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
@@ -47,7 +47,7 @@ export function buildToolAskPayload(facts: ToolAskFacts): PromptPayload {
executedUnit: check.executedUnit ?? null,
},
evidence: bash
? fullCommandEvidence(facts)
? [...fullCommandEvidence(facts), ...invokedShellInputPreviewEvidence(facts)]
: inputPreviewEvidence(facts, mcp),
annotations: [],
};
@@ -86,6 +86,14 @@ function fullCommandEvidence(facts: ToolAskFacts): PromptEvidence[] {
return [{ label: "full command", text: fullCommand, detail: null }];
}
/** Extra context supplied by the concrete tool that exposes shell semantics. */
function invokedShellInputPreviewEvidence(facts: ToolAskFacts): PromptEvidence[] {
const invokedToolName = distinctInvokedName(facts);
if (invokedToolName === null) return [];
const preview = facts.formatter?.formatToolInputForPrompt(invokedToolName, facts.input);
return preview ? [{ label: "input", text: preview, detail: null }] : [];
}
/**
* The per-tool input preview, when a formatter is registered and produces one.
*