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