@productbrain/cli 0.1.0-beta.27 → 0.1.0-beta.2721

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 (1097) hide show
  1. package/README.md +72 -172
  2. package/dist/__tests__/adapters.test.js +54 -1
  3. package/dist/__tests__/adapters.test.js.map +1 -1
  4. package/dist/__tests__/audit.test.js +65 -44
  5. package/dist/__tests__/audit.test.js.map +1 -1
  6. package/dist/__tests__/authority-domains-queue.test.d.ts +2 -0
  7. package/dist/__tests__/authority-domains-queue.test.d.ts.map +1 -0
  8. package/dist/__tests__/authority-domains-queue.test.js +169 -0
  9. package/dist/__tests__/authority-domains-queue.test.js.map +1 -0
  10. package/dist/__tests__/authority-domains.test.d.ts +2 -0
  11. package/dist/__tests__/authority-domains.test.d.ts.map +1 -0
  12. package/dist/__tests__/authority-domains.test.js +48 -0
  13. package/dist/__tests__/authority-domains.test.js.map +1 -0
  14. package/dist/__tests__/canonicalRefs.vocab.test.d.ts +2 -0
  15. package/dist/__tests__/canonicalRefs.vocab.test.d.ts.map +1 -0
  16. package/dist/__tests__/canonicalRefs.vocab.test.js +251 -0
  17. package/dist/__tests__/canonicalRefs.vocab.test.js.map +1 -0
  18. package/dist/__tests__/capture-receipt-coaching.test.d.ts +2 -0
  19. package/dist/__tests__/capture-receipt-coaching.test.d.ts.map +1 -0
  20. package/dist/__tests__/capture-receipt-coaching.test.js +89 -0
  21. package/dist/__tests__/capture-receipt-coaching.test.js.map +1 -0
  22. package/dist/__tests__/capture-receipt-domain.test.d.ts +2 -0
  23. package/dist/__tests__/capture-receipt-domain.test.d.ts.map +1 -0
  24. package/dist/__tests__/capture-receipt-domain.test.js +29 -0
  25. package/dist/__tests__/capture-receipt-domain.test.js.map +1 -0
  26. package/dist/__tests__/capture.test.js +645 -40
  27. package/dist/__tests__/capture.test.js.map +1 -1
  28. package/dist/__tests__/coaching-mirror-drift.test.d.ts +2 -0
  29. package/dist/__tests__/coaching-mirror-drift.test.d.ts.map +1 -0
  30. package/dist/__tests__/coaching-mirror-drift.test.js +47 -0
  31. package/dist/__tests__/coaching-mirror-drift.test.js.map +1 -0
  32. package/dist/__tests__/codex-prep-parity.test.d.ts +2 -0
  33. package/dist/__tests__/codex-prep-parity.test.d.ts.map +1 -0
  34. package/dist/__tests__/codex-prep-parity.test.js +107 -0
  35. package/dist/__tests__/codex-prep-parity.test.js.map +1 -0
  36. package/dist/__tests__/collection-registry-seed-drift.test.d.ts +2 -0
  37. package/dist/__tests__/collection-registry-seed-drift.test.d.ts.map +1 -0
  38. package/dist/__tests__/collection-registry-seed-drift.test.js +58 -0
  39. package/dist/__tests__/collection-registry-seed-drift.test.js.map +1 -0
  40. package/dist/__tests__/config-prod-fallthrough.test.d.ts +2 -0
  41. package/dist/__tests__/config-prod-fallthrough.test.d.ts.map +1 -0
  42. package/dist/__tests__/config-prod-fallthrough.test.js +82 -0
  43. package/dist/__tests__/config-prod-fallthrough.test.js.map +1 -0
  44. package/dist/__tests__/config.test.d.ts +8 -0
  45. package/dist/__tests__/config.test.d.ts.map +1 -0
  46. package/dist/__tests__/config.test.js +566 -0
  47. package/dist/__tests__/config.test.js.map +1 -0
  48. package/dist/__tests__/constants.test.d.ts +2 -0
  49. package/dist/__tests__/constants.test.d.ts.map +1 -0
  50. package/dist/__tests__/constants.test.js +146 -0
  51. package/dist/__tests__/constants.test.js.map +1 -0
  52. package/dist/__tests__/constellation.test.js +16 -22
  53. package/dist/__tests__/constellation.test.js.map +1 -1
  54. package/dist/__tests__/context-strategy.test.js +8 -8
  55. package/dist/__tests__/context-strategy.test.js.map +1 -1
  56. package/dist/__tests__/conversation.test.d.ts +2 -0
  57. package/dist/__tests__/conversation.test.d.ts.map +1 -0
  58. package/dist/__tests__/conversation.test.js +113 -0
  59. package/dist/__tests__/conversation.test.js.map +1 -0
  60. package/dist/__tests__/entry-formatter.test.d.ts +2 -0
  61. package/dist/__tests__/entry-formatter.test.d.ts.map +1 -0
  62. package/dist/__tests__/entry-formatter.test.js +82 -0
  63. package/dist/__tests__/entry-formatter.test.js.map +1 -0
  64. package/dist/__tests__/envelope-contract.test.d.ts +15 -0
  65. package/dist/__tests__/envelope-contract.test.d.ts.map +1 -0
  66. package/dist/__tests__/envelope-contract.test.js +152 -0
  67. package/dist/__tests__/envelope-contract.test.js.map +1 -0
  68. package/dist/__tests__/errors.test.d.ts +2 -0
  69. package/dist/__tests__/errors.test.d.ts.map +1 -0
  70. package/dist/__tests__/errors.test.js +125 -0
  71. package/dist/__tests__/errors.test.js.map +1 -0
  72. package/dist/__tests__/experiment.test.d.ts +6 -0
  73. package/dist/__tests__/experiment.test.d.ts.map +1 -0
  74. package/dist/__tests__/experiment.test.js +69 -0
  75. package/dist/__tests__/experiment.test.js.map +1 -0
  76. package/dist/__tests__/fields.test.js +36 -36
  77. package/dist/__tests__/fields.test.js.map +1 -1
  78. package/dist/__tests__/glossary.test.d.ts +2 -0
  79. package/dist/__tests__/glossary.test.d.ts.map +1 -0
  80. package/dist/__tests__/glossary.test.js +32 -0
  81. package/dist/__tests__/glossary.test.js.map +1 -0
  82. package/dist/__tests__/handshake-augment.test.d.ts +2 -0
  83. package/dist/__tests__/handshake-augment.test.d.ts.map +1 -0
  84. package/dist/__tests__/handshake-augment.test.js +424 -0
  85. package/dist/__tests__/handshake-augment.test.js.map +1 -0
  86. package/dist/__tests__/handshake-dormancy.test.d.ts +2 -0
  87. package/dist/__tests__/handshake-dormancy.test.d.ts.map +1 -0
  88. package/dist/__tests__/handshake-dormancy.test.js +207 -0
  89. package/dist/__tests__/handshake-dormancy.test.js.map +1 -0
  90. package/dist/__tests__/handshake-formatter.test.d.ts +2 -0
  91. package/dist/__tests__/handshake-formatter.test.d.ts.map +1 -0
  92. package/dist/__tests__/handshake-formatter.test.js +67 -0
  93. package/dist/__tests__/handshake-formatter.test.js.map +1 -0
  94. package/dist/__tests__/handshake-preview.test.d.ts +2 -0
  95. package/dist/__tests__/handshake-preview.test.d.ts.map +1 -0
  96. package/dist/__tests__/handshake-preview.test.js +950 -0
  97. package/dist/__tests__/handshake-preview.test.js.map +1 -0
  98. package/dist/__tests__/handshake.e2e.test.d.ts +2 -0
  99. package/dist/__tests__/handshake.e2e.test.d.ts.map +1 -0
  100. package/dist/__tests__/handshake.e2e.test.js +1255 -0
  101. package/dist/__tests__/handshake.e2e.test.js.map +1 -0
  102. package/dist/__tests__/handshake.test.js +796 -19
  103. package/dist/__tests__/handshake.test.js.map +1 -1
  104. package/dist/__tests__/health-gap-kinds-drift.test.d.ts +2 -0
  105. package/dist/__tests__/health-gap-kinds-drift.test.d.ts.map +1 -0
  106. package/dist/__tests__/health-gap-kinds-drift.test.js +41 -0
  107. package/dist/__tests__/health-gap-kinds-drift.test.js.map +1 -0
  108. package/dist/__tests__/hook-intents.test.d.ts +2 -0
  109. package/dist/__tests__/hook-intents.test.d.ts.map +1 -0
  110. package/dist/__tests__/hook-intents.test.js +184 -0
  111. package/dist/__tests__/hook-intents.test.js.map +1 -0
  112. package/dist/__tests__/ingest.test.js +37 -28
  113. package/dist/__tests__/ingest.test.js.map +1 -1
  114. package/dist/__tests__/init.test.d.ts +7 -0
  115. package/dist/__tests__/init.test.d.ts.map +1 -0
  116. package/dist/__tests__/init.test.js +146 -0
  117. package/dist/__tests__/init.test.js.map +1 -0
  118. package/dist/__tests__/login.test.d.ts +2 -0
  119. package/dist/__tests__/login.test.d.ts.map +1 -0
  120. package/dist/__tests__/login.test.js +167 -0
  121. package/dist/__tests__/login.test.js.map +1 -0
  122. package/dist/__tests__/manifest.test.d.ts +6 -0
  123. package/dist/__tests__/manifest.test.d.ts.map +1 -0
  124. package/dist/__tests__/manifest.test.js +255 -0
  125. package/dist/__tests__/manifest.test.js.map +1 -0
  126. package/dist/__tests__/method-publish-coherency.test.d.ts +9 -0
  127. package/dist/__tests__/method-publish-coherency.test.d.ts.map +1 -0
  128. package/dist/__tests__/method-publish-coherency.test.js +71 -0
  129. package/dist/__tests__/method-publish-coherency.test.js.map +1 -0
  130. package/dist/__tests__/method-registry.integration.test.d.ts +6 -0
  131. package/dist/__tests__/method-registry.integration.test.d.ts.map +1 -0
  132. package/dist/__tests__/method-registry.integration.test.js +17 -0
  133. package/dist/__tests__/method-registry.integration.test.js.map +1 -0
  134. package/dist/__tests__/method-registry.test.d.ts +12 -0
  135. package/dist/__tests__/method-registry.test.d.ts.map +1 -0
  136. package/dist/__tests__/method-registry.test.js +86 -0
  137. package/dist/__tests__/method-registry.test.js.map +1 -0
  138. package/dist/__tests__/notice-marker.test.d.ts +2 -0
  139. package/dist/__tests__/notice-marker.test.d.ts.map +1 -0
  140. package/dist/__tests__/notice-marker.test.js +41 -0
  141. package/dist/__tests__/notice-marker.test.js.map +1 -0
  142. package/dist/__tests__/onboarding-path-b.test.d.ts +2 -0
  143. package/dist/__tests__/onboarding-path-b.test.d.ts.map +1 -0
  144. package/dist/__tests__/onboarding-path-b.test.js +46 -0
  145. package/dist/__tests__/onboarding-path-b.test.js.map +1 -0
  146. package/dist/__tests__/onboarding.test.d.ts +6 -0
  147. package/dist/__tests__/onboarding.test.d.ts.map +1 -0
  148. package/dist/__tests__/onboarding.test.js +347 -0
  149. package/dist/__tests__/onboarding.test.js.map +1 -0
  150. package/dist/__tests__/orient.test.js +485 -11
  151. package/dist/__tests__/orient.test.js.map +1 -1
  152. package/dist/__tests__/perimeter.test.d.ts +2 -0
  153. package/dist/__tests__/perimeter.test.d.ts.map +1 -0
  154. package/dist/__tests__/perimeter.test.js +165 -0
  155. package/dist/__tests__/perimeter.test.js.map +1 -0
  156. package/dist/__tests__/personal-layer.test.d.ts +11 -0
  157. package/dist/__tests__/personal-layer.test.d.ts.map +1 -0
  158. package/dist/__tests__/personal-layer.test.js +268 -0
  159. package/dist/__tests__/personal-layer.test.js.map +1 -0
  160. package/dist/__tests__/preview-key-refresh.test.d.ts +2 -0
  161. package/dist/__tests__/preview-key-refresh.test.d.ts.map +1 -0
  162. package/dist/__tests__/preview-key-refresh.test.js +126 -0
  163. package/dist/__tests__/preview-key-refresh.test.js.map +1 -0
  164. package/dist/__tests__/profiles.test.d.ts +2 -0
  165. package/dist/__tests__/profiles.test.d.ts.map +1 -0
  166. package/dist/__tests__/profiles.test.js +320 -0
  167. package/dist/__tests__/profiles.test.js.map +1 -0
  168. package/dist/__tests__/promote-batch.test.d.ts +2 -0
  169. package/dist/__tests__/promote-batch.test.d.ts.map +1 -0
  170. package/dist/__tests__/promote-batch.test.js +185 -0
  171. package/dist/__tests__/promote-batch.test.js.map +1 -0
  172. package/dist/__tests__/promote.test.js +297 -40
  173. package/dist/__tests__/promote.test.js.map +1 -1
  174. package/dist/__tests__/prompts.test.d.ts +6 -0
  175. package/dist/__tests__/prompts.test.d.ts.map +1 -0
  176. package/dist/__tests__/prompts.test.js +146 -0
  177. package/dist/__tests__/prompts.test.js.map +1 -0
  178. package/dist/__tests__/proof-run.test.d.ts +2 -0
  179. package/dist/__tests__/proof-run.test.d.ts.map +1 -0
  180. package/dist/__tests__/proof-run.test.js +255 -0
  181. package/dist/__tests__/proof-run.test.js.map +1 -0
  182. package/dist/__tests__/proposals.test.js +24 -47
  183. package/dist/__tests__/proposals.test.js.map +1 -1
  184. package/dist/__tests__/relate.test.js +34 -36
  185. package/dist/__tests__/relate.test.js.map +1 -1
  186. package/dist/__tests__/runner.test.js +19 -15
  187. package/dist/__tests__/runner.test.js.map +1 -1
  188. package/dist/__tests__/session-close-loop.test.d.ts +2 -0
  189. package/dist/__tests__/session-close-loop.test.d.ts.map +1 -0
  190. package/dist/__tests__/session-close-loop.test.js +231 -0
  191. package/dist/__tests__/session-close-loop.test.js.map +1 -0
  192. package/dist/__tests__/session-label.test.d.ts +2 -0
  193. package/dist/__tests__/session-label.test.d.ts.map +1 -0
  194. package/dist/__tests__/session-label.test.js +46 -0
  195. package/dist/__tests__/session-label.test.js.map +1 -0
  196. package/dist/__tests__/session-list-show.test.d.ts +2 -0
  197. package/dist/__tests__/session-list-show.test.d.ts.map +1 -0
  198. package/dist/__tests__/session-list-show.test.js +174 -0
  199. package/dist/__tests__/session-list-show.test.js.map +1 -0
  200. package/dist/__tests__/session-reset.test.d.ts +2 -0
  201. package/dist/__tests__/session-reset.test.d.ts.map +1 -0
  202. package/dist/__tests__/session-reset.test.js +138 -0
  203. package/dist/__tests__/session-reset.test.js.map +1 -0
  204. package/dist/__tests__/session-resume-backstop.test.d.ts +2 -0
  205. package/dist/__tests__/session-resume-backstop.test.d.ts.map +1 -0
  206. package/dist/__tests__/session-resume-backstop.test.js +99 -0
  207. package/dist/__tests__/session-resume-backstop.test.js.map +1 -0
  208. package/dist/__tests__/session-start-key-refresh.test.d.ts +2 -0
  209. package/dist/__tests__/session-start-key-refresh.test.d.ts.map +1 -0
  210. package/dist/__tests__/session-start-key-refresh.test.js +183 -0
  211. package/dist/__tests__/session-start-key-refresh.test.js.map +1 -0
  212. package/dist/__tests__/session-state-machine.test.d.ts +2 -0
  213. package/dist/__tests__/session-state-machine.test.d.ts.map +1 -0
  214. package/dist/__tests__/session-state-machine.test.js +379 -0
  215. package/dist/__tests__/session-state-machine.test.js.map +1 -0
  216. package/dist/__tests__/session-switch.test.d.ts +2 -0
  217. package/dist/__tests__/session-switch.test.d.ts.map +1 -0
  218. package/dist/__tests__/session-switch.test.js +132 -0
  219. package/dist/__tests__/session-switch.test.js.map +1 -0
  220. package/dist/__tests__/session-touch.test.js +11 -11
  221. package/dist/__tests__/session-touch.test.js.map +1 -1
  222. package/dist/__tests__/session.test.js +4 -10
  223. package/dist/__tests__/session.test.js.map +1 -1
  224. package/dist/__tests__/setup-ingest.test.d.ts +2 -0
  225. package/dist/__tests__/setup-ingest.test.d.ts.map +1 -0
  226. package/dist/__tests__/setup-ingest.test.js +71 -0
  227. package/dist/__tests__/setup-ingest.test.js.map +1 -0
  228. package/dist/__tests__/setup-resolver.test.d.ts +14 -0
  229. package/dist/__tests__/setup-resolver.test.d.ts.map +1 -0
  230. package/dist/__tests__/setup-resolver.test.js +228 -0
  231. package/dist/__tests__/setup-resolver.test.js.map +1 -0
  232. package/dist/__tests__/skill-vocabulary.test.d.ts +21 -0
  233. package/dist/__tests__/skill-vocabulary.test.d.ts.map +1 -0
  234. package/dist/__tests__/skill-vocabulary.test.js +192 -0
  235. package/dist/__tests__/skill-vocabulary.test.js.map +1 -0
  236. package/dist/__tests__/spinner-labels.test.d.ts +2 -0
  237. package/dist/__tests__/spinner-labels.test.d.ts.map +1 -0
  238. package/dist/__tests__/spinner-labels.test.js +23 -0
  239. package/dist/__tests__/spinner-labels.test.js.map +1 -0
  240. package/dist/__tests__/state.test.d.ts +6 -0
  241. package/dist/__tests__/state.test.d.ts.map +1 -0
  242. package/dist/__tests__/state.test.js +97 -0
  243. package/dist/__tests__/state.test.js.map +1 -0
  244. package/dist/__tests__/surfaces.test.d.ts +2 -0
  245. package/dist/__tests__/surfaces.test.d.ts.map +1 -0
  246. package/dist/__tests__/surfaces.test.js +46 -0
  247. package/dist/__tests__/surfaces.test.js.map +1 -0
  248. package/dist/__tests__/update-check.test.d.ts +2 -0
  249. package/dist/__tests__/update-check.test.d.ts.map +1 -0
  250. package/dist/__tests__/update-check.test.js +215 -0
  251. package/dist/__tests__/update-check.test.js.map +1 -0
  252. package/dist/__tests__/update.test.js +88 -81
  253. package/dist/__tests__/update.test.js.map +1 -1
  254. package/dist/__tests__/upgrade-runner.test.d.ts +2 -0
  255. package/dist/__tests__/upgrade-runner.test.d.ts.map +1 -0
  256. package/dist/__tests__/upgrade-runner.test.js +54 -0
  257. package/dist/__tests__/upgrade-runner.test.js.map +1 -0
  258. package/dist/__tests__/upgrade.test.d.ts +2 -0
  259. package/dist/__tests__/upgrade.test.d.ts.map +1 -0
  260. package/dist/__tests__/upgrade.test.js +56 -0
  261. package/dist/__tests__/upgrade.test.js.map +1 -0
  262. package/dist/__tests__/verify-formatter.test.d.ts +2 -0
  263. package/dist/__tests__/verify-formatter.test.d.ts.map +1 -0
  264. package/dist/__tests__/verify-formatter.test.js +85 -0
  265. package/dist/__tests__/verify-formatter.test.js.map +1 -0
  266. package/dist/__tests__/vocabulary-leak.test.d.ts +39 -0
  267. package/dist/__tests__/vocabulary-leak.test.d.ts.map +1 -0
  268. package/dist/__tests__/vocabulary-leak.test.js +539 -0
  269. package/dist/__tests__/vocabulary-leak.test.js.map +1 -0
  270. package/dist/__tests__/workspace.test.d.ts +2 -0
  271. package/dist/__tests__/workspace.test.d.ts.map +1 -0
  272. package/dist/__tests__/workspace.test.js +328 -0
  273. package/dist/__tests__/workspace.test.js.map +1 -0
  274. package/dist/__tests__/workspaceNotice.test.d.ts +2 -0
  275. package/dist/__tests__/workspaceNotice.test.d.ts.map +1 -0
  276. package/dist/__tests__/workspaceNotice.test.js +338 -0
  277. package/dist/__tests__/workspaceNotice.test.js.map +1 -0
  278. package/dist/commands/__tests__/connect-handoff.test.d.ts +11 -0
  279. package/dist/commands/__tests__/connect-handoff.test.d.ts.map +1 -0
  280. package/dist/commands/__tests__/connect-handoff.test.js +111 -0
  281. package/dist/commands/__tests__/connect-handoff.test.js.map +1 -0
  282. package/dist/commands/__tests__/rework.test.d.ts +2 -0
  283. package/dist/commands/__tests__/rework.test.d.ts.map +1 -0
  284. package/dist/commands/__tests__/rework.test.js +149 -0
  285. package/dist/commands/__tests__/rework.test.js.map +1 -0
  286. package/dist/commands/__tests__/setup-detect-surfaces.test.d.ts +15 -0
  287. package/dist/commands/__tests__/setup-detect-surfaces.test.d.ts.map +1 -0
  288. package/dist/commands/__tests__/setup-detect-surfaces.test.js +149 -0
  289. package/dist/commands/__tests__/setup-detect-surfaces.test.js.map +1 -0
  290. package/dist/commands/__tests__/setup-state.test.d.ts +2 -0
  291. package/dist/commands/__tests__/setup-state.test.d.ts.map +1 -0
  292. package/dist/commands/__tests__/setup-state.test.js +194 -0
  293. package/dist/commands/__tests__/setup-state.test.js.map +1 -0
  294. package/dist/commands/accept.d.ts.map +1 -1
  295. package/dist/commands/accept.js +10 -6
  296. package/dist/commands/accept.js.map +1 -1
  297. package/dist/commands/admin/cockpit.d.ts +90 -0
  298. package/dist/commands/admin/cockpit.d.ts.map +1 -0
  299. package/dist/commands/admin/cockpit.js +618 -0
  300. package/dist/commands/admin/cockpit.js.map +1 -0
  301. package/dist/commands/admin/index.d.ts +21 -0
  302. package/dist/commands/admin/index.d.ts.map +1 -0
  303. package/dist/commands/admin/index.js +256 -0
  304. package/dist/commands/admin/index.js.map +1 -0
  305. package/dist/commands/admin/inspect.d.ts +30 -0
  306. package/dist/commands/admin/inspect.d.ts.map +1 -0
  307. package/dist/commands/admin/inspect.js +555 -0
  308. package/dist/commands/admin/inspect.js.map +1 -0
  309. package/dist/commands/admin/inspect.test.d.ts +7 -0
  310. package/dist/commands/admin/inspect.test.d.ts.map +1 -0
  311. package/dist/commands/admin/inspect.test.js +90 -0
  312. package/dist/commands/admin/inspect.test.js.map +1 -0
  313. package/dist/commands/admin/manage.d.ts +8 -0
  314. package/dist/commands/admin/manage.d.ts.map +1 -0
  315. package/dist/commands/admin/manage.js +260 -0
  316. package/dist/commands/admin/manage.js.map +1 -0
  317. package/dist/commands/admin/manage.test.d.ts +16 -0
  318. package/dist/commands/admin/manage.test.d.ts.map +1 -0
  319. package/dist/commands/admin/manage.test.js +159 -0
  320. package/dist/commands/admin/manage.test.js.map +1 -0
  321. package/dist/commands/admin/seed.d.ts +75 -0
  322. package/dist/commands/admin/seed.d.ts.map +1 -0
  323. package/dist/commands/admin/seed.js +944 -0
  324. package/dist/commands/admin/seed.js.map +1 -0
  325. package/dist/commands/admin/seed.test.d.ts +11 -0
  326. package/dist/commands/admin/seed.test.d.ts.map +1 -0
  327. package/dist/commands/admin/seed.test.js +127 -0
  328. package/dist/commands/admin/seed.test.js.map +1 -0
  329. package/dist/commands/admin/seedRegistryEntries.generated.d.ts +14 -0
  330. package/dist/commands/admin/seedRegistryEntries.generated.d.ts.map +1 -0
  331. package/dist/commands/admin/seedRegistryEntries.generated.js +153 -0
  332. package/dist/commands/admin/seedRegistryEntries.generated.js.map +1 -0
  333. package/dist/commands/admin/seedRegistryEntries.test.d.ts +13 -0
  334. package/dist/commands/admin/seedRegistryEntries.test.d.ts.map +1 -0
  335. package/dist/commands/admin/seedRegistryEntries.test.js +91 -0
  336. package/dist/commands/admin/seedRegistryEntries.test.js.map +1 -0
  337. package/dist/commands/audit.d.ts.map +1 -1
  338. package/dist/commands/audit.js +42 -7
  339. package/dist/commands/audit.js.map +1 -1
  340. package/dist/commands/authority-domains.d.ts +157 -0
  341. package/dist/commands/authority-domains.d.ts.map +1 -0
  342. package/dist/commands/authority-domains.js +387 -0
  343. package/dist/commands/authority-domains.js.map +1 -0
  344. package/dist/commands/brief.d.ts.map +1 -1
  345. package/dist/commands/brief.js +14 -5
  346. package/dist/commands/brief.js.map +1 -1
  347. package/dist/commands/capture.d.ts +9 -0
  348. package/dist/commands/capture.d.ts.map +1 -1
  349. package/dist/commands/capture.js +295 -76
  350. package/dist/commands/capture.js.map +1 -1
  351. package/dist/commands/chain-walk.d.ts.map +1 -1
  352. package/dist/commands/chain-walk.js +8 -3
  353. package/dist/commands/chain-walk.js.map +1 -1
  354. package/dist/commands/changes.d.ts.map +1 -1
  355. package/dist/commands/changes.js +8 -3
  356. package/dist/commands/changes.js.map +1 -1
  357. package/dist/commands/codex-prep.d.ts +12 -1
  358. package/dist/commands/codex-prep.d.ts.map +1 -1
  359. package/dist/commands/codex-prep.js +25 -87
  360. package/dist/commands/codex-prep.js.map +1 -1
  361. package/dist/commands/collections.d.ts +22 -0
  362. package/dist/commands/collections.d.ts.map +1 -0
  363. package/dist/commands/collections.js +77 -0
  364. package/dist/commands/collections.js.map +1 -0
  365. package/dist/commands/conflicts.d.ts +10 -0
  366. package/dist/commands/conflicts.d.ts.map +1 -0
  367. package/dist/commands/conflicts.js +103 -0
  368. package/dist/commands/conflicts.js.map +1 -0
  369. package/dist/commands/conflicts.test.d.ts +2 -0
  370. package/dist/commands/conflicts.test.d.ts.map +1 -0
  371. package/dist/commands/conflicts.test.js +97 -0
  372. package/dist/commands/conflicts.test.js.map +1 -0
  373. package/dist/commands/connect-config.test.d.ts +2 -0
  374. package/dist/commands/connect-config.test.d.ts.map +1 -0
  375. package/dist/commands/connect-config.test.js +44 -0
  376. package/dist/commands/connect-config.test.js.map +1 -0
  377. package/dist/commands/connect-context.d.ts +45 -0
  378. package/dist/commands/connect-context.d.ts.map +1 -0
  379. package/dist/commands/connect-context.js +83 -0
  380. package/dist/commands/connect-context.js.map +1 -0
  381. package/dist/commands/connect-context.test.d.ts +2 -0
  382. package/dist/commands/connect-context.test.d.ts.map +1 -0
  383. package/dist/commands/connect-context.test.js +158 -0
  384. package/dist/commands/connect-context.test.js.map +1 -0
  385. package/dist/commands/connect-handoff.d.ts +51 -0
  386. package/dist/commands/connect-handoff.d.ts.map +1 -0
  387. package/dist/commands/connect-handoff.js +70 -0
  388. package/dist/commands/connect-handoff.js.map +1 -0
  389. package/dist/commands/connect-integration.test.d.ts +7 -0
  390. package/dist/commands/connect-integration.test.d.ts.map +1 -0
  391. package/dist/commands/connect-integration.test.js +219 -0
  392. package/dist/commands/connect-integration.test.js.map +1 -0
  393. package/dist/commands/connect-screens.d.ts +33 -0
  394. package/dist/commands/connect-screens.d.ts.map +1 -0
  395. package/dist/commands/connect-screens.js +124 -0
  396. package/dist/commands/connect-screens.js.map +1 -0
  397. package/dist/commands/connect.d.ts +42 -0
  398. package/dist/commands/connect.d.ts.map +1 -0
  399. package/dist/commands/connect.js +339 -0
  400. package/dist/commands/connect.js.map +1 -0
  401. package/dist/commands/connect.test.d.ts +6 -0
  402. package/dist/commands/connect.test.d.ts.map +1 -0
  403. package/dist/commands/connect.test.js +380 -0
  404. package/dist/commands/connect.test.js.map +1 -0
  405. package/dist/commands/constellation.d.ts.map +1 -1
  406. package/dist/commands/constellation.js +8 -3
  407. package/dist/commands/constellation.js.map +1 -1
  408. package/dist/commands/context.d.ts.map +1 -1
  409. package/dist/commands/context.js +8 -3
  410. package/dist/commands/context.js.map +1 -1
  411. package/dist/commands/cross-cut.d.ts.map +1 -1
  412. package/dist/commands/cross-cut.js +2 -2
  413. package/dist/commands/cross-cut.js.map +1 -1
  414. package/dist/commands/doctor.d.ts +18 -0
  415. package/dist/commands/doctor.d.ts.map +1 -0
  416. package/dist/commands/doctor.js +297 -0
  417. package/dist/commands/doctor.js.map +1 -0
  418. package/dist/commands/doctor.test.d.ts +8 -0
  419. package/dist/commands/doctor.test.d.ts.map +1 -0
  420. package/dist/commands/doctor.test.js +461 -0
  421. package/dist/commands/doctor.test.js.map +1 -0
  422. package/dist/commands/feedback.d.ts +20 -0
  423. package/dist/commands/feedback.d.ts.map +1 -0
  424. package/dist/commands/feedback.js +146 -0
  425. package/dist/commands/feedback.js.map +1 -0
  426. package/dist/commands/feedback.test.d.ts +2 -0
  427. package/dist/commands/feedback.test.d.ts.map +1 -0
  428. package/dist/commands/feedback.test.js +98 -0
  429. package/dist/commands/feedback.test.js.map +1 -0
  430. package/dist/commands/fields.d.ts.map +1 -1
  431. package/dist/commands/fields.js +8 -4
  432. package/dist/commands/fields.js.map +1 -1
  433. package/dist/commands/files.d.ts +26 -0
  434. package/dist/commands/files.d.ts.map +1 -0
  435. package/dist/commands/files.js +160 -0
  436. package/dist/commands/files.js.map +1 -0
  437. package/dist/commands/files.test.d.ts +2 -0
  438. package/dist/commands/files.test.d.ts.map +1 -0
  439. package/dist/commands/files.test.js +243 -0
  440. package/dist/commands/files.test.js.map +1 -0
  441. package/dist/commands/get.d.ts.map +1 -1
  442. package/dist/commands/get.js +14 -6
  443. package/dist/commands/get.js.map +1 -1
  444. package/dist/commands/handshake.d.ts +227 -2
  445. package/dist/commands/handshake.d.ts.map +1 -1
  446. package/dist/commands/handshake.js +2175 -80
  447. package/dist/commands/handshake.js.map +1 -1
  448. package/dist/commands/ingest.d.ts.map +1 -1
  449. package/dist/commands/ingest.js +26 -9
  450. package/dist/commands/ingest.js.map +1 -1
  451. package/dist/commands/init.d.ts +14 -0
  452. package/dist/commands/init.d.ts.map +1 -0
  453. package/dist/commands/init.js +109 -0
  454. package/dist/commands/init.js.map +1 -0
  455. package/dist/commands/login.d.ts +4 -0
  456. package/dist/commands/login.d.ts.map +1 -1
  457. package/dist/commands/login.js +101 -38
  458. package/dist/commands/login.js.map +1 -1
  459. package/dist/commands/method.d.ts +99 -0
  460. package/dist/commands/method.d.ts.map +1 -0
  461. package/dist/commands/method.js +804 -0
  462. package/dist/commands/method.js.map +1 -0
  463. package/dist/commands/migrate-setup.d.ts +18 -0
  464. package/dist/commands/migrate-setup.d.ts.map +1 -0
  465. package/dist/commands/migrate-setup.js +148 -0
  466. package/dist/commands/migrate-setup.js.map +1 -0
  467. package/dist/commands/organisation.d.ts +24 -0
  468. package/dist/commands/organisation.d.ts.map +1 -0
  469. package/dist/commands/organisation.js +223 -0
  470. package/dist/commands/organisation.js.map +1 -0
  471. package/dist/commands/organisation.test.d.ts +2 -0
  472. package/dist/commands/organisation.test.d.ts.map +1 -0
  473. package/dist/commands/organisation.test.js +66 -0
  474. package/dist/commands/organisation.test.js.map +1 -0
  475. package/dist/commands/orient.d.ts +121 -2
  476. package/dist/commands/orient.d.ts.map +1 -1
  477. package/dist/commands/orient.js +222 -7
  478. package/dist/commands/orient.js.map +1 -1
  479. package/dist/commands/profile.d.ts +34 -0
  480. package/dist/commands/profile.d.ts.map +1 -0
  481. package/dist/commands/profile.js +170 -0
  482. package/dist/commands/profile.js.map +1 -0
  483. package/dist/commands/promote.d.ts +12 -1
  484. package/dist/commands/promote.d.ts.map +1 -1
  485. package/dist/commands/promote.js +246 -55
  486. package/dist/commands/promote.js.map +1 -1
  487. package/dist/commands/proof-run.d.ts +51 -0
  488. package/dist/commands/proof-run.d.ts.map +1 -0
  489. package/dist/commands/proof-run.js +209 -0
  490. package/dist/commands/proof-run.js.map +1 -0
  491. package/dist/commands/proposals.d.ts.map +1 -1
  492. package/dist/commands/proposals.js +2 -2
  493. package/dist/commands/proposals.js.map +1 -1
  494. package/dist/commands/reject.d.ts.map +1 -1
  495. package/dist/commands/reject.js +14 -7
  496. package/dist/commands/reject.js.map +1 -1
  497. package/dist/commands/relate.d.ts.map +1 -1
  498. package/dist/commands/relate.js +55 -17
  499. package/dist/commands/relate.js.map +1 -1
  500. package/dist/commands/rework.d.ts +24 -0
  501. package/dist/commands/rework.d.ts.map +1 -0
  502. package/dist/commands/rework.js +97 -0
  503. package/dist/commands/rework.js.map +1 -0
  504. package/dist/commands/scoreboard.d.ts +28 -0
  505. package/dist/commands/scoreboard.d.ts.map +1 -0
  506. package/dist/commands/scoreboard.js +40 -0
  507. package/dist/commands/scoreboard.js.map +1 -0
  508. package/dist/commands/search.d.ts.map +1 -1
  509. package/dist/commands/search.js +2 -2
  510. package/dist/commands/search.js.map +1 -1
  511. package/dist/commands/session.d.ts +55 -2
  512. package/dist/commands/session.d.ts.map +1 -1
  513. package/dist/commands/session.js +485 -45
  514. package/dist/commands/session.js.map +1 -1
  515. package/dist/commands/setup-audit.d.ts +59 -0
  516. package/dist/commands/setup-audit.d.ts.map +1 -0
  517. package/dist/commands/setup-audit.js +250 -0
  518. package/dist/commands/setup-audit.js.map +1 -0
  519. package/dist/commands/setup-detect-surfaces.d.ts +38 -0
  520. package/dist/commands/setup-detect-surfaces.d.ts.map +1 -0
  521. package/dist/commands/setup-detect-surfaces.js +76 -0
  522. package/dist/commands/setup-detect-surfaces.js.map +1 -0
  523. package/dist/commands/setup-ingest.d.ts +17 -0
  524. package/dist/commands/setup-ingest.d.ts.map +1 -0
  525. package/dist/commands/setup-ingest.js +174 -0
  526. package/dist/commands/setup-ingest.js.map +1 -0
  527. package/dist/commands/setup-resolver.d.ts +58 -0
  528. package/dist/commands/setup-resolver.d.ts.map +1 -0
  529. package/dist/commands/setup-resolver.js +150 -0
  530. package/dist/commands/setup-resolver.js.map +1 -0
  531. package/dist/commands/setup-state.d.ts +42 -0
  532. package/dist/commands/setup-state.d.ts.map +1 -0
  533. package/dist/commands/setup-state.js +93 -0
  534. package/dist/commands/setup-state.js.map +1 -0
  535. package/dist/commands/setup.d.ts +23 -0
  536. package/dist/commands/setup.d.ts.map +1 -0
  537. package/dist/commands/setup.js +69 -0
  538. package/dist/commands/setup.js.map +1 -0
  539. package/dist/commands/update.d.ts +8 -0
  540. package/dist/commands/update.d.ts.map +1 -1
  541. package/dist/commands/update.js +76 -49
  542. package/dist/commands/update.js.map +1 -1
  543. package/dist/commands/upgrade.d.ts +5 -0
  544. package/dist/commands/upgrade.d.ts.map +1 -0
  545. package/dist/commands/upgrade.js +110 -0
  546. package/dist/commands/upgrade.js.map +1 -0
  547. package/dist/commands/usage.d.ts +40 -0
  548. package/dist/commands/usage.d.ts.map +1 -0
  549. package/dist/commands/usage.js +214 -0
  550. package/dist/commands/usage.js.map +1 -0
  551. package/dist/commands/verify.d.ts.map +1 -1
  552. package/dist/commands/verify.js +19 -7
  553. package/dist/commands/verify.js.map +1 -1
  554. package/dist/commands/welcome.d.ts +21 -0
  555. package/dist/commands/welcome.d.ts.map +1 -0
  556. package/dist/commands/welcome.js +50 -0
  557. package/dist/commands/welcome.js.map +1 -0
  558. package/dist/commands/whoami.d.ts +12 -0
  559. package/dist/commands/whoami.d.ts.map +1 -0
  560. package/dist/commands/whoami.js +70 -0
  561. package/dist/commands/whoami.js.map +1 -0
  562. package/dist/commands/whoami.test.d.ts +2 -0
  563. package/dist/commands/whoami.test.d.ts.map +1 -0
  564. package/dist/commands/whoami.test.js +50 -0
  565. package/dist/commands/whoami.test.js.map +1 -0
  566. package/dist/commands/workspace.d.ts +115 -0
  567. package/dist/commands/workspace.d.ts.map +1 -0
  568. package/dist/commands/workspace.js +263 -0
  569. package/dist/commands/workspace.js.map +1 -0
  570. package/dist/formatters/__tests__/orient-possibleConflict.test.d.ts +2 -0
  571. package/dist/formatters/__tests__/orient-possibleConflict.test.d.ts.map +1 -0
  572. package/dist/formatters/__tests__/orient-possibleConflict.test.js +68 -0
  573. package/dist/formatters/__tests__/orient-possibleConflict.test.js.map +1 -0
  574. package/dist/formatters/__tests__/orient-provenance.test.d.ts +7 -0
  575. package/dist/formatters/__tests__/orient-provenance.test.d.ts.map +1 -0
  576. package/dist/formatters/__tests__/orient-provenance.test.js +548 -0
  577. package/dist/formatters/__tests__/orient-provenance.test.js.map +1 -0
  578. package/dist/formatters/__tests__/session-list-show.test.d.ts +2 -0
  579. package/dist/formatters/__tests__/session-list-show.test.d.ts.map +1 -0
  580. package/dist/formatters/__tests__/session-list-show.test.js +159 -0
  581. package/dist/formatters/__tests__/session-list-show.test.js.map +1 -0
  582. package/dist/formatters/__tests__/session.test.d.ts +2 -0
  583. package/dist/formatters/__tests__/session.test.d.ts.map +1 -0
  584. package/dist/formatters/__tests__/session.test.js +113 -0
  585. package/dist/formatters/__tests__/session.test.js.map +1 -0
  586. package/dist/formatters/audit.d.ts +6 -0
  587. package/dist/formatters/audit.d.ts.map +1 -1
  588. package/dist/formatters/audit.js.map +1 -1
  589. package/dist/formatters/capture.d.ts +8 -0
  590. package/dist/formatters/capture.d.ts.map +1 -1
  591. package/dist/formatters/capture.js +9 -0
  592. package/dist/formatters/capture.js.map +1 -1
  593. package/dist/formatters/coaching.d.ts +51 -0
  594. package/dist/formatters/coaching.d.ts.map +1 -0
  595. package/dist/formatters/coaching.js +46 -0
  596. package/dist/formatters/coaching.js.map +1 -0
  597. package/dist/formatters/collections.d.ts +40 -0
  598. package/dist/formatters/collections.d.ts.map +1 -0
  599. package/dist/formatters/collections.js +93 -0
  600. package/dist/formatters/collections.js.map +1 -0
  601. package/dist/formatters/conflicts.d.ts +44 -0
  602. package/dist/formatters/conflicts.d.ts.map +1 -0
  603. package/dist/formatters/conflicts.js +44 -0
  604. package/dist/formatters/conflicts.js.map +1 -0
  605. package/dist/formatters/conflicts.test.d.ts +2 -0
  606. package/dist/formatters/conflicts.test.d.ts.map +1 -0
  607. package/dist/formatters/conflicts.test.js +83 -0
  608. package/dist/formatters/conflicts.test.js.map +1 -0
  609. package/dist/formatters/context.d.ts +1 -1
  610. package/dist/formatters/context.d.ts.map +1 -1
  611. package/dist/formatters/context.js.map +1 -1
  612. package/dist/formatters/entry.d.ts +44 -0
  613. package/dist/formatters/entry.d.ts.map +1 -1
  614. package/dist/formatters/entry.js +70 -7
  615. package/dist/formatters/entry.js.map +1 -1
  616. package/dist/formatters/feedback.d.ts +35 -0
  617. package/dist/formatters/feedback.d.ts.map +1 -0
  618. package/dist/formatters/feedback.js +53 -0
  619. package/dist/formatters/feedback.js.map +1 -0
  620. package/dist/formatters/feedback.test.d.ts +2 -0
  621. package/dist/formatters/feedback.test.d.ts.map +1 -0
  622. package/dist/formatters/feedback.test.js +52 -0
  623. package/dist/formatters/feedback.test.js.map +1 -0
  624. package/dist/formatters/handshake.d.ts +44 -0
  625. package/dist/formatters/handshake.d.ts.map +1 -1
  626. package/dist/formatters/handshake.js +142 -3
  627. package/dist/formatters/handshake.js.map +1 -1
  628. package/dist/formatters/orient.coherencyCheckTag.test.d.ts +2 -0
  629. package/dist/formatters/orient.coherencyCheckTag.test.d.ts.map +1 -0
  630. package/dist/formatters/orient.coherencyCheckTag.test.js +22 -0
  631. package/dist/formatters/orient.coherencyCheckTag.test.js.map +1 -0
  632. package/dist/formatters/orient.d.ts +245 -4
  633. package/dist/formatters/orient.d.ts.map +1 -1
  634. package/dist/formatters/orient.js +302 -25
  635. package/dist/formatters/orient.js.map +1 -1
  636. package/dist/formatters/orient.rcrtMiss.test.d.ts +2 -0
  637. package/dist/formatters/orient.rcrtMiss.test.d.ts.map +1 -0
  638. package/dist/formatters/orient.rcrtMiss.test.js +146 -0
  639. package/dist/formatters/orient.rcrtMiss.test.js.map +1 -0
  640. package/dist/formatters/promote.d.ts +43 -0
  641. package/dist/formatters/promote.d.ts.map +1 -1
  642. package/dist/formatters/promote.js +32 -0
  643. package/dist/formatters/promote.js.map +1 -1
  644. package/dist/formatters/relate.d.ts +2 -0
  645. package/dist/formatters/relate.d.ts.map +1 -1
  646. package/dist/formatters/relate.js +3 -0
  647. package/dist/formatters/relate.js.map +1 -1
  648. package/dist/formatters/scoreboard.d.ts +11 -0
  649. package/dist/formatters/scoreboard.d.ts.map +1 -0
  650. package/dist/formatters/scoreboard.js +107 -0
  651. package/dist/formatters/scoreboard.js.map +1 -0
  652. package/dist/formatters/scoreboard.test.d.ts +2 -0
  653. package/dist/formatters/scoreboard.test.d.ts.map +1 -0
  654. package/dist/formatters/scoreboard.test.js +144 -0
  655. package/dist/formatters/scoreboard.test.js.map +1 -0
  656. package/dist/formatters/session-feedback.test.d.ts +2 -0
  657. package/dist/formatters/session-feedback.test.d.ts.map +1 -0
  658. package/dist/formatters/session-feedback.test.js +49 -0
  659. package/dist/formatters/session-feedback.test.js.map +1 -0
  660. package/dist/formatters/session.d.ts +101 -1
  661. package/dist/formatters/session.d.ts.map +1 -1
  662. package/dist/formatters/session.js +272 -9
  663. package/dist/formatters/session.js.map +1 -1
  664. package/dist/formatters/update.d.ts +3 -0
  665. package/dist/formatters/update.d.ts.map +1 -1
  666. package/dist/formatters/update.js +4 -0
  667. package/dist/formatters/update.js.map +1 -1
  668. package/dist/formatters/verify.d.ts +12 -4
  669. package/dist/formatters/verify.d.ts.map +1 -1
  670. package/dist/formatters/verify.js +20 -2
  671. package/dist/formatters/verify.js.map +1 -1
  672. package/dist/generated/healthGapKinds.generated.d.ts +12 -0
  673. package/dist/generated/healthGapKinds.generated.d.ts.map +1 -0
  674. package/dist/generated/healthGapKinds.generated.js +24 -0
  675. package/dist/generated/healthGapKinds.generated.js.map +1 -0
  676. package/dist/generators/adapters.d.ts +33 -0
  677. package/dist/generators/adapters.d.ts.map +1 -1
  678. package/dist/generators/adapters.js +64 -4
  679. package/dist/generators/adapters.js.map +1 -1
  680. package/dist/generators/archetypes.d.ts +52 -0
  681. package/dist/generators/archetypes.d.ts.map +1 -0
  682. package/dist/generators/archetypes.js +190 -0
  683. package/dist/generators/archetypes.js.map +1 -0
  684. package/dist/generators/archetypes.test.d.ts +2 -0
  685. package/dist/generators/archetypes.test.d.ts.map +1 -0
  686. package/dist/generators/archetypes.test.js +272 -0
  687. package/dist/generators/archetypes.test.js.map +1 -0
  688. package/dist/generators/boundary-manifest.d.ts +29 -0
  689. package/dist/generators/boundary-manifest.d.ts.map +1 -0
  690. package/dist/generators/boundary-manifest.js +183 -0
  691. package/dist/generators/boundary-manifest.js.map +1 -0
  692. package/dist/generators/boundary-manifest.real-file.test.d.ts +2 -0
  693. package/dist/generators/boundary-manifest.real-file.test.d.ts.map +1 -0
  694. package/dist/generators/boundary-manifest.real-file.test.js +70 -0
  695. package/dist/generators/boundary-manifest.real-file.test.js.map +1 -0
  696. package/dist/generators/boundary-manifest.test.d.ts +2 -0
  697. package/dist/generators/boundary-manifest.test.d.ts.map +1 -0
  698. package/dist/generators/boundary-manifest.test.js +91 -0
  699. package/dist/generators/boundary-manifest.test.js.map +1 -0
  700. package/dist/generators/chain-classifier-kernel-client-drift.test.d.ts +2 -0
  701. package/dist/generators/chain-classifier-kernel-client-drift.test.d.ts.map +1 -0
  702. package/dist/generators/chain-classifier-kernel-client-drift.test.js +41 -0
  703. package/dist/generators/chain-classifier-kernel-client-drift.test.js.map +1 -0
  704. package/dist/generators/chain-classifier.d.ts +102 -0
  705. package/dist/generators/chain-classifier.d.ts.map +1 -0
  706. package/dist/generators/chain-classifier.js +52 -0
  707. package/dist/generators/chain-classifier.js.map +1 -0
  708. package/dist/generators/chain-rules.d.ts +42 -0
  709. package/dist/generators/chain-rules.d.ts.map +1 -0
  710. package/dist/generators/chain-rules.js +256 -0
  711. package/dist/generators/chain-rules.js.map +1 -0
  712. package/dist/generators/chain-rules.test.d.ts +2 -0
  713. package/dist/generators/chain-rules.test.d.ts.map +1 -0
  714. package/dist/generators/chain-rules.test.js +448 -0
  715. package/dist/generators/chain-rules.test.js.map +1 -0
  716. package/dist/generators/context-md.d.ts +1 -1
  717. package/dist/generators/context-md.d.ts.map +1 -1
  718. package/dist/generators/context-md.js +18 -7
  719. package/dist/generators/context-md.js.map +1 -1
  720. package/dist/generators/handshake-diff.d.ts +67 -0
  721. package/dist/generators/handshake-diff.d.ts.map +1 -0
  722. package/dist/generators/handshake-diff.js +183 -0
  723. package/dist/generators/handshake-diff.js.map +1 -0
  724. package/dist/generators/handshake-diff.test.d.ts +2 -0
  725. package/dist/generators/handshake-diff.test.d.ts.map +1 -0
  726. package/dist/generators/handshake-diff.test.js +264 -0
  727. package/dist/generators/handshake-diff.test.js.map +1 -0
  728. package/dist/generators/manifest.d.ts +115 -0
  729. package/dist/generators/manifest.d.ts.map +1 -0
  730. package/dist/generators/manifest.js +277 -0
  731. package/dist/generators/manifest.js.map +1 -0
  732. package/dist/generators/portable-knowledge.d.ts +24 -2
  733. package/dist/generators/portable-knowledge.d.ts.map +1 -1
  734. package/dist/generators/portable-knowledge.js +97 -2
  735. package/dist/generators/portable-knowledge.js.map +1 -1
  736. package/dist/generators/portable-knowledge.test.js +43 -0
  737. package/dist/generators/portable-knowledge.test.js.map +1 -1
  738. package/dist/generators/region-projections.d.ts +18 -0
  739. package/dist/generators/region-projections.d.ts.map +1 -0
  740. package/dist/generators/region-projections.js +49 -0
  741. package/dist/generators/region-projections.js.map +1 -0
  742. package/dist/generators/region-projections.test.d.ts +2 -0
  743. package/dist/generators/region-projections.test.d.ts.map +1 -0
  744. package/dist/generators/region-projections.test.js +63 -0
  745. package/dist/generators/region-projections.test.js.map +1 -0
  746. package/dist/generators/region.d.ts +24 -0
  747. package/dist/generators/region.d.ts.map +1 -0
  748. package/dist/generators/region.js +87 -0
  749. package/dist/generators/region.js.map +1 -0
  750. package/dist/generators/region.test.d.ts +2 -0
  751. package/dist/generators/region.test.d.ts.map +1 -0
  752. package/dist/generators/region.test.js +126 -0
  753. package/dist/generators/region.test.js.map +1 -0
  754. package/dist/generators/surface-profiles.d.ts +1 -2
  755. package/dist/generators/surface-profiles.d.ts.map +1 -1
  756. package/dist/generators/surface-profiles.js.map +1 -1
  757. package/dist/index.js +795 -261
  758. package/dist/index.js.map +1 -1
  759. package/dist/lib/__tests__/parseFields.test.d.ts +2 -0
  760. package/dist/lib/__tests__/parseFields.test.d.ts.map +1 -0
  761. package/dist/lib/__tests__/parseFields.test.js +19 -0
  762. package/dist/lib/__tests__/parseFields.test.js.map +1 -0
  763. package/dist/lib/activation.d.ts +28 -0
  764. package/dist/lib/activation.d.ts.map +1 -0
  765. package/dist/lib/activation.js +61 -0
  766. package/dist/lib/activation.js.map +1 -0
  767. package/dist/lib/activation.test.d.ts +6 -0
  768. package/dist/lib/activation.test.d.ts.map +1 -0
  769. package/dist/lib/activation.test.js +121 -0
  770. package/dist/lib/activation.test.js.map +1 -0
  771. package/dist/lib/canonicalRefs.d.ts +141 -0
  772. package/dist/lib/canonicalRefs.d.ts.map +1 -0
  773. package/dist/lib/canonicalRefs.js +150 -0
  774. package/dist/lib/canonicalRefs.js.map +1 -0
  775. package/dist/lib/client.d.ts +36 -6
  776. package/dist/lib/client.d.ts.map +1 -1
  777. package/dist/lib/client.js +234 -45
  778. package/dist/lib/client.js.map +1 -1
  779. package/dist/lib/collectionRegistry.d.ts +52 -0
  780. package/dist/lib/collectionRegistry.d.ts.map +1 -0
  781. package/dist/lib/collectionRegistry.js +118 -0
  782. package/dist/lib/collectionRegistry.js.map +1 -0
  783. package/dist/lib/compose-wrapup-view.d.ts +48 -0
  784. package/dist/lib/compose-wrapup-view.d.ts.map +1 -0
  785. package/dist/lib/compose-wrapup-view.js +37 -0
  786. package/dist/lib/compose-wrapup-view.js.map +1 -0
  787. package/dist/lib/config.d.ts +204 -4
  788. package/dist/lib/config.d.ts.map +1 -1
  789. package/dist/lib/config.js +594 -42
  790. package/dist/lib/config.js.map +1 -1
  791. package/dist/lib/connectKeyLabel.d.ts +9 -0
  792. package/dist/lib/connectKeyLabel.d.ts.map +1 -0
  793. package/dist/lib/connectKeyLabel.js +12 -0
  794. package/dist/lib/connectKeyLabel.js.map +1 -0
  795. package/dist/lib/constants.d.ts +46 -0
  796. package/dist/lib/constants.d.ts.map +1 -0
  797. package/dist/lib/constants.js +83 -0
  798. package/dist/lib/constants.js.map +1 -0
  799. package/dist/lib/conversation-engine.d.ts +45 -0
  800. package/dist/lib/conversation-engine.d.ts.map +1 -0
  801. package/dist/lib/conversation-engine.js +112 -0
  802. package/dist/lib/conversation-engine.js.map +1 -0
  803. package/dist/lib/conversation-phases.d.ts +59 -0
  804. package/dist/lib/conversation-phases.d.ts.map +1 -0
  805. package/dist/lib/conversation-phases.js +11 -0
  806. package/dist/lib/conversation-phases.js.map +1 -0
  807. package/dist/lib/conversation-signals.d.ts +30 -0
  808. package/dist/lib/conversation-signals.d.ts.map +1 -0
  809. package/dist/lib/conversation-signals.js +64 -0
  810. package/dist/lib/conversation-signals.js.map +1 -0
  811. package/dist/lib/conversation.d.ts +36 -0
  812. package/dist/lib/conversation.d.ts.map +1 -0
  813. package/dist/lib/conversation.js +66 -0
  814. package/dist/lib/conversation.js.map +1 -0
  815. package/dist/lib/deployment.d.ts +23 -0
  816. package/dist/lib/deployment.d.ts.map +1 -0
  817. package/dist/lib/deployment.js +78 -0
  818. package/dist/lib/deployment.js.map +1 -0
  819. package/dist/lib/deployment.test.d.ts +5 -0
  820. package/dist/lib/deployment.test.d.ts.map +1 -0
  821. package/dist/lib/deployment.test.js +54 -0
  822. package/dist/lib/deployment.test.js.map +1 -0
  823. package/dist/lib/errors.d.ts +104 -0
  824. package/dist/lib/errors.d.ts.map +1 -0
  825. package/dist/lib/errors.js +113 -0
  826. package/dist/lib/errors.js.map +1 -0
  827. package/dist/lib/experiment.d.ts +18 -0
  828. package/dist/lib/experiment.d.ts.map +1 -0
  829. package/dist/lib/experiment.js +28 -0
  830. package/dist/lib/experiment.js.map +1 -0
  831. package/dist/lib/format.d.ts +10 -0
  832. package/dist/lib/format.d.ts.map +1 -0
  833. package/dist/lib/format.js +27 -0
  834. package/dist/lib/format.js.map +1 -0
  835. package/dist/lib/frontmatter.d.ts +55 -0
  836. package/dist/lib/frontmatter.d.ts.map +1 -0
  837. package/dist/lib/frontmatter.js +92 -0
  838. package/dist/lib/frontmatter.js.map +1 -0
  839. package/dist/lib/frontmatter.test.d.ts +15 -0
  840. package/dist/lib/frontmatter.test.d.ts.map +1 -0
  841. package/dist/lib/frontmatter.test.js +98 -0
  842. package/dist/lib/frontmatter.test.js.map +1 -0
  843. package/dist/lib/glossary.d.ts +19 -0
  844. package/dist/lib/glossary.d.ts.map +1 -0
  845. package/dist/lib/glossary.js +53 -0
  846. package/dist/lib/glossary.js.map +1 -0
  847. package/dist/lib/hook-intents.d.ts +51 -0
  848. package/dist/lib/hook-intents.d.ts.map +1 -0
  849. package/dist/lib/hook-intents.js +85 -0
  850. package/dist/lib/hook-intents.js.map +1 -0
  851. package/dist/lib/inferSourceDate.d.ts +12 -0
  852. package/dist/lib/inferSourceDate.d.ts.map +1 -0
  853. package/dist/lib/inferSourceDate.js +44 -0
  854. package/dist/lib/inferSourceDate.js.map +1 -0
  855. package/dist/lib/method-registry.d.ts +37 -0
  856. package/dist/lib/method-registry.d.ts.map +1 -0
  857. package/dist/lib/method-registry.js +41 -0
  858. package/dist/lib/method-registry.js.map +1 -0
  859. package/dist/lib/normalizeMaterializedFilename.d.ts +28 -0
  860. package/dist/lib/normalizeMaterializedFilename.d.ts.map +1 -0
  861. package/dist/lib/normalizeMaterializedFilename.js +56 -0
  862. package/dist/lib/normalizeMaterializedFilename.js.map +1 -0
  863. package/dist/lib/normalizeMaterializedFilename.test.d.ts +16 -0
  864. package/dist/lib/normalizeMaterializedFilename.test.d.ts.map +1 -0
  865. package/dist/lib/normalizeMaterializedFilename.test.js +90 -0
  866. package/dist/lib/normalizeMaterializedFilename.test.js.map +1 -0
  867. package/dist/lib/notice-marker.d.ts +3 -0
  868. package/dist/lib/notice-marker.d.ts.map +1 -0
  869. package/dist/lib/notice-marker.js +53 -0
  870. package/dist/lib/notice-marker.js.map +1 -0
  871. package/dist/lib/onboarding-path-b.d.ts +10 -0
  872. package/dist/lib/onboarding-path-b.d.ts.map +1 -0
  873. package/dist/lib/onboarding-path-b.js +243 -0
  874. package/dist/lib/onboarding-path-b.js.map +1 -0
  875. package/dist/lib/onboarding-shared.d.ts +81 -0
  876. package/dist/lib/onboarding-shared.d.ts.map +1 -0
  877. package/dist/lib/onboarding-shared.js +175 -0
  878. package/dist/lib/onboarding-shared.js.map +1 -0
  879. package/dist/lib/onboarding-topics.d.ts +27 -0
  880. package/dist/lib/onboarding-topics.d.ts.map +1 -0
  881. package/dist/lib/onboarding-topics.js +57 -0
  882. package/dist/lib/onboarding-topics.js.map +1 -0
  883. package/dist/lib/onboarding.d.ts +17 -0
  884. package/dist/lib/onboarding.d.ts.map +1 -0
  885. package/dist/lib/onboarding.js +350 -0
  886. package/dist/lib/onboarding.js.map +1 -0
  887. package/dist/lib/parseFields.d.ts +6 -0
  888. package/dist/lib/parseFields.d.ts.map +1 -0
  889. package/dist/lib/parseFields.js +30 -0
  890. package/dist/lib/parseFields.js.map +1 -0
  891. package/dist/lib/previewBanner.d.ts +9 -0
  892. package/dist/lib/previewBanner.d.ts.map +1 -0
  893. package/dist/lib/previewBanner.js +37 -0
  894. package/dist/lib/previewBanner.js.map +1 -0
  895. package/dist/lib/productbrain-files.d.ts +94 -0
  896. package/dist/lib/productbrain-files.d.ts.map +1 -0
  897. package/dist/lib/productbrain-files.js +214 -0
  898. package/dist/lib/productbrain-files.js.map +1 -0
  899. package/dist/lib/productbrain-files.test.d.ts +2 -0
  900. package/dist/lib/productbrain-files.test.d.ts.map +1 -0
  901. package/dist/lib/productbrain-files.test.js +258 -0
  902. package/dist/lib/productbrain-files.test.js.map +1 -0
  903. package/dist/lib/profiles.d.ts +41 -0
  904. package/dist/lib/profiles.d.ts.map +1 -0
  905. package/dist/lib/profiles.js +188 -0
  906. package/dist/lib/profiles.js.map +1 -0
  907. package/dist/lib/prompts.d.ts +65 -0
  908. package/dist/lib/prompts.d.ts.map +1 -0
  909. package/dist/lib/prompts.js +132 -0
  910. package/dist/lib/prompts.js.map +1 -0
  911. package/dist/lib/runner.d.ts +10 -0
  912. package/dist/lib/runner.d.ts.map +1 -1
  913. package/dist/lib/runner.js +44 -7
  914. package/dist/lib/runner.js.map +1 -1
  915. package/dist/lib/session.d.ts +85 -4
  916. package/dist/lib/session.d.ts.map +1 -1
  917. package/dist/lib/session.js +276 -13
  918. package/dist/lib/session.js.map +1 -1
  919. package/dist/lib/spinner.d.ts +27 -0
  920. package/dist/lib/spinner.d.ts.map +1 -0
  921. package/dist/lib/spinner.js +76 -0
  922. package/dist/lib/spinner.js.map +1 -0
  923. package/dist/lib/spinner.test.d.ts +2 -0
  924. package/dist/lib/spinner.test.d.ts.map +1 -0
  925. package/dist/lib/spinner.test.js +39 -0
  926. package/dist/lib/spinner.test.js.map +1 -0
  927. package/dist/lib/startup-resolution-signals.d.ts +34 -0
  928. package/dist/lib/startup-resolution-signals.d.ts.map +1 -0
  929. package/dist/lib/startup-resolution-signals.js +118 -0
  930. package/dist/lib/startup-resolution-signals.js.map +1 -0
  931. package/dist/lib/startup-resolution-signals.test.d.ts +2 -0
  932. package/dist/lib/startup-resolution-signals.test.d.ts.map +1 -0
  933. package/dist/lib/startup-resolution-signals.test.js +113 -0
  934. package/dist/lib/startup-resolution-signals.test.js.map +1 -0
  935. package/dist/lib/startup-signals.d.ts +12 -0
  936. package/dist/lib/startup-signals.d.ts.map +1 -0
  937. package/dist/lib/startup-signals.js +172 -0
  938. package/dist/lib/startup-signals.js.map +1 -0
  939. package/dist/lib/startup-signals.test.d.ts +2 -0
  940. package/dist/lib/startup-signals.test.d.ts.map +1 -0
  941. package/dist/lib/startup-signals.test.js +165 -0
  942. package/dist/lib/startup-signals.test.js.map +1 -0
  943. package/dist/lib/state.d.ts +51 -0
  944. package/dist/lib/state.d.ts.map +1 -0
  945. package/dist/lib/state.js +90 -0
  946. package/dist/lib/state.js.map +1 -0
  947. package/dist/lib/strip.d.ts.map +1 -1
  948. package/dist/lib/strip.js +7 -1
  949. package/dist/lib/strip.js.map +1 -1
  950. package/dist/lib/style.d.ts +96 -0
  951. package/dist/lib/style.d.ts.map +1 -0
  952. package/dist/lib/style.js +169 -0
  953. package/dist/lib/style.js.map +1 -0
  954. package/dist/lib/style.test.d.ts +7 -0
  955. package/dist/lib/style.test.d.ts.map +1 -0
  956. package/dist/lib/style.test.js +263 -0
  957. package/dist/lib/style.test.js.map +1 -0
  958. package/dist/lib/telemetry.d.ts +15 -0
  959. package/dist/lib/telemetry.d.ts.map +1 -0
  960. package/dist/lib/telemetry.js +47 -0
  961. package/dist/lib/telemetry.js.map +1 -0
  962. package/dist/lib/tokenConstants.d.ts +19 -0
  963. package/dist/lib/tokenConstants.d.ts.map +1 -0
  964. package/dist/lib/tokenConstants.js +19 -0
  965. package/dist/lib/tokenConstants.js.map +1 -0
  966. package/dist/lib/update-check.d.ts +56 -0
  967. package/dist/lib/update-check.d.ts.map +1 -0
  968. package/dist/lib/update-check.js +296 -0
  969. package/dist/lib/update-check.js.map +1 -0
  970. package/dist/lib/upgrade-runner.d.ts +22 -0
  971. package/dist/lib/upgrade-runner.d.ts.map +1 -0
  972. package/dist/lib/upgrade-runner.js +110 -0
  973. package/dist/lib/upgrade-runner.js.map +1 -0
  974. package/dist/lib/wizard-surfaces.d.ts +47 -0
  975. package/dist/lib/wizard-surfaces.d.ts.map +1 -0
  976. package/dist/lib/wizard-surfaces.js +176 -0
  977. package/dist/lib/wizard-surfaces.js.map +1 -0
  978. package/dist/lib/wizard-surfaces.test.d.ts +2 -0
  979. package/dist/lib/wizard-surfaces.test.d.ts.map +1 -0
  980. package/dist/lib/wizard-surfaces.test.js +127 -0
  981. package/dist/lib/wizard-surfaces.test.js.map +1 -0
  982. package/dist/lib/wizard-trust.d.ts +31 -0
  983. package/dist/lib/wizard-trust.d.ts.map +1 -0
  984. package/dist/lib/wizard-trust.js +66 -0
  985. package/dist/lib/wizard-trust.js.map +1 -0
  986. package/dist/lib/wizard-trust.test.d.ts +2 -0
  987. package/dist/lib/wizard-trust.test.d.ts.map +1 -0
  988. package/dist/lib/wizard-trust.test.js +32 -0
  989. package/dist/lib/wizard-trust.test.js.map +1 -0
  990. package/dist/lib/workspace-probe.d.ts +19 -0
  991. package/dist/lib/workspace-probe.d.ts.map +1 -0
  992. package/dist/lib/workspace-probe.js +27 -0
  993. package/dist/lib/workspace-probe.js.map +1 -0
  994. package/dist/lib/workspaceNotice.d.ts +59 -0
  995. package/dist/lib/workspaceNotice.d.ts.map +1 -0
  996. package/dist/lib/workspaceNotice.js +77 -0
  997. package/dist/lib/workspaceNotice.js.map +1 -0
  998. package/dist/lib/workspaceVocabCache.d.ts +60 -0
  999. package/dist/lib/workspaceVocabCache.d.ts.map +1 -0
  1000. package/dist/lib/workspaceVocabCache.js +98 -0
  1001. package/dist/lib/workspaceVocabCache.js.map +1 -0
  1002. package/dist/scoreboard/diagnose.d.ts +266 -0
  1003. package/dist/scoreboard/diagnose.d.ts.map +1 -0
  1004. package/dist/scoreboard/diagnose.js +274 -0
  1005. package/dist/scoreboard/diagnose.js.map +1 -0
  1006. package/dist/scoreboard/diagnose.test.d.ts +14 -0
  1007. package/dist/scoreboard/diagnose.test.d.ts.map +1 -0
  1008. package/dist/scoreboard/diagnose.test.js +266 -0
  1009. package/dist/scoreboard/diagnose.test.js.map +1 -0
  1010. package/dist/scoreboard/localDrift.d.ts +23 -0
  1011. package/dist/scoreboard/localDrift.d.ts.map +1 -0
  1012. package/dist/scoreboard/localDrift.js +111 -0
  1013. package/dist/scoreboard/localDrift.js.map +1 -0
  1014. package/dist/scoreboard/localDrift.test.d.ts +9 -0
  1015. package/dist/scoreboard/localDrift.test.d.ts.map +1 -0
  1016. package/dist/scoreboard/localDrift.test.js +82 -0
  1017. package/dist/scoreboard/localDrift.test.js.map +1 -0
  1018. package/dist/setup/__tests__/coach-traces.test.d.ts +2 -0
  1019. package/dist/setup/__tests__/coach-traces.test.d.ts.map +1 -0
  1020. package/dist/setup/__tests__/coach-traces.test.js +189 -0
  1021. package/dist/setup/__tests__/coach-traces.test.js.map +1 -0
  1022. package/dist/setup/__tests__/setup-commands.test.d.ts +2 -0
  1023. package/dist/setup/__tests__/setup-commands.test.d.ts.map +1 -0
  1024. package/dist/setup/__tests__/setup-commands.test.js +177 -0
  1025. package/dist/setup/__tests__/setup-commands.test.js.map +1 -0
  1026. package/dist/setup/__tests__/state-machine.test.d.ts +2 -0
  1027. package/dist/setup/__tests__/state-machine.test.d.ts.map +1 -0
  1028. package/dist/setup/__tests__/state-machine.test.js +341 -0
  1029. package/dist/setup/__tests__/state-machine.test.js.map +1 -0
  1030. package/dist/setup/detect-surfaces.d.ts +21 -0
  1031. package/dist/setup/detect-surfaces.d.ts.map +1 -0
  1032. package/dist/setup/detect-surfaces.js +39 -0
  1033. package/dist/setup/detect-surfaces.js.map +1 -0
  1034. package/dist/setup/manifest-writer.d.ts +17 -0
  1035. package/dist/setup/manifest-writer.d.ts.map +1 -0
  1036. package/dist/setup/manifest-writer.js +153 -0
  1037. package/dist/setup/manifest-writer.js.map +1 -0
  1038. package/dist/setup/perimeter.d.ts +72 -0
  1039. package/dist/setup/perimeter.d.ts.map +1 -0
  1040. package/dist/setup/perimeter.js +128 -0
  1041. package/dist/setup/perimeter.js.map +1 -0
  1042. package/dist/setup/state-machine.d.ts +67 -0
  1043. package/dist/setup/state-machine.d.ts.map +1 -0
  1044. package/dist/setup/state-machine.js +124 -0
  1045. package/dist/setup/state-machine.js.map +1 -0
  1046. package/dist/surfaces/__tests__/adapter.test.d.ts +2 -0
  1047. package/dist/surfaces/__tests__/adapter.test.d.ts.map +1 -0
  1048. package/dist/surfaces/__tests__/adapter.test.js +90 -0
  1049. package/dist/surfaces/__tests__/adapter.test.js.map +1 -0
  1050. package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts +2 -0
  1051. package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts.map +1 -0
  1052. package/dist/surfaces/__tests__/pb-setup-passthrough.test.js +132 -0
  1053. package/dist/surfaces/__tests__/pb-setup-passthrough.test.js.map +1 -0
  1054. package/dist/surfaces/__tests__/telemetry.test.d.ts +2 -0
  1055. package/dist/surfaces/__tests__/telemetry.test.d.ts.map +1 -0
  1056. package/dist/surfaces/__tests__/telemetry.test.js +55 -0
  1057. package/dist/surfaces/__tests__/telemetry.test.js.map +1 -0
  1058. package/dist/surfaces/adapter.d.ts +70 -0
  1059. package/dist/surfaces/adapter.d.ts.map +1 -0
  1060. package/dist/surfaces/adapter.js +2 -0
  1061. package/dist/surfaces/adapter.js.map +1 -0
  1062. package/dist/surfaces/adapters/claude.d.ts +3 -0
  1063. package/dist/surfaces/adapters/claude.d.ts.map +1 -0
  1064. package/dist/surfaces/adapters/claude.js +67 -0
  1065. package/dist/surfaces/adapters/claude.js.map +1 -0
  1066. package/dist/surfaces/adapters/codex.d.ts +3 -0
  1067. package/dist/surfaces/adapters/codex.d.ts.map +1 -0
  1068. package/dist/surfaces/adapters/codex.js +61 -0
  1069. package/dist/surfaces/adapters/codex.js.map +1 -0
  1070. package/dist/surfaces/adapters/copilot.d.ts +3 -0
  1071. package/dist/surfaces/adapters/copilot.d.ts.map +1 -0
  1072. package/dist/surfaces/adapters/copilot.js +59 -0
  1073. package/dist/surfaces/adapters/copilot.js.map +1 -0
  1074. package/dist/surfaces/adapters/cursor.d.ts +3 -0
  1075. package/dist/surfaces/adapters/cursor.d.ts.map +1 -0
  1076. package/dist/surfaces/adapters/cursor.js +78 -0
  1077. package/dist/surfaces/adapters/cursor.js.map +1 -0
  1078. package/dist/surfaces/registry.d.ts +76 -0
  1079. package/dist/surfaces/registry.d.ts.map +1 -0
  1080. package/dist/surfaces/registry.js +117 -0
  1081. package/dist/surfaces/registry.js.map +1 -0
  1082. package/dist/surfaces/telemetry.d.ts +17 -0
  1083. package/dist/surfaces/telemetry.d.ts.map +1 -0
  1084. package/dist/surfaces/telemetry.js +31 -0
  1085. package/dist/surfaces/telemetry.js.map +1 -0
  1086. package/package.json +12 -4
  1087. package/templates/archetypes/boundary.md +23 -0
  1088. package/templates/archetypes/constraint.md +23 -0
  1089. package/templates/archetypes/convention.md +23 -0
  1090. package/templates/archetypes/policy.md +23 -0
  1091. package/templates/archetypes/quality-gate.md +23 -0
  1092. package/templates/archetypes/workflow.md +23 -0
  1093. package/templates/method-registry.json +16 -0
  1094. package/dist/generators/__tests__/surface-profiles.test.d.ts +0 -2
  1095. package/dist/generators/__tests__/surface-profiles.test.d.ts.map +0 -1
  1096. package/dist/generators/__tests__/surface-profiles.test.js +0 -89
  1097. package/dist/generators/__tests__/surface-profiles.test.js.map +0 -1
