chainlesschain 0.163.6 → 0.163.7

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 (218) hide show
  1. package/package.json +1 -1
  2. package/src/assets/web-panel/assets/{AIOps-DDIUofA8.js → AIOps-axqQfwv8.js} +1 -1
  3. package/src/assets/web-panel/assets/{ActionButton-Bm-5xYRn.js → ActionButton-DV-Ro0By.js} +1 -1
  4. package/src/assets/web-panel/assets/{Analytics-D5UH4ljI.js → Analytics-Bt72WEVu.js} +3 -3
  5. package/src/assets/web-panel/assets/{AppLayout-D_ifjOOP.js → AppLayout-BtepG55E.js} +5 -5
  6. package/src/assets/web-panel/assets/{Artifacts-BY1mXdC7.js → Artifacts-B7KaJ7S_.js} +1 -1
  7. package/src/assets/web-panel/assets/{Audit-Bujr4Ml3.js → Audit-FNFaUg7A.js} +1 -1
  8. package/src/assets/web-panel/assets/{BackgroundAgents-sioKSTcC.js → BackgroundAgents-DFb6J2wQ.js} +1 -1
  9. package/src/assets/web-panel/assets/{Backup-DDOAK8RK.js → Backup-CC7YBhyj.js} +1 -1
  10. package/src/assets/web-panel/assets/{BaseInput-CtCsVVke.js → BaseInput-RkgTNVtj.js} +1 -1
  11. package/src/assets/web-panel/assets/{Chat-DpNj0vnd.js → Chat-hHEmGZy-.js} +4 -4
  12. package/src/assets/web-panel/assets/{ChatBubbleRenderer-CZta3Ftr.js → ChatBubbleRenderer-CAP9YhHv.js} +1 -1
  13. package/src/assets/web-panel/assets/{Checkbox-DoHVNSXq.js → Checkbox-z5wXOQP1.js} +1 -1
  14. package/src/assets/web-panel/assets/{Codegen-DlVl7Qmv.js → Codegen-DVaDJnxy.js} +1 -1
  15. package/src/assets/web-panel/assets/{Col-GIqoPYty.js → Col-CJmaRDR5.js} +1 -1
  16. package/src/assets/web-panel/assets/{Community-CIAPEVji.js → Community-DF29_2bI.js} +1 -1
  17. package/src/assets/web-panel/assets/{Compact-BN7JiI_h.js → Compact-DtkQkBzn.js} +1 -1
  18. package/src/assets/web-panel/assets/{Compliance-CqUWCM9B.js → Compliance-xoHDxp7I.js} +1 -1
  19. package/src/assets/web-panel/assets/{Cowork-A4iPp7A4.js → Cowork-BUm-R7ht.js} +3 -3
  20. package/src/assets/web-panel/assets/{Cron-B2zeXXWb.js → Cron-Cgl14ZkB.js} +2 -2
  21. package/src/assets/web-panel/assets/{Crosschain-BR2xmWr8.js → Crosschain-BNcbmoqh.js} +1 -1
  22. package/src/assets/web-panel/assets/{DID-BzFDjrIv.js → DID-Bwja0Zo9.js} +2 -2
  23. package/src/assets/web-panel/assets/{Dashboard-DKtDo3yA.js → Dashboard-Bk5XjEdJ.js} +2 -2
  24. package/src/assets/web-panel/assets/{Dropdown-RNx43_YG.js → Dropdown-Ci36Oitq.js} +1 -1
  25. package/src/assets/web-panel/assets/{EmailListRenderer-SwMt4Rcy.js → EmailListRenderer--U04ZN4q.js} +1 -1
  26. package/src/assets/web-panel/assets/{FamilyGuardDashboard-CsYebZ4X.js → FamilyGuardDashboard-B2gNPR2s.js} +1 -1
  27. package/src/assets/web-panel/assets/{Federation-BmRKvBTy.js → Federation-C4KghYn7.js} +1 -1
  28. package/src/assets/web-panel/assets/{FormItemContext-CVxGTA-0.js → FormItemContext-QL7x_Q_0.js} +1 -1
  29. package/src/assets/web-panel/assets/{GenericCardRenderer-x2iXpyB7.js → GenericCardRenderer-F3Ryltwm.js} +1 -1
  30. package/src/assets/web-panel/assets/{Git-DfqbkiOP.js → Git-2HassK5k.js} +2 -2
  31. package/src/assets/web-panel/assets/{Governance-RuHyyj5O.js → Governance-DoBIp7oe.js} +1 -1
  32. package/src/assets/web-panel/assets/{Inference-Bn7uZ7rI.js → Inference--W01QhZ-.js} +1 -1
  33. package/src/assets/web-panel/assets/{KnowledgeGraph-DlP7XefZ.js → KnowledgeGraph-DmvwqGpT.js} +1 -1
  34. package/src/assets/web-panel/assets/{Logs-BYNdOiCd.js → Logs-BBJ4yAel.js} +2 -2
  35. package/src/assets/web-panel/assets/{MarkdownRenderer-aMtgN-R6.js → MarkdownRenderer-BLCZMzhJ.js} +1 -1
  36. package/src/assets/web-panel/assets/{Marketplace-JQYmDqM8.js → Marketplace-D5lNngSI.js} +1 -1
  37. package/src/assets/web-panel/assets/{McpTools-Cyx4yZ-9.js → McpTools-CkEVOMKH.js} +4 -4
  38. package/src/assets/web-panel/assets/{Memory-VDuGZTN2.js → Memory-B1Ow1xVE.js} +2 -2
  39. package/src/assets/web-panel/assets/{MobileBridge-_yKo97gi.js → MobileBridge-SgYbUfb6.js} +1 -1
  40. package/src/assets/web-panel/assets/{MobileProjects-CXRXW3q7.js → MobileProjects-BWdOvQAj.js} +1 -1
  41. package/src/assets/web-panel/assets/{Mtc-acTGtfLH.js → Mtc-DcTXSSma.js} +5 -5
  42. package/src/assets/web-panel/assets/{MtcAudit-ClpjXfkY.js → MtcAudit-Dt3WG4oj.js} +4 -4
  43. package/src/assets/web-panel/assets/{Multisig-_6Tn3o96.js → Multisig-B9B38UZx.js} +3 -3
  44. package/src/assets/web-panel/assets/{NLProgramming-CK7pbZzP.js → NLProgramming-B0S4GGvG.js} +1 -1
  45. package/src/assets/web-panel/assets/{Notes-Czy6V_P8.js → Notes-DZ5U58Ng.js} +3 -3
  46. package/src/assets/web-panel/assets/{NotificationSettings-Cqx-UVv3.js → NotificationSettings-PjL5ZW34.js} +1 -1
  47. package/src/assets/web-panel/assets/{OrderTableRenderer-C69WDxGy.js → OrderTableRenderer-DrAX2ESt.js} +1 -1
  48. package/src/assets/web-panel/assets/{Organization-DFnA9vLQ.js → Organization-Cv1GYs-c.js} +4 -4
  49. package/src/assets/web-panel/assets/{Overflow-ReZkk2yT.js → Overflow-Bbkp_PL3.js} +1 -1
  50. package/src/assets/web-panel/assets/{P2P-DzjSI0aI.js → P2P-BD8QUgoZ.js} +2 -2
  51. package/src/assets/web-panel/assets/{PdhVaultBrowser-DKTf5xIP.js → PdhVaultBrowser-BO-2PeaB.js} +3 -3
  52. package/src/assets/web-panel/assets/{Permissions-DhQ5klhR.js → Permissions-D_OPVa02.js} +4 -4
  53. package/src/assets/web-panel/assets/{PersonalDataHub-CUL1iHrW.js → PersonalDataHub-mh-pEmaB.js} +4 -4
  54. package/src/assets/web-panel/assets/{Pipeline-DU88iu4N.js → Pipeline-6JC2EDdb.js} +1 -1
  55. package/src/assets/web-panel/assets/{Privacy-Bw-sYfyK.js → Privacy-CUshzUAG.js} +1 -1
  56. package/src/assets/web-panel/assets/{ProjectInit-Bq3Q5y0z.js → ProjectInit-Cs2Aalri.js} +2 -2
  57. package/src/assets/web-panel/assets/{ProjectSettings-C8spzpho.js → ProjectSettings-1ak49tcj.js} +2 -2
  58. package/src/assets/web-panel/assets/Projects-BV4oApsm.js +1 -0
  59. package/src/assets/web-panel/assets/{Providers-Bf4eTP9W.js → Providers-CXXxvafH.js} +1 -1
  60. package/src/assets/web-panel/assets/{QrScannerModal-Dme9BDU1.js → QrScannerModal-PTcDsF58.js} +1 -1
  61. package/src/assets/web-panel/assets/{QuickAsk-CIXfv1rE.js → QuickAsk-CDwucrJw.js} +1 -1
  62. package/src/assets/web-panel/assets/{Recommend-CIxvdeZ-.js → Recommend-CJlLVRXR.js} +1 -1
  63. package/src/assets/web-panel/assets/{RemoteSession-C6k7MExI.js → RemoteSession-DlN-ETsO.js} +2 -2
  64. package/src/assets/web-panel/assets/{Reputation-CISDz2bl.js → Reputation-DI23LR6m.js} +1 -1
  65. package/src/assets/web-panel/assets/{Row-CdnDxXyf.js → Row-Cl7UQMrM.js} +1 -1
  66. package/src/assets/web-panel/assets/{RssFeed-C-QpRHsl.js → RssFeed-CexHNfh8.js} +3 -3
  67. package/src/assets/web-panel/assets/{Search-DBjaGzSn.js → Search-BneBWvRN.js} +1 -1
  68. package/src/assets/web-panel/assets/{Security-CQKukOeE.js → Security-DX7Phgrp.js} +4 -4
  69. package/src/assets/web-panel/assets/{Services-DZz86jWb.js → Services-BWXO8Mte.js} +2 -2
  70. package/src/assets/web-panel/assets/{Skeleton-jb8RMK0d.js → Skeleton-DCyOjKPJ.js} +1 -1
  71. package/src/assets/web-panel/assets/{Skills-CdY76fZG.js → Skills-CXqERsTB.js} +1 -1
  72. package/src/assets/web-panel/assets/{Sla-C_CSiZX9.js → Sla-bhbrbz8E.js} +1 -1
  73. package/src/assets/web-panel/assets/SpeechSettings-3IPU0HBZ.js +1 -0
  74. package/src/assets/web-panel/assets/{SyncSettings-qvimGO0O.js → SyncSettings-DBNTQLbM.js} +2 -2
  75. package/src/assets/web-panel/assets/{Tasks-Dng5LPJC.js → Tasks-quP0bkN-.js} +1 -1
  76. package/src/assets/web-panel/assets/{Templates-Bwqq5Wll.js → Templates-BouWmgho.js} +1 -1
  77. package/src/assets/web-panel/assets/{Tenant-DNWuwP7Z.js → Tenant-qv0D9s7z.js} +1 -1
  78. package/src/assets/web-panel/assets/{Terminal-B-6Othpp.js → Terminal-BxvbE8BB.js} +2 -2
  79. package/src/assets/web-panel/assets/{TimelineRenderer-DKpKZfzx.js → TimelineRenderer-D-IeLnJ2.js} +1 -1
  80. package/src/assets/web-panel/assets/{Tokens-DzfGMd2J.js → Tokens-CFMKKyVG.js} +1 -1
  81. package/src/assets/web-panel/assets/{Trigger-BXwUi74J.js → Trigger-L8as3UuJ.js} +1 -1
  82. package/src/assets/web-panel/assets/{Trust-BNzUq4ui.js → Trust-MxmA4VZG.js} +1 -1
  83. package/src/assets/web-panel/assets/{UkeySign-BYugxww4.js → UkeySign-C0VvJYRi.js} +1 -1
  84. package/src/assets/web-panel/assets/{VideoEditing-DdauhtSJ.js → VideoEditing-Bf5QZj8N.js} +1 -1
  85. package/src/assets/web-panel/assets/{Wallet-CSC9bCe_.js → Wallet-BIJ9riRz.js} +4 -4
  86. package/src/assets/web-panel/assets/{WebAuthn-Q8AN3bTO.js → WebAuthn-B8p9Mhkw.js} +5 -5
  87. package/src/assets/web-panel/assets/{WorkflowEditor-d-LBGCuA.js → WorkflowEditor-BVsuaPen.js} +1 -1
  88. package/src/assets/web-panel/assets/{chat-BLVDCgsZ.js → chat-BfkjoKpV.js} +1 -1
  89. package/src/assets/web-panel/assets/{colors-BZlPSEHl.js → colors-DeAlsWK8.js} +1 -1
  90. package/src/assets/web-panel/assets/{compact-item-IWseP6R6.js → compact-item-Cs97bz5j.js} +1 -1
  91. package/src/assets/web-panel/assets/{createContext-DnVRV3Ao.js → createContext-BqbG60LH.js} +1 -1
  92. package/src/assets/web-panel/assets/devWarning-DPty0mGN.js +1 -0
  93. package/src/assets/web-panel/assets/{hasIn-DLQZA_Wn.js → hasIn-i_RY0b1X.js} +1 -1
  94. package/src/assets/web-panel/assets/{index-B_N4-Gq9.js → index-0-agYlWL.js} +1 -1
  95. package/src/assets/web-panel/assets/{index-DB0MJgF_.js → index-79V_zv1s.js} +1 -1
  96. package/src/assets/web-panel/assets/{index-BOZJBTWZ.js → index-B-3tEpTc.js} +1 -1
  97. package/src/assets/web-panel/assets/{index-DUq0c7gq.js → index-B-JVTrpr.js} +1 -1
  98. package/src/assets/web-panel/assets/{index-Dy0R5ZED.js → index-B1CbOH1i.js} +1 -1
  99. package/src/assets/web-panel/assets/{index-Bxp7uDD8.js → index-B5UkyA3c.js} +1 -1
  100. package/src/assets/web-panel/assets/{index-DpVrK6fr.js → index-BESLFt4q.js} +1 -1
  101. package/src/assets/web-panel/assets/{index-CT9vVN-X.js → index-BOVkf1K3.js} +1 -1
  102. package/src/assets/web-panel/assets/{index-DOoQpuQY.js → index-BYUVuwKt.js} +1 -1
  103. package/src/assets/web-panel/assets/{index-CINJQEj6.js → index-BcUXAB2s.js} +1 -1
  104. package/src/assets/web-panel/assets/{index-CarMTIyQ.js → index-BkBi5TmC.js} +1 -1
  105. package/src/assets/web-panel/assets/{index-C5dgnilC.js → index-Bm7lLR4c.js} +1 -1
  106. package/src/assets/web-panel/assets/index-Bt7g0Vq_.js +1 -0
  107. package/src/assets/web-panel/assets/{index-CbQNL0ue.js → index-BuLQobzW.js} +1 -1
  108. package/src/assets/web-panel/assets/{index-CpBaJ3TD.js → index-CE2VtTlp.js} +1 -1
  109. package/src/assets/web-panel/assets/{index-jWb70ZgZ.js → index-CED2PL_y.js} +1 -1
  110. package/src/assets/web-panel/assets/{index-BEu2lMBy.js → index-CG3PRyAL.js} +1 -1
  111. package/src/assets/web-panel/assets/{index-DocEhinm.js → index-CIG8fQ2_.js} +1 -1
  112. package/src/assets/web-panel/assets/{index-D_LQodeJ.js → index-COdGA-8n.js} +1 -1
  113. package/src/assets/web-panel/assets/{index-DZpYeqrh.js → index-CeWoNHau.js} +1 -1
  114. package/src/assets/web-panel/assets/{index-gt8bNefW.js → index-Cf3WCLmy.js} +1 -1
  115. package/src/assets/web-panel/assets/{index-N_GoWZX4.js → index-CgsqdnRV.js} +1 -1
  116. package/src/assets/web-panel/assets/index-ChVT0p9u.js +1 -0
  117. package/src/assets/web-panel/assets/{index-CZDekj7T.js → index-D2B4VPyP.js} +1 -1
  118. package/src/assets/web-panel/assets/{index-YSw_gxlZ.js → index-D9evtvg2.js} +1 -1
  119. package/src/assets/web-panel/assets/{index-DTbxp4UH.js → index-DUUrv141.js} +1 -1
  120. package/src/assets/web-panel/assets/{index-Bbj2NS_I.js → index-DiSkx4UB.js} +3 -3
  121. package/src/assets/web-panel/assets/{index-BZs5bBnk.js → index-Dk2qouAz.js} +1 -1
  122. package/src/assets/web-panel/assets/{index-DalA0TKC.js → index-Dk7-v4hP.js} +1 -1
  123. package/src/assets/web-panel/assets/{index-1jeAudHd.js → index-DmbfhJUP.js} +1 -1
  124. package/src/assets/web-panel/assets/{index-C1ifZtXo.js → index-DqBgBpgp.js} +1 -1
  125. package/src/assets/web-panel/assets/{index-BhA3QEni.js → index-PT_5sBMA.js} +1 -1
  126. package/src/assets/web-panel/assets/{index-BSjilZ9L.js → index-U4f5izHz.js} +1 -1
  127. package/src/assets/web-panel/assets/{index-C2FqfMvU.js → index-YXgLng0K.js} +1 -1
  128. package/src/assets/web-panel/assets/{index-COev0W2g.js → index-ZxO_-E8a.js} +1 -1
  129. package/src/assets/web-panel/assets/{index-M7wxfAbm.js → index-dIHr4B_u.js} +1 -1
  130. package/src/assets/web-panel/assets/{index-DjWnONdy.js → index-gyFpvL7l.js} +1 -1
  131. package/src/assets/web-panel/assets/{index-Dkwsi1Kn.js → index-s1opAL-M.js} +1 -1
  132. package/src/assets/web-panel/assets/{index-hwVDeoC0.js → index-yObj1O4n.js} +1 -1
  133. package/src/assets/web-panel/assets/{initDefaultProps-Co67Kqmb.js → initDefaultProps-C9h9yKL3.js} +1 -1
  134. package/src/assets/web-panel/assets/{motion-BMOxQSF_.js → motion-BvmLsPdu.js} +1 -1
  135. package/src/assets/web-panel/assets/{move-C5fWDw-N.js → move-CoL4ekU1.js} +1 -1
  136. package/src/assets/web-panel/assets/{mtc-parser-BJevpL0e.js → mtc-parser-C4pMy6xV.js} +1 -1
  137. package/src/assets/web-panel/assets/{omit-BCzNU8s6.js → omit-DPuJfNxx.js} +1 -1
  138. package/src/assets/web-panel/assets/{pickAttrs-CybWvDPk.js → pickAttrs-D0KEeaK2.js} +1 -1
  139. package/src/assets/web-panel/assets/{placementArrow-BMWS9HnW.js → placementArrow-BpkyINxt.js} +1 -1
  140. package/src/assets/web-panel/assets/{responsiveObserve-BoL2UnGY.js → responsiveObserve-DQI_wOq8.js} +1 -1
  141. package/src/assets/web-panel/assets/{slide-DWNfXraU.js → slide-DYfdDiRg.js} +1 -1
  142. package/src/assets/web-panel/assets/{statusUtils-BquTM3tX.js → statusUtils-B5dtvb0D.js} +1 -1
  143. package/src/assets/web-panel/assets/{styleChecker-BEkCleim.js → styleChecker-CF310mSj.js} +1 -1
  144. package/src/assets/web-panel/assets/{useFlexGapSupport-Oecnq7EA.js → useFlexGapSupport-D1Qp4BLp.js} +1 -1
  145. package/src/assets/web-panel/assets/{useFs-CkDffJ4F.js → useFs-C7_iyvJK.js} +1 -1
  146. package/src/assets/web-panel/assets/{usePersonalDataHub-qbvKXesB.js → usePersonalDataHub-DZUt_fIm.js} +1 -1
  147. package/src/assets/web-panel/assets/{vnode-C6v8n6mA.js → vnode-D3dsi0lZ.js} +1 -1
  148. package/src/assets/web-panel/assets/{zoom-4CTeFILV.js → zoom-WdbOlvdQ.js} +1 -1
  149. package/src/assets/web-panel/index.html +1 -1
  150. package/src/command-help-index.json +2 -2
  151. package/src/commands/agent.js +90 -1
  152. package/src/commands/chat.js +11 -2
  153. package/src/commands/compact.js +106 -23
  154. package/src/commands/loop.js +28 -10
  155. package/src/commands/routine.js +1 -1
  156. package/src/commands/scheduler-daemon.js +359 -2
  157. package/src/commands/session-observability.js +305 -0
  158. package/src/commands/session.js +38 -0
  159. package/src/data/changelog.json +14 -1
  160. package/src/gateways/ws/ws-agent-handler.js +439 -5
  161. package/src/harness/jsonl-session-store.js +463 -125
  162. package/src/harness/prompt-compressor.js +86 -13
  163. package/src/harness/provider-backed-compaction.js +100 -27
  164. package/src/lib/advisor-runtime.js +3 -1
  165. package/src/lib/agent-schedule-store.js +414 -4
  166. package/src/lib/agent-team/team-adjudication.js +40 -1
  167. package/src/lib/automation-engine.js +494 -0
  168. package/src/lib/background-agent-supervisor.js +793 -215
  169. package/src/lib/background-command-argv.js +24 -0
  170. package/src/lib/background-interaction-journal.js +361 -52
  171. package/src/lib/background-interaction-resolver.js +32 -0
  172. package/src/lib/background-launch-profile.js +2 -0
  173. package/src/lib/causal-observability.js +2661 -0
  174. package/src/lib/chat-session-admission.js +76 -0
  175. package/src/lib/cost-budget.js +5 -7
  176. package/src/lib/cowork/ab-comparator-cli.js +11 -0
  177. package/src/lib/cowork/debate-review-cli.js +12 -0
  178. package/src/lib/cowork-adapter.js +159 -38
  179. package/src/lib/cowork-cron.js +357 -1
  180. package/src/lib/cowork-task-runner.js +112 -17
  181. package/src/lib/delivery-coordinator.js +142 -0
  182. package/src/lib/direct-model-usage.js +121 -0
  183. package/src/lib/file-lines.js +183 -47
  184. package/src/lib/llm-pricing.js +12 -17
  185. package/src/lib/loop.js +26 -2
  186. package/src/lib/routine-store.js +380 -21
  187. package/src/lib/runtime-usage-ledger.js +182 -0
  188. package/src/lib/scheduler-kernel/agenda-adapter.js +308 -3
  189. package/src/lib/scheduler-kernel/automation-adapter.js +410 -8
  190. package/src/lib/scheduler-kernel/automation-event-adapter.js +36 -0
  191. package/src/lib/scheduler-kernel/cowork-cron-adapter.js +285 -3
  192. package/src/lib/scheduler-kernel/loop-adapter.js +541 -6
  193. package/src/lib/scheduler-kernel/migration-admin.js +346 -0
  194. package/src/lib/scheduler-kernel/migration-rollback-admin.js +932 -0
  195. package/src/lib/scheduler-kernel/routine-adapter.js +394 -20
  196. package/src/lib/scheduler-kernel/runtime.js +63 -1
  197. package/src/lib/scheduler-kernel/source-locator-path.js +142 -0
  198. package/src/lib/scheduler-kernel/store.js +2586 -85
  199. package/src/lib/session-host-lease.js +171 -2
  200. package/src/lib/session-host-snapshot.js +14 -3
  201. package/src/lib/session-persistence-failure.js +1 -0
  202. package/src/lib/session-tail.js +179 -34
  203. package/src/lib/session-transcript-structure.js +96 -0
  204. package/src/lib/sub-agent-context.js +328 -22
  205. package/src/lib/ws-agent-handler.js +4 -1
  206. package/src/repl/agent-repl.js +732 -91
  207. package/src/repl/chat-repl.js +5 -1
  208. package/src/runtime/agent-core.js +1272 -207
  209. package/src/runtime/fallback-model.js +5 -0
  210. package/src/runtime/headless-runner.js +324 -82
  211. package/src/runtime/headless-stream.js +232 -26
  212. package/src/runtime/policies/agent-policy.js +4 -0
  213. package/src/workers/background-agent-worker.js +403 -96
  214. package/src/assets/web-panel/assets/Projects-Dd-xuPIc.js +0 -1
  215. package/src/assets/web-panel/assets/SpeechSettings-C7tT9iad.js +0 -1
  216. package/src/assets/web-panel/assets/devWarning-Jzu62CLC.js +0 -1
  217. package/src/assets/web-panel/assets/index-Zb2MeDSy.js +0 -1
  218. package/src/assets/web-panel/assets/index-fikqml4k.js +0 -1
