feat: add pure ssh2 remote operations

This commit is contained in:
云服务部-叶林立
2026-08-21 19:51:43 +08:00
parent d3bf562189
commit 0ac50eb581
62 changed files with 3701 additions and 47 deletions
@@ -70,6 +70,34 @@ function assertNoPartialHashlineAnchors(text: string): void {
}
}
runTest("ssh_bash output uses Bash compaction while remote search output remains untouched", () => {
const config = cloneDefaultConfig();
const sshBash = compactToolResult(
{
toolName: "ssh_bash",
input: { command: "npm test" },
content: [{ type: "text", text: "\x1B[32mTests: 2 passed\x1B[0m\n" }],
},
config,
);
assert.equal(sshBash.changed, true);
assert.ok(sshBash.techniques.includes("ansi"));
assert.equal(firstTextBlock(sshBash.content).includes("\x1B"), false);
for (const toolName of ["ssh_find", "ssh_grep"]) {
const search = compactToolResult(
{
toolName,
input: { pattern: "TODO" },
content: [{ type: "text", text: "\x1B[31mremote result\x1B[0m\n" }],
},
config,
);
assert.equal(search.changed, false);
assert.deepEqual(search.techniques, []);
}
});
runTest("precision read with offset keeps exact output (no source/smart/hard truncation)", () => {
const config = cloneDefaultConfig();
setReadCompaction(config, true);