@tokenfactory/acc-runner 0.27.0 → 0.27.1

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.
Files changed (161) hide show
  1. package/dist/anthropic-auth.d.ts +53 -0
  2. package/dist/anthropic-auth.d.ts.map +1 -0
  3. package/dist/anthropic-auth.js +89 -0
  4. package/dist/anthropic-auth.js.map +1 -0
  5. package/dist/bin-resolve.d.ts +16 -0
  6. package/dist/bin-resolve.d.ts.map +1 -0
  7. package/dist/bin-resolve.js +35 -0
  8. package/dist/bin-resolve.js.map +1 -0
  9. package/dist/cli.d.ts +3 -0
  10. package/dist/cli.d.ts.map +1 -0
  11. package/dist/cli.js +128 -0
  12. package/dist/cli.js.map +1 -0
  13. package/dist/config.d.ts +121 -0
  14. package/dist/config.d.ts.map +1 -0
  15. package/dist/config.js +396 -0
  16. package/dist/config.js.map +1 -0
  17. package/dist/cost-pricing.d.ts +130 -0
  18. package/dist/cost-pricing.d.ts.map +1 -0
  19. package/dist/cost-pricing.js +191 -0
  20. package/dist/cost-pricing.js.map +1 -0
  21. package/dist/doctor.d.ts +49 -0
  22. package/dist/doctor.d.ts.map +1 -0
  23. package/dist/doctor.js +776 -0
  24. package/dist/doctor.js.map +1 -0
  25. package/dist/failure-classifier.d.ts +112 -0
  26. package/dist/failure-classifier.d.ts.map +1 -0
  27. package/dist/failure-classifier.js +353 -0
  28. package/dist/failure-classifier.js.map +1 -0
  29. package/dist/gh.d.ts +22 -0
  30. package/dist/gh.d.ts.map +1 -0
  31. package/dist/gh.js +48 -0
  32. package/dist/gh.js.map +1 -0
  33. package/dist/git.d.ts +50 -0
  34. package/dist/git.d.ts.map +1 -0
  35. package/dist/git.js +127 -0
  36. package/dist/git.js.map +1 -0
  37. package/dist/github-client.d.ts +133 -0
  38. package/dist/github-client.d.ts.map +1 -0
  39. package/dist/github-client.js +234 -0
  40. package/dist/github-client.js.map +1 -0
  41. package/dist/keychain.d.ts +21 -0
  42. package/dist/keychain.d.ts.map +1 -0
  43. package/dist/keychain.js +45 -0
  44. package/dist/keychain.js.map +1 -0
  45. package/dist/login.d.ts +12 -0
  46. package/dist/login.d.ts.map +1 -0
  47. package/dist/login.js +133 -0
  48. package/dist/login.js.map +1 -0
  49. package/dist/logout.d.ts +2 -0
  50. package/dist/logout.d.ts.map +1 -0
  51. package/dist/logout.js +31 -0
  52. package/dist/logout.js.map +1 -0
  53. package/dist/mcp-spawn.d.ts +30 -0
  54. package/dist/mcp-spawn.d.ts.map +1 -0
  55. package/dist/mcp-spawn.js +145 -0
  56. package/dist/mcp-spawn.js.map +1 -0
  57. package/dist/messaging.d.ts +49 -0
  58. package/dist/messaging.d.ts.map +1 -0
  59. package/dist/messaging.js +36 -0
  60. package/dist/messaging.js.map +1 -0
  61. package/dist/pkg-version.d.ts +3 -0
  62. package/dist/pkg-version.d.ts.map +1 -0
  63. package/dist/pkg-version.js +20 -0
  64. package/dist/pkg-version.js.map +1 -0
  65. package/dist/profiles/designer-prompt.d.ts +18 -0
  66. package/dist/profiles/designer-prompt.d.ts.map +1 -0
  67. package/dist/profiles/designer-prompt.js +172 -0
  68. package/dist/profiles/designer-prompt.js.map +1 -0
  69. package/dist/profiles/developer-prompt.d.ts +24 -0
  70. package/dist/profiles/developer-prompt.d.ts.map +1 -0
  71. package/dist/profiles/developer-prompt.js +24 -0
  72. package/dist/profiles/developer-prompt.js.map +1 -0
  73. package/dist/profiles/manager-prompt.d.ts +34 -0
  74. package/dist/profiles/manager-prompt.d.ts.map +1 -0
  75. package/dist/profiles/manager-prompt.js +93 -0
  76. package/dist/profiles/manager-prompt.js.map +1 -0
  77. package/dist/profiles/tester-prompt.d.ts +28 -0
  78. package/dist/profiles/tester-prompt.d.ts.map +1 -0
  79. package/dist/profiles/tester-prompt.js +165 -0
  80. package/dist/profiles/tester-prompt.js.map +1 -0
  81. package/dist/prompt.d.ts +38 -0
  82. package/dist/prompt.d.ts.map +1 -0
  83. package/dist/prompt.js +78 -0
  84. package/dist/prompt.js.map +1 -0
  85. package/dist/runtime/cache-dir.d.ts +10 -0
  86. package/dist/runtime/cache-dir.d.ts.map +1 -0
  87. package/dist/runtime/cache-dir.js +42 -0
  88. package/dist/runtime/cache-dir.js.map +1 -0
  89. package/dist/runtime/conflict-resolver.d.ts +65 -0
  90. package/dist/runtime/conflict-resolver.d.ts.map +1 -0
  91. package/dist/runtime/conflict-resolver.js +477 -0
  92. package/dist/runtime/conflict-resolver.js.map +1 -0
  93. package/dist/runtime/expand-args.d.ts +28 -0
  94. package/dist/runtime/expand-args.d.ts.map +1 -0
  95. package/dist/runtime/expand-args.js +50 -0
  96. package/dist/runtime/expand-args.js.map +1 -0
  97. package/dist/runtime/locks.d.ts +21 -0
  98. package/dist/runtime/locks.d.ts.map +1 -0
  99. package/dist/runtime/locks.js +103 -0
  100. package/dist/runtime/locks.js.map +1 -0
  101. package/dist/runtime/provision-mutex.d.ts +37 -0
  102. package/dist/runtime/provision-mutex.d.ts.map +1 -0
  103. package/dist/runtime/provision-mutex.js +67 -0
  104. package/dist/runtime/provision-mutex.js.map +1 -0
  105. package/dist/runtime/quarantine.d.ts +30 -0
  106. package/dist/runtime/quarantine.d.ts.map +1 -0
  107. package/dist/runtime/quarantine.js +53 -0
  108. package/dist/runtime/quarantine.js.map +1 -0
  109. package/dist/runtime/resolution-integrity.d.ts +86 -0
  110. package/dist/runtime/resolution-integrity.d.ts.map +1 -0
  111. package/dist/runtime/resolution-integrity.js +248 -0
  112. package/dist/runtime/resolution-integrity.js.map +1 -0
  113. package/dist/runtime/reviewer.d.ts +81 -0
  114. package/dist/runtime/reviewer.d.ts.map +1 -0
  115. package/dist/runtime/reviewer.js +374 -0
  116. package/dist/runtime/reviewer.js.map +1 -0
  117. package/dist/runtime/rework.d.ts +48 -0
  118. package/dist/runtime/rework.d.ts.map +1 -0
  119. package/dist/runtime/rework.js +136 -0
  120. package/dist/runtime/rework.js.map +1 -0
  121. package/dist/runtime/singleton.d.ts +66 -0
  122. package/dist/runtime/singleton.d.ts.map +1 -0
  123. package/dist/runtime/singleton.js +227 -0
  124. package/dist/runtime/singleton.js.map +1 -0
  125. package/dist/runtime/version-drift.d.ts +31 -0
  126. package/dist/runtime/version-drift.d.ts.map +1 -0
  127. package/dist/runtime/version-drift.js +114 -0
  128. package/dist/runtime/version-drift.js.map +1 -0
  129. package/dist/runtime/worktree.d.ts +74 -0
  130. package/dist/runtime/worktree.d.ts.map +1 -0
  131. package/dist/runtime/worktree.js +211 -0
  132. package/dist/runtime/worktree.js.map +1 -0
  133. package/dist/secrets/inject.d.ts +70 -0
  134. package/dist/secrets/inject.d.ts.map +1 -0
  135. package/dist/secrets/inject.js +102 -0
  136. package/dist/secrets/inject.js.map +1 -0
  137. package/dist/supabase.d.ts +4 -0
  138. package/dist/supabase.d.ts.map +1 -0
  139. package/dist/supabase.js +36 -0
  140. package/dist/supabase.js.map +1 -0
  141. package/dist/task-runner.d.ts +313 -0
  142. package/dist/task-runner.d.ts.map +1 -0
  143. package/dist/task-runner.js +1766 -0
  144. package/dist/task-runner.js.map +1 -0
  145. package/dist/token-provider.d.ts +50 -0
  146. package/dist/token-provider.d.ts.map +1 -0
  147. package/dist/token-provider.js +177 -0
  148. package/dist/token-provider.js.map +1 -0
  149. package/dist/types.d.ts +120 -0
  150. package/dist/types.d.ts.map +1 -0
  151. package/dist/types.js +16 -0
  152. package/dist/types.js.map +1 -0
  153. package/dist/version-check.d.ts +17 -0
  154. package/dist/version-check.d.ts.map +1 -0
  155. package/dist/version-check.js +56 -0
  156. package/dist/version-check.js.map +1 -0
  157. package/dist/watch.d.ts +296 -0
  158. package/dist/watch.d.ts.map +1 -0
  159. package/dist/watch.js +1570 -0
  160. package/dist/watch.js.map +1 -0
  161. package/package.json +1 -1
