agent-control-plane 0.1.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.
Files changed (317) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +589 -0
  3. package/SKILL.md +149 -0
  4. package/assets/workflow-catalog.json +57 -0
  5. package/bin/audit-issue-routing.sh +74 -0
  6. package/bin/issue-resource-class.sh +58 -0
  7. package/bin/label-follow-up-issues.sh +114 -0
  8. package/bin/pr-risk.sh +532 -0
  9. package/bin/sync-pr-labels.sh +112 -0
  10. package/hooks/heartbeat-hooks.sh +573 -0
  11. package/hooks/issue-reconcile-hooks.sh +217 -0
  12. package/hooks/pr-reconcile-hooks.sh +225 -0
  13. package/npm/bin/agent-control-plane.js +1984 -0
  14. package/npm/public-bin/agent-control-plane +3 -0
  15. package/package.json +61 -0
  16. package/tools/bin/agent-cleanup-worktree +247 -0
  17. package/tools/bin/agent-github-update-labels +66 -0
  18. package/tools/bin/agent-init-worktree +216 -0
  19. package/tools/bin/agent-project-archive-run +52 -0
  20. package/tools/bin/agent-project-capture-worker +46 -0
  21. package/tools/bin/agent-project-catch-up-merged-prs +137 -0
  22. package/tools/bin/agent-project-cleanup-session +244 -0
  23. package/tools/bin/agent-project-detached-launch +107 -0
  24. package/tools/bin/agent-project-heartbeat-loop +2347 -0
  25. package/tools/bin/agent-project-open-issue-worktree +89 -0
  26. package/tools/bin/agent-project-open-pr-worktree +80 -0
  27. package/tools/bin/agent-project-publish-issue-pr +349 -0
  28. package/tools/bin/agent-project-reconcile-issue-session +1128 -0
  29. package/tools/bin/agent-project-reconcile-pr-session +1005 -0
  30. package/tools/bin/agent-project-retry-state +147 -0
  31. package/tools/bin/agent-project-run-claude-session +657 -0
  32. package/tools/bin/agent-project-run-codex-resilient +718 -0
  33. package/tools/bin/agent-project-run-codex-session +316 -0
  34. package/tools/bin/agent-project-run-kilo-session +27 -0
  35. package/tools/bin/agent-project-run-openclaw-session +984 -0
  36. package/tools/bin/agent-project-run-opencode-session +27 -0
  37. package/tools/bin/agent-project-sync-anchor-repo +128 -0
  38. package/tools/bin/agent-project-worker-status +143 -0
  39. package/tools/bin/audit-agent-worktrees.sh +310 -0
  40. package/tools/bin/audit-issue-routing.sh +11 -0
  41. package/tools/bin/audit-retained-layout.sh +58 -0
  42. package/tools/bin/audit-retained-overlap.sh +135 -0
  43. package/tools/bin/audit-retained-worktrees.sh +228 -0
  44. package/tools/bin/branch-verification-guard.sh +351 -0
  45. package/tools/bin/capture-worker.sh +18 -0
  46. package/tools/bin/check-skill-contracts.sh +324 -0
  47. package/tools/bin/cleanup-worktree.sh +44 -0
  48. package/tools/bin/codex-quota +31 -0
  49. package/tools/bin/create-follow-up-issue.sh +114 -0
  50. package/tools/bin/dashboard-launchd-bootstrap.sh +38 -0
  51. package/tools/bin/flow-config-lib.sh +2127 -0
  52. package/tools/bin/flow-resident-worker-lib.sh +683 -0
  53. package/tools/bin/flow-runtime-doctor.sh +97 -0
  54. package/tools/bin/flow-shell-lib.sh +266 -0
  55. package/tools/bin/heartbeat-recovery-preflight.sh +106 -0
  56. package/tools/bin/heartbeat-safe-auto.sh +551 -0
  57. package/tools/bin/install-dashboard-launchd.sh +152 -0
  58. package/tools/bin/install-project-launchd.sh +219 -0
  59. package/tools/bin/issue-publish-scope-guard.sh +242 -0
  60. package/tools/bin/issue-requires-local-workspace-install.sh +31 -0
  61. package/tools/bin/issue-resource-class.sh +12 -0
  62. package/tools/bin/kick-scheduler.sh +75 -0
  63. package/tools/bin/label-follow-up-issues.sh +14 -0
  64. package/tools/bin/new-pr-worktree.sh +50 -0
  65. package/tools/bin/new-worktree.sh +49 -0
  66. package/tools/bin/pr-risk.sh +12 -0
  67. package/tools/bin/prepare-worktree.sh +140 -0
  68. package/tools/bin/profile-activate.sh +109 -0
  69. package/tools/bin/profile-adopt.sh +219 -0
  70. package/tools/bin/profile-smoke.sh +461 -0
  71. package/tools/bin/project-init.sh +189 -0
  72. package/tools/bin/project-launchd-bootstrap.sh +54 -0
  73. package/tools/bin/project-remove.sh +155 -0
  74. package/tools/bin/project-runtime-supervisor.sh +56 -0
  75. package/tools/bin/project-runtimectl.sh +586 -0
  76. package/tools/bin/provider-cooldown-state.sh +166 -0
  77. package/tools/bin/publish-issue-worker.sh +31 -0
  78. package/tools/bin/reconcile-issue-worker.sh +34 -0
  79. package/tools/bin/reconcile-pr-worker.sh +34 -0
  80. package/tools/bin/record-verification.sh +71 -0
  81. package/tools/bin/render-architecture-infographics.sh +110 -0
  82. package/tools/bin/render-dashboard-demo-media.sh +333 -0
  83. package/tools/bin/render-dashboard-snapshot.py +16 -0
  84. package/tools/bin/render-flow-config.sh +86 -0
  85. package/tools/bin/retry-state.sh +31 -0
  86. package/tools/bin/reuse-issue-worktree.sh +75 -0
  87. package/tools/bin/run-codex-bypass.sh +3 -0
  88. package/tools/bin/run-codex-safe.sh +3 -0
  89. package/tools/bin/run-codex-task.sh +231 -0
  90. package/tools/bin/scaffold-profile.sh +374 -0
  91. package/tools/bin/serve-dashboard.sh +5 -0
  92. package/tools/bin/split-retained-slice.sh +124 -0
  93. package/tools/bin/start-issue-worker.sh +796 -0
  94. package/tools/bin/start-pr-fix-worker.sh +458 -0
  95. package/tools/bin/start-pr-merge-repair-worker.sh +8 -0
  96. package/tools/bin/start-pr-review-worker.sh +227 -0
  97. package/tools/bin/start-resident-issue-loop.sh +908 -0
  98. package/tools/bin/sync-agent-repo.sh +52 -0
  99. package/tools/bin/sync-dependency-baseline.sh +247 -0
  100. package/tools/bin/sync-pr-labels.sh +12 -0
  101. package/tools/bin/sync-recurring-issue-checklist.sh +274 -0
  102. package/tools/bin/sync-shared-agent-home.sh +214 -0
  103. package/tools/bin/sync-vscode-workspace.sh +157 -0
  104. package/tools/bin/test-smoke.sh +63 -0
  105. package/tools/bin/uninstall-project-launchd.sh +55 -0
  106. package/tools/bin/update-github-labels.sh +14 -0
  107. package/tools/bin/worker-status.sh +19 -0
  108. package/tools/bin/workflow-catalog.sh +77 -0
  109. package/tools/dashboard/app.js +286 -0
  110. package/tools/dashboard/dashboard_snapshot.py +466 -0
  111. package/tools/dashboard/index.html +41 -0
  112. package/tools/dashboard/server.py +64 -0
  113. package/tools/dashboard/styles.css +351 -0
  114. package/tools/templates/issue-prompt-template.md +109 -0
  115. package/tools/templates/pr-fix-template.md +120 -0
  116. package/tools/templates/pr-merge-repair-template.md +91 -0
  117. package/tools/templates/pr-review-template.md +62 -0
  118. package/tools/templates/scheduled-issue-prompt-template.md +62 -0
  119. package/tools/tests/test-agent-control-plane-npm-cli.sh +279 -0
  120. package/tools/tests/test-agent-github-update-labels-falls-back-to-repository-id.sh +56 -0
  121. package/tools/tests/test-agent-project-claude-session-wrapper-clears-stale-sandbox-artifacts.sh +89 -0
  122. package/tools/tests/test-agent-project-claude-session-wrapper-does-not-retry-provider-quota.sh +82 -0
  123. package/tools/tests/test-agent-project-claude-session-wrapper-retries-transient-failures.sh +90 -0
  124. package/tools/tests/test-agent-project-claude-session-wrapper-times-out.sh +73 -0
  125. package/tools/tests/test-agent-project-claude-session-wrapper.sh +103 -0
  126. package/tools/tests/test-agent-project-cleanup-session-orphan-fallback.sh +90 -0
  127. package/tools/tests/test-agent-project-cleanup-session-skip-worktree-cleanup.sh +90 -0
  128. package/tools/tests/test-agent-project-codex-live-thread-persist.sh +76 -0
  129. package/tools/tests/test-agent-project-codex-recovery.sh +731 -0
  130. package/tools/tests/test-agent-project-codex-session-wrapper-clears-stale-sandbox-artifacts.sh +105 -0
  131. package/tools/tests/test-agent-project-codex-session-wrapper.sh +97 -0
  132. package/tools/tests/test-agent-project-open-pr-worktree-config-prefix.sh +81 -0
  133. package/tools/tests/test-agent-project-openclaw-session-wrapper-clears-stale-sandbox-artifacts.sh +109 -0
  134. package/tools/tests/test-agent-project-openclaw-session-wrapper-infers-blocked-result-contract.sh +89 -0
  135. package/tools/tests/test-agent-project-openclaw-session-wrapper-recovers-literal-env-artifacts.sh +113 -0
  136. package/tools/tests/test-agent-project-openclaw-session-wrapper-recovers-version-mismatch.sh +135 -0
  137. package/tools/tests/test-agent-project-openclaw-session-wrapper-resident.sh +179 -0
  138. package/tools/tests/test-agent-project-openclaw-session-wrapper-reuses-existing-agent-after-add-race.sh +119 -0
  139. package/tools/tests/test-agent-project-openclaw-session-wrapper-terminates-rate-limit-hang.sh +91 -0
  140. package/tools/tests/test-agent-project-openclaw-session-wrapper.sh +117 -0
  141. package/tools/tests/test-agent-project-publish-issue-pr-prunes-stale-worktree-entry.sh +148 -0
  142. package/tools/tests/test-agent-project-publish-issue-pr-reads-archived-session.sh +146 -0
  143. package/tools/tests/test-agent-project-publish-issue-pr-recovers-final-head.sh +145 -0
  144. package/tools/tests/test-agent-project-publish-issue-pr-reuses-existing-worktree.sh +147 -0
  145. package/tools/tests/test-agent-project-reconcile-failure-reason.sh +456 -0
  146. package/tools/tests/test-agent-project-reconcile-issue-archived-session-fallback.sh +96 -0
  147. package/tools/tests/test-agent-project-reconcile-issue-before-blocked.sh +90 -0
  148. package/tools/tests/test-agent-project-reconcile-issue-host-verification-recovery-uses-recovered-worktree.sh +212 -0
  149. package/tools/tests/test-agent-project-reconcile-issue-host-verification-recovery.sh +207 -0
  150. package/tools/tests/test-agent-project-reconcile-issue-provider-quota-schedules-provider-cooldown.sh +101 -0
  151. package/tools/tests/test-agent-project-reconcile-issue-session-backfills-lane-metadata-from-worker-key.sh +113 -0
  152. package/tools/tests/test-agent-project-reconcile-issue-session-clears-stale-failed-summary.sh +117 -0
  153. package/tools/tests/test-agent-project-reconcile-issue-session-initializes-shared-agent-home.sh +55 -0
  154. package/tools/tests/test-agent-project-reconcile-issue-session-normalizes-runner-state.sh +125 -0
  155. package/tools/tests/test-agent-project-reconcile-issue-session-records-invalid-contract-summary.sh +118 -0
  156. package/tools/tests/test-agent-project-reconcile-issue-session-skips-duplicate-blocked-comment.sh +144 -0
  157. package/tools/tests/test-agent-project-reconcile-issue-session-standardizes-no-commits-blocker.sh +145 -0
  158. package/tools/tests/test-agent-project-reconcile-issue-session-synthesizes-blocked-comment.sh +139 -0
  159. package/tools/tests/test-agent-project-reconcile-pr-blocked-host-recovery.sh +242 -0
  160. package/tools/tests/test-agent-project-reconcile-pr-guard-blocked-no-commit.sh +142 -0
  161. package/tools/tests/test-agent-project-reconcile-pr-provider-quota-schedules-provider-cooldown.sh +106 -0
  162. package/tools/tests/test-agent-project-reconcile-pr-session-initializes-shared-agent-home.sh +66 -0
  163. package/tools/tests/test-agent-project-reconcile-pr-updated-branch-noop.sh +129 -0
  164. package/tools/tests/test-audit-agent-worktrees-active-launch-skips-git-inspection.sh +69 -0
  165. package/tools/tests/test-audit-agent-worktrees-broken-worktree.sh +43 -0
  166. package/tools/tests/test-audit-agent-worktrees-pending-launch-owner.sh +46 -0
  167. package/tools/tests/test-audit-agent-worktrees-unreconciled-owner.sh +79 -0
  168. package/tools/tests/test-audit-issue-routing-managed-branch-globs.sh +56 -0
  169. package/tools/tests/test-branch-verification-guard-generated-artifacts.sh +72 -0
  170. package/tools/tests/test-branch-verification-guard-targeted-coverage.sh +125 -0
  171. package/tools/tests/test-codex-quota-manager-failure-driven-rotation.sh +178 -0
  172. package/tools/tests/test-codex-quota-wrapper.sh +37 -0
  173. package/tools/tests/test-contribution-docs.sh +18 -0
  174. package/tools/tests/test-control-plane-dashboard-runtime-smoke.sh +343 -0
  175. package/tools/tests/test-create-follow-up-issue.sh +73 -0
  176. package/tools/tests/test-dashboard-launchd-bootstrap.sh +55 -0
  177. package/tools/tests/test-flow-export-execution-env-exports-repo-id.sh +30 -0
  178. package/tools/tests/test-flow-export-github-cli-auth-env-prefers-git-credential.sh +48 -0
  179. package/tools/tests/test-flow-github-api-repo-fallback-preserves-input.sh +85 -0
  180. package/tools/tests/test-flow-github-api-repo-prefers-explicit-repository-id.sh +60 -0
  181. package/tools/tests/test-flow-github-issue-list-falls-back-to-repository-id.sh +64 -0
  182. package/tools/tests/test-flow-github-pr-list-falls-back-to-repository-id.sh +77 -0
  183. package/tools/tests/test-flow-resident-can-reuse-does-not-leak-metadata.sh +52 -0
  184. package/tools/tests/test-flow-resident-reap-stale-controllers.sh +63 -0
  185. package/tools/tests/test-flow-resolve-codex-quota-tools.sh +104 -0
  186. package/tools/tests/test-flow-runtime-doctor-profile-selection.sh +27 -0
  187. package/tools/tests/test-heartbeat-codex-pr-linked-issue-exclusion.sh +79 -0
  188. package/tools/tests/test-heartbeat-hooks-enqueue-resident-issue-for-idle-controller.sh +115 -0
  189. package/tools/tests/test-heartbeat-hooks-enqueue-resident-issue-for-live-lane-controller.sh +117 -0
  190. package/tools/tests/test-heartbeat-hooks-start-resident-issue-loop-claude.sh +96 -0
  191. package/tools/tests/test-heartbeat-hooks-start-resident-issue-loop-codex.sh +96 -0
  192. package/tools/tests/test-heartbeat-hooks-start-resident-issue-loop.sh +96 -0
  193. package/tools/tests/test-heartbeat-loop-auth-wait-does-not-consume-capacity.sh +170 -0
  194. package/tools/tests/test-heartbeat-loop-blocked-recovery-lane.sh +201 -0
  195. package/tools/tests/test-heartbeat-loop-blocked-recovery-vs-pr-reservation.sh +201 -0
  196. package/tools/tests/test-heartbeat-loop-idle-resident-controller-does-not-block-launches.sh +160 -0
  197. package/tools/tests/test-heartbeat-loop-pr-launch-dedup.sh +133 -0
  198. package/tools/tests/test-heartbeat-loop-provider-cooldown-suppresses-launches.sh +157 -0
  199. package/tools/tests/test-heartbeat-loop-reaps-stale-resident-controller.sh +181 -0
  200. package/tools/tests/test-heartbeat-loop-waiting-provider-resident-controller-does-not-block-launches.sh +160 -0
  201. package/tools/tests/test-heartbeat-ready-issues-blocked-recovery.sh +134 -0
  202. package/tools/tests/test-heartbeat-safe-auto-dynamic-concurrency.sh +162 -0
  203. package/tools/tests/test-heartbeat-safe-auto-no-tmux-sessions.sh +136 -0
  204. package/tools/tests/test-heartbeat-safe-auto-openclaw-skips-codex-quota.sh +139 -0
  205. package/tools/tests/test-heartbeat-safe-auto-quota-health-signal.sh +119 -0
  206. package/tools/tests/test-heartbeat-safe-auto-stale-shared-loop-pid-does-not-skip.sh +140 -0
  207. package/tools/tests/test-heartbeat-safe-auto-static-capacity-without-quota-cache.sh +142 -0
  208. package/tools/tests/test-heartbeat-safe-auto-zero-healthy-pools.sh +141 -0
  209. package/tools/tests/test-heartbeat-sync-issue-labels-empty-schedule.sh +65 -0
  210. package/tools/tests/test-heartbeat-sync-open-agent-prs-terminal-clears-running.sh +179 -0
  211. package/tools/tests/test-install-dashboard-launchd.sh +78 -0
  212. package/tools/tests/test-install-project-launchd-adds-tool-paths.sh +87 -0
  213. package/tools/tests/test-install-project-launchd.sh +110 -0
  214. package/tools/tests/test-issue-local-workspace-install-policy.sh +81 -0
  215. package/tools/tests/test-issue-publish-scope-guard-docs-signal.sh +70 -0
  216. package/tools/tests/test-issue-reconcile-hooks-success-clears-blocked.sh +36 -0
  217. package/tools/tests/test-kick-scheduler-requires-explicit-profile.sh +47 -0
  218. package/tools/tests/test-label-follow-up-issues-falls-back-to-repository-id.sh +132 -0
  219. package/tools/tests/test-manual-operator-entrypoints-require-explicit-profile.sh +64 -0
  220. package/tools/tests/test-package-funding-metadata.sh +21 -0
  221. package/tools/tests/test-package-public-metadata.sh +62 -0
  222. package/tools/tests/test-placeholder-worker-adapters.sh +38 -0
  223. package/tools/tests/test-pr-reconcile-hooks-refreshes-recurring-issue-checklist.sh +110 -0
  224. package/tools/tests/test-pr-risk-cohesive-mobile-locale-scope.sh +70 -0
  225. package/tools/tests/test-pr-risk-fix-label-semantics.sh +114 -0
  226. package/tools/tests/test-pr-risk-local-first-no-checks.sh +70 -0
  227. package/tools/tests/test-prepare-worktree-simple-repo-baseline.sh +67 -0
  228. package/tools/tests/test-profile-activate.sh +33 -0
  229. package/tools/tests/test-profile-adopt-allow-missing-repo.sh +68 -0
  230. package/tools/tests/test-profile-adopt-skip-workspace-sync-missing-file.sh +61 -0
  231. package/tools/tests/test-profile-adopt-syncs-anchor-and-workspace.sh +90 -0
  232. package/tools/tests/test-profile-smoke-collision.sh +44 -0
  233. package/tools/tests/test-profile-smoke-invalid-claude-config.sh +31 -0
  234. package/tools/tests/test-profile-smoke-invalid-provider-pool.sh +68 -0
  235. package/tools/tests/test-profile-smoke-repo-slug-mismatch.sh +36 -0
  236. package/tools/tests/test-profile-smoke.sh +45 -0
  237. package/tools/tests/test-project-init-force-and-skip-sync.sh +61 -0
  238. package/tools/tests/test-project-init-repo-slug-mismatch.sh +29 -0
  239. package/tools/tests/test-project-init.sh +66 -0
  240. package/tools/tests/test-project-launchd-bootstrap.sh +66 -0
  241. package/tools/tests/test-project-remove.sh +150 -0
  242. package/tools/tests/test-project-runtime-supervisor.sh +47 -0
  243. package/tools/tests/test-project-runtimectl-launchd.sh +115 -0
  244. package/tools/tests/test-project-runtimectl-missing-profile.sh +54 -0
  245. package/tools/tests/test-project-runtimectl-start-falls-back-to-bootstrap.sh +108 -0
  246. package/tools/tests/test-project-runtimectl-status-reports-supervisor-as-heartbeat-parent.sh +95 -0
  247. package/tools/tests/test-project-runtimectl-status-supervisor-running.sh +59 -0
  248. package/tools/tests/test-project-runtimectl-stop-cancels-pending-kick.sh +85 -0
  249. package/tools/tests/test-project-runtimectl-stop-clears-running-labels.sh +78 -0
  250. package/tools/tests/test-project-runtimectl.sh +212 -0
  251. package/tools/tests/test-provider-cooldown-state-prefers-runtime-worker-context.sh +39 -0
  252. package/tools/tests/test-provider-cooldown-state.sh +59 -0
  253. package/tools/tests/test-public-repo-docs.sh +159 -0
  254. package/tools/tests/test-reconcile-pr-worker-acp-config-routing.sh +75 -0
  255. package/tools/tests/test-render-dashboard-snapshot.sh +149 -0
  256. package/tools/tests/test-render-flow-config-demo-profile.sh +36 -0
  257. package/tools/tests/test-render-flow-config-provider-pool-fallback.sh +81 -0
  258. package/tools/tests/test-render-flow-config.sh +52 -0
  259. package/tools/tests/test-run-codex-task-claude-routing.sh +125 -0
  260. package/tools/tests/test-run-codex-task-codex-resident-routing.sh +108 -0
  261. package/tools/tests/test-run-codex-task-kilo-routing.sh +98 -0
  262. package/tools/tests/test-run-codex-task-openclaw-resident-routing.sh +117 -0
  263. package/tools/tests/test-run-codex-task-openclaw-routing.sh +113 -0
  264. package/tools/tests/test-run-codex-task-opencode-routing.sh +98 -0
  265. package/tools/tests/test-run-codex-task-provider-pool-fallback-routing.sh +146 -0
  266. package/tools/tests/test-scaffold-profile.sh +108 -0
  267. package/tools/tests/test-serve-dashboard.sh +93 -0
  268. package/tools/tests/test-start-issue-worker-blocked-context.sh +129 -0
  269. package/tools/tests/test-start-issue-worker-blocks-complete-recurring-checklist.sh +189 -0
  270. package/tools/tests/test-start-issue-worker-local-install-routing.sh +157 -0
  271. package/tools/tests/test-start-issue-worker-profile-template-routing.sh +149 -0
  272. package/tools/tests/test-start-issue-worker-recurring-resident-reuse-codex.sh +212 -0
  273. package/tools/tests/test-start-issue-worker-recurring-resident-reuse.sh +219 -0
  274. package/tools/tests/test-start-issue-worker-renders-verification-snippet.sh +155 -0
  275. package/tools/tests/test-start-issue-worker-resident-reuse-falls-back-to-new-worktree.sh +199 -0
  276. package/tools/tests/test-start-pr-fix-worker-host-blocker-context.sh +275 -0
  277. package/tools/tests/test-start-resident-issue-loop-adopts-next-recurring-issue.sh +185 -0
  278. package/tools/tests/test-start-resident-issue-loop-clears-pending-while-waiting-due.sh +152 -0
  279. package/tools/tests/test-start-resident-issue-loop-consumes-queued-lease.sh +186 -0
  280. package/tools/tests/test-start-resident-issue-loop-fails-over-provider-pool.sh +212 -0
  281. package/tools/tests/test-start-resident-issue-loop-immediate-cycles.sh +148 -0
  282. package/tools/tests/test-start-resident-issue-loop-waits-for-provider.sh +194 -0
  283. package/tools/tests/test-start-resident-issue-loop-waits-for-terminal-reconcile-status.sh +198 -0
  284. package/tools/tests/test-start-resident-issue-loop-yields-to-live-lane-controller.sh +145 -0
  285. package/tools/tests/test-sync-pr-labels-fix-lane-uses-repair-queued.sh +67 -0
  286. package/tools/tests/test-sync-recurring-issue-checklist-backfills-workflow-complete-blocker.sh +70 -0
  287. package/tools/tests/test-sync-recurring-issue-checklist.sh +95 -0
  288. package/tools/tests/test-sync-shared-agent-home-local-source-root.sh +66 -0
  289. package/tools/tests/test-sync-shared-agent-home-preserves-unrelated-workflow-catalog-skill.sh +47 -0
  290. package/tools/tests/test-test-smoke.sh +86 -0
  291. package/tools/tests/test-uninstall-project-launchd.sh +37 -0
  292. package/tools/tests/test-update-github-labels-prefers-sibling-helper.sh +49 -0
  293. package/tools/tests/test-workflow-catalog.sh +43 -0
  294. package/tools/vendor/codex-quota/LICENSE +21 -0
  295. package/tools/vendor/codex-quota/README.md +459 -0
  296. package/tools/vendor/codex-quota/codex-quota.js +261 -0
  297. package/tools/vendor/codex-quota/lib/claude-accounts.js +226 -0
  298. package/tools/vendor/codex-quota/lib/claude-oauth.js +174 -0
  299. package/tools/vendor/codex-quota/lib/claude-tokens.js +471 -0
  300. package/tools/vendor/codex-quota/lib/claude-usage.js +929 -0
  301. package/tools/vendor/codex-quota/lib/codex-accounts.js +205 -0
  302. package/tools/vendor/codex-quota/lib/codex-tokens.js +326 -0
  303. package/tools/vendor/codex-quota/lib/codex-usage.js +32 -0
  304. package/tools/vendor/codex-quota/lib/color.js +72 -0
  305. package/tools/vendor/codex-quota/lib/constants.js +57 -0
  306. package/tools/vendor/codex-quota/lib/container.js +143 -0
  307. package/tools/vendor/codex-quota/lib/display.js +1111 -0
  308. package/tools/vendor/codex-quota/lib/fs.js +63 -0
  309. package/tools/vendor/codex-quota/lib/handlers.js +2060 -0
  310. package/tools/vendor/codex-quota/lib/jwt.js +33 -0
  311. package/tools/vendor/codex-quota/lib/oauth.js +486 -0
  312. package/tools/vendor/codex-quota/lib/paths.js +34 -0
  313. package/tools/vendor/codex-quota/lib/prompts.js +44 -0
  314. package/tools/vendor/codex-quota/lib/sync.js +1438 -0
  315. package/tools/vendor/codex-quota/lib/token-match.js +96 -0
  316. package/tools/vendor/codex-quota-manager/scripts/auto-switch.sh +500 -0
  317. package/tools/vendor/codex-quota-manager/scripts/batch-add.sh +123 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ducminhnguyen0319
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,589 @@
1
+ # agent-control-plane
2
+
3
+ <p>
4
+ <a href="https://github.com/ducminhuyen0319/agent-control-plane/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/ducminhuyen0319/agent-control-plane/actions/workflows/ci.yml/badge.svg?branch=main"></a>
5
+ <a href="https://www.npmjs.com/package/agent-control-plane"><img alt="npm version" src="https://img.shields.io/npm/v/agent-control-plane?style=flat-square"></a>
6
+ <a href="https://www.npmjs.com/package/agent-control-plane"><img alt="node version" src="https://img.shields.io/node/v/agent-control-plane?style=flat-square"></a>
7
+ <a href="./LICENSE"><img alt="license" src="https://img.shields.io/npm/l/agent-control-plane?style=flat-square"></a>
8
+ <a href="https://github.com/sponsors/ducminhnguyen0319"><img alt="GitHub Sponsors" src="https://img.shields.io/badge/sponsor-GitHub%20Sponsors-ea4aaa?style=flat-square&logo=githubsponsors&logoColor=white"></a>
9
+ </p>
10
+
11
+ `agent-control-plane` helps a repo keep coding agents running reliably without
12
+ constant human babysitting.
13
+
14
+ It is the operator layer for coding agents that need to keep running after the
15
+ novelty wears off.
16
+
17
+ License: `MIT`
18
+
19
+ Changelog: [CHANGELOG.md](./CHANGELOG.md)
20
+
21
+ Roadmap: [ROADMAP.md](./ROADMAP.md)
22
+
23
+ Architecture: [references/architecture.md](./references/architecture.md)
24
+
25
+ Commands: [references/commands.md](./references/commands.md)
26
+
27
+ It turns a GitHub repo into a managed runtime with a repeatable setup, a stable
28
+ place for state, a real status command, and a dashboard you can glance at
29
+ without spelunking through temp folders, worktrees, or half-remembered `tmux`
30
+ sessions.
31
+
32
+ ACP does not try to be the coding agent itself. It makes the surrounding system
33
+ less fragile: profile setup, runtime start and stop, heartbeat scheduling,
34
+ reconcile-owned outcomes, background execution, and operator visibility under
35
+ `~/.agent-runtime`.
36
+
37
+ The promise is intentionally boring in the best possible way: your agents stay
38
+ busy, your runtime stays understandable, and the repo keeps moving even when
39
+ you are not sitting there manually babysitting every loop, retry, or publish
40
+ decision.
41
+
42
+ ## Why people use it
43
+
44
+ ACP is useful when you want agent workflows to feel operational instead of
45
+ fragile, improvised, or tied to one lucky terminal session.
46
+
47
+ - replace human babysitting with boring runtime ownership: supervisor,
48
+ heartbeat, reconcile, and status tooling
49
+ - one profile per repo, so every project has a clear runtime identity
50
+ - start, stop, restart, and status commands that behave like operator tooling
51
+ - dashboard visibility instead of hunting through `tmux` panes and temp folders
52
+ - smoke checks before you trust the runtime on real work
53
+ - optional macOS autostart so a reboot does not reset your flow
54
+ - room for multiple worker backends without changing how you operate the repo
55
+
56
+ ACP is a good fit when your pain is not "the agent cannot code" but "the setup
57
+ around the agent is too easy to break."
58
+
59
+ ## Use Cases
60
+
61
+ Teams and solo builders usually reach for ACP when one of these starts to feel
62
+ familiar:
63
+
64
+ - you want issue-driven or PR-driven agent work to keep running in the
65
+ background, but still be inspectable
66
+ - you are juggling more than one repo and want each one to have a clean,
67
+ separate runtime identity
68
+ - you want to swap or compare worker backends without rebuilding your runtime
69
+ habits every time
70
+ - you want one command to tell you whether automation is healthy instead of
71
+ inferring it from stale branches, dangling sessions, or mystery files
72
+ - you want a dashboard and smoke checks before you trust the setup on real work
73
+ - you want your local machine to behave more like a reliable operator box and
74
+ less like a pile of shell history
75
+
76
+ If you have ever thought "the agent part basically works, but the runtime
77
+ around it is messy," this tool is aimed directly at that problem.
78
+
79
+ ## Roadmap
80
+
81
+ ACP is moving toward a true multi-backend control plane.
82
+
83
+ - available now: `codex`, `claude`, `openclaw`
84
+ - planned next: `opencode`, `kilo`, `gemini-cli`
85
+ - platform roadmap now calls out Linux, Windows via WSL2, and the longer-term
86
+ native Windows story explicitly
87
+ - adjacent ecosystem targets now include local-model and neighboring runtimes
88
+ such as `ollama`, `nanoclaw`, and `picoclaw`
89
+ - roadmap matrix now distinguishes implemented backends from placeholder
90
+ scaffolds so users can see what is ready today versus what is being prepared
91
+ - long-term direction: one runtime and dashboard for many coding-agent backends
92
+
93
+ ### Backend Snapshot
94
+
95
+ | Backend | What You Can Expect Today |
96
+ | --- | --- |
97
+ | `codex` | Ready for real ACP workflows today. |
98
+ | `claude` | Ready for real ACP workflows today. |
99
+ | `openclaw` | Ready for real ACP workflows today, including resident-style runs. |
100
+ | `opencode` | Scaffolded in the package so routing and docs can evolve, but not implemented for live execution yet. |
101
+ | `kilo` | Scaffolded in the package so routing and docs can evolve, but not implemented for live execution yet. |
102
+ | `gemini-cli` | Not wired into ACP yet, but on the public roadmap as a strong future worker candidate. |
103
+
104
+ ### Support Matrix
105
+
106
+ | Target | Kind | ACP Relationship Today | Current Status |
107
+ | --- | --- | --- | --- |
108
+ | `codex` | direct worker | First-class ACP worker backend | production-ready path today |
109
+ | `claude` | direct worker | First-class ACP worker backend | production-ready path today |
110
+ | `openclaw` | direct worker | First-class ACP worker backend with resident workflow support | production-ready path today |
111
+ | `opencode` | direct worker | Planned future worker adapter | placeholder scaffold only |
112
+ | `kilo` | direct worker | Planned future worker adapter | placeholder scaffold only |
113
+ | `gemini-cli` | direct worker | Research target for a future worker adapter | roadmap candidate |
114
+ | `ollama` | local model runtime | Candidate local-model substrate behind future ACP integrations | research target |
115
+ | `nanoclaw` | adjacent agent shell | Ecosystem reference for containerized and WSL2-friendly workflows | exploratory interoperability target |
116
+ | `picoclaw` | adjacent agent shell | Ecosystem reference for lightweight Linux and edge-style agent runtimes | exploratory interoperability target |
117
+
118
+ If you are trying ACP on a real repo right now, start with `codex`, `claude`,
119
+ or `openclaw`. The other adapters are there to show the direction of travel,
120
+ not to pretend support is already complete.
121
+
122
+ See [ROADMAP.md](./ROADMAP.md) for the fuller public roadmap.
123
+
124
+ ## See It Running
125
+
126
+ The dashboard media below is rendered from a real local ACP demo fixture using
127
+ `bash tools/bin/render-dashboard-demo-media.sh`.
128
+
129
+ ![ACP dashboard demo screenshot](./assets/readme/dashboard-demo.png)
130
+
131
+ <details>
132
+ <summary>Animated dashboard walkthrough</summary>
133
+
134
+ ![ACP dashboard demo walkthrough](./assets/readme/dashboard-demo.gif)
135
+
136
+ </details>
137
+
138
+ ## Architecture
139
+
140
+ ACP is easiest to trust once you can see the moving pieces. The short version
141
+ is: the npm package stages a shared runtime, installed profiles live outside
142
+ the package, a shared heartbeat loop decides what to launch, worker adapters do
143
+ the coding work, and reconcile scripts own the GitHub-facing outcome.
144
+
145
+ ```mermaid
146
+ flowchart LR
147
+ User[Operator] --> CLI["agent-control-plane.js"]
148
+ CLI --> Profiles["installed profiles"]
149
+ CLI --> RuntimeHome["runtime-home"]
150
+ CLI --> RuntimeCtl["project-runtimectl.sh"]
151
+ RuntimeCtl --> Supervisor["project-runtime-supervisor.sh"]
152
+ Supervisor --> Heartbeat["heartbeat-safe-auto.sh"]
153
+ Heartbeat --> Scheduler["agent-project-heartbeat-loop"]
154
+ Scheduler --> Workers["issue / PR worker launchers"]
155
+ Workers --> Backends["codex / claude / openclaw"]
156
+ Backends --> Reconcile["reconcile issue / PR session"]
157
+ Reconcile --> GitHub["issues / PRs / labels / comments"]
158
+ Scheduler --> State["runs + state + history"]
159
+ State --> Dashboard["dashboard snapshot + UI"]
160
+ ```
161
+
162
+ ### Runtime Loop At A Glance
163
+
164
+ ```mermaid
165
+ sequenceDiagram
166
+ participant Operator
167
+ participant RuntimeCtl as project-runtimectl
168
+ participant Supervisor
169
+ participant Bootstrap
170
+ participant Heartbeat
171
+ participant Worker
172
+ participant Reconcile
173
+ participant GitHub
174
+
175
+ Operator->>RuntimeCtl: runtime start --profile-id <id>
176
+ RuntimeCtl->>Supervisor: keep runtime alive
177
+ loop each pass
178
+ Supervisor->>Bootstrap: run profile bootstrap
179
+ Bootstrap->>Heartbeat: invoke published heartbeat
180
+ Heartbeat->>Worker: launch eligible issue/PR flow
181
+ Worker->>Reconcile: emit result artifacts
182
+ Reconcile->>GitHub: labels, comments, PR actions
183
+ end
184
+ ```
185
+
186
+ Architecture shortcuts:
187
+
188
+ - [System overview](./references/architecture.md#system-overview)
189
+ - [Install and publication flow](./references/architecture.md#install-and-publication-flow)
190
+ - [Runtime scheduler loop](./references/architecture.md#runtime-scheduler-loop)
191
+ - [Worker session lifecycle](./references/architecture.md#worker-session-lifecycle)
192
+ - [Dashboard snapshot pipeline](./references/architecture.md#dashboard-snapshot-pipeline)
193
+ - [Control plane ownership map](./references/control-plane-map.md)
194
+
195
+ Visual assets:
196
+
197
+ - [Architecture deck PDF](./assets/architecture/agent-control-plane-architecture.pdf)
198
+ - [Overview infographic](./assets/architecture/overview-infographic.png)
199
+ - [Runtime loop infographic](./assets/architecture/runtime-loop-infographic.png)
200
+ - [Worker lifecycle infographic](./assets/architecture/worker-lifecycle-infographic.png)
201
+ - [State and dashboard infographic](./assets/architecture/state-dashboard-infographic.png)
202
+
203
+ ## Prerequisites
204
+
205
+ ACP is a shell-first operator tool. Most install problems become much easier to
206
+ debug once it is clear which dependency is responsible for which part of the
207
+ system.
208
+
209
+ | Tool | Required | Why ACP uses it | Notes |
210
+ | --- | --- | --- | --- |
211
+ | Node.js `>= 18` | yes | Runs the npm package entrypoint and `npx agent-control-plane ...` wrapper. | ACP declares `>= 18`. CI currently runs on Node `22`, so newer maintained versions are expected to work too. If you are already on Node `20` or `22`, you do not need to downgrade. |
212
+ | `bash` | yes | Most runtime, profile, and worker orchestration scripts are Bash-based. | Your login shell can be `zsh` or something else, but `bash` must exist on `PATH`. |
213
+ | `git` | yes | ACP manages worktrees, checks branch state, and coordinates repo-local automation state. | Required even if you mainly interact through GitHub issues and PRs. |
214
+ | `gh` | yes | ACP uses GitHub CLI auth and API access for issues, PRs, labels, and repo metadata. | Run `gh auth login` before first real use. |
215
+ | `jq` | yes | Several runtime and GitHub flows parse JSON from `gh` and worker metadata. | If `jq` is missing, some operator flows will fail even though the npm package itself installs fine. |
216
+ | `python3` | yes | Powers the dashboard server, snapshot renderer, and a few config/render helpers. | Required for both dashboard use and several internal helper scripts. |
217
+ | `tmux` | yes | ACP runs long-lived worker sessions and captures status through `tmux`. | If `tmux` is missing, background worker workflows will not launch. |
218
+ | Worker CLI: `codex`, `claude`, or `openclaw` | depends on backend | The actual coding worker for a profile. | You only need the backend you plan to choose via `--coding-worker`. Authenticate that backend before starting recurring or background runs. |
219
+ | Bundled `codex-quota` plus ACP quota manager | automatic for Codex profiles | Improves Codex quota-aware failover and health signals. | ACP now ships a maintained `codex-quota` fork and a first-party manager script for Codex worker flows. You only need an external install if you intentionally override `ACP_CODEX_QUOTA_BIN` or `ACP_CODEX_QUOTA_MANAGER_SCRIPT`. |
220
+ | `playwright` and `ffmpeg` | maintainer-only | Regenerate the README dashboard screenshot and GIF. | Needed for `bash tools/bin/render-dashboard-demo-media.sh`, not for everyday ACP use. |
221
+
222
+ Before you start background runtimes, make sure `gh` and whichever worker
223
+ backend you plan to use are already authenticated for the same OS user.
224
+
225
+ For Codex-backed profiles, ACP will use the bundled quota tooling by default.
226
+ That keeps quota-aware rotation inside the same package and avoids depending on
227
+ an unmaintained external install. If you already have a custom `codex-quota`
228
+ setup you want to keep, point ACP at it explicitly with
229
+ `ACP_CODEX_QUOTA_BIN=/path/to/codex-quota` and optionally
230
+ `ACP_CODEX_QUOTA_MANAGER_SCRIPT=/path/to/auto-switch.sh`.
231
+
232
+ ## Install
233
+
234
+ The easiest way to try ACP is with `npx`:
235
+
236
+ ```bash
237
+ npx agent-control-plane@latest help
238
+ ```
239
+
240
+ If you use it often, a global install gives you a shorter command:
241
+
242
+ ```bash
243
+ npm install -g agent-control-plane
244
+ agent-control-plane help
245
+ ```
246
+
247
+ The examples below use `npx agent-control-plane@latest ...`, but every command
248
+ works the same way after a global install.
249
+
250
+ ## Support the Project
251
+
252
+ If ACP saves you time, helps you keep agent workflows sane, or simply makes
253
+ background automation less annoying, you can support the project.
254
+
255
+ - sponsor the maintainer on GitHub:
256
+ `https://github.com/sponsors/ducminhnguyen0319`
257
+ - use the npm `funding` metadata so `npm fund` points people to the same place
258
+ - keep the open source core free, then layer in paid help or team features later
259
+
260
+ If you fork or republish this package under another maintainer account, update
261
+ the sponsor links in `package.json` and `.github/FUNDING.yml`.
262
+
263
+ ### Sponsorship Policy
264
+
265
+ Sponsorships for this repository are maintainer-managed project support.
266
+
267
+ - sponsorships go to the maintainer account linked in the sponsor button
268
+ - sponsorship does not transfer ownership, copyright, patent rights, or control
269
+ over the project
270
+ - contributors are not automatically entitled to sponsorship payouts
271
+ - the maintainer may choose to use sponsorship funds for project maintenance,
272
+ infrastructure, contributor rewards, or other project-related work at their
273
+ discretion
274
+
275
+ ## First Run
276
+
277
+ The shortest path is now a guided setup flow:
278
+
279
+ ```bash
280
+ npx agent-control-plane@latest setup
281
+ ```
282
+
283
+ `setup` detects the current repo when it can, suggests sane managed paths under
284
+ `~/.agent-runtime/projects/<profile-id>`, offers to install missing core tools
285
+ when it knows how, can prompt to run `gh auth login`, runs `sync`, scaffolds
286
+ the profile, checks doctor status, reports core tool and auth readiness, and
287
+ can optionally start the runtime for you.
288
+
289
+ Use it when you want ACP to walk you through the install instead of assembling
290
+ the bootstrap sequence by hand.
291
+
292
+ During `setup`, ACP can:
293
+
294
+ - auto-detect the current repo root and GitHub slug when you run it inside a
295
+ checkout with `origin` configured
296
+ - offer to install missing core tools like `gh`, `jq`, `python3`, or `tmux`
297
+ through supported package managers such as `brew`, `apt-get`, `dnf`, `yum`,
298
+ and `pacman`
299
+ - prompt to run `gh auth login` before ACP tries to start background runtime
300
+ flows
301
+ - offer to install supported worker backends like `codex`, `claude`, or
302
+ `openclaw` when ACP knows a safe install command, and otherwise show
303
+ backend-specific next steps, install/auth/verify examples, and a docs URL it
304
+ can open for you on interactive machines
305
+ - run one final fix-up summary at the end so you can clear whatever is still
306
+ red instead of guessing which step to retry next
307
+ - scaffold the profile, run doctor checks, and optionally start the runtime in
308
+ one guided pass
309
+
310
+ The wizard now automates ACP's shell/runtime prerequisites and can also
311
+ auto-install supported worker CLIs through npm. If ACP cannot or should not
312
+ install the selected backend itself, it will tell you what is missing, print
313
+ backend-specific next steps, and offer to open the right setup docs before ACP
314
+ tries to launch it.
315
+
316
+ If you want the same flow without prompts, use flags such as
317
+ `--non-interactive`, `--install-missing-deps`, `--gh-auth-login`,
318
+ `--start-runtime`, and `--json`.
319
+
320
+ If you want to inspect the entire onboarding plan before ACP touches your
321
+ machine, run:
322
+
323
+ ```bash
324
+ npx agent-control-plane@latest setup --dry-run
325
+ ```
326
+
327
+ That mode renders the detected repo/profile values, dependency and backend
328
+ install commands, auth steps, runtime/launchd intent, and a final fix-up plan
329
+ without writing files, installing packages, or launching background services.
330
+
331
+ If you are building a GUI installer, setup assistant, or another frontend
332
+ around ACP, add `--json` to either the real run or the dry-run preview. ACP
333
+ will emit exactly one JSON object on `stdout` and send progress logs to
334
+ `stderr`, which keeps parsing stable.
335
+
336
+ If you want the explicit manual path, the happy path is still:
337
+
338
+ 1. authenticate GitHub
339
+ 2. sync the packaged runtime into `~/.agent-runtime`
340
+ 3. create one profile for one repo
341
+ 4. run quick health checks
342
+ 5. start the runtime and confirm it answers to you
343
+
344
+ If that feels more like installing an operator tool than a toy demo, that is
345
+ intentional.
346
+
347
+ ### 1. Authenticate GitHub first
348
+
349
+ ```bash
350
+ gh auth login
351
+ ```
352
+
353
+ ACP assumes GitHub access is already in place before you ask it to manage repo
354
+ automation. If `gh` cannot see the repo, the rest of the flow will feel broken
355
+ for reasons that have nothing to do with ACP.
356
+
357
+ ### 2. Install or refresh the packaged runtime
358
+
359
+ ```bash
360
+ npx agent-control-plane@latest sync
361
+ ```
362
+
363
+ This publishes the packaged ACP runtime into `~/.agent-runtime/runtime-home`.
364
+ You can safely run it again after upgrades. Think of this as "put the operator
365
+ tooling in place on disk" before you wire it to a specific repo.
366
+
367
+ ### 3. Create one profile for one repo manually
368
+
369
+ ```bash
370
+ npx agent-control-plane@latest init \
371
+ --profile-id my-repo \
372
+ --repo-slug owner/my-repo \
373
+ --repo-root ~/src/my-repo \
374
+ --agent-root ~/.agent-runtime/projects/my-repo \
375
+ --worktree-root ~/src/my-repo-worktrees \
376
+ --coding-worker openclaw
377
+ ```
378
+
379
+ That single command tells ACP what repo to manage, where its runtime state
380
+ should live, where worktrees belong, and which worker backend you want ACP to
381
+ orchestrate.
382
+
383
+ What those flags mean:
384
+
385
+ - `--profile-id` is the short name you will use in ACP commands
386
+ - `--repo-slug` is the GitHub repo ACP should track
387
+ - `--repo-root` points at your local checkout
388
+ - `--agent-root` is where ACP keeps per-project runtime state
389
+ - `--worktree-root` is where ACP can place repo worktrees
390
+ - `--coding-worker` picks the backend ACP should orchestrate
391
+
392
+ ### 4. Validate before you trust it
393
+
394
+ ```bash
395
+ npx agent-control-plane@latest doctor
396
+ npx agent-control-plane@latest profile-smoke --profile-id my-repo
397
+ ```
398
+
399
+ This is the "trust, but verify" step. `doctor` checks installation health, and
400
+ `profile-smoke` gives one profile a fast confidence pass before you turn on
401
+ background loops.
402
+
403
+ ### 5. Start the runtime and make sure it answers back
404
+
405
+ ```bash
406
+ npx agent-control-plane@latest runtime start --profile-id my-repo
407
+ npx agent-control-plane@latest runtime status --profile-id my-repo
408
+ ```
409
+
410
+ At this point ACP is no longer just installed. It is actively managing the
411
+ runtime for that profile. If `runtime status` feels boring and readable, that
412
+ is a good sign. That is exactly the point.
413
+
414
+ ## What Happens After `runtime start`
415
+
416
+ ACP takes the profile you installed and runs it like an operator would:
417
+
418
+ - it uses the installed runtime layout under `~/.agent-runtime`
419
+ - it keeps per-profile state grouped together instead of scattered everywhere
420
+ - it gives you a stable `runtime status` command for health checks
421
+ - it lets you inspect the system through the dashboard rather than memory
422
+
423
+ That matters most when the setup grows beyond one-off experiments and becomes
424
+ something you want to keep running.
425
+
426
+ ## Everyday Usage
427
+
428
+ Check runtime state:
429
+
430
+ ```bash
431
+ npx agent-control-plane@latest runtime status --profile-id my-repo
432
+ ```
433
+
434
+ Restart the runtime:
435
+
436
+ ```bash
437
+ npx agent-control-plane@latest runtime restart --profile-id my-repo
438
+ ```
439
+
440
+ Stop the runtime:
441
+
442
+ ```bash
443
+ npx agent-control-plane@latest runtime stop --profile-id my-repo
444
+ ```
445
+
446
+ Run smoke checks:
447
+
448
+ ```bash
449
+ npx agent-control-plane@latest profile-smoke --profile-id my-repo
450
+ npx agent-control-plane@latest smoke
451
+ ```
452
+
453
+ This is the rhythm ACP is built for: install once, inspect often, restart when
454
+ needed, and keep the runtime understandable.
455
+
456
+ ## Dashboard
457
+
458
+ Run the dashboard locally:
459
+
460
+ ```bash
461
+ npx agent-control-plane@latest dashboard --host 127.0.0.1 --port 8765
462
+ ```
463
+
464
+ Then open:
465
+
466
+ ```text
467
+ http://127.0.0.1:8765
468
+ ```
469
+
470
+ The dashboard is where ACP gets much more pleasant to use. Instead of treating
471
+ automation like a black box, you can track profiles, runtime state, and system
472
+ activity in one place.
473
+
474
+ ## Contributing
475
+
476
+ Contributions are welcome, but this repo uses a contributor agreement so the
477
+ project can stay easy to maintain and relicense if needed.
478
+
479
+ - contribution guide: [CONTRIBUTING.md](./CONTRIBUTING.md)
480
+ - contributor agreement: [CLA.md](./CLA.md)
481
+
482
+ ## Security
483
+
484
+ If you find a vulnerability, do not open a public issue first.
485
+
486
+ - security policy: [SECURITY.md](./SECURITY.md)
487
+ - code of conduct: [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
488
+
489
+ ## Releases
490
+
491
+ - release history: [CHANGELOG.md](./CHANGELOG.md)
492
+ - maintainer checklist: [references/release-checklist.md](./references/release-checklist.md)
493
+
494
+ ## macOS Autostart
495
+
496
+ If you want a profile runtime to come back automatically after login or reboot:
497
+
498
+ ```bash
499
+ npx agent-control-plane@latest launchd-install --profile-id my-repo
500
+ ```
501
+
502
+ Remove that autostart entry:
503
+
504
+ ```bash
505
+ npx agent-control-plane@latest launchd-uninstall --profile-id my-repo
506
+ ```
507
+
508
+ These commands are macOS-only because they manage per-user `launchd` agents.
509
+
510
+ ## Update
511
+
512
+ Refresh the installed runtime after upgrading the package:
513
+
514
+ ```bash
515
+ npx agent-control-plane@latest sync
516
+ npx agent-control-plane@latest doctor
517
+ ```
518
+
519
+ Optional confidence check:
520
+
521
+ ```bash
522
+ npx agent-control-plane@latest smoke
523
+ ```
524
+
525
+ This keeps the runtime on disk aligned with the packaged version you just
526
+ installed.
527
+
528
+ ## Remove a Profile
529
+
530
+ Delete one installed profile and its ACP-managed runtime state:
531
+
532
+ ```bash
533
+ npx agent-control-plane@latest remove --profile-id my-repo
534
+ ```
535
+
536
+ Also remove ACP-managed repo and worktree paths:
537
+
538
+ ```bash
539
+ npx agent-control-plane@latest remove --profile-id my-repo --purge-paths
540
+ ```
541
+
542
+ Use `--purge-paths` only when you want ACP-managed directories removed too.
543
+
544
+ ## Troubleshooting
545
+
546
+ - `profile not installed`
547
+ Run `init` first, then retry with the same `--profile-id`.
548
+ - `explicit profile selection required`
549
+ Pass `--profile-id <id>` to `runtime`, `launchd-install`,
550
+ `launchd-uninstall`, and `remove`.
551
+ - `gh` cannot access the repo
552
+ Re-run `gh auth login` and confirm the repo slug in the profile is correct.
553
+ - backend auth failures from `codex`, `claude`, or `openclaw`
554
+ Authenticate that backend before starting ACP in the background.
555
+ - `node` is older than `18`
556
+ Upgrade Node first. ACP's package contract starts at `18+`.
557
+ - you are already on Node `20` or `22`
558
+ That is fine. The package only has a minimum version, not a maximum.
559
+ - missing `jq`
560
+ Install `jq`, then retry the GitHub- or runtime-heavy command that failed.
561
+ - runtime or source drift after updates
562
+ Run `sync`, then `doctor`.
563
+ - missing `tmux`, `gh`, or `python3`
564
+ Install the dependency, then retry `sync` or `runtime start`.
565
+ - missing `codex-quota`
566
+ This is only an optional Codex enhancement. Core ACP installation and most
567
+ non-Codex flows do not require it.
568
+
569
+ ## Command Summary
570
+
571
+ | Command | What it is for | Key args and parameters |
572
+ | --- | --- | --- |
573
+ | `npx agent-control-plane@latest help` | Show the public CLI surface. | No args. Good first command on a new machine. |
574
+ | `npx agent-control-plane@latest version` | Print the package version you are actually running. | No args. Useful when comparing local output to docs or release notes. |
575
+ | `npx agent-control-plane@latest setup` | Guided bootstrap for one repo profile. | Auto-detects repo details when possible, prompts for missing values, can install missing core tools, supported worker backends, and run `gh auth login`, then runs `sync`, `init`, health checks, optional runtime start, and a final fix-up pass. Add `--json` for one structured JSON result on `stdout`. |
576
+ | `npx agent-control-plane@latest setup --dry-run` | Preview exactly what setup would do without changing the machine. | Also available as `--plan`. Prints detected paths, command previews, auth/runtime intentions, and final fix-up plan. Add `--json` for a machine-readable plan object. |
577
+ | `npx agent-control-plane@latest sync` | Publish or refresh the packaged runtime into `~/.agent-runtime/runtime-home`. | No required args. Run this after install or upgrade. |
578
+ | `npx agent-control-plane@latest install` | Alias for `sync`. | Same behavior as `sync`. |
579
+ | `npx agent-control-plane@latest init ...` | Scaffold and adopt one repo profile. | Usually includes `--profile-id`, `--repo-slug`, `--repo-root`, `--agent-root`, `--worktree-root`, and `--coding-worker`. Helpful bootstrap flags include `--allow-missing-repo`, `--skip-anchor-sync`, and `--skip-workspace-sync`. |
580
+ | `npx agent-control-plane@latest doctor` | Inspect runtime/source installation health. | No required args. Use after `sync` or when something feels off. |
581
+ | `npx agent-control-plane@latest profile-smoke [--profile-id <id>]` | Validate one installed profile before you trust it. | `--profile-id` is recommended when more than one profile exists. |
582
+ | `npx agent-control-plane@latest runtime <status|start|stop|restart> --profile-id <id>` | Operate one profile runtime. | `--profile-id` is required for real use. Subcommands are `status`, `start`, `stop`, and `restart`. |
583
+ | `npx agent-control-plane@latest dashboard [--host 127.0.0.1] [--port 8765]` | Start the local monitoring dashboard. | `--host` and `--port` are optional; defaults are good for most local setups. |
584
+ | `npx agent-control-plane@latest launchd-install --profile-id <id>` | Install a per-profile LaunchAgent on macOS. | macOS only. Requires `--profile-id`. |
585
+ | `npx agent-control-plane@latest launchd-uninstall --profile-id <id>` | Remove a per-profile LaunchAgent on macOS. | macOS only. Requires `--profile-id`. |
586
+ | `npx agent-control-plane@latest remove --profile-id <id> [--purge-paths]` | Remove an installed profile and ACP-managed state. | `--purge-paths` also deletes ACP-managed repo/worktree paths, so use it carefully. |
587
+ | `npx agent-control-plane@latest smoke` | Run the packaged smoke suite for the shared control plane. | No required args. Best used after `sync` or before a public release. |
588
+
589
+ For a lower-level script map, see [references/commands.md](./references/commands.md).