package/dist/index.js CHANGED
@@ -7,17 +7,25 @@
7
7
  import { readFileSync } from 'node:fs';
8
8
  import { dirname, join } from 'node:path';
9
9
  import { fileURLToPath } from 'node:url';
10
- import { Command } from 'commander';
10
+ import { Command, CommanderError } from 'commander';
11
11
  const __dirname = dirname(fileURLToPath(import.meta.url));
12
12
  const cliPackageVersion = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
13
- import { setOutputMode } from './lib/runner.js';
13
+ import { setOutputMode, setQuietMode, isJsonMode } from './lib/runner.js';
14
+ import { CLIError, ErrorCode } from './lib/errors.js';
14
15
  import { runContext } from './commands/context.js';
15
16
  import { runGet, runGetMany } from './commands/get.js';
17
+ import { runScoreboard } from './commands/scoreboard.js';
18
+ import { runReworkReport } from './commands/rework.js';
19
+ import { runConnect } from './commands/connect.js';
16
20
  import { runLogin } from './commands/login.js';
21
+ import { runSetup } from './commands/setup.js';
22
+ import { runSetupDetectSurfaces, formatDetectSurfacesSummary } from './commands/setup-detect-surfaces.js';
23
+ import { runSetupState } from './commands/setup-state.js';
24
+ import { runSetupAudit } from './commands/setup-audit.js';
17
25
  import { runOrient } from './commands/orient.js';