@@ -8,7 +8,7 @@
8
8
  // Injected by web-ui-server.js at serve time
9
9
  window.__CC_CONFIG__ = __CC_CONFIG_PLACEHOLDER__;
10
10
  </script>
11
- <script type="module" crossorigin src="./assets/index-Bbj2NS_I.js"></script>
11
+ <script type="module" crossorigin src="./assets/index-DiSkx4UB.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="./assets/vendor-Bn1JzzAn.js">
13
13
  <link rel="modulepreload" crossorigin href="./assets/icons-DG5UD-6K.js">
14
14
  <link rel="stylesheet" crossorigin href="./assets/index-Cq93VfoF.css">
@@ -5,7 +5,7 @@
5
5
  "a2a": "Usage: chainlesschain a2a [options] [command]\n\nA2A Protocol — agent-to-agent communication\n\nOptions:\n -h, --help display help for command\n\nCommands:\n register [options] <name> Register an agent card\n discover [options] Discover agents by capability or skill\n submit [options] <agent-id> <input> Submit a task to an agent\n status [options] <task-id> Get task status\n complete <task-id> <output> Mark a task as completed\n fail <task-id> <error> Mark a task as failed\n peers [options] List all registered agents\n cards [options] List all agent cards with details\n negotiate [options] <agent-id> <capabilities> Check if an agent supports required capabilities\n task-statuses [options] List V2 task statuses (Phase 81)\n card-statuses [options] List V2 card statuses (Phase 81)\n subscription-types [options] List V2 subscription types (Phase 81)\n negotiation-results [options] List V2 negotiation outcomes (Phase 81)\n validate-card [options] <name> Validate an agent card against the A2A schema\n set-card-status [options] <cardId> <status> Transition a card between active/inactive/expired\n card-status [options] <cardId> Show a card's V2 status\n send-task-v2 [options] <agentId> <input> Submit a V2 task (in-memory, with optional timeout)\n start-working [options] <taskId> Transition a V2 task to working\n request-input [options] <taskId> <prompt> Request user input while a V2 task is working\n provide-input [options] <taskId> <input> Provide input for an input-required V2 task\n complete-task-v2 [options] <taskId> [output] Complete a V2 task (from working only)\n fail-task-v2 [options] <taskId> [error] Fail a V2 task with an error message\n cancel-task [options] <taskId> [reason] Cancel a non-terminal V2 task\n check-timeout [options] <taskId> Check V2 task timeout (auto-fails if past deadline)\n task-v2 [options] <taskId> Show a V2 task snapshot\n tasks-v2 [options] List V2 tasks\n negotiate-v2 [options] <cardJson> Phase 81 capability negotiation against an agent card\n stats-v2 [options] Aggregate V2 stats (tasks + cards + subscriptions)\n enums-v2 Show V2 governance enums\n register-agent-v2 [options] Register an a2a agent profile (pending)\n activate-agent-v2 <id> Activate agent\n suspend-agent-v2 <id> Suspend agent\n retire-agent-v2 <id> Retire agent (terminal)\n touch-agent-v2 <id> Refresh lastTouchedAt\n get-agent-v2 <id> Get agent\n list-agents-v2 List agents\n create-message-v2 [options] Create an a2a message (queued)\n start-message-v2 <id> Transition message to sending\n deliver-message-v2 <id> Transition message to delivered\n fail-message-v2 [options] <id> Fail message\n cancel-message-v2 [options] <id> Cancel message\n get-message-v2 <id> Get message\n list-messages-v2 List messages\n set-max-active-agents-v2 <n> Set per-owner active cap\n set-max-pending-messages-v2 <n> Set per-agent pending cap\n set-agent-idle-ms-v2 <n> Set idle threshold\n set-message-stuck-ms-v2 <n> Set stuck threshold\n auto-suspend-idle-agents-v2 Auto-suspend idle agents\n auto-fail-stuck-messages-v2 Auto-fail stuck sending messages\n gov-stats-v2 V2 governance aggregate stats\n help [command] display help for command\n",
