chore: soft deprecate unlink and link (#239)

This commit is contained in:
Kian Jones
2025-12-16 14:52:28 -05:00
committed by GitHub
parent f5110dd21e
commit 34eb87b014
2 changed files with 106 additions and 0 deletions

View File

@@ -2026,6 +2026,96 @@ export default function App({
return { submitted: true };
}
// Special handling for /link command - attach all Letta Code tools (deprecated)
if (msg.trim() === "/link" || msg.trim().startsWith("/link ")) {
const cmdId = uid("cmd");
buffersRef.current.byId.set(cmdId, {
kind: "command",
id: cmdId,
input: msg,
output: "Attaching Letta Code tools...",
phase: "running",
});
buffersRef.current.order.push(cmdId);
refreshDerived();
setCommandRunning(true);
try {
const { linkToolsToAgent } = await import("../agent/modify");
const result = await linkToolsToAgent(agentId);
buffersRef.current.byId.set(cmdId, {
kind: "command",
id: cmdId,
input: msg,
output: result.message,
phase: "finished",
success: result.success,
});
refreshDerived();
} catch (error) {
const errorDetails = formatErrorDetails(error, agentId);
buffersRef.current.byId.set(cmdId, {
kind: "command",
id: cmdId,
input: msg,
output: `Failed to link tools: ${errorDetails}`,
phase: "finished",
success: false,
});
refreshDerived();
} finally {
setCommandRunning(false);
}
return { submitted: true };
}
// Special handling for /unlink command - remove all Letta Code tools (deprecated)
if (msg.trim() === "/unlink" || msg.trim().startsWith("/unlink ")) {
const cmdId = uid("cmd");
buffersRef.current.byId.set(cmdId, {
kind: "command",
id: cmdId,
input: msg,
output: "Removing Letta Code tools...",
phase: "running",
});
buffersRef.current.order.push(cmdId);
refreshDerived();
setCommandRunning(true);
try {
const { unlinkToolsFromAgent } = await import("../agent/modify");
const result = await unlinkToolsFromAgent(agentId);
buffersRef.current.byId.set(cmdId, {
kind: "command",
id: cmdId,
input: msg,
output: result.message,
phase: "finished",
success: result.success,
});
refreshDerived();
} catch (error) {
const errorDetails = formatErrorDetails(error, agentId);
buffersRef.current.byId.set(cmdId, {
kind: "command",
id: cmdId,
input: msg,
output: `Failed to unlink tools: ${errorDetails}`,
phase: "finished",
success: false,
});
refreshDerived();
} finally {
setCommandRunning(false);
}
return { submitted: true };
}
// Special handling for /bg command - show background shell processes
if (msg.trim() === "/bg") {
const { backgroundProcesses } = await import(

View File

@@ -59,6 +59,22 @@ export const commands: Record<string, Command> = {
return "Updating description...";
},
},
"/link": {
desc: "Attach all Letta Code tools to agent (deprecated, use /toolset instead)",
hidden: true,
handler: () => {
// Handled specially in App.tsx to access agent ID and client
return "Linking tools...";
},
},
"/unlink": {
desc: "Remove all Letta Code tools from agent (deprecated, use /toolset instead)",
hidden: true,
handler: () => {
// Handled specially in App.tsx to access agent ID and client
return "Unlinking tools...";
},
},
"/toolset": {
desc: "Switch toolset (replaces /link and /unlink)",
handler: () => {