18
26
  import { runSearch } from './commands/search.js';
19
27
  import { runHandshake, runHandshakeInit } from './commands/handshake.js';
20
- import { runSessionStart, runSessionClose, runSessionId } from './commands/session.js';
28
+ import { runSessionStart, runSessionClose, runSessionId, runSessionReset, runSessionList, runSessionShow } from './commands/session.js';
21
29
  import { runCapture } from './commands/capture.js';
22
30
  import { runUpdate } from './commands/update.js';
23
31
  import { runRelate, runUnrelate } from './commands/relate.js';
@@ -36,16 +44,92 @@ import { runCrossCut } from './commands/cross-cut.js';
36
44
  import { runBrief, runCompoundBrief, isCompoundType } from './commands/brief.js';
37
45
  import { runVerify } from './commands/verify.js';
38
46
  import { runCodexPrep } from './commands/codex-prep.js';
47
+ import { runCollectionsList, runCollectionsGet, runCollectionsAudit, runCollectionsExport } from './commands/collections.js';
48
+ import { runWorkspaceVerify, runWorkspaceRepair, runDefinitionsDiff } from './commands/workspace.js';
49
+ import { runAuthorityDomainsActivateCutover, runAuthorityDomainsAdd, runAuthorityDomainsDeactivateCutover, runAuthorityDomainsBenchmark, runAuthorityDomainsDiscardPending, runAuthorityDomainsPropose, runAuthorityDomainsQueueTag, runAuthorityDomainsRatify, runAuthorityDomainsReadiness, runAuthorityDomainsRecordSample, runAuthorityDomainsReject, runAuthorityDomainsReview, runAuthorityDomainsPrincipleDistribution, } from './commands/authority-domains.js';
50
+ import { runDoctor } from './commands/doctor.js';
51
+ import { runWhoami } from './commands/whoami.js';
52
+ import { runFiles } from './commands/files.js';
53
+ import { runUpgrade } from './commands/upgrade.js';
54
+ import { runProfileList, runProfileCreate, runProfileUse, runProfileDelete } from './commands/profile.js';
55
+ import { runInit } from './commands/init.js';
56
+ import { runMethodList, runMethodShow, runMethodDiff, runMethodPublish } from './commands/method.js';
57
+ import { createAdminCommand } from './commands/admin/index.js';
58
+ import { createFeedbackCommand } from './commands/feedback.js';
59
+ import { createConflictsCommand } from './commands/conflicts.js';
60
+ import { createOrganisationCommand } from './commands/organisation.js';
61
+ import { runUsage } from './commands/usage.js';
62
+ import { runProofRun } from './commands/proof-run.js';
63
+ import { GLOSSARY, formatGlossary } from './lib/glossary.js';
64
+ import { API_KEY_PREFIX } from './lib/tokenConstants.js';
65
+ import { hint, heading, bold, dim, green, icons } from './lib/style.js';
66
+ import { printPreviewBanner } from './lib/previewBanner.js';
67
+ import { checkForUpdate } from './lib/update-check.js';
68
+ import { UPGRADE_COMMAND } from './lib/constants.js';
69
+ import { resolveSetupState, detectRenderTier } from './lib/state.js';
39
70
  const program = new Command();
