@productbrain/cli 0.1.0-beta.7 → 0.1.0-beta.71
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.
- package/README.md +98 -30
- package/dist/__tests__/adapters.test.d.ts +2 -0
- package/dist/__tests__/adapters.test.d.ts.map +1 -0
- package/dist/__tests__/adapters.test.js +417 -0
- package/dist/__tests__/adapters.test.js.map +1 -0
- package/dist/__tests__/audit.test.d.ts +2 -0
- package/dist/__tests__/audit.test.d.ts.map +1 -0
- package/dist/__tests__/audit.test.js +394 -0
- package/dist/__tests__/audit.test.js.map +1 -0
- package/dist/__tests__/batch-transformations.test.d.ts +2 -0
- package/dist/__tests__/batch-transformations.test.d.ts.map +1 -0
- package/dist/__tests__/batch-transformations.test.js +263 -0
- package/dist/__tests__/batch-transformations.test.js.map +1 -0
- package/dist/__tests__/capture.test.d.ts +2 -0
- package/dist/__tests__/capture.test.d.ts.map +1 -0
- package/dist/__tests__/capture.test.js +377 -0
- package/dist/__tests__/capture.test.js.map +1 -0
- package/dist/__tests__/config.test.d.ts +8 -0
- package/dist/__tests__/config.test.d.ts.map +1 -0
- package/dist/__tests__/config.test.js +166 -0
- package/dist/__tests__/config.test.js.map +1 -0
- package/dist/__tests__/constants.test.d.ts +2 -0
- package/dist/__tests__/constants.test.d.ts.map +1 -0
- package/dist/__tests__/constants.test.js +141 -0
- package/dist/__tests__/constants.test.js.map +1 -0
- package/dist/__tests__/constellation.test.d.ts +2 -0
- package/dist/__tests__/constellation.test.d.ts.map +1 -0
- package/dist/__tests__/constellation.test.js +254 -0
- package/dist/__tests__/constellation.test.js.map +1 -0
- package/dist/__tests__/context-strategy.test.d.ts +2 -0
- package/dist/__tests__/context-strategy.test.d.ts.map +1 -0
- package/dist/__tests__/context-strategy.test.js +79 -0
- package/dist/__tests__/context-strategy.test.js.map +1 -0
- package/dist/__tests__/errors.test.d.ts +2 -0
- package/dist/__tests__/errors.test.d.ts.map +1 -0
- package/dist/__tests__/errors.test.js +117 -0
- package/dist/__tests__/errors.test.js.map +1 -0
- package/dist/__tests__/experiment.test.d.ts +6 -0
- package/dist/__tests__/experiment.test.d.ts.map +1 -0
- package/dist/__tests__/experiment.test.js +69 -0
- package/dist/__tests__/experiment.test.js.map +1 -0
- package/dist/__tests__/fields.test.d.ts +2 -0
- package/dist/__tests__/fields.test.d.ts.map +1 -0
- package/dist/__tests__/fields.test.js +238 -0
- package/dist/__tests__/fields.test.js.map +1 -0
- package/dist/__tests__/glossary.test.d.ts +2 -0
- package/dist/__tests__/glossary.test.d.ts.map +1 -0
- package/dist/__tests__/glossary.test.js +32 -0
- package/dist/__tests__/glossary.test.js.map +1 -0
- package/dist/__tests__/handshake.test.d.ts +2 -0
- package/dist/__tests__/handshake.test.d.ts.map +1 -0
- package/dist/__tests__/handshake.test.js +196 -0
- package/dist/__tests__/handshake.test.js.map +1 -0
- package/dist/__tests__/ingest.test.js +110 -12
- package/dist/__tests__/ingest.test.js.map +1 -1
- package/dist/__tests__/init.test.d.ts +7 -0
- package/dist/__tests__/init.test.d.ts.map +1 -0
- package/dist/__tests__/init.test.js +146 -0
- package/dist/__tests__/init.test.js.map +1 -0
- package/dist/__tests__/login.test.d.ts +2 -0
- package/dist/__tests__/login.test.d.ts.map +1 -0
- package/dist/__tests__/login.test.js +167 -0
- package/dist/__tests__/login.test.js.map +1 -0
- package/dist/__tests__/onboarding-path-b.test.d.ts +2 -0
- package/dist/__tests__/onboarding-path-b.test.d.ts.map +1 -0
- package/dist/__tests__/onboarding-path-b.test.js +46 -0
- package/dist/__tests__/onboarding-path-b.test.js.map +1 -0
- package/dist/__tests__/onboarding.test.d.ts +6 -0
- package/dist/__tests__/onboarding.test.d.ts.map +1 -0
- package/dist/__tests__/onboarding.test.js +347 -0
- package/dist/__tests__/onboarding.test.js.map +1 -0
- package/dist/__tests__/orient.test.d.ts +2 -0
- package/dist/__tests__/orient.test.d.ts.map +1 -0
- package/dist/__tests__/orient.test.js +143 -0
- package/dist/__tests__/orient.test.js.map +1 -0
- package/dist/__tests__/profiles.test.d.ts +2 -0
- package/dist/__tests__/profiles.test.d.ts.map +1 -0
- package/dist/__tests__/profiles.test.js +168 -0
- package/dist/__tests__/profiles.test.js.map +1 -0
- package/dist/__tests__/promote.test.d.ts +2 -0
- package/dist/__tests__/promote.test.d.ts.map +1 -0
- package/dist/__tests__/promote.test.js +161 -0
- package/dist/__tests__/promote.test.js.map +1 -0
- package/dist/__tests__/prompts.test.d.ts +6 -0
- package/dist/__tests__/prompts.test.d.ts.map +1 -0
- package/dist/__tests__/prompts.test.js +146 -0
- package/dist/__tests__/prompts.test.js.map +1 -0
- package/dist/__tests__/proposals.test.d.ts +2 -0
- package/dist/__tests__/proposals.test.d.ts.map +1 -0
- package/dist/__tests__/proposals.test.js +167 -0
- package/dist/__tests__/proposals.test.js.map +1 -0
- package/dist/__tests__/relate.test.d.ts +2 -0
- package/dist/__tests__/relate.test.d.ts.map +1 -0
- package/dist/__tests__/relate.test.js +103 -0
- package/dist/__tests__/relate.test.js.map +1 -0
- package/dist/__tests__/repo-detect.test.d.ts +2 -0
- package/dist/__tests__/repo-detect.test.d.ts.map +1 -0
- package/dist/__tests__/repo-detect.test.js +215 -0
- package/dist/__tests__/repo-detect.test.js.map +1 -0
- package/dist/__tests__/runner.test.d.ts +2 -0
- package/dist/__tests__/runner.test.d.ts.map +1 -0
- package/dist/__tests__/runner.test.js +219 -0
- package/dist/__tests__/runner.test.js.map +1 -0
- package/dist/__tests__/session-state-machine.test.d.ts +2 -0
- package/dist/__tests__/session-state-machine.test.d.ts.map +1 -0
- package/dist/__tests__/session-state-machine.test.js +154 -0
- package/dist/__tests__/session-state-machine.test.js.map +1 -0
- package/dist/__tests__/session-touch.test.d.ts +2 -0
- package/dist/__tests__/session-touch.test.d.ts.map +1 -0
- package/dist/__tests__/session-touch.test.js +134 -0
- package/dist/__tests__/session-touch.test.js.map +1 -0
- package/dist/__tests__/session.test.d.ts +2 -0
- package/dist/__tests__/session.test.d.ts.map +1 -0
- package/dist/__tests__/session.test.js +46 -0
- package/dist/__tests__/session.test.js.map +1 -0
- package/dist/__tests__/setup.test.d.ts +2 -0
- package/dist/__tests__/setup.test.d.ts.map +1 -0
- package/dist/__tests__/setup.test.js +141 -0
- package/dist/__tests__/setup.test.js.map +1 -0
- package/dist/__tests__/spinner-labels.test.d.ts +2 -0
- package/dist/__tests__/spinner-labels.test.d.ts.map +1 -0
- package/dist/__tests__/spinner-labels.test.js +23 -0
- package/dist/__tests__/spinner-labels.test.js.map +1 -0
- package/dist/__tests__/strip.test.d.ts +2 -0
- package/dist/__tests__/strip.test.d.ts.map +1 -0
- package/dist/__tests__/strip.test.js +136 -0
- package/dist/__tests__/strip.test.js.map +1 -0
- package/dist/__tests__/surface-profiles.test.d.ts +2 -0
- package/dist/__tests__/surface-profiles.test.d.ts.map +1 -0
- package/dist/__tests__/surface-profiles.test.js +233 -0
- package/dist/__tests__/surface-profiles.test.js.map +1 -0
- package/dist/__tests__/update.test.d.ts +2 -0
- package/dist/__tests__/update.test.d.ts.map +1 -0
- package/dist/__tests__/update.test.js +228 -0
- package/dist/__tests__/update.test.js.map +1 -0
- package/dist/__tests__/workspace.test.d.ts +2 -0
- package/dist/__tests__/workspace.test.d.ts.map +1 -0
- package/dist/__tests__/workspace.test.js +308 -0
- package/dist/__tests__/workspace.test.js.map +1 -0
- package/dist/commands/accept.d.ts +18 -0
- package/dist/commands/accept.d.ts.map +1 -0
- package/dist/commands/accept.js +76 -0
- package/dist/commands/accept.js.map +1 -0
- package/dist/commands/admin/cockpit.d.ts +88 -0
- package/dist/commands/admin/cockpit.d.ts.map +1 -0
- package/dist/commands/admin/cockpit.js +409 -0
- package/dist/commands/admin/cockpit.js.map +1 -0
- package/dist/commands/admin/index.d.ts +21 -0
- package/dist/commands/admin/index.d.ts.map +1 -0
- package/dist/commands/admin/index.js +254 -0
- package/dist/commands/admin/index.js.map +1 -0
- package/dist/commands/admin/inspect.d.ts +21 -0
- package/dist/commands/admin/inspect.d.ts.map +1 -0
- package/dist/commands/admin/inspect.js +536 -0
- package/dist/commands/admin/inspect.js.map +1 -0
- package/dist/commands/admin/inspect.test.d.ts +7 -0
- package/dist/commands/admin/inspect.test.d.ts.map +1 -0
- package/dist/commands/admin/inspect.test.js +71 -0
- package/dist/commands/admin/inspect.test.js.map +1 -0
- package/dist/commands/admin/seed.d.ts +32 -0
- package/dist/commands/admin/seed.d.ts.map +1 -0
- package/dist/commands/admin/seed.js +527 -0
- package/dist/commands/admin/seed.js.map +1 -0
- package/dist/commands/admin/seed.test.d.ts +6 -0
- package/dist/commands/admin/seed.test.d.ts.map +1 -0
- package/dist/commands/admin/seed.test.js +65 -0
- package/dist/commands/admin/seed.test.js.map +1 -0
- package/dist/commands/audit.d.ts +25 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +188 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/brand-pack.d.ts +2 -0
- package/dist/commands/brand-pack.d.ts.map +1 -0
- package/dist/commands/brand-pack.js +25 -0
- package/dist/commands/brand-pack.js.map +1 -0
- package/dist/commands/brief.d.ts +28 -0
- package/dist/commands/brief.d.ts.map +1 -0
- package/dist/commands/brief.js +75 -0
- package/dist/commands/brief.js.map +1 -0
- package/dist/commands/capture.d.ts +30 -0
- package/dist/commands/capture.d.ts.map +1 -0
- package/dist/commands/capture.js +385 -0
- package/dist/commands/capture.js.map +1 -0
- package/dist/commands/chain-walk.d.ts +14 -0
- package/dist/commands/chain-walk.d.ts.map +1 -0
- package/dist/commands/chain-walk.js +38 -0
- package/dist/commands/chain-walk.js.map +1 -0
- package/dist/commands/changes.d.ts +11 -0
- package/dist/commands/changes.d.ts.map +1 -0
- package/dist/commands/changes.js +46 -0
- package/dist/commands/changes.js.map +1 -0
- package/dist/commands/codex-prep.d.ts +12 -0
- package/dist/commands/codex-prep.d.ts.map +1 -0
- package/dist/commands/codex-prep.js +122 -0
- package/dist/commands/codex-prep.js.map +1 -0
- package/dist/commands/collections.d.ts +22 -0
- package/dist/commands/collections.d.ts.map +1 -0
- package/dist/commands/collections.js +77 -0
- package/dist/commands/collections.js.map +1 -0
- package/dist/commands/connect-integration.test.d.ts +7 -0
- package/dist/commands/connect-integration.test.d.ts.map +1 -0
- package/dist/commands/connect-integration.test.js +200 -0
- package/dist/commands/connect-integration.test.js.map +1 -0
- package/dist/commands/connect.d.ts +21 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +279 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/connect.test.d.ts +6 -0
- package/dist/commands/connect.test.d.ts.map +1 -0
- package/dist/commands/connect.test.js +230 -0
- package/dist/commands/connect.test.js.map +1 -0
- package/dist/commands/constellation.d.ts +11 -0
- package/dist/commands/constellation.d.ts.map +1 -0
- package/dist/commands/constellation.js +33 -0
- package/dist/commands/constellation.js.map +1 -0
- package/dist/commands/context.d.ts +2 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +21 -10
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/cross-cut.d.ts +11 -0
- package/dist/commands/cross-cut.d.ts.map +1 -0
- package/dist/commands/cross-cut.js +23 -0
- package/dist/commands/cross-cut.js.map +1 -0
- package/dist/commands/doctor.d.ts +18 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +232 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/doctor.test.d.ts +8 -0
- package/dist/commands/doctor.test.d.ts.map +1 -0
- package/dist/commands/doctor.test.js +311 -0
- package/dist/commands/doctor.test.js.map +1 -0
- package/dist/commands/fields.d.ts +9 -0
- package/dist/commands/fields.d.ts.map +1 -0
- package/dist/commands/fields.js +30 -0
- package/dist/commands/fields.js.map +1 -0
- package/dist/commands/get.d.ts +8 -1
- package/dist/commands/get.d.ts.map +1 -1
- package/dist/commands/get.js +61 -8
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/handshake.d.ts +28 -0
- package/dist/commands/handshake.d.ts.map +1 -0
- package/dist/commands/handshake.js +617 -0
- package/dist/commands/handshake.js.map +1 -0
- package/dist/commands/ingest.d.ts +8 -2
- package/dist/commands/ingest.d.ts.map +1 -1
- package/dist/commands/ingest.js +151 -28
- package/dist/commands/ingest.js.map +1 -1
- package/dist/commands/init.d.ts +14 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +117 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +4 -0
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +101 -38
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/orient.d.ts +107 -1
- package/dist/commands/orient.d.ts.map +1 -1
- package/dist/commands/orient.js +25 -9
- package/dist/commands/orient.js.map +1 -1
- package/dist/commands/profile.d.ts +24 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +82 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/promote.d.ts +12 -0
- package/dist/commands/promote.d.ts.map +1 -0
- package/dist/commands/promote.js +90 -0
- package/dist/commands/promote.js.map +1 -0
- package/dist/commands/proposals.d.ts +9 -0
- package/dist/commands/proposals.d.ts.map +1 -0
- package/dist/commands/proposals.js +24 -0
- package/dist/commands/proposals.js.map +1 -0
- package/dist/commands/reject.d.ts +14 -0
- package/dist/commands/reject.d.ts.map +1 -0
- package/dist/commands/reject.js +43 -0
- package/dist/commands/reject.js.map +1 -0
- package/dist/commands/relate.d.ts +16 -0
- package/dist/commands/relate.d.ts.map +1 -0
- package/dist/commands/relate.js +98 -0
- package/dist/commands/relate.js.map +1 -0
- package/dist/commands/search.d.ts +1 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +6 -4
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/session.d.ts +20 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +203 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/setup.d.ts +15 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +168 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/update.d.ts +17 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +178 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/usage.d.ts +40 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +232 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/commands/verify.d.ts +13 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +49 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/commands/workspace.d.ts +41 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +239 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/formatters/audit.d.ts +46 -0
- package/dist/formatters/audit.d.ts.map +1 -0
- package/dist/formatters/audit.js +81 -0
- package/dist/formatters/audit.js.map +1 -0
- package/dist/formatters/brief.d.ts +112 -0
- package/dist/formatters/brief.d.ts.map +1 -0
- package/dist/formatters/brief.js +179 -0
- package/dist/formatters/brief.js.map +1 -0
- package/dist/formatters/capture.d.ts +48 -0
- package/dist/formatters/capture.d.ts.map +1 -0
- package/dist/formatters/capture.js +77 -0
- package/dist/formatters/capture.js.map +1 -0
- package/dist/formatters/chain-walk.d.ts +33 -0
- package/dist/formatters/chain-walk.d.ts.map +1 -0
- package/dist/formatters/chain-walk.js +54 -0
- package/dist/formatters/chain-walk.js.map +1 -0
- package/dist/formatters/changes.d.ts +25 -0
- package/dist/formatters/changes.d.ts.map +1 -0
- package/dist/formatters/changes.js +60 -0
- package/dist/formatters/changes.js.map +1 -0
- package/dist/formatters/collections.d.ts +40 -0
- package/dist/formatters/collections.d.ts.map +1 -0
- package/dist/formatters/collections.js +93 -0
- package/dist/formatters/collections.js.map +1 -0
- package/dist/formatters/constellation.d.ts +34 -0
- package/dist/formatters/constellation.d.ts.map +1 -0
- package/dist/formatters/constellation.js +38 -0
- package/dist/formatters/constellation.js.map +1 -0
- package/dist/formatters/cross-cut.d.ts +21 -0
- package/dist/formatters/cross-cut.d.ts.map +1 -0
- package/dist/formatters/cross-cut.js +32 -0
- package/dist/formatters/cross-cut.js.map +1 -0
- package/dist/formatters/entry.d.ts +11 -4
- package/dist/formatters/entry.d.ts.map +1 -1
- package/dist/formatters/entry.js +24 -8
- package/dist/formatters/entry.js.map +1 -1
- package/dist/formatters/fields.d.ts +32 -0
- package/dist/formatters/fields.d.ts.map +1 -0
- package/dist/formatters/fields.js +49 -0
- package/dist/formatters/fields.js.map +1 -0
- package/dist/formatters/handshake.d.ts +24 -0
- package/dist/formatters/handshake.d.ts.map +1 -0
- package/dist/formatters/handshake.js +69 -0
- package/dist/formatters/handshake.js.map +1 -0
- package/dist/formatters/orient.d.ts +104 -1
- package/dist/formatters/orient.d.ts.map +1 -1
- package/dist/formatters/orient.js +140 -17
- package/dist/formatters/orient.js.map +1 -1
- package/dist/formatters/promote.d.ts +30 -0
- package/dist/formatters/promote.d.ts.map +1 -0
- package/dist/formatters/promote.js +39 -0
- package/dist/formatters/promote.js.map +1 -0
- package/dist/formatters/proposals.d.ts +45 -0
- package/dist/formatters/proposals.d.ts.map +1 -0
- package/dist/formatters/proposals.js +62 -0
- package/dist/formatters/proposals.js.map +1 -0
- package/dist/formatters/relate.d.ts +14 -0
- package/dist/formatters/relate.d.ts.map +1 -0
- package/dist/formatters/relate.js +16 -0
- package/dist/formatters/relate.js.map +1 -0
- package/dist/formatters/search.d.ts +0 -4
- package/dist/formatters/search.d.ts.map +1 -1
- package/dist/formatters/search.js +4 -1
- package/dist/formatters/search.js.map +1 -1
- package/dist/formatters/session.d.ts +11 -0
- package/dist/formatters/session.d.ts.map +1 -0
- package/dist/formatters/session.js +53 -0
- package/dist/formatters/session.js.map +1 -0
- package/dist/formatters/update.d.ts +17 -0
- package/dist/formatters/update.d.ts.map +1 -0
- package/dist/formatters/update.js +45 -0
- package/dist/formatters/update.js.map +1 -0
- package/dist/formatters/verify.d.ts +11 -0
- package/dist/formatters/verify.d.ts.map +1 -0
- package/dist/formatters/verify.js +11 -0
- package/dist/formatters/verify.js.map +1 -0
- package/dist/generators/__tests__/surface-profiles.test.d.ts +2 -0
- package/dist/generators/__tests__/surface-profiles.test.d.ts.map +1 -0
- package/dist/generators/__tests__/surface-profiles.test.js +89 -0
- package/dist/generators/__tests__/surface-profiles.test.js.map +1 -0
- package/dist/generators/adapters.d.ts +44 -0
- package/dist/generators/adapters.d.ts.map +1 -0
- package/dist/generators/adapters.js +290 -0
- package/dist/generators/adapters.js.map +1 -0
- package/dist/generators/adapters.test.d.ts +2 -0
- package/dist/generators/adapters.test.d.ts.map +1 -0
- package/dist/generators/adapters.test.js +27 -0
- package/dist/generators/adapters.test.js.map +1 -0
- package/dist/generators/archetypes.d.ts +52 -0
- package/dist/generators/archetypes.d.ts.map +1 -0
- package/dist/generators/archetypes.js +153 -0
- package/dist/generators/archetypes.js.map +1 -0
- package/dist/generators/archetypes.test.d.ts +2 -0
- package/dist/generators/archetypes.test.d.ts.map +1 -0
- package/dist/generators/archetypes.test.js +237 -0
- package/dist/generators/archetypes.test.js.map +1 -0
- package/dist/generators/briefing-md.d.ts +8 -0
- package/dist/generators/briefing-md.d.ts.map +1 -0
- package/dist/generators/briefing-md.js +51 -0
- package/dist/generators/briefing-md.js.map +1 -0
- package/dist/generators/chain-classifier.d.ts +49 -0
- package/dist/generators/chain-classifier.d.ts.map +1 -0
- package/dist/generators/chain-classifier.js +180 -0
- package/dist/generators/chain-classifier.js.map +1 -0
- package/dist/generators/chain-classifier.test.d.ts +2 -0
- package/dist/generators/chain-classifier.test.d.ts.map +1 -0
- package/dist/generators/chain-classifier.test.js +257 -0
- package/dist/generators/chain-classifier.test.js.map +1 -0
- package/dist/generators/chain-rules.d.ts +42 -0
- package/dist/generators/chain-rules.d.ts.map +1 -0
- package/dist/generators/chain-rules.js +144 -0
- package/dist/generators/chain-rules.js.map +1 -0
- package/dist/generators/chain-rules.test.d.ts +2 -0
- package/dist/generators/chain-rules.test.d.ts.map +1 -0
- package/dist/generators/chain-rules.test.js +179 -0
- package/dist/generators/chain-rules.test.js.map +1 -0
- package/dist/generators/context-md.d.ts +8 -0
- package/dist/generators/context-md.d.ts.map +1 -0
- package/dist/generators/context-md.js +134 -0
- package/dist/generators/context-md.js.map +1 -0
- package/dist/generators/handshake-diff.d.ts +67 -0
- package/dist/generators/handshake-diff.d.ts.map +1 -0
- package/dist/generators/handshake-diff.js +183 -0
- package/dist/generators/handshake-diff.js.map +1 -0
- package/dist/generators/handshake-diff.test.d.ts +2 -0
- package/dist/generators/handshake-diff.test.d.ts.map +1 -0
- package/dist/generators/handshake-diff.test.js +264 -0
- package/dist/generators/handshake-diff.test.js.map +1 -0
- package/dist/generators/portable-knowledge.d.ts +143 -0
- package/dist/generators/portable-knowledge.d.ts.map +1 -0
- package/dist/generators/portable-knowledge.js +504 -0
- package/dist/generators/portable-knowledge.js.map +1 -0
- package/dist/generators/portable-knowledge.test.d.ts +2 -0
- package/dist/generators/portable-knowledge.test.d.ts.map +1 -0
- package/dist/generators/portable-knowledge.test.js +927 -0
- package/dist/generators/portable-knowledge.test.js.map +1 -0
- package/dist/generators/surface-profiles.d.ts +49 -0
- package/dist/generators/surface-profiles.d.ts.map +1 -0
- package/dist/generators/surface-profiles.js +98 -0
- package/dist/generators/surface-profiles.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +670 -37
- package/dist/index.js.map +1 -1
- package/dist/lib/activation.d.ts +28 -0
- package/dist/lib/activation.d.ts.map +1 -0
- package/dist/lib/activation.js +57 -0
- package/dist/lib/activation.js.map +1 -0
- package/dist/lib/activation.test.d.ts +6 -0
- package/dist/lib/activation.test.d.ts.map +1 -0
- package/dist/lib/activation.test.js +121 -0
- package/dist/lib/activation.test.js.map +1 -0
- package/dist/lib/client.d.ts +62 -1
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +258 -12
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/config.d.ts +84 -4
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +322 -42
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/constants.d.ts +42 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +76 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/conversation-engine.d.ts +45 -0
- package/dist/lib/conversation-engine.d.ts.map +1 -0
- package/dist/lib/conversation-engine.js +112 -0
- package/dist/lib/conversation-engine.js.map +1 -0
- package/dist/lib/conversation-phases.d.ts +59 -0
- package/dist/lib/conversation-phases.d.ts.map +1 -0
- package/dist/lib/conversation-phases.js +11 -0
- package/dist/lib/conversation-phases.js.map +1 -0
- package/dist/lib/conversation-signals.d.ts +30 -0
- package/dist/lib/conversation-signals.d.ts.map +1 -0
- package/dist/lib/conversation-signals.js +64 -0
- package/dist/lib/conversation-signals.js.map +1 -0
- package/dist/lib/deployment.d.ts +23 -0
- package/dist/lib/deployment.d.ts.map +1 -0
- package/dist/lib/deployment.js +78 -0
- package/dist/lib/deployment.js.map +1 -0
- package/dist/lib/deployment.test.d.ts +5 -0
- package/dist/lib/deployment.test.d.ts.map +1 -0
- package/dist/lib/deployment.test.js +54 -0
- package/dist/lib/deployment.test.js.map +1 -0
- package/dist/lib/errors.d.ts +58 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +67 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/experiment.d.ts +18 -0
- package/dist/lib/experiment.d.ts.map +1 -0
- package/dist/lib/experiment.js +28 -0
- package/dist/lib/experiment.js.map +1 -0
- package/dist/lib/format.d.ts +10 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +27 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/glossary.d.ts +19 -0
- package/dist/lib/glossary.d.ts.map +1 -0
- package/dist/lib/glossary.js +53 -0
- package/dist/lib/glossary.js.map +1 -0
- package/dist/lib/onboarding-path-b.d.ts +10 -0
- package/dist/lib/onboarding-path-b.d.ts.map +1 -0
- package/dist/lib/onboarding-path-b.js +214 -0
- package/dist/lib/onboarding-path-b.js.map +1 -0
- package/dist/lib/onboarding-phases.d.ts +9 -0
- package/dist/lib/onboarding-phases.d.ts.map +1 -0
- package/dist/lib/onboarding-phases.js +120 -0
- package/dist/lib/onboarding-phases.js.map +1 -0
- package/dist/lib/onboarding-shared.d.ts +81 -0
- package/dist/lib/onboarding-shared.d.ts.map +1 -0
- package/dist/lib/onboarding-shared.js +190 -0
- package/dist/lib/onboarding-shared.js.map +1 -0
- package/dist/lib/onboarding-topics.d.ts +27 -0
- package/dist/lib/onboarding-topics.d.ts.map +1 -0
- package/dist/lib/onboarding-topics.js +57 -0
- package/dist/lib/onboarding-topics.js.map +1 -0
- package/dist/lib/onboarding.d.ts +17 -0
- package/dist/lib/onboarding.d.ts.map +1 -0
- package/dist/lib/onboarding.js +350 -0
- package/dist/lib/onboarding.js.map +1 -0
- package/dist/lib/profiles.d.ts +39 -0
- package/dist/lib/profiles.d.ts.map +1 -0
- package/dist/lib/profiles.js +185 -0
- package/dist/lib/profiles.js.map +1 -0
- package/dist/lib/prompts.d.ts +65 -0
- package/dist/lib/prompts.d.ts.map +1 -0
- package/dist/lib/prompts.js +132 -0
- package/dist/lib/prompts.js.map +1 -0
- package/dist/lib/repo-detect.d.ts +33 -0
- package/dist/lib/repo-detect.d.ts.map +1 -0
- package/dist/lib/repo-detect.js +83 -0
- package/dist/lib/repo-detect.js.map +1 -0
- package/dist/lib/runner.d.ts +33 -0
- package/dist/lib/runner.d.ts.map +1 -0
- package/dist/lib/runner.js +79 -0
- package/dist/lib/runner.js.map +1 -0
- package/dist/lib/session.d.ts +42 -0
- package/dist/lib/session.d.ts.map +1 -0
- package/dist/lib/session.js +109 -0
- package/dist/lib/session.js.map +1 -0
- package/dist/lib/spinner.d.ts +27 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +76 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/spinner.test.d.ts +2 -0
- package/dist/lib/spinner.test.d.ts.map +1 -0
- package/dist/lib/spinner.test.js +39 -0
- package/dist/lib/spinner.test.js.map +1 -0
- package/dist/lib/strip.d.ts +12 -0
- package/dist/lib/strip.d.ts.map +1 -0
- package/dist/lib/strip.js +41 -0
- package/dist/lib/strip.js.map +1 -0
- package/dist/lib/style.d.ts +94 -0
- package/dist/lib/style.d.ts.map +1 -0
- package/dist/lib/style.js +167 -0
- package/dist/lib/style.js.map +1 -0
- package/dist/lib/style.test.d.ts +7 -0
- package/dist/lib/style.test.d.ts.map +1 -0
- package/dist/lib/style.test.js +263 -0
- package/dist/lib/style.test.js.map +1 -0
- package/dist/lib/telemetry.d.ts +15 -0
- package/dist/lib/telemetry.d.ts.map +1 -0
- package/dist/lib/telemetry.js +47 -0
- package/dist/lib/telemetry.js.map +1 -0
- package/dist/lib/tokenConstants.d.ts +17 -0
- package/dist/lib/tokenConstants.d.ts.map +1 -0
- package/dist/lib/tokenConstants.js +17 -0
- package/dist/lib/tokenConstants.js.map +1 -0
- package/dist/lib/update-check.d.ts +21 -0
- package/dist/lib/update-check.d.ts.map +1 -0
- package/dist/lib/update-check.js +144 -0
- package/dist/lib/update-check.js.map +1 -0
- package/dist/lib/wizard-surfaces.d.ts +47 -0
- package/dist/lib/wizard-surfaces.d.ts.map +1 -0
- package/dist/lib/wizard-surfaces.js +176 -0
- package/dist/lib/wizard-surfaces.js.map +1 -0
- package/dist/lib/wizard-surfaces.test.d.ts +2 -0
- package/dist/lib/wizard-surfaces.test.d.ts.map +1 -0
- package/dist/lib/wizard-surfaces.test.js +127 -0
- package/dist/lib/wizard-surfaces.test.js.map +1 -0
- package/dist/lib/wizard-trust.d.ts +31 -0
- package/dist/lib/wizard-trust.d.ts.map +1 -0
- package/dist/lib/wizard-trust.js +66 -0
- package/dist/lib/wizard-trust.js.map +1 -0
- package/dist/lib/wizard-trust.test.d.ts +2 -0
- package/dist/lib/wizard-trust.test.d.ts.map +1 -0
- package/dist/lib/wizard-trust.test.js +32 -0
- package/dist/lib/wizard-trust.test.js.map +1 -0
- package/dist/lib/workspace-probe.d.ts +16 -0
- package/dist/lib/workspace-probe.d.ts.map +1 -0
- package/dist/lib/workspace-probe.js +33 -0
- package/dist/lib/workspace-probe.js.map +1 -0
- package/package.json +13 -4
- package/templates/archetypes/boundary.md +23 -0
- package/templates/archetypes/constraint.md +23 -0
- package/templates/archetypes/convention.md +23 -0
- package/templates/archetypes/policy.md +23 -0
- package/templates/archetypes/quality-gate.md +23 -0
- package/templates/archetypes/workflow.md +23 -0
- package/templates/general/code-integrity.md +11 -0
- package/templates/general/getting-started.md +12 -0
- package/templates/node-ts/code-integrity.md +13 -0
- package/templates/node-ts/testing.md +12 -0
- package/templates/python/code-integrity.md +13 -0
- package/templates/python/testing.md +12 -0
package/dist/index.js
CHANGED
|
@@ -1,19 +1,216 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Product Brain CLI —
|
|
4
|
-
* BET-108
|
|
3
|
+
* Product Brain CLI — Chain knowledge + write-back in the terminal.
|
|
4
|
+
* Read: BET-108. Write: pb session + pb capture (TEN-27, INS-80).
|
|
5
|
+
* BET-181 Slice 0: global --json / --pretty flags for agent-native output (DEC-299).
|
|
5
6
|
*/
|
|
6
|
-
import {
|
|
7
|
+
import { readFileSync } from 'node:fs';
|
|
8
|
+
import { dirname, join } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import { Command, CommanderError } from 'commander';
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const cliPackageVersion = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
|
|
13
|
+
import { setOutputMode, setQuietMode, isJsonMode } from './lib/runner.js';
|
|
14
|
+
import { CLIError, ErrorCode } from './lib/errors.js';
|
|
7
15
|
import { runContext } from './commands/context.js';
|
|
8
|
-
import { runGet } from './commands/get.js';
|
|
16
|
+
import { runGet, runGetMany } from './commands/get.js';
|
|
17
|
+
import { runConnect } from './commands/connect.js';
|
|
9
18
|
import { runLogin } from './commands/login.js';
|
|
19
|
+
import { runSetup } from './commands/setup.js';
|
|
10
20
|
import { runOrient } from './commands/orient.js';
|
|
11
21
|
import { runSearch } from './commands/search.js';
|
|
22
|
+
import { runHandshake, runHandshakeInit } from './commands/handshake.js';
|
|
23
|
+
import { runSessionStart, runSessionClose, runSessionId } from './commands/session.js';
|
|
24
|
+
import { runCapture } from './commands/capture.js';
|
|
25
|
+
import { runUpdate } from './commands/update.js';
|
|
26
|
+
import { runRelate, runUnrelate } from './commands/relate.js';
|
|
27
|
+
import { runIngest } from './commands/ingest.js';
|
|
28
|
+
import { runFields } from './commands/fields.js';
|
|
29
|
+
import { runConstellation } from './commands/constellation.js';
|
|
30
|
+
import { runPromote } from './commands/promote.js';
|
|
31
|
+
import { runBrandPack } from './commands/brand-pack.js';
|
|
32
|
+
import { runAudit } from './commands/audit.js';
|
|
33
|
+
import { runProposals } from './commands/proposals.js';
|
|
34
|
+
import { runAccept } from './commands/accept.js';
|
|
35
|
+
import { runReject } from './commands/reject.js';
|
|
36
|
+
import { runChanges } from './commands/changes.js';
|
|
37
|
+
import { runChainWalk } from './commands/chain-walk.js';
|
|
38
|
+
import { runCrossCut } from './commands/cross-cut.js';
|
|
39
|
+
import { runBrief, runCompoundBrief, isCompoundType } from './commands/brief.js';
|
|
40
|
+
import { runVerify } from './commands/verify.js';
|
|
41
|
+
import { runCodexPrep } from './commands/codex-prep.js';
|
|
42
|
+
import { runCollectionsList, runCollectionsGet, runCollectionsAudit, runCollectionsExport } from './commands/collections.js';
|
|
43
|
+
import { runWorkspaceVerify, runWorkspaceRepair, runDefinitionsDiff } from './commands/workspace.js';
|
|
44
|
+
import { runDoctor } from './commands/doctor.js';
|
|
45
|
+
import { runProfileList, runProfileCreate, runProfileUse, runProfileDelete } from './commands/profile.js';
|
|
46
|
+
import { runInit } from './commands/init.js';
|
|
47
|
+
import { createAdminCommand } from './commands/admin/index.js';
|
|
48
|
+
import { runUsage } from './commands/usage.js';
|
|
49
|
+
import { GLOSSARY, formatGlossary } from './lib/glossary.js';
|
|
50
|
+
import { API_KEY_PREFIX } from './lib/tokenConstants.js';
|
|
51
|
+
import { hint, heading, bold, dim, green, icons } from './lib/style.js';
|
|
52
|
+
import { readSession } from './lib/session.js';
|
|
53
|
+
import { formatElapsed } from './lib/format.js';
|
|
54
|
+
import { probeWorkspace } from './lib/workspace-probe.js';
|
|
55
|
+
import { checkForUpdate } from './lib/update-check.js';
|
|
12
56
|
const program = new Command();
|
|
57
|
+
/**
|
|
58
|
+
* Global error handler — single exit point for all CLI errors.
|
|
59
|
+
* CLIError: format with code + category + guidance.
|
|
60
|
+
* CommanderError: re-throw for --help / --version (exitCode 0), format others.
|
|
61
|
+
* Regular Error: wrap as INTERNAL.
|
|
62
|
+
*/
|
|
63
|
+
function handleError(err) {
|
|
64
|
+
// Commander help/version exits with code 0 — let them through
|
|
65
|
+
if (err instanceof CommanderError && err.exitCode === 0) {
|
|
66
|
+
process.exit(0);
|
|
67
|
+
}
|
|
68
|
+
const json = isJsonMode();
|
|
69
|
+
if (err instanceof CLIError) {
|
|
70
|
+
if (json) {
|
|
71
|
+
process.stderr.write(JSON.stringify(err.toJSON()) + '\n');
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
process.stderr.write(err.message + '\n');
|
|
75
|
+
if (err.guidance) {
|
|
76
|
+
process.stderr.write(err.guidance + '\n');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
// CommanderError (bad usage, missing args, etc.)
|
|
82
|
+
if (err instanceof CommanderError) {
|
|
83
|
+
const cliErr = new CLIError(err.message, {
|
|
84
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
85
|
+
category: 'validation',
|
|
86
|
+
});
|
|
87
|
+
if (json) {
|
|
88
|
+
process.stderr.write(JSON.stringify(cliErr.toJSON()) + '\n');
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
process.stderr.write(err.message + '\n');
|
|
92
|
+
}
|
|
93
|
+
process.exit(err.exitCode);
|
|
94
|
+
}
|
|
95
|
+
// Unknown / unstructured errors
|
|
96
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
97
|
+
if (json) {
|
|
98
|
+
process.stderr.write(JSON.stringify({ error: message, code: 'INTERNAL', category: 'internal' }) + '\n');
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
process.stderr.write(message + '\n');
|
|
102
|
+
}
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
13
105
|
program
|
|
14
106
|
.name('pb')
|
|
15
|
-
.description('Product Brain —
|
|
16
|
-
.version(
|
|
107
|
+
.description('Product Brain — Chain knowledge + write-back CLI')
|
|
108
|
+
.version(cliPackageVersion.version)
|
|
109
|
+
// Global output mode flags (DEC-299, BET-181)
|
|
110
|
+
.option('--json', 'Output machine-readable JSON (overrides TTY auto-detection)')
|
|
111
|
+
.option('--pretty', 'Force human-readable output even when piped')
|
|
112
|
+
.option('-q, --quiet', 'Suppress non-essential output (banners, hints, progress)')
|
|
113
|
+
.exitOverride(); // Throw CommanderError instead of calling process.exit directly
|
|
114
|
+
// Apply global output mode BEFORE subcommand actions run
|
|
115
|
+
program.hook('preAction', (thisCommand) => {
|
|
116
|
+
const globalOpts = program.opts();
|
|
117
|
+
if (globalOpts.json) {
|
|
118
|
+
setOutputMode('json');
|
|
119
|
+
}
|
|
120
|
+
else if (globalOpts.pretty) {
|
|
121
|
+
setOutputMode('pretty');
|
|
122
|
+
}
|
|
123
|
+
// else: 'auto' (default) — TTY detection handles it
|
|
124
|
+
if (globalOpts.quiet) {
|
|
125
|
+
setQuietMode(true);
|
|
126
|
+
}
|
|
127
|
+
// Ambient update notification — non-blocking, suppressed in JSON mode (WP-322 S1)
|
|
128
|
+
checkForUpdate(cliPackageVersion.version);
|
|
129
|
+
void thisCommand;
|
|
130
|
+
});
|
|
131
|
+
// Default action — status dashboard when `pb` is invoked with no command.
|
|
132
|
+
// `pb --help` still works because Commander intercepts --help before the action runs.
|
|
133
|
+
program.action(async () => {
|
|
134
|
+
// Check if we have a valid API key (sync, no network)
|
|
135
|
+
let hasKey = false;
|
|
136
|
+
let config = null;
|
|
137
|
+
try {
|
|
138
|
+
const { getConfig: gc } = await import('./lib/config.js');
|
|
139
|
+
config = gc();
|
|
140
|
+
hasKey = true;
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
// No valid key
|
|
144
|
+
}
|
|
145
|
+
// JSON mode: structured status
|
|
146
|
+
if (isJsonMode()) {
|
|
147
|
+
if (!hasKey) {
|
|
148
|
+
process.stdout.write(JSON.stringify({
|
|
149
|
+
configured: false,
|
|
150
|
+
hint: 'Run pb login to configure your API key.',
|
|
151
|
+
}) + '\n');
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const session = readSession();
|
|
155
|
+
const wsInfo = await probeWorkspace();
|
|
156
|
+
process.stdout.write(JSON.stringify({
|
|
157
|
+
configured: true,
|
|
158
|
+
workspace: wsInfo?.name ?? null,
|
|
159
|
+
session: session ? { id: session.sessionId, startedAt: session.startedAt } : null,
|
|
160
|
+
entryCount: wsInfo?.entryCount ?? null,
|
|
161
|
+
hint: 'Run pb --help for available commands.',
|
|
162
|
+
}) + '\n');
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
// Human mode — not configured
|
|
166
|
+
if (!hasKey) {
|
|
167
|
+
process.stdout.write('\n');
|
|
168
|
+
process.stdout.write(`${bold('Product Brain')} ${dim('— not connected')}\n\n`);
|
|
169
|
+
process.stdout.write(`${heading('Get started')}\n\n`);
|
|
170
|
+
hint('1. pb login Save your API key');
|
|
171
|
+
hint('2. pb setup Connect a workspace');
|
|
172
|
+
hint('3. pb orient -b See what\'s happening');
|
|
173
|
+
process.stdout.write('\n');
|
|
174
|
+
hint('pb --help Show all commands');
|
|
175
|
+
process.stdout.write('\n');
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
// Human mode — configured, try workspace probe
|
|
179
|
+
const session = readSession();
|
|
180
|
+
const wsInfo = await probeWorkspace();
|
|
181
|
+
const workspaceName = wsInfo?.name ?? null;
|
|
182
|
+
const entryCount = wsInfo?.entryCount ?? null;
|
|
183
|
+
const offline = !wsInfo;
|
|
184
|
+
process.stdout.write('\n');
|
|
185
|
+
if (offline) {
|
|
186
|
+
process.stdout.write(`${bold('Product Brain')} ${dim('— connected (offline)')}\n\n`);
|
|
187
|
+
process.stdout.write(` ${green(icons.pass)} Key: configured\n`);
|
|
188
|
+
process.stdout.write(` ${dim('Server: unreachable — check your connection')}\n\n`);
|
|
189
|
+
hint('pb doctor Diagnose connection issues');
|
|
190
|
+
hint('pb --help Show all commands');
|
|
191
|
+
process.stdout.write('\n');
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
// Online with workspace
|
|
195
|
+
const title = workspaceName
|
|
196
|
+
? `${bold('Product Brain')} ${dim('—')} ${bold(workspaceName)}`
|
|
197
|
+
: `${bold('Product Brain')}`;
|
|
198
|
+
process.stdout.write(`${title}\n\n`);
|
|
199
|
+
if (session) {
|
|
200
|
+
const elapsed = formatElapsed(session.startedAt);
|
|
201
|
+
process.stdout.write(` Session: active (started ${elapsed})\n`);
|
|
202
|
+
}
|
|
203
|
+
if (entryCount !== null && entryCount > 0) {
|
|
204
|
+
process.stdout.write(` Entries: ${entryCount}\n`);
|
|
205
|
+
}
|
|
206
|
+
process.stdout.write('\n');
|
|
207
|
+
if (!session) {
|
|
208
|
+
hint('pb session start Start a write session');
|
|
209
|
+
}
|
|
210
|
+
hint('pb orient -b Workspace overview');
|
|
211
|
+
hint('pb --help Show all commands');
|
|
212
|
+
process.stdout.write('\n');
|
|
213
|
+
});
|
|
17
214
|
program
|
|
18
215
|
.command('get <entry-id>')
|
|
19
216
|
.description('Display full entry by ID (data, relations, last 10 history events)')
|
|
@@ -22,29 +219,84 @@ program
|
|
|
22
219
|
program.commands.find((c) => c.name() === 'get')?.help();
|
|
23
220
|
return;
|
|
24
221
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
222
|
+
await runGet({ entryId: entryId.trim() });
|
|
223
|
+
});
|
|
224
|
+
program
|
|
225
|
+
.command('get-many <entry-ids...>')
|
|
226
|
+
.description('Fetch multiple entries in parallel (space-separated IDs)')
|
|
227
|
+
.action(async (entryIds) => {
|
|
228
|
+
await runGetMany({ entryIds: entryIds.map((id) => id.trim()).filter(Boolean) });
|
|
32
229
|
});
|
|
33
230
|
program
|
|
34
231
|
.command('context <entry-id>')
|
|
35
|
-
.description('Gather and display constellation context (pipe-friendly
|
|
232
|
+
.description('Gather and display constellation context (pipe-friendly: JSON when piped, human text in terminal)')
|
|
36
233
|
.action(async (entryId) => {
|
|
37
234
|
if (!entryId?.trim()) {
|
|
38
235
|
program.commands.find((c) => c.name() === 'context')?.help();
|
|
39
236
|
return;
|
|
40
237
|
}
|
|
41
|
-
|
|
42
|
-
|
|
238
|
+
await runContext({ entryId: entryId.trim() });
|
|
239
|
+
});
|
|
240
|
+
program
|
|
241
|
+
.command('changes')
|
|
242
|
+
.description('Detect entries modified and relations created since a given time (BET-239)')
|
|
243
|
+
.requiredOption('--since <duration>', 'Time window: 1h, 6h, 1d, 7d, 30d')
|
|
244
|
+
.action(async (opts) => {
|
|
245
|
+
await runChanges({ since: opts.since });
|
|
246
|
+
});
|
|
247
|
+
program
|
|
248
|
+
.command('walk <entry-id>')
|
|
249
|
+
.description('Directed deep traversal along one relation type to depth 4 (BET-239)')
|
|
250
|
+
.option('-d, --depth <n>', 'Traversal depth 1-4 (default 2)', '2')
|
|
251
|
+
.option('--direction <dir>', 'Traversal direction: outgoing or incoming (default outgoing)', 'outgoing')
|
|
252
|
+
.option('-t, --type <relation-type>', 'Filter by relation type (e.g. depends_on, informs, governs)')
|
|
253
|
+
.action(async (entryId, opts) => {
|
|
254
|
+
const depth = parseInt(opts.depth, 10);
|
|
255
|
+
if (isNaN(depth) || depth < 1 || depth > 4) {
|
|
256
|
+
throw new CLIError('--depth must be between 1 and 4.', {
|
|
257
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
258
|
+
category: 'validation',
|
|
259
|
+
});
|
|
43
260
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
261
|
+
await runChainWalk({
|
|
262
|
+
entryId: entryId.trim(),
|
|
263
|
+
depth,
|
|
264
|
+
direction: opts.direction,
|
|
265
|
+
type: opts.type,
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
program
|
|
269
|
+
.command('cross-cut')
|
|
270
|
+
.description('Structural aggregation — all relations of a given type grouped by source collection (BET-239)')
|
|
271
|
+
.requiredOption('--type <relation-type>', 'Relation type to scan (e.g. part_of, informs, governs)')
|
|
272
|
+
.action(async (opts) => {
|
|
273
|
+
await runCrossCut({ type: opts.type });
|
|
274
|
+
});
|
|
275
|
+
program
|
|
276
|
+
.command('brief [type]')
|
|
277
|
+
.description('Brief intelligence queries (BET-239).\n' +
|
|
278
|
+
' pb brief --skill <name> Incremental delta for a skill (E4)\n' +
|
|
279
|
+
' pb brief steering Compound: changes + structure + delta + readiness (E6)\n' +
|
|
280
|
+
' pb brief confidence Compound: changes + active bets + tensions (E6)\n' +
|
|
281
|
+
' pb brief delta [--since] Compound: changes + relations since timestamp (E6)')
|
|
282
|
+
.option('--skill <name>', 'Skill name for incremental brief (e.g. preflight, shaping, review)')
|
|
283
|
+
.option('--since-last', 'Compare against last brief run (incremental mode)')
|
|
284
|
+
.option('--since <timestamp>', 'ISO 8601 timestamp for delta type (e.g. 2026-03-24T00:00:00Z)')
|
|
285
|
+
.action(async (type, opts) => {
|
|
286
|
+
// If positional arg is a compound type, route to compound brief
|
|
287
|
+
if (type && isCompoundType(type)) {
|
|
288
|
+
await runCompoundBrief({ type, since: opts.since });
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
// Otherwise, require --skill for incremental brief
|
|
292
|
+
if (!opts.skill) {
|
|
293
|
+
throw new CLIError('Usage:\n' +
|
|
294
|
+
' pb brief --skill <name> Incremental delta\n' +
|
|
295
|
+
' pb brief steering Compound steering brief\n' +
|
|
296
|
+
' pb brief confidence Compound confidence pass\n' +
|
|
297
|
+
' pb brief delta Compound delta sync', { code: ErrorCode.VALIDATION_FAILED, category: 'validation' });
|
|
47
298
|
}
|
|
299
|
+
await runBrief({ skill: opts.skill, sinceLast: opts.sinceLast });
|
|
48
300
|
});
|
|
49
301
|
program
|
|
50
302
|
.command('search [query...]')
|
|
@@ -55,38 +307,419 @@ program
|
|
|
55
307
|
program.commands.find((c) => c.name() === 'search')?.help();
|
|
56
308
|
return;
|
|
57
309
|
}
|
|
58
|
-
|
|
59
|
-
await runSearch({ query });
|
|
60
|
-
}
|
|
61
|
-
catch (err) {
|
|
62
|
-
console.error(err instanceof Error ? err.message : String(err));
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
310
|
+
await runSearch({ query });
|
|
65
311
|
});
|
|
66
312
|
program
|
|
67
313
|
.command('orient')
|
|
68
314
|
.description('Print workspace stage and all orient sections (strategic context, bets, governance, tensions, etc.)')
|
|
69
315
|
.option('-b, --brief', 'Compact view: stage, counts, top bets, tensions, planned work')
|
|
316
|
+
.option('-t, --task <task>', 'Task description for task-shaped governance and context')
|
|
317
|
+
// SYNC: domain list must match TaskDomain in convex/agentKnowledge/startupResolver.ts
|
|
318
|
+
.option('-s, --scope <domain>', 'Domain scope for governance filtering. Valid values: auth, governance, architecture, product, data-foundation, chainwork, capture-pipeline, ingestion, intelligence-and-operations, review-and-learning, general')
|
|
70
319
|
.action(async (opts) => {
|
|
71
|
-
|
|
72
|
-
|
|
320
|
+
await runOrient({ brief: opts.brief, task: opts.task?.trim() || undefined, scope: opts.scope?.trim() || undefined });
|
|
321
|
+
});
|
|
322
|
+
program
|
|
323
|
+
.command('handshake')
|
|
324
|
+
.description('Generate context files for AI developer tools (AGENTS.md, .codex/skills/, CLAUDE.md, .cursor/rules/, .github/copilot-instructions.md)')
|
|
325
|
+
.option('--force', 'Overwrite adapter files even if they exist without auto-generated marker')
|
|
326
|
+
.option('--dry-run', 'Show what would be generated without writing files')
|
|
327
|
+
.option('--init', 'Set up Claude Code integration: team hooks + personal trust level')
|
|
328
|
+
.option('--level <level>', 'With --init: trust level (guide|work|silent|full-trust). Without --init: content tier (beginner|intermediate|expert)')
|
|
329
|
+
.option('--generate', 'Fetch governance entries from the Chain and merge generated rules (BET-286)')
|
|
330
|
+
.option('--surfaces <list>', 'Comma-separated surfaces to write (cursor,claude,copilot,codex)')
|
|
331
|
+
.action(async (opts) => {
|
|
332
|
+
if (opts.init) {
|
|
333
|
+
await runHandshakeInit({ level: opts.level, dryRun: opts.dryRun });
|
|
334
|
+
return;
|
|
73
335
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
336
|
+
await runHandshake({ force: opts.force, dryRun: opts.dryRun, level: opts.level, generate: opts.generate, surfaces: opts.surfaces?.split(',') });
|
|
337
|
+
});
|
|
338
|
+
program
|
|
339
|
+
.command('codex-prep <task...>')
|
|
340
|
+
.description('Generate task-specific governance context for Codex (.codex/task-context.md)')
|
|
341
|
+
.option('--dry-run', 'Print to stdout instead of writing file')
|
|
342
|
+
.action(async (taskParts, opts) => {
|
|
343
|
+
const task = taskParts.join(' ').trim();
|
|
344
|
+
if (!task) {
|
|
345
|
+
program.commands.find((c) => c.name() === 'codex-prep')?.help();
|
|
346
|
+
return;
|
|
77
347
|
}
|
|
348
|
+
await runCodexPrep({ task, dryRun: opts.dryRun });
|
|
349
|
+
});
|
|
350
|
+
program
|
|
351
|
+
.command('init')
|
|
352
|
+
.description('Detect setup state and guide you through configuration (WP-303)')
|
|
353
|
+
.action(async () => {
|
|
354
|
+
await runInit();
|
|
355
|
+
});
|
|
356
|
+
program
|
|
357
|
+
.command('connect <token>')
|
|
358
|
+
.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.')
|
|
359
|
+
.option('--gateway <url>', 'Override redeem gateway (default: CONVEX_SITE_URL or production). Use when token came from a different Convex deployment.')
|
|
360
|
+
.action(async (token, opts) => {
|
|
361
|
+
if (!token?.trim()) {
|
|
362
|
+
program.commands.find((c) => c.name() === 'connect')?.help();
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
await runConnect(token.trim(), { gateway: opts.gateway });
|
|
78
366
|
});
|
|
79
367
|
program
|
|
80
368
|
.command('login')
|
|
81
369
|
.description('Save your API key to ~/.config/productbrain/.env (works from any directory)')
|
|
82
370
|
.action(async () => {
|
|
83
|
-
|
|
84
|
-
|
|
371
|
+
await runLogin();
|
|
372
|
+
});
|
|
373
|
+
program
|
|
374
|
+
.command('doctor')
|
|
375
|
+
.description('Check CLI configuration and connectivity')
|
|
376
|
+
.option('--fix', 'Auto-repair common configuration issues')
|
|
377
|
+
.option('--dry-run', 'Preview what --fix would do without changing anything')
|
|
378
|
+
.action(async (opts) => {
|
|
379
|
+
await runDoctor({ fix: opts.fix, dryRun: opts.dryRun });
|
|
380
|
+
});
|
|
381
|
+
program
|
|
382
|
+
.command('setup')
|
|
383
|
+
.description('Guided first-time setup: account, login, workspace, first capture')
|
|
384
|
+
.action(async () => {
|
|
385
|
+
await runSetup();
|
|
386
|
+
});
|
|
387
|
+
// --- Write commands (require active session) ---
|
|
388
|
+
const sessionCmd = program
|
|
389
|
+
.command('session')
|
|
390
|
+
.description('Manage write sessions (DEC-9: sessions required before write access)');
|
|
391
|
+
sessionCmd
|
|
392
|
+
.command('start')
|
|
393
|
+
.description('Start a tracked write session (opens session, refreshes context)')
|
|
394
|
+
.option('--json', 'Output machine-readable JSON (deprecated: use global --json flag)')
|
|
395
|
+
.action(async (opts) => {
|
|
396
|
+
await runSessionStart({ json: opts.json });
|
|
397
|
+
});
|
|
398
|
+
sessionCmd
|
|
399
|
+
.command('id')
|
|
400
|
+
.description('Print current session ID to stdout (machine-readable, TEN-707)')
|
|
401
|
+
.action(() => {
|
|
402
|
+
runSessionId();
|
|
403
|
+
});
|
|
404
|
+
sessionCmd
|
|
405
|
+
.command('close')
|
|
406
|
+
.description('Close the active session (wrapup, refresh context)')
|
|
407
|
+
.option('--force', 'Clear local session state even if server close fails')
|
|
408
|
+
.action(async (opts) => {
|
|
409
|
+
await runSessionClose({ force: opts.force });
|
|
410
|
+
});
|
|
411
|
+
program
|
|
412
|
+
.command('capture [text...]')
|
|
413
|
+
.description('Capture knowledge to the Chain (requires active session)')
|
|
414
|
+
.option('-n, --name <name>', 'Entry name (defaults to capture text)')
|
|
415
|
+
.option('-d, --description <desc>', 'Entry description (defaults to capture text)')
|
|
416
|
+
.option('-c, --collection <slug>', 'Explicit collection (skip auto-classification)')
|
|
417
|
+
.option('-l, --link <entry-id>', 'Link new entry to an existing entry (TEN-705)')
|
|
418
|
+
.option('-t, --type <relation-type>', 'Relation type for --link (default: surfaces_tension_in)')
|
|
419
|
+
.option('--source-ref <ref>', 'Source reference URI (BET-240 E2: e.g. "meeting-2026-03-28.md")')
|
|
420
|
+
.option('--source-excerpt <text>', 'Verbatim source excerpt (BET-240 E2)')
|
|
421
|
+
.option('--json', 'Output machine-readable JSON (deprecated: use global --json flag)')
|
|
422
|
+
.option('--suggest-only', 'Show grounding preview (possible duplicates, related entries) without creating entry (WP-319)')
|
|
423
|
+
.option('--strict', 'Prompt y/N before capturing when a possible duplicate is detected (WP-319)')
|
|
424
|
+
.action(async (textParts = [], opts) => {
|
|
425
|
+
const text = textParts.join(' ').trim();
|
|
426
|
+
if (!text && !opts.name) {
|
|
427
|
+
program.commands.find((c) => c.name() === 'capture')?.help();
|
|
428
|
+
return;
|
|
85
429
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
430
|
+
await runCapture({
|
|
431
|
+
text: text || opts.name || '',
|
|
432
|
+
name: opts.name,
|
|
433
|
+
description: opts.description,
|
|
434
|
+
collection: opts.collection,
|
|
435
|
+
link: opts.link,
|
|
436
|
+
type: opts.type,
|
|
437
|
+
sourceRef: opts.sourceRef,
|
|
438
|
+
sourceExcerpt: opts.sourceExcerpt,
|
|
439
|
+
json: opts.json,
|
|
440
|
+
suggestOnly: opts.suggestOnly,
|
|
441
|
+
strict: opts.strict,
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
// --- Update command (TEN-703) ---
|
|
445
|
+
program
|
|
446
|
+
.command('update <entry-id>')
|
|
447
|
+
.description('Update fields on an existing Chain entry (requires active session)')
|
|
448
|
+
.option('-f, --field <key=value>', 'Set a data field (repeatable)', (val, prev) => [...prev, val], [])
|
|
449
|
+
.option('--name <name>', 'Update entry name')
|
|
450
|
+
.option('--status <status>', 'Update entry status (draft | active | deprecated | archived)')
|
|
451
|
+
.option('--workflow-status <status>', 'Set workflow status (server-validated)')
|
|
452
|
+
.option('--note <text>', 'Change note for history')
|
|
453
|
+
.action(async (entryId, opts) => {
|
|
454
|
+
await runUpdate({
|
|
455
|
+
entryId,
|
|
456
|
+
field: opts.field,
|
|
457
|
+
name: opts.name,
|
|
458
|
+
status: opts.status,
|
|
459
|
+
workflowStatus: opts.workflowStatus,
|
|
460
|
+
note: opts.note,
|
|
461
|
+
});
|
|
462
|
+
});
|
|
463
|
+
// --- Promote command (Wave 2 CLI Polish) ---
|
|
464
|
+
program
|
|
465
|
+
.command('verify <entry-id>')
|
|
466
|
+
.description('Mark an entry as verified (BET-240: source fidelity trust signal)')
|
|
467
|
+
.action(async (entryId) => {
|
|
468
|
+
if (!entryId?.trim()) {
|
|
469
|
+
program.commands.find((c) => c.name() === 'verify')?.help();
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
await runVerify({ entryId: entryId.trim() });
|
|
473
|
+
});
|
|
474
|
+
program
|
|
475
|
+
.command('promote <entry-id>')
|
|
476
|
+
.description('Promote entry from draft to active (commit to SSOT)')
|
|
477
|
+
.option('-m, --message <text>', 'Commit message')
|
|
478
|
+
.action(async (entryId, opts) => {
|
|
479
|
+
await runPromote({ entryId, message: opts.message });
|
|
480
|
+
});
|
|
481
|
+
// --- Relate / Unrelate commands (TEN-704) ---
|
|
482
|
+
program
|
|
483
|
+
.command('relate <from-id> <type> <to-id>')
|
|
484
|
+
.description('Add a typed relation between two entries (requires active session)')
|
|
485
|
+
.option('--if-missing', 'Only create relation if it does not already exist')
|
|
486
|
+
.action(async (fromId, type, toId, opts) => {
|
|
487
|
+
await runRelate({ fromId, type, toId, ifMissing: opts.ifMissing });
|
|
488
|
+
});
|
|
489
|
+
program
|
|
490
|
+
.command('unrelate <from-id> <type> <to-id>')
|
|
491
|
+
.description('Remove a typed relation between two entries (requires active session)')
|
|
492
|
+
.action(async (fromId, type, toId) => {
|
|
493
|
+
await runUnrelate({ fromId, type, toId });
|
|
494
|
+
});
|
|
495
|
+
// --- Ingest command (BET-81) ---
|
|
496
|
+
program
|
|
497
|
+
.command('ingest <pattern>')
|
|
498
|
+
.description('Bulk ingest documents to Chain as drafts')
|
|
499
|
+
.option('--dry-run', 'Stage entries without auto-committing. Shows summary only.')
|
|
500
|
+
.option('--resume', 'Skip files whose sourceRef is already committed in staging.')
|
|
501
|
+
.option('--concurrency <n>', 'Process up to N files in parallel (default 1, max 5).', '1')
|
|
502
|
+
.action(async (pattern, opts) => {
|
|
503
|
+
const concurrency = parseInt(opts.concurrency ?? '1', 10);
|
|
504
|
+
if (Number.isNaN(concurrency) || concurrency < 1) {
|
|
505
|
+
throw new CLIError('--concurrency must be a positive integer.', {
|
|
506
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
507
|
+
category: 'validation',
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
await runIngest({
|
|
511
|
+
pattern,
|
|
512
|
+
dryRun: opts.dryRun,
|
|
513
|
+
resume: opts.resume,
|
|
514
|
+
concurrency,
|
|
515
|
+
});
|
|
516
|
+
});
|
|
517
|
+
// --- Fields command (BET-181 Slice 2) ---
|
|
518
|
+
program
|
|
519
|
+
.command('fields <collection>')
|
|
520
|
+
.description('List all field definitions for a collection (schema discovery for agents)')
|
|
521
|
+
.action(async (collection) => {
|
|
522
|
+
if (!collection?.trim()) {
|
|
523
|
+
program.commands.find((c) => c.name() === 'fields')?.help();
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
await runFields({ collectionSlug: collection.trim() });
|
|
527
|
+
});
|
|
528
|
+
// --- Constellation command (BET-181 Slice 3) ---
|
|
529
|
+
program
|
|
530
|
+
.command('constellation <entry-id>')
|
|
531
|
+
.description('Compound view: entry + all related entries grouped by relation type (agent-native)')
|
|
532
|
+
.action(async (entryId) => {
|
|
533
|
+
if (!entryId?.trim()) {
|
|
534
|
+
program.commands.find((c) => c.name() === 'constellation')?.help();
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
await runConstellation({ entryId: entryId.trim() });
|
|
538
|
+
});
|
|
539
|
+
// --- Audit command (BET-182 Slice 2) ---
|
|
540
|
+
program
|
|
541
|
+
.command('audit <entry-ids...>')
|
|
542
|
+
.description('Run STD-113 hygiene audit on bet(s) — 13 gates, exit code reflects verdict')
|
|
543
|
+
.option('--phase <phase>', 'Override phase detection (shaping | handoff)')
|
|
544
|
+
.option('--gate <name>', 'Run only specified gate(s) (repeatable)', (val, prev) => [...prev, val], [])
|
|
545
|
+
.option('--fix', 'Auto-execute exact fixes via pb update, rerun once')
|
|
546
|
+
.option('--verbose', 'Show all gates including PASS detail')
|
|
547
|
+
.action(async (entryIds, opts) => {
|
|
548
|
+
await runAudit({
|
|
549
|
+
entryIds: entryIds.map((id) => id.trim()).filter(Boolean),
|
|
550
|
+
phase: opts.phase,
|
|
551
|
+
gate: opts.gate,
|
|
552
|
+
fix: opts.fix,
|
|
553
|
+
verbose: opts.verbose,
|
|
554
|
+
});
|
|
555
|
+
});
|
|
556
|
+
program
|
|
557
|
+
.command('brand-pack')
|
|
558
|
+
.description('Internal marketing: structured community copy via OpenRouter (requires OPENROUTER_API_KEY). Forwards args to scripts/brand-pack.mjs')
|
|
559
|
+
.allowUnknownOption(true)
|
|
560
|
+
.allowExcessArguments(true)
|
|
561
|
+
.action(() => {
|
|
562
|
+
runBrandPack(process.argv);
|
|
563
|
+
});
|
|
564
|
+
// --- Governance proposal commands (BET-221 Slice 3) ---
|
|
565
|
+
program
|
|
566
|
+
.command('proposals')
|
|
567
|
+
.description('List open consent proposals with expiry countdown (BET-221)')
|
|
568
|
+
.action(async () => {
|
|
569
|
+
await runProposals();
|
|
570
|
+
});
|
|
571
|
+
program
|
|
572
|
+
.command('accept [proposal-id]')
|
|
573
|
+
.description('Approve a consent proposal by ID, or --auto to batch-approve all')
|
|
574
|
+
.option('-a, --auto', 'Auto-approve all open proposals (skip contradictions)')
|
|
575
|
+
.action(async (proposalId, opts) => {
|
|
576
|
+
if (!proposalId && !opts.auto) {
|
|
577
|
+
throw new CLIError('Usage: pb accept <proposal-id> or pb accept --auto', {
|
|
578
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
579
|
+
category: 'validation',
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
await runAccept({ proposalId, auto: opts.auto });
|
|
583
|
+
});
|
|
584
|
+
program
|
|
585
|
+
.command('reject <proposal-id>')
|
|
586
|
+
.description('Reject a consent proposal with a required reason (BR-7)')
|
|
587
|
+
.requiredOption('-r, --reason <text>', 'Reason for rejection (required)')
|
|
588
|
+
.action(async (proposalId, opts) => {
|
|
589
|
+
await runReject({ proposalId, reason: opts.reason });
|
|
590
|
+
});
|
|
591
|
+
// --- Collections command (BET-280 Slice 1) ---
|
|
592
|
+
const collectionsCmd = program
|
|
593
|
+
.command('collections')
|
|
594
|
+
.description('Inspect and audit workspace collection registry (BET-280)');
|
|
595
|
+
collectionsCmd
|
|
596
|
+
.command('list')
|
|
597
|
+
.description('List all collections — slug, name, field count, icon')
|
|
598
|
+
.action(async () => {
|
|
599
|
+
await runCollectionsList();
|
|
600
|
+
});
|
|
601
|
+
collectionsCmd
|
|
602
|
+
.command('get <slug>')
|
|
603
|
+
.description('Show full detail for a collection by slug')
|
|
604
|
+
.action(async (slug) => {
|
|
605
|
+
if (!slug?.trim()) {
|
|
606
|
+
program.commands.find((c) => c.name() === 'collections')?.help();
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
await runCollectionsGet({ slug: slug.trim() });
|
|
610
|
+
});
|
|
611
|
+
collectionsCmd
|
|
612
|
+
.command('audit')
|
|
613
|
+
.description('Collection health report — classification, icon, displayHint coverage, schema gaps')
|
|
614
|
+
.action(async () => {
|
|
615
|
+
await runCollectionsAudit();
|
|
616
|
+
});
|
|
617
|
+
collectionsCmd
|
|
618
|
+
.command('export')
|
|
619
|
+
.description('Export all system_collection_definitions with full classification metadata (admin only)')
|
|
620
|
+
.action(async () => {
|
|
621
|
+
await runCollectionsExport();
|
|
622
|
+
});
|
|
623
|
+
// --- Workspace operator commands (WP-305 Slice 4) ---
|
|
624
|
+
const workspaceCmd = program
|
|
625
|
+
.command('workspace')
|
|
626
|
+
.description('Operator commands for workspace health and repair (WP-305)');
|
|
627
|
+
workspaceCmd
|
|
628
|
+
.command('verify')
|
|
629
|
+
.description('Check workspace health — seeds, collections, glossary (admin only)')
|
|
630
|
+
.action(async () => {
|
|
631
|
+
await runWorkspaceVerify();
|
|
632
|
+
});
|
|
633
|
+
workspaceCmd
|
|
634
|
+
.command('repair')
|
|
635
|
+
.description('Backfill missing seeds for the active workspace (admin only)')
|
|
636
|
+
.action(async () => {
|
|
637
|
+
await runWorkspaceRepair();
|
|
638
|
+
});
|
|
639
|
+
// --- Definitions diff command (WP-305 Slice 4) ---
|
|
640
|
+
const definitionsCmd = program
|
|
641
|
+
.command('definitions')
|
|
642
|
+
.description('Inspect and compare workspace definitions (WP-305)');
|
|
643
|
+
definitionsCmd
|
|
644
|
+
.command('diff [file]')
|
|
645
|
+
.description('Compare local dev-system-collections.json against server definitions (admin only)')
|
|
646
|
+
.action(async (file) => {
|
|
647
|
+
await runDefinitionsDiff({ file });
|
|
648
|
+
});
|
|
649
|
+
// --- Profile commands (WP-302 Slice 2) ---
|
|
650
|
+
const profileCmd = program
|
|
651
|
+
.command('profile')
|
|
652
|
+
.description('Manage workspace profiles (WP-302: multi-workspace support)');
|
|
653
|
+
profileCmd
|
|
654
|
+
.command('list')
|
|
655
|
+
.description('List all profiles, mark active one')
|
|
656
|
+
.action(async () => {
|
|
657
|
+
await runProfileList();
|
|
658
|
+
});
|
|
659
|
+
profileCmd
|
|
660
|
+
.command('create <name>')
|
|
661
|
+
.description('Create a new profile with an API key')
|
|
662
|
+
.requiredOption('--api-key <key>', `API key (${API_KEY_PREFIX}...)`)
|
|
663
|
+
.option('--url <url>', 'Convex site URL (defaults to production)')
|
|
664
|
+
.action(async (name, opts) => {
|
|
665
|
+
await runProfileCreate({ name, apiKey: opts.apiKey, url: opts.url });
|
|
666
|
+
});
|
|
667
|
+
profileCmd
|
|
668
|
+
.command('use <name>')
|
|
669
|
+
.description('Switch active profile (closes any active session)')
|
|
670
|
+
.action(async (name) => {
|
|
671
|
+
await runProfileUse({ name });
|
|
672
|
+
});
|
|
673
|
+
profileCmd
|
|
674
|
+
.command('delete <name>')
|
|
675
|
+
.description('Delete a profile (cannot delete active or last profile)')
|
|
676
|
+
.action(async (name) => {
|
|
677
|
+
await runProfileDelete({ name });
|
|
678
|
+
});
|
|
679
|
+
// --- Glossary command (WP-302 Slice 4) ---
|
|
680
|
+
program
|
|
681
|
+
.command('glossary')
|
|
682
|
+
.description('Show key Product Brain CLI terms and definitions')
|
|
683
|
+
.action(() => {
|
|
684
|
+
if (isJsonMode()) {
|
|
685
|
+
process.stdout.write(JSON.stringify(GLOSSARY) + '\n');
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
const lines = [
|
|
689
|
+
'',
|
|
690
|
+
heading('Glossary'),
|
|
691
|
+
'',
|
|
692
|
+
formatGlossary(),
|
|
693
|
+
'',
|
|
694
|
+
];
|
|
695
|
+
process.stdout.write(lines.join('\n') + '\n');
|
|
696
|
+
});
|
|
697
|
+
// --- Usage command (WP-322 S4, FEAT-1011) ---
|
|
698
|
+
program
|
|
699
|
+
.command('usage')
|
|
700
|
+
.description('Session and activity dashboard — 4-tab Ink TUI (WP-322)')
|
|
701
|
+
.option('--json', 'Output machine-readable JSON (sessions, entries30d, activity array)')
|
|
702
|
+
.action(async (opts) => {
|
|
703
|
+
await runUsage({ json: opts.json });
|
|
704
|
+
});
|
|
705
|
+
// --- Admin command group (WP-312 S2, FEAT-969) ---
|
|
706
|
+
program.addCommand(createAdminCommand());
|
|
707
|
+
// --- Upgrade command (WP-322 S1: ambient update notification) ---
|
|
708
|
+
program
|
|
709
|
+
.command('upgrade')
|
|
710
|
+
.description('Upgrade pb CLI to the latest version (npm install -g @productbrain/cli@latest)')
|
|
711
|
+
.action(() => {
|
|
712
|
+
if (isJsonMode()) {
|
|
713
|
+
process.stdout.write(JSON.stringify({
|
|
714
|
+
command: 'npm install -g @productbrain/cli@latest',
|
|
715
|
+
hint: 'Run the command above to upgrade pb CLI.',
|
|
716
|
+
}) + '\n');
|
|
717
|
+
return;
|
|
89
718
|
}
|
|
719
|
+
process.stdout.write('\n');
|
|
720
|
+
process.stdout.write(`${bold('Upgrade pb CLI')} ${dim('—')} run the command below:\n\n`);
|
|
721
|
+
process.stdout.write(` npm install -g @productbrain/cli@latest\n\n`);
|
|
90
722
|
});
|
|
91
|
-
|
|
723
|
+
// Parse with global error handler — all uncaught errors route through handleError
|
|
724
|
+
program.parseAsync().catch(handleError);
|
|
92
725
|
//# sourceMappingURL=index.js.map
|