| 1 | import { describe, expect, it } from "vitest"; |
| 2 | import { TERMINAL_CLAUDE_SETTINGS, terminalCommand } from "../../src/agentic/runtimes.js"; |
| 3 | |
| 4 | describe("a task in a web terminal", () => { |
| 5 | it("runs the agent without web tools, and Claude Code without reading the sign-ins or the git credential", () => { |
| 6 | expect(terminalCommand("claude-code")).toContain('--disallowedTools "WebSearch,WebFetch"'); |
| 7 | expect(terminalCommand("claude-code")).toContain('--settings "$DIFFINERY_AGENT_SETTINGS"'); |
| 8 | expect(terminalCommand("codex")).toContain("-c web_search=disabled"); |
| 9 | const deny: string[] = JSON.parse(TERMINAL_CLAUDE_SETTINGS).permissions.deny; |
| 10 | for (const p of ["~/.claude/**", "~/.claude.json", "~/.codex/**", "~/.config/**", "//workspace/repo/.git/config"]) { |
| 11 | expect(deny).toContain(`Read(${p})`); |
| 12 | expect(deny).toContain(`Edit(${p})`); |
| 13 | } |
| 14 | }); |
| 15 | }); |