71
+ /**
72
+ * Global error handler — single exit point for all CLI errors.
73
+ * CLIError: format with code + category + guidance.
74
+ * CommanderError: re-throw for --help / --version (exitCode 0), format others.
75
+ * Regular Error: wrap as INTERNAL.
76
+ */
77
+ function handleError(err) {
78
+ // Commander help/version exits with code 0 — let them through
79
+ if (err instanceof CommanderError && err.exitCode === 0) {
80
+ process.exit(0);
81
+ }
82
+ const json = isJsonMode();
83
+ if (err instanceof CLIError) {
84
+ if (json) {
85
+ process.stderr.write(JSON.stringify(err.toJSON()) + '\n');
86
+ }
87
+ else {
88
+ process.stderr.write(err.message + '\n');
89
+ if (err.guidance) {
90
+ process.stderr.write(err.guidance + '\n');
91
+ }
92
+ }
93
+ process.exit(1);
94
+ }
95
+ // CommanderError (bad usage, missing args, etc.)
96
+ if (err instanceof CommanderError) {
97
+ const cliErr = new CLIError(err.message, {
98
+ code: ErrorCode.VALIDATION_FAILED,
99
+ category: 'validation',
100
+ });
101
+ if (json) {
102
+ process.stderr.write(JSON.stringify(cliErr.toJSON()) + '\n');
103
+ }
104
+ else {
105
+ process.stderr.write(err.message + '\n');
106
+ }
107
+ process.exit(err.exitCode);
108
+ }
109
+ // Unknown / unstructured errors
110
+ const message = err instanceof Error ? err.message : String(err);
111
+ if (json) {
112
+ process.stderr.write(JSON.stringify({ error: message, code: 'INTERNAL', category: 'internal' }) + '\n');
113
+ }
114
+ else {
115
+ process.stderr.write(message + '\n');
116
+ }
117
+ process.exit(1);
118
+ }
40
119
  program