6
6
  "activitypub": "Usage: chainlesschain activitypub|ap [options] [command]\n\nActivityPub C2S bridge — actors, outbox/inbox, Follow/Create/Like/Announce\n\nOptions:\n -h, --help display help for command\n\nCommands:\n actor Manage local and remote ActivityPub actors\n publish [options] <content> Publish a Create(Note) activity to the actor's outbox\n follow [options] <target> Publish a Follow activity (target: username or actor URL)\n accept [options] <follow-activity-id> Accept a pending Follow request\n unfollow [options] <target> Publish an Undo(Follow) activity\n like [options] <object-id> Publish a Like activity for an object URL\n announce [options] <object-id> Publish an Announce (boost) activity for an object URL\n outbox [options] <username> List an actor's outbox activities\n inbox [options] <username> List an actor's inbox activities\n deliver [options] <username> <activity-json> Simulate inbox delivery — push a JSON activity into a local actor's inbox\n followers [options] <username> List followers of an actor\n search [options] <query> Search actors and/or notes in the local Fediverse index\n following [options] <username> List who this actor is following\n enums-v2 Show V2 enums\n register-actor-v2 [options] Register an AP actor profile (pending)\n activate-actor-v2 <id> Activate actor\n suspend-actor-v2 <id> Suspend actor\n deactivate-actor-v2 <id> Deactivate actor (terminal)\n touch-actor-v2 <id> Refresh lastTouchedAt\n get-actor-v2 <id> Get actor\n list-actors-v2 List actors\n create-activity-v2 [options] Create an AP activity (queued)\n start-activity-v2 <id> Transition activity to delivering\n deliver-activity-v2 <id> Transition activity to delivered\n fail-activity-v2 [options] <id> Fail activity\n cancel-activity-v2 [options] <id> Cancel activity\n get-activity-v2 <id> Get activity\n list-activities-v2 List activities\n set-max-active-actors-v2 <n> Set per-owner active cap\n set-max-pending-activities-v2 <n> Set per-actor pending cap\n set-actor-idle-ms-v2 <n> Set idle threshold\n set-activity-stuck-ms-v2 <n> Set stuck threshold\n auto-suspend-idle-actors-v2 Auto-suspend idle actors\n auto-fail-stuck-activities-v2 Auto-fail stuck delivering activities\n gov-stats-v2 V2 governance aggregate stats\n help [command] display help for command\n",
7
7
  "agenda": "Usage: chainlesschain agenda [options] [command]\n\nFire agent-scheduled wakeups / crons / monitors (persisted by the `schedule`\ntool)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n list [options] List all scheduled entries\n run [options] Fire every entry that is due now\n cancel [options] <id> Remove a scheduled entry by id\n prune [options] Remove finished entries (fired / matched / exhausted /\n expired)\n help [command] display help for command\n",
