@productbrain/cli 0.1.0-beta.1 → 0.1.0-beta.1000

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