@productbrain/cli 0.1.0-beta.96 → 0.1.0-beta.978

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 (422) 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__/notice-marker.test.d.ts +2 -0
  40. package/dist/__tests__/notice-marker.test.d.ts.map +1 -0
  41. package/dist/__tests__/notice-marker.test.js +41 -0
  42. package/dist/__tests__/notice-marker.test.js.map +1 -0
  43. package/dist/__tests__/onboarding-path-b.test.js +4 -4
  44. package/dist/__tests__/onboarding-path-b.test.js.map +1 -1
  45. package/dist/__tests__/orient.test.js +184 -7
  46. package/dist/__tests__/orient.test.js.map +1 -1
  47. package/dist/__tests__/perimeter.test.d.ts +2 -0
  48. package/dist/__tests__/perimeter.test.d.ts.map +1 -0
  49. package/dist/__tests__/perimeter.test.js +165 -0
  50. package/dist/__tests__/perimeter.test.js.map +1 -0
  51. package/dist/__tests__/personal-layer.test.d.ts +1 -2
  52. package/dist/__tests__/personal-layer.test.d.ts.map +1 -1
  53. package/dist/__tests__/personal-layer.test.js +12 -48
  54. package/dist/__tests__/personal-layer.test.js.map +1 -1
  55. package/dist/__tests__/profiles.test.js +122 -7
  56. package/dist/__tests__/profiles.test.js.map +1 -1
  57. package/dist/__tests__/promote.test.js +2 -2
  58. package/dist/__tests__/promote.test.js.map +1 -1
  59. package/dist/__tests__/session-state-machine.test.js +45 -1
  60. package/dist/__tests__/session-state-machine.test.js.map +1 -1
  61. package/dist/__tests__/session-switch.test.d.ts +2 -0
  62. package/dist/__tests__/session-switch.test.d.ts.map +1 -0
  63. package/dist/__tests__/session-switch.test.js +129 -0
  64. package/dist/__tests__/session-switch.test.js.map +1 -0
  65. package/dist/__tests__/setup-ingest.test.js +16 -0
  66. package/dist/__tests__/setup-ingest.test.js.map +1 -1
  67. package/dist/__tests__/skill-vocabulary.test.d.ts +21 -0
  68. package/dist/__tests__/skill-vocabulary.test.d.ts.map +1 -0
  69. package/dist/__tests__/skill-vocabulary.test.js +187 -0
  70. package/dist/__tests__/skill-vocabulary.test.js.map +1 -0
  71. package/dist/__tests__/update-check.test.d.ts +2 -0
  72. package/dist/__tests__/update-check.test.d.ts.map +1 -0
  73. package/dist/__tests__/update-check.test.js +215 -0
  74. package/dist/__tests__/update-check.test.js.map +1 -0
  75. package/dist/__tests__/upgrade-runner.test.d.ts +2 -0
  76. package/dist/__tests__/upgrade-runner.test.d.ts.map +1 -0
  77. package/dist/__tests__/upgrade-runner.test.js +54 -0
  78. package/dist/__tests__/upgrade-runner.test.js.map +1 -0
  79. package/dist/__tests__/upgrade.test.d.ts +2 -0
  80. package/dist/__tests__/upgrade.test.d.ts.map +1 -0
  81. package/dist/__tests__/upgrade.test.js +56 -0
  82. package/dist/__tests__/upgrade.test.js.map +1 -0
  83. package/dist/__tests__/vocabulary-leak.test.d.ts +39 -0
  84. package/dist/__tests__/vocabulary-leak.test.d.ts.map +1 -0
  85. package/dist/__tests__/vocabulary-leak.test.js +534 -0
  86. package/dist/__tests__/vocabulary-leak.test.js.map +1 -0
  87. package/dist/__tests__/workspace.test.js +32 -12
  88. package/dist/__tests__/workspace.test.js.map +1 -1
  89. package/dist/commands/__tests__/connect-handoff.test.d.ts +11 -0
  90. package/dist/commands/__tests__/connect-handoff.test.d.ts.map +1 -0
  91. package/dist/commands/__tests__/connect-handoff.test.js +111 -0
  92. package/dist/commands/__tests__/connect-handoff.test.js.map +1 -0
  93. package/dist/commands/__tests__/setup-detect-surfaces.test.d.ts +15 -0
  94. package/dist/commands/__tests__/setup-detect-surfaces.test.d.ts.map +1 -0
  95. package/dist/commands/__tests__/setup-detect-surfaces.test.js +149 -0
  96. package/dist/commands/__tests__/setup-detect-surfaces.test.js.map +1 -0
  97. package/dist/commands/__tests__/setup-state.test.d.ts +2 -0
  98. package/dist/commands/__tests__/setup-state.test.d.ts.map +1 -0
  99. package/dist/commands/__tests__/setup-state.test.js +194 -0
  100. package/dist/commands/__tests__/setup-state.test.js.map +1 -0
  101. package/dist/commands/admin/seed.d.ts +46 -2
  102. package/dist/commands/admin/seed.d.ts.map +1 -1
  103. package/dist/commands/admin/seed.js +475 -33
  104. package/dist/commands/admin/seed.js.map +1 -1
  105. package/dist/commands/admin/seed.test.d.ts +5 -0
  106. package/dist/commands/admin/seed.test.d.ts.map +1 -1
  107. package/dist/commands/admin/seed.test.js +67 -2
  108. package/dist/commands/admin/seed.test.js.map +1 -1
  109. package/dist/commands/admin/seedRegistryEntries.generated.d.ts +14 -0
  110. package/dist/commands/admin/seedRegistryEntries.generated.d.ts.map +1 -0
  111. package/dist/commands/admin/seedRegistryEntries.generated.js +117 -0
  112. package/dist/commands/admin/seedRegistryEntries.generated.js.map +1 -0
  113. package/dist/commands/admin/seedRegistryEntries.test.d.ts +11 -0
  114. package/dist/commands/admin/seedRegistryEntries.test.d.ts.map +1 -0
  115. package/dist/commands/admin/seedRegistryEntries.test.js +67 -0
  116. package/dist/commands/admin/seedRegistryEntries.test.js.map +1 -0
  117. package/dist/commands/audit.d.ts.map +1 -1
  118. package/dist/commands/audit.js +30 -3
  119. package/dist/commands/audit.js.map +1 -1
  120. package/dist/commands/authority-domains.d.ts +25 -1
  121. package/dist/commands/authority-domains.d.ts.map +1 -1
  122. package/dist/commands/authority-domains.js +51 -4
  123. package/dist/commands/authority-domains.js.map +1 -1
  124. package/dist/commands/capture.d.ts.map +1 -1
  125. package/dist/commands/capture.js +3 -2
  126. package/dist/commands/capture.js.map +1 -1
  127. package/dist/commands/codex-prep.d.ts +1 -0
  128. package/dist/commands/codex-prep.d.ts.map +1 -1
  129. package/dist/commands/codex-prep.js +10 -7
  130. package/dist/commands/codex-prep.js.map +1 -1
  131. package/dist/commands/connect-config.test.d.ts +2 -0
  132. package/dist/commands/connect-config.test.d.ts.map +1 -0
  133. package/dist/commands/connect-config.test.js +44 -0
  134. package/dist/commands/connect-config.test.js.map +1 -0
  135. package/dist/commands/connect-context.d.ts +45 -0
  136. package/dist/commands/connect-context.d.ts.map +1 -0
  137. package/dist/commands/connect-context.js +64 -0
  138. package/dist/commands/connect-context.js.map +1 -0
  139. package/dist/commands/connect-context.test.d.ts +2 -0
  140. package/dist/commands/connect-context.test.d.ts.map +1 -0
  141. package/dist/commands/connect-context.test.js +110 -0
  142. package/dist/commands/connect-context.test.js.map +1 -0
  143. package/dist/commands/connect-handoff.d.ts +51 -0
  144. package/dist/commands/connect-handoff.d.ts.map +1 -0
  145. package/dist/commands/connect-handoff.js +70 -0
  146. package/dist/commands/connect-handoff.js.map +1 -0
  147. package/dist/commands/connect-integration.test.js +29 -12
  148. package/dist/commands/connect-integration.test.js.map +1 -1
  149. package/dist/commands/connect-screens.d.ts +6 -4
  150. package/dist/commands/connect-screens.d.ts.map +1 -1
  151. package/dist/commands/connect-screens.js +30 -19
  152. package/dist/commands/connect-screens.js.map +1 -1
  153. package/dist/commands/connect.d.ts +21 -6
  154. package/dist/commands/connect.d.ts.map +1 -1
  155. package/dist/commands/connect.js +65 -58
  156. package/dist/commands/connect.js.map +1 -1
  157. package/dist/commands/connect.test.js +17 -1
  158. package/dist/commands/connect.test.js.map +1 -1
  159. package/dist/commands/doctor.d.ts.map +1 -1
  160. package/dist/commands/doctor.js +68 -3
  161. package/dist/commands/doctor.js.map +1 -1
  162. package/dist/commands/doctor.test.js +150 -0
  163. package/dist/commands/doctor.test.js.map +1 -1
  164. package/dist/commands/handshake.d.ts +194 -2
  165. package/dist/commands/handshake.d.ts.map +1 -1
  166. package/dist/commands/handshake.js +1537 -46
  167. package/dist/commands/handshake.js.map +1 -1
  168. package/dist/commands/method.d.ts.map +1 -1
  169. package/dist/commands/method.js +3 -0
  170. package/dist/commands/method.js.map +1 -1
  171. package/dist/commands/orient.d.ts +63 -2
  172. package/dist/commands/orient.d.ts.map +1 -1
  173. package/dist/commands/orient.js +106 -4
  174. package/dist/commands/orient.js.map +1 -1
  175. package/dist/commands/profile.d.ts +1 -14
  176. package/dist/commands/profile.d.ts.map +1 -1
  177. package/dist/commands/profile.js +89 -72
  178. package/dist/commands/profile.js.map +1 -1
  179. package/dist/commands/promote.js +1 -1
  180. package/dist/commands/promote.js.map +1 -1
  181. package/dist/commands/relate.d.ts.map +1 -1
  182. package/dist/commands/relate.js +13 -0
  183. package/dist/commands/relate.js.map +1 -1
  184. package/dist/commands/session.d.ts.map +1 -1
  185. package/dist/commands/session.js +51 -14
  186. package/dist/commands/session.js.map +1 -1
  187. package/dist/commands/setup-audit.d.ts +59 -0
  188. package/dist/commands/setup-audit.d.ts.map +1 -0
  189. package/dist/commands/setup-audit.js +250 -0
  190. package/dist/commands/setup-audit.js.map +1 -0
  191. package/dist/commands/setup-detect-surfaces.d.ts +38 -0
  192. package/dist/commands/setup-detect-surfaces.d.ts.map +1 -0
  193. package/dist/commands/setup-detect-surfaces.js +76 -0
  194. package/dist/commands/setup-detect-surfaces.js.map +1 -0
  195. package/dist/commands/setup-ingest.d.ts.map +1 -1
  196. package/dist/commands/setup-ingest.js +4 -2
  197. package/dist/commands/setup-ingest.js.map +1 -1
  198. package/dist/commands/setup-state.d.ts +42 -0
  199. package/dist/commands/setup-state.d.ts.map +1 -0
  200. package/dist/commands/setup-state.js +93 -0
  201. package/dist/commands/setup-state.js.map +1 -0
  202. package/dist/commands/setup.d.ts +17 -9
  203. package/dist/commands/setup.d.ts.map +1 -1
  204. package/dist/commands/setup.js +52 -131
  205. package/dist/commands/setup.js.map +1 -1
  206. package/dist/commands/upgrade.d.ts +5 -0
  207. package/dist/commands/upgrade.d.ts.map +1 -0
  208. package/dist/commands/upgrade.js +110 -0
  209. package/dist/commands/upgrade.js.map +1 -0
  210. package/dist/commands/whoami.d.ts +12 -0
  211. package/dist/commands/whoami.d.ts.map +1 -0
  212. package/dist/commands/whoami.js +70 -0
  213. package/dist/commands/whoami.js.map +1 -0
  214. package/dist/commands/whoami.test.d.ts +2 -0
  215. package/dist/commands/whoami.test.d.ts.map +1 -0
  216. package/dist/commands/whoami.test.js +50 -0
  217. package/dist/commands/whoami.test.js.map +1 -0
  218. package/dist/commands/workspace.d.ts +23 -2
  219. package/dist/commands/workspace.d.ts.map +1 -1
  220. package/dist/commands/workspace.js +2 -2
  221. package/dist/commands/workspace.js.map +1 -1
  222. package/dist/formatters/__tests__/orient-provenance.test.d.ts +7 -0
  223. package/dist/formatters/__tests__/orient-provenance.test.d.ts.map +1 -0
  224. package/dist/formatters/__tests__/orient-provenance.test.js +454 -0
  225. package/dist/formatters/__tests__/orient-provenance.test.js.map +1 -0
  226. package/dist/formatters/audit.d.ts +6 -0
  227. package/dist/formatters/audit.d.ts.map +1 -1
  228. package/dist/formatters/audit.js.map +1 -1
  229. package/dist/formatters/entry.d.ts +21 -0
  230. package/dist/formatters/entry.d.ts.map +1 -1
  231. package/dist/formatters/entry.js +46 -5
  232. package/dist/formatters/entry.js.map +1 -1
  233. package/dist/formatters/handshake.d.ts +19 -3
  234. package/dist/formatters/handshake.d.ts.map +1 -1
  235. package/dist/formatters/handshake.js +48 -13
  236. package/dist/formatters/handshake.js.map +1 -1
  237. package/dist/formatters/orient.d.ts +79 -4
  238. package/dist/formatters/orient.d.ts.map +1 -1
  239. package/dist/formatters/orient.js +119 -18
  240. package/dist/formatters/orient.js.map +1 -1
  241. package/dist/formatters/session.js +1 -1
  242. package/dist/formatters/session.js.map +1 -1
  243. package/dist/generators/adapters.js +2 -2
  244. package/dist/generators/context-md.js +6 -6
  245. package/dist/generators/context-md.js.map +1 -1
  246. package/dist/generators/manifest.d.ts +76 -0
  247. package/dist/generators/manifest.d.ts.map +1 -1
  248. package/dist/generators/manifest.js +125 -14
  249. package/dist/generators/manifest.js.map +1 -1
  250. package/dist/generators/portable-knowledge.d.ts +6 -12
  251. package/dist/generators/portable-knowledge.d.ts.map +1 -1
  252. package/dist/generators/portable-knowledge.js +2 -19
  253. package/dist/generators/portable-knowledge.js.map +1 -1
  254. package/dist/generators/region-projections.d.ts +18 -0
  255. package/dist/generators/region-projections.d.ts.map +1 -0
  256. package/dist/generators/region-projections.js +49 -0
  257. package/dist/generators/region-projections.js.map +1 -0
  258. package/dist/generators/region-projections.test.d.ts +2 -0
  259. package/dist/generators/region-projections.test.d.ts.map +1 -0
  260. package/dist/generators/region-projections.test.js +63 -0
  261. package/dist/generators/region-projections.test.js.map +1 -0
  262. package/dist/generators/region.d.ts +24 -0
  263. package/dist/generators/region.d.ts.map +1 -0
  264. package/dist/generators/region.js +87 -0
  265. package/dist/generators/region.js.map +1 -0
  266. package/dist/generators/region.test.d.ts +2 -0
  267. package/dist/generators/region.test.d.ts.map +1 -0
  268. package/dist/generators/region.test.js +126 -0
  269. package/dist/generators/region.test.js.map +1 -0
  270. package/dist/generators/surface-profiles.d.ts +1 -2
  271. package/dist/generators/surface-profiles.d.ts.map +1 -1
  272. package/dist/generators/surface-profiles.js.map +1 -1
  273. package/dist/index.js +142 -27
  274. package/dist/index.js.map +1 -1
  275. package/dist/lib/activation.d.ts.map +1 -1
  276. package/dist/lib/activation.js +3 -3
  277. package/dist/lib/activation.js.map +1 -1
  278. package/dist/lib/activation.test.js +3 -3
  279. package/dist/lib/activation.test.js.map +1 -1
  280. package/dist/lib/canonicalRefs.d.ts +72 -0
  281. package/dist/lib/canonicalRefs.d.ts.map +1 -1
  282. package/dist/lib/canonicalRefs.js +67 -0
  283. package/dist/lib/canonicalRefs.js.map +1 -1
  284. package/dist/lib/client.d.ts.map +1 -1
  285. package/dist/lib/client.js +14 -4
  286. package/dist/lib/client.js.map +1 -1
  287. package/dist/lib/config.d.ts +70 -4
  288. package/dist/lib/config.d.ts.map +1 -1
  289. package/dist/lib/config.js +151 -11
  290. package/dist/lib/config.js.map +1 -1
  291. package/dist/lib/connectKeyLabel.d.ts +9 -0
  292. package/dist/lib/connectKeyLabel.d.ts.map +1 -0
  293. package/dist/lib/connectKeyLabel.js +12 -0
  294. package/dist/lib/connectKeyLabel.js.map +1 -0
  295. package/dist/lib/constants.d.ts +2 -0
  296. package/dist/lib/constants.d.ts.map +1 -1
  297. package/dist/lib/constants.js +2 -0
  298. package/dist/lib/constants.js.map +1 -1
  299. package/dist/lib/errors.d.ts +3 -0
  300. package/dist/lib/errors.d.ts.map +1 -1
  301. package/dist/lib/errors.js +3 -0
  302. package/dist/lib/errors.js.map +1 -1
  303. package/dist/lib/normalizeMaterializedFilename.d.ts +28 -0
  304. package/dist/lib/normalizeMaterializedFilename.d.ts.map +1 -0
  305. package/dist/lib/normalizeMaterializedFilename.js +56 -0
  306. package/dist/lib/normalizeMaterializedFilename.js.map +1 -0
  307. package/dist/lib/normalizeMaterializedFilename.test.d.ts +16 -0
  308. package/dist/lib/normalizeMaterializedFilename.test.d.ts.map +1 -0
  309. package/dist/lib/normalizeMaterializedFilename.test.js +90 -0
  310. package/dist/lib/normalizeMaterializedFilename.test.js.map +1 -0
  311. package/dist/lib/notice-marker.d.ts +3 -0
  312. package/dist/lib/notice-marker.d.ts.map +1 -0
  313. package/dist/lib/notice-marker.js +53 -0
  314. package/dist/lib/notice-marker.js.map +1 -0
  315. package/dist/lib/onboarding-path-b.d.ts.map +1 -1
  316. package/dist/lib/onboarding-path-b.js +0 -1
  317. package/dist/lib/onboarding-path-b.js.map +1 -1
  318. package/dist/lib/onboarding-shared.d.ts +0 -1
  319. package/dist/lib/onboarding-shared.d.ts.map +1 -1
  320. package/dist/lib/onboarding-shared.js +1 -17
  321. package/dist/lib/onboarding-shared.js.map +1 -1
  322. package/dist/lib/profiles.d.ts +3 -1
  323. package/dist/lib/profiles.d.ts.map +1 -1
  324. package/dist/lib/profiles.js +9 -6
  325. package/dist/lib/profiles.js.map +1 -1
  326. package/dist/lib/session.d.ts +10 -0
  327. package/dist/lib/session.d.ts.map +1 -1
  328. package/dist/lib/session.js +14 -0
  329. package/dist/lib/session.js.map +1 -1
  330. package/dist/lib/update-check.d.ts +42 -7
  331. package/dist/lib/update-check.d.ts.map +1 -1
  332. package/dist/lib/update-check.js +213 -62
  333. package/dist/lib/update-check.js.map +1 -1
  334. package/dist/lib/upgrade-runner.d.ts +22 -0
  335. package/dist/lib/upgrade-runner.d.ts.map +1 -0
  336. package/dist/lib/upgrade-runner.js +110 -0
  337. package/dist/lib/upgrade-runner.js.map +1 -0
  338. package/dist/lib/workspaceVocabCache.d.ts +60 -0
  339. package/dist/lib/workspaceVocabCache.d.ts.map +1 -0
  340. package/dist/lib/workspaceVocabCache.js +98 -0
  341. package/dist/lib/workspaceVocabCache.js.map +1 -0
  342. package/dist/setup/__tests__/coach-traces.test.d.ts +2 -0
  343. package/dist/setup/__tests__/coach-traces.test.d.ts.map +1 -0
  344. package/dist/setup/__tests__/coach-traces.test.js +189 -0
  345. package/dist/setup/__tests__/coach-traces.test.js.map +1 -0
  346. package/dist/setup/__tests__/setup-commands.test.d.ts +2 -0
  347. package/dist/setup/__tests__/setup-commands.test.d.ts.map +1 -0
  348. package/dist/setup/__tests__/setup-commands.test.js +177 -0
  349. package/dist/setup/__tests__/setup-commands.test.js.map +1 -0
  350. package/dist/setup/__tests__/state-machine.test.d.ts +2 -0
  351. package/dist/setup/__tests__/state-machine.test.d.ts.map +1 -0
  352. package/dist/setup/__tests__/state-machine.test.js +341 -0
  353. package/dist/setup/__tests__/state-machine.test.js.map +1 -0
  354. package/dist/setup/detect-surfaces.d.ts +21 -0
  355. package/dist/setup/detect-surfaces.d.ts.map +1 -0
  356. package/dist/setup/detect-surfaces.js +39 -0
  357. package/dist/setup/detect-surfaces.js.map +1 -0
  358. package/dist/setup/manifest-writer.d.ts +17 -0
  359. package/dist/setup/manifest-writer.d.ts.map +1 -0
  360. package/dist/setup/manifest-writer.js +153 -0
  361. package/dist/setup/manifest-writer.js.map +1 -0
  362. package/dist/setup/perimeter.d.ts +72 -0
  363. package/dist/setup/perimeter.d.ts.map +1 -0
  364. package/dist/setup/perimeter.js +128 -0
  365. package/dist/setup/perimeter.js.map +1 -0
  366. package/dist/setup/state-machine.d.ts +67 -0
  367. package/dist/setup/state-machine.d.ts.map +1 -0
  368. package/dist/setup/state-machine.js +124 -0
  369. package/dist/setup/state-machine.js.map +1 -0
  370. package/dist/surfaces/__tests__/adapter.test.d.ts +2 -0
  371. package/dist/surfaces/__tests__/adapter.test.d.ts.map +1 -0
  372. package/dist/surfaces/__tests__/adapter.test.js +90 -0
  373. package/dist/surfaces/__tests__/adapter.test.js.map +1 -0
  374. package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts +2 -0
  375. package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts.map +1 -0
  376. package/dist/surfaces/__tests__/pb-setup-passthrough.test.js +132 -0
  377. package/dist/surfaces/__tests__/pb-setup-passthrough.test.js.map +1 -0
  378. package/dist/surfaces/__tests__/telemetry.test.d.ts +2 -0
  379. package/dist/surfaces/__tests__/telemetry.test.d.ts.map +1 -0
  380. package/dist/surfaces/__tests__/telemetry.test.js +55 -0
  381. package/dist/surfaces/__tests__/telemetry.test.js.map +1 -0
  382. package/dist/surfaces/adapter.d.ts +70 -0
  383. package/dist/surfaces/adapter.d.ts.map +1 -0
  384. package/dist/surfaces/adapter.js +2 -0
  385. package/dist/surfaces/adapter.js.map +1 -0
  386. package/dist/surfaces/adapters/claude.d.ts +3 -0
  387. package/dist/surfaces/adapters/claude.d.ts.map +1 -0
  388. package/dist/surfaces/adapters/claude.js +67 -0
  389. package/dist/surfaces/adapters/claude.js.map +1 -0
  390. package/dist/surfaces/adapters/codex.d.ts +3 -0
  391. package/dist/surfaces/adapters/codex.d.ts.map +1 -0
  392. package/dist/surfaces/adapters/codex.js +61 -0
  393. package/dist/surfaces/adapters/codex.js.map +1 -0
  394. package/dist/surfaces/adapters/copilot.d.ts +3 -0
  395. package/dist/surfaces/adapters/copilot.d.ts.map +1 -0
  396. package/dist/surfaces/adapters/copilot.js +59 -0
  397. package/dist/surfaces/adapters/copilot.js.map +1 -0
  398. package/dist/surfaces/adapters/cursor.d.ts +3 -0
  399. package/dist/surfaces/adapters/cursor.d.ts.map +1 -0
  400. package/dist/surfaces/adapters/cursor.js +78 -0
  401. package/dist/surfaces/adapters/cursor.js.map +1 -0
  402. package/dist/surfaces/registry.d.ts +58 -2
  403. package/dist/surfaces/registry.d.ts.map +1 -1
  404. package/dist/surfaces/registry.js +82 -7
  405. package/dist/surfaces/registry.js.map +1 -1
  406. package/dist/surfaces/telemetry.d.ts +17 -0
  407. package/dist/surfaces/telemetry.d.ts.map +1 -0
  408. package/dist/surfaces/telemetry.js +31 -0
  409. package/dist/surfaces/telemetry.js.map +1 -0
  410. package/package.json +3 -1
  411. package/dist/__tests__/setup.test.d.ts +0 -2
  412. package/dist/__tests__/setup.test.d.ts.map +0 -1
  413. package/dist/__tests__/setup.test.js +0 -141
  414. package/dist/__tests__/setup.test.js.map +0 -1
  415. package/dist/generators/__tests__/surface-profiles.test.d.ts +0 -2
  416. package/dist/generators/__tests__/surface-profiles.test.d.ts.map +0 -1
  417. package/dist/generators/__tests__/surface-profiles.test.js +0 -89
  418. package/dist/generators/__tests__/surface-profiles.test.js.map +0 -1
  419. package/dist/lib/onboarding-phases.d.ts +0 -9
  420. package/dist/lib/onboarding-phases.d.ts.map +0 -1
  421. package/dist/lib/onboarding-phases.js +0 -120
  422. package/dist/lib/onboarding-phases.js.map +0 -1
