<%*
// Configuration
const python = "/Users/samuelxiang/Library/Mobile Documents/iCloudmdobsidian/Documents/SamHigh/Scripts/AgentSkills/.venv/bin/python";
const script = "/Users/samuelxiang/Library/Mobile Documents/iCloudmdobsidian/Documents/SamHigh/Scripts/AgentSkills/obsidian_bridge.py";
const selection = tp.file.selection(); const name = await tp.system.prompt("Tool Name:"); if (!name) return;
const safeName = name.replace(/"/g, "\""); const safeCode = (selection || "").replace(/"/g, "\"");
const cmd = "${python}" "${script}" generate_tool_desc "${safeName}" "${safeCode}";
try { const result = await tp.user.run_cmd(cmd); tR += "\n" + result; } catch (e) { tR += "> [!error] " + e.message; }
%>