@productbrain/cli 0.1.0-beta.95 → 0.1.0-beta.951

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 (419) hide show
  1. package/dist/__tests__/audit.test.js +5 -0
  2. package/dist/__tests__/audit.test.js.map +1 -1
  3. package/dist/__tests__/authority-domains.test.js +3 -0
  4. package/dist/__tests__/authority-domains.test.js.map +1 -1
  5. package/dist/__tests__/canonicalRefs.vocab.test.d.ts +2 -0
  6. package/dist/__tests__/canonicalRefs.vocab.test.d.ts.map +1 -0
  7. package/dist/__tests__/canonicalRefs.vocab.test.js +251 -0
  8. package/dist/__tests__/canonicalRefs.vocab.test.js.map +1 -0
  9. package/dist/__tests__/config.test.js +272 -2
  10. package/dist/__tests__/config.test.js.map +1 -1
  11. package/dist/__tests__/constants.test.js +6 -1
  12. package/dist/__tests__/constants.test.js.map +1 -1
  13. package/dist/__tests__/envelope-contract.test.js +29 -3
  14. package/dist/__tests__/envelope-contract.test.js.map +1 -1
  15. package/dist/__tests__/errors.test.js +1 -0
  16. package/dist/__tests__/errors.test.js.map +1 -1
  17. package/dist/__tests__/handshake-augment.test.d.ts +2 -0
  18. package/dist/__tests__/handshake-augment.test.d.ts.map +1 -0
  19. package/dist/__tests__/handshake-augment.test.js +423 -0
  20. package/dist/__tests__/handshake-augment.test.js.map +1 -0
  21. package/dist/__tests__/handshake-dormancy.test.d.ts +2 -0
  22. package/dist/__tests__/handshake-dormancy.test.d.ts.map +1 -0
  23. package/dist/__tests__/handshake-dormancy.test.js +207 -0
  24. package/dist/__tests__/handshake-dormancy.test.js.map +1 -0
  25. package/dist/__tests__/handshake-formatter.test.d.ts +2 -0
  26. package/dist/__tests__/handshake-formatter.test.d.ts.map +1 -0
  27. package/dist/__tests__/handshake-formatter.test.js +67 -0
  28. package/dist/__tests__/handshake-formatter.test.js.map +1 -0
  29. package/dist/__tests__/handshake-preview.test.js +566 -4
  30. package/dist/__tests__/handshake-preview.test.js.map +1 -1
  31. package/dist/__tests__/handshake.e2e.test.d.ts +2 -0
  32. package/dist/__tests__/handshake.e2e.test.d.ts.map +1 -0
  33. package/dist/__tests__/handshake.e2e.test.js +1252 -0
  34. package/dist/__tests__/handshake.e2e.test.js.map +1 -0
  35. package/dist/__tests__/handshake.test.js +611 -2
  36. package/dist/__tests__/handshake.test.js.map +1 -1
  37. package/dist/__tests__/manifest.test.js +118 -1
  38. package/dist/__tests__/manifest.test.js.map +1 -1
  39. package/dist/__tests__/onboarding-path-b.test.js +4 -4
  40. package/dist/__tests__/onboarding-path-b.test.js.map +1 -1
  41. package/dist/__tests__/orient.test.js +135 -8
  42. package/dist/__tests__/orient.test.js.map +1 -1
  43. package/dist/__tests__/perimeter.test.d.ts +2 -0
  44. package/dist/__tests__/perimeter.test.d.ts.map +1 -0
  45. package/dist/__tests__/perimeter.test.js +165 -0
  46. package/dist/__tests__/perimeter.test.js.map +1 -0
  47. package/dist/__tests__/personal-layer.test.d.ts +1 -2
  48. package/dist/__tests__/personal-layer.test.d.ts.map +1 -1
  49. package/dist/__tests__/personal-layer.test.js +12 -48
  50. package/dist/__tests__/personal-layer.test.js.map +1 -1
  51. package/dist/__tests__/profiles.test.js +122 -7
  52. package/dist/__tests__/profiles.test.js.map +1 -1
  53. package/dist/__tests__/promote.test.js +71 -2
  54. package/dist/__tests__/promote.test.js.map +1 -1
  55. package/dist/__tests__/session-state-machine.test.js +45 -1
  56. package/dist/__tests__/session-state-machine.test.js.map +1 -1
  57. package/dist/__tests__/session-switch.test.d.ts +2 -0
  58. package/dist/__tests__/session-switch.test.d.ts.map +1 -0
  59. package/dist/__tests__/session-switch.test.js +129 -0
  60. package/dist/__tests__/session-switch.test.js.map +1 -0
  61. package/dist/__tests__/setup-ingest.test.js +16 -0
  62. package/dist/__tests__/setup-ingest.test.js.map +1 -1
  63. package/dist/__tests__/skill-vocabulary.test.d.ts +21 -0
  64. package/dist/__tests__/skill-vocabulary.test.d.ts.map +1 -0
  65. package/dist/__tests__/skill-vocabulary.test.js +187 -0
  66. package/dist/__tests__/skill-vocabulary.test.js.map +1 -0
  67. package/dist/__tests__/update-check.test.d.ts +2 -0
  68. package/dist/__tests__/update-check.test.d.ts.map +1 -0
  69. package/dist/__tests__/update-check.test.js +56 -0
  70. package/dist/__tests__/update-check.test.js.map +1 -0
  71. package/dist/__tests__/upgrade-runner.test.d.ts +2 -0
  72. package/dist/__tests__/upgrade-runner.test.d.ts.map +1 -0
  73. package/dist/__tests__/upgrade-runner.test.js +42 -0
  74. package/dist/__tests__/upgrade-runner.test.js.map +1 -0
  75. package/dist/__tests__/vocabulary-leak.test.d.ts +39 -0
  76. package/dist/__tests__/vocabulary-leak.test.d.ts.map +1 -0
  77. package/dist/__tests__/vocabulary-leak.test.js +534 -0
  78. package/dist/__tests__/vocabulary-leak.test.js.map +1 -0
  79. package/dist/__tests__/workspace.test.js +32 -12
  80. package/dist/__tests__/workspace.test.js.map +1 -1
  81. package/dist/commands/__tests__/connect-handoff.test.d.ts +11 -0
  82. package/dist/commands/__tests__/connect-handoff.test.d.ts.map +1 -0
  83. package/dist/commands/__tests__/connect-handoff.test.js +111 -0
  84. package/dist/commands/__tests__/connect-handoff.test.js.map +1 -0
  85. package/dist/commands/__tests__/setup-detect-surfaces.test.d.ts +15 -0
  86. package/dist/commands/__tests__/setup-detect-surfaces.test.d.ts.map +1 -0
  87. package/dist/commands/__tests__/setup-detect-surfaces.test.js +149 -0
  88. package/dist/commands/__tests__/setup-detect-surfaces.test.js.map +1 -0
  89. package/dist/commands/__tests__/setup-state.test.d.ts +2 -0
  90. package/dist/commands/__tests__/setup-state.test.d.ts.map +1 -0
  91. package/dist/commands/__tests__/setup-state.test.js +194 -0
  92. package/dist/commands/__tests__/setup-state.test.js.map +1 -0
  93. package/dist/commands/admin/seed.d.ts +46 -2
  94. package/dist/commands/admin/seed.d.ts.map +1 -1
  95. package/dist/commands/admin/seed.js +475 -33
  96. package/dist/commands/admin/seed.js.map +1 -1
  97. package/dist/commands/admin/seed.test.d.ts +5 -0
  98. package/dist/commands/admin/seed.test.d.ts.map +1 -1
  99. package/dist/commands/admin/seed.test.js +67 -2
  100. package/dist/commands/admin/seed.test.js.map +1 -1
  101. package/dist/commands/admin/seedRegistryEntries.generated.d.ts +14 -0
  102. package/dist/commands/admin/seedRegistryEntries.generated.d.ts.map +1 -0
  103. package/dist/commands/admin/seedRegistryEntries.generated.js +117 -0
  104. package/dist/commands/admin/seedRegistryEntries.generated.js.map +1 -0
  105. package/dist/commands/admin/seedRegistryEntries.test.d.ts +11 -0
  106. package/dist/commands/admin/seedRegistryEntries.test.d.ts.map +1 -0
  107. package/dist/commands/admin/seedRegistryEntries.test.js +67 -0
  108. package/dist/commands/admin/seedRegistryEntries.test.js.map +1 -0
  109. package/dist/commands/audit.d.ts.map +1 -1
  110. package/dist/commands/audit.js +30 -3
  111. package/dist/commands/audit.js.map +1 -1
  112. package/dist/commands/authority-domains.d.ts +25 -1
  113. package/dist/commands/authority-domains.d.ts.map +1 -1
  114. package/dist/commands/authority-domains.js +51 -4
  115. package/dist/commands/authority-domains.js.map +1 -1
  116. package/dist/commands/capture.d.ts.map +1 -1
  117. package/dist/commands/capture.js +3 -2
  118. package/dist/commands/capture.js.map +1 -1
  119. package/dist/commands/codex-prep.d.ts +1 -0
  120. package/dist/commands/codex-prep.d.ts.map +1 -1
  121. package/dist/commands/codex-prep.js +10 -7
  122. package/dist/commands/codex-prep.js.map +1 -1
  123. package/dist/commands/connect-config.test.d.ts +2 -0
  124. package/dist/commands/connect-config.test.d.ts.map +1 -0
  125. package/dist/commands/connect-config.test.js +44 -0
  126. package/dist/commands/connect-config.test.js.map +1 -0
  127. package/dist/commands/connect-context.d.ts +45 -0
  128. package/dist/commands/connect-context.d.ts.map +1 -0
  129. package/dist/commands/connect-context.js +64 -0
  130. package/dist/commands/connect-context.js.map +1 -0
  131. package/dist/commands/connect-context.test.d.ts +2 -0
  132. package/dist/commands/connect-context.test.d.ts.map +1 -0
  133. package/dist/commands/connect-context.test.js +110 -0
  134. package/dist/commands/connect-context.test.js.map +1 -0
  135. package/dist/commands/connect-handoff.d.ts +51 -0
  136. package/dist/commands/connect-handoff.d.ts.map +1 -0
  137. package/dist/commands/connect-handoff.js +70 -0
  138. package/dist/commands/connect-handoff.js.map +1 -0
  139. package/dist/commands/connect-integration.test.js +29 -12
  140. package/dist/commands/connect-integration.test.js.map +1 -1
  141. package/dist/commands/connect-screens.d.ts +6 -4
  142. package/dist/commands/connect-screens.d.ts.map +1 -1
  143. package/dist/commands/connect-screens.js +30 -19
  144. package/dist/commands/connect-screens.js.map +1 -1
  145. package/dist/commands/connect.d.ts +21 -6
  146. package/dist/commands/connect.d.ts.map +1 -1
  147. package/dist/commands/connect.js +65 -58
  148. package/dist/commands/connect.js.map +1 -1
  149. package/dist/commands/connect.test.js +17 -1
  150. package/dist/commands/connect.test.js.map +1 -1
  151. package/dist/commands/doctor.d.ts.map +1 -1
  152. package/dist/commands/doctor.js +68 -3
  153. package/dist/commands/doctor.js.map +1 -1
  154. package/dist/commands/doctor.test.js +131 -0
  155. package/dist/commands/doctor.test.js.map +1 -1
  156. package/dist/commands/handshake.d.ts +194 -2
  157. package/dist/commands/handshake.d.ts.map +1 -1
  158. package/dist/commands/handshake.js +1563 -54
  159. package/dist/commands/handshake.js.map +1 -1
  160. package/dist/commands/method.d.ts.map +1 -1
  161. package/dist/commands/method.js +3 -0
  162. package/dist/commands/method.js.map +1 -1
  163. package/dist/commands/orient.d.ts +49 -2
  164. package/dist/commands/orient.d.ts.map +1 -1
  165. package/dist/commands/orient.js +86 -4
  166. package/dist/commands/orient.js.map +1 -1
  167. package/dist/commands/profile.d.ts +1 -14
  168. package/dist/commands/profile.d.ts.map +1 -1
  169. package/dist/commands/profile.js +89 -72
  170. package/dist/commands/profile.js.map +1 -1
  171. package/dist/commands/promote.d.ts.map +1 -1
  172. package/dist/commands/promote.js +25 -2
  173. package/dist/commands/promote.js.map +1 -1
  174. package/dist/commands/relate.d.ts.map +1 -1
  175. package/dist/commands/relate.js +13 -0
  176. package/dist/commands/relate.js.map +1 -1
  177. package/dist/commands/session.d.ts.map +1 -1
  178. package/dist/commands/session.js +51 -14
  179. package/dist/commands/session.js.map +1 -1
  180. package/dist/commands/setup-audit.d.ts +59 -0
  181. package/dist/commands/setup-audit.d.ts.map +1 -0
  182. package/dist/commands/setup-audit.js +250 -0
  183. package/dist/commands/setup-audit.js.map +1 -0
  184. package/dist/commands/setup-detect-surfaces.d.ts +38 -0
  185. package/dist/commands/setup-detect-surfaces.d.ts.map +1 -0
  186. package/dist/commands/setup-detect-surfaces.js +76 -0
  187. package/dist/commands/setup-detect-surfaces.js.map +1 -0
  188. package/dist/commands/setup-ingest.d.ts.map +1 -1
  189. package/dist/commands/setup-ingest.js +4 -2
  190. package/dist/commands/setup-ingest.js.map +1 -1
  191. package/dist/commands/setup-state.d.ts +42 -0
  192. package/dist/commands/setup-state.d.ts.map +1 -0
  193. package/dist/commands/setup-state.js +93 -0
  194. package/dist/commands/setup-state.js.map +1 -0
  195. package/dist/commands/setup.d.ts +17 -9
  196. package/dist/commands/setup.d.ts.map +1 -1
  197. package/dist/commands/setup.js +52 -131
  198. package/dist/commands/setup.js.map +1 -1
  199. package/dist/commands/upgrade.d.ts +5 -0
  200. package/dist/commands/upgrade.d.ts.map +1 -0
  201. package/dist/commands/upgrade.js +89 -0
  202. package/dist/commands/upgrade.js.map +1 -0
  203. package/dist/commands/whoami.d.ts +12 -0
  204. package/dist/commands/whoami.d.ts.map +1 -0
  205. package/dist/commands/whoami.js +70 -0
  206. package/dist/commands/whoami.js.map +1 -0
  207. package/dist/commands/whoami.test.d.ts +2 -0
  208. package/dist/commands/whoami.test.d.ts.map +1 -0
  209. package/dist/commands/whoami.test.js +50 -0
  210. package/dist/commands/whoami.test.js.map +1 -0
  211. package/dist/commands/workspace.d.ts +23 -2
  212. package/dist/commands/workspace.d.ts.map +1 -1
  213. package/dist/commands/workspace.js +2 -2
  214. package/dist/commands/workspace.js.map +1 -1
  215. package/dist/formatters/__tests__/orient-provenance.test.d.ts +7 -0
  216. package/dist/formatters/__tests__/orient-provenance.test.d.ts.map +1 -0
  217. package/dist/formatters/__tests__/orient-provenance.test.js +197 -0
  218. package/dist/formatters/__tests__/orient-provenance.test.js.map +1 -0
  219. package/dist/formatters/audit.d.ts +6 -0
  220. package/dist/formatters/audit.d.ts.map +1 -1
  221. package/dist/formatters/audit.js.map +1 -1
  222. package/dist/formatters/entry.d.ts +6 -0
  223. package/dist/formatters/entry.d.ts.map +1 -1
  224. package/dist/formatters/entry.js +30 -5
  225. package/dist/formatters/entry.js.map +1 -1
  226. package/dist/formatters/handshake.d.ts +19 -3
  227. package/dist/formatters/handshake.d.ts.map +1 -1
  228. package/dist/formatters/handshake.js +48 -13
  229. package/dist/formatters/handshake.js.map +1 -1
  230. package/dist/formatters/orient.d.ts +65 -4
  231. package/dist/formatters/orient.d.ts.map +1 -1
  232. package/dist/formatters/orient.js +86 -17
  233. package/dist/formatters/orient.js.map +1 -1
  234. package/dist/formatters/session.js +1 -1
  235. package/dist/formatters/session.js.map +1 -1
  236. package/dist/generators/adapters.js +2 -2
  237. package/dist/generators/boundary-manifest.d.ts +29 -0
  238. package/dist/generators/boundary-manifest.d.ts.map +1 -0
  239. package/dist/generators/boundary-manifest.js +183 -0
  240. package/dist/generators/boundary-manifest.js.map +1 -0
  241. package/dist/generators/boundary-manifest.test.d.ts +2 -0
  242. package/dist/generators/boundary-manifest.test.d.ts.map +1 -0
  243. package/dist/generators/boundary-manifest.test.js +91 -0
  244. package/dist/generators/boundary-manifest.test.js.map +1 -0
  245. package/dist/generators/context-md.js +6 -6
  246. package/dist/generators/context-md.js.map +1 -1
  247. package/dist/generators/manifest.d.ts +78 -0
  248. package/dist/generators/manifest.d.ts.map +1 -1
  249. package/dist/generators/manifest.js +125 -14
  250. package/dist/generators/manifest.js.map +1 -1
  251. package/dist/generators/portable-knowledge.d.ts +6 -12
  252. package/dist/generators/portable-knowledge.d.ts.map +1 -1
  253. package/dist/generators/portable-knowledge.js +2 -19
  254. package/dist/generators/portable-knowledge.js.map +1 -1
  255. package/dist/generators/region-projections.d.ts +18 -0
  256. package/dist/generators/region-projections.d.ts.map +1 -0
  257. package/dist/generators/region-projections.js +49 -0
  258. package/dist/generators/region-projections.js.map +1 -0
  259. package/dist/generators/region-projections.test.d.ts +2 -0
  260. package/dist/generators/region-projections.test.d.ts.map +1 -0
  261. package/dist/generators/region-projections.test.js +63 -0
  262. package/dist/generators/region-projections.test.js.map +1 -0
  263. package/dist/generators/region.d.ts +24 -0
  264. package/dist/generators/region.d.ts.map +1 -0
  265. package/dist/generators/region.js +87 -0
  266. package/dist/generators/region.js.map +1 -0
  267. package/dist/generators/region.test.d.ts +2 -0
  268. package/dist/generators/region.test.d.ts.map +1 -0
  269. package/dist/generators/region.test.js +126 -0
  270. package/dist/generators/region.test.js.map +1 -0
  271. package/dist/generators/surface-profiles.d.ts +1 -2
  272. package/dist/generators/surface-profiles.d.ts.map +1 -1
  273. package/dist/generators/surface-profiles.js.map +1 -1
  274. package/dist/index.js +142 -27
  275. package/dist/index.js.map +1 -1
  276. package/dist/lib/activation.d.ts.map +1 -1
  277. package/dist/lib/activation.js +3 -3
  278. package/dist/lib/activation.js.map +1 -1
  279. package/dist/lib/activation.test.js +3 -3
  280. package/dist/lib/activation.test.js.map +1 -1
  281. package/dist/lib/canonicalRefs.d.ts +98 -0
  282. package/dist/lib/canonicalRefs.d.ts.map +1 -1
  283. package/dist/lib/canonicalRefs.js +67 -0
  284. package/dist/lib/canonicalRefs.js.map +1 -1
  285. package/dist/lib/client.d.ts.map +1 -1
  286. package/dist/lib/client.js +14 -4
  287. package/dist/lib/client.js.map +1 -1
  288. package/dist/lib/config.d.ts +70 -4
  289. package/dist/lib/config.d.ts.map +1 -1
  290. package/dist/lib/config.js +151 -11
  291. package/dist/lib/config.js.map +1 -1
  292. package/dist/lib/connectKeyLabel.d.ts +9 -0
  293. package/dist/lib/connectKeyLabel.d.ts.map +1 -0
  294. package/dist/lib/connectKeyLabel.js +12 -0
  295. package/dist/lib/connectKeyLabel.js.map +1 -0
  296. package/dist/lib/constants.d.ts +2 -0
  297. package/dist/lib/constants.d.ts.map +1 -1
  298. package/dist/lib/constants.js +2 -0
  299. package/dist/lib/constants.js.map +1 -1
  300. package/dist/lib/errors.d.ts +3 -0
  301. package/dist/lib/errors.d.ts.map +1 -1
  302. package/dist/lib/errors.js +3 -0
  303. package/dist/lib/errors.js.map +1 -1
  304. package/dist/lib/normalizeMaterializedFilename.d.ts +28 -0
  305. package/dist/lib/normalizeMaterializedFilename.d.ts.map +1 -0
  306. package/dist/lib/normalizeMaterializedFilename.js +56 -0
  307. package/dist/lib/normalizeMaterializedFilename.js.map +1 -0
  308. package/dist/lib/normalizeMaterializedFilename.test.d.ts +16 -0
  309. package/dist/lib/normalizeMaterializedFilename.test.d.ts.map +1 -0
  310. package/dist/lib/normalizeMaterializedFilename.test.js +90 -0
  311. package/dist/lib/normalizeMaterializedFilename.test.js.map +1 -0
  312. package/dist/lib/onboarding-path-b.d.ts.map +1 -1
  313. package/dist/lib/onboarding-path-b.js +0 -1
  314. package/dist/lib/onboarding-path-b.js.map +1 -1
  315. package/dist/lib/onboarding-shared.d.ts +0 -1
  316. package/dist/lib/onboarding-shared.d.ts.map +1 -1
  317. package/dist/lib/onboarding-shared.js +1 -17
  318. package/dist/lib/onboarding-shared.js.map +1 -1
  319. package/dist/lib/profiles.d.ts +3 -1
  320. package/dist/lib/profiles.d.ts.map +1 -1
  321. package/dist/lib/profiles.js +9 -6
  322. package/dist/lib/profiles.js.map +1 -1
  323. package/dist/lib/session.d.ts +10 -0
  324. package/dist/lib/session.d.ts.map +1 -1
  325. package/dist/lib/session.js +14 -0
  326. package/dist/lib/session.js.map +1 -1
  327. package/dist/lib/update-check.d.ts +20 -0
  328. package/dist/lib/update-check.d.ts.map +1 -1
  329. package/dist/lib/update-check.js +122 -21
  330. package/dist/lib/update-check.js.map +1 -1
  331. package/dist/lib/upgrade-runner.d.ts +21 -0
  332. package/dist/lib/upgrade-runner.d.ts.map +1 -0
  333. package/dist/lib/upgrade-runner.js +109 -0
  334. package/dist/lib/upgrade-runner.js.map +1 -0
  335. package/dist/lib/workspaceVocabCache.d.ts +60 -0
  336. package/dist/lib/workspaceVocabCache.d.ts.map +1 -0
  337. package/dist/lib/workspaceVocabCache.js +98 -0
  338. package/dist/lib/workspaceVocabCache.js.map +1 -0
  339. package/dist/setup/__tests__/coach-traces.test.d.ts +2 -0
  340. package/dist/setup/__tests__/coach-traces.test.d.ts.map +1 -0
  341. package/dist/setup/__tests__/coach-traces.test.js +189 -0
  342. package/dist/setup/__tests__/coach-traces.test.js.map +1 -0
  343. package/dist/setup/__tests__/setup-commands.test.d.ts +2 -0
  344. package/dist/setup/__tests__/setup-commands.test.d.ts.map +1 -0
  345. package/dist/setup/__tests__/setup-commands.test.js +177 -0
  346. package/dist/setup/__tests__/setup-commands.test.js.map +1 -0
  347. package/dist/setup/__tests__/state-machine.test.d.ts +2 -0
  348. package/dist/setup/__tests__/state-machine.test.d.ts.map +1 -0
  349. package/dist/setup/__tests__/state-machine.test.js +341 -0
  350. package/dist/setup/__tests__/state-machine.test.js.map +1 -0
  351. package/dist/setup/detect-surfaces.d.ts +21 -0
  352. package/dist/setup/detect-surfaces.d.ts.map +1 -0
  353. package/dist/setup/detect-surfaces.js +39 -0
  354. package/dist/setup/detect-surfaces.js.map +1 -0
  355. package/dist/setup/manifest-writer.d.ts +17 -0
  356. package/dist/setup/manifest-writer.d.ts.map +1 -0
  357. package/dist/setup/manifest-writer.js +153 -0
  358. package/dist/setup/manifest-writer.js.map +1 -0
  359. package/dist/setup/perimeter.d.ts +72 -0
  360. package/dist/setup/perimeter.d.ts.map +1 -0
  361. package/dist/setup/perimeter.js +128 -0
  362. package/dist/setup/perimeter.js.map +1 -0
  363. package/dist/setup/state-machine.d.ts +67 -0
  364. package/dist/setup/state-machine.d.ts.map +1 -0
  365. package/dist/setup/state-machine.js +124 -0
  366. package/dist/setup/state-machine.js.map +1 -0
  367. package/dist/surfaces/__tests__/adapter.test.d.ts +2 -0
  368. package/dist/surfaces/__tests__/adapter.test.d.ts.map +1 -0
  369. package/dist/surfaces/__tests__/adapter.test.js +90 -0
  370. package/dist/surfaces/__tests__/adapter.test.js.map +1 -0
  371. package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts +2 -0
  372. package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts.map +1 -0
  373. package/dist/surfaces/__tests__/pb-setup-passthrough.test.js +132 -0
  374. package/dist/surfaces/__tests__/pb-setup-passthrough.test.js.map +1 -0
  375. package/dist/surfaces/__tests__/telemetry.test.d.ts +2 -0
  376. package/dist/surfaces/__tests__/telemetry.test.d.ts.map +1 -0
  377. package/dist/surfaces/__tests__/telemetry.test.js +55 -0
  378. package/dist/surfaces/__tests__/telemetry.test.js.map +1 -0
  379. package/dist/surfaces/adapter.d.ts +70 -0
  380. package/dist/surfaces/adapter.d.ts.map +1 -0
  381. package/dist/surfaces/adapter.js +2 -0
  382. package/dist/surfaces/adapter.js.map +1 -0
  383. package/dist/surfaces/adapters/claude.d.ts +3 -0
  384. package/dist/surfaces/adapters/claude.d.ts.map +1 -0
  385. package/dist/surfaces/adapters/claude.js +67 -0
  386. package/dist/surfaces/adapters/claude.js.map +1 -0
  387. package/dist/surfaces/adapters/codex.d.ts +3 -0
  388. package/dist/surfaces/adapters/codex.d.ts.map +1 -0
  389. package/dist/surfaces/adapters/codex.js +61 -0
  390. package/dist/surfaces/adapters/codex.js.map +1 -0
  391. package/dist/surfaces/adapters/copilot.d.ts +3 -0
  392. package/dist/surfaces/adapters/copilot.d.ts.map +1 -0
  393. package/dist/surfaces/adapters/copilot.js +59 -0
  394. package/dist/surfaces/adapters/copilot.js.map +1 -0
  395. package/dist/surfaces/adapters/cursor.d.ts +3 -0
  396. package/dist/surfaces/adapters/cursor.d.ts.map +1 -0
  397. package/dist/surfaces/adapters/cursor.js +78 -0
  398. package/dist/surfaces/adapters/cursor.js.map +1 -0
  399. package/dist/surfaces/registry.d.ts +58 -2
  400. package/dist/surfaces/registry.d.ts.map +1 -1
  401. package/dist/surfaces/registry.js +82 -7
  402. package/dist/surfaces/registry.js.map +1 -1
  403. package/dist/surfaces/telemetry.d.ts +17 -0
  404. package/dist/surfaces/telemetry.d.ts.map +1 -0
  405. package/dist/surfaces/telemetry.js +31 -0
  406. package/dist/surfaces/telemetry.js.map +1 -0
  407. package/package.json +3 -1
  408. package/dist/__tests__/setup.test.d.ts +0 -2
  409. package/dist/__tests__/setup.test.d.ts.map +0 -1
  410. package/dist/__tests__/setup.test.js +0 -141
  411. package/dist/__tests__/setup.test.js.map +0 -1
  412. package/dist/generators/__tests__/surface-profiles.test.d.ts +0 -2
  413. package/dist/generators/__tests__/surface-profiles.test.d.ts.map +0 -1
  414. package/dist/generators/__tests__/surface-profiles.test.js +0 -89
  415. package/dist/generators/__tests__/surface-profiles.test.js.map +0 -1
  416. package/dist/lib/onboarding-phases.d.ts +0 -9
  417. package/dist/lib/onboarding-phases.d.ts.map +0 -1
  418. package/dist/lib/onboarding-phases.js +0 -120
  419. package/dist/lib/onboarding-phases.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Region mechanism for non-destructive augmentation of user-owned adapter files (TEN-2155).