8
- "agent": "Usage: chainlesschain agent|a [options] [task...]\n\nStart an agentic AI session (reads/writes files, runs commands)\n\nArguments:\n task Headless task 鈥?when given (or with -p /\n piped stdin), runs non-interactively\n\nOptions:\n --model <model> Model name\n --provider <provider> LLM provider (ollama, openai,\n volcengine, deepseek, ...)\n --base-url <url> API base URL\n --api-key <key> API key\n --think [level] Enable Anthropic extended thinking\n (level: think | hard | ultra; Anthropic\n models only)\n --ultrathink Maximum Anthropic extended thinking (=\n --think ultra)\n --thinking-budget <n> Thinking token budget for legacy Claude\n models (Sonnet 4.5 / Opus 4.0-4.5 /\n older); clamped below max_tokens.\n Adaptive-thinking models ignore it (they\n use --think's effort). Requires\n --think/--ultrathink.\n --image <path> Attach an image (png/jpg/jpeg/gif/webp)\n to the prompt for a vision-capable model\n (headless; repeatable)\n --vision-model <id> Model to use when an image is attached\n (default: config llm.visionModel or\n doubao-seed-2-0-lite-260215)\n --session <id> Resume a previous agent session\n -c, --continue Resume the most recent session (no id\n needed 鈥?claude --continue parity)\n --resume [id] Resume a session by id (no id 鈫?most\n recent 鈥?claude --resume parity)\n --fork-session When resuming, branch into a NEW session\n id and leave the original untouched\n (claude --fork-session parity)\n --fork-request-id <key> Stable idempotency key for\n --fork-session retries (omit for a new\n fork each invocation)\n --add-dir <dir> Extra working directory the agent may\n read/search/edit (repeatable)\n --checkpoint Auto-snapshot the work tree before each\n mutating tool (DEFAULT inside a git\n repo; cc checkpoint restore to roll\n back)\n --no-checkpoint Disable auto-checkpointing (it is on by\n default inside git repos)\n --managed-checkpoint Checkpoint bounded mutating tools with\n Process Broker; unavailable writer\n lifetimes are reported as coverage none\n --managed-checkpoint-state <dir> Durable managed-checkpoint state\n directory (must be outside the\n workspace)\n --managed-checkpoint-exclude <path> Explicit workspace path excluded from\n managed checkpoints; repeatable and\n reported as partial coverage\n --safe-mode Run bare: disable project memory,\n settings hooks, memory recall, IDE\n context, status line and update notice\n (permission rules STAY active)\n --bare Everything --safe-mode disables PLUS\n skills, plugins and MCP/IDE auto-connect\n — minimal fast surface for scripted\n calls (explicit --mcp-config still\n loads; permission rules STAY active)\n --ephemeral No session persistence: nothing is\n written to the session store (headless;\n a --resume id still replays history\n read-only)\n --capabilities Print a machine-readable capability\n manifest (JSON: protocol version, tools,\n permission modes, exit codes) and exit\n --disable-slash-commands Interactive REPL: don't dispatch '/'\n input as slash commands — it reaches the\n model verbatim (/exit and /quit stay\n live)\n --ax-screen-reader Screen-reader friendly output: no ANSI\n colors, no in-place status line repaints\n (also CC_SCREEN_READER=1)\n --worktree Run this session in a fresh git worktree\n (isolated branch; auto-removed when the\n session changes nothing)\n --no-worktree Background Git task: explicitly share\n the current work tree (intended for\n read-only tasks; writable runs are not\n isolated)\n --unattended Enable fail-closed shell action policy\n for scheduled/event-driven runs\n --unattended-allow <classes> Comma-separated action classes\n explicitly allowed for unattended shell\n runs\n --sandbox [image] Run shell commands in an ephemeral\n Docker sandbox (network disabled by\n default)\n --sandbox-mode <mode> Sandbox posture: off | workspace-write |\n strict (explicit isolation modes fail\n closed)\n --sandbox-network Allow network access inside --sandbox\n --otlp <file> Write the agent run's OpenTelemetry\n spans (model/tool/retry) as OTLP/JSON to\n <file>\n --otlp-content Include prompt/response CONTENT in\n --otlp spans (off by default; content is\n redacted unless this is set)\n --auto-rewake When an async `asyncRewake` hook (e.g. a\n background test) fails at turn end,\n re-engage the agent to fix it (bounded\n by --max-rewakes)\n --auto-pin Force-pin the original task (first user\n turn) through compaction (ON by default;\n disable with CC_AUTO_PIN=0 or config\n context.autoPin=false)\n --max-rewakes <n> Max auto-rewake re-drives per run\n (default 1); implies --auto-rewake\n --bg, --background Start as a detached background agent and\n return its id immediately\n --agent-id <id> Agent id for scoped memory recall\n --recall-limit <n> Top-K memories to inject into system\n prompt\n --recall-query <q> Query string for startup memory recall\n --no-recall-memory Disable startup memory recall\n --vim Start the interactive REPL in vim-mode\n line editing (toggle later with /vim; or\n CC_VIM=1)\n --no-stream Disable streamed response rendering\n --no-park-on-exit Close the session-core handle on exit\n instead of parking it\n --bundle <path> Agent bundle directory (may execute\n local MCP commands from mcp.json)\n -p, --print [prompt] Headless: run one non-interactive turn\n and exit\n --output-format <fmt> Headless output: text | json |\n stream-json (default: \"text\")\n --max-turns <n> Cap agent loop iterations (headless)\n --json-schema <file> Headless structured output: final reply\n must be JSON validating against this\n schema (invalid replies retried)\n --allowed-tools <list> Comma/space-separated tool allow-list\n (headless)\n --disallowed-tools <list> Comma/space-separated tool deny-list\n (headless)\n --permission-mode <mode> manual | auto | dontAsk | default | plan\n | acceptEdits | bypassPermissions (plan\n headless-only)\n --no-file-refs Disable @path file-reference expansion\n in the prompt (headless)\n --no-slash-macros Disable /name custom-command\n (.claude/commands) expansion in the\n prompt (headless)\n --system-prompt <text> Replace the built-in system prompt\n (literal text or @file)\n --append-system-prompt <text> Append extra guidance to the system\n prompt (literal text or @file)\n --no-project-memory Skip auto-loaded project memory (cc.md /\n CLAUDE.md / AGENTS.md hierarchy,\n .chainlesschain/rules.md,\n .claude/rules/*.md) — a lean system\n prompt for token-tight surfaces (e.g.\n IDE chat). The agent can still read\n those files with tools when it needs\n them.\n --output-style <name> Apply a named output-style persona\n (.claude/output-styles/<name>.md or a\n built-in: explanatory | learning)\n --input-format <fmt> Headless input: text | stream-json\n (NDJSON user events on stdin,\n multi-turn) (default: \"text\")\n --trace-id <id> Correlation id stamped as `trace_id` on\n every stream-json output line (also read\n from CC_TRACE_ID). Lets an IDE/bridge\n trace one run across its own logs, the\n CLI, transcripts and diagnostics.\n Auto-generated per run when omitted.\n --fallback-model <model> Backup model(s) to try in order when the\n primary fails (transient error or\n model-not-found). Repeatable or\n comma-separated; up to 3. A\n `provider:model` entry (e.g.\n openai:gpt-4o) falls back\n cross-provider, using that provider's\n API key from its env var (skipped if\n unset — never reuses the primary key).\n Defaults to config llm.fallbackModels.\n --include-partial-messages Emit live assistant-text deltas as\n stream_event lines (requires\n --output-format stream-json)\n --goal [id] Bind a cc goal into the run (id, or omit\n the value to auto-resolve the active\n goal)\n --goal-assess After the run, ask the model to assess\n goal progress and persist it (opt-in;\n costs one extra completion; requires\n --goal)\n --goal-condition <spec> Session completion condition; re-drives\n outer turns until met. Prefix\n exit-zero:/file-exists:/contains:/regex:\n (deterministic) or model:<desc>\n (model-judged)\n --max-outer-turns <n> Max outer re-drive turns for\n --goal-condition (default 10, hard cap\n 100)\n --goal-max-tokens <n> Token budget across --goal-condition\n outer turns\n --goal-max-cost <usd> Cost budget (USD) across\n --goal-condition outer turns\n --goal-max-time <ms> Wall-clock budget (ms) across\n --goal-condition outer turns\n --mcp-config <file> Load ad-hoc MCP servers from a JSON file\n for this run (headless); their tools\n become callable (mcp__<server>__<tool>)\n --no-mcp Don't auto-connect MCP servers\n registered with `cc mcp add\n --auto-connect` (--mcp-config still\n loads)\n --ide Force-enable IDE bridge auto-connect:\n discover a running editor's MCP server\n via ~/.chainlesschain/ide/*.json\n (default: auto inside an IDE integrated\n terminal)\n --no-ide Disable IDE bridge auto-connect\n --pdh Force-enable PDH bridge auto-connect:\n discover the Android app's\n device-capability MCP server via\n ~/.chainlesschain/pdh-bridge/*.json\n (default: auto when\n CHAINLESSCHAIN_PDH_PORT is set)\n --no-pdh Disable PDH bridge auto-connect\n --jetbrains Force-enable IntelliJ IDEA built-in MCP\n (IDEA >= 2025.2) as server `idea`\n (default: auto when the ChainlessChain\n JetBrains plugin injects\n CHAINLESSCHAIN_JETBRAINS_MCP_URL)\n --no-jetbrains Disable IDEA built-in MCP auto-connect\n --interactive-approvals Stream mode: confirm-tier approvals\n become approval_request/approval\n stdin-stdout events instead of failing\n closed (chat-panel UX)\n --permission-prompt-tool <tool> Defer tool approvals to an MCP tool\n (mcp__<server>__<tool>; requires\n --mcp-config) instead of headless\n fail-closed\n --remote-control Route confirm-tier approvals to paired\n mobile/web devices — prints a pairing\n URI/QR. Headless waits for the remote\n allow/deny (fail-closed on timeout);\n interactive races the terminal prompt\n (first answer wins; also\n /remote-control)\n --channels <list> Inbound channels for the interactive\n session (webhook[:port],telegram) —\n external events enter as user turns;\n webhook needs its bearer token, telegram\n needs channels.telegram.allowFrom\n --settings <file> Merge an extra\n .claude/settings.json-shaped file for\n this run: permission rules\n (allow/ask/deny) + native config\n overrides (model, env)\n --max-budget-usd <amount> Hard USD spend cap: stop the run before\n the next paid LLM call once the\n estimated cost reaches this (headless;\n uses the cc cost price table)\n --strict-mcp-config Use ONLY --mcp-config servers; ignore\n registered (cc mcp add) and IDE-bridge\n MCP for a reproducible tool surface\n --project-mcp Opt in to loading a project-scoped\n .mcp.json (default off; a checked-in\n .mcp.json can spawn commands)\n --replay-user-messages Stream-input mode: echo each accepted\n stdin user message back as a `user`\n event (transcript/correlation)\n --allow-dangerous-bypass Bypass all permission prompts in\n headless mode (DANGEROUS: auto-approves\n all tool calls) (default: false)\n -y, --yolo Alias for --allow-dangerous-bypass\n (default: false)\n --dangerously-skip-permissions Alias for --allow-dangerous-bypass\n (default: false)\n -h, --help display help for command\n",
8
+ "agent": "Usage: chainlesschain agent|a [options] [task...]\n\nStart an agentic AI session (reads/writes files, runs commands)\n\nArguments:\n task Headless task 鈥?when given (or with -p /\n piped stdin), runs non-interactively\n\nOptions:\n --model <model> Model name\n --provider <provider> LLM provider (ollama, openai,\n volcengine, deepseek, ...)\n --base-url <url> API base URL\n --api-key <key> API key\n --think [level] Enable Anthropic extended thinking\n (level: think | hard | ultra; Anthropic\n models only)\n --ultrathink Maximum Anthropic extended thinking (=\n --think ultra)\n --thinking-budget <n> Thinking token budget for legacy Claude\n models (Sonnet 4.5 / Opus 4.0-4.5 /\n older); clamped below max_tokens.\n Adaptive-thinking models ignore it (they\n use --think's effort). Requires\n --think/--ultrathink.\n --image <path> Attach an image (png/jpg/jpeg/gif/webp)\n to the prompt for a vision-capable model\n (headless; repeatable)\n --vision-model <id> Model to use when an image is attached\n (default: config llm.visionModel or\n doubao-seed-2-0-lite-260215)\n --session <id> Resume a previous agent session\n -c, --continue Resume the most recent session (no id\n needed 鈥?claude --continue parity)\n --resume [id] Resume a session by id (no id 鈫?most\n recent 鈥?claude --resume parity)\n --fork-session When resuming, branch into a NEW session\n id and leave the original untouched\n (claude --fork-session parity)\n --fork-request-id <key> Stable idempotency key for\n --fork-session retries (omit for a new\n fork each invocation)\n --add-dir <dir> Extra working directory the agent may\n read/search/edit (repeatable)\n --checkpoint Auto-snapshot the work tree before each\n mutating tool (DEFAULT inside a git\n repo; cc checkpoint restore to roll\n back)\n --no-checkpoint Disable auto-checkpointing (it is on by\n default inside git repos)\n --managed-checkpoint Checkpoint bounded mutating tools with\n Process Broker; unavailable writer\n lifetimes are reported as coverage none\n --managed-checkpoint-state <dir> Durable managed-checkpoint state\n directory (must be outside the\n workspace)\n --managed-checkpoint-exclude <path> Explicit workspace path excluded from\n managed checkpoints; repeatable and\n reported as partial coverage\n --safe-mode Run bare: disable project memory,\n settings hooks, memory recall, IDE\n context, status line and update notice\n (permission rules STAY active)\n --bare Everything --safe-mode disables PLUS\n skills, plugins and MCP/IDE auto-connect\n — minimal fast surface for scripted\n calls (explicit --mcp-config still\n loads; permission rules STAY active)\n --ephemeral No session persistence: nothing is\n written to the session store (headless;\n a --resume id still replays history\n read-only)\n --capabilities Print a machine-readable capability\n manifest (JSON: protocol version, tools,\n permission modes, exit codes) and exit\n --disable-slash-commands Interactive REPL: don't dispatch '/'\n input as slash commands — it reaches the\n model verbatim (/exit and /quit stay\n live)\n --ax-screen-reader Screen-reader friendly output: no ANSI\n colors, no in-place status line repaints\n (also CC_SCREEN_READER=1)\n --worktree Run this session in a fresh git worktree\n (isolated branch; auto-removed when the\n session changes nothing)\n --no-worktree Background Git task: explicitly share\n the current work tree (intended for\n read-only tasks; writable runs are not\n isolated)\n --unattended Enable fail-closed shell action policy\n for scheduled/event-driven runs\n --unattended-allow <classes> Comma-separated action classes\n explicitly allowed for unattended shell\n runs\n --sandbox [image] Run shell commands in an ephemeral\n Docker sandbox (network disabled by\n default)\n --sandbox-mode <mode> Sandbox posture: off | workspace-write |\n strict (explicit isolation modes fail\n closed)\n --sandbox-network Allow network access inside --sandbox\n --otlp <file> Write the agent run's OpenTelemetry\n spans (model/tool/retry) as OTLP/JSON to\n <file>\n --otlp-content Include prompt/response CONTENT in\n --otlp spans (off by default; content is\n redacted unless this is set)\n --auto-rewake When an async `asyncRewake` hook (e.g. a\n background test) fails at turn end,\n re-engage the agent to fix it (bounded\n by --max-rewakes)\n --auto-pin Force-pin the original task (first user\n turn) through compaction (ON by default;\n disable with CC_AUTO_PIN=0 or config\n context.autoPin=false)\n --max-rewakes <n> Max auto-rewake re-drives per run\n (default 1); implies --auto-rewake\n --bg, --background Start as a detached background agent and\n return its id immediately\n --agent-id <id> Agent id for scoped memory recall\n --recall-limit <n> Top-K memories to inject into system\n prompt\n --recall-query <q> Query string for startup memory recall\n --no-recall-memory Disable startup memory recall\n --vim Start the interactive REPL in vim-mode\n line editing (toggle later with /vim; or\n CC_VIM=1)\n --no-stream Disable streamed response rendering\n --no-park-on-exit Close the session-core handle on exit\n instead of parking it\n --bundle <path> Agent bundle directory (may execute\n local MCP commands from mcp.json)\n -p, --print [prompt] Headless: run one non-interactive turn\n and exit\n --output-format <fmt> Headless output: text | json |\n stream-json (default: \"text\")\n --max-turns <n> Cap agent loop iterations (headless)\n --json-schema <file> Headless structured output: final reply\n must be JSON validating against this\n schema (invalid replies retried)\n --allowed-tools <list> Comma/space-separated tool allow-list\n (headless)\n --disallowed-tools <list> Comma/space-separated tool deny-list\n (headless)\n --permission-mode <mode> manual | auto | dontAsk | default | plan\n | acceptEdits | bypassPermissions (plan\n headless-only)\n --no-file-refs Disable @path file-reference expansion\n in the prompt (headless)\n --no-slash-macros Disable /name custom-command\n (.claude/commands) expansion in the\n prompt (headless)\n --system-prompt <text> Replace the built-in system prompt\n (literal text or @file)\n --append-system-prompt <text> Append extra guidance to the system\n prompt (literal text or @file)\n --no-project-memory Skip auto-loaded project memory (cc.md /\n CLAUDE.md / AGENTS.md hierarchy,\n .chainlesschain/rules.md,\n .claude/rules/*.md) — a lean system\n prompt for token-tight surfaces (e.g.\n IDE chat). The agent can still read\n those files with tools when it needs\n them.\n --output-style <name> Apply a named output-style persona\n (.claude/output-styles/<name>.md or a\n built-in: explanatory | learning)\n --input-format <fmt> Headless input: text | stream-json\n (NDJSON user events on stdin,\n multi-turn) (default: \"text\")\n --trace-id <id> Correlation id stamped as `trace_id` on\n every stream-json output line (also read\n from CC_TRACE_ID). Lets an IDE/bridge\n trace one run across its own logs, the\n CLI, transcripts and diagnostics.\n Auto-generated per run when omitted.\n --fallback-model <model> Backup model(s) to try in order when the\n primary fails (transient error or\n model-not-found). Repeatable or\n comma-separated; up to 3. A\n `provider:model` entry (e.g.\n openai:gpt-4o) falls back\n cross-provider, using that provider's\n API key from its env var (skipped if\n unset — never reuses the primary key).\n Defaults to config llm.fallbackModels.\n --include-partial-messages Emit live assistant-text deltas as\n stream_event lines (requires\n --output-format stream-json)\n --goal [id] Bind a cc goal into the run (id, or omit\n the value to auto-resolve the active\n goal)\n --goal-assess After the run, ask the model to assess\n goal progress and persist it (opt-in;\n costs one extra completion; requires\n --goal)\n --goal-condition <spec> Session completion condition; re-drives\n outer turns until met. Prefix\n exit-zero:/file-exists:/contains:/regex:\n (deterministic) or model:<desc>\n (model-judged)\n --max-outer-turns <n> Max outer re-drive turns for\n --goal-condition (default 10, hard cap\n 100)\n --goal-max-tokens <n> Token budget across --goal-condition\n outer turns\n --goal-max-cost <usd> Cost budget (USD) across\n --goal-condition outer turns\n --goal-max-time <ms> Wall-clock budget (ms) across\n --goal-condition outer turns\n --mcp-config <file> Load ad-hoc MCP servers from a JSON file\n for this run (headless); their tools\n become callable (mcp__<server>__<tool>)\n --no-mcp Don't auto-connect MCP servers\n registered with `cc mcp add\n --auto-connect` (--mcp-config still\n loads)\n --ide Force-enable IDE bridge auto-connect:\n discover a running editor's MCP server\n via ~/.chainlesschain/ide/*.json\n (default: auto inside an IDE integrated\n terminal)\n --no-ide Disable IDE bridge auto-connect\n --pdh Force-enable PDH bridge auto-connect:\n discover the Android app's\n device-capability MCP server via\n ~/.chainlesschain/pdh-bridge/*.json\n (default: auto when\n CHAINLESSCHAIN_PDH_PORT is set)\n --no-pdh Disable PDH bridge auto-connect\n --jetbrains Force-enable IntelliJ IDEA built-in MCP\n (IDEA >= 2025.2) as server `idea`\n (default: auto when the ChainlessChain\n JetBrains plugin injects\n CHAINLESSCHAIN_JETBRAINS_MCP_URL)\n --no-jetbrains Disable IDEA built-in MCP auto-connect\n --interactive-approvals Stream mode: confirm-tier approvals\n become approval_request/approval\n stdin-stdout events instead of failing\n closed (chat-panel UX)\n --permission-prompt-tool <tool> Defer tool approvals to an MCP tool\n (mcp__<server>__<tool>; requires\n --mcp-config) instead of headless\n fail-closed\n --remote-control Route confirm-tier approvals to paired\n mobile/web devices — prints a pairing\n URI/QR. Headless waits for the remote\n allow/deny (fail-closed on timeout);\n interactive races the terminal prompt\n (first answer wins; also\n /remote-control)\n --channels <list> Inbound channels for the interactive\n session (webhook[:port],telegram) —\n external events enter as user turns;\n webhook needs its bearer token, telegram\n needs channels.telegram.allowFrom\n --settings <file> Merge an extra\n .claude/settings.json-shaped file for\n this run: permission rules\n (allow/ask/deny) + native config\n overrides (model, env)\n --max-budget-usd <amount> Hard USD spend cap: stop the run before\n the next paid LLM call once the\n estimated cost reaches this (headless;\n uses the cc cost price table)\n --observability-workspace <id> Persist a workspace scope on new session\n authority for causal reports\n --observability-team <id> Persist a team scope on new session\n authority for causal reports\n --observability-policy <id> Persist a policy scope on new session\n authority for causal reports\n --strict-mcp-config Use ONLY --mcp-config servers; ignore\n registered (cc mcp add) and IDE-bridge\n MCP for a reproducible tool surface\n --project-mcp Opt in to loading a project-scoped\n .mcp.json (default off; a checked-in\n .mcp.json can spawn commands)\n --replay-user-messages Stream-input mode: echo each accepted\n stdin user message back as a `user`\n event (transcript/correlation)\n --allow-dangerous-bypass Bypass all permission prompts in\n headless mode (DANGEROUS: auto-approves\n all tool calls) (default: false)\n -y, --yolo Alias for --allow-dangerous-bypass\n (default: false)\n --dangerously-skip-permissions Alias for --allow-dangerous-bypass\n (default: false)\n -h, --help display help for command\n",
9
9
  "agent-network": "Usage: chainlesschain agent-network|anet [options] [command]\n\nDecentralized Agent Network (Phase 24) — DID / registry / credentials / task\nrouting\n\nOptions:\n -h, --help display help for command\n\nCommands:\n config [options] Show network constants & reputation weights\n dimensions [options] List reputation dimensions\n task-statuses [options] List task lifecycle statuses\n did-create [options] Create an Agent DID (Ed25519 + DID document)\n did-resolve [options] <did> Resolve DID → DID document\n dids [options] List Agent DIDs\n did-deactivate [options] <did> Deactivate a DID (also forces registry offline)\n sign [options] <did> <data> Sign data with agent's Ed25519 key\n verify [options] <did> <data> <signature> Verify a signature from an agent\n register [options] <did> <orgId> Register an Agent in the federated registry\n unregister [options] <did> Remove an Agent from the registry\n heartbeat [options] <did> Bump last_heartbeat (forces online)\n discover [options] Discover agents (capability / org / status)\n sweep [options] Mark stale online agents offline\n peer-add [options] <peerId> Add/update a Kademlia peer (k-bucket auto-computed)\n peer-remove [options] <peerId> Remove a peer\n peers [options] List peers (optionally by k-bucket)\n auth-start [options] <did> Issue an auth challenge for a DID\n auth-complete [options] <sessionId> <signature> Complete auth with signature over challenge\n auth-validate [options] <token> Validate a session token (returns agentDid or exits 1)\n auth-sessions [options] List auth sessions\n credential-issue [options] <issuerDid> <subjectDid> Issue a VC with HMAC/Ed25519 proof\n credential-verify [options] <id> Verify a VC (signature + expiry + revocation)\n credential-revoke [options] <id> Revoke a credential\n credential-show [options] <id> Show a credential\n credentials [options] List credentials (filter by subject/issuer/status/type)\n task-route [options] <sourceOrg> <taskType> Route task → pick best-rep agent matching capability\n task-show [options] <taskId> Show a task\n task-status [options] <taskId> <status> Update task status (terminal states set completedAt)\n task-cancel [options] <taskId> Cancel a task (sets CANCELLED + reason)\n tasks [options] List tasks\n rep-update [options] <did> <dimension> <score> Record a reputation observation\n rep-show [options] <did> Show reputation summary (weighted total + per-dim avg)\n rep-history [options] <did> Show reputation history (newest first)\n rep-top [options] Top agents by dimension (or total)\n stats [options] Network-level statistics\n agent-maturities-v2 List V2 agent maturity states\n task-lifecycles-v2 List V2 task lifecycle states\n stats-v2 V2 agent-network stats\n get-max-active-agents-v2 Get max active agents per network (V2)\n set-max-active-agents-v2 <n> Set max active agents per network (V2)\n get-max-pending-tasks-v2 Get max pending tasks per agent (V2)\n set-max-pending-tasks-v2 <n> Set max pending tasks per agent (V2)\n get-agent-idle-ms-v2 Get agent idle threshold (V2)\n set-agent-idle-ms-v2 <ms> Set agent idle threshold (V2)\n get-task-stuck-ms-v2 Get task stuck threshold (V2)\n set-task-stuck-ms-v2 <ms> Set task stuck threshold (V2)\n active-agent-count-v2 <networkId> Active agent count for network (V2)\n pending-task-count-v2 <agentId> Pending task count for agent (V2)\n register-agent-v2 [options] <id> Register a V2 agent\n get-agent-v2 <id> Get a V2 agent\n list-agents-v2 [options] List V2 agents\n set-agent-status-v2 <id> <next> Set V2 agent status\n activate-agent-v2 <id> Activate a V2 agent\n suspend-agent-v2 <id> Suspend a V2 agent\n revoke-agent-v2 <id> Revoke a V2 agent\n touch-agent-v2 <id> Touch a V2 agent\n create-task-v2 [options] <id> Create a V2 task\n get-task-v2 <id> Get a V2 task\n list-tasks-v2 [options] List V2 tasks\n set-task-status-v2 <id> <next> Set V2 task status\n start-task-v2 <id> Start a V2 task\n complete-task-v2 <id> Complete a V2 task\n fail-task-v2 <id> Fail a V2 task\n cancel-task-v2 <id> Cancel a V2 task\n auto-suspend-idle-agents-v2 Auto-suspend idle V2 agents\n auto-fail-stuck-tasks-v2 Auto-fail stuck V2 tasks\n help [command] display help for command\n",
