Diffinery

homeflare/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

diffinery/apps/diffinery/test/unit/terminal-command.test.ts
15 lines · 874 BRaw History
1import { describe, expect, it } from "vitest";
2import { TERMINAL_CLAUDE_SETTINGS, terminalCommand } from "../../src/agentic/runtimes.js";
3
4describe("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});