3
+ * Pure, surface-agnostic: sentinels, classification, EOL detection, and the splice transforms.
4
+ * Per-surface CONTENT lives in region-projections.ts; the write loop wires them together.
5
+ *
6
+ * Invariant (asserted by region.test.ts): the sentinels are disjoint from the whole-file
7
+ * MARKER ('auto-generated by pb handshake'), so an augmented file is never classified pb-managed
8
+ * and never whole-file-overwritten.
9
+ */
10
+ import { MARKER } from './adapters.js';
11
+ export const REGION_START = '<!-- pb:region:start — managed by `pb handshake`; edit only OUTSIDE this block -->';
12
+ export const REGION_END = '<!-- pb:region:end -->';
13
+ // Opt-out sentinel (TEN-2155): a file carrying this declares "pb handshake must NOT augment me".
14
+ // Generic + consumer-usable — and the mechanism by which this repo's own committed CLAUDE.md/AGENTS.md
15
+ // (the static constitution the constitution forbids handshake from writing) decline a PB region.
16
+ export const REGION_OPT_OUT = '<!-- pb:no-augment -->';
17
+ // Compile-time guard against a future MARKER rename silently colliding (belt-and-suspenders to the test).
18
+ if (REGION_START.includes(MARKER) || REGION_END.includes(MARKER)) {
19
+ throw new Error('pb:region sentinels must not contain the whole-file MARKER substring');
20
+ }
21
+ // The opt-out sentinel must stay distinguishable from MARKER + the region sentinels, else a
22
+ // region-present or pb-managed file could misclassify as opt-out (and silently stop being managed).
23
+ if (REGION_OPT_OUT.includes(MARKER) ||
24
+ REGION_START.includes(REGION_OPT_OUT) ||
25
+ REGION_END.includes(REGION_OPT_OUT)) {
26
+ throw new Error('pb:no-augment sentinel must be disjoint from the MARKER and region sentinels');
27
+ }
28
+ // Precondition: needle.length > 0 (callers are internal, always non-empty sentinels). An empty needle would not terminate.
29
+ function countOccurrences(haystack, needle) {
30
+ let count = 0;
31
+ let i = 0;
32
+ for (;;) {
33
+ const idx = haystack.indexOf(needle, i);
34
+ if (idx === -1)
35
+ break;
36
+ count += 1;
37
+ i = idx + needle.length;
38
+ }
39
+ return count;
40
+ }
41
+ /**
42
+ * Classify an EXISTING adapter file's content. Caller decides routing.
43
+ * Precedence: MARKER (whole-file pb-managed) → opt-out (user declined augmentation) → region balance.
44
+ */
45
+ export function classifyAdapterFile(content) {
46
+ if (content.includes(MARKER))
47
+ return 'pb-managed';
48
+ if (content.includes(REGION_OPT_OUT))
49
+ return 'opt-out';
50
+ const starts = countOccurrences(content, REGION_START);
51
+ const ends = countOccurrences(content, REGION_END);
52
+ if (starts === 0 && ends === 0)
53
+ return 'augmentable';
54
+ if (starts === 1 && ends === 1 && content.indexOf(REGION_START) < content.indexOf(REGION_END)) {
55
+ return 'region-present';
56
+ }
57
+ return 'malformed';
58
+ }
59
+ /** Dominant EOL of the file. LF for empty / no-newline / ties. */
60
+ export function detectEol(content) {
61
+ const crlf = (content.match(/\r\n/g) ?? []).length;
62
+ const loneLf = (content.match(/(?<!\r)\n/g) ?? []).length;
63
+ return crlf > loneLf ? '\r\n' : '\n';
64
+ }
65
+ /**
66
+ * Append a region to a file that has none. Never removes meaningful user content
67
+ * (a whitespace-only file is treated as empty) — only adds a blank-line separator
68
+ * when one is not already present. `region` includes both sentinels.
69
+ */
70
+ export function spliceAppend(disk, region, eol) {
71
+ // The region body's EOL is the caller's responsibility (region-projections renders it in `eol`); this function only controls the separator + trailing newline.
72
+ if (disk.trim() === '')
73
+ return region + eol;
74
+ const sep = disk.endsWith(eol + eol) ? '' : disk.endsWith(eol) ? eol : eol + eol;
75
+ return disk + sep + region + eol;
76
+ }
77
+ /**
78
+ * Replace an existing region body in place. Bytes before REGION_START and after REGION_END
79
+ * are preserved verbatim. Caller guarantees `disk` classifies as 'region-present'.
80
+ * `region` includes both sentinels.
81
+ */
82
+ export function spliceReplace(disk, region) {
83
+ const start = disk.indexOf(REGION_START);
84
+ const end = disk.indexOf(REGION_END) + REGION_END.length;
85
+ return disk.slice(0, start) + region + disk.slice(end);
86
+ }
87
+ //# sourceMappingURL=region.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"region.js","sourceRoot":"","sources":["../../src/generators/region.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,CAAC,MAAM,YAAY,GAAG,oFAAoF,CAAC;AACjH,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAEnD,iGAAiG;AACjG,uGAAuG;AACvG,iGAAiG;AACjG,MAAM,CAAC,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAEvD,0GAA0G;AAC1G,IAAI,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;IACjE,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;AAC1F,CAAC;AACD,4FA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+ export {};
2
+ //# sourceMappingURL=region.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"region.test.d.ts","sourceRoot":"","sources":["../../src/generators/region.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,126 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { describe, it, expect } from 'vitest';
5
+ import { MARKER } from './adapters.js';
6
+ import { REGION_START, REGION_END, REGION_OPT_OUT, classifyAdapterFile, detectEol, spliceAppend, spliceReplace, } from './region.js';
7
+ describe('region sentinels', () => {
8
+ it('are disjoint from the whole-file MARKER (both directions)', () => {
9
+ expect(REGION_START.includes(MARKER)).toBe(false);
10
+ expect(REGION_END.includes(MARKER)).toBe(false);
11
+ expect(MARKER.includes(REGION_START)).toBe(false);
12
+ expect(MARKER.includes(REGION_END)).toBe(false);
13
+ });
14
+ it('opt-out sentinel is disjoint from MARKER and the region sentinels', () => {
15
+ expect(REGION_OPT_OUT.includes(MARKER)).toBe(false);
16
+ expect(REGION_START.includes(REGION_OPT_OUT)).toBe(false);
17
+ expect(REGION_END.includes(REGION_OPT_OUT)).toBe(false);
18
+ });
19
+ });
20
+ describe('detectEol', () => {
21
+ it('returns LF for empty / no-newline / LF-dominant', () => {
22
+ expect(detectEol('')).toBe('\n');
23
+ expect(detectEol('one line')).toBe('\n');
24
+ expect(detectEol('a\nb\nc\n')).toBe('\n');
25
+ });
26
+ it('returns CRLF when CRLF-dominant', () => {
27
+ expect(detectEol('a\r\nb\r\nc\r\n')).toBe('\r\n');
28
+ });
29
+ it('returns LF when CRLF and lone-LF counts tie (tie-breaks to LF)', () => {
30
+ expect(detectEol('a\r\nb\n')).toBe('\n');
31
+ });
32
+ });
33
+ describe('classifyAdapterFile', () => {
34
+ const region = `${REGION_START}\n## x\n${REGION_END}`;
35
+ it('pb-managed when MARKER present (even with sentinel-looking text)', () => {
36
+ expect(classifyAdapterFile(`<!-- ${MARKER} -->\n${region}`)).toBe('pb-managed');
37
+ });
38
+ it('augmentable when no MARKER and no sentinels', () => {
39
+ expect(classifyAdapterFile('# my file\n')).toBe('augmentable');
40
+ });
41
+ it('region-present for exactly one balanced pair', () => {
42
+ expect(classifyAdapterFile(`# mine\n\n${region}\n`)).toBe('region-present');
43
+ });
44
+ it('malformed: start without end', () => {
45
+ expect(classifyAdapterFile(`# mine\n${REGION_START}\n`)).toBe('malformed');
46
+ });
47
+ it('malformed: end without start', () => {
48
+ expect(classifyAdapterFile(`# mine\n${REGION_END}\n`)).toBe('malformed');
49
+ });
50
+ it('malformed: duplicate starts', () => {
51
+ expect(classifyAdapterFile(`${REGION_START}\n${REGION_START}\n${REGION_END}`)).toBe('malformed');
52
+ });
53
+ it('malformed: duplicate ends', () => {
54
+ expect(classifyAdapterFile(`${REGION_START}\n${REGION_END}\n${REGION_END}`)).toBe('malformed');
55
+ });
56
+ it('malformed: end before start', () => {
57
+ expect(classifyAdapterFile(`${REGION_END}\nx\n${REGION_START}`)).toBe('malformed');
58
+ });
59
+ it('opt-out when the pb:no-augment sentinel is present (no MARKER)', () => {
60
+ expect(classifyAdapterFile(`# constitution\n${REGION_OPT_OUT}\n`)).toBe('opt-out');
61
+ });
62
+ it('opt-out wins over an existing region (user froze the file)', () => {
63
+ expect(classifyAdapterFile(`${REGION_OPT_OUT}\n${region}`)).toBe('opt-out');
64
+ });
65
+ it('opt-out wins over malformed sentinels (decline beats refusal)', () => {
66
+ expect(classifyAdapterFile(`${REGION_OPT_OUT}\n${REGION_START}\n(no end)\n`)).toBe('opt-out');
67
+ });
68
+ it('MARKER still wins over opt-out (whole-file pb-managed precedence)', () => {
69
+ expect(classifyAdapterFile(`<!-- ${MARKER} -->\n${REGION_OPT_OUT}\n`)).toBe('pb-managed');
70
+ });
71
+ });
72
+ describe('spliceAppend (never strips user bytes)', () => {
73
+ const region = `${REGION_START}\n## x\n${REGION_END}`;
74
+ it('empty/whitespace-only → region only (identical for both)', () => {
75
+ expect(spliceAppend('', region, '\n')).toBe(region + '\n');
76
+ expect(spliceAppend(' \n\n', region, '\n')).toBe(region + '\n');
77
+ });
78
+ it('no trailing newline → adds blank-line separator', () => {
79
+ expect(spliceAppend('last line', region, '\n')).toBe(`last line\n\n${region}\n`);
80
+ });
81
+ it('one trailing newline → one more for a blank line', () => {
82
+ expect(spliceAppend('body\n', region, '\n')).toBe(`body\n\n${region}\n`);
83
+ });
84
+ it('two+ trailing newlines → preserved verbatim, no extra separator', () => {
85
+ expect(spliceAppend('body\n\n\n', region, '\n')).toBe(`body\n\n\n${region}\n`);
86
+ });
87
+ it('exactly two trailing newlines → no extra separator', () => {
88
+ expect(spliceAppend('body\n\n', region, '\n')).toBe(`body\n\n${region}\n`);
89
+ });
90
+ it('CRLF file → region rendered + separated with CRLF; user bytes preserved', () => {
91
+ expect(spliceAppend('a\r\n', region, '\r\n')).toBe(`a\r\n\r\n${region}\r\n`);
92
+ });
93
+ });
94
+ describe('spliceReplace (only between sentinels; surrounding bytes verbatim)', () => {
95
+ it('replaces region body, preserves prefix + suffix byte-for-byte', () => {
96
+ const before = '# mine\nkeep me\n\n';
97
+ const after = '\nmore user text\n';
98
+ const oldRegion = `${REGION_START}\nOLD\n${REGION_END}`;
99
+ const newRegion = `${REGION_START}\nNEW\n${REGION_END}`;
100
+ const disk = before + oldRegion + after;
101
+ expect(spliceReplace(disk, newRegion)).toBe(before + newRegion + after);
102
+ });
103
+ });
104
+ describe('append → replace convergence (idempotency)', () => {
105
+ it('appending once then replacing with identical region is byte-stable', () => {
106
+ const region = `${REGION_START}\n## x\n${REGION_END}`;
107
+ const appended = spliceAppend('# mine\nbody\n', region, '\n');
108
+ expect(classifyAdapterFile(appended)).toBe('region-present');
109
+ expect(spliceReplace(appended, region)).toBe(appended);
110
+ });
111
+ });
112
+ // Reads the ACTUAL committed constitution files (not a copy of the sentinel string), so it catches
113
+ // drift in EITHER REGION_OPT_OUT or the files themselves — the exact bug class where a paraphrased
114
+ // comment was not a substring of the literal sentinel and the files would have been spliced anyway.
115
+ describe('committed constitution declines augmentation (TEN-2155 governance regression)', () => {
116
+ // This test lives at <repo>/packages/cli/src/generators — walk up 4 to the repo root.
117
+ const repoRoot = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..', '..');
118
+ for (const file of ['CLAUDE.md', 'AGENTS.md']) {
119
+ it(`${file} carries the literal opt-out sentinel and classifies 'opt-out'`, () => {
120
+ const content = readFileSync(join(repoRoot, file), 'utf8');
121
+ expect(content.includes(REGION_OPT_OUT), `${file} must contain the literal sentinel ${JSON.stringify(REGION_OPT_OUT)}`).toBe(true);
122
+ expect(classifyAdapterFile(content), `${file} must classify 'opt-out' so handshake never splices it`).toBe('opt-out');
123
+ });
124
+ }
125
+ });
126
+ //# sourceMappingURL=region.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"region.test.js","sourceRoot":"","sources":["../../src/generators/region.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EACL,YAAY,EAAE,UAAU,EAAE,cAAc,EACxC,mBAAmB,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,GAC5D,MAAM,aAAa,CAAC;AAErB,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC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AI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACvF,KAAK,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC;QAC9C,EAAE,CAAC,GAAG,IAAI,gEAAgE,EAAE,GAAG,EAAE;YAC/E,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;YAC3D,MAAM,CACJ,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,EAChC,GAAG,IAAI,sCAAsC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAC9E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACb,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,wDAAwD,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -4,8 +4,7 @@
4
4
  * BET-270 Slice 0: type system + registry only. Generators accept but do not yet use the profile.
