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