10
10
  "agents": "Usage: chainlesschain agents [options] [command]\n\nUser-defined subagents (.claude/agents/*.md)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n background|bg [options] List background agent sessions\n logs [options] <id> Print recent output from a background agent\n view [options] <id> Show a detailed background agent view\n stop [options] <id> Stop a running background agent\n rename [options] <id> <title...> Rename a background agent session\n list|ls [options] List discovered subagents (project +\n personal)\n show [options] <name> Show an agent's metadata + system prompt\n run [options] <name> [task...] Run a task headlessly as the named subagent\n new [options] <name> Scaffold a new agent file (project-native\n .chainlesschain/agents/)\n help [command] display help for command\n",
11
11
  "android": "Usage: chainlesschain android [options] [command]\n\nAndroid-native bridge: ContentResolver / SAF / Accessibility / Shizuku / root\n(Plan A A7)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n caps [options] Probe what bridge capabilities are available on this\n device\n contacts ContentResolver: contacts\n sms ContentResolver: SMS\n calls ContentResolver: call log\n app PackageManager: app inventory + Intent\n fs SAF / sandbox filesystem\n a11y Accessibility Service\n shizuku Shizuku ADB-like privileges\n root Magisk root su\n perms [options] <name> Check (and request) a runtime permission\n help [command] display help for command\n",