@@ -3,6 +3,10 @@
3
3
  *
4
4
  * Seed metadata is duplicated from `convex/admin/commandManifest.ts` for CLI help
5
5
  * and ordering only — behavior is enforced server-side (STD-101).
6
+ *
7
+ * WP-433 S1b D13: the 4 substrate-repair migrations + backfill-default-team are
8
+ * generated from `convex/admin/seed/registry.ts` (single SSOT) into
9
+ * `seedRegistryEntries.generated.ts`. Run `npm run codegen` to refresh after registry edits.
6
10
  */
7
11
  import * as clack from '@clack/prompts';
8
12
  import { adminCall } from '../../lib/client.js';
@@ -11,9 +15,10 @@ import { CLIError, ErrorCode } from '../../lib/errors.js';
11
15
  import { ask, confirm, intro, isInteractive, log, multiselect, note, outro } from '../../lib/prompts.js';
12
16
  import { readSession } from '../../lib/session.js';
13
17
  import { isJsonMode } from '../../lib/runner.js';
18
+ import { REGISTRY_SEED_COMMAND_ENTRIES } from './seedRegistryEntries.generated.js';
14
19
  import { confirmRiskNoteTitle, requiresAdminDestructiveConfirmation, seedAllConfirmMessage, seedMultiselectConfirmMessage, seedRunConfirmMessage, } from '../../lib/deployment.js';