5
5
  * BET-270 Slice 4: pluggable surface registration + fallback.
6
6
  */
7
- import type { TargetName } from './portable-knowledge.js';
8
- export type { TargetName };
7
+ export type TargetName = 'cursor' | 'claude' | 'copilot' | 'codex';
9
8
  export interface SurfaceProfile {
10
9
  /** How the agent executes work in this surface. */
11
10
  executionModel: 'batch' | 'interactive' | 'passive';
@@ -1 +1 @@
1
- {"version":3,"file":"surface-profiles.d.ts","sourceRoot":"","sources":["../../src/generators/surface-profiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,YAAY,EAAE,UAAU,EAAE,CAAC;AAI3B,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,cAAc,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAAC;IACpD,8EAA8E;IAC9E,MAAM,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AM,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,cAAc,CA6B/D,CAAC;AAKF;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAID;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,cAAc,CAWlF;AAID;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAY3E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAKpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"surface-profiles.js","sourceRoot":"","sources":["../../src/generators/surface-profiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH,0EAA0E;AAE1E,MAAM,CAAC,MAAM,gBAAgB,GAAuC;IAClE,MAAM,EAAE;QACN,cAAc,EAAE,aAAa;QAC7B,MAAM,EAAE,YAAY;QACpB,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,cAAc;KAC9B;IACD,MAAM,EAAE;QACN,cAAc,EAAE,aAAa;QAC7B,MAAM,EAAE,YAAY;QACpB,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,cAAc;KAC9B;IACD,KAAK,EAAE;QACL,cAAc,EAAE,OAAO;QACvB,MAAM,EAAE,YAAY;QACpB,YAAY,EAAE,YAAY;QAC1B,WAAW,EAAE,MAAM;QACnB,aAAa,EAAE,QAAQ;KACxB;IACD,OAAO,EAAE;QACP,cAAc,EAAE,SAAS;QACzB,MAAM,EAAE,aAAa;QACrB,YAAY,EAAE,WAAW;QACzB,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,QAAQ;KACxB;CACF,CAAC;AAEF,iGAAiG;AACjG,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,UAAU,qBAAqB;IACnC,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;AACxE,CAAC;AAED,yEAAyE;AAEzE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAc;IAClD,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAoB,CAAC,CAAC;IACrD,OAAO,KAAK,IAAI,gBAAgB,CAAC,KAAK,CAAC;AACzC,CAAC"}
1
+ {"version":3,"file":"surface-profiles.js","sourceRoot":"","sources":["../../src/generators/surface-profiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmBH,0EAA0E;AAE1E,MAAM,CAAC,MAAM,gBAAgB,GAAuC;IAClE,MAAM,EAAE;QACN,cAAc,EAAE,aAAa;QAC7B,MAAM,EAAE,YAAY;QACpB,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,cAAc;KAC9B;IACD,MAAM,EAAE;QACN,cAAc,EAAE,aAAa;QAC7B,MAAM,EAAE,YAAY;QACpB,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,cAAc;KAC9B;IACD,KAAK,EAAE;QACL,cAAc,EAAE,OAAO;QACvB,MAAM,EAAE,YAAY;QACpB,YAAY,EAAE,YAAY;QAC1B,WAAW,EAAE,MAAM;QACnB,aAAa,EAAE,QAAQ;KACxB;IACD,OAAO,EAAE;QACP,cAAc,EAAE,SAAS;QACzB,MAAM,EAAE,aAAa;QACrB,YAAY,EAAE,WAAW;QACzB,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,QAAQ;KACxB;CACF,CAAC;AAEF,iGAAiG;AACjG,MAAM,gBAAgB,GAAG,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,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;AACxE,CAAC;AAED,yEAAyE;AAEzE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAc;IAClD,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAoB,CAAC,CAAC;IACrD,OAAO,KAAK,IAAI,gBAAgB,CAAC,KAAK,CAAC;AACzC,CAAC"}
package/dist/index.js CHANGED
@@ -17,6 +17,9 @@ import { runGet, runGetMany } from './commands/get.js';
17
17
  import { runConnect } from './commands/connect.js';
18
18
  import { runLogin } from './commands/login.js';
19
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';
20
23
  import { runOrient } from './commands/orient.js';
21
24
  import { runSearch } from './commands/search.js';
22
25
  import { runHandshake, runHandshakeInit } from './commands/handshake.js';
@@ -41,8 +44,10 @@ import { runVerify } from './commands/verify.js';
41
44
  import { runCodexPrep } from './commands/codex-prep.js';
42
45
  import { runCollectionsList, runCollectionsGet, runCollectionsAudit, runCollectionsExport } from './commands/collections.js';
43
46
  import { runWorkspaceVerify, runWorkspaceRepair, runDefinitionsDiff } from './commands/workspace.js';
44
- import { runAuthorityDomainsActivateCutover, runAuthorityDomainsBenchmark, runAuthorityDomainsDiscardPending, runAuthorityDomainsPropose, runAuthorityDomainsRatify, runAuthorityDomainsReadiness, runAuthorityDomainsRecordSample, runAuthorityDomainsReject, runAuthorityDomainsReview, } from './commands/authority-domains.js';
47
+ import { runAuthorityDomainsActivateCutover, runAuthorityDomainsDeactivateCutover, runAuthorityDomainsBenchmark, runAuthorityDomainsDiscardPending, runAuthorityDomainsPropose, runAuthorityDomainsRatify, runAuthorityDomainsReadiness, runAuthorityDomainsRecordSample, runAuthorityDomainsReject, runAuthorityDomainsReview, runAuthorityDomainsPrincipleDistribution, } from './commands/authority-domains.js';
45
48
  import { runDoctor } from './commands/doctor.js';
49
+ import { runWhoami } from './commands/whoami.js';
50
+ import { runUpgrade } from './commands/upgrade.js';
46
51
  import { runProfileList, runProfileCreate, runProfileUse, runProfileDelete } from './commands/profile.js';
47
52
  import { runInit } from './commands/init.js';
48
53
  import { runMethodList, runMethodShow, runMethodDiff, runMethodPublish } from './commands/method.js';
@@ -50,10 +55,56 @@ import { createAdminCommand } from './commands/admin/index.js';
50
55
  import { runUsage } from './commands/usage.js';
51
56
  import { GLOSSARY, formatGlossary } from './lib/glossary.js';
52
57
  import { API_KEY_PREFIX } from './lib/tokenConstants.js';
53
- import { hint, heading, bold, dim, green, icons } from './lib/style.js';
58
+ import { hint, heading, bold, dim, green, icons, yellow } from './lib/style.js';
59
+ import { getPreviewBinding } from './lib/config.js';
54
60
  import { checkForUpdate } from './lib/update-check.js';
61
+ import { UPGRADE_COMMAND } from './lib/constants.js';
55
62
  import { resolveSetupState, detectRenderTier } from './lib/state.js';
56
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
+ }
57
108
  /**
58
109
  * Global error handler — single exit point for all CLI errors.
59
110
  * CLIError: format with code + category + guidance.
@@ -112,7 +163,10 @@ program
112
163
  .option('-q, --quiet', 'Suppress non-essential output (banners, hints, progress)')
113
164
  .exitOverride(); // Throw CommanderError instead of calling process.exit directly
114
165
  // Apply global output mode BEFORE subcommand actions run
115
- program.hook('preAction', (thisCommand) => {
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) => {
116
170
  const globalOpts = program.opts();
117
171
  if (globalOpts.json) {
118
172
  setOutputMode('json');
@@ -126,7 +180,9 @@ program.hook('preAction', (thisCommand) => {
126
180
  }
127
181
  // Ambient update notification — non-blocking, suppressed in JSON mode (WP-322 S1)
128
182
  checkForUpdate(cliPackageVersion.version);
129
- void thisCommand;
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);
130
186
  });
131
187
  // Default action — status dashboard when `pb` is invoked with no command.
132
188
  // `pb --help` still works because Commander intercepts --help before the action runs.
@@ -347,8 +403,9 @@ program
347
403
  .option('-t, --task <task>', 'Task description for task-shaped governance and context')
348
404
  // SYNC: domain list must match TaskDomain in convex/agentKnowledge/startupResolver.ts
349
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.')
350
407
  .action(async (opts) => {
351
- await runOrient({ brief: opts.brief, task: opts.task?.trim() || undefined, scope: opts.scope?.trim() || undefined });
408
+ await runOrient({ brief: opts.brief, task: opts.task?.trim() || undefined, scope: opts.scope?.trim() || undefined, full: opts.full });
352
409
  });
353
410
  program
354
411
  .command('handshake')
@@ -360,24 +417,29 @@ program
360
417
  .option('--level <level>', 'With --init: trust level (guide|work|silent|full-trust). Without --init: content tier (beginner|intermediate|expert)')
361
418
  .option('--generate', 'Fetch governance entries from the Chain and merge generated rules (BET-286)')
362
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.')
363
422
  .action(async (opts) => {
364
423
  if (opts.init) {
365
424
  await runHandshakeInit({ level: opts.level, dryRun: opts.dryRun });
366
425
  return;
367
426
  }
368
- await runHandshake({ force: opts.force, apply: opts.apply, dryRun: opts.dryRun, level: opts.level, generate: opts.generate, surfaces: opts.surfaces?.split(',') });
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 });
369
430
  });
370
431
  program
371
432
  .command('codex-prep <task...>')
372
433
  .description('Generate task-specific governance context for Codex (.codex/task-context.md)')
373
434
  .option('--dry-run', 'Print to stdout instead of writing file')
435
+ .option('--full', 'Full depth orient (tier=full). Use for thorough context loading.')
374
436
  .action(async (taskParts, opts) => {
375
437
  const task = taskParts.join(' ').trim();
376
438
  if (!task) {
377
439
  program.commands.find((c) => c.name() === 'codex-prep')?.help();
378
440
  return;
379
441
  }
380
- await runCodexPrep({ task, dryRun: opts.dryRun });
442
+ await runCodexPrep({ task, dryRun: opts.dryRun, full: opts.full });
381
443
  });
382
444
  program
383
445
  .command('init')
@@ -387,14 +449,15 @@ program
387
449
  });
388
450
  program
389
451
  .command('connect <token>')
390
- .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.')
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).')
391
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.')
392
455
  .action(async (token, opts) => {
393
456
  if (!token?.trim()) {
394
457
  program.commands.find((c) => c.name() === 'connect')?.help();
395
458
  return;
396
459
  }
397
- await runConnect(token.trim(), { gateway: opts.gateway });
460
+ await runConnect(token.trim(), { gateway: opts.gateway, name: opts.name });
398
461
  });
399
462
  program
400
463
  .command('login')
@@ -410,12 +473,49 @@ program
410
473
  .action(async (opts) => {
411
474
  await runDoctor({ fix: opts.fix, dryRun: opts.dryRun });
412
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
+ });
413
483
  program
414
484
  .command('setup')
415
- .description('Guided first-time setup: account, login, workspace, first capture')
485
+ .description('Canonical pb-setup entry (DEC-995): detect surfaces, read state, emit JSON for the skill body.')
416
486
  .action(async () => {
417
487
  await runSetup();
418
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
+ });
419
519
  // --- Write commands (require active session) ---
420
520
  const sessionCmd = program
421
521
  .command('session')
@@ -595,7 +695,7 @@ program
595
695
  // --- Audit command (BET-182 Slice 2) ---
596
696
  program
597
697
  .command('audit <entry-ids...>')
598
- .description('Run STD-113 hygiene audit on bet(s) — 13 gates, exit code reflects verdict')
698
+ .description('Run hygiene audit on bet(s) — 13 gates (shaping) / 18 gates (handoff), exit code reflects verdict')
599
699
  .option('--phase <phase>', 'Override phase detection (shaping | handoff)')
600
700
  .option('--gate <name>', 'Run only specified gate(s) (repeatable)', (val, prev) => [...prev, val], [])
601
701
  .option('--fix', 'Auto-execute exact fixes via pb update, rerun once')
@@ -764,8 +864,23 @@ authorityDomainsCmd
764
864
  authorityDomainsCmd
765
865
  .command('activate-cutover')
766
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')
767
882
  .action(async () => {
768
- await runAuthorityDomainsActivateCutover();
883
+ await runAuthorityDomainsPrincipleDistribution();
769
884
  });
770
885
  // --- Definitions diff command (WP-305 Slice 4) ---
771
886
  const definitionsCmd = program
@@ -838,10 +953,11 @@ profileCmd
838
953
  });
839
954
  profileCmd
840
955
  .command('use <name>')
841
- .description('Switch active profile (closes any active session). Use --local to pin profile in project config.local.json instead.')
842
- .option('--local', 'Write profile pin to .productbrain/config.local.json in the project root (machine-local, gitignored)')
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)')
843
959
  .action(async (name, opts) => {
844
- await runProfileUse({ name, local: opts.local });
960
+ await runProfileUse({ name, local: opts.local, global: opts.global });
845
961
  });
846
962
  profileCmd
847
963
  .command('delete <name>')
@@ -849,6 +965,14 @@ profileCmd
849
965
  .action(async (name) => {
850
966
  await runProfileDelete({ name });
851
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
+ });
852
976
  // --- Glossary command (WP-302 Slice 4) ---
853
977
  program
854
978
  .command('glossary')
@@ -880,18 +1004,9 @@ program.addCommand(createAdminCommand());
880
1004
  // --- Upgrade command (WP-322 S1: ambient update notification) ---
881
1005
  program
882
1006
  .command('upgrade')
883
- .description('Upgrade pb CLI to the latest version (npm install -g @productbrain/cli@latest)')
884
- .action(() => {
885
- if (isJsonMode()) {
886
- process.stdout.write(JSON.stringify({
887
- command: 'npm install -g @productbrain/cli@latest',
888
- hint: 'Run the command above to upgrade pb CLI.',
889
- }) + '\n');
890
- return;
891
- }
892
- process.stdout.write('\n');
893
- process.stdout.write(`${bold('Upgrade pb CLI')} ${dim('—')} run the command below:\n\n`);
894
- process.stdout.write(` npm install -g @productbrain/cli@latest\n\n`);
1007
+ .description(`Upgrade pb CLI to the latest beta (${UPGRADE_COMMAND})`)
1008
+ .action(async () => {
1009
+ await runUpgrade({ currentVersion: cliPackageVersion.version });
895
1010
  });
896
1011
  // Parse with global error handler — all uncaught errors route through handleError
897
1012
  program.parseAsync(process.argv).catch(handleError);