@@ -140,7 +140,7 @@
140
140
  "seshsearch": "Usage: chainlesschain seshsearch [options] [command]\n\nSession Search V2 governance\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n config-v2\n set-max-active-v2 <n>\n set-max-pending-v2 <n>\n set-idle-ms-v2 <n>\n set-stuck-ms-v2 <n>\n register-profile-v2 [options] <id> <owner>\n activate-profile-v2 <id>\n stale-profile-v2 <id>\n archive-profile-v2 <id>\n touch-profile-v2 <id>\n get-profile-v2 <id>\n list-profiles-v2\n create-query-v2 [options] <id> <profileId>\n searching-query-v2 <id>\n complete-query-v2 <id>\n fail-query-v2 <id> [reason]\n cancel-query-v2 <id> [reason]\n get-query-v2 <id>\n list-queries-v2\n auto-stale-idle-v2\n auto-fail-stuck-v2\n gov-stats-v2\n reset-state-v2\n help [command] display help for command\n",
141
141
  "seshtail": "Usage: chainlesschain seshtail [options] [command]\n\nSession Tail V2 governance\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n config-v2\n set-max-active-v2 <n>\n set-max-pending-v2 <n>\n set-idle-ms-v2 <n>\n set-stuck-ms-v2 <n>\n register-sub-v2 [options] <id> <owner>\n activate-sub-v2 <id>\n pause-sub-v2 <id>\n close-sub-v2 <id>\n touch-sub-v2 <id>\n get-sub-v2 <id>\n list-subs-v2\n create-event-v2 [options] <id> <subId>\n tailing-event-v2 <id>\n complete-event-v2 <id>\n fail-event-v2 <id> [reason]\n cancel-event-v2 <id> [reason]\n get-event-v2 <id>\n list-events-v2\n auto-pause-idle-v2\n auto-fail-stuck-v2\n gov-stats-v2\n reset-state-v2\n help [command] display help for command\n",
142
142
  "seshu": "Usage: chainlesschain seshu [options] [command]\n\nSession Usage V2 governance\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n config-v2\n set-max-active-v2 <n>\n set-max-pending-v2 <n>\n set-idle-ms-v2 <n>\n set-stuck-ms-v2 <n>\n register-budget-v2 [options] <id> <owner>\n activate-budget-v2 <id>\n exhaust-budget-v2 <id>\n archive-budget-v2 <id>\n touch-budget-v2 <id>\n get-budget-v2 <id>\n list-budgets-v2\n create-record-v2 [options] <id> <budgetId>\n recording-record-v2 <id>\n record-record-v2 <id>\n reject-record-v2 <id> [reason]\n cancel-record-v2 <id> [reason]\n get-record-v2 <id>\n list-records-v2\n auto-exhaust-idle-v2\n auto-reject-stuck-v2\n gov-stats-v2\n reset-state-v2\n help [command] display help for command\n",
143
- "session": "Usage: chainlesschain session [options] [command]\n\nConversation session management\n\nOptions:\n -h, --help display help for command\n\nCommands:\n mcp-recovery Inspect or adjudicate verified MCP outcome-unknown calls\n list [options] List saved sessions\n projection [options] Emit the canonical versioned session projection for IDEs\n show [options] <id> Show a session's messages\n pr-status [options] [id] PR/CI monitor + controlled auto-merge decision for a session's linked PR\n resume [options] [id] Resume a session in chat mode (id optional — interactive picker, or most recent when piped)\n export [options] <id> Export a session as Markdown (canonical JSONL transcript, then legacy DB fallback)\n search [options] <query> Full-text search across agent session transcripts (JSONL --resume store)\n delete [options] <id> Delete a session\n rename [options] <id> <title...> Rename a headless (JSONL) session — shows up in session list\n prune [options] Delete JSONL sessions whose last activity is older than a cutoff (newest N always kept)\n migrate [options] [source] Migrate legacy JSON session files to JSONL\n validate [options] [id] Validate JSONL session files\n verify [options] [id] Verify transcript hash-chain integrity (tamper-evidence); omit id to verify all\n repair [options] <id> Diagnose and repair one crash-partial final transcript record only\n index [options] [query] Build/refresh the SQLite session index; search it, or mirror sessions off-box\n policy [options] <id> Show or set per-session approval policy\n lifecycle [options] List session-core handles (running/idle/parked)\n park <id> Park a session (persist to disk, free process memory)\n unpark <id> Resume a parked session\n end [options] <id> Close a session (optionally consolidate trace into MemoryStore)\n tail [options] <id> Follow a JSONL session's events (NDJSON on stdout)\n usage [options] [id] Aggregate token usage (per-session or global)\n workflow [options] [id] Inspect coding workflow state (.chainlesschain/sessions/)\n conversation-maturities-v2 [options] List V2 conversation maturity states\n turn-lifecycles-v2 [options] List V2 turn lifecycle states\n stats-v2 [options] Show V2 session stats\n get-max-active-conv-v2 Get max active conversations per user\n set-max-active-conv-v2 <n> Set max active conversations per user\n get-max-pending-turns-v2 Get max pending turns per conversation\n set-max-pending-turns-v2 <n> Set max pending turns per conversation\n get-conv-idle-ms-v2 Get conversation idle ms\n set-conv-idle-ms-v2 <ms> Set conversation idle ms\n get-turn-stuck-ms-v2 Get turn stuck ms\n set-turn-stuck-ms-v2 <ms> Set turn stuck ms\n active-conv-count-v2 <userId> Count active conversations for user\n pending-turn-count-v2 <conversationId> Count pending+streaming turns for conversation\n register-conversation-v2 [options] <id> Register V2 conversation (initial=draft)\n get-conversation-v2 <id> Get V2 conversation by id\n list-conversations-v2 [options] List V2 conversations\n activate-conversation-v2 <id> Transition conversation → active\n pause-conversation-v2 <id> Transition conversation → paused\n archive-conversation-v2 <id> Transition conversation → archived (terminal)\n touch-conversation-v2 <id> Update conversation lastSeenAt\n create-turn-v2 [options] <id> Create V2 turn (initial=pending)\n get-turn-v2 <id> Get V2 turn by id\n list-turns-v2 [options] List V2 turns\n stream-turn-v2 <id> Transition turn → streaming\n complete-turn-v2 <id> Transition turn → completed (terminal)\n fail-turn-v2 <id> Transition turn → failed (terminal)\n cancel-turn-v2 <id> Transition turn → cancelled (terminal)\n auto-archive-idle-conv-v2 Auto-archive idle conversations; output flipped\n auto-fail-stuck-turns-v2 Auto-fail stuck streaming turns; output flipped\n help [command] display help for command\n",
143
+ "session": "Usage: chainlesschain session [options] [command]\n\nConversation session management\n\nOptions:\n -h, --help display help for command\n\nCommands:\n mcp-recovery Inspect or adjudicate verified MCP outcome-unknown calls\n list [options] List saved sessions\n projection [options] Emit the canonical versioned session projection for IDEs\n show [options] <id> Show a session's messages\n pr-status [options] [id] PR/CI monitor + controlled auto-merge decision for a session's linked PR\n resume [options] [id] Resume a session in chat mode (id optional — interactive picker, or most recent when piped)\n export [options] <id> Export a session as Markdown (canonical JSONL transcript, then legacy DB fallback)\n search [options] <query> Full-text search across agent session transcripts (JSONL --resume store)\n delete [options] <id> Delete a session\n rename [options] <id> <title...> Rename a headless (JSONL) session — shows up in session list\n prune [options] Delete JSONL sessions whose last activity is older than a cutoff (newest N always kept)\n migrate [options] [source] Migrate legacy JSON session files to JSONL\n validate [options] [id] Validate JSONL session files\n verify [options] [id] Verify transcript hash-chain integrity (tamper-evidence); omit id to verify all\n repair [options] <id> Diagnose and repair one crash-partial final transcript record only\n index [options] [query] Build/refresh the SQLite session index; search it, or mirror sessions off-box\n policy [options] <id> Show or set per-session approval policy\n lifecycle [options] List session-core handles (running/idle/parked)\n park <id> Park a session (persist to disk, free process memory)\n unpark <id> Resume a parked session\n end [options] <id> Close a session (optionally consolidate trace into MemoryStore)\n tail [options] <id> Follow a JSONL session's events (NDJSON on stdout)\n usage [options] [id] Aggregate token usage (per-session or global)\n observability [options] <request> Export verified token/USD, retry, tool latency, diff, gate, artifact and PR causality\n observability-authority [options] <id> Print the verified headHash/eventCount/scope binding for a delivery flow\n workflow [options] [id] Inspect coding workflow state (.chainlesschain/sessions/)\n conversation-maturities-v2 [options] List V2 conversation maturity states\n turn-lifecycles-v2 [options] List V2 turn lifecycle states\n stats-v2 [options] Show V2 session stats\n get-max-active-conv-v2 Get max active conversations per user\n set-max-active-conv-v2 <n> Set max active conversations per user\n get-max-pending-turns-v2 Get max pending turns per conversation\n set-max-pending-turns-v2 <n> Set max pending turns per conversation\n get-conv-idle-ms-v2 Get conversation idle ms\n set-conv-idle-ms-v2 <ms> Set conversation idle ms\n get-turn-stuck-ms-v2 Get turn stuck ms\n set-turn-stuck-ms-v2 <ms> Set turn stuck ms\n active-conv-count-v2 <userId> Count active conversations for user\n pending-turn-count-v2 <conversationId> Count pending+streaming turns for conversation\n register-conversation-v2 [options] <id> Register V2 conversation (initial=draft)\n get-conversation-v2 <id> Get V2 conversation by id\n list-conversations-v2 [options] List V2 conversations\n activate-conversation-v2 <id> Transition conversation → active\n pause-conversation-v2 <id> Transition conversation → paused\n archive-conversation-v2 <id> Transition conversation → archived (terminal)\n touch-conversation-v2 <id> Update conversation lastSeenAt\n create-turn-v2 [options] <id> Create V2 turn (initial=pending)\n get-turn-v2 <id> Get V2 turn by id\n list-turns-v2 [options] List V2 turns\n stream-turn-v2 <id> Transition turn → streaming\n complete-turn-v2 <id> Transition turn → completed (terminal)\n fail-turn-v2 <id> Transition turn → failed (terminal)\n cancel-turn-v2 <id> Transition turn → cancelled (terminal)\n auto-archive-idle-conv-v2 Auto-archive idle conversations; output flipped\n auto-fail-stuck-turns-v2 Auto-fail stuck streaming turns; output flipped\n help [command] display help for command\n",
144
144
  "setup": "Usage: chainlesschain setup [options]\n\nInteractive setup wizard for ChainlessChain\n\nOptions:\n --skip-download Skip binary download\n --skip-services Skip Docker service setup\n -h, --help display help for command\n",