15
20
  import { withSpinner } from '../../lib/spinner.js';
16
- import { adminBanner, bold, confirmProdAction, cyan, dim, green, heading, hint, icons, red, } from '../../lib/style.js';
21
+ import { adminBanner, bold, confirmProdAction, cyan, dim, green, heading, hint, icons, red, yellow, } from '../../lib/style.js';
17
22
  /**
18
23
  * Order matches `ADMIN_COMMANDS` seed block in commandManifest.ts — dependency order for `seed all`.
19
24
  */
@@ -108,14 +113,90 @@ export const SEED_COMMAND_ENTRIES = [
108
113
  requiresWorkspaceId: true,
109
114
  dryRunSupported: true,
110
115
  },
116
+ // ─── WP-379 S5a: Starter Setup seed operations ─────────────────────────────
117
+ {
118
+ name: 'seed:show-starter',
119
+ description: 'List 18 Starter Setup assets for a workspace with body previews, lockLevel, and gate summary',
120
+ requiresWorkspaceId: true,
121
+ dryRunSupported: false,
122
+ },
123
+ {
124
+ name: 'seed:backfill-starter',
125
+ description: 'Idempotent bulk seed of Starter Setup bundle across workspaces. Defaults to dry-run.',
126
+ requiresWorkspaceId: false,
127
+ dryRunSupported: true,
128
+ dangerous: true,
129
+ },
130
+ {
131
+ name: 'seed:migrate-starter-fields',
132
+ description: 'STUB (WP-379 S5b): backfill explicit lockLevel + gate columns on existing setup-assets entries.',
133
+ requiresWorkspaceId: true,
134
+ dryRunSupported: true,
135
+ },
136
+ // WP-433 S1b D13: `seed:migrate-setup-skill-entryid` migrated to the SSOT registry.
137
+ // It now appears via REGISTRY_SEED_COMMAND_ENTRIES below (alongside the 3 new repair ops
138
+ // and `backfill-default-team`).
139
+ ];
140
+ // WP-433 S1b D13: registry-generated entries appended to the static list. These are the
141
+ // 11 ops registered in `convex/admin/seed/registry.ts`. Filter out the prestep
142
+ // (`align-workspace-collections`) — it cannot be invoked via `pb admin seed run`.
143
+ const REGISTRY_RUNNABLE_ENTRIES = REGISTRY_SEED_COMMAND_ENTRIES
144
+ .filter((e) => e.runnable)
145
+ .map((e) => ({
146
+ name: e.name,
147
+ description: e.description,
148
+ requiresWorkspaceId: e.requiresWorkspaceId,
149
+ dryRunSupported: e.dryRunSupported,
150
+ }));
151
+ /** Combined list: static manifest entries (legacy seeds) + registry-generated entries. */
152
+ const ALL_SEED_COMMAND_ENTRIES = [
153
+ ...SEED_COMMAND_ENTRIES,
154
+ ...REGISTRY_RUNNABLE_ENTRIES,
111
155
  ];
