@productbrain/cli 0.1.0-beta.91 → 0.1.0-beta.917
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/dist/__tests__/audit.test.js +5 -0
- package/dist/__tests__/audit.test.js.map +1 -1
- 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__/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__/config.test.d.ts +1 -1
- package/dist/__tests__/config.test.js +410 -10
- package/dist/__tests__/config.test.js.map +1 -1
- package/dist/__tests__/constants.test.js +6 -1
- package/dist/__tests__/constants.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.js +1 -0
- package/dist/__tests__/errors.test.js.map +1 -1
- package/dist/__tests__/handshake-augment.test.d.ts +2 -0
- package/dist/__tests__/handshake-augment.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-augment.test.js +423 -0
- package/dist/__tests__/handshake-augment.test.js.map +1 -0
- package/dist/__tests__/handshake-dormancy.test.d.ts +2 -0
- package/dist/__tests__/handshake-dormancy.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-dormancy.test.js +207 -0
- package/dist/__tests__/handshake-dormancy.test.js.map +1 -0
- package/dist/__tests__/handshake-formatter.test.d.ts +2 -0
- package/dist/__tests__/handshake-formatter.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-formatter.test.js +67 -0
- package/dist/__tests__/handshake-formatter.test.js.map +1 -0
- package/dist/__tests__/handshake-preview.test.js +688 -3
- package/dist/__tests__/handshake-preview.test.js.map +1 -1
- package/dist/__tests__/handshake.e2e.test.d.ts +2 -0
- package/dist/__tests__/handshake.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/handshake.e2e.test.js +1252 -0
- package/dist/__tests__/handshake.e2e.test.js.map +1 -0
- package/dist/__tests__/handshake.test.js +611 -2
- package/dist/__tests__/handshake.test.js.map +1 -1
- package/dist/__tests__/manifest.test.js +118 -1
- package/dist/__tests__/manifest.test.js.map +1 -1
- package/dist/__tests__/onboarding-path-b.test.js +4 -4
- package/dist/__tests__/onboarding-path-b.test.js.map +1 -1
- package/dist/__tests__/orient.test.js +135 -8
- 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 +1 -2
- package/dist/__tests__/personal-layer.test.d.ts.map +1 -1
- package/dist/__tests__/personal-layer.test.js +12 -48
- package/dist/__tests__/personal-layer.test.js.map +1 -1
- package/dist/__tests__/profiles.test.js +153 -5
- package/dist/__tests__/profiles.test.js.map +1 -1
- package/dist/__tests__/promote.test.js +71 -2
- package/dist/__tests__/promote.test.js.map +1 -1
- package/dist/__tests__/session-state-machine.test.js +45 -1
- package/dist/__tests__/session-state-machine.test.js.map +1 -1
- 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 +129 -0
- package/dist/__tests__/session-switch.test.js.map +1 -0
- 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 +187 -0
- package/dist/__tests__/skill-vocabulary.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 +56 -0
- package/dist/__tests__/update-check.test.js.map +1 -0
- 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 +42 -0
- package/dist/__tests__/upgrade-runner.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.js +32 -12
- package/dist/__tests__/workspace.test.js.map +1 -1
- 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/admin/seed.d.ts +46 -2
- package/dist/commands/admin/seed.d.ts.map +1 -1
- package/dist/commands/admin/seed.js +475 -33
- package/dist/commands/admin/seed.js.map +1 -1
- package/dist/commands/admin/seed.test.d.ts +5 -0
- package/dist/commands/admin/seed.test.d.ts.map +1 -1
- package/dist/commands/admin/seed.test.js +67 -2
- package/dist/commands/admin/seed.test.js.map +1 -1
- 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 +117 -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 +67 -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 +30 -3
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/authority-domains.d.ts +146 -0
- package/dist/commands/authority-domains.d.ts.map +1 -0
- package/dist/commands/authority-domains.js +282 -0
- package/dist/commands/authority-domains.js.map +1 -0
- package/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +3 -2
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/codex-prep.d.ts +1 -0
- package/dist/commands/codex-prep.d.ts.map +1 -1
- package/dist/commands/codex-prep.js +10 -7
- package/dist/commands/codex-prep.js.map +1 -1
- package/dist/commands/connect-config.test.d.ts +2 -0
- package/dist/commands/connect-config.test.d.ts.map +1 -0
- package/dist/commands/connect-config.test.js +44 -0
- package/dist/commands/connect-config.test.js.map +1 -0
- package/dist/commands/connect-context.d.ts +45 -0
- package/dist/commands/connect-context.d.ts.map +1 -0
- package/dist/commands/connect-context.js +64 -0
- package/dist/commands/connect-context.js.map +1 -0
- package/dist/commands/connect-context.test.d.ts +2 -0
- package/dist/commands/connect-context.test.d.ts.map +1 -0
- package/dist/commands/connect-context.test.js +110 -0
- package/dist/commands/connect-context.test.js.map +1 -0
- package/dist/commands/connect-handoff.d.ts +51 -0
- package/dist/commands/connect-handoff.d.ts.map +1 -0
- package/dist/commands/connect-handoff.js +70 -0
- package/dist/commands/connect-handoff.js.map +1 -0
- package/dist/commands/connect-integration.test.js +29 -12
- package/dist/commands/connect-integration.test.js.map +1 -1
- package/dist/commands/connect-screens.d.ts +6 -4
- package/dist/commands/connect-screens.d.ts.map +1 -1
- package/dist/commands/connect-screens.js +30 -19
- package/dist/commands/connect-screens.js.map +1 -1
- package/dist/commands/connect.d.ts +21 -6
- package/dist/commands/connect.d.ts.map +1 -1
- package/dist/commands/connect.js +78 -51
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/connect.test.js +64 -1
- package/dist/commands/connect.test.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +68 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/doctor.test.js +131 -0
- package/dist/commands/doctor.test.js.map +1 -1
- package/dist/commands/handshake.d.ts +194 -2
- package/dist/commands/handshake.d.ts.map +1 -1
- package/dist/commands/handshake.js +1738 -44
- package/dist/commands/handshake.js.map +1 -1
- package/dist/commands/method.d.ts.map +1 -1
- package/dist/commands/method.js +3 -0
- package/dist/commands/method.js.map +1 -1
- package/dist/commands/migrate-setup.d.ts +18 -0
- package/dist/commands/migrate-setup.d.ts.map +1 -0
- package/dist/commands/migrate-setup.js +198 -0
- package/dist/commands/migrate-setup.js.map +1 -0
- package/dist/commands/orient.d.ts +15 -2
- package/dist/commands/orient.d.ts.map +1 -1
- package/dist/commands/orient.js +86 -4
- package/dist/commands/orient.js.map +1 -1
- package/dist/commands/profile.d.ts +11 -1
- package/dist/commands/profile.d.ts.map +1 -1
- package/dist/commands/profile.js +109 -26
- package/dist/commands/profile.js.map +1 -1
- package/dist/commands/promote.d.ts.map +1 -1
- package/dist/commands/promote.js +25 -2
- package/dist/commands/promote.js.map +1 -1
- package/dist/commands/relate.d.ts.map +1 -1
- package/dist/commands/relate.js +13 -0
- package/dist/commands/relate.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +55 -18
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/setup-audit.d.ts +59 -0
- package/dist/commands/setup-audit.d.ts.map +1 -0
- package/dist/commands/setup-audit.js +250 -0
- package/dist/commands/setup-audit.js.map +1 -0
- package/dist/commands/setup-detect-surfaces.d.ts +38 -0
- package/dist/commands/setup-detect-surfaces.d.ts.map +1 -0
- package/dist/commands/setup-detect-surfaces.js +76 -0
- package/dist/commands/setup-detect-surfaces.js.map +1 -0
- package/dist/commands/setup-ingest.d.ts +17 -0
- package/dist/commands/setup-ingest.d.ts.map +1 -0
- package/dist/commands/setup-ingest.js +226 -0
- package/dist/commands/setup-ingest.js.map +1 -0
- package/dist/commands/setup-resolver.d.ts +58 -0
- package/dist/commands/setup-resolver.d.ts.map +1 -0
- package/dist/commands/setup-resolver.js +150 -0
- package/dist/commands/setup-resolver.js.map +1 -0
- package/dist/commands/setup-state.d.ts +42 -0
- package/dist/commands/setup-state.d.ts.map +1 -0
- package/dist/commands/setup-state.js +93 -0
- package/dist/commands/setup-state.js.map +1 -0
- package/dist/commands/setup.d.ts +17 -9
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +52 -131
- package/dist/commands/setup.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 +89 -0
- package/dist/commands/upgrade.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 +74 -2
- package/dist/commands/workspace.d.ts.map +1 -1
- package/dist/commands/workspace.js +26 -2
- package/dist/commands/workspace.js.map +1 -1
- 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/handshake.d.ts +19 -3
- package/dist/formatters/handshake.d.ts.map +1 -1
- package/dist/formatters/handshake.js +48 -13
- package/dist/formatters/handshake.js.map +1 -1
- package/dist/formatters/orient.d.ts +50 -4
- package/dist/formatters/orient.d.ts.map +1 -1
- package/dist/formatters/orient.js +64 -16
- package/dist/formatters/orient.js.map +1 -1
- package/dist/formatters/session.js +1 -1
- package/dist/formatters/session.js.map +1 -1
- package/dist/generators/adapters.js +2 -2
- 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/context-md.js +6 -6
- package/dist/generators/context-md.js.map +1 -1
- package/dist/generators/manifest.d.ts +78 -0
- package/dist/generators/manifest.d.ts.map +1 -1
- package/dist/generators/manifest.js +125 -14
- package/dist/generators/manifest.js.map +1 -1
- package/dist/generators/portable-knowledge.d.ts +6 -12
- package/dist/generators/portable-knowledge.d.ts.map +1 -1
- package/dist/generators/portable-knowledge.js +2 -19
- package/dist/generators/portable-knowledge.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 +1 -2
- package/dist/generators/surface-profiles.d.ts.map +1 -1
- package/dist/generators/surface-profiles.js.map +1 -1
- package/dist/index.js +242 -26
- package/dist/index.js.map +1 -1
- package/dist/lib/activation.d.ts.map +1 -1
- package/dist/lib/activation.js +3 -3
- package/dist/lib/activation.js.map +1 -1
- package/dist/lib/activation.test.js +3 -3
- package/dist/lib/activation.test.js.map +1 -1
- 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.map +1 -1
- package/dist/lib/client.js +27 -17
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/config.d.ts +98 -9
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +231 -44
- 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 +2 -0
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +2 -0
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/errors.d.ts +3 -0
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +3 -0
- package/dist/lib/errors.js.map +1 -1
- 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/onboarding-path-b.d.ts.map +1 -1
- package/dist/lib/onboarding-path-b.js +0 -1
- package/dist/lib/onboarding-path-b.js.map +1 -1
- package/dist/lib/onboarding-shared.d.ts +0 -1
- package/dist/lib/onboarding-shared.d.ts.map +1 -1
- package/dist/lib/onboarding-shared.js +1 -17
- package/dist/lib/onboarding-shared.js.map +1 -1
- package/dist/lib/profiles.d.ts +3 -1
- package/dist/lib/profiles.d.ts.map +1 -1
- package/dist/lib/profiles.js +9 -6
- package/dist/lib/profiles.js.map +1 -1
- package/dist/lib/session.d.ts +10 -0
- package/dist/lib/session.d.ts.map +1 -1
- package/dist/lib/session.js +14 -0
- package/dist/lib/session.js.map +1 -1
- package/dist/lib/update-check.d.ts +20 -0
- package/dist/lib/update-check.d.ts.map +1 -1
- package/dist/lib/update-check.js +122 -21
- package/dist/lib/update-check.js.map +1 -1
- package/dist/lib/upgrade-runner.d.ts +21 -0
- package/dist/lib/upgrade-runner.d.ts.map +1 -0
- package/dist/lib/upgrade-runner.js +109 -0
- package/dist/lib/upgrade-runner.js.map +1 -0
- package/dist/lib/workspaceVocabCache.d.ts +60 -0
- package/dist/lib/workspaceVocabCache.d.ts.map +1 -0
- package/dist/lib/workspaceVocabCache.js +98 -0
- package/dist/lib/workspaceVocabCache.js.map +1 -0
- package/dist/setup/__tests__/coach-traces.test.d.ts +2 -0
- package/dist/setup/__tests__/coach-traces.test.d.ts.map +1 -0
- package/dist/setup/__tests__/coach-traces.test.js +189 -0
- package/dist/setup/__tests__/coach-traces.test.js.map +1 -0
- package/dist/setup/__tests__/setup-commands.test.d.ts +2 -0
- package/dist/setup/__tests__/setup-commands.test.d.ts.map +1 -0
- package/dist/setup/__tests__/setup-commands.test.js +177 -0
- package/dist/setup/__tests__/setup-commands.test.js.map +1 -0
- package/dist/setup/__tests__/state-machine.test.d.ts +2 -0
- package/dist/setup/__tests__/state-machine.test.d.ts.map +1 -0
- package/dist/setup/__tests__/state-machine.test.js +341 -0
- package/dist/setup/__tests__/state-machine.test.js.map +1 -0
- package/dist/setup/detect-surfaces.d.ts +21 -0
- package/dist/setup/detect-surfaces.d.ts.map +1 -0
- package/dist/setup/detect-surfaces.js +39 -0
- package/dist/setup/detect-surfaces.js.map +1 -0
- package/dist/setup/manifest-writer.d.ts +17 -0
- package/dist/setup/manifest-writer.d.ts.map +1 -0
- package/dist/setup/manifest-writer.js +153 -0
- package/dist/setup/manifest-writer.js.map +1 -0
- package/dist/setup/perimeter.d.ts +72 -0
- package/dist/setup/perimeter.d.ts.map +1 -0
- package/dist/setup/perimeter.js +128 -0
- package/dist/setup/perimeter.js.map +1 -0
- package/dist/setup/state-machine.d.ts +67 -0
- package/dist/setup/state-machine.d.ts.map +1 -0
- package/dist/setup/state-machine.js +124 -0
- package/dist/setup/state-machine.js.map +1 -0
- package/dist/surfaces/__tests__/adapter.test.d.ts +2 -0
- package/dist/surfaces/__tests__/adapter.test.d.ts.map +1 -0
- package/dist/surfaces/__tests__/adapter.test.js +90 -0
- package/dist/surfaces/__tests__/adapter.test.js.map +1 -0
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts +2 -0
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts.map +1 -0
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.js +132 -0
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.js.map +1 -0
- package/dist/surfaces/__tests__/telemetry.test.d.ts +2 -0
- package/dist/surfaces/__tests__/telemetry.test.d.ts.map +1 -0
- package/dist/surfaces/__tests__/telemetry.test.js +55 -0
- package/dist/surfaces/__tests__/telemetry.test.js.map +1 -0
- package/dist/surfaces/adapter.d.ts +70 -0
- package/dist/surfaces/adapter.d.ts.map +1 -0
- package/dist/surfaces/adapter.js +2 -0
- package/dist/surfaces/adapter.js.map +1 -0
- package/dist/surfaces/adapters/claude.d.ts +3 -0
- package/dist/surfaces/adapters/claude.d.ts.map +1 -0
- package/dist/surfaces/adapters/claude.js +67 -0
- package/dist/surfaces/adapters/claude.js.map +1 -0
- package/dist/surfaces/adapters/codex.d.ts +3 -0
- package/dist/surfaces/adapters/codex.d.ts.map +1 -0
- package/dist/surfaces/adapters/codex.js +61 -0
- package/dist/surfaces/adapters/codex.js.map +1 -0
- package/dist/surfaces/adapters/copilot.d.ts +3 -0
- package/dist/surfaces/adapters/copilot.d.ts.map +1 -0
- package/dist/surfaces/adapters/copilot.js +59 -0
- package/dist/surfaces/adapters/copilot.js.map +1 -0
- package/dist/surfaces/adapters/cursor.d.ts +3 -0
- package/dist/surfaces/adapters/cursor.d.ts.map +1 -0
- package/dist/surfaces/adapters/cursor.js +78 -0
- package/dist/surfaces/adapters/cursor.js.map +1 -0
- package/dist/surfaces/registry.d.ts +58 -2
- package/dist/surfaces/registry.d.ts.map +1 -1
- package/dist/surfaces/registry.js +82 -7
- package/dist/surfaces/registry.js.map +1 -1
- 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 +2 -1
- package/dist/__tests__/setup.test.d.ts +0 -2
- package/dist/__tests__/setup.test.d.ts.map +0 -1
- package/dist/__tests__/setup.test.js +0 -141
- package/dist/__tests__/setup.test.js.map +0 -1
- package/dist/generators/__tests__/surface-profiles.test.d.ts +0 -2
- package/dist/generators/__tests__/surface-profiles.test.d.ts.map +0 -1
- package/dist/generators/__tests__/surface-profiles.test.js +0 -89
- package/dist/generators/__tests__/surface-profiles.test.js.map +0 -1
- package/dist/lib/onboarding-phases.d.ts +0 -9
- package/dist/lib/onboarding-phases.d.ts.map +0 -1
- package/dist/lib/onboarding-phases.js +0 -120
- package/dist/lib/onboarding-phases.js.map +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { describe, it, expect } from 'vitest';
|
|
5
|
+
import { MARKER } from './adapters.js';
|
|
6
|
+
import { REGION_START, REGION_END, REGION_OPT_OUT, classifyAdapterFile, detectEol, spliceAppend, spliceReplace, } from './region.js';
|
|
7
|
+
describe('region sentinels', () => {
|
|
8
|
+
it('are disjoint from the whole-file MARKER (both directions)', () => {
|
|
9
|
+
expect(REGION_START.includes(MARKER)).toBe(false);
|
|
10
|
+
expect(REGION_END.includes(MARKER)).toBe(false);
|
|
11
|
+
expect(MARKER.includes(REGION_START)).toBe(false);
|
|
12
|
+
expect(MARKER.includes(REGION_END)).toBe(false);
|
|
13
|
+
});
|
|
14
|
+
it('opt-out sentinel is disjoint from MARKER and the region sentinels', () => {
|
|
15
|
+
expect(REGION_OPT_OUT.includes(MARKER)).toBe(false);
|
|
16
|
+
expect(REGION_START.includes(REGION_OPT_OUT)).toBe(false);
|
|
17
|
+
expect(REGION_END.includes(REGION_OPT_OUT)).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
describe('detectEol', () => {
|
|
21
|
+
it('returns LF for empty / no-newline / LF-dominant', () => {
|
|
22
|
+
expect(detectEol('')).toBe('\n');
|
|
23
|
+
expect(detectEol('one line')).toBe('\n');
|
|
24
|
+
expect(detectEol('a\nb\nc\n')).toBe('\n');
|
|
25
|
+
});
|
|
26
|
+
it('returns CRLF when CRLF-dominant', () => {
|
|
27
|
+
expect(detectEol('a\r\nb\r\nc\r\n')).toBe('\r\n');
|
|
28
|
+
});
|
|
29
|
+
it('returns LF when CRLF and lone-LF counts tie (tie-breaks to LF)', () => {
|
|
30
|
+
expect(detectEol('a\r\nb\n')).toBe('\n');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
describe('classifyAdapterFile', () => {
|
|
34
|
+
const region = `${REGION_START}\n## x\n${REGION_END}`;
|
|
35
|
+
it('pb-managed when MARKER present (even with sentinel-looking text)', () => {
|
|
36
|
+
expect(classifyAdapterFile(`<!-- ${MARKER} -->\n${region}`)).toBe('pb-managed');
|
|
37
|
+
});
|
|
38
|
+
it('augmentable when no MARKER and no sentinels', () => {
|
|
39
|
+
expect(classifyAdapterFile('# my file\n')).toBe('augmentable');
|
|
40
|
+
});
|
|
41
|
+
it('region-present for exactly one balanced pair', () => {
|
|
42
|
+
expect(classifyAdapterFile(`# mine\n\n${region}\n`)).toBe('region-present');
|
|
43
|
+
});
|
|
44
|
+
it('malformed: start without end', () => {
|
|
45
|
+
expect(classifyAdapterFile(`# mine\n${REGION_START}\n`)).toBe('malformed');
|
|
46
|
+
});
|
|
47
|
+
it('malformed: end without start', () => {
|
|
48
|
+
expect(classifyAdapterFile(`# mine\n${REGION_END}\n`)).toBe('malformed');
|
|
49
|
+
});
|
|
50
|
+
it('malformed: duplicate starts', () => {
|
|
51
|
+
expect(classifyAdapterFile(`${REGION_START}\n${REGION_START}\n${REGION_END}`)).toBe('malformed');
|
|
52
|
+
});
|
|
53
|
+
it('malformed: duplicate ends', () => {
|
|
54
|
+
expect(classifyAdapterFile(`${REGION_START}\n${REGION_END}\n${REGION_END}`)).toBe('malformed');
|
|
55
|
+
});
|
|
56
|
+
it('malformed: end before start', () => {
|
|
57
|
+
expect(classifyAdapterFile(`${REGION_END}\nx\n${REGION_START}`)).toBe('malformed');
|
|
58
|
+
});
|
|
59
|
+
it('opt-out when the pb:no-augment sentinel is present (no MARKER)', () => {
|
|
60
|
+
expect(classifyAdapterFile(`# constitution\n${REGION_OPT_OUT}\n`)).toBe('opt-out');
|
|
61
|
+
});
|
|
62
|
+
it('opt-out wins over an existing region (user froze the file)', () => {
|
|
63
|
+
expect(classifyAdapterFile(`${REGION_OPT_OUT}\n${region}`)).toBe('opt-out');
|
|
64
|
+
});
|
|
65
|
+
it('opt-out wins over malformed sentinels (decline beats refusal)', () => {
|
|
66
|
+
expect(classifyAdapterFile(`${REGION_OPT_OUT}\n${REGION_START}\n(no end)\n`)).toBe('opt-out');
|
|
67
|
+
});
|
|
68
|
+
it('MARKER still wins over opt-out (whole-file pb-managed precedence)', () => {
|
|
69
|
+
expect(classifyAdapterFile(`<!-- ${MARKER} -->\n${REGION_OPT_OUT}\n`)).toBe('pb-managed');
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe('spliceAppend (never strips user bytes)', () => {
|
|
73
|
+
const region = `${REGION_START}\n## x\n${REGION_END}`;
|
|
74
|
+
it('empty/whitespace-only → region only (identical for both)', () => {
|
|
75
|
+
expect(spliceAppend('', region, '\n')).toBe(region + '\n');
|
|
76
|
+
expect(spliceAppend(' \n\n', region, '\n')).toBe(region + '\n');
|
|
77
|
+
});
|
|
78
|
+
it('no trailing newline → adds blank-line separator', () => {
|
|
79
|
+
expect(spliceAppend('last line', region, '\n')).toBe(`last line\n\n${region}\n`);
|
|
80
|
+
});
|
|
81
|
+
it('one trailing newline → one more for a blank line', () => {
|
|
82
|
+
expect(spliceAppend('body\n', region, '\n')).toBe(`body\n\n${region}\n`);
|
|
83
|
+
});
|
|
84
|
+
it('two+ trailing newlines → preserved verbatim, no extra separator', () => {
|
|
85
|
+
expect(spliceAppend('body\n\n\n', region, '\n')).toBe(`body\n\n\n${region}\n`);
|
|
86
|
+
});
|
|
87
|
+
it('exactly two trailing newlines → no extra separator', () => {
|
|
88
|
+
expect(spliceAppend('body\n\n', region, '\n')).toBe(`body\n\n${region}\n`);
|
|
89
|
+
});
|
|
90
|
+
it('CRLF file → region rendered + separated with CRLF; user bytes preserved', () => {
|
|
91
|
+
expect(spliceAppend('a\r\n', region, '\r\n')).toBe(`a\r\n\r\n${region}\r\n`);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
describe('spliceReplace (only between sentinels; surrounding bytes verbatim)', () => {
|
|
95
|
+
it('replaces region body, preserves prefix + suffix byte-for-byte', () => {
|
|
96
|
+
const before = '# mine\nkeep me\n\n';
|
|
97
|
+
const after = '\nmore user text\n';
|
|
98
|
+
const oldRegion = `${REGION_START}\nOLD\n${REGION_END}`;
|
|
99
|
+
const newRegion = `${REGION_START}\nNEW\n${REGION_END}`;
|
|
100
|
+
const disk = before + oldRegion + after;
|
|
101
|
+
expect(spliceReplace(disk, newRegion)).toBe(before + newRegion + after);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
describe('append → replace convergence (idempotency)', () => {
|
|
105
|
+
it('appending once then replacing with identical region is byte-stable', () => {
|
|
106
|
+
const region = `${REGION_START}\n## x\n${REGION_END}`;
|
|
107
|
+
const appended = spliceAppend('# mine\nbody\n', region, '\n');
|
|
108
|
+
expect(classifyAdapterFile(appended)).toBe('region-present');
|
|
109
|
+
expect(spliceReplace(appended, region)).toBe(appended);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
// Reads the ACTUAL committed constitution files (not a copy of the sentinel string), so it catches
|
|
113
|
+
// drift in EITHER REGION_OPT_OUT or the files themselves — the exact bug class where a paraphrased
|
|
114
|
+
// comment was not a substring of the literal sentinel and the files would have been spliced anyway.
|
|
115
|
+
describe('committed constitution declines augmentation (TEN-2155 governance regression)', () => {
|
|
116
|
+
// This test lives at <repo>/packages/cli/src/generators — walk up 4 to the repo root.
|
|
117
|
+
const repoRoot = join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..', '..');
|
|
118
|
+
for (const file of ['CLAUDE.md', 'AGENTS.md']) {
|
|
119
|
+
it(`${file} carries the literal opt-out sentinel and classifies 'opt-out'`, () => {
|
|
120
|
+
const content = readFileSync(join(repoRoot, file), 'utf8');
|
|
121
|
+
expect(content.includes(REGION_OPT_OUT), `${file} must contain the literal sentinel ${JSON.stringify(REGION_OPT_OUT)}`).toBe(true);
|
|
122
|
+
expect(classifyAdapterFile(content), `${file} must classify 'opt-out' so handshake never splices it`).toBe('opt-out');
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
//# sourceMappingURL=region.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"region.test.js","sourceRoot":"","sources":["../../src/generators/region.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EACL,YAAY,EAAE,UAAU,EAAE,cAAc,EACxC,mBAAmB,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,GAC5D,MAAM,aAAa,CAAC;AAErB,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,CAAC,cAAc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,CAAC,cAAc,CAAC,EAChC,GAAG,IAAI,sCAAsC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAC9E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACb,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,wDAAwD,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* BET-270 Slice 0: type system + registry only. Generators accept but do not yet use the profile.
|
|
5
5
|
* BET-270 Slice 4: pluggable surface registration + fallback.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
export type { TargetName };
|
|
7
|
+
export type TargetName = 'cursor' | 'claude' | 'copilot' | 'codex';
|
|
9
8
|
export interface SurfaceProfile {
|
|
10
9
|
/** How the agent executes work in this surface. */
|
|
11
10
|
executionModel: 'batch' | 'interactive' | 'passive';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface-profiles.d.ts","sourceRoot":"","sources":["../../src/generators/surface-profiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"surface-profiles.d.ts","sourceRoot":"","sources":["../../src/generators/surface-profiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAEnE,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,cAAc,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAAC;IACpD,8EAA8E;IAC9E,MAAM,EAAE,YAAY,GAAG,aAAa,CAAC;IACrC,oDAAoD;IACpD,YAAY,EAAE,WAAW,GAAG,gBAAgB,GAAG,YAAY,CAAC;IAC5D,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,aAAa,EAAE,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;CACrD;AAID,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,cAAc,CA6B/D,CAAC;AAKF;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAID;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,cAAc,CAWlF;AAID;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAY3E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAKpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface-profiles.js","sourceRoot":"","sources":["../../src/generators/surface-profiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"surface-profiles.js","sourceRoot":"","sources":["../../src/generators/surface-profiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmBH,0EAA0E;AAE1E,MAAM,CAAC,MAAM,gBAAgB,GAAuC;IAClE,MAAM,EAAE;QACN,cAAc,EAAE,aAAa;QAC7B,MAAM,EAAE,YAAY;QACpB,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,cAAc;KAC9B;IACD,MAAM,EAAE;QACN,cAAc,EAAE,aAAa;QAC7B,MAAM,EAAE,YAAY;QACpB,YAAY,EAAE,gBAAgB;QAC9B,WAAW,EAAE,KAAK;QAClB,aAAa,EAAE,cAAc;KAC9B;IACD,KAAK,EAAE;QACL,cAAc,EAAE,OAAO;QACvB,MAAM,EAAE,YAAY;QACpB,YAAY,EAAE,YAAY;QAC1B,WAAW,EAAE,MAAM;QACnB,aAAa,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AAO,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CACb,gCAAgC,IAAI,+DAA+D,CACpG,CAAC;IACJ,CAAC;IACD,gBAAgB,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;AACxE,CAAC;AAED,yEAAyE;AAEzE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAc;IAClD,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAoB,CAAC,CAAC;IACrD,OAAO,KAAK,IAAI,gBAAgB,CAAC,KAAK,CAAC;AACzC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,9 @@ import { runGet, runGetMany } from './commands/get.js';
|
|
|
17
17
|
import { runConnect } from './commands/connect.js';
|
|
18
18
|
import { runLogin } from './commands/login.js';
|
|
19
19
|
import { runSetup } from './commands/setup.js';
|
|
20
|
+
import { runSetupDetectSurfaces, formatDetectSurfacesSummary } from './commands/setup-detect-surfaces.js';
|
|
21
|
+
import { runSetupState } from './commands/setup-state.js';
|
|
22
|
+
import { runSetupAudit } from './commands/setup-audit.js';
|
|
20
23
|
import { runOrient } from './commands/orient.js';
|
|
21
24
|
import { runSearch } from './commands/search.js';
|
|
22
25
|
import { runHandshake, runHandshakeInit } from './commands/handshake.js';
|
|
@@ -41,7 +44,10 @@ import { runVerify } from './commands/verify.js';
|
|
|
41
44
|
import { runCodexPrep } from './commands/codex-prep.js';
|
|
42
45
|
import { runCollectionsList, runCollectionsGet, runCollectionsAudit, runCollectionsExport } from './commands/collections.js';
|
|
43
46
|
import { runWorkspaceVerify, runWorkspaceRepair, runDefinitionsDiff } from './commands/workspace.js';
|
|
47
|
+
import { runAuthorityDomainsActivateCutover, runAuthorityDomainsDeactivateCutover, runAuthorityDomainsBenchmark, runAuthorityDomainsDiscardPending, runAuthorityDomainsPropose, runAuthorityDomainsRatify, runAuthorityDomainsReadiness, runAuthorityDomainsRecordSample, runAuthorityDomainsReject, runAuthorityDomainsReview, runAuthorityDomainsPrincipleDistribution, } from './commands/authority-domains.js';
|
|
44
48
|
import { runDoctor } from './commands/doctor.js';
|
|
49
|
+
import { runWhoami } from './commands/whoami.js';
|
|
50
|
+
import { runUpgrade } from './commands/upgrade.js';
|
|
45
51
|
import { runProfileList, runProfileCreate, runProfileUse, runProfileDelete } from './commands/profile.js';
|
|
46
52
|
import { runInit } from './commands/init.js';
|
|
47
53
|
import { runMethodList, runMethodShow, runMethodDiff, runMethodPublish } from './commands/method.js';
|
|
@@ -49,10 +55,56 @@ import { createAdminCommand } from './commands/admin/index.js';
|
|
|
49
55
|
import { runUsage } from './commands/usage.js';
|
|
50
56
|
import { GLOSSARY, formatGlossary } from './lib/glossary.js';
|
|
51
57
|
import { API_KEY_PREFIX } from './lib/tokenConstants.js';
|
|
52
|
-
import { hint, heading, bold, dim, green, icons } from './lib/style.js';
|
|
58
|
+
import { hint, heading, bold, dim, green, icons, yellow } from './lib/style.js';
|
|
59
|
+
import { getPreviewBinding } from './lib/config.js';
|
|
53
60
|
import { checkForUpdate } from './lib/update-check.js';
|
|
61
|
+
import { UPGRADE_COMMAND } from './lib/constants.js';
|
|
54
62
|
import { resolveSetupState, detectRenderTier } from './lib/state.js';
|
|
55
63
|
const program = new Command();
|
|
64
|
+
/**
|
|
65
|
+
* Top-level Chain-write commands that receive the throwaway-writes advisory in
|
|
66
|
+
* addition to the PREVIEW banner. Each is registered directly on `program`, so
|
|
67
|
+
* `actionCommand.name()` matches verbatim. We gate on top-level (parent === program)
|
|
68
|
+
* to avoid false positives from nested commands whose leaf name collides
|
|
69
|
+
* (e.g. `pb workspace verify`, which is a health check, not a Chain write).
|
|
70
|
+
*/
|
|
71
|
+
const PREVIEW_WRITE_COMMANDS = new Set([
|
|
72
|
+
'capture',
|
|
73
|
+
'update',
|
|
74
|
+
'verify',
|
|
75
|
+
'promote',
|
|
76
|
+
'relate',
|
|
77
|
+
'unrelate',
|
|
78
|
+
'ingest',
|
|
79
|
+
'accept',
|
|
80
|
+
'reject',
|
|
81
|
+
]);
|
|
82
|
+
/**
|
|
83
|
+
* Print a loud PREVIEW banner to stderr when pb is bound to a throwaway preview.
|
|
84
|
+
*
|
|
85
|
+
* Writes to stderr (NOT stdout) so stdout stays clean JSON for agents — and so the
|
|
86
|
+
* banner appears even when --json or --quiet are set, which is the whole point: the
|
|
87
|
+
* agent must see it every time. Cheap + synchronous (one file read). Never throws.
|
|
88
|
+
*
|
|
89
|
+
* For every Chain-write command (see PREVIEW_WRITE_COMMANDS), also writes an
|
|
90
|
+
* advisory reminding the user that real learnings belong in the real Chain.
|
|
91
|
+
*/
|
|
92
|
+
function printPreviewBanner(actionCommand) {
|
|
93
|
+
try {
|
|
94
|
+
const binding = getPreviewBinding();
|
|
95
|
+
if (!binding)
|
|
96
|
+
return;
|
|
97
|
+
const name = binding.workspaceName ?? 'preview';
|
|
98
|
+
process.stderr.write(yellow(bold(`⚠ PREVIEW ${name} — writes are throwaway. npm run pb:real to return to the real Chain`)) + '\n');
|
|
99
|
+
const isTopLevel = actionCommand.parent?.name() === 'pb';
|
|
100
|
+
if (isTopLevel && PREVIEW_WRITE_COMMANDS.has(actionCommand.name())) {
|
|
101
|
+
process.stderr.write(` → real learnings belong in the real Chain. Switch back with: npm run pb:real\n`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// Never let the banner crash the CLI
|
|
106
|
+
}
|
|
107
|
+
}
|
|
56
108
|
/**
|
|
57
109
|
* Global error handler — single exit point for all CLI errors.
|
|
58
110
|
* CLIError: format with code + category + guidance.
|
|
@@ -111,7 +163,10 @@ program
|
|
|
111
163
|
.option('-q, --quiet', 'Suppress non-essential output (banners, hints, progress)')
|
|
112
164
|
.exitOverride(); // Throw CommanderError instead of calling process.exit directly
|
|
113
165
|
// Apply global output mode BEFORE subcommand actions run
|
|
114
|
-
|
|
166
|
+
// Commander preAction hook signature: (hookedCommand, actionCommand)
|
|
167
|
+
// hookedCommand = the command where hook was registered (root program)
|
|
168
|
+
// actionCommand = the subcommand actually being invoked
|
|
169
|
+
program.hook('preAction', (_hookedCommand, actionCommand) => {
|
|
115
170
|
const globalOpts = program.opts();
|
|
116
171
|
if (globalOpts.json) {
|
|
117
172
|
setOutputMode('json');
|
|
@@ -125,7 +180,9 @@ program.hook('preAction', (thisCommand) => {
|
|
|
125
180
|
}
|
|
126
181
|
// Ambient update notification — non-blocking, suppressed in JSON mode (WP-322 S1)
|
|
127
182
|
checkForUpdate(cliPackageVersion.version);
|
|
128
|
-
|
|
183
|
+
// PREVIEW banner — writes to stderr so it's always visible even in --json/--quiet mode.
|
|
184
|
+
// Advisory line added for top-level Chain-write commands: real learnings belong in the real Chain.
|
|
185
|
+
printPreviewBanner(actionCommand);
|
|
129
186
|
});
|
|
130
187
|
// Default action — status dashboard when `pb` is invoked with no command.
|
|
131
188
|
// `pb --help` still works because Commander intercepts --help before the action runs.
|
|
@@ -345,9 +402,10 @@ program
|
|
|
345
402
|
.option('-b, --brief', 'Compact view: stage, counts, top bets, tensions, planned work')
|
|
346
403
|
.option('-t, --task <task>', 'Task description for task-shaped governance and context')
|
|
347
404
|
// SYNC: domain list must match TaskDomain in convex/agentKnowledge/startupResolver.ts
|
|
348
|
-
.option('-s, --scope <domain>', 'Domain scope for governance filtering.
|
|
405
|
+
.option('-s, --scope <domain>', 'Domain scope for governance filtering. Accepts authority roots, child scopes such as product-design/ux and data/analytics, and legacy internal scopes.')
|
|
406
|
+
.option('--full', 'Full depth orient (tier=full). Use for thorough context loading.')
|
|
349
407
|
.action(async (opts) => {
|
|
350
|
-
await runOrient({ brief: opts.brief, task: opts.task?.trim() || undefined, scope: opts.scope?.trim() || undefined });
|
|
408
|
+
await runOrient({ brief: opts.brief, task: opts.task?.trim() || undefined, scope: opts.scope?.trim() || undefined, full: opts.full });
|
|
351
409
|
});
|
|
352
410
|
program
|
|
353
411
|
.command('handshake')
|
|
@@ -359,24 +417,29 @@ program
|
|
|
359
417
|
.option('--level <level>', 'With --init: trust level (guide|work|silent|full-trust). Without --init: content tier (beginner|intermediate|expert)')
|
|
360
418
|
.option('--generate', 'Fetch governance entries from the Chain and merge generated rules (BET-286)')
|
|
361
419
|
.option('--surfaces <list>', 'Comma-separated surfaces to write (cursor,claude,copilot,codex)')
|
|
420
|
+
.option('--no-prompt', 'Headless mode: refuse on tampered projection files (WP-421 S3, doneWhen #17). Always implied when stdout is not a TTY.')
|
|
421
|
+
.option('--lenient', 'WP-439 S4: continue past setup-asset body fetch failures with a warning (legacy behaviour). By default, body fetch failures are hard errors; run `pb setup-audit --repair` to fix orphaned rows.')
|
|
362
422
|
.action(async (opts) => {
|
|
363
423
|
if (opts.init) {
|
|
364
424
|
await runHandshakeInit({ level: opts.level, dryRun: opts.dryRun });
|
|
365
425
|
return;
|
|
366
426
|
}
|
|
367
|
-
|
|
427
|
+
// Commander turns `--no-prompt` into `prompt: false`. We invert so HandshakeOptions sees noPrompt=true.
|
|
428
|
+
const noPrompt = opts.prompt === false;
|
|
429
|
+
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 });
|
|
368
430
|
});
|
|
369
431
|
program
|
|
370
432
|
.command('codex-prep <task...>')
|
|
371
433
|
.description('Generate task-specific governance context for Codex (.codex/task-context.md)')
|
|
372
434
|
.option('--dry-run', 'Print to stdout instead of writing file')
|
|
435
|
+
.option('--full', 'Full depth orient (tier=full). Use for thorough context loading.')
|
|
373
436
|
.action(async (taskParts, opts) => {
|
|
374
437
|
const task = taskParts.join(' ').trim();
|
|
375
438
|
if (!task) {
|
|
376
439
|
program.commands.find((c) => c.name() === 'codex-prep')?.help();
|
|
377
440
|
return;
|
|
378
441
|
}
|
|
379
|
-
await runCodexPrep({ task, dryRun: opts.dryRun });
|
|
442
|
+
await runCodexPrep({ task, dryRun: opts.dryRun, full: opts.full });
|
|
380
443
|
});
|
|
381
444
|
program
|
|
382
445
|
.command('init')
|
|
@@ -386,14 +449,15 @@ program
|
|
|
386
449
|
});
|
|
387
450
|
program
|
|
388
451
|
.command('connect <token>')
|
|
389
|
-
.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.')
|
|
452
|
+
.description('Redeem an onboarding token and save your API key locally (FEAT-958). Uses CONVEX_SITE_URL if set, otherwise the production gateway. Override with --gateway or PB_CONNECT_GATEWAY_URL. Optional --name sets the key label in workspace settings (useful in non-interactive shells).')
|
|
390
453
|
.option('--gateway <url>', 'Override redeem gateway (default: CONVEX_SITE_URL or production). Use when token came from a different Convex deployment.')
|
|
454
|
+
.option('--name <label>', 'Optional label for this API key in workspace settings. In non-interactive terminals, use this instead of a prompt.')
|
|
391
455
|
.action(async (token, opts) => {
|
|
392
456
|
if (!token?.trim()) {
|
|
393
457
|
program.commands.find((c) => c.name() === 'connect')?.help();
|
|
394
458
|
return;
|
|
395
459
|
}
|
|
396
|
-
await runConnect(token.trim(), { gateway: opts.gateway });
|
|
460
|
+
await runConnect(token.trim(), { gateway: opts.gateway, name: opts.name });
|
|
397
461
|
});
|
|
398
462
|
program
|
|
399
463
|
.command('login')
|
|
@@ -409,12 +473,49 @@ program
|
|
|
409
473
|
.action(async (opts) => {
|
|
410
474
|
await runDoctor({ fix: opts.fix, dryRun: opts.dryRun });
|
|
411
475
|
});
|
|
476
|
+
program
|
|
477
|
+
.command('whoami')
|
|
478
|
+
.alias('status')
|
|
479
|
+
.description('Show the active profile + workspace (fast; no session required).')
|
|
480
|
+
.action(async () => {
|
|
481
|
+
await runWhoami();
|
|
482
|
+
});
|
|
412
483
|
program
|
|
413
484
|
.command('setup')
|
|
414
|
-
.description('
|
|
485
|
+
.description('Canonical pb-setup entry (DEC-995): detect surfaces, read state, emit JSON for the skill body.')
|
|
415
486
|
.action(async () => {
|
|
416
487
|
await runSetup();
|
|
417
488
|
});
|
|
489
|
+
program
|
|
490
|
+
.command('setup-detect-surfaces')
|
|
491
|
+
.description('Detect local surface markers and union-merge into manifest.surfaces (STD-235 forward-only)')
|
|
492
|
+
.action(async () => {
|
|
493
|
+
const result = await runSetupDetectSurfaces();
|
|
494
|
+
if (process.stdout.isTTY) {
|
|
495
|
+
process.stdout.write(formatDetectSurfacesSummary(result) + '\n');
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
process.stderr.write(formatDetectSurfacesSummary(result) + '\n');
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
program
|
|
502
|
+
.command('setup-state')
|
|
503
|
+
.description('Emit compact JSON of getPbSetupState (machine-readable, used by the pb-setup skill body)')
|
|
504
|
+
.action(async () => {
|
|
505
|
+
await runSetupState();
|
|
506
|
+
});
|
|
507
|
+
// WP-439 S2: setup-asset orphan audit. Read-only diagnostic; exits 1 if any
|
|
508
|
+
// setup_asset row has a broken body wiring (will fail at handshake).
|
|
509
|
+
// WP-439 S3: --repair attempts to restore class III/II orphans from STARTER_*
|
|
510
|
+
// constants. Class I (inline-only) and IV (hash drift) are NOT touched.
|
|
511
|
+
program
|
|
512
|
+
.command('setup-audit')
|
|
513
|
+
.description('Audit setup_asset rows for orphaned bodies (WP-439 S2/S3). Exits 1 if any orphan or repair-failure.')
|
|
514
|
+
.option('--json', 'Emit machine-readable JSON (overrides pretty output for this command)')
|
|
515
|
+
.option('--repair', 'Attempt to restore class III/II orphans from STARTER_* constants (WP-439 S3)')
|
|
516
|
+
.action(async (opts) => {
|
|
517
|
+
await runSetupAudit({ json: opts.json, repair: opts.repair });
|
|
518
|
+
});
|
|
418
519
|
// --- Write commands (require active session) ---
|
|
419
520
|
const sessionCmd = program
|
|
420
521
|
.command('session')
|
|
@@ -545,6 +646,30 @@ program
|
|
|
545
646
|
concurrency,
|
|
546
647
|
});
|
|
547
648
|
});
|
|
649
|
+
// --- migrate:setup command (WP-345 S0b) ---
|
|
650
|
+
program
|
|
651
|
+
.command('migrate:setup')
|
|
652
|
+
.description('Migrate .productbrain/skills|rules|hooks/*.md into the DB setup-assets collection (WP-345)')
|
|
653
|
+
.option('--dry-run', 'Show what would be migrated without writing to DB.')
|
|
654
|
+
.option('--cwd <path>', 'Override working directory (default: process.cwd())')
|
|
655
|
+
.action(async (opts) => {
|
|
656
|
+
const { runMigrateSetup } = await import('./commands/migrate-setup.js');
|
|
657
|
+
await runMigrateSetup({ dryRun: opts.dryRun, cwd: opts.cwd });
|
|
658
|
+
});
|
|
659
|
+
// --- setup:ingest command (WP-345 S3) ---
|
|
660
|
+
program
|
|
661
|
+
.command('setup:ingest <path>')
|
|
662
|
+
.description('Push a single .productbrain skill/rule/hook file to the DB setup-assets SSOT (WP-345)')
|
|
663
|
+
.option('--dry-run', 'Show what would be ingested without writing to DB.')
|
|
664
|
+
.option('--json', 'Output machine-readable JSON (deprecated: use global --json flag)')
|
|
665
|
+
.action(async (filePath, opts) => {
|
|
666
|
+
if (!filePath?.trim()) {
|
|
667
|
+
program.commands.find((c) => c.name() === 'setup:ingest')?.help();
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
const { runSetupIngest } = await import('./commands/setup-ingest.js');
|
|
671
|
+
await runSetupIngest(filePath.trim(), { dryRun: opts.dryRun });
|
|
672
|
+
});
|
|
548
673
|
// --- Fields command (BET-181 Slice 2) ---
|
|
549
674
|
program
|
|
550
675
|
.command('fields <collection>')
|
|
@@ -570,7 +695,7 @@ program
|
|
|
570
695
|
// --- Audit command (BET-182 Slice 2) ---
|
|
571
696
|
program
|
|
572
697
|
.command('audit <entry-ids...>')
|
|
573
|
-
.description('Run
|
|
698
|
+
.description('Run hygiene audit on bet(s) — 13 gates (shaping) / 18 gates (handoff), exit code reflects verdict')
|
|
574
699
|
.option('--phase <phase>', 'Override phase detection (shaping | handoff)')
|
|
575
700
|
.option('--gate <name>', 'Run only specified gate(s) (repeatable)', (val, prev) => [...prev, val], [])
|
|
576
701
|
.option('--fix', 'Auto-execute exact fixes via pb update, rerun once')
|
|
@@ -667,6 +792,96 @@ workspaceCmd
|
|
|
667
792
|
.action(async () => {
|
|
668
793
|
await runWorkspaceRepair();
|
|
669
794
|
});
|
|
795
|
+
const authorityDomainsCmd = program
|
|
796
|
+
.command('authority-domains')
|
|
797
|
+
.description('Operator commands for WP-354 authority-domain readiness and evidence');
|
|
798
|
+
authorityDomainsCmd
|
|
799
|
+
.command('propose')
|
|
800
|
+
.description('Generate authority-domain tag proposals')
|
|
801
|
+
.option('--dry-run', 'Preview without writing staging proposals')
|
|
802
|
+
.option('--limit <n>', 'Maximum governance entries to classify')
|
|
803
|
+
.option('--mock', 'Use deterministic mock classifier')
|
|
804
|
+
.action(async (opts) => {
|
|
805
|
+
await runAuthorityDomainsPropose(opts);
|
|
806
|
+
});
|
|
807
|
+
authorityDomainsCmd
|
|
808
|
+
.command('review')
|
|
809
|
+
.description('List authority-domain tag proposals')
|
|
810
|
+
.option('--status <status>', 'pending, committed, rejected, or skipped', 'pending')
|
|
811
|
+
.option('--limit <n>', 'Maximum proposals to list')
|
|
812
|
+
.option('--sample <n>', 'Return a stable proposal sample')
|
|
813
|
+
.option('--stratified', 'Stratify sample across proposed domain and source collection')
|
|
814
|
+
.action(async (opts) => {
|
|
815
|
+
await runAuthorityDomainsReview(opts);
|
|
816
|
+
});
|
|
817
|
+
const authorityDomainsSampleCmd = authorityDomainsCmd
|
|
818
|
+
.command('sample')
|
|
819
|
+
.description('Manage human-reviewed authority-domain proposal samples');
|
|
820
|
+
authorityDomainsSampleCmd
|
|
821
|
+
.command('record')
|
|
822
|
+
.description('Record human-reviewed sample accuracy for authority-domain proposals')
|
|
823
|
+
.requiredOption('--sample-id <id>', 'Stable sample identifier from the review packet')
|
|
824
|
+
.option('--run-id <id>', 'Proposal run identifier')
|
|
825
|
+
.requiredOption('--approved <n>', 'Count of sampled proposals approved as-is')
|
|
826
|
+
.requiredOption('--rejected <n>', 'Count of sampled proposals rejected')
|
|
827
|
+
.requiredOption('--corrected <n>', 'Count of sampled proposals corrected to another domain')
|
|
828
|
+
.action(async (opts) => {
|
|
829
|
+
await runAuthorityDomainsRecordSample(opts);
|
|
830
|
+
});
|
|
831
|
+
authorityDomainsCmd
|
|
832
|
+
.command('ratify <proposal-id>')
|
|
833
|
+
.description('Ratify an authority-domain tag proposal')
|
|
834
|
+
.option('--note <note>', 'Review note')
|
|
835
|
+
.action(async (proposalId, opts) => {
|
|
836
|
+
await runAuthorityDomainsRatify(proposalId, opts);
|
|
837
|
+
});
|
|
838
|
+
authorityDomainsCmd
|
|
839
|
+
.command('reject <proposal-id>')
|
|
840
|
+
.description('Reject an authority-domain tag proposal')
|
|
841
|
+
.option('--reason <reason>', 'Rejection reason')
|
|
842
|
+
.action(async (proposalId, opts) => {
|
|
843
|
+
await runAuthorityDomainsReject(proposalId, opts);
|
|
844
|
+
});
|
|
845
|
+
authorityDomainsCmd
|
|
846
|
+
.command('discard-pending')
|
|
847
|
+
.description('Reject all pending authority-domain tag proposals after a failed batch diagnosis')
|
|
848
|
+
.option('--reason <reason>', 'Discard reason')
|
|
849
|
+
.action(async (opts) => {
|
|
850
|
+
await runAuthorityDomainsDiscardPending(opts);
|
|
851
|
+
});
|
|
852
|
+
authorityDomainsCmd
|
|
853
|
+
.command('readiness')
|
|
854
|
+
.description('Show WP-354 authority-domain readiness, evidence gap, and next action')
|
|
855
|
+
.action(async () => {
|
|
856
|
+
await runAuthorityDomainsReadiness();
|
|
857
|
+
});
|
|
858
|
+
authorityDomainsCmd
|
|
859
|
+
.command('benchmark')
|
|
860
|
+
.description('Run and persist the WP-354 authority-domain benchmark')
|
|
861
|
+
.action(async () => {
|
|
862
|
+
await runAuthorityDomainsBenchmark();
|
|
863
|
+
});
|
|
864
|
+
authorityDomainsCmd
|
|
865
|
+
.command('activate-cutover')
|
|
866
|
+
.description('Activate graph retrieval after WP-354 evidence gates pass')
|
|
867
|
+
.option('--force-pre-production', 'Bypass the permanently-locked valueProof gate (requires --dec-id, DEC-864)')
|
|
868
|
+
.option('--dec-id <decId>', 'Chain DEC ID authorizing the bypass')
|
|
869
|
+
.action(async (opts) => {
|
|
870
|
+
await runAuthorityDomainsActivateCutover({ forcePreProduction: opts.forcePreProduction, decId: opts.decId });
|
|
871
|
+
});
|
|
872
|
+
authorityDomainsCmd
|
|
873
|
+
.command('deactivate-cutover')
|
|
874
|
+
.description('Deactivate the active WP-354 authorityDomain cutover for this workspace (DEC-864 rollback).')
|
|
875
|
+
.option('--clerk-user-id <clerkUserId>', 'Override the Clerk user ID for audit trail')
|
|
876
|
+
.action(async (opts) => {
|
|
877
|
+
await runAuthorityDomainsDeactivateCutover({ clerkUserId: opts.clerkUserId });
|
|
878
|
+
});
|
|
879
|
+
authorityDomainsCmd
|
|
880
|
+
.command('principle-distribution')
|
|
881
|
+
.description('Pre-merge gate: check governance category match rate for principles entries')
|
|
882
|
+
.action(async () => {
|
|
883
|
+
await runAuthorityDomainsPrincipleDistribution();
|
|
884
|
+
});
|
|
670
885
|
// --- Definitions diff command (WP-305 Slice 4) ---
|
|
671
886
|
const definitionsCmd = program
|
|
672
887
|
.command('definitions')
|
|
@@ -738,9 +953,11 @@ profileCmd
|
|
|
738
953
|
});
|
|
739
954
|
profileCmd
|
|
740
955
|
.command('use <name>')
|
|
741
|
-
.description('Switch
|
|
742
|
-
.
|
|
743
|
-
|
|
956
|
+
.description('Switch profile: reconciles the repo pin + global by default. --local = repo pin only; --global = global only.')
|
|
957
|
+
.option('--local', 'Write the profile pin only to .productbrain/config.local.json (repo-local, gitignored)')
|
|
958
|
+
.option('--global', 'Switch only the global active profile (does not change a locally-pinned repo)')
|
|
959
|
+
.action(async (name, opts) => {
|
|
960
|
+
await runProfileUse({ name, local: opts.local, global: opts.global });
|
|
744
961
|
});
|
|
745
962
|
profileCmd
|
|
746
963
|
.command('delete <name>')
|
|
@@ -748,6 +965,14 @@ profileCmd
|
|
|
748
965
|
.action(async (name) => {
|
|
749
966
|
await runProfileDelete({ name });
|
|
750
967
|
});
|
|
968
|
+
program
|
|
969
|
+
.command('use <name>')
|
|
970
|
+
.description('Switch the active workspace profile (alias for `pb profile use`).')
|
|
971
|
+
.option('--local', 'Write the profile pin only to .productbrain/config.local.json (repo-local, gitignored)')
|
|
972
|
+
.option('--global', 'Switch only the global active profile (does not change a locally-pinned repo)')
|
|
973
|
+
.action(async (name, opts) => {
|
|
974
|
+
await runProfileUse({ name, local: opts.local, global: opts.global });
|
|
975
|
+
});
|
|
751
976
|
// --- Glossary command (WP-302 Slice 4) ---
|
|
752
977
|
program
|
|
753
978
|
.command('glossary')
|
|
@@ -779,18 +1004,9 @@ program.addCommand(createAdminCommand());
|
|
|
779
1004
|
// --- Upgrade command (WP-322 S1: ambient update notification) ---
|
|
780
1005
|
program
|
|
781
1006
|
.command('upgrade')
|
|
782
|
-
.description(
|
|
783
|
-
.action(() => {
|
|
784
|
-
|
|
785
|
-
process.stdout.write(JSON.stringify({
|
|
786
|
-
command: 'npm install -g @productbrain/cli@latest',
|
|
787
|
-
hint: 'Run the command above to upgrade pb CLI.',
|
|
788
|
-
}) + '\n');
|
|
789
|
-
return;
|
|
790
|
-
}
|
|
791
|
-
process.stdout.write('\n');
|
|
792
|
-
process.stdout.write(`${bold('Upgrade pb CLI')} ${dim('—')} run the command below:\n\n`);
|
|
793
|
-
process.stdout.write(` npm install -g @productbrain/cli@latest\n\n`);
|
|
1007
|
+
.description(`Upgrade pb CLI to the latest beta (${UPGRADE_COMMAND})`)
|
|
1008
|
+
.action(async () => {
|
|
1009
|
+
await runUpgrade({ currentVersion: cliPackageVersion.version });
|
|
794
1010
|
});
|
|
795
1011
|
// Parse with global error handler — all uncaught errors route through handleError
|
|
796
1012
|
program.parseAsync(process.argv).catch(handleError);
|