145
145
  "sganal": "Usage: chainlesschain sganal [options] [command]\n\nSocial Graph Analytics V2 governance (in-memory, CLI v0.143.0)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n register-profile-v2 [options]\n activate-profile-v2 <id>\n stale-profile-v2 <id>\n archive-profile-v2 <id>\n touch-profile-v2 <id>\n get-profile-v2 <id>\n list-profiles-v2\n create-run-v2 [options]\n running-run-v2 <id>\n complete-run-v2 <id>\n fail-run-v2 [options] <id>\n cancel-run-v2 [options] <id>\n get-run-v2 <id>\n list-runs-v2\n config-v2\n set-max-active-profiles-v2 <n>\n set-max-pending-runs-v2 <n>\n set-profile-idle-ms-v2 <ms>\n set-run-stuck-ms-v2 <ms>\n auto-stale-idle-v2\n auto-fail-stuck-v2\n gov-stats-v2\n help [command] display help for command\n",
146
146
  "siem": "Usage: chainlesschain siem [options] [command]\n\nSIEM integration — log export to external targets\n\nOptions:\n -h, --help display help for command\n\nCommands:\n targets [options] List SIEM export targets\n add-target [options] <type> <url> Add a SIEM target (splunk_hec, elasticsearch, azure_sentinel)\n export <target-id> Export logs to a SIEM target\n stats [options] Show SIEM export statistics\n formats List SIEM export formats (V2)\n target-types List SIEM target types (V2)\n severities List SIEM severity levels (V2)\n statuses List SIEM target statuses (V2)\n default-batch-size Show default SIEM batch size (V2)\n severity-cef <severity> Map a SIEM severity to its CEF integer (0-10)\n format-log [options] <format> Format a JSON log payload as cef|leef|json\n add-target-v2 [options] Add a SIEM target via canonical options (V2)\n remove-target <target-id> Remove a SIEM target (V2)\n set-status <target-id> <status> Transition a SIEM target's status (V2)\n export-v2 [options] <target-id> Batch-export logs to a target (V2)\n stats-v2 Show extended SIEM stats (byFormat/byType/byStatus, V2)\n by-status <status> List SIEM targets filtered by status (V2)\n enums-v2 Show V2 enums (target maturity + export lifecycle)\n config-v2 Show V2 config thresholds\n set-max-active-targets-v2 <n> Set max active targets per operator\n set-max-pending-exports-v2 <n> Set max pending exports per target\n set-target-idle-ms-v2 <n> Set target idle threshold (ms)\n set-export-stuck-ms-v2 <n> Set export stuck threshold (ms)\n register-target-v2 [options] <id> <operator> Register V2 SIEM target\n activate-target-v2 <id> Activate target\n degrade-target-v2 <id> Degrade target\n retire-target-v2 <id> Retire target (terminal)\n touch-target-v2 <id> Touch target lastTouchedAt\n get-target-v2 <id> Get V2 target\n list-targets-v2 List V2 targets\n create-export-v2 [options] <id> <targetId> Create V2 export (queued)\n start-export-v2 <id> Start export\n deliver-export-v2 <id> Deliver export\n fail-export-v2 <id> [reason] Fail export\n cancel-export-v2 <id> [reason] Cancel export\n get-export-v2 <id> Get V2 export\n list-exports-v2 List V2 exports\n auto-degrade-idle-v2 Auto-degrade idle targets\n auto-fail-stuck-v2 Auto-fail stuck sending exports\n gov-stats-v2 V2 governance aggregate stats\n help [command] display help for command\n",
@@ -24,6 +24,7 @@ import {
24
24
  import { appendSecurityAuditEvent } from "../lib/security-audit.js";
25
25
  import {
26
26
  agentPrintArgument,
27
+ BACKGROUND_EPHEMERAL_UNSUPPORTED_CODE,
27
28
  canonicalizeBackgroundSessionArgv,
28
29
  captureCommandArgvGrammar,
29
30
  transformBackgroundLaunchArgv,
@@ -175,6 +176,52 @@ function readStdin() {
175
176
  });
176
177
  }
177
178
 
