@tokenfactory/acc-runner 0.25.0 → 0.27.0
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/README.md +77 -4
- package/package.json +1 -1
- package/dist/anthropic-auth.d.ts +0 -53
- package/dist/anthropic-auth.d.ts.map +0 -1
- package/dist/anthropic-auth.js +0 -89
- package/dist/anthropic-auth.js.map +0 -1
- package/dist/bin-resolve.d.ts +0 -16
- package/dist/bin-resolve.d.ts.map +0 -1
- package/dist/bin-resolve.js +0 -35
- package/dist/bin-resolve.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -128
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts +0 -121
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -396
- package/dist/config.js.map +0 -1
- package/dist/cost-pricing.d.ts +0 -130
- package/dist/cost-pricing.d.ts.map +0 -1
- package/dist/cost-pricing.js +0 -191
- package/dist/cost-pricing.js.map +0 -1
- package/dist/doctor.d.ts +0 -37
- package/dist/doctor.d.ts.map +0 -1
- package/dist/doctor.js +0 -658
- package/dist/doctor.js.map +0 -1
- package/dist/failure-classifier.d.ts +0 -112
- package/dist/failure-classifier.d.ts.map +0 -1
- package/dist/failure-classifier.js +0 -353
- package/dist/failure-classifier.js.map +0 -1
- package/dist/gh.d.ts +0 -22
- package/dist/gh.d.ts.map +0 -1
- package/dist/gh.js +0 -48
- package/dist/gh.js.map +0 -1
- package/dist/git.d.ts +0 -50
- package/dist/git.d.ts.map +0 -1
- package/dist/git.js +0 -127
- package/dist/git.js.map +0 -1
- package/dist/github-client.d.ts +0 -133
- package/dist/github-client.d.ts.map +0 -1
- package/dist/github-client.js +0 -234
- package/dist/github-client.js.map +0 -1
- package/dist/keychain.d.ts +0 -21
- package/dist/keychain.d.ts.map +0 -1
- package/dist/keychain.js +0 -45
- package/dist/keychain.js.map +0 -1
- package/dist/login.d.ts +0 -12
- package/dist/login.d.ts.map +0 -1
- package/dist/login.js +0 -133
- package/dist/login.js.map +0 -1
- package/dist/logout.d.ts +0 -2
- package/dist/logout.d.ts.map +0 -1
- package/dist/logout.js +0 -31
- package/dist/logout.js.map +0 -1
- package/dist/mcp-spawn.d.ts +0 -30
- package/dist/mcp-spawn.d.ts.map +0 -1
- package/dist/mcp-spawn.js +0 -145
- package/dist/mcp-spawn.js.map +0 -1
- package/dist/messaging.d.ts +0 -49
- package/dist/messaging.d.ts.map +0 -1
- package/dist/messaging.js +0 -36
- package/dist/messaging.js.map +0 -1
- package/dist/pkg-version.d.ts +0 -3
- package/dist/pkg-version.d.ts.map +0 -1
- package/dist/pkg-version.js +0 -20
- package/dist/pkg-version.js.map +0 -1
- package/dist/profiles/designer-prompt.d.ts +0 -18
- package/dist/profiles/designer-prompt.d.ts.map +0 -1
- package/dist/profiles/designer-prompt.js +0 -172
- package/dist/profiles/designer-prompt.js.map +0 -1
- package/dist/profiles/developer-prompt.d.ts +0 -24
- package/dist/profiles/developer-prompt.d.ts.map +0 -1
- package/dist/profiles/developer-prompt.js +0 -24
- package/dist/profiles/developer-prompt.js.map +0 -1
- package/dist/profiles/manager-prompt.d.ts +0 -34
- package/dist/profiles/manager-prompt.d.ts.map +0 -1
- package/dist/profiles/manager-prompt.js +0 -93
- package/dist/profiles/manager-prompt.js.map +0 -1
- package/dist/profiles/tester-prompt.d.ts +0 -28
- package/dist/profiles/tester-prompt.d.ts.map +0 -1
- package/dist/profiles/tester-prompt.js +0 -165
- package/dist/profiles/tester-prompt.js.map +0 -1
- package/dist/prompt.d.ts +0 -38
- package/dist/prompt.d.ts.map +0 -1
- package/dist/prompt.js +0 -78
- package/dist/prompt.js.map +0 -1
- package/dist/runtime/cache-dir.d.ts +0 -2
- package/dist/runtime/cache-dir.d.ts.map +0 -1
- package/dist/runtime/cache-dir.js +0 -15
- package/dist/runtime/cache-dir.js.map +0 -1
- package/dist/runtime/conflict-resolver.d.ts +0 -65
- package/dist/runtime/conflict-resolver.d.ts.map +0 -1
- package/dist/runtime/conflict-resolver.js +0 -477
- package/dist/runtime/conflict-resolver.js.map +0 -1
- package/dist/runtime/expand-args.d.ts +0 -28
- package/dist/runtime/expand-args.d.ts.map +0 -1
- package/dist/runtime/expand-args.js +0 -50
- package/dist/runtime/expand-args.js.map +0 -1
- package/dist/runtime/locks.d.ts +0 -21
- package/dist/runtime/locks.d.ts.map +0 -1
- package/dist/runtime/locks.js +0 -97
- package/dist/runtime/locks.js.map +0 -1
- package/dist/runtime/provision-mutex.d.ts +0 -37
- package/dist/runtime/provision-mutex.d.ts.map +0 -1
- package/dist/runtime/provision-mutex.js +0 -67
- package/dist/runtime/provision-mutex.js.map +0 -1
- package/dist/runtime/quarantine.d.ts +0 -26
- package/dist/runtime/quarantine.d.ts.map +0 -1
- package/dist/runtime/quarantine.js +0 -50
- package/dist/runtime/quarantine.js.map +0 -1
- package/dist/runtime/resolution-integrity.d.ts +0 -86
- package/dist/runtime/resolution-integrity.d.ts.map +0 -1
- package/dist/runtime/resolution-integrity.js +0 -248
- package/dist/runtime/resolution-integrity.js.map +0 -1
- package/dist/runtime/reviewer.d.ts +0 -81
- package/dist/runtime/reviewer.d.ts.map +0 -1
- package/dist/runtime/reviewer.js +0 -374
- package/dist/runtime/reviewer.js.map +0 -1
- package/dist/runtime/rework.d.ts +0 -48
- package/dist/runtime/rework.d.ts.map +0 -1
- package/dist/runtime/rework.js +0 -136
- package/dist/runtime/rework.js.map +0 -1
- package/dist/runtime/singleton.d.ts +0 -47
- package/dist/runtime/singleton.d.ts.map +0 -1
- package/dist/runtime/singleton.js +0 -200
- package/dist/runtime/singleton.js.map +0 -1
- package/dist/runtime/version-drift.d.ts +0 -31
- package/dist/runtime/version-drift.d.ts.map +0 -1
- package/dist/runtime/version-drift.js +0 -114
- package/dist/runtime/version-drift.js.map +0 -1
- package/dist/runtime/worktree.d.ts +0 -74
- package/dist/runtime/worktree.d.ts.map +0 -1
- package/dist/runtime/worktree.js +0 -206
- package/dist/runtime/worktree.js.map +0 -1
- package/dist/secrets/inject.d.ts +0 -70
- package/dist/secrets/inject.d.ts.map +0 -1
- package/dist/secrets/inject.js +0 -102
- package/dist/secrets/inject.js.map +0 -1
- package/dist/supabase.d.ts +0 -4
- package/dist/supabase.d.ts.map +0 -1
- package/dist/supabase.js +0 -36
- package/dist/supabase.js.map +0 -1
- package/dist/task-runner.d.ts +0 -313
- package/dist/task-runner.d.ts.map +0 -1
- package/dist/task-runner.js +0 -1766
- package/dist/task-runner.js.map +0 -1
- package/dist/token-provider.d.ts +0 -50
- package/dist/token-provider.d.ts.map +0 -1
- package/dist/token-provider.js +0 -177
- package/dist/token-provider.js.map +0 -1
- package/dist/types.d.ts +0 -120
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -16
- package/dist/types.js.map +0 -1
- package/dist/version-check.d.ts +0 -17
- package/dist/version-check.d.ts.map +0 -1
- package/dist/version-check.js +0 -56
- package/dist/version-check.js.map +0 -1
- package/dist/watch.d.ts +0 -295
- package/dist/watch.d.ts.map +0 -1
- package/dist/watch.js +0 -1532
- package/dist/watch.js.map +0 -1
package/README.md
CHANGED
|
@@ -46,6 +46,12 @@ location, or declare capabilities.
|
|
|
46
46
|
| `ACC_INTEGRATION_BRANCH` | `acc/integration` | Base branch for new PRs. A task's `integration_branch` wins. |
|
|
47
47
|
| `ACC_RUNNER_CAPABILITIES` | _(unset)_ | Comma-separated tags, e.g. `code,docs`. See "Capabilities" below. |
|
|
48
48
|
| `ACC_RUNNER_PROFILE` | _(unset)_ | Profile slug (`developer`, `designer`, `tester`, `manager`). |
|
|
49
|
+
| `ACC_RUNNER_TOKEN_MODE` | `keychain` | `env` sources credentials from env vars instead of the OS keychain. See "Ephemeral runners" below. |
|
|
50
|
+
| `ACC_RUNNER_ACCESS_TOKEN` | _(unset)_ | Required when `ACC_RUNNER_TOKEN_MODE=env`. The Supabase JWT minted by the device-code exchange or autoscale provider. |
|
|
51
|
+
| `ACC_RUNNER_REFRESH_TOKEN`| _(unset)_ | Optional. Enables in-process token rotation in `env` mode; rotated successors stay in memory only. |
|
|
52
|
+
| `ACC_RUNNER_ID` | minted `acc-eph-<hex8>` | Optional pre-assigned runner id (`env` mode). The `acc-eph-` prefix marks the ephemeral fleet — don't reuse it for desktop runners. Also keys the singleton lock and (when no `ACC_RUNNER_CACHE_DIR`) namespaces the cache dir, so distinct ids coexist on one host. |
|
|
53
|
+
| `ACC_RUNNER_CACHE_DIR` | `~/.cache/acc-runner` (or `…/runners/<ACC_RUNNER_ID>`) | Cache root for locks, worktrees, quarantine, and the singleton lock. When unset and `ACC_RUNNER_ID` is set, defaults to a per-identity subdir. Set explicitly to override. |
|
|
54
|
+
| `ACC_RUNNER_CONCURRENCY` | `2` | Max tasks this runner processes simultaneously. Parsed with `Number.parseInt`, clamped to `1..50`, falls back to `2` on non-numeric input. Each slot is a live Claude session **plus** a git worktree, so high values are only viable on **API-key** runners on high-resource hosts. On a **Claude subscription** they will `429`. The serial integration-merge queue still caps end-to-end throughput, so real-world gains plateau around **~2–2.5×** regardless of how high this is set. |
|
|
49
55
|
|
|
50
56
|
### `~/.config/acc-runner/config.json`
|
|
51
57
|
|
|
@@ -127,6 +133,71 @@ abort CLI startup with a clear error rather than failing at task
|
|
|
127
133
|
pickup. Env vars and config.json `capabilities` still override the
|
|
128
134
|
profile's defaults when both are set.
|
|
129
135
|
|
|
136
|
+
### Ephemeral runners (env-token mode)
|
|
137
|
+
|
|
138
|
+
Desktop runners read their session from the OS keychain (the default,
|
|
139
|
+
`ACC_RUNNER_TOKEN_MODE=keychain`). Containerized / autoscaled runners have
|
|
140
|
+
no keychain, so set `ACC_RUNNER_TOKEN_MODE=env` and source the session from
|
|
141
|
+
environment variables instead:
|
|
142
|
+
|
|
143
|
+
```sh
|
|
144
|
+
export ACC_RUNNER_TOKEN_MODE=env
|
|
145
|
+
export ACC_RUNNER_ACCESS_TOKEN=<jwt-from-device-code-exchange>
|
|
146
|
+
export ACC_RUNNER_REFRESH_TOKEN=<refresh-token> # optional; enables rotation
|
|
147
|
+
export ACC_RUNNER_ID=acc-eph-1a2b3c4d # optional; minted if unset
|
|
148
|
+
acc-runner doctor # validates the env-token config (see below)
|
|
149
|
+
acc-runner watch
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
- `ACC_RUNNER_ACCESS_TOKEN` is required. `user_id` / `email` / expiry are
|
|
153
|
+
decoded from the JWT — no extra env needed. A missing or undecodable
|
|
154
|
+
token fails `doctor` and aborts `watch` at startup, not on the first RPC.
|
|
155
|
+
- `ACC_RUNNER_REFRESH_TOKEN` is optional. With it, the runner rotates the
|
|
156
|
+
access token in process memory (never written to disk). Without it, the
|
|
157
|
+
runner simply exits when the access token expires — fine for an
|
|
158
|
+
idle-TTL-bounded ephemeral runner. Provision a **fresh** access/refresh
|
|
159
|
+
pair per container: replaying a previously-rotated refresh token trips
|
|
160
|
+
the server's reuse detection and revokes the chain.
|
|
161
|
+
- `ACC_RUNNER_ID` lets the orchestrator pre-assign a stable id. When unset,
|
|
162
|
+
the runner mints one `acc-eph-<hex8>` per process; the `acc-eph-` prefix
|
|
163
|
+
is the autoscale sweep's ephemeral-fleet discriminator.
|
|
164
|
+
|
|
165
|
+
`acc-runner doctor` adds an **env-token config** check in this mode: it
|
|
166
|
+
confirms the access token is present and decodable, then reports the
|
|
167
|
+
resolved runner id (and whether it came from `ACC_RUNNER_ID` or was
|
|
168
|
+
minted), whether refresh is wired, and the access-token expiry. The check
|
|
169
|
+
is a silent no-op for keychain runners.
|
|
170
|
+
|
|
171
|
+
### Running multiple runners on one host
|
|
172
|
+
|
|
173
|
+
Each runner keeps its locks, per-task worktrees, quarantine sentinel, and
|
|
174
|
+
single-instance lock under a cache root that defaults to
|
|
175
|
+
`~/.cache/acc-runner`. As of v1.02-A, giving each co-located runner a
|
|
176
|
+
**distinct `ACC_RUNNER_ID`** is enough to run them concurrently on one host:
|
|
177
|
+
|
|
178
|
+
```sh
|
|
179
|
+
ACC_RUNNER_ID=acc-eph-aaaa0001 acc-runner watch &
|
|
180
|
+
ACC_RUNNER_ID=acc-eph-bbbb0002 acc-runner watch &
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The single-instance lock is keyed by **(repo path + runner id)**, so two
|
|
184
|
+
distinct ids serving the same repo each acquire their own lock and coexist;
|
|
185
|
+
only a true duplicate — same repo, *same* identity — is refused. With no
|
|
186
|
+
explicit `ACC_RUNNER_CACHE_DIR`, each id also gets its own cache subdir
|
|
187
|
+
(`~/.cache/acc-runner/runners/<id>`), so their locks, worktrees, and
|
|
188
|
+
quarantine state never collide. You can still pin an explicit
|
|
189
|
+
`ACC_RUNNER_CACHE_DIR` per runner if you want the cache somewhere specific:
|
|
190
|
+
|
|
191
|
+
```sh
|
|
192
|
+
ACC_RUNNER_ID=acc-eph-aaaa0001 ACC_RUNNER_CACHE_DIR=/var/run/acc/a acc-runner watch &
|
|
193
|
+
ACC_RUNNER_ID=acc-eph-bbbb0002 ACC_RUNNER_CACHE_DIR=/var/run/acc/b acc-runner watch &
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Two runners with the *same* identity (or both with no `ACC_RUNNER_ID`)
|
|
197
|
+
serving the same repo are still caught by the singleton lock. `acc-runner
|
|
198
|
+
doctor` prints the resolved token mode and cache dir in its **Runtime**
|
|
199
|
+
block, and names the holding identity if a duplicate is detected.
|
|
200
|
+
|
|
130
201
|
### `PATH` under launchd
|
|
131
202
|
|
|
132
203
|
`launchd` resets `PATH` to `/usr/bin:/bin:/usr/sbin:/sbin`, which omits
|
|
@@ -176,10 +247,12 @@ broadcasts (sends `SIGTERM` to the in-flight `claude` child).
|
|
|
176
247
|
|
|
177
248
|
### `acc-runner doctor`
|
|
178
249
|
|
|
179
|
-
Runs every environment check (binaries, keychain access,
|
|
180
|
-
reachability, repo path, orphan worktrees) and prints a green/red
|
|
181
|
-
|
|
182
|
-
|
|
250
|
+
Runs every environment check (binaries, keychain access, env-token config,
|
|
251
|
+
Supabase reachability, repo path, orphan worktrees) and prints a green/red
|
|
252
|
+
list, preceded by the resolved **Config** and **Runtime** (token mode +
|
|
253
|
+
cache dir) blocks. Exits 0 if all pass, 1 otherwise. A single check that
|
|
254
|
+
throws is reported as one `[FAIL]` row rather than crashing the run.
|
|
255
|
+
Suitable for CI and for diagnosing a silent failure mode after install.
|
|
183
256
|
|
|
184
257
|
### `acc-runner version`
|
|
185
258
|
|
package/package.json
CHANGED
package/dist/anthropic-auth.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v0.74-B (T-1780800000740201): centralised resolution of how the spawned
|
|
3
|
-
* `claude` CLI authenticates with Anthropic.
|
|
4
|
-
*
|
|
5
|
-
* Claude Code authenticates *strictly* via the `ANTHROPIC_API_KEY`
|
|
6
|
-
* environment variable (or an apiKeyHelper) — it has no `--api-key` flag;
|
|
7
|
-
* passing one fails with `error: unknown option '--api-key'`. So "passing
|
|
8
|
-
* the API key to claude" means making sure the variable is present in the
|
|
9
|
-
* spawned subprocess's environment.
|
|
10
|
-
*
|
|
11
|
-
* When ANTHROPIC_API_KEY is set the CLI bills against the API account, which
|
|
12
|
-
* has no per-session usage cap. When it is absent the CLI falls back to the
|
|
13
|
-
* operator's interactive OAuth session, which is subject to the 429 session
|
|
14
|
-
* caps this change exists to avoid.
|
|
15
|
-
*/
|
|
16
|
-
export type AnthropicAuthMode = "api-key" | "interactive-session";
|
|
17
|
-
/** Trimmed ANTHROPIC_API_KEY from `env`, or "" when unset/blank. */
|
|
18
|
-
export declare function anthropicApiKey(env?: NodeJS.ProcessEnv): string;
|
|
19
|
-
/**
|
|
20
|
-
* v0.76-A (GA-11): opt-in claude-config isolation. Even with ANTHROPIC_API_KEY
|
|
21
|
-
* set, the Claude CLI prefers a stored claude.ai OAuth login when one exists —
|
|
22
|
-
* the observed cause of 429 session caps on a key-configured runner. Pointing
|
|
23
|
-
* the spawned claude at an isolated CLAUDE_CONFIG_DIR (no stored login) leaves
|
|
24
|
-
* the env key as the only credential, forcing API-key auth. Opt-in via
|
|
25
|
-
* ACC_RUNNER_ISOLATE_CLAUDE_CONFIG because the behaviour needs live-runner
|
|
26
|
-
* validation before becoming default.
|
|
27
|
-
*/
|
|
28
|
-
export declare function claudeConfigIsolationEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
29
|
-
/** Runner-owned claude config dir used when isolation is enabled. */
|
|
30
|
-
export declare function isolatedClaudeConfigDir(env?: NodeJS.ProcessEnv): string;
|
|
31
|
-
/**
|
|
32
|
-
* `"api-key"` when ANTHROPIC_API_KEY is set (non-blank), else
|
|
33
|
-
* `"interactive-session"`.
|
|
34
|
-
*/
|
|
35
|
-
export declare function resolveAuthMode(env?: NodeJS.ProcessEnv): AnthropicAuthMode;
|
|
36
|
-
/**
|
|
37
|
-
* Returns `base` with ANTHROPIC_API_KEY explicitly forwarded (trimmed) when
|
|
38
|
-
* set, so every claude spawn site authenticates identically regardless of how
|
|
39
|
-
* `base` was assembled. A passthrough of `base` when the key is absent — the
|
|
40
|
-
* CLI then uses the operator's interactive OAuth session.
|
|
41
|
-
*/
|
|
42
|
-
export declare function withAnthropicAuth(base?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
43
|
-
/** One-line, human-readable description of an auth mode for banners/checks. */
|
|
44
|
-
export declare function describeAuthMode(mode: AnthropicAuthMode): string;
|
|
45
|
-
/**
|
|
46
|
-
* v0.76-A (GA-11): precedence hint for the banner / doctor. Returns null when
|
|
47
|
-
* there's nothing to add (interactive-session mode is already self-explanatory
|
|
48
|
-
* via describeAuthMode). In api-key mode it tells the operator either that
|
|
49
|
-
* isolation is forcing the key, or — if not isolated — how to stop a claude.ai
|
|
50
|
-
* login from shadowing the key and causing 429s.
|
|
51
|
-
*/
|
|
52
|
-
export declare function authPrecedenceHint(env?: NodeJS.ProcessEnv): string | null;
|
|
53
|
-
//# sourceMappingURL=anthropic-auth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-auth.d.ts","sourceRoot":"","sources":["../src/anthropic-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,qBAAqB,CAAC;AAElE,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAE5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAGT;AAED,qEAAqE;AACrE,wBAAgB,uBAAuB,CACrC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,iBAAiB,CAEvF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAAC,UAAU,CAc1F;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAIhE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,IAAI,CASf"}
|
package/dist/anthropic-auth.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* v0.74-B (T-1780800000740201): centralised resolution of how the spawned
|
|
3
|
-
* `claude` CLI authenticates with Anthropic.
|
|
4
|
-
*
|
|
5
|
-
* Claude Code authenticates *strictly* via the `ANTHROPIC_API_KEY`
|
|
6
|
-
* environment variable (or an apiKeyHelper) — it has no `--api-key` flag;
|
|
7
|
-
* passing one fails with `error: unknown option '--api-key'`. So "passing
|
|
8
|
-
* the API key to claude" means making sure the variable is present in the
|
|
9
|
-
* spawned subprocess's environment.
|
|
10
|
-
*
|
|
11
|
-
* When ANTHROPIC_API_KEY is set the CLI bills against the API account, which
|
|
12
|
-
* has no per-session usage cap. When it is absent the CLI falls back to the
|
|
13
|
-
* operator's interactive OAuth session, which is subject to the 429 session
|
|
14
|
-
* caps this change exists to avoid.
|
|
15
|
-
*/
|
|
16
|
-
import os from "node:os";
|
|
17
|
-
import path from "node:path";
|
|
18
|
-
/** Trimmed ANTHROPIC_API_KEY from `env`, or "" when unset/blank. */
|
|
19
|
-
export function anthropicApiKey(env = process.env) {
|
|
20
|
-
return (env.ANTHROPIC_API_KEY ?? "").trim();
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* v0.76-A (GA-11): opt-in claude-config isolation. Even with ANTHROPIC_API_KEY
|
|
24
|
-
* set, the Claude CLI prefers a stored claude.ai OAuth login when one exists —
|
|
25
|
-
* the observed cause of 429 session caps on a key-configured runner. Pointing
|
|
26
|
-
* the spawned claude at an isolated CLAUDE_CONFIG_DIR (no stored login) leaves
|
|
27
|
-
* the env key as the only credential, forcing API-key auth. Opt-in via
|
|
28
|
-
* ACC_RUNNER_ISOLATE_CLAUDE_CONFIG because the behaviour needs live-runner
|
|
29
|
-
* validation before becoming default.
|
|
30
|
-
*/
|
|
31
|
-
export function claudeConfigIsolationEnabled(env = process.env) {
|
|
32
|
-
const v = (env.ACC_RUNNER_ISOLATE_CLAUDE_CONFIG ?? "").trim().toLowerCase();
|
|
33
|
-
return v === "1" || v === "true" || v === "yes" || v === "on";
|
|
34
|
-
}
|
|
35
|
-
/** Runner-owned claude config dir used when isolation is enabled. */
|
|
36
|
-
export function isolatedClaudeConfigDir(env = process.env) {
|
|
37
|
-
const override = (env.ACC_RUNNER_CLAUDE_CONFIG_DIR ?? "").trim();
|
|
38
|
-
return override || path.join(os.homedir(), ".acc-runner", "claude-config");
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* `"api-key"` when ANTHROPIC_API_KEY is set (non-blank), else
|
|
42
|
-
* `"interactive-session"`.
|
|
43
|
-
*/
|
|
44
|
-
export function resolveAuthMode(env = process.env) {
|
|
45
|
-
return anthropicApiKey(env) ? "api-key" : "interactive-session";
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Returns `base` with ANTHROPIC_API_KEY explicitly forwarded (trimmed) when
|
|
49
|
-
* set, so every claude spawn site authenticates identically regardless of how
|
|
50
|
-
* `base` was assembled. A passthrough of `base` when the key is absent — the
|
|
51
|
-
* CLI then uses the operator's interactive OAuth session.
|
|
52
|
-
*/
|
|
53
|
-
export function withAnthropicAuth(base = process.env) {
|
|
54
|
-
const key = anthropicApiKey(base);
|
|
55
|
-
if (!key)
|
|
56
|
-
return base;
|
|
57
|
-
const next = { ...base, ANTHROPIC_API_KEY: key };
|
|
58
|
-
// v0.76-A (GA-11): when isolation is opted in and the operator hasn't already
|
|
59
|
-
// pinned a config dir, point claude at a runner-owned dir so a stored
|
|
60
|
-
// claude.ai login can't shadow the API key. Never clobber an explicit value.
|
|
61
|
-
if (claudeConfigIsolationEnabled(base) &&
|
|
62
|
-
!(base.CLAUDE_CONFIG_DIR ?? "").trim()) {
|
|
63
|
-
next.CLAUDE_CONFIG_DIR = isolatedClaudeConfigDir(base);
|
|
64
|
-
}
|
|
65
|
-
return next;
|
|
66
|
-
}
|
|
67
|
-
/** One-line, human-readable description of an auth mode for banners/checks. */
|
|
68
|
-
export function describeAuthMode(mode) {
|
|
69
|
-
return mode === "api-key"
|
|
70
|
-
? "api-key (ANTHROPIC_API_KEY set — no session cap)"
|
|
71
|
-
: "interactive-session (no ANTHROPIC_API_KEY — subject to 429 session caps)";
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* v0.76-A (GA-11): precedence hint for the banner / doctor. Returns null when
|
|
75
|
-
* there's nothing to add (interactive-session mode is already self-explanatory
|
|
76
|
-
* via describeAuthMode). In api-key mode it tells the operator either that
|
|
77
|
-
* isolation is forcing the key, or — if not isolated — how to stop a claude.ai
|
|
78
|
-
* login from shadowing the key and causing 429s.
|
|
79
|
-
*/
|
|
80
|
-
export function authPrecedenceHint(env = process.env) {
|
|
81
|
-
if (resolveAuthMode(env) !== "api-key")
|
|
82
|
-
return null;
|
|
83
|
-
if (claudeConfigIsolationEnabled(env)) {
|
|
84
|
-
return `claude config isolated at ${isolatedClaudeConfigDir(env)} — API key forced`;
|
|
85
|
-
}
|
|
86
|
-
return ("if you still hit 429 session caps, a claude.ai login is shadowing the API key — " +
|
|
87
|
-
"run `claude /logout` or set ACC_RUNNER_ISOLATE_CLAUDE_CONFIG=1");
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=anthropic-auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-auth.js","sourceRoot":"","sources":["../src/anthropic-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,oEAAoE;AACpE,MAAM,UAAU,eAAe,CAAC,MAAyB,OAAO,CAAC,GAAG;IAClE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAC1C,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,gCAAgC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5E,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC;AAChE,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,uBAAuB,CACrC,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjE,OAAO,QAAQ,I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AC;IACD,OAAO,CACL,kFAAkF;QAClF,gEAAgE,CACjE,CAAC;AACJ,CAAC"}
|
package/dist/bin-resolve.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Binary path resolution for launchd-launched acc-runner processes.
|
|
3
|
-
*
|
|
4
|
-
* launchd strips the shell PATH to /usr/bin:/bin:/usr/sbin:/sbin, omitting
|
|
5
|
-
* /opt/homebrew/bin and /usr/local/bin where Homebrew installs git and gh.
|
|
6
|
-
* All execa("git"/"gh", ...) calls must use buildEnv() instead of bare
|
|
7
|
-
* process.env so the binaries are resolvable under launchd supervision.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Returns process.env with PATH augmented to include Homebrew bin dirs.
|
|
11
|
-
* Memoized — safe to call on every execa invocation.
|
|
12
|
-
*
|
|
13
|
-
* execa("git", args, { cwd, env: buildEnv() })
|
|
14
|
-
*/
|
|
15
|
-
export declare function buildEnv(): NodeJS.ProcessEnv;
|
|
16
|
-
//# sourceMappingURL=bin-resolve.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bin-resolve.d.ts","sourceRoot":"","sources":["../src/bin-resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqBH;;;;;GAKG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAAC,UAAU,CAE5C"}
|
package/dist/bin-resolve.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Binary path resolution for launchd-launched acc-runner processes.
|
|
3
|
-
*
|
|
4
|
-
* launchd strips the shell PATH to /usr/bin:/bin:/usr/sbin:/sbin, omitting
|
|
5
|
-
* /opt/homebrew/bin and /usr/local/bin where Homebrew installs git and gh.
|
|
6
|
-
* All execa("git"/"gh", ...) calls must use buildEnv() instead of bare
|
|
7
|
-
* process.env so the binaries are resolvable under launchd supervision.
|
|
8
|
-
*/
|
|
9
|
-
/** Directories prepended when not already in PATH. */
|
|
10
|
-
const EXTRA_PATHS = [
|
|
11
|
-
"/opt/homebrew/bin", // Apple Silicon Homebrew
|
|
12
|
-
"/opt/homebrew/sbin",
|
|
13
|
-
"/usr/local/bin", // Intel Homebrew / MacPorts
|
|
14
|
-
"/usr/local/sbin",
|
|
15
|
-
];
|
|
16
|
-
let _augmented = null;
|
|
17
|
-
function augmentedPath() {
|
|
18
|
-
if (_augmented !== null)
|
|
19
|
-
return _augmented;
|
|
20
|
-
const existing = process.env.PATH ?? "/usr/bin:/bin:/usr/sbin:/sbin";
|
|
21
|
-
const parts = existing.split(":");
|
|
22
|
-
const extras = EXTRA_PATHS.filter((p) => !parts.includes(p));
|
|
23
|
-
_augmented = extras.length > 0 ? `${extras.join(":")}:${existing}` : existing;
|
|
24
|
-
return _augmented;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Returns process.env with PATH augmented to include Homebrew bin dirs.
|
|
28
|
-
* Memoized — safe to call on every execa invocation.
|
|
29
|
-
*
|
|
30
|
-
* execa("git", args, { cwd, env: buildEnv() })
|
|
31
|
-
*/
|
|
32
|
-
export function buildEnv() {
|
|
33
|
-
return { ...process.env, PATH: augmentedPath() };
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=bin-resolve.js.map
|
package/dist/bin-resolve.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bin-resolve.js","sourceRoot":"","sources":["../src/bin-resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,sDAAsD;AACtD,MAAM,WAAW,GAAG;IAClB,mBAAmB,EAAI,yBAAyB;IAChD,oBAAoB;IACpB,gBAAgB,EAAO,4BAA4B;IACnD,iBAAiB;CAClB,CAAC;AAEF,IAAI,UAAU,GAAkB,IAAI,CAAC;AAErC,SAAS,aAAa;IACpB,IAAI,UAAU,KAAK,IAAI;QAAE,OAAO,UAAU,CAAC;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,+BAA+B,CAAC;IACrE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC9E,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,CAAC;AACnD,CAAC"}
|
package/dist/cli.d.ts
DELETED
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* acc-runner — CLI entry point. commander wires subcommands into named
|
|
4
|
-
* functions in their own files; this module is intentionally thin.
|
|
5
|
-
*/
|
|
6
|
-
import { Command } from "commander";
|
|
7
|
-
import chalk from "chalk";
|
|
8
|
-
import { loadConfig } from "./config.js";
|
|
9
|
-
import { fetchPricing } from "./cost-pricing.js";
|
|
10
|
-
import { loginCommand } from "./login.js";
|
|
11
|
-
import { logoutCommand } from "./logout.js";
|
|
12
|
-
import { watchCommand } from "./watch.js";
|
|
13
|
-
import { doctorCommand } from "./doctor.js";
|
|
14
|
-
import { clearQuarantine, getQuarantine } from "./runtime/quarantine.js";
|
|
15
|
-
import { PROTOCOL_VERSION } from "./types.js";
|
|
16
|
-
import { PACKAGE_VERSION } from "./pkg-version.js";
|
|
17
|
-
const program = new Command();
|
|
18
|
-
program
|
|
19
|
-
.name("acc-runner")
|
|
20
|
-
.description("Agent Control Center local runner. Subscribes to ACC, spawns Claude Code on assignment, and opens a PR when done.")
|
|
21
|
-
.version(`${PACKAGE_VERSION} (protocol v${PROTOCOL_VERSION})`);
|
|
22
|
-
program
|
|
23
|
-
.command("login")
|
|
24
|
-
.description("Sign in via device-code OAuth and register this machine.")
|
|
25
|
-
.action(async () => {
|
|
26
|
-
try {
|
|
27
|
-
await loginCommand();
|
|
28
|
-
}
|
|
29
|
-
catch (err) {
|
|
30
|
-
console.error(chalk.red(`✗ ${err.message}`));
|
|
31
|
-
process.exitCode = 1;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
program
|
|
35
|
-
.command("logout")
|
|
36
|
-
.description("Clear the local session and mark this runner offline.")
|
|
37
|
-
.action(async () => {
|
|
38
|
-
try {
|
|
39
|
-
await logoutCommand();
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
console.error(chalk.red(`✗ ${err.message}`));
|
|
43
|
-
process.exitCode = 1;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
program
|
|
47
|
-
.command("watch")
|
|
48
|
-
.description("Long-running. Receive task assignments and execute them.")
|
|
49
|
-
.action(async () => {
|
|
50
|
-
try {
|
|
51
|
-
// Warm the cost-pricing cache before the realtime loop opens.
|
|
52
|
-
// fetchPricing handles its own logging; embedded fallback governs
|
|
53
|
-
// if the endpoint is unreachable.
|
|
54
|
-
await fetchPricing(loadConfig().publicUrl);
|
|
55
|
-
await watchCommand();
|
|
56
|
-
// Keep the process alive — stop() runs in the SIGINT handler.
|
|
57
|
-
await new Promise(() => { });
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
console.error(chalk.red(`✗ ${err.message}`));
|
|
61
|
-
process.exitCode = 1;
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
program
|
|
65
|
-
.command("doctor")
|
|
66
|
-
.description("Run environment checks. Exit 0 if all green, 1 otherwise.")
|
|
67
|
-
.action(async () => {
|
|
68
|
-
const code = await doctorCommand();
|
|
69
|
-
process.exitCode = code;
|
|
70
|
-
});
|
|
71
|
-
// v0.48: quarantine management. The runner enters quarantine automatically
|
|
72
|
-
// when the failure classifier detects a machine-level failure. An operator
|
|
73
|
-
// resolves the underlying issue then clears the quarantine to resume work.
|
|
74
|
-
const quarantineCmd = program
|
|
75
|
-
.command("quarantine")
|
|
76
|
-
.description("Inspect or clear the runner quarantine state.");
|
|
77
|
-
quarantineCmd
|
|
78
|
-
.command("status")
|
|
79
|
-
.description("Show quarantine state.")
|
|
80
|
-
.action(async () => {
|
|
81
|
-
try {
|
|
82
|
-
const q = await getQuarantine();
|
|
83
|
-
if (!q) {
|
|
84
|
-
console.log("Runner is not quarantined.");
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
console.log(chalk.red.bold(`QUARANTINED (${q.cause})`));
|
|
88
|
-
console.log(` Detail: ${q.detail}`);
|
|
89
|
-
console.log(` Task: ${q.taskId}`);
|
|
90
|
-
console.log(` Since: ${q.classifiedAt}`);
|
|
91
|
-
// v0.53 T-53-4: consecutive instant-empty count (1 = definitive,
|
|
92
|
-
// 2 = heuristic confirmed by retry). Omitted for pre-0.53 states.
|
|
93
|
-
if (q.consecutive !== undefined) {
|
|
94
|
-
console.log(` Streak: ${q.consecutive} consecutive instant-empty exit(s)`);
|
|
95
|
-
}
|
|
96
|
-
console.log(chalk.gray(`\nResolve the underlying ${q.cause} issue, then run \`acc-runner quarantine clear\`.`));
|
|
97
|
-
process.exitCode = 1;
|
|
98
|
-
}
|
|
99
|
-
catch (err) {
|
|
100
|
-
console.error(chalk.red(`✗ ${err.message}`));
|
|
101
|
-
process.exitCode = 1;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
quarantineCmd
|
|
105
|
-
.command("clear")
|
|
106
|
-
.description("Clear quarantine and allow the runner to resume claiming tasks.")
|
|
107
|
-
.action(async () => {
|
|
108
|
-
try {
|
|
109
|
-
await clearQuarantine();
|
|
110
|
-
console.log(chalk.green("✓ Quarantine cleared. Runner will resume on next task assignment."));
|
|
111
|
-
}
|
|
112
|
-
catch (err) {
|
|
113
|
-
console.error(chalk.red(`✗ ${err.message}`));
|
|
114
|
-
process.exitCode = 1;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
program
|
|
118
|
-
.command("version")
|
|
119
|
-
.description("Print CLI + protocol versions.")
|
|
120
|
-
.action(() => {
|
|
121
|
-
console.log(`acc-runner ${PACKAGE_VERSION}`);
|
|
122
|
-
console.log(`protocol ${PROTOCOL_VERSION}`);
|
|
123
|
-
});
|
|
124
|
-
program.parseAsync(process.argv).catch((err) => {
|
|
125
|
-
console.error(chalk.red(`✗ ${err.message}`));
|
|
126
|
-
process.exit(1);
|
|
127
|
-
});
|
|
128
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YA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AC,cAAc,eAAe,EAAE,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,gBAAgB,gBAAgB,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC7C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAM,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/config.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
export interface RunnerConfig {
|
|
2
|
-
publicUrl: string;
|
|
3
|
-
supabaseUrl: string;
|
|
4
|
-
supabaseAnonKey: string;
|
|
5
|
-
repoPath: string;
|
|
6
|
-
targetRepo: string;
|
|
7
|
-
integrationBranch: string;
|
|
8
|
-
/**
|
|
9
|
-
* v0.6.4+: capability tags this runner declares to the task-router.
|
|
10
|
-
* Resolution order: ACC_RUNNER_CAPABILITIES env (comma-separated)
|
|
11
|
-
* > ~/.config/acc-runner/config.json `capabilities` field > [].
|
|
12
|
-
* Empty array matches any task with empty required_capabilities,
|
|
13
|
-
* preserving backward compatibility with 0.6.3 runners. Optional
|
|
14
|
-
* on the interface so existing test fixtures that construct a
|
|
15
|
-
* RunnerConfig literal don't have to add the new field — call
|
|
16
|
-
* sites coalesce to [] via the loader.
|
|
17
|
-
*/
|
|
18
|
-
capabilities?: string[];
|
|
19
|
-
/**
|
|
20
|
-
* v0.41-B: optional path to a mirror clone used exclusively for
|
|
21
|
-
* git worktree operations. When set, worktree add/remove/prune run
|
|
22
|
-
* against this path instead of repoPath, eliminating virtiofs lock
|
|
23
|
-
* conflicts on machines where repoPath is mounted by another process.
|
|
24
|
-
* Operator initialises once via: git clone --mirror <remote> <path>
|
|
25
|
-
* Resolution: ACC_WORKTREE_REPO_PATH env > config.json
|
|
26
|
-
* "worktree-repo-path" field > undefined (falls back to repoPath).
|
|
27
|
-
*/
|
|
28
|
-
worktreeRepoPath?: string;
|
|
29
|
-
}
|
|
30
|
-
export type ConfigSource = "env" | "file" | "default";
|
|
31
|
-
/**
|
|
32
|
-
* Canonical capability vocabulary, mirrored from
|
|
33
|
-
* `api/_lib/capabilities.ts` and the CHECK constraint enforced by
|
|
34
|
-
* migration 0115 (v0.14-CAPABILITY-VOCAB). Duplicated here because the
|
|
35
|
-
* runner package's tsconfig pins rootDir to `./src/`, so reaching into
|
|
36
|
-
* `api/_lib/` is out of bounds for a published artifact. The
|
|
37
|
-
* integration test `tests/integration/v0.14-DEVELOPER-AGENT.test.ts`
|
|
38
|
-
* asserts this list and the api/_lib version stay in lockstep; the
|
|
39
|
-
* "adding a new capability" recipe in
|
|
40
|
-
* docs/acc/CAPABILITY_VOCABULARY.md covers all three sites (SQL, api/,
|
|
41
|
-
* runner/).
|
|
42
|
-
*/
|
|
43
|
-
export declare const RUNNER_CAPABILITY_VOCABULARY: readonly ["code", "design", "test", "docs", "migration", "review", "orchestration"];
|
|
44
|
-
export type RunnerCapability = (typeof RUNNER_CAPABILITY_VOCABULARY)[number];
|
|
45
|
-
/**
|
|
46
|
-
* Throws if any element of `arr` is outside the canonical vocabulary.
|
|
47
|
-
* Mirrors `assertCapabilityArray` from api/_lib/capabilities.ts. The
|
|
48
|
-
* runner uses this on profile load — misspellings ("desgn") fail at
|
|
49
|
-
* CLI startup, not after a task assignment fires.
|
|
50
|
-
*/
|
|
51
|
-
export declare function assertRunnerCapabilityArray(arr: readonly string[], context: string): asserts arr is RunnerCapability[];
|
|
52
|
-
/**
|
|
53
|
-
* v0.8.2: Scan a list of absolute candidate paths and return the first
|
|
54
|
-
* that exists on disk. Returns null when none exist so loadConfig() can
|
|
55
|
-
* fall through to the ~/work/TechArch last-resort default.
|
|
56
|
-
*
|
|
57
|
-
* Used when neither ACC_REPO_PATH nor config.json supply a path so a
|
|
58
|
-
* freshly-installed runner finds the repo automatically when the operator
|
|
59
|
-
* cloned it to ~/code/ instead of ~/work/. Candidates are checked in
|
|
60
|
-
* order; the first hit wins.
|
|
61
|
-
*/
|
|
62
|
-
export declare function detectRepoPath(candidates: string[]): string | null;
|
|
63
|
-
/**
|
|
64
|
-
* Read ~/.config/acc-runner/config.json (or $XDG_CONFIG_HOME/acc-runner/
|
|
65
|
-
* config.json) and pull out the capabilities field. Missing file or
|
|
66
|
-
* malformed JSON returns []. This is best-effort, never throws: a
|
|
67
|
-
* runner that can't read its config file should still register with
|
|
68
|
-
* the default-empty capabilities rather than crash at startup.
|
|
69
|
-
*/
|
|
70
|
-
export declare function loadCapabilitiesFromConfigFile(): string[];
|
|
71
|
-
/**
|
|
72
|
-
* v0.14-DEVELOPER-AGENT — shape of a runner-profile JSON. One file per
|
|
73
|
-
* profile under `packages/acc-runner/runner-profiles/<name>.json`. The
|
|
74
|
-
* developer profile is the v0.13 baseline (capabilities = ["code",
|
|
75
|
-
* "migration"], no prompt prelude beyond what renderTaskPrompt already
|
|
76
|
-
* emits). Designer/Tester/Manager add their own JSONs in subsequent
|
|
77
|
-
* tracks.
|
|
78
|
-
*/
|
|
79
|
-
export interface RunnerProfile {
|
|
80
|
-
/** Profile slug; must match the JSON's filename (without extension). */
|
|
81
|
-
name: string;
|
|
82
|
-
/** Capability tags this profile declares. Validated against the
|
|
83
|
-
* canonical vocabulary at load time — a typo here aborts CLI
|
|
84
|
-
* startup with a clear error. */
|
|
85
|
-
capabilities: RunnerCapability[];
|
|
86
|
-
/** Optional hints for which Claude model the profile prefers. The
|
|
87
|
-
* v0.14 runtime still picks `task.model_id` first; these are
|
|
88
|
-
* reserved for the cost-aware router (v0.14-COST-AWARE-ROUTING) and
|
|
89
|
-
* future profile-aware spawn paths. */
|
|
90
|
-
modelDefaults?: {
|
|
91
|
-
primary?: string;
|
|
92
|
-
fallback?: string;
|
|
93
|
-
};
|
|
94
|
-
/** Path (relative to the runner package root) to a module whose
|
|
95
|
-
* default export is a string prepended to the rendered task prompt
|
|
96
|
-
* when this profile is active. The developer profile points at an
|
|
97
|
-
* empty-string module so byte-identical behavior holds. Wire-up of
|
|
98
|
-
* the prelude in task-runner.ts lands in v0.14-DESIGNER-AGENT
|
|
99
|
-
* (Tier 2); v0.14-DEVELOPER-AGENT only establishes the contract. */
|
|
100
|
-
promptPrelude?: string;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Load the active runner profile, if any. Returns null when no profile
|
|
104
|
-
* is selected (the v0.13 path). Throws on malformed / unknown profile
|
|
105
|
-
* names so the operator sees the misconfiguration at CLI startup
|
|
106
|
-
* rather than at task-pickup time.
|
|
107
|
-
*/
|
|
108
|
-
export declare function loadProfile(): RunnerProfile | null;
|
|
109
|
-
export declare function loadConfig(): RunnerConfig;
|
|
110
|
-
/**
|
|
111
|
-
* Source of each resolved config value. Used by `doctor` to annotate
|
|
112
|
-
* the resolved config with "(env)" / "(default)" labels.
|
|
113
|
-
*/
|
|
114
|
-
export declare function configSources(): Record<keyof RunnerConfig, ConfigSource>;
|
|
115
|
-
/**
|
|
116
|
-
* Kept for callers that still treat config-load failure as recoverable.
|
|
117
|
-
* With defaults in place loadConfig() does not throw, so this returns
|
|
118
|
-
* a populated RunnerConfig in normal use.
|
|
119
|
-
*/
|
|
120
|
-
export declare function loadConfigOrNull(): RunnerConfig | null;
|
|
121
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAgEA,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAA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