112
- const SEED_BY_NAME = new Map(SEED_COMMAND_ENTRIES.map((e) => [e.name, e]));
113
- /** Manifest order for `pb admin seed all`. */
114
- export const SEED_MANIFEST_ORDER = SEED_COMMAND_ENTRIES.map((e) => e.name);
156
+ const SEED_BY_NAME = new Map(ALL_SEED_COMMAND_ENTRIES.map((e) => [e.name, e]));
157
+ /**
158
+ * Manifest order for `pb admin seed all`.
159
+ *
160
+ * Includes the static legacy seeds plus the registry-generated runnable entries so
161
+ * `seed all` exercises the full surface (D13 SSOT).
162
+ */
163
+ export const SEED_MANIFEST_ORDER = ALL_SEED_COMMAND_ENTRIES.map((e) => e.name);
115
164
  function shortLabel(manifestName) {
116
165
  return manifestName.startsWith('seed:') ? manifestName.slice('seed:'.length) : manifestName;
117
166
  }
118
- /** Accept `knowledge` or `seed:knowledge`. */
167
+ /**
168
+ * Convert a manifest name (which may be a bare slug for registry-generated entries)
169
+ * to the backend command name expected by the admin dispatch layer.
170
+ *
171
+ * Legacy static entries are already stored as `seed:<slug>` — returned as-is.
172
+ * Registry-generated entries are stored as bare slugs (e.g. `seed-system-glossary`);
173
+ * the backend COMMAND_MAP expects `seed:<slug>`, so we add the prefix here.
174
+ */
175
+ function toBackendCommand(manifestName) {
176
+ return manifestName.startsWith('seed:') ? manifestName : `seed:${manifestName}`;
177
+ }
178
+ /**
179
+ * Accept short-form or long-form seed op names; return the canonical backend command name.
180
+ *
181
+ * Static entries (legacy) are stored as `seed:<slug>` (e.g. `seed:knowledge`).
182
+ * Registry-generated entries (WP-433 S1b) are stored as bare slugs (e.g.
183
+ * `seed-system-glossary`) to avoid the double-prefix `seed:seed-*` trap that
184
+ * arose when slugs like `seed-system-glossary` were naively stored as
185
+ * `seed:seed-system-glossary`.
186
+ *
187
+ * Both forms always return the backend command name (`seed:<bare-slug>`):
188
+ * - `'system-glossary'` or `'seed-system-glossary'` → `'seed:seed-system-glossary'`
189
+ * would be wrong; instead the bare slug stored in the map IS `seed-system-glossary`
190
+ * and the backend command is `seed:seed-system-glossary`.
191
+ *
192
+ * Resolution order:
193
+ * 1. Try `seed:<t>` — covers legacy static entries (`seed:knowledge`) and any input
194
+ * that normalises to a key already stored with the `seed:` prefix.
195
+ * 2. Try bare `<t>` (stripping a leading `seed:` from the input if present) —
196
+ * covers registry entries stored without the prefix.
197
+ * When found via bare slug, return `seed:<bare>` so the caller always gets a
198
+ * backend-compatible command name.
199
+ */
119
200
  export function normalizeSeedCommandName(input) {
120
201
  const t = input.trim();
121
202
  if (!t) {
@@ -124,15 +205,50 @@ export function normalizeSeedCommandName(input) {
124
205
  category: 'validation',
125
206
  });
126
207
  }
