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