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