127
- const full = t.startsWith('seed:') ? t : `seed:${t}`;
128
- if (!SEED_BY_NAME.has(full)) {
129
- const known = SEED_MANIFEST_ORDER.map((n) => shortLabel(n)).join(', ');
130
- throw new CLIError(`Unknown seed operation "${input}". Known short names: ${known}`, {
131
- code: ErrorCode.VALIDATION_FAILED,
132
- category: 'validation',
133
- });
208
+ // 1. Try the `seed:`-prefixed form (covers all legacy static entries).
209
+ const withPrefix = t.startsWith('seed:') ? t : `seed:${t}`;
210
+ if (SEED_BY_NAME.has(withPrefix))
211
+ return withPrefix;
212
+ // 2. Try the bare-slug form (covers registry-generated entries stored without `seed:`).
213
+ // Strip one leading `seed:` if the input has it, so both
214
+ // `seed-system-glossary` and `seed:seed-system-glossary` resolve to `seed-system-glossary`.
215
+ const bare = t.startsWith('seed:') ? t.slice('seed:'.length) : t;
216
+ if (SEED_BY_NAME.has(bare)) {
217
+ // Return the backend-compatible `seed:` form so callers can pass this directly
218
+ // to adminCall and the backend COMMAND_MAP will find it.
219
+ return `seed:${bare}`;
220
+ }
221
+ const known = SEED_MANIFEST_ORDER.map((n) => shortLabel(n)).join(', ');
222
+ throw new CLIError(`Unknown seed operation "${input}". Known short names: ${known}`, {
223
+ code: ErrorCode.VALIDATION_FAILED,
224
+ category: 'validation',
225
+ });
226
+ }
227
+ // ─── WP-379 S5a: Starter-specific arg builders ───────────────────────────────
228
+ /**
229
+ * Build args for seed:backfill-starter with CLI-side validation.
230
+ *
231
+ * Rules:
232
+ * - confirm:true requires workspaceScope to be explicitly provided
233
+ * - dryRun defaults to true when confirm is false
234
+ *
235
+ * Exported for testing.
236
+ */
237
+ export function buildBackfillStarterArgs(opts) {
238
+ const confirm = opts.confirm ?? false;
239
+ const dryRun = opts.dryRun ?? !confirm;
240
+ if (confirm && !opts.workspaceScope) {
241
+ throw new CLIError('backfill-starter: --workspace-scope (dev|prod|all) is required when --confirm is passed. ' +
242
+ 'Specify which deployment scope to seed to prevent accidental cross-scope writes.', { code: ErrorCode.VALIDATION_FAILED, category: 'validation' });
243
+ }
244
+ const validScopes = ['dev', 'prod', 'all'];
245
+ if (opts.workspaceScope && !validScopes.includes(opts.workspaceScope)) {
246
+ throw new CLIError(`backfill-starter: --workspace-scope must be one of: ${validScopes.join(', ')}. Got: "${opts.workspaceScope}"`, { code: ErrorCode.VALIDATION_FAILED, category: 'validation' });
134
247
  }
135
- return full;
248
+ const args = { dryRun, confirm };
249
+ if (opts.workspaceScope)
250
+ args.workspaceScope = opts.workspaceScope;
251
+ return args;
136
252
  }
