@productbrain/cli 0.1.0-beta.30 → 0.1.0-beta.3015

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