mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 08:35:57 +00:00
feat: add pure ssh2 remote operations
This commit is contained in:
@@ -120,6 +120,36 @@ describe("describeToolGate", () => {
|
||||
expect(desc.payload.request.invokedToolName).toBe("exec_command");
|
||||
});
|
||||
|
||||
it("records a shell alias formatter preview for review and authorization context", () => {
|
||||
const shell: ShellInvocation = { command: "rm -rf dist", workdir: undefined };
|
||||
const formatter = new ToolPreviewFormatter(
|
||||
{
|
||||
toolInputPreviewMaxLength: TOOL_INPUT_PREVIEW_MAX_LENGTH,
|
||||
toolTextSummaryMaxLength: TOOL_TEXT_SUMMARY_MAX_LENGTH,
|
||||
},
|
||||
{
|
||||
get: (name) =>
|
||||
name === "ssh_bash"
|
||||
? () => "SSH target 'packaging-server' in remote cwd '/srv/build'"
|
||||
: undefined,
|
||||
},
|
||||
);
|
||||
const desc = describeToolGate(
|
||||
makeTcc({ toolName: "ssh_bash", input: { command: "rm -rf dist" } }),
|
||||
makeCheckResult("ask", { toolName: "bash", source: "bash", command: "rm -rf dist" }),
|
||||
formatter,
|
||||
undefined,
|
||||
shell,
|
||||
);
|
||||
|
||||
expect(desc.promptDetails.toolInputPreview).toBe(
|
||||
"SSH target 'packaging-server' in remote cwd '/srv/build'",
|
||||
);
|
||||
expect(desc.logContext.toolInputPreview).toBe(
|
||||
"SSH target 'packaging-server' in remote cwd '/srv/build'",
|
||||
);
|
||||
});
|
||||
|
||||
it("returns mcp surface with target in decision.value for MCP tools", () => {
|
||||
const check = makeCheckResult("ask", {
|
||||
toolName: "mcp",
|
||||
|
||||
Reference in New Issue
Block a user