fix: issue with shell calls
This commit is contained in:
+1
-1
@@ -125,7 +125,7 @@ function buildCommonTools(ctx: ToolContext, outputSchema?: JsonSchema): Tool<any
|
|||||||
tools.push(SetOutputTool(ctx, outputSchema));
|
tools.push(SetOutputTool(ctx, outputSchema));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx.payload.shell === "restricted") {
|
if (ctx.payload.shell !== "disabled") {
|
||||||
tools.push(ShellTool(ctx));
|
tools.push(ShellTool(ctx));
|
||||||
tools.push(KillBackgroundTool(ctx));
|
tools.push(KillBackgroundTool(ctx));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ function getShellInstructions(
|
|||||||
case "restricted":
|
case "restricted":
|
||||||
return `### Shell commands\n\nUse the \`${t("shell")}\` MCP tool for all shell command execution. This tool provides a secure environment with filtered credentials. Do NOT use any native shell tool — it is disabled for security. For long-running processes, use \`shell({ command, background: true })\`. Use \`${t("kill_background")}\` to stop background processes.`;
|
return `### Shell commands\n\nUse the \`${t("shell")}\` MCP tool for all shell command execution. This tool provides a secure environment with filtered credentials. Do NOT use any native shell tool — it is disabled for security. For long-running processes, use \`shell({ command, background: true })\`. Use \`${t("kill_background")}\` to stop background processes.`;
|
||||||
case "enabled":
|
case "enabled":
|
||||||
return `### Shell commands\n\nUse your native shell tool for shell command execution.`;
|
return `### Shell commands\n\nUse the \`${t("shell")}\` MCP tool for all shell command execution (unrestricted environment, credentials available).`;
|
||||||
default: {
|
default: {
|
||||||
const _exhaustive: never = shell;
|
const _exhaustive: never = shell;
|
||||||
return _exhaustive satisfies never;
|
return _exhaustive satisfies never;
|
||||||
|
|||||||
Reference in New Issue
Block a user