feat: add secure envsitter dotenv operations

Expose validate/copy/format/annotate tools with dry-run by default, and switch is_equal matching to candidate hashing. Remove prompt-append warning to avoid writing into OpenCode input.
This commit is contained in:
David Ibia
2026-01-13 19:28:39 +01:00
parent abe3467f37
commit fa23dd07f8
6 changed files with 398 additions and 30 deletions

View File

@@ -19,12 +19,11 @@ function createClientSpy(): {
client: {
tui: {
showToast: (input: { body: { title: string; variant: string; message: string } }) => Promise<void>;
appendPrompt: (input: { body: { text: string } }) => Promise<void>;
};
};
calls: { showToast: number; appendPrompt: number };
calls: { showToast: number };
} {
const calls = { showToast: 0, appendPrompt: 0 };
const calls = { showToast: 0 };
return {
calls,
@@ -33,9 +32,6 @@ function createClientSpy(): {
async showToast() {
calls.showToast += 1;
},
async appendPrompt() {
calls.appendPrompt += 1;
},
},
},
};
@@ -117,5 +113,4 @@ test("toasts are throttled", async () => {
await assert.rejects(() => hook({ tool: "read", sessionID: "s", callID: "c" }, { args: { filePath: ".env" } }));
assert.equal(calls.showToast, 1);
assert.equal(calls.appendPrompt, 1);
});