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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user