@bill10/agent-007 0.6.4001 → 0.6.5000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example CHANGED
@@ -46,9 +46,11 @@
46
46
  # runs anywhere, and every job-board worker gets a brand-new worktree. By default
47
47
  # the app accepts it for board workers (it adds the worktree to ~/.claude.json
48
48
  # before the spawn, and answers "Yes" if the dialog still appears), so queued
49
- # jobs start on their own. A trusted worktree loads that repo's own
50
- # .claude/settings.json: its hooks run, and its permission allow rules can
51
- # pre-approve what a strict board mode would ask about. 0/false/off/no keeps
52
- # the dialog.
49
+ # jobs start on their own. Codex asks the same, and its board workers are
50
+ # started with that one worktree trusted for the run (-c projects=...; nothing
51
+ # is written to ~/.codex/config.toml). A trusted worktree loads that repo's own
52
+ # .claude/settings.json, or Codex's project config, hooks and exec policies:
53
+ # its hooks run, and its permission allow rules can pre-approve what a strict
54
+ # board mode would ask about. 0/false/off/no keeps the dialog for both.
53
55
  # Hand-started agents always keep it.
54
56
  # TRUST_BOARD_WORKTREES=0
package/README.md CHANGED
@@ -54,7 +54,7 @@ Uncomment what you want, then restart. The ones people change:
54
54
  | `HOST=0.0.0.0` + `ALLOWED_ORIGINS=<tailnet name>` | Reach it from your phone or another machine (behind Tailscale only, see [docs/REMOTE.md](docs/REMOTE.md)) |
55
55
  | `CLAUDE_PERMISSION_MODE` | Mode Claude Code agents start in, e.g. `bypassPermissions` |
56
56
  | `CODEX_PERMISSION_MODE` | The same for Codex |
57
- | `TRUST_BOARD_WORKTREES=0` | Keeps Claude Code's folder-trust prompt for job board workers |
57
+ | `TRUST_BOARD_WORKTREES=0` | Keeps Claude Code's and Codex's folder-trust prompt for job board workers |
58
58
  | `PORT` | Port to listen on (default `7007`) |
59
59
 
60
60
  Highest wins: command-line flags (`--port`), then environment variables, then
@@ -121,7 +121,7 @@ ALLOWED_ORIGINS=mac-mini.tailXXXX.ts.net npm start # Allow a remote browser or
121
121
  | `AGENT_MESSAGING` | *(guarded)* | `open` lets any of your agents message any other. By default an agent that asks before acting cannot message one that never asks |
122
122
  | `BILLION` | *(on)* | `0` (or `false`/`off`/`no`) turns Billion off. It is also off whenever user accounts exist, since it would belong to everyone |
123
123
  | `BILLION_DIR` | `~/.agent-007/billion` | Billion's own folder and git repo. Point it at a new or empty folder |
124
- | `TRUST_BOARD_WORKTREES` | *(on)* | Board-dispatched Claude Code workers skip the workspace-trust dialog, so queued jobs start unattended. That also lets the repo's own `.claude/settings.json` hooks and permission allow rules apply without asking. `0` (or `false`/`off`/`no`) keeps the dialog. Hand-started agents always keep it |
124
+ | `TRUST_BOARD_WORKTREES` | *(on)* | Board-dispatched Claude Code and Codex workers skip the workspace-trust dialog, so queued jobs start unattended. That also lets the repo's own `.claude/settings.json` (or Codex project config, hooks and exec policies) apply without asking. `0` (or `false`/`off`/`no`) keeps the dialog. Hand-started agents always keep it |
125
125
 
126
126
  > **Running remotely?** The server spawns real shells, so never expose it to the
127
127
  > open internet. See [docs/REMOTE.md](docs/REMOTE.md) for the recommended
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.4.1
1
+ 0.6.5.0
package/bin/agent-007.js CHANGED
@@ -41,8 +41,8 @@ Settings (default in brackets):
41
41
  AGENT_MESSAGING open = any agent may message any other [guarded]
42
42
  BILLION 0 turns off Billion, the always-on agent [on]
43
43
  BILLION_DIR Billion's folder and repo [~/.agent-007/billion]
44
- TRUST_BOARD_WORKTREES 0 keeps Claude Code's folder-trust prompt for job
45
- board workers [on]
44
+ TRUST_BOARD_WORKTREES 0 keeps Claude Code's and Codex's folder-trust
45
+ prompt for job board workers [on]
46
46
 