41
120
  .name('pb')
42
121
  .description('Product Brain — Chain knowledge + write-back CLI')
43
122
  .version(cliPackageVersion.version)
44
123
  // Global output mode flags (DEC-299, BET-181)
45
124
  .option('--json', 'Output machine-readable JSON (overrides TTY auto-detection)')
46
- .option('--pretty', 'Force human-readable output even when piped');
125
+ .option('--pretty', 'Force human-readable output even when piped')
126
+ .option('-q, --quiet', 'Suppress non-essential output (banners, hints, progress)')
127
+ .exitOverride(); // Throw CommanderError instead of calling process.exit directly
47
128
  // Apply global output mode BEFORE subcommand actions run
48
- program.hook('preAction', (thisCommand) => {
129
+ // Commander preAction hook signature: (hookedCommand, actionCommand)
130
+ // hookedCommand = the command where hook was registered (root program)
131
+ // actionCommand = the subcommand actually being invoked
132
+ program.hook('preAction', (_hookedCommand, actionCommand) => {
49
133
  const globalOpts = program.opts();
50
134
  if (globalOpts.json) {
51
135
  setOutputMode('json');
@@ -54,7 +138,128 @@ program.hook('preAction', (thisCommand) => {
54
138
  setOutputMode('pretty');
55
139
  }
56
140
  // else: 'auto' (default) — TTY detection handles it
57
- void thisCommand;
141
+ if (globalOpts.quiet) {
142
+ setQuietMode(true);
143
+ }
144
+ // Ambient update notification — non-blocking, suppressed in JSON mode (WP-322 S1)
145
+ checkForUpdate(cliPackageVersion.version);
146
+ // PREVIEW banner — writes to stderr so it's always visible even in --json/--quiet mode.
147
+ // Advisory line added for top-level Chain-write commands: real learnings belong in the real Chain.
148
+ printPreviewBanner(actionCommand);
149
+ });
150
+ // Default action — status dashboard when `pb` is invoked with no command.
151
+ // `pb --help` still works because Commander intercepts --help before the action runs.
152
+ program.action(async () => {
153
+ // Alias handling — forward common shorthands before showing the welcome screen
154
+ if (program.args.length > 0) {
155
+ const args = program.args;
156
+ // `pb start` / `pb start session` → `pb session start`
157
+ if (args[0] === 'start') {
158
+ await runSessionStart();
159
+ return;
160
+ }
161
+ // `pb close` / `pb close session` → `pb session close`
162
+ if (args[0] === 'close') {
163
+ await runSessionClose({});
164
+ return;
165
+ }
166
+ // Unknown command — show a helpful error instead of the welcome screen
167
+ const unknown = args[0];
168
+ process.stderr.write(`error: unknown command '${unknown}'\n`);
169
+ process.stderr.write(`Run 'pb --help' to see available commands.\n`);
170
+ process.exit(1);
171
+ }
172
+ const tier = detectRenderTier();
173
+ // JSON tier — structured status output
174
+ if (tier === 'json') {
175
+ // Check for API key first (sync, no network)
176
+ let hasKey = false;
177
+ try {
178
+ const { getConfig: gc } = await import('./lib/config.js');
179
+ gc();
180
+ hasKey = true;
181
+ }
182
+ catch {
183
+ // No valid key
184
+ }
185
+ if (!hasKey) {
186
+ process.stdout.write(JSON.stringify({
187
+ configured: false,
188
+ hint: 'Run pb login to configure your API key.',
189
+ }) + '\n');
190
+ return;
191
+ }
192
+ const { readSession } = await import('./lib/session.js');
193
+ const { probeWorkspace } = await import('./lib/workspace-probe.js');
194
+ const session = readSession();
195
+ const wsInfo = await probeWorkspace();
196
+ process.stdout.write(JSON.stringify({
197
+ configured: true,
198
+ workspace: wsInfo?.name ?? null,
199
+ session: session ? { id: session.sessionId, startedAt: session.startedAt } : null,
200
+ entryCount: wsInfo?.entryCount ?? null,
201
+ hint: 'Run pb --help for available commands.',
202
+ }) + '\n');
203
+ return;
204
+ }
205
+ // Ink tier: suppress withSpinner output before Ink mounts — spinner writes pollute the TUI canvas
206
+ if (tier === 'ink')
207
+ setQuietMode(true);
208
+ // Resolve state (plain and ink both need it)
209
+ const state = await resolveSetupState();
210
+ // Plain tier — console output driven by state
211
+ if (tier === 'plain') {
212
+ process.stdout.write('\n');
213
+ if (state.stage === 'unconfigured') {
214
+ process.stdout.write(`${bold('Product Brain')} ${dim('— not connected')}\n\n`);
215
+ process.stdout.write(`${heading('Get started')}\n\n`);
216
+ hint('1. pb login Save your API key');
217
+ hint('2. pb connect Connect a workspace');
218
+ hint('3. pb orient -b See what\'s happening');
219
+ process.stdout.write('\n');
220
+ hint('pb --help Show all commands');
221
+ process.stdout.write('\n');
222
+ }
223
+ else if (state.stage === 'authenticated') {
224
+ process.stdout.write(`${bold('Product Brain')} ${dim('— server unreachable')}\n\n`);
225
+ process.stdout.write(` ${green(icons.pass)} Key: configured\n`);
226
+ process.stdout.write(` ! Server: unreachable — run pb doctor to diagnose\n\n`);
227
+ hint('pb session start Start a write session');
228
+ hint('pb doctor Diagnose connection issues');
229
+ hint('pb --help Show all commands');
230
+ process.stdout.write('\n');
231
+ }
232
+ else {
233
+ // workspace-bound or active
234
+ const workspaceName = state.workspaceName ?? 'unknown';
235
+ const entryCount = state.entryCount ?? 0;
236
+ const title = `${bold('Product Brain')} ${dim('—')} ${bold(workspaceName)}`;
237
+ process.stdout.write(`${title}\n\n`);
238
+ process.stdout.write(` ${green(icons.pass)} Key: configured\n`);
239
+ process.stdout.write(` ${green(icons.pass)} Workspace: ${workspaceName} (${entryCount} entries)\n`);
240
+ if (state.sessionActive) {
241
+ process.stdout.write(` ${green(icons.pass)} Session: active\n`);
242
+ }
243
+ else {
244
+ process.stdout.write(` ${dim('- Session: none')}\n`);
245
+ }
246
+ process.stdout.write('\n');
247
+ if (!state.sessionActive) {
248
+ hint('pb session start Start a write session');
249
+ }
250
+ hint('pb orient -b Workspace overview');
251
+ hint('pb --help Show all commands');
252
+ process.stdout.write('\n');
253
+ }
254
+ return;
255
+ }
256
+ // Ink tier — interactive TUI
257
+ const version = cliPackageVersion.version;
258
+ const { render } = await import('ink');
259
+ const { WelcomeCockpit } = await import('./commands/welcome.js');
260
+ const React = await import('react');
261
+ const { waitUntilExit, unmount } = render(React.default.createElement(WelcomeCockpit, { state, version, onExit: () => unmount() }));
262
+ await waitUntilExit();
58
263
  });
59
264
  program
60
265
  .command('get <entry-id>')
@@ -64,25 +269,41 @@ program
64
269
  program.commands.find((c) => c.name() === 'get')?.help();
65
270
  return;
66
271
  }
67
- try {
68
- await runGet({ entryId: entryId.trim() });
69
- }
70
- catch (err) {
71
- console.error(err instanceof Error ? err.message : String(err));
72
- process.exit(1);
73
- }
272
+ await runGet({ entryId: entryId.trim() });
273
+ });
274
+ program
275
+ .command('scoreboard')
276
+ .description('Flywheel scoreboard M1-M5 metrics + diagnosis layer (agent-primary; --json for structured consumption)')
277
+ .option('-t, --task <task>', 'Task context for the ranking-agreement (M2) + truth-state (M1) read')
278
+ .action(async (opts) => {
279
+ await runScoreboard({ ...(opts.task ? { task: opts.task } : {}) });
280
+ });
281
+ const reworkCmd = program
282
+ .command('rework')
283
+ .description('Report observed rework signals (WP-487 / FEAT-1373 — fills the M4 rework meter)');
284
+ reworkCmd
285
+ .command('report <entry-id>')
286
+ .description('Report a rework event attributed to a previously served governance entry (agent-native checkpoint; requires an active session)')
287
+ .requiredOption('--classification <kind>', 'revision | ci_review_correction | user_override')
288
+ .option('--via <kind>', 'How this was observed: followup_commit | ci_rerun | manual', 'manual')
289
+ .option('--attributable', 'Flag: this ci_review_correction is attributed to a missing/violated served decision')
290
+ .option('--task <text>', 'Task context this rework relates to (truncated server-side, never raw diff/comment text)')
291
+ .option('--conversation <id>', 'Explicit conversation override, matching `pb session start --conversation <id>` — use when the shell has no PB_CONVERSATION_ID set')
292
+ .action(async (entryId, opts) => {
293
+ await runReworkReport({
294
+ entryId,
295
+ classification: opts.classification,
296
+ reportedVia: opts.via,
297
+ attributable: opts.attributable,
298
+ task: opts.task,
299
+ conversation: opts.conversation,
300
+ });
74
301
  });
75
302
  program
76
303
  .command('get-many <entry-ids...>')
77
304
  .description('Fetch multiple entries in parallel (space-separated IDs)')
78
305
  .action(async (entryIds) => {
79
- try {
80
- await runGetMany({ entryIds: entryIds.map((id) => id.trim()).filter(Boolean) });
81
- }
82
- catch (err) {
83
- console.error(err instanceof Error ? err.message : String(err));
84
- process.exit(1);
85
- }
306
+ await runGetMany({ entryIds: entryIds.map((id) => id.trim()).filter(Boolean) });
86
307
  });
87
308
  program
88
309
  .command('context <entry-id>')
@@ -92,26 +313,14 @@ program
92
313
  program.commands.find((c) => c.name() === 'context')?.help();
93
314
  return;
94
315
  }