179
+ /** Normalize the three opt-in causal-report scope flags without losing empties. */
180
+ export function resolveAgentObservabilityScope(options = {}) {
181
+ const fields = [
182
+ ["observabilityWorkspace", "workspaceId", "--observability-workspace"],
183
+ ["observabilityTeam", "teamId", "--observability-team"],
184
+ ["observabilityPolicy", "policyId", "--observability-policy"],
185
+ ];
186
+ const providedFields = fields.filter(
187
+ ([optionName]) => options[optionName] !== undefined,
188
+ );
189
+ if (providedFields.length > 0 && options.forkSession === true) {
190
+ throw new Error(
191
+ "observability scope flags cannot be combined with --fork-session; a fork inherits the source session's immutable observability scope",
192
+ );
193
+ }
194
+ let provided = false;
195
+ const scope = {};
196
+ for (const [optionName, scopeName, flag] of fields) {
197
+ const value = options[optionName];
198
+ if (value === undefined) {
199
+ scope[scopeName] = null;
200
+ continue;
201
+ }
202
+ provided = true;
203
+ if (typeof value !== "string") {
204
+ throw new TypeError(`${flag} requires a non-empty string id`);
205
+ }
206
+ const normalized = value.trim();
207
+ const hasControlCharacter = [...normalized].some((character) => {
208
+ const code = character.codePointAt(0);
209
+ return code <= 0x1f || code === 0x7f;
210
+ });
211
+ if (!normalized || normalized.length > 256 || hasControlCharacter) {
212
+ throw new TypeError(`${flag} requires a valid non-empty id`);
213
+ }
214
+ scope[scopeName] = normalized;
215
+ }
216
+ if (!provided) return undefined;
217
+ if (options.ephemeral === true) {
218
+ throw new Error(
219
+ "observability scope requires durable session persistence and cannot be combined with --ephemeral",
220
+ );
221
+ }
222
+ return scope;
223
+ }
224
+
178
225
  export function registerAgentCommand(program) {
179
226
  program
180
227
  .command("agent")
@@ -496,6 +543,18 @@ export function registerAgentCommand(program) {
496
543
  "--max-budget-usd <amount>",
497
544
  "Hard USD spend cap: stop the run before the next paid LLM call once the estimated cost reaches this (headless; uses the cc cost price table)",
498
545
  )
546
+ .option(
547
+ "--observability-workspace <id>",
548
+ "Persist a workspace scope on new session authority for causal reports",
549
+ )
550
+ .option(
551
+ "--observability-team <id>",
552
+ "Persist a team scope on new session authority for causal reports",
553
+ )
554
+ .option(
555
+ "--observability-policy <id>",
556
+ "Persist a policy scope on new session authority for causal reports",
557
+ )
499
558
  .option(
500
559
  "--strict-mcp-config",
501
560
  "Use ONLY --mcp-config servers; ignore registered (cc mcp add) and IDE-bridge MCP for a reproducible tool surface",
@@ -520,6 +579,19 @@ export function registerAgentCommand(program) {
520
579
  false,
521
580
  )
522
581
  .action(async (task, options, command) => {
582
+ // Scope is immutable session authority. Resolve every scope/fork
583
+ // conflict before worktree creation, session forking, bootstrap, or any
584
+ // other externally visible setup performed by this action.
585
+ let observabilityScope;
586
+ try {
587
+ observabilityScope = resolveAgentObservabilityScope(options);
588
+ } catch (error) {
589
+ process.stderr.write(`${error.message}\n`);
590
+ process.exitCode = 1;
591
+ return;
592
+ }
593
+ const hasObservabilityScope = observabilityScope !== undefined;
594
+
523
595
  // --capabilities: print the machine-readable manifest and exit — no
524
596
  // config, no bootstrap, no network (gap-analysis 2026-07-11 快速收益 #6).
525
597
  if (options.capabilities) {
@@ -625,6 +697,15 @@ export function registerAgentCommand(program) {
625
697
  }
626
698
  const backgroundRequested =
627
699
  options.background === true || options.bg === true;
700
+ if (backgroundRequested && options.ephemeral === true) {
701
+ const error = new Error(
702
+ "--bg cannot be combined with --ephemeral because background sessions require durable session and interaction authority",
703
+ );
704
+ error.code = BACKGROUND_EPHEMERAL_UNSUPPORTED_CODE;
705
+ process.stderr.write(`${error.message}\n`);
706
+ process.exitCode = 1;
707
+ return;
708
+ }
628
709
  const invocationCwd = process.cwd();
629
710
  let worktreeDecision = {
630
711
  enabled: false,
@@ -1182,7 +1263,6 @@ export function registerAgentCommand(program) {
1182
1263
  const { mergePricing } = await import("../lib/llm-pricing.js");
1183
1264
  priceTable = mergePricing(loadConfig().llm?.pricing);
1184
1265
  }
1185
-
1186
1266
  // 鈹€鈹€ Streaming-input mode (--input-format stream-json) 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€
1187
1267
  // A persistent multi-turn conversation driven by NDJSON user events on
1188
1268
  // stdin; output is always NDJSON. Routed before single-prompt handling
@@ -1248,6 +1328,9 @@ export function registerAgentCommand(program) {
1248
1328
  maxCostUsd,
1249
1329
  priceTable,
1250
1330
  chatFn: fallbackChatFn,
1331
+ observabilityScope: hasObservabilityScope
1332
+ ? observabilityScope
1333
+ : undefined,
1251
1334
  // --json-schema: structured output for stream-INPUT mode. The schema
1252
1335
  // is resolved + meta-validated up front, its output contract injected
1253
1336
  // into the system prompt, and a per-turn `structured_result` event is
@@ -1544,6 +1627,9 @@ export function registerAgentCommand(program) {
1544
1627
  // --max-budget-usd: hard spend cap (+ price table from config llm.pricing)
1545
1628
  maxCostUsd,
1546
1629
  priceTable,
1630
+ observabilityScope: hasObservabilityScope
1631
+ ? observabilityScope
1632
+ : undefined,
1547
1633
  // --fallback-model: retry once on a backup model on transient errors
1548
1634
  chatFn: fallbackChatFn,
1549
1635
  };
@@ -1701,6 +1787,9 @@ export function registerAgentCommand(program) {
1701
1787
  // --channels: inbound channel listeners (webhook/telegram) whose
1702
1788
  // events become user turns in this session.
1703
1789
  channels: options.channels || null,
1790
+ observabilityScope: hasObservabilityScope
1791
+ ? observabilityScope
1792
+ : undefined,
1704
1793
  });
1705
1794
  await runtime.startAgentSession();
1706
1795
  // Interactive session ended (REPL closed) — settle the worktree.
@@ -4,8 +4,16 @@
4
4
  */
5
5
 
6
6
  import { createAgentRuntimeFactory } from "../runtime/runtime-factory.js";
7
+ import { assertChatSessionUsageAdmission } from "../lib/chat-session-admission.js";
7
8
 
8
- export function registerChatCommand(program) {
9
+ export { assertChatSessionUsageAdmission } from "../lib/chat-session-admission.js";
10
+
11
+ export function registerChatCommand(program, dependencies = {}) {
12
+ const createRuntimeFactory =
13
+ dependencies.createAgentRuntimeFactory || createAgentRuntimeFactory;
14
+ const assertUsageAdmission =
15
+ dependencies.assertChatSessionUsageAdmission ||
16
+ assertChatSessionUsageAdmission;
9
17
  program
10
18
  .command("chat")
11
19
  .description("Start an interactive AI chat session")
@@ -22,7 +30,8 @@ export function registerChatCommand(program) {
22
30
  )
23
31
  .option("--session <id>", "Resume a previous session (agent mode)")
24
32
  .action(async (options) => {
25
- const factory = createAgentRuntimeFactory();
33
+ if (!options.agent) assertUsageAdmission(options.session);
34
+ const factory = createRuntimeFactory();
26
35
  const runtimeOptions = {
27
36
  model: options.model,
28
37
  provider: options.provider,
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * cc compact <session-id> compact and persist (writes a `compact`
7
7
  * checkpoint event the resume path honors)
8
- * cc compact <session-id> --dry-run preview the reduction, write nothing
8
+ * cc compact <session-id> --dry-run offline preview; no provider call/write
9
9
  *
10
10
  * Engine: PromptCompressor with a bounded structured semantic handoff using the
11
11
  * session's recorded provider. `--offline` explicitly selects deterministic
@@ -23,14 +23,17 @@ import chalk from "chalk";
23
23
  import { logger } from "../lib/logger.js";
24
24
  import {
25
25
  appendAuthorityEventIfHead,
26
+ appendEventIfHead,
26
27
  readVerifiedProjection,
27
28
  sessionExists,
28
29
  } from "../harness/jsonl-session-store.js";
29
30
  import { PromptCompressor } from "../harness/prompt-compressor.js";
31
+ import { compactConversationWithProvider } from "../harness/provider-backed-compaction.js";
32
+ import { runMeteredDirectModelCall } from "../lib/direct-model-usage.js";
30
33
  import { chatWithTools } from "../runtime/agent-core.js";
31
34
 
32
35
  /** Build a compressor sized to the session (or explicit overrides). */
33
- function buildCompressor(options, recorded) {
36
+ function buildCompressor(options, recorded, llmQuery) {
34
37
  const maxTokens = options.maxTokens ? Number(options.maxTokens) : undefined;
35
38
  const maxMessages = options.maxMessages
36
39
  ? Number(options.maxMessages)
@@ -40,7 +43,7 @@ function buildCompressor(options, recorded) {
40
43
  return new PromptCompressor({
41
44
  maxTokens,
42
45
  maxMessages,
43
- llmQuery: buildSemanticQuery(options, recorded),
46
+ llmQuery,
44
47
  });
45
48
  }
46
49
  const model = options.model || recorded.model || undefined;
@@ -49,32 +52,89 @@ function buildCompressor(options, recorded) {
49
52
  return new PromptCompressor({
50
53
  model,
51
54
  provider,
52
- llmQuery: buildSemanticQuery(options, { model, provider }),
55
+ llmQuery,
53
56
  });
54
57
  }
55
58
 
56
- function buildSemanticQuery(options, recorded) {
59
+ function attachMeteringMetadata(value, { callId, settled }) {
60
+ if (!value || typeof value !== "object" || Array.isArray(value)) return;
61
+ try {
62
+ Object.defineProperties(value, {
63
+ compactionCallId: {
64
+ configurable: true,
65
+ value: callId || undefined,
66
+ },
67
+ usageLedgerSettled: {
68
+ configurable: true,
69
+ value: settled === true,
70
+ },
71
+ });
72
+ } catch {
73
+ // A frozen provider error still propagates. The durable started row remains
74
+ // authoritative if its unknown settlement could not be attached here.
75
+ }
76
+ }
77
+
78
+ function buildSemanticQuery(options, recorded, sessionId, ledger) {
57
79
  const provider = options.provider || recorded.provider || undefined;
58
80
  const model = options.model || recorded.model || undefined;
59
- if (options.offline || !provider) return null;
81
+ // A preview must be both write-free and spend-free. It uses the same
82
+ // deterministic compressor thresholds, but never installs an LLM callback.
83
+ if (options.offline || options.dryRun || !provider) return null;
60
84
  const baseUrl =
61
85
  options.baseUrl ||
62
86
  (provider === "ollama" ? "http://localhost:11434" : undefined);
63
87
  return async (prompt) => {
64
- const response = await chatWithTools([{ role: "user", content: prompt }], {
65
- provider,
66
- model,
67
- baseUrl,
68
- enabledToolNames: [],
69
- extraToolDefinitions: [],
70
- maxOutputTokens: 2048,
71
- });
72
- return {
73
- summary: response?.message?.content || "",
74
- usage: response?.usage || null,
75
- provider,
76
- model,
77
- };
88
+ let callId = null;
89
+ try {
90
+ const response = await runMeteredDirectModelCall({
91
+ sessionId,
92
+ provider,
93
+ model,
94
+ source: "semantic-compaction",
95
+ persist: async (type, data) => {
96
+ const appended = appendEventIfHead(
97
+ sessionId,
98
+ type,
99
+ data,
100
+ ledger.headHash,
101
+ );
102
+ ledger.headHash = appended.hash;
103
+ if (type === "model_usage_started") {
104
+ callId = data.callId;
105
+ ledger.callId = callId;
106
+ ledger.started = true;
107
+ } else {
108
+ ledger.settled = true;
109
+ }
110
+ },
111
+ call: () =>
112
+ chatWithTools([{ role: "user", content: prompt }], {
113
+ provider,
114
+ model,
115
+ baseUrl,
116
+ enabledToolNames: [],
117
+ extraToolDefinitions: [],
118
+ hostManagedToolPolicy: null,
119
+ contextEngine: null,
120
+ maxOutputTokens: 2048,
121
+ }),
122
+ });
123
+ return {
124
+ summary: response?.message?.content || "",
125
+ usage: response?.usage || null,
126
+ provider,
127
+ model,
128
+ callId,
129
+ usageLedgerSettled: true,
130
+ };
131
+ } catch (error) {
132
+ attachMeteringMetadata(error, {
133
+ callId: callId || ledger.callId,
134
+ settled: ledger.settled,
135
+ });
136
+ throw error;
137
+ }
78
138
  };
79
139
  }
80
140
 
@@ -144,9 +204,32 @@ export function registerCompactCommand(program) {
144
204
 
145
205
  const source = readCompactSource(sessionId);
146
206
  const messages = source.messages;
147
- const compressor = buildCompressor(options, source.recorded);
207
+ const ledger = {
208
+ headHash: source.headHash,
209
+ callId: null,
210
+ started: false,
211
+ settled: false,
212
+ };
213
+ const llmQuery = buildSemanticQuery(
214
+ options,
215
+ source.recorded,
216
+ sessionId,
217
+ ledger,
218
+ );
219
+ const compressor = buildCompressor(options, source.recorded, llmQuery);
220
+ // llmQuery already persisted a complete call ledger. The provider
221
+ // helper only carries its metadata through stats; its projected usage
222
+ // event is intentionally not appended a second time here.
148
223
  const { messages: compacted, stats } =
149
- await compressor.compress(messages);
224
+ await compactConversationWithProvider(messages, {
225
+ compressor,
226
+ provider: options.provider || source.recorded.provider || undefined,
227
+ model: options.model || source.recorded.model || undefined,
228
+ });
229
+
230
+ if (ledger.started && !ledger.settled) {
231
+ throw new Error("semantic compaction usage ledger is unsettled");
232
+ }
150
233
 
151
234
  const reduced = stats.saved > 0 || compacted.length < messages.length;
152
235
 
@@ -170,7 +253,7 @@ export function registerCompactCommand(program) {
170
253
  sessionId,
171
254
  "compact",
172
255
  { ...stats, messages: compacted },
173
- source.headHash,
256
+ ledger.headHash,
174
257
  );
175
258
  }
176
259
 
@@ -44,15 +44,20 @@ import {
44
44
  appendEvent,
45
45
  appendEventIfHead,
46
46
  readEvents,
47
+ sessionPath,
47
48
  sessionExists,
48
49
  } from "../harness/jsonl-session-store.js";
49
50
  import { openSchedulerStore } from "../lib/scheduler-kernel/store.js";
50
- import { LoopSchedulerBridge } from "../lib/scheduler-kernel/loop-adapter.js";
51
+ import {
52
+ LoopSchedulerBridge,
53
+ migrateSavedLoopSession,
54
+ } from "../lib/scheduler-kernel/loop-adapter.js";
51
55
 
52
56
  export const _deps = {
53
57
  spawn: executionBroker.spawn.bind(executionBroker),
54
58
  openSchedulerStore,
55
59
  createLoopSchedulerBridge: (options) => new LoopSchedulerBridge(options),
60
+ migrateSavedLoopSession,
56
61
  };
57
62
 
58
63
  /**
@@ -395,7 +400,7 @@ export function registerLoopCommand(program) {
395
400
  : null,
396
401
  { title: `loop: ${operands.join(" ")}`.slice(0, 80) },
397
402
  );
398
- appendEvent(sessionId, "loop_config", {
403
+ savedConfig = {
399
404
  execMode,
400
405
  operands,
401
406
  dynamic,
@@ -404,7 +409,8 @@ export function registerLoopCommand(program) {
404
409
  untilExitZero,
405
410
  until: untilRaw || null,
406
411
  cwd: executionCwd,
407
- });
412
+ };
413
+ appendEvent(sessionId, "loop_config", savedConfig);
408
414
  }
409
415
 
410
416
  // --- SIGINT → graceful stop after the current iteration ---
@@ -446,15 +452,27 @@ export function registerLoopCommand(program) {
446
452
  try {
447
453
  const executionId = sessionId || `loop-${randomUUID()}`;
448
454
  schedulerStore = _deps.openSchedulerStore();
455
+ const definition = {
456
+ executionId,
457
+ cwd: executionCwd,
458
+ execMode,
459
+ operands,
460
+ dynamic,
461
+ };
462
+ if (persist) {
463
+ _deps.migrateSavedLoopSession({
464
+ schedulerStore,
465
+ sessionId,
466
+ config: savedConfig,
467
+ definition,
468
+ readEvents,
469
+ appendEventIfHead,
470
+ sessionFilePath: sessionPath,
471
+ });
472
+ }
449
473
  const loopScheduler = _deps.createLoopSchedulerBridge({
450
474
  schedulerStore,
451
- definition: {
452
- executionId,
453
- cwd: executionCwd,
454
- execMode,
455
- operands,
456
- dynamic,
457
- },
475
+ definition,
458
476
  runIteration: async (n, { signal } = {}) => {
459
477
  logger.log(chalk.gray(`\n▸ iteration ${n} — ${label}`));
460
478
  const t0 = Date.now();
@@ -345,7 +345,7 @@ export function registerRoutineCommand(program) {
345
345
  runId,
346
346
  });
347
347
  }
348
- for (const r of store.githubRoutines()) {
348
+ for (const r of store.githubRoutines({ schedulerMigration: true })) {
349
349
  const github = await bridge.pollGithub(r, {
350
350
  fetchEvents: defaultFetchEvents,
351
351
  });