47
47
  Set them in the environment, in ~/.agent-007/.env (\`agent-007 init\` writes it,
48
48
  every setting explained and commented out), or in a .env in the current
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bill10/agent-007",
3
- "version": "0.6.4001",
3
+ "version": "0.6.5000",
4
4
  "description": "From web terminals for your coding agents to a self-running agent company: Claude Code and Codex in parallel git worktrees, a job board they pick work from, and one agent that runs the board from a goal.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -18,14 +18,26 @@ import { join } from 'path';
18
18
  import { sessionAgentFromCommand } from '../lib/jobs.js';
19
19
  import { envSwitchOn } from '../lib/helpers.js';
20
20
 
21
- // Board-dispatched Claude Code workers only, and on unless
21
+ // Board-dispatched Claude Code and Codex workers only, and on unless
22
22
  // TRUST_BOARD_WORKTREES says otherwise (0/false/off/no). Hand-started agents
23
23
  // keep the dialog.
24
24
  export function autoTrusts({ spawnedBy, worktreePath, command }, env = process.env) {
25
- return spawnedBy === 'board' && !!worktreePath && sessionAgentFromCommand(command) === 'claude'
25
+ return spawnedBy === 'board' && !!worktreePath && ['claude', 'codex'].includes(sessionAgentFromCommand(command))
26
26
  && envSwitchOn(env.TRUST_BOARD_WORKTREES);
27
27
  }
28
28
 
29
+ // Codex asks "Do you trust the contents of this directory?" in a new worktree
30
+ // too, and records the answer as [projects."<path>"] trust_level in
31
+ // ~/.codex/config.toml. A -c override does the same for this one run and
32
+ // writes nothing: an inline table merges with the user's own [projects]
33
+ // (verified against codex-cli 0.154), and unlike a dotted key it survives the
34
+ // dot in ~/.agent-007. A JSON string is a valid TOML basic string.
35
+ export function codexTrustArgs(folder) {
36
+ let path = folder;
37
+ try { path = realpathSync(folder); } catch {}
38
+ return ['-c', `projects={${JSON.stringify(path)}={trust_level="trusted"}}`];
39
+ }
40
+
29
41
  const isRecord = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
30
42
 
31
43
  // True when the entry is there afterwards. Never throws. Workers inherit the
package/server/pty.js CHANGED
@@ -14,6 +14,7 @@ import { broadcastJobs } from './jobs.js';
14
14
  import { flushMessages, dropMessages } from './messages.js';
15
15
  import { sessionAgentFromCommand, permissionFlagsFromCommand } from '../lib/jobs.js';
16
16
  import { trustDialogKey } from './billion.js';
17
+ import { codexTrustArgs } from './claude-trust.js';
17
18
  import { dropApprovals } from './approvals.js';
18
19
 
19
20
  // Regex constants for output filtering (shared, not recreated per event)
@@ -234,7 +235,8 @@ export function createSessionFromConfig({ sessionId, name, color, command, repoP
234
235
  // would put a live board credential on disk for terminals that have no way to
235
236
  // use it — a plain `bash` tab does not need one.
236
237
  const mcpConfigPath = takesMcpConfig(file) ? writeMcpConfig(sessionId, agentToken) : null;
237
- const mcpArgs = withMcpConfig(file, args, mcpConfigPath);
238
+ const codexTrust = autoTrust && sessionAgentFromCommand(command) === 'codex';
239
+ const mcpArgs = withMcpConfig(file, codexTrust ? [...codexTrustArgs(worktreePath), ...args] : args, mcpConfigPath);
238
240
  // A worker on one of Billion's cards asks Billion before it asks a person
239
241
  // (server/approvals.js) — where the CLI can be hooked, which today is
240
242
  // Claude Code only. Recorded as whether the hook actually went in.
@@ -308,7 +310,7 @@ export function createSessionFromConfig({ sessionId, name, color, command, repoP
308
310
  spawnedBy: spawnedBy || 'user',
309
311
  jobId: jobId || null, // job this session was dispatched for, if any
310
312
  isBillion: !!isBillion, // the one agent you talk to (server/billion.js)
311
- answersTrust: !!(isBillion || autoTrust), // see answerTrustDialog
313
+ answersTrust: !!(isBillion || (autoTrust && !codexTrust)), // see answerTrustDialog; Codex's flag leaves nothing to answer
312
314
  approvalsToBillion: hooked, // its permission dialogs go to Billion first
313
315
  exited: false,
314
316
  stateCheckInterval: null,
package/server.js CHANGED
@@ -32,7 +32,7 @@ import { setupRoutes } from './server/http.js';
32
32
  import { startDispatcher, stopDispatcher, boardSettings } from './server/jobs.js';
33
33
  import { orphans, config } from './server/state.js';
34
34
  import { sweepMcpConfigs } from './server/agent-mcp.js';
35
- import { withDefaultPermission, envPermissionMode, PERMISSION_MODES, ENV_PERMISSION_MODE } from './lib/jobs.js';
35
+ import { withDefaultPermission, envPermissionMode, PERMISSION_MODES, ENV_PERMISSION_MODE, sessionAgentFromCommand } from './lib/jobs.js';
36
36
  import { BILLION_NAME, billionEnabled, billionRuns, billionDir, ensureBillionRepo, refreshCharter, suggestProjectsDir, billionCommand, noClaudeCommand } from './server/billion.js';
37
37
  import { commandExists, missingCommandMessage } from './server/command-path.js';
38
38
  import { parseCommand } from './lib/helpers.js';
@@ -100,8 +100,9 @@ async function createSession(command, name, repoPath, customBranch, ownerId, met
100
100
 
101
101
  // A board worker's worktree is brand new, so Claude Code would stop at its
102
102
  // workspace-trust dialog until someone clicked (server/claude-trust.js).
103
+ // Codex's is skipped by a flag instead (server/pty.js).
103
104
  const autoTrust = autoTrusts({ spawnedBy: meta.spawnedBy, worktreePath, command });
104
- if (autoTrust) trustClaudeFolder(worktreePath);
105
+ if (autoTrust && sessionAgentFromCommand(command) === 'claude') trustClaudeFolder(worktreePath);
105
106
 
106
107
  const result = createSessionFromConfig({
107
108
  sessionId, name: agentName, color, command,