@@ -0,0 +1,53 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,89 @@
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_RUNN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BAAiB,CAAC,OAA0B,OAAO,CAAC,GAAG;IACrE,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,IAAI,GAAsB,EAAE,GAAG,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC;IACpE,8EAA8E;IAC9E,sEAAsE;IACtE,6EAA6E;IAC7E,IACE,4BAA4B,CAAC,IAAI,CAAC;QAClC,CAAC,CAAC,IAAI,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EACtC,CAAC;QACD,IAAI,CAAC,iBAAiB,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,gBAAgB,CAAC,IAAuB;IACtD,OAAO,IAAI,KAAK,SAAS;QACvB,CAAC,CAAC,kDAAkD;QACpD,CAAC,CAAC,0EAA0E,CAAC;AACjF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAyB,OAAO,CAAC,GAAG;IAEpC,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpD,IAAI,4BAA4B,CAAC,GAAG,CAAC,EAAE,CAAC;QACtC,OAAO,6BAA6B,uBAAuB,CAAC,GAAG,CAAC,mBAAmB,CAAC;IACtF,CAAC;IACD,OAAO,CACL,kFAAkF;QAClF,gEAAgE,CACjE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,35 @@
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
@@ -0,0 +1 @@
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 ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,128 @@
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
@@ -0,0 +1 @@
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,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CACV,mHAAmH,CACpH;KACA,OAAO,CAAC,GAAG,eAAe,eAAe,gBAAgB,GAAG,CAAC,CAAC;AAEjE,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,0DAA0D,CAAC;KACvE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,CAAC;QACH,MAAM,YAAY,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,C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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
@@ -0,0 +1 @@
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,MAAM,CAAC;IAC1B;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAMtD;;;;;;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