95
- try {
96
- await runContext({ entryId: entryId.trim() });
97
- }
98
- catch (err) {
99
- console.error(err instanceof Error ? err.message : String(err));
100
- process.exit(1);
101
- }
316
+ await runContext({ entryId: entryId.trim() });
102
317
  });
103
318
  program
104
319
  .command('changes')
105
320
  .description('Detect entries modified and relations created since a given time (BET-239)')
106
321
  .requiredOption('--since <duration>', 'Time window: 1h, 6h, 1d, 7d, 30d')
107
322
  .action(async (opts) => {
108
- try {
109
- await runChanges({ since: opts.since });
110
- }
111
- catch (err) {
112
- console.error(err instanceof Error ? err.message : String(err));
113
- process.exit(1);
114
- }
323
+ await runChanges({ since: opts.since });
115
324
  });
116
325
  program
117
326
  .command('walk <entry-id>')
@@ -120,36 +329,26 @@ program
120
329
  .option('--direction <dir>', 'Traversal direction: outgoing or incoming (default outgoing)', 'outgoing')
121
330
  .option('-t, --type <relation-type>', 'Filter by relation type (e.g. depends_on, informs, governs)')
122
331
  .action(async (entryId, opts) => {
123
- try {
124
- const depth = parseInt(opts.depth, 10);
125
- if (isNaN(depth) || depth < 1 || depth > 4) {
126
- console.error('--depth must be between 1 and 4.');
127
- process.exit(1);
128
- }
129
- await runChainWalk({
130
- entryId: entryId.trim(),
131
- depth,
132
- direction: opts.direction,
133
- type: opts.type,
332
+ const depth = parseInt(opts.depth, 10);
333
+ if (isNaN(depth) || depth < 1 || depth > 4) {
334
+ throw new CLIError('--depth must be between 1 and 4.', {
335
+ code: ErrorCode.VALIDATION_FAILED,
336
+ category: 'validation',
134
337
  });
135
338
  }
136
- catch (err) {
137
- console.error(err instanceof Error ? err.message : String(err));
138
- process.exit(1);
139
- }
339
+ await runChainWalk({
340
+ entryId: entryId.trim(),
341
+ depth,
342
+ direction: opts.direction,
343
+ type: opts.type,
344
+ });
140
345
  });
141
346
  program
142
347
  .command('cross-cut')
143
348
  .description('Structural aggregation — all relations of a given type grouped by source collection (BET-239)')
144
349
  .requiredOption('--type <relation-type>', 'Relation type to scan (e.g. part_of, informs, governs)')
145
350
  .action(async (opts) => {
146
- try {
147
- await runCrossCut({ type: opts.type });
148
- }
149
- catch (err) {
150
- console.error(err instanceof Error ? err.message : String(err));
151
- process.exit(1);
152
- }
351
+ await runCrossCut({ type: opts.type });
153
352
  });
154
353
  program
155
354
  .command('brief [type]')
@@ -162,27 +361,20 @@ program
162
361
  .option('--since-last', 'Compare against last brief run (incremental mode)')
163
362
  .option('--since <timestamp>', 'ISO 8601 timestamp for delta type (e.g. 2026-03-24T00:00:00Z)')
164
363
  .action(async (type, opts) => {
165
- try {
166
- // If positional arg is a compound type, route to compound brief
167
- if (type && isCompoundType(type)) {
168
- await runCompoundBrief({ type, since: opts.since });
169
- return;
170
- }
171
- // Otherwise, require --skill for incremental brief
172
- if (!opts.skill) {
173
- console.error('Usage:\n' +
174
- ' pb brief --skill <name> Incremental delta\n' +
175
- ' pb brief steering Compound steering brief\n' +
176
- ' pb brief confidence Compound confidence pass\n' +
177
- ' pb brief delta Compound delta sync');
178
- process.exit(1);
179
- }
180
- await runBrief({ skill: opts.skill, sinceLast: opts.sinceLast });
364
+ // If positional arg is a compound type, route to compound brief
365
+ if (type && isCompoundType(type)) {
366
+ await runCompoundBrief({ type, since: opts.since });
367
+ return;
181
368
  }
182
- catch (err) {
183
- console.error(err instanceof Error ? err.message : String(err));
184
- process.exit(1);
369
+ // Otherwise, require --skill for incremental brief
370
+ if (!opts.skill) {
371
+ throw new CLIError('Usage:\n' +
372
+ ' pb brief --skill <name> Incremental delta\n' +
373
+ ' pb brief steering Compound steering brief\n' +
374
+ ' pb brief confidence Compound confidence pass\n' +
375
+ ' pb brief delta Compound delta sync', { code: ErrorCode.VALIDATION_FAILED, category: 'validation' });
185
376
  }
377
+ await runBrief({ skill: opts.skill, sinceLast: opts.sinceLast });
186
378
  });
187
379
  program
188
380
  .command('search [query...]')
@@ -193,80 +385,141 @@ program
193
385
  program.commands.find((c) => c.name() === 'search')?.help();
194
386
  return;
195
387
  }
196
- try {
197
- await runSearch({ query });
198
- }
199
- catch (err) {
200
- console.error(err instanceof Error ? err.message : String(err));
201
- process.exit(1);
202
- }
388
+ await runSearch({ query });
203
389
  });
204
390
  program
205
391
  .command('orient')
206
392
  .description('Print workspace stage and all orient sections (strategic context, bets, governance, tensions, etc.)')
207
393
  .option('-b, --brief', 'Compact view: stage, counts, top bets, tensions, planned work')
208
394
  .option('-t, --task <task>', 'Task description for task-shaped governance and context')
209
- // SYNC: domain list must match TaskDomain in convex/mcpKnowledge/startupResolver.ts
210
- .option('-s, --scope <domain>', 'Domain scope for governance filtering. Valid values: auth, governance, architecture, product, data-foundation, chainwork, capture-pipeline, ingestion, intelligence-and-operations, review-and-learning, general')
395
+ .option('-s, --scope <domain>', 'Domain scope for governance filtering. Forwarded to the workspace model for validation and custom domain resolution.')
396
+ .option('--full', 'Full depth orient (tier=full). Use for thorough context loading.')
211
397
  .action(async (opts) => {
212
- try {
213
- await runOrient({ brief: opts.brief, task: opts.task?.trim() || undefined, scope: opts.scope?.trim() || undefined });
214
- }
215
- catch (err) {
216
- console.error(err instanceof Error ? err.message : String(err));
217
- process.exit(1);
218
- }
398
+ await runOrient({ brief: opts.brief, task: opts.task?.trim() || undefined, scope: opts.scope?.trim() || undefined, full: opts.full });
219
399
  });
220
400
  program
221
401
  .command('handshake')
222
402
  .description('Generate context files for AI developer tools (AGENTS.md, .codex/skills/, CLAUDE.md, .cursor/rules/, .github/copilot-instructions.md)')
223
403
  .option('--force', 'Overwrite adapter files even if they exist without auto-generated marker')
224
- .option('--dry-run', 'Show what would be generated without writing files')
404
+ .option('--apply', 'Write files (default: preview only)')
405
+ .option('--dry-run', 'Show what would be generated without writing files (alias for preview)')
225
406
  .option('--init', 'Set up Claude Code integration: team hooks + personal trust level')
226
407
  .option('--level <level>', 'With --init: trust level (guide|work|silent|full-trust). Without --init: content tier (beginner|intermediate|expert)')
408
+ .option('--generate', 'Fetch governance entries from the Chain and merge generated rules (BET-286)')
409
+ .option('--surfaces <list>', 'Comma-separated surfaces to write (cursor,claude,copilot,codex)')
410
+ .option('--no-prompt', 'Headless mode: refuse on tampered projection files (WP-421 S3, doneWhen #17). Always implied when stdout is not a TTY.')
411
+ .option('--lenient', 'WP-439 S4: continue past setup-asset body fetch failures with a warning (legacy behaviour). By default, body fetch failures are hard errors; run `pb setup-audit --repair` to fix orphaned rows.')
227
412
  .action(async (opts) => {
228
- try {
229
- if (opts.init) {
230
- await runHandshakeInit({ level: opts.level, dryRun: opts.dryRun });
231
- return;
232
- }
233
- await runHandshake({ force: opts.force, dryRun: opts.dryRun, level: opts.level });
234
- }
235
- catch (err) {
236
- console.error(err instanceof Error ? err.message : String(err));
237
- process.exit(1);
413
+ if (opts.init) {
414
+ await runHandshakeInit({ level: opts.level, dryRun: opts.dryRun });
415
+ return;
238
416
  }
417
+ // Commander turns `--no-prompt` into `prompt: false`. We invert so HandshakeOptions sees noPrompt=true.
418
+ const noPrompt = opts.prompt === false;
419
+ // Attribute the bare-handshake invocation so its context.served row is separable from
420
+ // session-start ('session-start') / session-close ('session-close') / manual orient rows.
421
+ // Without this, the kernel used to coerce the absent path to 'manual-orient', polluting the
422
+ // proof slice that isolates manual `pb orient --task` rows (the 'handshake' union member was
423
+ // otherwise never emitted).
424
+ await runHandshake({ force: opts.force, apply: opts.apply, dryRun: opts.dryRun, level: opts.level, generate: opts.generate, surfaces: opts.surfaces?.split(','), noPrompt, lenient: opts.lenient, invocationPath: 'handshake' });
239
425
  });
240
426
  program
241
427
  .command('codex-prep <task...>')
242
428
  .description('Generate task-specific governance context for Codex (.codex/task-context.md)')
243
429
  .option('--dry-run', 'Print to stdout instead of writing file')
430
+ .option('--full', 'Full depth orient (tier=full). Use for thorough context loading.')
244
431
  .action(async (taskParts, opts) => {
245
432
  const task = taskParts.join(' ').trim();
246
433
  if (!task) {
247
434
  program.commands.find((c) => c.name() === 'codex-prep')?.help();
248
435
  return;
249
436
  }
250
- try {
251
- await runCodexPrep({ task, dryRun: opts.dryRun });
252
- }
253
- catch (err) {
254
- console.error(err instanceof Error ? err.message : String(err));
255
- process.exit(1);
437
+ await runCodexPrep({ task, dryRun: opts.dryRun, full: opts.full });
438
+ });
439
+ program
440
+ .command('init')
441
+ .description('Detect setup state and guide you through configuration (WP-303)')
442
+ .action(async () => {
443
+ await runInit();
444
+ });
445
+ program
446
+ .command('connect <token>')
447
+ .description('Redeem an onboarding token and save your API key locally (FEAT-958). Uses CONVEX_SITE_URL if set, otherwise the production gateway. Override with --gateway or PB_CONNECT_GATEWAY_URL. In a non-interactive shell (e.g. CI), pass --yes to confirm the workspace, optionally with --name to label the key.')
448
+ .option('--gateway <url>', 'Override redeem gateway (default: CONVEX_SITE_URL or production). Use when token came from a different Convex deployment.')
449
+ .option('--name <label>', 'Optional label for this API key in workspace settings. Skips the key-label prompt when set.')
450
+ .option('-y, --yes', 'Skip the interactive workspace confirmation. Required to connect in a non-interactive shell (e.g. CI).')
451
+ .action(async (token, opts) => {
452
+ if (!token?.trim()) {
453
+ program.commands.find((c) => c.name() === 'connect')?.help();
454
+ return;
256
455
  }
456
+ await runConnect(token.trim(), { gateway: opts.gateway, name: opts.name, assumeYes: opts.yes });
257
457
  });
258
458
  program
259
459
  .command('login')
260
460
  .description('Save your API key to ~/.config/productbrain/.env (works from any directory)')
261
461
  .action(async () => {
262
- try {
263
- await runLogin();
462
+ await runLogin();
463
+ });
464
+ program
465
+ .command('doctor')
466
+ .description('Check CLI configuration and connectivity')
467
+ .option('--fix', 'Auto-repair common configuration issues')
468
+ .option('--dry-run', 'Preview what --fix would do without changing anything')
469
+ .action(async (opts) => {
470
+ await runDoctor({ fix: opts.fix, dryRun: opts.dryRun });
471
+ });
472
+ program
473
+ .command('whoami')
474
+ .alias('status')
475
+ .description('Show the active profile + workspace (fast; no session required).')
476
+ .action(async () => {
477
+ await runWhoami();
478
+ });
479
+ program
480
+ .command('files')
481
+ .description('Show which .productbrain files are pb-owned vs committed, and what writes each.')
482
+ .option('--fix', 'Add any exposed pb-owned files to .gitignore (idempotent)')
483
+ .option('--dry-run', 'With --fix: preview the .gitignore lines without writing')
484
+ .action(async (opts) => {
485
+ await runFiles({ fix: opts.fix, dryRun: opts.dryRun });
486
+ });
487
+ program
488
+ .command('setup')
489
+ .description('Canonical pb-setup entry (DEC-995): detect surfaces, read state, emit JSON for the skill body.')
490
+ .action(async () => {
491
+ await runSetup();
492
+ });
493
+ program
494
+ .command('setup-detect-surfaces')
495
+ .description('Detect local surface markers and union-merge into manifest.surfaces (STD-235 forward-only)')
496
+ .action(async () => {
497
+ const result = await runSetupDetectSurfaces();
498
+ if (process.stdout.isTTY) {
499
+ process.stdout.write(formatDetectSurfacesSummary(result) + '\n');
264
500
  }
265
- catch (err) {
266
- console.error(err instanceof Error ? err.message : String(err));
267
- process.exit(1);
501
+ else {
502
+ process.stderr.write(formatDetectSurfacesSummary(result) + '\n');
268
503
  }
269
504
  });
505
+ program
506
+ .command('setup-state')
507
+ .description('Emit compact JSON of getPbSetupState (machine-readable, used by the pb-setup skill body)')
508
+ .action(async () => {
509
+ await runSetupState();
510
+ });
511
+ // WP-439 S2: setup-asset orphan audit. Read-only diagnostic; exits 1 if any
512
+ // setup_asset row has a broken body wiring (will fail at handshake).
513
+ // WP-439 S3: --repair attempts to restore class III/II orphans from STARTER_*
514
+ // constants. Class I (inline-only) and IV (hash drift) are NOT touched.
515
+ program
516
+ .command('setup-audit')
517
+ .description('Audit setup_asset rows for orphaned bodies (WP-439 S2/S3). Exits 1 if any orphan or repair-failure.')
518
+ .option('--json', 'Emit machine-readable JSON (overrides pretty output for this command)')
519
+ .option('--repair', 'Attempt to restore class III/II orphans from STARTER_* constants (WP-439 S3)')
520
+ .action(async (opts) => {
521
+ await runSetupAudit({ json: opts.json, repair: opts.repair });
522
+ });
270
523
  // --- Write commands (require active session) ---
271
524
  const sessionCmd = program
272
525
  .command('session')
@@ -275,39 +528,45 @@ sessionCmd
275
528
  .command('start')
276
529
  .description('Start a tracked write session (opens session, refreshes context)')
277
530
  .option('--json', 'Output machine-readable JSON (deprecated: use global --json flag)')
531
+ .option('--conversation <id>', 'Explicit conversation identity override (WP-479 E2) — takes priority over env-detected channels. Pair with PB_CONVERSATION_ID=<id> so later bare pb commands (orient, capture) attribute to the same conversation — they resolve identity from env only')
278
532
  .action(async (opts) => {
279
- try {
280
- await runSessionStart({ json: opts.json });
281
- }
282
- catch (err) {
283
- console.error(err instanceof Error ? err.message : String(err));
284
- process.exit(1);
285
- }
533
+ await runSessionStart({ json: opts.json, conversation: opts.conversation });
286
534
  });
287
535
  sessionCmd
288
536
  .command('id')
289
537
  .description('Print current session ID to stdout (machine-readable, TEN-707)')
290
538
  .action(() => {
291
- try {
292
- runSessionId();
293
- }
294
- catch (err) {
295
- console.error(err instanceof Error ? err.message : String(err));
296
- process.exit(1);
297
- }
539
+ runSessionId();
298
540
  });
299
541
  sessionCmd
300
542
  .command('close')
301
543
  .description('Close the active session (wrapup, refresh context)')
302
544
  .option('--force', 'Clear local session state even if server close fails')
303
545
  .action(async (opts) => {
304
- try {
305
- await runSessionClose({ force: opts.force });
306
- }
307
- catch (err) {
308
- console.error(err instanceof Error ? err.message : String(err));
309
- process.exit(1);
310
- }
546
+ await runSessionClose({ force: opts.force });
547
+ });
548
+ // WP-479 E4: traceback + quota observability.
549
+ sessionCmd
550
+ .command('list')
551
+ .description('List active sessions (with quota gauge) + recent non-active ones (WP-479 E4)')
552
+ .action(async () => {
553
+ await runSessionList();
554
+ });
555
+ sessionCmd
556
+ .command('show <id-or-conversation>')
557
+ .description('Show a conversation\'s full session lineage + governance serves (WP-479 E4)')
558
+ .action(async (idOrConversation) => {
559
+ await runSessionShow(idOrConversation);
560
+ });
561
+ // TEN-2189 / WP-456 E2: hard-reset worktree-local session state (no resume marker)
562
+ // + clear the PREVIEW_MODE marker. Recovery path for a session stranded on the wrong
563
+ // workspace after a pb:preview/pb:real binding flip.
564
+ sessionCmd
565
+ .command('reset')
566
+ .description('Hard-reset local session state (discard session.json + clear PREVIEW_MODE)')
567
+ .option('--force', 'Skip the confirmation prompt when an active session is present')
568
+ .action(async (opts) => {
569
+ await runSessionReset({ force: opts.force });
311
570
  });
312
571
  program
313
572
  .command('capture [text...]')
@@ -315,34 +574,37 @@ program
315
574
  .option('-n, --name <name>', 'Entry name (defaults to capture text)')
316
575
  .option('-d, --description <desc>', 'Entry description (defaults to capture text)')
317
576
  .option('-c, --collection <slug>', 'Explicit collection (skip auto-classification)')
577
+ .option('-f, --field <key=value>', 'Set a data field (repeatable; e.g. rationale="...")', (val, prev) => [...prev, val], [])
318
578
  .option('-l, --link <entry-id>', 'Link new entry to an existing entry (TEN-705)')
319
579
  .option('-t, --type <relation-type>', 'Relation type for --link (default: surfaces_tension_in)')
320
580
  .option('--source-ref <ref>', 'Source reference URI (BET-240 E2: e.g. "meeting-2026-03-28.md")')
321
581
  .option('--source-excerpt <text>', 'Verbatim source excerpt (BET-240 E2)')
582
+ // TEN-2226 / WP-456 E1: opt-in override — keeps the entry a draft even in Open governance mode.
583
+ .option('--draft', 'Force the entry to draft regardless of workspace governance mode (TEN-2226)')
322
584
  .option('--json', 'Output machine-readable JSON (deprecated: use global --json flag)')
585
+ .option('--suggest-only', 'Show grounding preview (possible duplicates, related entries) without creating entry (WP-319)')
586
+ .option('--strict', 'Prompt y/N before capturing when a possible duplicate is detected (WP-319)')
323
587
  .action(async (textParts = [], opts) => {
324
588
  const text = textParts.join(' ').trim();
325
589
  if (!text && !opts.name) {
326
590
  program.commands.find((c) => c.name() === 'capture')?.help();
327
591
  return;
328
592
  }
329
- try {
330
- await runCapture({
331
- text: text || opts.name || '',
332
- name: opts.name,
333
- description: opts.description,
334
- collection: opts.collection,
335
- link: opts.link,
336
- type: opts.type,
337
- sourceRef: opts.sourceRef,
338
- sourceExcerpt: opts.sourceExcerpt,
339
- json: opts.json,
340
- });
341
- }
342
- catch (err) {
343
- console.error(err instanceof Error ? err.message : String(err));
344
- process.exit(1);
345
- }
593
+ await runCapture({
594
+ text: text || opts.name || '',
595
+ name: opts.name,
596
+ description: opts.description,
597
+ collection: opts.collection,
598
+ field: opts.field,
599
+ link: opts.link,
600
+ type: opts.type,
601
+ sourceRef: opts.sourceRef,
602
+ sourceExcerpt: opts.sourceExcerpt,
603
+ draft: opts.draft,
604
+ json: opts.json,
605
+ suggestOnly: opts.suggestOnly,
606
+ strict: opts.strict,
607
+ });
346
608
  });
347
609
  // --- Update command (TEN-703) ---
348
610
  program
@@ -353,21 +615,23 @@ program
353
615
  .option('--status <status>', 'Update entry status (draft | active | deprecated | archived)')
354
616
  .option('--workflow-status <status>', 'Set workflow status (server-validated)')
355
617
  .option('--note <text>', 'Change note for history')
618
+ .option('--override-reason <text>', 'Typed override (≥12 chars) clearing a steering coherency block — recorded with author attribution (WP-465)')
619
+ .option('--acknowledge <response>', 'Respond to a coherency challenge: linked | accepted-fix | diverged (WP-465)')
620
+ .option('--ack-entry <entry-id>', 'Authorizing entry for --acknowledge linked / accepted-fix')
621
+ .option('--ack-reason <text>', 'Divergence rationale (≥12 chars) for --acknowledge diverged')
356
622
  .action(async (entryId, opts) => {
357
- try {
358
- await runUpdate({
359
- entryId,
360
- field: opts.field,
361
- name: opts.name,
362
- status: opts.status,
363
- workflowStatus: opts.workflowStatus,
364
- note: opts.note,
365
- });
366
- }
367
- catch (err) {
368
- console.error(err instanceof Error ? err.message : String(err));
369
- process.exit(1);
370
- }
623
+ await runUpdate({
624
+ entryId,
625
+ field: opts.field,
626
+ name: opts.name,
627
+ status: opts.status,
628
+ workflowStatus: opts.workflowStatus,
629
+ note: opts.note,
630
+ overrideReason: opts.overrideReason,
631
+ acknowledge: opts.acknowledge,
632
+ ackEntry: opts.ackEntry,
633
+ ackReason: opts.ackReason,
634
+ });
371
635
  });
372
636
  // --- Promote command (Wave 2 CLI Polish) ---
373
637
  program
@@ -378,26 +642,25 @@ program
378
642
  program.commands.find((c) => c.name() === 'verify')?.help();
379
643
  return;
380
644
  }
381
- try {
382
- await runVerify({ entryId: entryId.trim() });
383
- }
384
- catch (err) {
385
- console.error(err instanceof Error ? err.message : String(err));
386
- process.exit(1);
387
- }
645
+ await runVerify({ entryId: entryId.trim() });
388
646
  });
389
647
  program
390
- .command('promote <entry-id>')
391
- .description('Promote entry from draft to active (commit to SSOT)')
392
- .option('-m, --message <text>', 'Commit message')
393
- .action(async (entryId, opts) => {
394
- try {
395
- await runPromote({ entryId, message: opts.message });
396
- }
397
- catch (err) {
398
- console.error(err instanceof Error ? err.message : String(err));
399
- process.exit(1);
400
- }
648
+ .command('promote <entry-ids...>')
649
+ .description('Promote one or more entries from draft to active (commit to SSOT). Batch: a single failure does not abort the rest (INS-1813).')
650
+ .option('-m, --message <text>', 'Commit message (applied to every entry in the batch)')
651
+ .option('--override-reason <text>', 'Typed override (≥12 chars) clearing a steering coherency block at publish — recorded with author attribution (WP-465)')
652
+ .option('--acknowledge <response>', 'Respond to a coherency challenge: linked | accepted-fix | diverged (WP-465)')
653
+ .option('--ack-entry <entry-id>', 'Authorizing entry for --acknowledge linked / accepted-fix')
654
+ .option('--ack-reason <text>', 'Divergence rationale (≥12 chars) for --acknowledge diverged')
655
+ .action(async (entryIds, opts) => {
656
+ await runPromote({
657
+ entryIds,
658
+ message: opts.message,
659
+ overrideReason: opts.overrideReason,
660
+ acknowledge: opts.acknowledge,
661
+ ackEntry: opts.ackEntry,
662
+ ackReason: opts.ackReason,
663
+ });
401
664
  });
402
665
  // --- Relate / Unrelate commands (TEN-704) ---
403
666
  program
@@ -405,25 +668,13 @@ program
405
668
  .description('Add a typed relation between two entries (requires active session)')
406
669
  .option('--if-missing', 'Only create relation if it does not already exist')
407
670
  .action(async (fromId, type, toId, opts) => {
408
- try {
409
- await runRelate({ fromId, type, toId, ifMissing: opts.ifMissing });
410
- }
411
- catch (err) {
412
- console.error(err instanceof Error ? err.message : String(err));
413
- process.exit(1);
414
- }
671
+ await runRelate({ fromId, type, toId, ifMissing: opts.ifMissing });
415
672
  });
416
673
  program
417
674
  .command('unrelate <from-id> <type> <to-id>')
418
675
  .description('Remove a typed relation between two entries (requires active session)')
419
676
  .action(async (fromId, type, toId) => {
420
- try {
421
- await runUnrelate({ fromId, type, toId });
422
- }
423
- catch (err) {
424
- console.error(err instanceof Error ? err.message : String(err));
425
- process.exit(1);
426
- }
677
+ await runUnrelate({ fromId, type, toId });
427
678
  });
428
679
  // --- Ingest command (BET-81) ---
429
680
  program
@@ -433,23 +684,43 @@ program
433
684
  .option('--resume', 'Skip files whose sourceRef is already committed in staging.')
434
685
  .option('--concurrency <n>', 'Process up to N files in parallel (default 1, max 5).', '1')
435
686
  .action(async (pattern, opts) => {
436
- try {
437
- const concurrency = parseInt(opts.concurrency ?? '1', 10);
438
- if (Number.isNaN(concurrency) || concurrency < 1) {
439
- console.error('--concurrency must be a positive integer.');
440
- process.exit(1);
441
- }
442
- await runIngest({
443
- pattern,
444
- dryRun: opts.dryRun,
445
- resume: opts.resume,
446
- concurrency,
687
+ const concurrency = parseInt(opts.concurrency ?? '1', 10);
688
+ if (Number.isNaN(concurrency) || concurrency < 1) {
689
+ throw new CLIError('--concurrency must be a positive integer.', {
690
+ code: ErrorCode.VALIDATION_FAILED,
691
+ category: 'validation',
447
692
  });
448
693
  }
449
- catch (err) {
450
- console.error(err instanceof Error ? err.message : String(err));
451
- process.exit(1);
694
+ await runIngest({
695
+ pattern,
696
+ dryRun: opts.dryRun,
697
+ resume: opts.resume,
698
+ concurrency,
699
+ });
700
+ });
701
+ // --- migrate:setup command (WP-345 S0b) ---
702
+ program
703
+ .command('migrate:setup')
704
+ .description('Migrate .productbrain/skills|rules|hooks/*.md into the DB setup-assets collection (WP-345)')
705
+ .option('--dry-run', 'Show what would be migrated without writing to DB.')
706
+ .option('--cwd <path>', 'Override working directory (default: process.cwd())')
707
+ .action(async (opts) => {
708
+ const { runMigrateSetup } = await import('./commands/migrate-setup.js');
709
+ await runMigrateSetup({ dryRun: opts.dryRun, cwd: opts.cwd });
710
+ });
711
+ // --- setup:ingest command (WP-345 S3) ---
712
+ program
713
+ .command('setup:ingest <path>')
714
+ .description('Push a single .productbrain skill/rule/hook file to the DB setup-assets SSOT (WP-345)')
715
+ .option('--dry-run', 'Show what would be ingested without writing to DB.')
716
+ .option('--json', 'Output machine-readable JSON (deprecated: use global --json flag)')
717
+ .action(async (filePath, opts) => {
718
+ if (!filePath?.trim()) {
719
+ program.commands.find((c) => c.name() === 'setup:ingest')?.help();
720
+ return;
452
721
  }
722
+ const { runSetupIngest } = await import('./commands/setup-ingest.js');
723
+ await runSetupIngest(filePath.trim(), { dryRun: opts.dryRun });
453
724
  });
454
725
  // --- Fields command (BET-181 Slice 2) ---
455
726
  program
@@ -460,13 +731,7 @@ program
460
731
  program.commands.find((c) => c.name() === 'fields')?.help();
461
732
  return;
462
733
  }
463
- try {
464
- await runFields({ collectionSlug: collection.trim() });
465
- }
466
- catch (err) {
467
- console.error(err instanceof Error ? err.message : String(err));
468
- process.exit(1);
469
- }
734
+ await runFields({ collectionSlug: collection.trim() });
470
735
  });
471
736
  // --- Constellation command (BET-181 Slice 3) ---
472
737
  program
@@ -477,36 +742,24 @@ program
477
742
  program.commands.find((c) => c.name() === 'constellation')?.help();
478
743
  return;
479
744
  }
480
- try {
481
- await runConstellation({ entryId: entryId.trim() });
482
- }
483
- catch (err) {
484
- console.error(err instanceof Error ? err.message : String(err));
485
- process.exit(1);
486
- }
745
+ await runConstellation({ entryId: entryId.trim() });
487
746
  });
488
747
  // --- Audit command (BET-182 Slice 2) ---
489
748
  program
490
749
  .command('audit <entry-ids...>')
491
- .description('Run STD-113 hygiene audit on bet(s) — 13 gates, exit code reflects verdict')
750
+ .description('Run hygiene audit on bet(s) — 13 gates (shaping) / 18 gates (handoff), exit code reflects verdict')
492
751
  .option('--phase <phase>', 'Override phase detection (shaping | handoff)')
493
752
  .option('--gate <name>', 'Run only specified gate(s) (repeatable)', (val, prev) => [...prev, val], [])
494
753
  .option('--fix', 'Auto-execute exact fixes via pb update, rerun once')
495
754
  .option('--verbose', 'Show all gates including PASS detail')
496
755
  .action(async (entryIds, opts) => {
497
- try {
498
- await runAudit({
499
- entryIds: entryIds.map((id) => id.trim()).filter(Boolean),
500
- phase: opts.phase,
501
- gate: opts.gate,
502
- fix: opts.fix,
503
- verbose: opts.verbose,
504
- });
505
- }
506
- catch (err) {
507
- console.error(err instanceof Error ? err.message : String(err));
508
- process.exit(1);
509
- }
756
+ await runAudit({
757
+ entryIds: entryIds.map((id) => id.trim()).filter(Boolean),
758
+ phase: opts.phase,
759
+ gate: opts.gate,
760
+ fix: opts.fix,
761
+ verbose: opts.verbose,
762
+ });
510
763
  });
511
764
  program
512
765
  .command('brand-pack')
@@ -521,13 +774,7 @@ program
521
774
  .command('proposals')
522
775
  .description('List open consent proposals with expiry countdown (BET-221)')
523
776
  .action(async () => {
524
- try {
525
- await runProposals();
526
- }
527
- catch (err) {
528
- console.error(err instanceof Error ? err.message : String(err));
529
- process.exit(1);
530
- }
777
+ await runProposals();
531
778
  });
532
779
  program
533
780
  .command('accept [proposal-id]')
@@ -535,29 +782,316 @@ program
535
782
  .option('-a, --auto', 'Auto-approve all open proposals (skip contradictions)')
536
783
  .action(async (proposalId, opts) => {
537
784
  if (!proposalId && !opts.auto) {
538
- process.stderr.write('Usage: pb accept <proposal-id> or pb accept --auto\n');
539
- process.exit(1);
540
- }
541
- try {
542
- await runAccept({ proposalId, auto: opts.auto });
543
- }
544
- catch (err) {
545
- console.error(err instanceof Error ? err.message : String(err));
546
- process.exit(1);
785
+ throw new CLIError('Usage: pb accept <proposal-id> or pb accept --auto', {
786
+ code: ErrorCode.VALIDATION_FAILED,
787
+ category: 'validation',
788
+ });
547
789
  }
790
+ await runAccept({ proposalId, auto: opts.auto });
548
791
  });
549
792
  program
550
793
  .command('reject <proposal-id>')
551
794
  .description('Reject a consent proposal with a required reason (BR-7)')
552
795
  .requiredOption('-r, --reason <text>', 'Reason for rejection (required)')
553
796
  .action(async (proposalId, opts) => {
554
- try {
555
- await runReject({ proposalId, reason: opts.reason });
797
+ await runReject({ proposalId, reason: opts.reason });
798
+ });
799
+ // --- Collections command (BET-280 Slice 1) ---
800
+ const collectionsCmd = program
801
+ .command('collections')
802
+ .description('Inspect and audit workspace collection registry (BET-280)');
803
+ collectionsCmd
804
+ .command('list')
805
+ .description('List all collections — slug, name, field count, icon')
806
+ .action(async () => {
807
+ await runCollectionsList();
808
+ });
809
+ collectionsCmd
810
+ .command('get <slug>')
811
+ .description('Show full detail for a collection by slug')
812
+ .action(async (slug) => {
813
+ if (!slug?.trim()) {
814
+ program.commands.find((c) => c.name() === 'collections')?.help();
815
+ return;
556
816
  }
557
- catch (err) {
558
- console.error(err instanceof Error ? err.message : String(err));
559
- process.exit(1);
817
+ await runCollectionsGet({ slug: slug.trim() });
818
+ });
819
+ collectionsCmd
820
+ .command('audit')
821
+ .description('Collection health report — classification, icon, displayHint coverage, schema gaps')
822
+ .action(async () => {
823
+ await runCollectionsAudit();
824
+ });
825
+ collectionsCmd
826
+ .command('export')
827
+ .description('Export all system_collection_definitions with full classification metadata (admin only)')
828
+ .action(async () => {
829
+ await runCollectionsExport();
830
+ });
831
+ // --- Workspace operator commands (WP-305 Slice 4) ---
832
+ const workspaceCmd = program
833
+ .command('workspace')
834
+ .description('Operator commands for workspace health and repair (WP-305)');
835
+ workspaceCmd
836
+ .command('verify')
837
+ .description('Check workspace health — seeds, collections, glossary (admin only)')
838
+ .action(async () => {
839
+ await runWorkspaceVerify();
840
+ });
841
+ workspaceCmd
842
+ .command('repair')
843
+ .description('Backfill missing seeds for the active workspace (admin only)')
844
+ .action(async () => {
845
+ await runWorkspaceRepair();
846
+ });
847
+ const authorityDomainsCmd = program
848
+ .command('authority-domains')
849
+ .description('Operator commands for WP-354 authority-domain readiness and evidence');
850
+ function collectRepeatableOption(value, previous) {
851
+ return [...(previous ?? []), value];
852
+ }
853
+ authorityDomainsCmd
854
+ .command('add <slug>')
855
+ .description('Create an authority domain for this workspace')
856
+ .option('--description <description>', 'Authority-domain description')
857
+ .option('--alias <alias>', 'Alias/keyword for this domain (repeatable)', collectRepeatableOption)
858
+ .option('--path-glob <glob>', 'Changed-path glob for this domain (repeatable)', collectRepeatableOption)
859
+ .action(async (slug, opts) => {
860
+ await runAuthorityDomainsAdd(slug, opts);
861
+ });
862
+ authorityDomainsCmd
863
+ .command('propose')
864
+ .description('Generate authority-domain tag proposals')
865
+ .option('--dry-run', 'Preview without writing staging proposals')
866
+ .option('--limit <n>', 'Maximum governance entries to classify')
867
+ .option('--mock', 'Use deterministic mock classifier')
868
+ .action(async (opts) => {
869
+ await runAuthorityDomainsPropose(opts);
870
+ });
871
+ authorityDomainsCmd
872
+ .command('review')
873
+ .description('List authority-domain tag proposals')
874
+ .option('--status <status>', 'pending, committed, rejected, or skipped', 'pending')
875
+ .option('--limit <n>', 'Maximum proposals to list')
876
+ .option('--sample <n>', 'Return a stable proposal sample')
877
+ .option('--stratified', 'Stratify sample across proposed domain and source collection')
878
+ .action(async (opts) => {
879
+ await runAuthorityDomainsReview(opts);
880
+ });
881
+ const authorityDomainsSampleCmd = authorityDomainsCmd
882
+ .command('sample')
883
+ .description('Manage human-reviewed authority-domain proposal samples');
884
+ authorityDomainsSampleCmd
885
+ .command('record')
886
+ .description('Record human-reviewed sample accuracy for authority-domain proposals')
887
+ .requiredOption('--sample-id <id>', 'Stable sample identifier from the review packet')
888
+ .option('--run-id <id>', 'Proposal run identifier')
889
+ .requiredOption('--approved <n>', 'Count of sampled proposals approved as-is')
890
+ .requiredOption('--rejected <n>', 'Count of sampled proposals rejected')
891
+ .requiredOption('--corrected <n>', 'Count of sampled proposals corrected to another domain')
892
+ .action(async (opts) => {
893
+ await runAuthorityDomainsRecordSample(opts);
894
+ });
895
+ authorityDomainsCmd
896
+ .command('ratify <proposal-id>')
897
+ .description('Ratify an authority-domain tag proposal')
898
+ .option('--note <note>', 'Review note')
899
+ .action(async (proposalId, opts) => {
900
+ await runAuthorityDomainsRatify(proposalId, opts);
901
+ });
902
+ authorityDomainsCmd
903
+ .command('queue-tag')
904
+ .description('Queue a known-correct authority-domain tag proposal')
905
+ .requiredOption('--entry <entryId>', 'Entry ID to tag, e.g. DEC-1244')
906
+ .requiredOption('--domain <domainSlug>', 'Authority-domain slug, e.g. product-design/ux')
907
+ .option('--note <note>', 'Known-correct evidence note')
908
+ .option('--ratify', 'Immediately ratify using the generated confirmation string')
909
+ .action(async (opts) => {
910
+ await runAuthorityDomainsQueueTag(opts);
911
+ });
912
+ authorityDomainsCmd
913
+ .command('reject <proposal-id>')
914
+ .description('Reject an authority-domain tag proposal')
915
+ .option('--reason <reason>', 'Rejection reason')
916
+ .action(async (proposalId, opts) => {
917
+ await runAuthorityDomainsReject(proposalId, opts);
918
+ });
919
+ authorityDomainsCmd
920
+ .command('discard-pending')
921
+ .description('Reject all pending authority-domain tag proposals after a failed batch diagnosis')
922
+ .option('--reason <reason>', 'Discard reason')
923
+ .action(async (opts) => {
924
+ await runAuthorityDomainsDiscardPending(opts);
925
+ });
926
+ authorityDomainsCmd
927
+ .command('readiness')
928
+ .description('Show WP-354 authority-domain readiness, evidence gap, and next action')
929
+ .action(async () => {
930
+ await runAuthorityDomainsReadiness();
931
+ });
932
+ authorityDomainsCmd
933
+ .command('benchmark')
934
+ .description('Run and persist the WP-354 authority-domain benchmark')
935
+ .action(async () => {
936
+ await runAuthorityDomainsBenchmark();
937
+ });
938
+ authorityDomainsCmd
939
+ .command('activate-cutover')
940
+ .description('Activate graph retrieval after WP-354 evidence gates pass')
941
+ .option('--force-pre-production', 'Bypass the permanently-locked valueProof gate (requires --dec-id, DEC-864)')
942
+ .option('--dec-id <decId>', 'Chain DEC ID authorizing the bypass')
943
+ .action(async (opts) => {
944
+ await runAuthorityDomainsActivateCutover({ forcePreProduction: opts.forcePreProduction, decId: opts.decId });
945
+ });
946
+ authorityDomainsCmd
947
+ .command('deactivate-cutover')
948
+ .description('Deactivate the active WP-354 authorityDomain cutover for this workspace (DEC-864 rollback).')
949
+ .option('--clerk-user-id <clerkUserId>', 'Override the Clerk user ID for audit trail')
950
+ .action(async (opts) => {
951
+ await runAuthorityDomainsDeactivateCutover({ clerkUserId: opts.clerkUserId });
952
+ });
953
+ authorityDomainsCmd
954
+ .command('principle-distribution')
955
+ .description('Pre-merge gate: check governance category match rate for principles entries')
956
+ .action(async () => {
957
+ await runAuthorityDomainsPrincipleDistribution();
958
+ });
959
+ // --- Definitions diff command (WP-305 Slice 4) ---
960
+ const definitionsCmd = program
961
+ .command('definitions')
962
+ .description('Inspect and compare workspace definitions (WP-305)');
963
+ definitionsCmd
964
+ .command('diff [file]')
965
+ .description('Compare local dev-system-collections.json against server definitions (admin only)')
966
+ .action(async (file) => {
967
+ await runDefinitionsDiff({ file });
968
+ });
969
+ // --- Method commands (WP-329 S1: method visibility) ---
970
+ const methodCmd = program
971
+ .command('method')
972
+ .description('Inspect published methods (skills + rules) and their per-surface adapter status (WP-329)');
973
+ methodCmd
974
+ .command('ls')
975
+ .description('List all methods with version, published status, and adapter presence')
976
+ .action(async () => {
977
+ await runMethodList();
978
+ });
979
+ methodCmd
980
+ .command('show <name>')
981
+ .description('Show details for one method: frontmatter, Chain entry, and per-adapter fork status')
982
+ .action(async (name) => {
983
+ if (!name?.trim()) {
984
+ program.commands.find((c) => c.name() === 'method')?.help();
985
+ return;
986
+ }
987
+ await runMethodShow({ name: name.trim() });
988
+ });
989
+ methodCmd
990
+ .command('diff <name>')
991
+ .description('Show diff between local .productbrain/ source and last-published Chain version (WP-329 S2)')
992
+ .action(async (name) => {
993
+ if (!name?.trim()) {
994
+ program.commands.find((c) => c.name() === 'method')?.help();
995
+ return;
560
996
  }
997
+ await runMethodDiff({ name: name.trim() });
998
+ });
999
+ methodCmd
1000
+ .command('publish <name>')
1001
+ .description('Publish a local .productbrain/ method (skill or rule) to the Chain methods collection (WP-329 S3)')
1002
+ .option('--force', 'Publish even when local body matches the last-published version (override D4 no-op guard)')
1003
+ .action(async (name, opts) => {
1004
+ if (!name?.trim()) {
1005
+ program.commands.find((c) => c.name() === 'method')?.help();
1006
+ return;
1007
+ }
1008
+ await runMethodPublish({ name: name.trim(), force: opts.force });
1009
+ });
1010
+ // --- Profile commands (WP-302 Slice 2) ---
1011
+ const profileCmd = program
1012
+ .command('profile')
1013
+ .description('Manage workspace profiles (WP-302: multi-workspace support)');
1014
+ profileCmd
1015
+ .command('list')
1016
+ .description('List all profiles, mark active one')
1017
+ .action(async () => {
1018
+ await runProfileList();
1019
+ });
1020
+ profileCmd
1021
+ .command('create <name>')
1022
+ .description('Create a new profile with an API key')
1023
+ .requiredOption('--api-key <key>', `API key (${API_KEY_PREFIX}...)`)
1024
+ .option('--url <url>', 'Convex site URL (defaults to production)')
1025
+ .action(async (name, opts) => {
1026
+ await runProfileCreate({ name, apiKey: opts.apiKey, url: opts.url });
1027
+ });
1028
+ profileCmd
1029
+ .command('use <name>')
1030
+ .description('Switch profile: reconciles the repo pin + global by default. --local = repo pin only; --global = global only.')
1031
+ .option('--local', 'Write the profile pin only to .productbrain/config.local.json (repo-local, gitignored)')
1032
+ .option('--global', 'Switch only the global active profile (does not change a locally-pinned repo)')
1033
+ .action(async (name, opts) => {
1034
+ await runProfileUse({ name, local: opts.local, global: opts.global });
1035
+ });
1036
+ profileCmd
1037
+ .command('delete <name>')
1038
+ .description('Delete a profile (cannot delete active or last profile)')
1039
+ .action(async (name) => {
1040
+ await runProfileDelete({ name });
1041
+ });
1042
+ program
1043
+ .command('use <name>')
1044
+ .description('Switch the active workspace profile (alias for `pb profile use`).')
1045
+ .option('--local', 'Write the profile pin only to .productbrain/config.local.json (repo-local, gitignored)')
1046
+ .option('--global', 'Switch only the global active profile (does not change a locally-pinned repo)')
1047
+ .action(async (name, opts) => {
1048
+ await runProfileUse({ name, local: opts.local, global: opts.global });
1049
+ });
1050
+ // --- Glossary command (WP-302 Slice 4) ---
1051
+ program
1052
+ .command('glossary')
1053
+ .description('Show key Product Brain CLI terms and definitions')
1054
+ .action(() => {
1055
+ if (isJsonMode()) {
1056
+ process.stdout.write(JSON.stringify(GLOSSARY) + '\n');
1057
+ return;
1058
+ }
1059
+ const lines = [
1060
+ '',
1061
+ heading('Glossary'),
1062
+ '',
1063
+ formatGlossary(),
1064
+ '',
1065
+ ];
1066
+ process.stdout.write(lines.join('\n') + '\n');
1067
+ });
1068
+ // --- Usage command (WP-322 S4, FEAT-1011) ---
1069
+ program
1070
+ .command('usage')
1071
+ .description('Session and activity dashboard — 4-tab Ink TUI (WP-322)')
1072
+ .option('--json', 'Output machine-readable JSON (sessions, entries30d, activity array)')
1073
+ .action(async (opts) => {
1074
+ await runUsage({ json: opts.json });
1075
+ });
1076
+ // --- Proof-run command (WP-459: admin-proof bridge dogfood) ---
1077
+ program
1078
+ .command('proof-run <proof-name>')
1079
+ .description('Run an admin-only proof against the seeded preview via the proof bridge (WP-459)')
1080
+ .action(async (proofName) => {
1081
+ await runProofRun({ proofName: proofName.trim() });
1082
+ });
1083
+ // --- Admin command group (WP-312 S2, FEAT-969) ---
1084
+ program.addCommand(createAdminCommand());
1085
+ program.addCommand(createFeedbackCommand());
1086
+ program.addCommand(createConflictsCommand());
1087
+ program.addCommand(createOrganisationCommand());
1088
+ // --- Upgrade command (WP-322 S1: ambient update notification) ---
1089
+ program
1090
+ .command('upgrade')
1091
+ .description(`Upgrade pb CLI to the latest beta (${UPGRADE_COMMAND})`)
1092
+ .action(async () => {
1093
+ await runUpgrade({ currentVersion: cliPackageVersion.version });
561
1094
  });
562
- program.parse();
1095
+ // Parse with global error handler — all uncaught errors route through handleError
1096
+ program.parseAsync(process.argv).catch(handleError);
563
1097
  //# sourceMappingURL=index.js.map