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:
@@ -318,6 +318,10 @@ await runTest("session_start refreshes RTK provenance and runtime guard skips mi
|
||||
|
||||
assert.equal(rewriteCalls, 1);
|
||||
assert.ok((rewrittenEvent.input as { command: string }).command.includes("rtk git status"));
|
||||
const remoteEvent = { toolName: "ssh_bash", input: { command: "git status" } };
|
||||
await toolCallHandler(remoteEvent, createNotificationContext(notifications));
|
||||
assert.equal(remoteEvent.input.command, "git status");
|
||||
assert.equal(rewriteCalls, 1, "ssh_bash output support must not enable remote command rewriting");
|
||||
assert.ok(execCommands.includes("/opt/rtk/bin/rtk"));
|
||||
writeTestConfig(false);
|
||||
});
|
||||
@@ -367,6 +371,26 @@ await runTest("tool execution lifecycle sanitizes streamed bash output", async (
|
||||
};
|
||||
await endHandler(endEvent, {});
|
||||
assert.equal(firstText(endEvent.result.content), "error: build failed\n");
|
||||
|
||||
await startHandler(
|
||||
{ toolName: "ssh_bash", toolCallId: "ssh-bash-1", args: { command: "npm test" } },
|
||||
{},
|
||||
);
|
||||
const remoteUpdate = {
|
||||
toolName: "ssh_bash",
|
||||
toolCallId: "ssh-bash-1",
|
||||
args: { command: "npm test" },
|
||||
partialResult: { content: [{ type: "text", text: "\x1B[32mremote test\x1B[0m\n" }] },
|
||||
};
|
||||
await updateHandler(remoteUpdate, {});
|
||||
assert.equal(firstText(remoteUpdate.partialResult.content), "remote test\n");
|
||||
const remoteEnd = {
|
||||
toolName: "ssh_bash",
|
||||
toolCallId: "ssh-bash-1",
|
||||
result: { content: [{ type: "text", text: "\x1B[31mremote failed\x1B[0m\n" }] },
|
||||
};
|
||||
await endHandler(remoteEnd, {});
|
||||
assert.equal(firstText(remoteEnd.result.content), "remote failed\n");
|
||||
});
|
||||
|
||||
await runTest("tool_result lifecycle merges compaction metadata with existing details", async () => {
|
||||
|
||||
Reference in New Issue
Block a user