137
253
  function resolveWorkspaceId(explicit) {
138
254
  if (explicit)
@@ -147,7 +263,10 @@ function requireWorkspaceId(explicit) {
147
263
  return id;
148
264
  }
149
265
  export function buildSeedArgs(manifestName, opts) {
150
- const def = SEED_BY_NAME.get(manifestName);
266
+ // Try exact match first (legacy static entries stored as `seed:<slug>`).
267
+ // Fall back to bare-slug lookup (registry-generated entries stored without `seed:` prefix).
268
+ const bare = manifestName.startsWith('seed:') ? manifestName.slice('seed:'.length) : manifestName;
269
+ const def = SEED_BY_NAME.get(manifestName) ?? SEED_BY_NAME.get(bare);
151
270
  if (!def) {
152
271
  throw new CLIError(`Unknown seed command: ${manifestName}`, {
153
272
  code: ErrorCode.VALIDATION_FAILED,
@@ -179,7 +298,7 @@ export function buildSeedArgs(manifestName, opts) {
179
298
  return args;
180
299
  }
181
300
  function printSeedList() {
182
- const rows = SEED_COMMAND_ENTRIES.map((e) => ({
301
+ const rows = ALL_SEED_COMMAND_ENTRIES.map((e) => ({
183
302
  name: shortLabel(e.name),
184
303
  description: e.description,
185
304
  workspace: e.requiresWorkspaceId ? 'yes' : 'no',
@@ -203,7 +322,7 @@ function printSeedList() {
203
322
  process.stdout.write(`${cyan(r.name.padEnd(wName))} ${r.workspace.padEnd(wWs)} ${dryRunStr} ${dim(r.description)}\n`);
204
323
  }
205
324
  process.stdout.write('\n');
206
- hint(`${SEED_COMMAND_ENTRIES.length} operations — behavior enforced server-side (commandManifest.ts)`);
325
+ hint(`${ALL_SEED_COMMAND_ENTRIES.length} operations — behavior enforced server-side (commandManifest.ts + WP-433 S1b registry)`);
207
326
  hint('pb admin seed run <name> Run one operation');
208
327
  hint('pb admin seed all Run all in manifest order');
209
328
  }
@@ -242,13 +361,153 @@ async function runSeedOperation(manifestName, opts) {
242
361
  const args = buildSeedArgs(manifestName, opts);
243
362
  return adminCall(manifestName, args);
244
363
  }
364
+ /**
365
+ * WP-433 S1b D16 — render the system/fleet seed status report.
366
+ *
367
+ * Frame: this is a system-admin (operator) command. Output never says "your workspace" —
368
+ * always "the system" / "X workspaces" / a specific named workspace.
369
+ */
370
+ function renderSeedStatusReport(data) {
371
+ if (!data || typeof data !== 'object') {
372
+ process.stdout.write(`${dim('No data returned.')}\n`);
373
+ return;
374
+ }
375
+ const report = data;
376
+ const mode = report.mode;
377
+ if (mode === 'fleet') {
378
+ const summary = report.summary;
379
+ const failures = report.failures ?? [];
380
+ process.stdout.write(`${bold(`System: ${summary.total} workspace${summary.total === 1 ? '' : 's'} total`)}\n\n`);
381
+ process.stdout.write(` ${green(icons.pass)} ${summary.healthy} healthy (all assertions passed)\n`);
382
+ if (summary.failed > 0) {
383
+ process.stdout.write(` ${red(icons.fail)} ${summary.failed} with failed assertions\n`);
384
+ }
385
+ if (summary.neverRun > 0) {
386
+ process.stdout.write(` ${dim('!')} ${summary.neverRun} with never-run ops (likely created pre-registry)\n`);
387
+ }
388
+ if (failures.length === 0) {
389
+ process.stdout.write(`\n${dim('No failures or never-run ops to report.')}\n`);
390
+ return;
391
+ }
392
+ // Group failures by status for readable output.
393
+ const failedRows = failures.filter((f) => f.status === 'failed');
394
+ const neverRunRows = failures.filter((f) => f.status === 'never-run');
395
+ if (failedRows.length > 0) {
396
+ process.stdout.write(`\n${red('Failures:')}\n`);
397
+ for (const f of failedRows) {
398
+ process.stdout.write(` - ${cyan(`workspace-${f.workspaceId}`)} (${bold(f.workspaceName)}) — ${f.slug}: ${f.detail}\n`);
399
+ if (f.recommendedRepairOp) {
400
+ process.stdout.write(` repair: ${dim(`pb admin seed run ${f.recommendedRepairOp} --workspace-id ${f.workspaceId}`)}\n`);
401
+ }
402
+ }
403
+ }
404
+ if (neverRunRows.length > 0) {
405
+ process.stdout.write(`\n${dim('Never-run ops:')}\n`);
406
+ for (const f of neverRunRows) {
407
+ process.stdout.write(` - ${cyan(`workspace-${f.workspaceId}`)} (${bold(f.workspaceName)}) — ${f.slug} never invoked\n`);
408
+ if (f.recommendedRepairOp) {
409
+ process.stdout.write(` repair: ${dim(`pb admin seed run ${f.recommendedRepairOp} --workspace-id ${f.workspaceId}`)}\n`);
410
+ }
411
+ }
412
+ }
413
+ return;
414
+ }
415
+ if (mode === 'drilldown') {
416
+ const workspaceName = report.workspaceName;
417
+ const workspaceId = report.workspaceId;
418
+ const rows = report.rows ?? [];
419
+ if (rows.length === 0) {
420
+ process.stdout.write(`${bold(`Workspace: ${workspaceName}`)} ${dim(`(${workspaceId})`)}\n\n`);
421
+ process.stdout.write(`${dim('No registered ops.')}\n`);
422
+ return;
423
+ }
424
+ // TEN-2021: group by level so non-tech operators don't conflate
425
+ // platform-substrate ops with on-demand repair tools.
426
+ const levelBySlug = new Map(REGISTRY_SEED_COMMAND_ENTRIES.map((e) => [e.name, e.level]));
427
+ const platformRows = rows.filter((r) => levelBySlug.get(r.slug) === 'platform');
428
+ const workspaceRows = rows.filter((r) => levelBySlug.get(r.slug) === 'workspace');
429
+ const repairRows = rows.filter((r) => levelBySlug.get(r.slug) === 'repair');
430
+ // TEN-2019 known soft-failure: platform-source workspace has no curated
431
+ // methods/skills entries to project. Not a workspace bug — render as ⚠.
432
+ const PLATFORM_SOURCE_EMPTY_MARKER = 'neither methods nor skills collection found';
433
+ const isPlatformSourceEmptyRow = (r) => r.status === 'failed' && r.detail.includes(PLATFORM_SOURCE_EMPTY_MARKER);
434
+ // ── Header: workspace identity + at-a-glance health summary ────────────────
435
+ const isSeedRow = (r) => {
436
+ const lvl = levelBySlug.get(r.slug);
437
+ return lvl === 'platform' || lvl === 'workspace';
438
+ };
439
+ const seedRows = rows.filter(isSeedRow);
440
+ const passCount = seedRows.filter((r) => r.status === 'passed').length;
441
+ const warnCount = seedRows.filter(isPlatformSourceEmptyRow).length;
442
+ const failCount = seedRows.filter((r) => r.status === 'failed' && !isPlatformSourceEmptyRow(r)).length;
443
+ process.stdout.write(`${bold('Workspace:')} ${workspaceName}\n`);
444
+ process.stdout.write(`${bold('ID:')} ${dim(workspaceId)}\n`);
445
+ process.stdout.write(`${bold('Health:')} ${green(`${passCount} ${icons.pass}`)} ${yellow(`${warnCount} ⚠`)} ${red(`${failCount} ${icons.fail}`)}\n\n`);
446
+ // ── Row renderer: only show detail on ⚠ / ✗ via indented sub-line ──────────
447
+ const renderRow = (r) => {
448
+ const isWarn = isPlatformSourceEmptyRow(r);
449
+ const icon = isWarn ? yellow('⚠')
450
+ : r.status === 'passed' ? green(icons.pass)
451
+ : r.status === 'failed' ? red(icons.fail)
452
+ : dim('-');
453
+ process.stdout.write(` ${icon} ${cyan(r.slug)}\n`);
454
+ // Detail sub-line only for genuine signals (⚠ or ✗). ✓ and "-" are noise.
455
+ if (isWarn) {
456
+ process.stdout.write(` ${dim('└─ Platform-curated content not yet published (TEN-2019).')}\n`);
457
+ }
458
+ else if (r.status === 'failed') {
459
+ const cleaned = r.detail.replace(new RegExp(`^${r.slug} assertion failed:\\s*`), '');
460
+ process.stdout.write(` ${dim(`└─ ${cleaned}`)}\n`);
461
+ }
462
+ };
463
+ if (platformRows.length > 0) {
464
+ process.stdout.write(`${bold('Seeded on workspace creation')}\n`);
465
+ process.stdout.write(`${dim('Runs automatically when a new workspace is created.')}\n\n`);
466
+ for (const r of platformRows)
467
+ renderRow(r);
468
+ process.stdout.write('\n');
469
+ }
470
+ if (workspaceRows.length > 0) {
471
+ process.stdout.write(`${bold('Owner-level defaults')}\n`);
472
+ process.stdout.write(`${dim('Per-workspace state seeded for the owner.')}\n\n`);
473
+ for (const r of workspaceRows)
474
+ renderRow(r);
475
+ process.stdout.write('\n');
476
+ }
477
+ if (repairRows.length > 0) {
478
+ process.stdout.write(`${bold('Repair commands (manual)')}\n`);
479
+ process.stdout.write(`${dim('Used to fix older or drifted workspaces. Usually nothing to do.')}\n\n`);
480
+ for (const r of repairRows)
481
+ renderRow(r);
482
+ }
483
+ return;
484
+ }
485
+ if (mode === 'op-filter') {
486
+ const slug = report.slug;
487
+ const rows = report.rows ?? [];
488
+ process.stdout.write(`${bold(`Op: ${slug}`)} ${dim(`(${rows.length} workspace${rows.length === 1 ? '' : 's'})`)}\n\n`);
489
+ if (rows.length === 0) {
490
+ process.stdout.write(`${dim('Op not found in registry, or no workspaces exist.')}\n`);
491
+ return;
492
+ }
493
+ for (const r of rows) {
494
+ const icon = r.status === 'passed' ? green(icons.pass)
495
+ : r.status === 'failed' ? red(icons.fail)
496
+ : dim('-');
497
+ const detail = r.detail ? ` ${dim(r.detail)}` : '';
498
+ process.stdout.write(` ${icon} ${cyan(`workspace-${r.workspaceId}`)} (${bold(r.workspaceName)})${detail}\n`);
499
+ }
500
+ return;
501
+ }
502
+ process.stdout.write(`${dim('Unknown report mode.')}\n`);
503
+ }
245
504
  /** Attach seed subcommands to the `seed` Commander node. */
246
505
  export function attachSeedCommands(seed) {
247
506
  // Default action when `pb admin seed` is invoked with no subcommand.
248
507
  seed.action(async () => {
249
508
  if (isJsonMode()) {
250
509
  process.stdout.write(JSON.stringify({
251
- operations: SEED_COMMAND_ENTRIES.map((e) => ({
510
+ operations: ALL_SEED_COMMAND_ENTRIES.map((e) => ({
252
511
  name: shortLabel(e.name),
253
512
  requiresWorkspaceId: e.requiresWorkspaceId,
254
513
  dryRunSupported: e.dryRunSupported,
@@ -267,7 +526,7 @@ export function attachSeedCommands(seed) {
267
526
  if (isInteractive()) {
268
527
  intro('Seed Operations');
269
528
  // methodology-preset needs --preset-id, not suitable for interactive menu
270
- const menuEntries = SEED_COMMAND_ENTRIES.filter((e) => e.name !== 'seed:methodology-preset');
529
+ const menuEntries = ALL_SEED_COMMAND_ENTRIES.filter((e) => e.name !== 'seed:methodology-preset');
271
530
  const selected = await multiselect({
272
531
  message: 'Select operations to run (space to toggle, enter to confirm):',
273
532
  options: menuEntries.map((e) => ({
@@ -317,7 +576,7 @@ export function attachSeedCommands(seed) {
317
576
  try {
318
577
  await withSpinner(`Running ${shortLabel(name)}`, async () => {
319
578
  const args = buildSeedArgs(name, { workspaceId });
320
- await adminCall(name, args);
579
+ await adminCall(toBackendCommand(name), args);
321
580
  });
322
581
  results.push({ name, ok: true });
323
582
  }
@@ -343,23 +602,23 @@ export function attachSeedCommands(seed) {
343
602
  return;
344
603
  }
345
604
  // Non-interactive (non-JSON) fallback — existing static preview
346
- process.stdout.write(`${heading('Seed operations')} ${dim(`(${SEED_COMMAND_ENTRIES.length})`)}\n\n`);
605
+ process.stdout.write(`${heading('Seed operations')} ${dim(`(${ALL_SEED_COMMAND_ENTRIES.length})`)}\n\n`);
347
606
  // Show first 6 entries as a preview
348
- const preview = SEED_COMMAND_ENTRIES.slice(0, 6);
607
+ const preview = ALL_SEED_COMMAND_ENTRIES.slice(0, 6);
349
608
  const wName = Math.max(...preview.map((e) => shortLabel(e.name).length));
350
609
  for (const e of preview) {
351
610
  const label = shortLabel(e.name);
352
611
  const flags = e.dryRunSupported ? dim(' dry-run ✓') : '';
353
612
  process.stdout.write(` ${cyan(label.padEnd(wName))} ${dim(e.description)}${flags}\n`);
354
613
  }
355
- if (SEED_COMMAND_ENTRIES.length > 6) {
356
- process.stdout.write(` ${dim(`... ${SEED_COMMAND_ENTRIES.length - 6} more — run pb admin seed list`)}\n`);
614
+ if (ALL_SEED_COMMAND_ENTRIES.length > 6) {
615
+ process.stdout.write(` ${dim(`... ${ALL_SEED_COMMAND_ENTRIES.length - 6} more — run pb admin seed list`)}\n`);
357
616
  }
358
617
  process.stdout.write('\n');
359
618
  process.stdout.write(` ${cyan('pb admin seed list')} ${dim('Full list with workspace + dry-run flags')}\n`);
360
619
  process.stdout.write(` ${cyan('pb admin seed run <name>')} ${dim('Run one operation')}\n`);
361
620
  process.stdout.write(` ${cyan('pb admin seed all')} ${dim('Run all in manifest order')}\n`);
362
- process.stdout.write(` ${cyan('pb admin seed status')} ${dim('Workspace readiness signals')}\n`);
621
+ process.stdout.write(` ${cyan('pb admin seed status')} ${dim('Fleet-wide seed health (system admin)')}\n`);
363
622
  process.stdout.write('\n');
364
623
  });
365
624
  seed
@@ -368,22 +627,56 @@ export function attachSeedCommands(seed) {
368
627
  .action(() => {
369
628
  printSeedList();
370
629
  });
630
+ // WP-433 S1b D16 — fleet-wide seed status (system-admin command).
631
+ // Default behaviour: scan ALL workspaces in the deployment and report summary + failures.
632
+ // `--workspace-id <id>` drilldown flag triages a single workspace.
633
+ // `--op <slug>` fleet view filtered to one op.
634
+ // `--failed-only` fleet view skipping healthy workspaces.
635
+ // `--legacy-readiness` falls back to the pre-S1b workspace-readiness signals view.
371
636
  seed
372
637
  .command('status')
373
- .description('Readiness + workspace collection signals (no per-seed run log yet)')
374
- .option('--workspace-id <id>', 'Workspace id (defaults to session workspace when set)')
638
+ .description('WP-433 S1b D16: Fleet-wide seed health (system admin). Default scans ALL workspaces. ' +
639
+ 'Use --workspace-id to drill down, --op to filter one op, --failed-only for failures only.')
640
+ .option('--workspace-id <id>', 'Drill down to one workspace (operator triage)')
641
+ .option('--op <slug>', 'Filter fleet view to one op slug')
642
+ .option('--failed-only', 'Skip healthy workspaces; show failures only', false)
643
+ .option('--legacy-readiness', 'Use pre-S1b workspace readiness signals view', false)
375
644
  .action(async (options) => {
645
+ if (options.legacyReadiness) {
646
+ if (!isJsonMode()) {
647
+ try {
648
+ adminBanner(resolveAdminConfig().siteUrl);
649
+ }
650
+ catch { /* not configured */ }
651
+ intro('Seed: status (legacy readiness)');
652
+ }
653
+ await printSeedStatus(options.workspaceId);
654
+ if (!isJsonMode()) {
655
+ outro('Read-only status check complete');
656
+ }
657
+ return;
658
+ }
376
659
  if (!isJsonMode()) {
377
660
  try {
378
661
  adminBanner(resolveAdminConfig().siteUrl);
379
662
  }
380
663
  catch { /* not configured */ }
381
- intro('Seed: status');
664
+ intro('Seed status — system / fleet view');
382
665
  }
383
- await printSeedStatus(options.workspaceId);
384
- if (!isJsonMode()) {
385
- outro('Read-only status check complete');
666
+ const callArgs = {};
667
+ if (options.workspaceId)
668
+ callArgs.workspaceId = options.workspaceId;
669
+ if (options.op)
670
+ callArgs.opSlug = options.op;
671
+ if (options.failedOnly)
672
+ callArgs.failedOnly = true;
673
+ const data = await withSpinner('Scanning the system', () => adminCall('admin:seed-status', callArgs));
674
+ if (isJsonMode()) {
675
+ process.stdout.write(JSON.stringify(data, null, 2) + '\n');
676
+ return;
386
677
  }
678
+ renderSeedStatusReport(data);
679
+ outro('Done');
387
680
  });
388
681
  seed
389
682
  .command('run')
@@ -396,7 +689,6 @@ export function attachSeedCommands(seed) {
396
689
  .action(async (name, options) => {
397
690
  const { siteUrl } = resolveAdminConfig();
398
691
  const manifestName = normalizeSeedCommandName(name);
399
- const meta = SEED_BY_NAME.get(manifestName);
400
692
  const needsConfirm = requiresAdminDestructiveConfirmation(siteUrl);
401
693
  // Remote / prod deployments require confirmation — not local or known dev-cloud.
402
694
  if (needsConfirm) {
@@ -434,6 +726,156 @@ export function attachSeedCommands(seed) {
434
726
  note(summaryLines || 'No response data', manifestName);
435
727
  outro('Complete');
436
728
  });
729
+ // ─── WP-379 S5a: Starter Setup subcommands ─────────────────────────────────
730
+ seed
731
+ .command('show-starter')
732
+ .description('List 18 Starter Setup assets for a workspace with body previews, lockLevel, and gate summary')
733
+ .option('--workspace-id <id>', 'Workspace id (required; defaults to session workspace when set)')
734
+ .action(async (options) => {
735
+ const wsId = requireWorkspaceId(options.workspaceId);
736
+ const { siteUrl } = resolveAdminConfig();
737
+ if (!isJsonMode()) {
738
+ adminBanner(siteUrl);
739
+ intro('seed:show-starter');
740
+ }
741
+ const data = await withSpinner('Fetching starter assets', () => adminCall('seed:show-starter', { workspaceId: wsId }));
742
+ if (isJsonMode()) {
743
+ process.stdout.write(JSON.stringify(data, null, 2) + '\n');
744
+ return;
745
+ }
746
+ const assets = Array.isArray(data?.assets) ? data.assets : [];
747
+ if (assets.length === 0) {
748
+ note('No platform-seeded assets found. Run: pb admin seed run backfill-starter', 'show-starter');
749
+ outro('Done');
750
+ return;
751
+ }
752
+ const wIdx = assets.length.toString().length + 2;
753
+ const wId = Math.max(10, ...assets.map((a) => a.entryId.length));
754
+ const wLock = 10;
755
+ const wGate = 24;
756
+ process.stdout.write(`${bold(`${'#'.padEnd(wIdx)}${' '}${'Entry ID'.padEnd(wId)} ${'Lock'.padEnd(wLock)} ${'Gate'.padEnd(wGate)} Name / Preview`)}\n`);
757
+ process.stdout.write(dim('─'.repeat(wIdx + wId + wLock + wGate + 40)) + '\n');
758
+ assets.forEach((asset, i) => {
759
+ const idx = `${i + 1}.`.padEnd(wIdx);
760
+ const entryId = cyan(asset.entryId.padEnd(wId));
761
+ const lock = dim((asset.lockLevel ?? '—').padEnd(wLock));
762
+ const gateStr = asset.gate
763
+ ? asset.gate.kind === 'always'
764
+ ? 'always'
765
+ : `readiness[${asset.gate.min ?? '0'}–${asset.gate.max ?? '100'}]`
766
+ : '—';
767
+ const gate = dim(gateStr.padEnd(wGate));
768
+ const preview = dim(asset.bodyPreview.slice(0, 60));
769
+ process.stdout.write(`${idx} ${entryId} ${lock} ${gate} ${bold(asset.name)} ${preview}\n`);
770
+ });
771
+ process.stdout.write('\n');
772
+ note(`${assets.length} / 18 starter assets seeded`, 'show-starter');
773
+ outro('Done');
774
+ });
775
+ seed
776
+ .command('backfill-starter')
777
+ .description('Idempotent bulk seed of Starter Setup bundle across workspaces (dry-run by default)')
778
+ .option('--all', 'Required: acknowledge you intend to act on all workspaces in scope', false)
779
+ .option('--dry-run', 'Preview what would be seeded without writing anything (default behavior)', false)
780
+ .option('--workspace-scope <scope>', 'Required when --confirm is passed: dev | prod | all')
781
+ .option('--confirm', 'Execute seeds (requires --all and --workspace-scope)', false)
782
+ .action(async (options) => {
783
+ const { siteUrl } = resolveAdminConfig();
784
+ // CLI-side guard: --confirm requires --all
785
+ if (options.confirm && !options.all) {
786
+ process.stderr.write(red('Error: --confirm requires --all. Pass --all to acknowledge you intend to act on all workspaces in scope.\n'));
787
+ process.exitCode = 1;
788
+ return;
789
+ }
790
+ // Validate args and enforce scope gate via shared helper (also used by tests)
791
+ let callArgs;
792
+ try {
793
+ callArgs = buildBackfillStarterArgs({
794
+ confirm: options.confirm,
795
+ dryRun: options.dryRun,
796
+ workspaceScope: options.workspaceScope,
797
+ });
798
+ }
799
+ catch (e) {
800
+ process.stderr.write(red(`Error: ${e instanceof Error ? e.message : String(e)}\n`));
801
+ process.exitCode = 1;
802
+ return;
803
+ }
804
+ const isConfirm = options.confirm;
805
+ const isDryRun = callArgs.dryRun;
806
+ // Production acknowledgment for destructive confirm path
807
+ const needsConfirm = requiresAdminDestructiveConfirmation(siteUrl);
808
+ if (isConfirm && needsConfirm) {
809
+ const ok = await confirmProdAction({
810
+ confirm: options.confirm,
811
+ isProduction: true,
812
+ message: `Seed Starter Setup across ALL workspaces (scope: ${options.workspaceScope ?? 'all'}) on ${siteUrl}`,
813
+ noteTitle: confirmRiskNoteTitle(siteUrl),
814
+ });
815
+ if (!ok) {
816
+ process.stderr.write('Cancelled.\n');
817
+ process.exitCode = 1;
818
+ return;
819
+ }
820
+ }
821
+ if (!isJsonMode()) {
822
+ adminBanner(siteUrl);
823
+ intro(`seed:backfill-starter (${isDryRun ? 'DRY RUN' : 'EXECUTE'})`);
824
+ }
825
+ const result = await withSpinner(isDryRun ? 'Running dry-run scan' : 'Seeding workspaces', () => adminCall('seed:backfill-starter', callArgs));
826
+ if (isJsonMode()) {
827
+ process.stdout.write(JSON.stringify(result, null, 2) + '\n');
828
+ return;
829
+ }
830
+ // Per-workspace progress
831
+ const rows = Array.isArray(result?.rows) ? result.rows : [];
832
+ for (const row of rows) {
833
+ const statusIcon = row.status === 'seeded' ? green(icons.pass) :
834
+ row.status === 'already-seeded' ? dim(icons.dot) :
835
+ row.status === 'errored' ? red(icons.fail) :
836
+ dim(icons.dot);
837
+ const detail = row.detail ? dim(` ${row.detail}`) : '';
838
+ process.stdout.write(` ${statusIcon} ${bold(row.workspaceName)}${detail}\n`);
839
+ }
840
+ // Summary
841
+ const summaryLines = [
842
+ `Total workspaces: ${result.totalWorkspaces}`,
843
+ result.seededCount > 0 ? `${green(icons.pass)} Seeded: ${result.seededCount}` : null,
844
+ result.alreadySeededCount > 0 ? `${dim(icons.dot)} Already seeded: ${result.alreadySeededCount}` : null,
845
+ result.skippedCount > 0 ? `${dim(icons.dot)} Skipped (dry-run): ${result.skippedCount}` : null,
846
+ `Scope: ${result.workspaceScope}`,
847
+ result.dryRun ? dim('(dry-run — no writes performed)') : green('(writes executed)'),
848
+ ].filter(Boolean).join('\n');
849
+ note(summaryLines, 'backfill-starter');
850
+ outro('Done');
851
+ });
852
+ seed
853
+ .command('migrate-starter-fields')
854
+ .description('STUB (WP-379 S5b): backfill explicit lockLevel + gate columns on existing setup-assets entries')
855
+ .option('--workspace-id <id>', 'Workspace id (required; defaults to session workspace when set)')
856
+ .option('--dry-run', 'Preview changes without writing (default in stub)', false)
857
+ .action(async (options) => {
858
+ const wsId = requireWorkspaceId(options.workspaceId);
859
+ const { siteUrl } = resolveAdminConfig();
860
+ if (!isJsonMode()) {
861
+ adminBanner(siteUrl);
862
+ intro('seed:migrate-starter-fields');
863
+ }
864
+ const result = await withSpinner('Calling migrate-starter-fields', () => adminCall('seed:migrate-starter-fields', { workspaceId: wsId, dryRun: options.dryRun }));
865
+ if (isJsonMode()) {
866
+ process.stdout.write(JSON.stringify({ command: 'seed:migrate-starter-fields', data: result }, null, 2) + '\n');
867
+ return;
868
+ }
869
+ const summaryLines = [
870
+ `Migrated: ${result.migrated}`,
871
+ `Skipped: ${result.skipped}`,
872
+ `Dry-run: ${result.dryRun}`,
873
+ result.note ? dim(result.note) : null,
874
+ ].filter(Boolean).join('\n');
875
+ note(summaryLines, 'migrate-starter-fields');
876
+ outro('Done');
877
+ });
878
+ // ─── End WP-379 S5a Starter Setup subcommands ───────────────────────────────
437
879
  seed
438
880
  .command('all')
439
881
  .description('Run all seed operations in manifest order (skips methodology-preset unless --preset-id)')
@@ -467,7 +909,7 @@ export function attachSeedCommands(seed) {
467
909
  }
468
910
  try {
469
911
  const args = buildSeedArgs(cmd, { workspaceId: options.workspaceId, dryRun: options.dryRun, presetId: options.presetId });
470
- await adminCall(cmd, args);
912
+ await adminCall(toBackendCommand(cmd), args);
471
913
  results.push({ command: cmd, ok: true });
472
914
  }
473
915
  catch (e) {
@@ -499,7 +941,7 @@ export function attachSeedCommands(seed) {
499
941
  s.start(`${current}/${total} ${label}`);
500
942
  try {
501
943
  const args = buildSeedArgs(cmd, { workspaceId: options.workspaceId, dryRun: options.dryRun, presetId: options.presetId });
502
- await adminCall(cmd, args);
944
+ await adminCall(toBackendCommand(cmd), args);
503
945
  s.stop(`${green(icons.pass)} ${label}`);
504
946
  results.push({ command: cmd, ok: true });
505
947
  }