@productbrain/cli 0.1.0-beta.15 → 0.1.0-beta.1522
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -115
- package/dist/__tests__/adapters.test.d.ts +2 -0
- package/dist/__tests__/adapters.test.d.ts.map +1 -0
- package/dist/__tests__/adapters.test.js +417 -0
- package/dist/__tests__/adapters.test.js.map +1 -0
- package/dist/__tests__/audit.test.js +65 -44
- package/dist/__tests__/audit.test.js.map +1 -1
- package/dist/__tests__/authority-domains-queue.test.d.ts +2 -0
- package/dist/__tests__/authority-domains-queue.test.d.ts.map +1 -0
- package/dist/__tests__/authority-domains-queue.test.js +169 -0
- package/dist/__tests__/authority-domains-queue.test.js.map +1 -0
- package/dist/__tests__/authority-domains.test.d.ts +2 -0
- package/dist/__tests__/authority-domains.test.d.ts.map +1 -0
- package/dist/__tests__/authority-domains.test.js +48 -0
- package/dist/__tests__/authority-domains.test.js.map +1 -0
- package/dist/__tests__/batch-transformations.test.d.ts +2 -0
- package/dist/__tests__/batch-transformations.test.d.ts.map +1 -0
- package/dist/__tests__/batch-transformations.test.js +263 -0
- package/dist/__tests__/batch-transformations.test.js.map +1 -0
- package/dist/__tests__/canonicalRefs.vocab.test.d.ts +2 -0
- package/dist/__tests__/canonicalRefs.vocab.test.d.ts.map +1 -0
- package/dist/__tests__/canonicalRefs.vocab.test.js +251 -0
- package/dist/__tests__/canonicalRefs.vocab.test.js.map +1 -0
- package/dist/__tests__/capture-receipt-domain.test.d.ts +2 -0
- package/dist/__tests__/capture-receipt-domain.test.d.ts.map +1 -0
- package/dist/__tests__/capture-receipt-domain.test.js +29 -0
- package/dist/__tests__/capture-receipt-domain.test.js.map +1 -0
- package/dist/__tests__/capture.test.js +309 -18
- package/dist/__tests__/capture.test.js.map +1 -1
- package/dist/__tests__/codex-prep-parity.test.d.ts +2 -0
- package/dist/__tests__/codex-prep-parity.test.d.ts.map +1 -0
- package/dist/__tests__/codex-prep-parity.test.js +107 -0
- package/dist/__tests__/codex-prep-parity.test.js.map +1 -0
- package/dist/__tests__/config-prod-fallthrough.test.d.ts +2 -0
- package/dist/__tests__/config-prod-fallthrough.test.d.ts.map +1 -0
- package/dist/__tests__/config-prod-fallthrough.test.js +82 -0
- package/dist/__tests__/config-prod-fallthrough.test.js.map +1 -0
- package/dist/__tests__/config.test.d.ts +8 -0
- package/dist/__tests__/config.test.d.ts.map +1 -0
- package/dist/__tests__/config.test.js +566 -0
- package/dist/__tests__/config.test.js.map +1 -0
- package/dist/__tests__/constants.test.d.ts +2 -0
- package/dist/__tests__/constants.test.d.ts.map +1 -0
- package/dist/__tests__/constants.test.js +146 -0
- package/dist/__tests__/constants.test.js.map +1 -0
- package/dist/__tests__/constellation.test.js +16 -22
- package/dist/__tests__/constellation.test.js.map +1 -1
- package/dist/__tests__/context-strategy.test.js +8 -8
- package/dist/__tests__/context-strategy.test.js.map +1 -1
- package/dist/__tests__/envelope-contract.test.d.ts +15 -0
- package/dist/__tests__/envelope-contract.test.d.ts.map +1 -0
- package/dist/__tests__/envelope-contract.test.js +152 -0
- package/dist/__tests__/envelope-contract.test.js.map +1 -0
- package/dist/__tests__/errors.test.d.ts +2 -0
- package/dist/__tests__/errors.test.d.ts.map +1 -0
- package/dist/__tests__/errors.test.js +118 -0
- package/dist/__tests__/errors.test.js.map +1 -0
- package/dist/__tests__/experiment.test.d.ts +6 -0
- package/dist/__tests__/experiment.test.d.ts.map +1 -0
- package/dist/__tests__/experiment.test.js +69 -0
- package/dist/__tests__/experiment.test.js.map +1 -0
- package/dist/__tests__/fields.test.js +36 -36
- package/dist/__tests__/fields.test.js.map +1 -1
- package/dist/__tests__/glossary.test.d.ts +2 -0
- package/dist/__tests__/glossary.test.d.ts.map +1 -0
- package/dist/__tests__/glossary.test.js +32 -0
- package/dist/__tests__/glossary.test.js.map +1 -0
- package/dist/__tests__/handshake-augment.test.d.ts +2 -0
- package/dist/__tests__/handshake-augment.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-augment.test.js +423 -0
- package/dist/__tests__/handshake-augment.test.js.map +1 -0
- package/dist/__tests__/handshake-dormancy.test.d.ts +2 -0
- package/dist/__tests__/handshake-dormancy.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-dormancy.test.js +207 -0
- package/dist/__tests__/handshake-dormancy.test.js.map +1 -0
- package/dist/__tests__/handshake-formatter.test.d.ts +2 -0
- package/dist/__tests__/handshake-formatter.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-formatter.test.js +67 -0
- package/dist/__tests__/handshake-formatter.test.js.map +1 -0
- package/dist/__tests__/handshake-preview.test.d.ts +2 -0
- package/dist/__tests__/handshake-preview.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-preview.test.js +949 -0
- package/dist/__tests__/handshake-preview.test.js.map +1 -0
- package/dist/__tests__/handshake.e2e.test.d.ts +2 -0
- package/dist/__tests__/handshake.e2e.test.d.ts.map +1 -0
- package/dist/__tests__/handshake.e2e.test.js +1252 -0
- package/dist/__tests__/handshake.e2e.test.js.map +1 -0
- package/dist/__tests__/handshake.test.js +813 -19
- package/dist/__tests__/handshake.test.js.map +1 -1
- package/dist/__tests__/hook-intents.test.d.ts +2 -0
- package/dist/__tests__/hook-intents.test.d.ts.map +1 -0
- package/dist/__tests__/hook-intents.test.js +184 -0
- package/dist/__tests__/hook-intents.test.js.map +1 -0
- package/dist/__tests__/ingest.test.js +28 -28
- package/dist/__tests__/ingest.test.js.map +1 -1
- package/dist/__tests__/init.test.d.ts +7 -0
- package/dist/__tests__/init.test.d.ts.map +1 -0
- package/dist/__tests__/init.test.js +146 -0
- package/dist/__tests__/init.test.js.map +1 -0
- package/dist/__tests__/login.test.d.ts +2 -0
- package/dist/__tests__/login.test.d.ts.map +1 -0
- package/dist/__tests__/login.test.js +167 -0
- package/dist/__tests__/login.test.js.map +1 -0
- package/dist/__tests__/manifest.test.d.ts +6 -0
- package/dist/__tests__/manifest.test.d.ts.map +1 -0
- package/dist/__tests__/manifest.test.js +255 -0
- package/dist/__tests__/manifest.test.js.map +1 -0
- package/dist/__tests__/method-publish-coherency.test.d.ts +9 -0
- package/dist/__tests__/method-publish-coherency.test.d.ts.map +1 -0
- package/dist/__tests__/method-publish-coherency.test.js +71 -0
- package/dist/__tests__/method-publish-coherency.test.js.map +1 -0
- package/dist/__tests__/method-registry.integration.test.d.ts +6 -0
- package/dist/__tests__/method-registry.integration.test.d.ts.map +1 -0
- package/dist/__tests__/method-registry.integration.test.js +18 -0
- package/dist/__tests__/method-registry.integration.test.js.map +1 -0
- package/dist/__tests__/method-registry.test.d.ts +14 -0
- package/dist/__tests__/method-registry.test.d.ts.map +1 -0
- package/dist/__tests__/method-registry.test.js +134 -0
- package/dist/__tests__/method-registry.test.js.map +1 -0
- package/dist/__tests__/notice-marker.test.d.ts +2 -0
- package/dist/__tests__/notice-marker.test.d.ts.map +1 -0
- package/dist/__tests__/notice-marker.test.js +41 -0
- package/dist/__tests__/notice-marker.test.js.map +1 -0
- package/dist/__tests__/onboarding-path-b.test.d.ts +2 -0
- package/dist/__tests__/onboarding-path-b.test.d.ts.map +1 -0
- package/dist/__tests__/onboarding-path-b.test.js +46 -0
- package/dist/__tests__/onboarding-path-b.test.js.map +1 -0
- package/dist/__tests__/onboarding.test.d.ts +6 -0
- package/dist/__tests__/onboarding.test.d.ts.map +1 -0
- package/dist/__tests__/onboarding.test.js +347 -0
- package/dist/__tests__/onboarding.test.js.map +1 -0
- package/dist/__tests__/orient.test.d.ts +2 -0
- package/dist/__tests__/orient.test.d.ts.map +1 -0
- package/dist/__tests__/orient.test.js +424 -0
- package/dist/__tests__/orient.test.js.map +1 -0
- package/dist/__tests__/perimeter.test.d.ts +2 -0
- package/dist/__tests__/perimeter.test.d.ts.map +1 -0
- package/dist/__tests__/perimeter.test.js +165 -0
- package/dist/__tests__/perimeter.test.js.map +1 -0
- package/dist/__tests__/personal-layer.test.d.ts +11 -0
- package/dist/__tests__/personal-layer.test.d.ts.map +1 -0
- package/dist/__tests__/personal-layer.test.js +268 -0
- package/dist/__tests__/personal-layer.test.js.map +1 -0
- package/dist/__tests__/preview-key-refresh.test.d.ts +2 -0
- package/dist/__tests__/preview-key-refresh.test.d.ts.map +1 -0
- package/dist/__tests__/preview-key-refresh.test.js +126 -0
- package/dist/__tests__/preview-key-refresh.test.js.map +1 -0
- package/dist/__tests__/profiles.test.d.ts +2 -0
- package/dist/__tests__/profiles.test.d.ts.map +1 -0
- package/dist/__tests__/profiles.test.js +316 -0
- package/dist/__tests__/profiles.test.js.map +1 -0
- package/dist/__tests__/promote-batch.test.d.ts +2 -0
- package/dist/__tests__/promote-batch.test.d.ts.map +1 -0
- package/dist/__tests__/promote-batch.test.js +185 -0
- package/dist/__tests__/promote-batch.test.js.map +1 -0
- package/dist/__tests__/promote.test.js +213 -34
- package/dist/__tests__/promote.test.js.map +1 -1
- package/dist/__tests__/prompts.test.d.ts +6 -0
- package/dist/__tests__/prompts.test.d.ts.map +1 -0
- package/dist/__tests__/prompts.test.js +146 -0
- package/dist/__tests__/prompts.test.js.map +1 -0
- package/dist/__tests__/proof-run.test.d.ts +2 -0
- package/dist/__tests__/proof-run.test.d.ts.map +1 -0
- package/dist/__tests__/proof-run.test.js +255 -0
- package/dist/__tests__/proof-run.test.js.map +1 -0
- package/dist/__tests__/proposals.test.js +24 -47
- package/dist/__tests__/proposals.test.js.map +1 -1
- package/dist/__tests__/relate.test.js +34 -36
- package/dist/__tests__/relate.test.js.map +1 -1
- package/dist/__tests__/repo-detect.test.js +97 -1
- package/dist/__tests__/repo-detect.test.js.map +1 -1
- package/dist/__tests__/runner.test.js +19 -15
- package/dist/__tests__/runner.test.js.map +1 -1
- package/dist/__tests__/session-close-loop.test.d.ts +2 -0
- package/dist/__tests__/session-close-loop.test.d.ts.map +1 -0
- package/dist/__tests__/session-close-loop.test.js +231 -0
- package/dist/__tests__/session-close-loop.test.js.map +1 -0
- package/dist/__tests__/session-reset.test.d.ts +2 -0
- package/dist/__tests__/session-reset.test.d.ts.map +1 -0
- package/dist/__tests__/session-reset.test.js +122 -0
- package/dist/__tests__/session-reset.test.js.map +1 -0
- package/dist/__tests__/session-resume-backstop.test.d.ts +2 -0
- package/dist/__tests__/session-resume-backstop.test.d.ts.map +1 -0
- package/dist/__tests__/session-resume-backstop.test.js +97 -0
- package/dist/__tests__/session-resume-backstop.test.js.map +1 -0
- package/dist/__tests__/session-start-key-refresh.test.d.ts +2 -0
- package/dist/__tests__/session-start-key-refresh.test.d.ts.map +1 -0
- package/dist/__tests__/session-start-key-refresh.test.js +179 -0
- package/dist/__tests__/session-start-key-refresh.test.js.map +1 -0
- package/dist/__tests__/session-state-machine.test.d.ts +2 -0
- package/dist/__tests__/session-state-machine.test.d.ts.map +1 -0
- package/dist/__tests__/session-state-machine.test.js +198 -0
- package/dist/__tests__/session-state-machine.test.js.map +1 -0
- package/dist/__tests__/session-switch.test.d.ts +2 -0
- package/dist/__tests__/session-switch.test.d.ts.map +1 -0
- package/dist/__tests__/session-switch.test.js +130 -0
- package/dist/__tests__/session-switch.test.js.map +1 -0
- package/dist/__tests__/session-touch.test.js +11 -11
- package/dist/__tests__/session-touch.test.js.map +1 -1
- package/dist/__tests__/session.test.js +4 -10
- package/dist/__tests__/session.test.js.map +1 -1
- package/dist/__tests__/setup-ingest.test.d.ts +2 -0
- package/dist/__tests__/setup-ingest.test.d.ts.map +1 -0
- package/dist/__tests__/setup-ingest.test.js +71 -0
- package/dist/__tests__/setup-ingest.test.js.map +1 -0
- package/dist/__tests__/setup-resolver.test.d.ts +14 -0
- package/dist/__tests__/setup-resolver.test.d.ts.map +1 -0
- package/dist/__tests__/setup-resolver.test.js +228 -0
- package/dist/__tests__/setup-resolver.test.js.map +1 -0
- package/dist/__tests__/skill-vocabulary.test.d.ts +21 -0
- package/dist/__tests__/skill-vocabulary.test.d.ts.map +1 -0
- package/dist/__tests__/skill-vocabulary.test.js +192 -0
- package/dist/__tests__/skill-vocabulary.test.js.map +1 -0
- package/dist/__tests__/spinner-labels.test.d.ts +2 -0
- package/dist/__tests__/spinner-labels.test.d.ts.map +1 -0
- package/dist/__tests__/spinner-labels.test.js +23 -0
- package/dist/__tests__/spinner-labels.test.js.map +1 -0
- package/dist/__tests__/state.test.d.ts +6 -0
- package/dist/__tests__/state.test.d.ts.map +1 -0
- package/dist/__tests__/state.test.js +97 -0
- package/dist/__tests__/state.test.js.map +1 -0
- package/dist/__tests__/surface-profiles.test.d.ts +2 -0
- package/dist/__tests__/surface-profiles.test.d.ts.map +1 -0
- package/dist/__tests__/surface-profiles.test.js +233 -0
- package/dist/__tests__/surface-profiles.test.js.map +1 -0
- package/dist/__tests__/surfaces.test.d.ts +2 -0
- package/dist/__tests__/surfaces.test.d.ts.map +1 -0
- package/dist/__tests__/surfaces.test.js +46 -0
- package/dist/__tests__/surfaces.test.js.map +1 -0
- package/dist/__tests__/update-check.test.d.ts +2 -0
- package/dist/__tests__/update-check.test.d.ts.map +1 -0
- package/dist/__tests__/update-check.test.js +215 -0
- package/dist/__tests__/update-check.test.js.map +1 -0
- package/dist/__tests__/update.test.js +63 -72
- package/dist/__tests__/update.test.js.map +1 -1
- package/dist/__tests__/upgrade-runner.test.d.ts +2 -0
- package/dist/__tests__/upgrade-runner.test.d.ts.map +1 -0
- package/dist/__tests__/upgrade-runner.test.js +54 -0
- package/dist/__tests__/upgrade-runner.test.js.map +1 -0
- package/dist/__tests__/upgrade.test.d.ts +2 -0
- package/dist/__tests__/upgrade.test.d.ts.map +1 -0
- package/dist/__tests__/upgrade.test.js +56 -0
- package/dist/__tests__/upgrade.test.js.map +1 -0
- package/dist/__tests__/vocabulary-leak.test.d.ts +39 -0
- package/dist/__tests__/vocabulary-leak.test.d.ts.map +1 -0
- package/dist/__tests__/vocabulary-leak.test.js +534 -0
- package/dist/__tests__/vocabulary-leak.test.js.map +1 -0
- package/dist/__tests__/workspace.test.d.ts +2 -0
- package/dist/__tests__/workspace.test.d.ts.map +1 -0
- package/dist/__tests__/workspace.test.js +328 -0
- package/dist/__tests__/workspace.test.js.map +1 -0
- package/dist/commands/__tests__/connect-handoff.test.d.ts +11 -0
- package/dist/commands/__tests__/connect-handoff.test.d.ts.map +1 -0
- package/dist/commands/__tests__/connect-handoff.test.js +111 -0
- package/dist/commands/__tests__/connect-handoff.test.js.map +1 -0
- package/dist/commands/__tests__/setup-detect-surfaces.test.d.ts +15 -0
- package/dist/commands/__tests__/setup-detect-surfaces.test.d.ts.map +1 -0
- package/dist/commands/__tests__/setup-detect-surfaces.test.js +149 -0
- package/dist/commands/__tests__/setup-detect-surfaces.test.js.map +1 -0
- package/dist/commands/__tests__/setup-state.test.d.ts +2 -0
- package/dist/commands/__tests__/setup-state.test.d.ts.map +1 -0
- package/dist/commands/__tests__/setup-state.test.js +194 -0
- package/dist/commands/__tests__/setup-state.test.js.map +1 -0
- package/dist/commands/accept.d.ts.map +1 -1
- package/dist/commands/accept.js +10 -6
- package/dist/commands/accept.js.map +1 -1
- package/dist/commands/admin/cockpit.d.ts +90 -0
- package/dist/commands/admin/cockpit.d.ts.map +1 -0
- package/dist/commands/admin/cockpit.js +618 -0
- package/dist/commands/admin/cockpit.js.map +1 -0
- package/dist/commands/admin/index.d.ts +21 -0
- package/dist/commands/admin/index.d.ts.map +1 -0
- package/dist/commands/admin/index.js +256 -0
- package/dist/commands/admin/index.js.map +1 -0
- package/dist/commands/admin/inspect.d.ts +30 -0
- package/dist/commands/admin/inspect.d.ts.map +1 -0
- package/dist/commands/admin/inspect.js +555 -0
- package/dist/commands/admin/inspect.js.map +1 -0
- package/dist/commands/admin/inspect.test.d.ts +7 -0
- package/dist/commands/admin/inspect.test.d.ts.map +1 -0
- package/dist/commands/admin/inspect.test.js +90 -0
- package/dist/commands/admin/inspect.test.js.map +1 -0
- package/dist/commands/admin/manage.d.ts +8 -0
- package/dist/commands/admin/manage.d.ts.map +1 -0
- package/dist/commands/admin/manage.js +260 -0
- package/dist/commands/admin/manage.js.map +1 -0
- package/dist/commands/admin/manage.test.d.ts +16 -0
- package/dist/commands/admin/manage.test.d.ts.map +1 -0
- package/dist/commands/admin/manage.test.js +159 -0
- package/dist/commands/admin/manage.test.js.map +1 -0
- package/dist/commands/admin/seed.d.ts +75 -0
- package/dist/commands/admin/seed.d.ts.map +1 -0
- package/dist/commands/admin/seed.js +944 -0
- package/dist/commands/admin/seed.js.map +1 -0
- package/dist/commands/admin/seed.test.d.ts +11 -0
- package/dist/commands/admin/seed.test.d.ts.map +1 -0
- package/dist/commands/admin/seed.test.js +127 -0
- package/dist/commands/admin/seed.test.js.map +1 -0
- package/dist/commands/admin/seedRegistryEntries.generated.d.ts +14 -0
- package/dist/commands/admin/seedRegistryEntries.generated.d.ts.map +1 -0
- package/dist/commands/admin/seedRegistryEntries.generated.js +144 -0
- package/dist/commands/admin/seedRegistryEntries.generated.js.map +1 -0
- package/dist/commands/admin/seedRegistryEntries.test.d.ts +11 -0
- package/dist/commands/admin/seedRegistryEntries.test.d.ts.map +1 -0
- package/dist/commands/admin/seedRegistryEntries.test.js +70 -0
- package/dist/commands/admin/seedRegistryEntries.test.js.map +1 -0
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +42 -7
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/authority-domains.d.ts +157 -0
- package/dist/commands/authority-domains.d.ts.map +1 -0
- package/dist/commands/authority-domains.js +356 -0
- package/dist/commands/authority-domains.js.map +1 -0
- package/dist/commands/brief.d.ts.map +1 -1
- package/dist/commands/brief.js +10 -5
- package/dist/commands/brief.js.map +1 -1
- package/dist/commands/capture.d.ts +7 -0
- package/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +266 -19
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/chain-walk.d.ts.map +1 -1
- package/dist/commands/chain-walk.js +8 -3
- package/dist/commands/chain-walk.js.map +1 -1
- package/dist/commands/changes.d.ts.map +1 -1
- package/dist/commands/changes.js +8 -3
- package/dist/commands/changes.js.map +1 -1
- package/dist/commands/codex-prep.d.ts +23 -0
- package/dist/commands/codex-prep.d.ts.map +1 -0
- package/dist/commands/codex-prep.js +56 -0
- package/dist/commands/codex-prep.js.map +1 -0
- package/dist/commands/collections.d.ts +22 -0
- package/dist/commands/collections.d.ts.map +1 -0
- package/dist/commands/collections.js +77 -0
- package/dist/commands/collections.js.map +1 -0
- package/dist/commands/connect-config.test.d.ts +2 -0
- package/dist/commands/connect-config.test.d.ts.map +1 -0
- package/dist/commands/connect-config.test.js +44 -0
- package/dist/commands/connect-config.test.js.map +1 -0
- package/dist/commands/connect-context.d.ts +45 -0
- package/dist/commands/connect-context.d.ts.map +1 -0
- package/dist/commands/connect-context.js +64 -0
- package/dist/commands/connect-context.js.map +1 -0
- package/dist/commands/connect-context.test.d.ts +2 -0
- package/dist/commands/connect-context.test.d.ts.map +1 -0
- package/dist/commands/connect-context.test.js +110 -0
- package/dist/commands/connect-context.test.js.map +1 -0
- package/dist/commands/connect-handoff.d.ts +51 -0
- package/dist/commands/connect-handoff.d.ts.map +1 -0
- package/dist/commands/connect-handoff.js +70 -0
- package/dist/commands/connect-handoff.js.map +1 -0
- package/dist/commands/connect-integration.test.d.ts +7 -0
- package/dist/commands/connect-integration.test.d.ts.map +1 -0
- package/dist/commands/connect-integration.test.js +212 -0
- package/dist/commands/connect-integration.test.js.map +1 -0
- package/dist/commands/connect-screens.d.ts +23 -0
- package/dist/commands/connect-screens.d.ts.map +1 -0
- package/dist/commands/connect-screens.js +90 -0
- package/dist/commands/connect-screens.js.map +1 -0
- package/dist/commands/connect.d.ts +36 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +264 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/connect.test.d.ts +6 -0
- package/dist/commands/connect.test.d.ts.map +1 -0
- package/dist/commands/connect.test.js +297 -0
- package/dist/commands/connect.test.js.map +1 -0
- package/dist/commands/constellation.d.ts.map +1 -1
- package/dist/commands/constellation.js +8 -3
- package/dist/commands/constellation.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +8 -3
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/cross-cut.js +2 -2
- package/dist/commands/cross-cut.js.map +1 -1
- package/dist/commands/doctor.d.ts +18 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +297 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/doctor.test.d.ts +8 -0
- package/dist/commands/doctor.test.d.ts.map +1 -0
- package/dist/commands/doctor.test.js +461 -0
- package/dist/commands/doctor.test.js.map +1 -0
- package/dist/commands/fields.d.ts.map +1 -1
- package/dist/commands/fields.js +8 -4
- package/dist/commands/fields.js.map +1 -1
- package/dist/commands/get.d.ts.map +1 -1
- package/dist/commands/get.js +14 -6
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/handshake.d.ts +233 -2
- package/dist/commands/handshake.d.ts.map +1 -1
- package/dist/commands/handshake.js +2338 -81
- package/dist/commands/handshake.js.map +1 -1
- package/dist/commands/ingest.d.ts.map +1 -1
- package/dist/commands/ingest.js +17 -9
- package/dist/commands/ingest.js.map +1 -1
- package/dist/commands/init.d.ts +14 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +109 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +4 -0
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +101 -38
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/method.d.ts +99 -0
- package/dist/commands/method.d.ts.map +1 -0
- package/dist/commands/method.js +796 -0
- package/dist/commands/method.js.map +1 -0
- package/dist/commands/migrate-setup.d.ts +18 -0
- package/dist/commands/migrate-setup.d.ts.map +1 -0
- package/dist/commands/migrate-setup.js +148 -0
- package/dist/commands/migrate-setup.js.map +1 -0
- package/dist/commands/orient.d.ts +197 -3
- package/dist/commands/orient.d.ts.map +1 -1
- package/dist/commands/orient.js +129 -7
- package/dist/commands/orient.js.map +1 -1
- package/dist/commands/profile.d.ts +34 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +165 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/promote.d.ts +12 -1
- package/dist/commands/promote.d.ts.map +1 -1
- package/dist/commands/promote.js +197 -30
- package/dist/commands/promote.js.map +1 -1
- package/dist/commands/proof-run.d.ts +51 -0
- package/dist/commands/proof-run.d.ts.map +1 -0
- package/dist/commands/proof-run.js +209 -0
- package/dist/commands/proof-run.js.map +1 -0
- package/dist/commands/proposals.js +2 -2
- package/dist/commands/proposals.js.map +1 -1
- package/dist/commands/reject.d.ts.map +1 -1
- package/dist/commands/reject.js +14 -7
- package/dist/commands/reject.js.map +1 -1
- package/dist/commands/relate.d.ts.map +1 -1
- package/dist/commands/relate.js +49 -16
- package/dist/commands/relate.js.map +1 -1
- package/dist/commands/scoreboard.d.ts +28 -0
- package/dist/commands/scoreboard.d.ts.map +1 -0
- package/dist/commands/scoreboard.js +40 -0
- package/dist/commands/scoreboard.js.map +1 -0
- package/dist/commands/search.js +2 -2
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/session.d.ts +26 -2
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +355 -41
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/setup-audit.d.ts +59 -0
- package/dist/commands/setup-audit.d.ts.map +1 -0
- package/dist/commands/setup-audit.js +250 -0
- package/dist/commands/setup-audit.js.map +1 -0
- package/dist/commands/setup-detect-surfaces.d.ts +38 -0
- package/dist/commands/setup-detect-surfaces.d.ts.map +1 -0
- package/dist/commands/setup-detect-surfaces.js +76 -0
- package/dist/commands/setup-detect-surfaces.js.map +1 -0
- package/dist/commands/setup-ingest.d.ts +17 -0
- package/dist/commands/setup-ingest.d.ts.map +1 -0
- package/dist/commands/setup-ingest.js +174 -0
- package/dist/commands/setup-ingest.js.map +1 -0
- package/dist/commands/setup-resolver.d.ts +58 -0
- package/dist/commands/setup-resolver.d.ts.map +1 -0
- package/dist/commands/setup-resolver.js +150 -0
- package/dist/commands/setup-resolver.js.map +1 -0
- package/dist/commands/setup-state.d.ts +42 -0
- package/dist/commands/setup-state.d.ts.map +1 -0
- package/dist/commands/setup-state.js +93 -0
- package/dist/commands/setup-state.js.map +1 -0
- package/dist/commands/setup.d.ts +23 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +69 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/update.d.ts +9 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +92 -26
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/upgrade.d.ts +5 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +110 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/usage.d.ts +40 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +232 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +14 -7
- package/dist/commands/verify.js.map +1 -1
- package/dist/commands/welcome.d.ts +21 -0
- package/dist/commands/welcome.d.ts.map +1 -0
- package/dist/commands/welcome.js +50 -0
- package/dist/commands/welcome.js.map +1 -0
- package/dist/commands/whoami.d.ts +12 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +70 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/commands/whoami.test.d.ts +2 -0
- package/dist/commands/whoami.test.d.ts.map +1 -0
- package/dist/commands/whoami.test.js +50 -0
- package/dist/commands/whoami.test.js.map +1 -0
- package/dist/commands/workspace.d.ts +113 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +263 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/formatters/__tests__/orient-provenance.test.d.ts +7 -0
- package/dist/formatters/__tests__/orient-provenance.test.d.ts.map +1 -0
- package/dist/formatters/__tests__/orient-provenance.test.js +454 -0
- package/dist/formatters/__tests__/orient-provenance.test.js.map +1 -0
- package/dist/formatters/__tests__/session.test.d.ts +2 -0
- package/dist/formatters/__tests__/session.test.d.ts.map +1 -0
- package/dist/formatters/__tests__/session.test.js +113 -0
- package/dist/formatters/__tests__/session.test.js.map +1 -0
- package/dist/formatters/audit.d.ts +6 -0
- package/dist/formatters/audit.d.ts.map +1 -1
- package/dist/formatters/audit.js.map +1 -1
- package/dist/formatters/capture.d.ts +26 -3
- package/dist/formatters/capture.d.ts.map +1 -1
- package/dist/formatters/capture.js +25 -1
- package/dist/formatters/capture.js.map +1 -1
- package/dist/formatters/collections.d.ts +40 -0
- package/dist/formatters/collections.d.ts.map +1 -0
- package/dist/formatters/collections.js +93 -0
- package/dist/formatters/collections.js.map +1 -0
- package/dist/formatters/entry.d.ts +30 -4
- package/dist/formatters/entry.d.ts.map +1 -1
- package/dist/formatters/entry.js +66 -17
- package/dist/formatters/entry.js.map +1 -1
- package/dist/formatters/handshake.d.ts +45 -0
- package/dist/formatters/handshake.d.ts.map +1 -1
- package/dist/formatters/handshake.js +150 -3
- package/dist/formatters/handshake.js.map +1 -1
- package/dist/formatters/orient.d.ts +268 -5
- package/dist/formatters/orient.d.ts.map +1 -1
- package/dist/formatters/orient.js +381 -34
- package/dist/formatters/orient.js.map +1 -1
- package/dist/formatters/promote.d.ts +6 -0
- package/dist/formatters/promote.d.ts.map +1 -1
- package/dist/formatters/promote.js +8 -0
- package/dist/formatters/promote.js.map +1 -1
- package/dist/formatters/relate.d.ts +2 -0
- package/dist/formatters/relate.d.ts.map +1 -1
- package/dist/formatters/relate.js +3 -0
- package/dist/formatters/relate.js.map +1 -1
- package/dist/formatters/scoreboard.d.ts +11 -0
- package/dist/formatters/scoreboard.d.ts.map +1 -0
- package/dist/formatters/scoreboard.js +48 -0
- package/dist/formatters/scoreboard.js.map +1 -0
- package/dist/formatters/search.d.ts +0 -4
- package/dist/formatters/search.d.ts.map +1 -1
- package/dist/formatters/search.js +4 -1
- package/dist/formatters/search.js.map +1 -1
- package/dist/formatters/session.d.ts +39 -2
- package/dist/formatters/session.d.ts.map +1 -1
- package/dist/formatters/session.js +130 -9
- package/dist/formatters/session.js.map +1 -1
- package/dist/formatters/update.d.ts.map +1 -1
- package/dist/formatters/update.js +2 -0
- package/dist/formatters/update.js.map +1 -1
- package/dist/generators/adapters.d.ts +37 -3
- package/dist/generators/adapters.d.ts.map +1 -1
- package/dist/generators/adapters.js +196 -8
- package/dist/generators/adapters.js.map +1 -1
- package/dist/generators/adapters.test.d.ts +2 -0
- package/dist/generators/adapters.test.d.ts.map +1 -0
- package/dist/generators/adapters.test.js +27 -0
- package/dist/generators/adapters.test.js.map +1 -0
- package/dist/generators/archetypes.d.ts +52 -0
- package/dist/generators/archetypes.d.ts.map +1 -0
- package/dist/generators/archetypes.js +190 -0
- package/dist/generators/archetypes.js.map +1 -0
- package/dist/generators/archetypes.test.d.ts +2 -0
- package/dist/generators/archetypes.test.d.ts.map +1 -0
- package/dist/generators/archetypes.test.js +272 -0
- package/dist/generators/archetypes.test.js.map +1 -0
- package/dist/generators/boundary-manifest.d.ts +29 -0
- package/dist/generators/boundary-manifest.d.ts.map +1 -0
- package/dist/generators/boundary-manifest.js +183 -0
- package/dist/generators/boundary-manifest.js.map +1 -0
- package/dist/generators/boundary-manifest.test.d.ts +2 -0
- package/dist/generators/boundary-manifest.test.d.ts.map +1 -0
- package/dist/generators/boundary-manifest.test.js +91 -0
- package/dist/generators/boundary-manifest.test.js.map +1 -0
- package/dist/generators/chain-classifier.d.ts +63 -0
- package/dist/generators/chain-classifier.d.ts.map +1 -0
- package/dist/generators/chain-classifier.js +131 -0
- package/dist/generators/chain-classifier.js.map +1 -0
- package/dist/generators/chain-classifier.test.d.ts +2 -0
- package/dist/generators/chain-classifier.test.d.ts.map +1 -0
- package/dist/generators/chain-classifier.test.js +371 -0
- package/dist/generators/chain-classifier.test.js.map +1 -0
- package/dist/generators/chain-rules.d.ts +42 -0
- package/dist/generators/chain-rules.d.ts.map +1 -0
- package/dist/generators/chain-rules.js +152 -0
- package/dist/generators/chain-rules.js.map +1 -0
- package/dist/generators/chain-rules.test.d.ts +2 -0
- package/dist/generators/chain-rules.test.d.ts.map +1 -0
- package/dist/generators/chain-rules.test.js +211 -0
- package/dist/generators/chain-rules.test.js.map +1 -0
- package/dist/generators/context-md.d.ts +1 -1
- package/dist/generators/context-md.d.ts.map +1 -1
- package/dist/generators/context-md.js +18 -7
- package/dist/generators/context-md.js.map +1 -1
- package/dist/generators/handshake-diff.d.ts +67 -0
- package/dist/generators/handshake-diff.d.ts.map +1 -0
- package/dist/generators/handshake-diff.js +183 -0
- package/dist/generators/handshake-diff.js.map +1 -0
- package/dist/generators/handshake-diff.test.d.ts +2 -0
- package/dist/generators/handshake-diff.test.d.ts.map +1 -0
- package/dist/generators/handshake-diff.test.js +264 -0
- package/dist/generators/handshake-diff.test.js.map +1 -0
- package/dist/generators/manifest.d.ts +115 -0
- package/dist/generators/manifest.d.ts.map +1 -0
- package/dist/generators/manifest.js +277 -0
- package/dist/generators/manifest.js.map +1 -0
- package/dist/generators/portable-knowledge.d.ts +96 -9
- package/dist/generators/portable-knowledge.d.ts.map +1 -1
- package/dist/generators/portable-knowledge.js +367 -17
- package/dist/generators/portable-knowledge.js.map +1 -1
- package/dist/generators/portable-knowledge.test.js +529 -1
- package/dist/generators/portable-knowledge.test.js.map +1 -1
- package/dist/generators/region-projections.d.ts +18 -0
- package/dist/generators/region-projections.d.ts.map +1 -0
- package/dist/generators/region-projections.js +49 -0
- package/dist/generators/region-projections.js.map +1 -0
- package/dist/generators/region-projections.test.d.ts +2 -0
- package/dist/generators/region-projections.test.d.ts.map +1 -0
- package/dist/generators/region-projections.test.js +63 -0
- package/dist/generators/region-projections.test.js.map +1 -0
- package/dist/generators/region.d.ts +24 -0
- package/dist/generators/region.d.ts.map +1 -0
- package/dist/generators/region.js +87 -0
- package/dist/generators/region.js.map +1 -0
- package/dist/generators/region.test.d.ts +2 -0
- package/dist/generators/region.test.d.ts.map +1 -0
- package/dist/generators/region.test.js +126 -0
- package/dist/generators/region.test.js.map +1 -0
- package/dist/generators/surface-profiles.d.ts +48 -0
- package/dist/generators/surface-profiles.d.ts.map +1 -0
- package/dist/generators/surface-profiles.js +98 -0
- package/dist/generators/surface-profiles.js.map +1 -0
- package/dist/index.js +800 -252
- package/dist/index.js.map +1 -1
- package/dist/lib/activation.d.ts +28 -0
- package/dist/lib/activation.d.ts.map +1 -0
- package/dist/lib/activation.js +57 -0
- package/dist/lib/activation.js.map +1 -0
- package/dist/lib/activation.test.d.ts +6 -0
- package/dist/lib/activation.test.d.ts.map +1 -0
- package/dist/lib/activation.test.js +121 -0
- package/dist/lib/activation.test.js.map +1 -0
- package/dist/lib/canonicalRefs.d.ts +141 -0
- package/dist/lib/canonicalRefs.d.ts.map +1 -0
- package/dist/lib/canonicalRefs.js +150 -0
- package/dist/lib/canonicalRefs.js.map +1 -0
- package/dist/lib/client.d.ts +33 -6
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +203 -42
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/collectionRegistry.d.ts +40 -0
- package/dist/lib/collectionRegistry.d.ts.map +1 -0
- package/dist/lib/collectionRegistry.js +112 -0
- package/dist/lib/collectionRegistry.js.map +1 -0
- package/dist/lib/compose-wrapup-view.d.ts +48 -0
- package/dist/lib/compose-wrapup-view.d.ts.map +1 -0
- package/dist/lib/compose-wrapup-view.js +37 -0
- package/dist/lib/compose-wrapup-view.js.map +1 -0
- package/dist/lib/config.d.ts +204 -4
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +594 -42
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/connectKeyLabel.d.ts +9 -0
- package/dist/lib/connectKeyLabel.d.ts.map +1 -0
- package/dist/lib/connectKeyLabel.js +12 -0
- package/dist/lib/connectKeyLabel.js.map +1 -0
- package/dist/lib/constants.d.ts +46 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +83 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/conversation-engine.d.ts +45 -0
- package/dist/lib/conversation-engine.d.ts.map +1 -0
- package/dist/lib/conversation-engine.js +112 -0
- package/dist/lib/conversation-engine.js.map +1 -0
- package/dist/lib/conversation-phases.d.ts +59 -0
- package/dist/lib/conversation-phases.d.ts.map +1 -0
- package/dist/lib/conversation-phases.js +11 -0
- package/dist/lib/conversation-phases.js.map +1 -0
- package/dist/lib/conversation-signals.d.ts +30 -0
- package/dist/lib/conversation-signals.d.ts.map +1 -0
- package/dist/lib/conversation-signals.js +64 -0
- package/dist/lib/conversation-signals.js.map +1 -0
- package/dist/lib/deployment.d.ts +23 -0
- package/dist/lib/deployment.d.ts.map +1 -0
- package/dist/lib/deployment.js +78 -0
- package/dist/lib/deployment.js.map +1 -0
- package/dist/lib/deployment.test.d.ts +5 -0
- package/dist/lib/deployment.test.d.ts.map +1 -0
- package/dist/lib/deployment.test.js +54 -0
- package/dist/lib/deployment.test.js.map +1 -0
- package/dist/lib/errors.d.ts +63 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +72 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/experiment.d.ts +18 -0
- package/dist/lib/experiment.d.ts.map +1 -0
- package/dist/lib/experiment.js +28 -0
- package/dist/lib/experiment.js.map +1 -0
- package/dist/lib/format.d.ts +10 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +27 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/frontmatter.d.ts +55 -0
- package/dist/lib/frontmatter.d.ts.map +1 -0
- package/dist/lib/frontmatter.js +92 -0
- package/dist/lib/frontmatter.js.map +1 -0
- package/dist/lib/frontmatter.test.d.ts +15 -0
- package/dist/lib/frontmatter.test.d.ts.map +1 -0
- package/dist/lib/frontmatter.test.js +98 -0
- package/dist/lib/frontmatter.test.js.map +1 -0
- package/dist/lib/glossary.d.ts +19 -0
- package/dist/lib/glossary.d.ts.map +1 -0
- package/dist/lib/glossary.js +53 -0
- package/dist/lib/glossary.js.map +1 -0
- package/dist/lib/hook-intents.d.ts +51 -0
- package/dist/lib/hook-intents.d.ts.map +1 -0
- package/dist/lib/hook-intents.js +85 -0
- package/dist/lib/hook-intents.js.map +1 -0
- package/dist/lib/inferSourceDate.d.ts +12 -0
- package/dist/lib/inferSourceDate.d.ts.map +1 -0
- package/dist/lib/inferSourceDate.js +44 -0
- package/dist/lib/inferSourceDate.js.map +1 -0
- package/dist/lib/method-registry.d.ts +32 -0
- package/dist/lib/method-registry.d.ts.map +1 -0
- package/dist/lib/method-registry.js +53 -0
- package/dist/lib/method-registry.js.map +1 -0
- package/dist/lib/normalizeMaterializedFilename.d.ts +28 -0
- package/dist/lib/normalizeMaterializedFilename.d.ts.map +1 -0
- package/dist/lib/normalizeMaterializedFilename.js +56 -0
- package/dist/lib/normalizeMaterializedFilename.js.map +1 -0
- package/dist/lib/normalizeMaterializedFilename.test.d.ts +16 -0
- package/dist/lib/normalizeMaterializedFilename.test.d.ts.map +1 -0
- package/dist/lib/normalizeMaterializedFilename.test.js +90 -0
- package/dist/lib/normalizeMaterializedFilename.test.js.map +1 -0
- package/dist/lib/notice-marker.d.ts +3 -0
- package/dist/lib/notice-marker.d.ts.map +1 -0
- package/dist/lib/notice-marker.js +53 -0
- package/dist/lib/notice-marker.js.map +1 -0
- package/dist/lib/onboarding-path-b.d.ts +10 -0
- package/dist/lib/onboarding-path-b.d.ts.map +1 -0
- package/dist/lib/onboarding-path-b.js +213 -0
- package/dist/lib/onboarding-path-b.js.map +1 -0
- package/dist/lib/onboarding-shared.d.ts +80 -0
- package/dist/lib/onboarding-shared.d.ts.map +1 -0
- package/dist/lib/onboarding-shared.js +174 -0
- package/dist/lib/onboarding-shared.js.map +1 -0
- package/dist/lib/onboarding-topics.d.ts +27 -0
- package/dist/lib/onboarding-topics.d.ts.map +1 -0
- package/dist/lib/onboarding-topics.js +57 -0
- package/dist/lib/onboarding-topics.js.map +1 -0
- package/dist/lib/onboarding.d.ts +17 -0
- package/dist/lib/onboarding.d.ts.map +1 -0
- package/dist/lib/onboarding.js +350 -0
- package/dist/lib/onboarding.js.map +1 -0
- package/dist/lib/profiles.d.ts +41 -0
- package/dist/lib/profiles.d.ts.map +1 -0
- package/dist/lib/profiles.js +188 -0
- package/dist/lib/profiles.js.map +1 -0
- package/dist/lib/prompts.d.ts +65 -0
- package/dist/lib/prompts.d.ts.map +1 -0
- package/dist/lib/prompts.js +132 -0
- package/dist/lib/prompts.js.map +1 -0
- package/dist/lib/repo-detect.d.ts +19 -0
- package/dist/lib/repo-detect.d.ts.map +1 -1
- package/dist/lib/repo-detect.js +25 -0
- package/dist/lib/repo-detect.js.map +1 -1
- package/dist/lib/runner.d.ts +2 -0
- package/dist/lib/runner.d.ts.map +1 -1
- package/dist/lib/runner.js +21 -7
- package/dist/lib/runner.js.map +1 -1
- package/dist/lib/session.d.ts +35 -0
- package/dist/lib/session.d.ts.map +1 -1
- package/dist/lib/session.js +94 -3
- package/dist/lib/session.js.map +1 -1
- package/dist/lib/spinner.d.ts +27 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +76 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/spinner.test.d.ts +2 -0
- package/dist/lib/spinner.test.d.ts.map +1 -0
- package/dist/lib/spinner.test.js +39 -0
- package/dist/lib/spinner.test.js.map +1 -0
- package/dist/lib/startup-resolution-signals.d.ts +34 -0
- package/dist/lib/startup-resolution-signals.d.ts.map +1 -0
- package/dist/lib/startup-resolution-signals.js +118 -0
- package/dist/lib/startup-resolution-signals.js.map +1 -0
- package/dist/lib/startup-resolution-signals.test.d.ts +2 -0
- package/dist/lib/startup-resolution-signals.test.d.ts.map +1 -0
- package/dist/lib/startup-resolution-signals.test.js +113 -0
- package/dist/lib/startup-resolution-signals.test.js.map +1 -0
- package/dist/lib/state.d.ts +51 -0
- package/dist/lib/state.d.ts.map +1 -0
- package/dist/lib/state.js +90 -0
- package/dist/lib/state.js.map +1 -0
- package/dist/lib/strip.d.ts +1 -0
- package/dist/lib/strip.d.ts.map +1 -1
- package/dist/lib/strip.js +15 -0
- package/dist/lib/strip.js.map +1 -1
- package/dist/lib/style.d.ts +96 -0
- package/dist/lib/style.d.ts.map +1 -0
- package/dist/lib/style.js +169 -0
- package/dist/lib/style.js.map +1 -0
- package/dist/lib/style.test.d.ts +7 -0
- package/dist/lib/style.test.d.ts.map +1 -0
- package/dist/lib/style.test.js +263 -0
- package/dist/lib/style.test.js.map +1 -0
- package/dist/lib/telemetry.d.ts +15 -0
- package/dist/lib/telemetry.d.ts.map +1 -0
- package/dist/lib/telemetry.js +47 -0
- package/dist/lib/telemetry.js.map +1 -0
- package/dist/lib/tokenConstants.d.ts +19 -0
- package/dist/lib/tokenConstants.d.ts.map +1 -0
- package/dist/lib/tokenConstants.js +19 -0
- package/dist/lib/tokenConstants.js.map +1 -0
- package/dist/lib/update-check.d.ts +56 -0
- package/dist/lib/update-check.d.ts.map +1 -0
- package/dist/lib/update-check.js +296 -0
- package/dist/lib/update-check.js.map +1 -0
- package/dist/lib/upgrade-runner.d.ts +22 -0
- package/dist/lib/upgrade-runner.d.ts.map +1 -0
- package/dist/lib/upgrade-runner.js +110 -0
- package/dist/lib/upgrade-runner.js.map +1 -0
- package/dist/lib/wizard-surfaces.d.ts +47 -0
- package/dist/lib/wizard-surfaces.d.ts.map +1 -0
- package/dist/lib/wizard-surfaces.js +176 -0
- package/dist/lib/wizard-surfaces.js.map +1 -0
- package/dist/lib/wizard-surfaces.test.d.ts +2 -0
- package/dist/lib/wizard-surfaces.test.d.ts.map +1 -0
- package/dist/lib/wizard-surfaces.test.js +127 -0
- package/dist/lib/wizard-surfaces.test.js.map +1 -0
- package/dist/lib/wizard-trust.d.ts +31 -0
- package/dist/lib/wizard-trust.d.ts.map +1 -0
- package/dist/lib/wizard-trust.js +66 -0
- package/dist/lib/wizard-trust.js.map +1 -0
- package/dist/lib/wizard-trust.test.d.ts +2 -0
- package/dist/lib/wizard-trust.test.d.ts.map +1 -0
- package/dist/lib/wizard-trust.test.js +32 -0
- package/dist/lib/wizard-trust.test.js.map +1 -0
- package/dist/lib/workspace-probe.d.ts +19 -0
- package/dist/lib/workspace-probe.d.ts.map +1 -0
- package/dist/lib/workspace-probe.js +27 -0
- package/dist/lib/workspace-probe.js.map +1 -0
- package/dist/lib/workspaceVocabCache.d.ts +60 -0
- package/dist/lib/workspaceVocabCache.d.ts.map +1 -0
- package/dist/lib/workspaceVocabCache.js +98 -0
- package/dist/lib/workspaceVocabCache.js.map +1 -0
- package/dist/scoreboard/diagnose.d.ts +182 -0
- package/dist/scoreboard/diagnose.d.ts.map +1 -0
- package/dist/scoreboard/diagnose.js +250 -0
- package/dist/scoreboard/diagnose.js.map +1 -0
- package/dist/scoreboard/diagnose.test.d.ts +12 -0
- package/dist/scoreboard/diagnose.test.d.ts.map +1 -0
- package/dist/scoreboard/diagnose.test.js +192 -0
- package/dist/scoreboard/diagnose.test.js.map +1 -0
- package/dist/scoreboard/localDrift.d.ts +23 -0
- package/dist/scoreboard/localDrift.d.ts.map +1 -0
- package/dist/scoreboard/localDrift.js +111 -0
- package/dist/scoreboard/localDrift.js.map +1 -0
- package/dist/scoreboard/localDrift.test.d.ts +9 -0
- package/dist/scoreboard/localDrift.test.d.ts.map +1 -0
- package/dist/scoreboard/localDrift.test.js +82 -0
- package/dist/scoreboard/localDrift.test.js.map +1 -0
- package/dist/setup/__tests__/coach-traces.test.d.ts +2 -0
- package/dist/setup/__tests__/coach-traces.test.d.ts.map +1 -0
- package/dist/setup/__tests__/coach-traces.test.js +189 -0
- package/dist/setup/__tests__/coach-traces.test.js.map +1 -0
- package/dist/setup/__tests__/setup-commands.test.d.ts +2 -0
- package/dist/setup/__tests__/setup-commands.test.d.ts.map +1 -0
- package/dist/setup/__tests__/setup-commands.test.js +177 -0
- package/dist/setup/__tests__/setup-commands.test.js.map +1 -0
- package/dist/setup/__tests__/state-machine.test.d.ts +2 -0
- package/dist/setup/__tests__/state-machine.test.d.ts.map +1 -0
- package/dist/setup/__tests__/state-machine.test.js +341 -0
- package/dist/setup/__tests__/state-machine.test.js.map +1 -0
- package/dist/setup/detect-surfaces.d.ts +21 -0
- package/dist/setup/detect-surfaces.d.ts.map +1 -0
- package/dist/setup/detect-surfaces.js +39 -0
- package/dist/setup/detect-surfaces.js.map +1 -0
- package/dist/setup/manifest-writer.d.ts +17 -0
- package/dist/setup/manifest-writer.d.ts.map +1 -0
- package/dist/setup/manifest-writer.js +153 -0
- package/dist/setup/manifest-writer.js.map +1 -0
- package/dist/setup/perimeter.d.ts +72 -0
- package/dist/setup/perimeter.d.ts.map +1 -0
- package/dist/setup/perimeter.js +128 -0
- package/dist/setup/perimeter.js.map +1 -0
- package/dist/setup/state-machine.d.ts +67 -0
- package/dist/setup/state-machine.d.ts.map +1 -0
- package/dist/setup/state-machine.js +124 -0
- package/dist/setup/state-machine.js.map +1 -0
- package/dist/surfaces/__tests__/adapter.test.d.ts +2 -0
- package/dist/surfaces/__tests__/adapter.test.d.ts.map +1 -0
- package/dist/surfaces/__tests__/adapter.test.js +90 -0
- package/dist/surfaces/__tests__/adapter.test.js.map +1 -0
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts +2 -0
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts.map +1 -0
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.js +132 -0
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.js.map +1 -0
- package/dist/surfaces/__tests__/telemetry.test.d.ts +2 -0
- package/dist/surfaces/__tests__/telemetry.test.d.ts.map +1 -0
- package/dist/surfaces/__tests__/telemetry.test.js +55 -0
- package/dist/surfaces/__tests__/telemetry.test.js.map +1 -0
- package/dist/surfaces/adapter.d.ts +70 -0
- package/dist/surfaces/adapter.d.ts.map +1 -0
- package/dist/surfaces/adapter.js +2 -0
- package/dist/surfaces/adapter.js.map +1 -0
- package/dist/surfaces/adapters/claude.d.ts +3 -0
- package/dist/surfaces/adapters/claude.d.ts.map +1 -0
- package/dist/surfaces/adapters/claude.js +67 -0
- package/dist/surfaces/adapters/claude.js.map +1 -0
- package/dist/surfaces/adapters/codex.d.ts +3 -0
- package/dist/surfaces/adapters/codex.d.ts.map +1 -0
- package/dist/surfaces/adapters/codex.js +61 -0
- package/dist/surfaces/adapters/codex.js.map +1 -0
- package/dist/surfaces/adapters/copilot.d.ts +3 -0
- package/dist/surfaces/adapters/copilot.d.ts.map +1 -0
- package/dist/surfaces/adapters/copilot.js +59 -0
- package/dist/surfaces/adapters/copilot.js.map +1 -0
- package/dist/surfaces/adapters/cursor.d.ts +3 -0
- package/dist/surfaces/adapters/cursor.d.ts.map +1 -0
- package/dist/surfaces/adapters/cursor.js +78 -0
- package/dist/surfaces/adapters/cursor.js.map +1 -0
- package/dist/surfaces/registry.d.ts +76 -0
- package/dist/surfaces/registry.d.ts.map +1 -0
- package/dist/surfaces/registry.js +117 -0
- package/dist/surfaces/registry.js.map +1 -0
- package/dist/surfaces/telemetry.d.ts +17 -0
- package/dist/surfaces/telemetry.d.ts.map +1 -0
- package/dist/surfaces/telemetry.js +31 -0
- package/dist/surfaces/telemetry.js.map +1 -0
- package/package.json +12 -4
- package/templates/archetypes/boundary.md +23 -0
- package/templates/archetypes/constraint.md +23 -0
- package/templates/archetypes/convention.md +23 -0
- package/templates/archetypes/policy.md +23 -0
- package/templates/archetypes/quality-gate.md +23 -0
- package/templates/archetypes/workflow.md +23 -0
- package/templates/general/code-integrity.md +11 -0
- package/templates/general/getting-started.md +12 -0
- package/templates/method-registry.json +16 -0
- package/templates/node-ts/code-integrity.md +13 -0
- package/templates/node-ts/testing.md +12 -0
- package/templates/python/code-integrity.md +13 -0
- package/templates/python/testing.md +12 -0
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pb method ls / pb method show <name> / pb method diff <name> / pb method publish <name>
|
|
3
|
+
* WP-329 S1-S3: Method visibility CLI + publish.
|
|
4
|
+
*
|
|
5
|
+
* Lists all .productbrain/ skills and rules with per-surface adapter status,
|
|
6
|
+
* shows detailed fork-detection output for a single method, diffs against
|
|
7
|
+
* the Chain, and publishes to the Chain methods collection.
|
|
8
|
+
*
|
|
9
|
+
* Chain: WP-329 (Method Publish + Visibility), DEC-299 (JSON-default output),
|
|
10
|
+
* DEC-598 (local-only monotonic versioning, Option B).
|
|
11
|
+
*/
|
|
12
|
+
import { createHash } from 'node:crypto';
|
|
13
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
14
|
+
import { join, resolve } from 'node:path';
|
|
15
|
+
import { cwd } from 'node:process';
|
|
16
|
+
import { kernelCall, kernelCallWithSession } from '../lib/client.js';
|
|
17
|
+
import { readSession } from '../lib/session.js';
|
|
18
|
+
import { runCliCommand } from '../lib/runner.js';
|
|
19
|
+
import { CLIError, ErrorCode } from '../lib/errors.js';
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Constants
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
const CODEX_MARKER_PREFIX = '<!-- auto-generated by pb handshake — source: .productbrain/';
|
|
24
|
+
/**
|
|
25
|
+
* Normalize path references in Claude adapter bodies before comparison.
|
|
26
|
+
* pb handshake rewrites .productbrain/rules/ → .claude/rules/ in .claude/ adapters.
|
|
27
|
+
* Reverting here lets us compare body content without false-positive "forked" reports.
|
|
28
|
+
*/
|
|
29
|
+
function normalizeClaudeAdapterBody(body) {
|
|
30
|
+
return body.replace(/\.claude\/rules\//g, '.productbrain/rules/');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Normalize path references in Cursor adapter bodies before comparison.
|
|
34
|
+
* pb handshake rewrites .productbrain/rules/ → .cursor/rules/ in .cursor/ adapters.
|
|
35
|
+
*/
|
|
36
|
+
function normalizeCursorAdapterBody(body) {
|
|
37
|
+
return body.replace(/\.cursor\/rules\//g, '.productbrain/rules/');
|
|
38
|
+
}
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Filesystem helpers
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
/** Returns project root (the directory containing .productbrain/). */
|
|
43
|
+
function projectRoot() {
|
|
44
|
+
// Walk up from cwd until we find .productbrain/, or fall back to cwd
|
|
45
|
+
let dir = cwd();
|
|
46
|
+
for (let i = 0; i < 8; i++) {
|
|
47
|
+
if (existsSync(join(dir, '.productbrain')))
|
|
48
|
+
return dir;
|
|
49
|
+
const parent = resolve(dir, '..');
|
|
50
|
+
if (parent === dir)
|
|
51
|
+
break;
|
|
52
|
+
dir = parent;
|
|
53
|
+
}
|
|
54
|
+
return cwd();
|
|
55
|
+
}
|
|
56
|
+
// Intentionally NOT folded into lib/frontmatter.ts (parseSetupFrontmatter): this
|
|
57
|
+
// parser has different semantics (multi-line value support, MethodFrontmatter shape).
|
|
58
|
+
/** Parse YAML-ish frontmatter block from a .md file (simple key: value, supports multi-line values). */
|
|
59
|
+
function parseFrontmatter(content) {
|
|
60
|
+
if (!content.startsWith('---')) {
|
|
61
|
+
return { frontmatter: {}, body: content };
|
|
62
|
+
}
|
|
63
|
+
const end = content.indexOf('\n---', 3);
|
|
64
|
+
if (end === -1) {
|
|
65
|
+
return { frontmatter: {}, body: content };
|
|
66
|
+
}
|
|
67
|
+
const fmBlock = content.slice(4, end); // skip the opening ---\n
|
|
68
|
+
const body = content.slice(end + 4); // skip the closing ---
|
|
69
|
+
const frontmatter = {};
|
|
70
|
+
let i = 0;
|
|
71
|
+
const lines = fmBlock.split('\n');
|
|
72
|
+
while (i < lines.length) {
|
|
73
|
+
const line = lines[i];
|
|
74
|
+
const colonIdx = line.indexOf(':');
|
|
75
|
+
if (colonIdx < 1) {
|
|
76
|
+
i++;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const key = line.slice(0, colonIdx).trim();
|
|
80
|
+
let value = line.slice(colonIdx + 1).trim();
|
|
81
|
+
// Multi-line value: starts with >- or |
|
|
82
|
+
if (value === '>-' || value === '>' || value === '|') {
|
|
83
|
+
const parts = [];
|
|
84
|
+
i++;
|
|
85
|
+
while (i < lines.length && (lines[i].startsWith(' ') || lines[i] === '')) {
|
|
86
|
+
parts.push(lines[i].trim());
|
|
87
|
+
i++;
|
|
88
|
+
}
|
|
89
|
+
frontmatter[key] = parts.join(' ').trim();
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
// Boolean values
|
|
93
|
+
if (value === 'true') {
|
|
94
|
+
frontmatter[key] = true;
|
|
95
|
+
i++;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (value === 'false') {
|
|
99
|
+
frontmatter[key] = false;
|
|
100
|
+
i++;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
// Strip surrounding quotes
|
|
104
|
+
if ((value.startsWith('"') && value.endsWith('"')) ||
|
|
105
|
+
(value.startsWith("'") && value.endsWith("'"))) {
|
|
106
|
+
value = value.slice(1, -1);
|
|
107
|
+
}
|
|
108
|
+
frontmatter[key] = value;
|
|
109
|
+
i++;
|
|
110
|
+
}
|
|
111
|
+
return { frontmatter, body: body.trimStart() };
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Strip frontmatter from adapter files so we can compare body content.
|
|
115
|
+
* Also strip CODEX MARKER comment line if present.
|
|
116
|
+
*/
|
|
117
|
+
function extractAdapterBody(content) {
|
|
118
|
+
// Strip frontmatter block if present
|
|
119
|
+
let text = content;
|
|
120
|
+
if (text.startsWith('---')) {
|
|
121
|
+
const end = text.indexOf('\n---', 3);
|
|
122
|
+
if (end !== -1) {
|
|
123
|
+
text = text.slice(end + 4).trimStart();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// Strip MARKER comment line (first line if it matches)
|
|
127
|
+
const firstNewline = text.indexOf('\n');
|
|
128
|
+
if (firstNewline !== -1) {
|
|
129
|
+
const firstLine = text.slice(0, firstNewline).trim();
|
|
130
|
+
if (firstLine.startsWith('<!--') && firstLine.includes('auto-generated by pb handshake')) {
|
|
131
|
+
text = text.slice(firstNewline + 1).trimStart();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return text.trim();
|
|
135
|
+
}
|
|
136
|
+
/** Load all methods from .productbrain/skills/ and .productbrain/rules/. */
|
|
137
|
+
function loadAllSources(root) {
|
|
138
|
+
const sources = [];
|
|
139
|
+
const skillsDir = join(root, '.productbrain', 'skills');
|
|
140
|
+
const rulesDir = join(root, '.productbrain', 'rules');
|
|
141
|
+
for (const [dir, type] of [[skillsDir, 'skill'], [rulesDir, 'rule']]) {
|
|
142
|
+
if (!existsSync(dir))
|
|
143
|
+
continue;
|
|
144
|
+
const files = readdirSync(dir).filter((f) => f.endsWith('.md'));
|
|
145
|
+
for (const file of files) {
|
|
146
|
+
const filePath = join(dir, file);
|
|
147
|
+
let content;
|
|
148
|
+
try {
|
|
149
|
+
content = readFileSync(filePath, 'utf8');
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const { frontmatter, body } = parseFrontmatter(content);
|
|
155
|
+
const stem = file.replace(/\.md$/, '');
|
|
156
|
+
sources.push({
|
|
157
|
+
name: stem,
|
|
158
|
+
type,
|
|
159
|
+
sourcePath: filePath,
|
|
160
|
+
frontmatter,
|
|
161
|
+
body,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return sources;
|
|
166
|
+
}
|
|
167
|
+
// ---------------------------------------------------------------------------
|
|
168
|
+
// Adapter status detection
|
|
169
|
+
// ---------------------------------------------------------------------------
|
|
170
|
+
function checkClaude(root, source) {
|
|
171
|
+
// Rules have adapters in .claude/rules/; skills do NOT have a direct claude adapter
|
|
172
|
+
if (source.type === 'skill')
|
|
173
|
+
return 'missing';
|
|
174
|
+
const adapterPath = join(root, '.claude', 'rules', `${source.name}.md`);
|
|
175
|
+
if (!existsSync(adapterPath))
|
|
176
|
+
return 'missing';
|
|
177
|
+
let adapterContent;
|
|
178
|
+
try {
|
|
179
|
+
adapterContent = readFileSync(adapterPath, 'utf8');
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
return 'missing';
|
|
183
|
+
}
|
|
184
|
+
const adapterBody = normalizeClaudeAdapterBody(extractAdapterBody(adapterContent));
|
|
185
|
+
const sourceBody = source.body.trim();
|
|
186
|
+
return adapterBody === sourceBody ? 'ok' : 'forked';
|
|
187
|
+
}
|
|
188
|
+
function checkCursor(root, source) {
|
|
189
|
+
// Rules have adapters in .cursor/rules/<name>.mdc; skills do NOT have cursor adapters
|
|
190
|
+
if (source.type === 'skill')
|
|
191
|
+
return 'missing';
|
|
192
|
+
const adapterPath = join(root, '.cursor', 'rules', `${source.name}.mdc`);
|
|
193
|
+
if (!existsSync(adapterPath))
|
|
194
|
+
return 'missing';
|
|
195
|
+
let adapterContent;
|
|
196
|
+
try {
|
|
197
|
+
adapterContent = readFileSync(adapterPath, 'utf8');
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
return 'missing';
|
|
201
|
+
}
|
|
202
|
+
const adapterBody = normalizeCursorAdapterBody(extractAdapterBody(adapterContent));
|
|
203
|
+
const sourceBody = source.body.trim();
|
|
204
|
+
return adapterBody === sourceBody ? 'ok' : 'forked';
|
|
205
|
+
}
|
|
206
|
+
function checkCodex(root, source) {
|
|
207
|
+
// Only skills have codex adapters in .codex/skills/
|
|
208
|
+
if (source.type === 'rule')
|
|
209
|
+
return 'missing';
|
|
210
|
+
const adapterPath = join(root, '.codex', 'skills', `${source.name}.md`);
|
|
211
|
+
if (!existsSync(adapterPath))
|
|
212
|
+
return 'missing';
|
|
213
|
+
let adapterContent;
|
|
214
|
+
try {
|
|
215
|
+
adapterContent = readFileSync(adapterPath, 'utf8');
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
return 'missing';
|
|
219
|
+
}
|
|
220
|
+
// Check MARKER presence
|
|
221
|
+
if (!adapterContent.includes(CODEX_MARKER_PREFIX))
|
|
222
|
+
return 'forked';
|
|
223
|
+
const adapterBody = extractAdapterBody(adapterContent);
|
|
224
|
+
const sourceBody = source.body.trim();
|
|
225
|
+
return adapterBody === sourceBody ? 'ok' : 'forked';
|
|
226
|
+
}
|
|
227
|
+
function checkCopilot(root, source) {
|
|
228
|
+
// Only rules contribute to copilot-instructions.md (skills are not included)
|
|
229
|
+
if (source.type === 'skill')
|
|
230
|
+
return 'missing';
|
|
231
|
+
const copilotPath = join(root, '.github', 'copilot-instructions.md');
|
|
232
|
+
if (!existsSync(copilotPath))
|
|
233
|
+
return 'missing';
|
|
234
|
+
let copilotContent;
|
|
235
|
+
try {
|
|
236
|
+
copilotContent = readFileSync(copilotPath, 'utf8');
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return 'missing';
|
|
240
|
+
}
|
|
241
|
+
// copilot-instructions.md stores summaries (### name\ndescription), not full bodies
|
|
242
|
+
return copilotContent.includes(`### ${source.name}`) ? 'ok' : 'forked';
|
|
243
|
+
}
|
|
244
|
+
function checkAdapters(root, source) {
|
|
245
|
+
return {
|
|
246
|
+
claude: checkClaude(root, source),
|
|
247
|
+
cursor: checkCursor(root, source),
|
|
248
|
+
codex: checkCodex(root, source),
|
|
249
|
+
copilot: checkCopilot(root, source),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
// ---------------------------------------------------------------------------
|
|
253
|
+
// Chain query helper
|
|
254
|
+
// ---------------------------------------------------------------------------
|
|
255
|
+
/** Attempt to fetch published Chain entry for a method by name. Returns null on failure. */
|
|
256
|
+
async function fetchChainMethod(name) {
|
|
257
|
+
try {
|
|
258
|
+
const results = await kernelCall('chain.searchEntries', { query: name, collectionSlug: 'methods' });
|
|
259
|
+
if (!Array.isArray(results))
|
|
260
|
+
return null;
|
|
261
|
+
// Find exact name match in results
|
|
262
|
+
const match = results.find((r) => {
|
|
263
|
+
const entryName = (r.data?.name ?? r.name);
|
|
264
|
+
return entryName === name;
|
|
265
|
+
});
|
|
266
|
+
if (!match)
|
|
267
|
+
return null;
|
|
268
|
+
const data = match.data ?? {};
|
|
269
|
+
const fmRaw = data.frontmatter;
|
|
270
|
+
let frontmatter;
|
|
271
|
+
if (fmRaw) {
|
|
272
|
+
try {
|
|
273
|
+
frontmatter = JSON.parse(fmRaw);
|
|
274
|
+
}
|
|
275
|
+
catch { /* ignore */ }
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
_id: match._id,
|
|
279
|
+
version: data.version != null ? String(data.version) : undefined,
|
|
280
|
+
publishedAt: data.publishedAt,
|
|
281
|
+
publishedBy: data.publishedBy,
|
|
282
|
+
manifestHash: data.manifestHash,
|
|
283
|
+
body: data.body,
|
|
284
|
+
frontmatter,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
catch {
|
|
288
|
+
// Chain unreachable or collection doesn't exist yet — not fatal
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// ---------------------------------------------------------------------------
|
|
293
|
+
// Diff helpers
|
|
294
|
+
// ---------------------------------------------------------------------------
|
|
295
|
+
/**
|
|
296
|
+
* Produce a minimal unified diff between two texts.
|
|
297
|
+
* Returns an array of diff lines (context lines prefixed with space,
|
|
298
|
+
* removals prefixed with -, additions prefixed with +).
|
|
299
|
+
* Context window: 3 lines around each change.
|
|
300
|
+
*/
|
|
301
|
+
function computeUnifiedDiff(oldText, newText, context = 3) {
|
|
302
|
+
const oldLines = oldText.split('\n');
|
|
303
|
+
const newLines = newText.split('\n');
|
|
304
|
+
// Myers-style LCS — compute edit script via DP table
|
|
305
|
+
const m = oldLines.length;
|
|
306
|
+
const n = newLines.length;
|
|
307
|
+
// dp[i][j] = length of LCS for oldLines[0..i-1] and newLines[0..j-1]
|
|
308
|
+
const dp = Array.from({ length: m + 1 }, () => new Array(n + 1).fill(0));
|
|
309
|
+
for (let i = 1; i <= m; i++) {
|
|
310
|
+
for (let j = 1; j <= n; j++) {
|
|
311
|
+
if (oldLines[i - 1] === newLines[j - 1]) {
|
|
312
|
+
dp[i][j] = dp[i - 1][j - 1] + 1;
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
const edits = [];
|
|
320
|
+
let i = m;
|
|
321
|
+
let j = n;
|
|
322
|
+
while (i > 0 || j > 0) {
|
|
323
|
+
if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) {
|
|
324
|
+
edits.unshift({ op: ' ', line: oldLines[i - 1], oldIdx: i - 1, newIdx: j - 1 });
|
|
325
|
+
i--;
|
|
326
|
+
j--;
|
|
327
|
+
}
|
|
328
|
+
else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
|
|
329
|
+
edits.unshift({ op: '+', line: newLines[j - 1], newIdx: j - 1 });
|
|
330
|
+
j--;
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
edits.unshift({ op: '-', line: oldLines[i - 1], oldIdx: i - 1 });
|
|
334
|
+
i--;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if (edits.length === 0)
|
|
338
|
+
return [];
|
|
339
|
+
// Find indices of changed lines
|
|
340
|
+
const changedAt = new Set();
|
|
341
|
+
for (let k = 0; k < edits.length; k++) {
|
|
342
|
+
if (edits[k].op !== ' ')
|
|
343
|
+
changedAt.add(k);
|
|
344
|
+
}
|
|
345
|
+
if (changedAt.size === 0)
|
|
346
|
+
return []; // identical
|
|
347
|
+
// Build context windows — include context lines around changes
|
|
348
|
+
const included = new Set();
|
|
349
|
+
for (const idx of changedAt) {
|
|
350
|
+
for (let d = -context; d <= context; d++) {
|
|
351
|
+
const pos = idx + d;
|
|
352
|
+
if (pos >= 0 && pos < edits.length)
|
|
353
|
+
included.add(pos);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
const output = [];
|
|
357
|
+
let prevIncluded = false;
|
|
358
|
+
for (let k = 0; k < edits.length; k++) {
|
|
359
|
+
if (included.has(k)) {
|
|
360
|
+
if (!prevIncluded && k > 0) {
|
|
361
|
+
output.push('...');
|
|
362
|
+
}
|
|
363
|
+
output.push(`${edits[k].op}${edits[k].line}`);
|
|
364
|
+
prevIncluded = true;
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
prevIncluded = false;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return output;
|
|
371
|
+
}
|
|
372
|
+
/** Count hook-related diff lines in the edit script (lines with changes touching hooks). */
|
|
373
|
+
function countHookChanges(diffLines, localAlwaysApply, chainAlwaysApply) {
|
|
374
|
+
const HOOK_KEYWORDS = /hook|settings\.json|alwaysApply/i;
|
|
375
|
+
let count = 0;
|
|
376
|
+
for (const line of diffLines) {
|
|
377
|
+
if ((line.startsWith('+') || line.startsWith('-')) && HOOK_KEYWORDS.test(line)) {
|
|
378
|
+
count++;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
// If alwaysApply changed between local and chain, count that as at least 1
|
|
382
|
+
if (count === 0 && localAlwaysApply !== chainAlwaysApply) {
|
|
383
|
+
count = 1;
|
|
384
|
+
}
|
|
385
|
+
return count;
|
|
386
|
+
}
|
|
387
|
+
// ---------------------------------------------------------------------------
|
|
388
|
+
// pb method ls
|
|
389
|
+
// ---------------------------------------------------------------------------
|
|
390
|
+
export async function runMethodList() {
|
|
391
|
+
await runCliCommand({
|
|
392
|
+
fn: async () => {
|
|
393
|
+
const root = projectRoot();
|
|
394
|
+
const sources = loadAllSources(root);
|
|
395
|
+
if (sources.length === 0) {
|
|
396
|
+
return { methods: [], total: 0 };
|
|
397
|
+
}
|
|
398
|
+
// Sort: rules first (alpha), then skills (alpha)
|
|
399
|
+
sources.sort((a, b) => {
|
|
400
|
+
if (a.type !== b.type)
|
|
401
|
+
return a.type === 'rule' ? -1 : 1;
|
|
402
|
+
return a.name.localeCompare(b.name);
|
|
403
|
+
});
|
|
404
|
+
// Batch Chain lookups in parallel (best-effort)
|
|
405
|
+
const chainResults = await Promise.allSettled(sources.map((s) => fetchChainMethod(s.name)));
|
|
406
|
+
const methods = sources.map((source, i) => {
|
|
407
|
+
const chainEntry = chainResults[i].status === 'fulfilled' ? chainResults[i].value : null;
|
|
408
|
+
const adapters = checkAdapters(root, source);
|
|
409
|
+
return {
|
|
410
|
+
name: source.name,
|
|
411
|
+
type: source.type,
|
|
412
|
+
version: chainEntry?.version != null ? String(chainEntry.version) : '-',
|
|
413
|
+
published: chainEntry !== null,
|
|
414
|
+
claude: adapters.claude === 'ok',
|
|
415
|
+
cursor: adapters.cursor === 'ok',
|
|
416
|
+
codex: adapters.codex === 'ok',
|
|
417
|
+
};
|
|
418
|
+
});
|
|
419
|
+
return { methods, total: methods.length };
|
|
420
|
+
},
|
|
421
|
+
formatPretty: (result) => formatMethodList(result),
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
// ---------------------------------------------------------------------------
|
|
425
|
+
// pb method show <name>
|
|
426
|
+
// ---------------------------------------------------------------------------
|
|
427
|
+
export async function runMethodShow(options) {
|
|
428
|
+
await runCliCommand({
|
|
429
|
+
fn: async () => {
|
|
430
|
+
const root = projectRoot();
|
|
431
|
+
const sources = loadAllSources(root);
|
|
432
|
+
const source = sources.find((s) => s.name === options.name);
|
|
433
|
+
if (!source) {
|
|
434
|
+
throw new CLIError(`Method '${options.name}' not found in .productbrain/skills/ or .productbrain/rules/.`, {
|
|
435
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
436
|
+
category: 'validation',
|
|
437
|
+
guidance: `Run 'pb method ls' to see available methods.`,
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
const [chainEntry, adapters] = await Promise.all([
|
|
441
|
+
fetchChainMethod(source.name),
|
|
442
|
+
Promise.resolve(checkAdapters(root, source)),
|
|
443
|
+
]);
|
|
444
|
+
return {
|
|
445
|
+
name: source.name,
|
|
446
|
+
type: source.type,
|
|
447
|
+
frontmatter: source.frontmatter,
|
|
448
|
+
chain: chainEntry,
|
|
449
|
+
adapters,
|
|
450
|
+
};
|
|
451
|
+
},
|
|
452
|
+
formatPretty: (result) => formatMethodDetail(result),
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
// ---------------------------------------------------------------------------
|
|
456
|
+
// pb method diff <name>
|
|
457
|
+
// ---------------------------------------------------------------------------
|
|
458
|
+
export async function runMethodDiff(options) {
|
|
459
|
+
await runCliCommand({
|
|
460
|
+
fn: async () => {
|
|
461
|
+
const root = projectRoot();
|
|
462
|
+
const sources = loadAllSources(root);
|
|
463
|
+
const source = sources.find((s) => s.name === options.name);
|
|
464
|
+
if (!source) {
|
|
465
|
+
throw new CLIError(`Method '${options.name}' not found in .productbrain/skills/ or .productbrain/rules/.`, {
|
|
466
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
467
|
+
category: 'validation',
|
|
468
|
+
guidance: `Run 'pb method ls' to see available methods.`,
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
const chainEntry = await fetchChainMethod(source.name);
|
|
472
|
+
if (!chainEntry || chainEntry.body === undefined) {
|
|
473
|
+
return {
|
|
474
|
+
name: source.name,
|
|
475
|
+
published: false,
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
const localBody = source.body.trim();
|
|
479
|
+
const chainBody = (chainEntry.body ?? '').trim();
|
|
480
|
+
const diffLines = computeUnifiedDiff(chainBody, localBody);
|
|
481
|
+
// Detect hook-related changes — read alwaysApply from stored frontmatter JSON
|
|
482
|
+
const chainAlwaysApply = chainEntry.frontmatter?.alwaysApply;
|
|
483
|
+
const hookChanges = countHookChanges(diffLines, source.frontmatter.alwaysApply, chainAlwaysApply);
|
|
484
|
+
const hasFanOut = hookChanges > 0;
|
|
485
|
+
return {
|
|
486
|
+
name: source.name,
|
|
487
|
+
published: true,
|
|
488
|
+
diffLines,
|
|
489
|
+
hookChanges,
|
|
490
|
+
hasFanOut,
|
|
491
|
+
};
|
|
492
|
+
},
|
|
493
|
+
formatPretty: (result) => formatMethodDiff(result),
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
// ---------------------------------------------------------------------------
|
|
497
|
+
// pb method publish <name>
|
|
498
|
+
// ---------------------------------------------------------------------------
|
|
499
|
+
export async function runMethodPublish(options) {
|
|
500
|
+
await runCliCommand({
|
|
501
|
+
fn: async () => {
|
|
502
|
+
// 1. Require active session — publish is a write operation (DEC-9, BR-8)
|
|
503
|
+
const session = readSession();
|
|
504
|
+
if (!session) {
|
|
505
|
+
throw new CLIError('No active session.', {
|
|
506
|
+
code: ErrorCode.SESSION_REQUIRED,
|
|
507
|
+
category: 'session',
|
|
508
|
+
// DEC-9
|
|
509
|
+
guidance: 'Run `pb session start` first. Write access requires a tracked session.',
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
// 2. Find local source file
|
|
513
|
+
const root = projectRoot();
|
|
514
|
+
const sources = loadAllSources(root);
|
|
515
|
+
const source = sources.find((s) => s.name === options.name);
|
|
516
|
+
if (!source) {
|
|
517
|
+
throw new CLIError(`Method '${options.name}' not found in .productbrain/skills/ or .productbrain/rules/.`, {
|
|
518
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
519
|
+
category: 'validation',
|
|
520
|
+
guidance: `Run 'pb method ls' to see available methods.`,
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
// 3. Compute SHA-256 hash of the local body (everything after frontmatter)
|
|
524
|
+
const localBody = source.body.trim();
|
|
525
|
+
const manifestHash = createHash('sha256').update(localBody, 'utf8').digest('hex');
|
|
526
|
+
// 4. Query Chain for existing published entry
|
|
527
|
+
const existing = await fetchChainMethod(source.name);
|
|
528
|
+
// 5. D4 check — refuse on no-op (unless --force)
|
|
529
|
+
if (!options.force && existing && existing.manifestHash === manifestHash) {
|
|
530
|
+
const existingVersion = typeof existing.version === 'string'
|
|
531
|
+
? parseInt(existing.version, 10)
|
|
532
|
+
: existing.version ?? 1;
|
|
533
|
+
throw new CLIError(`No changes to publish. Local body matches last-published version (v${existingVersion}). Use --force to override.`, {
|
|
534
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
535
|
+
category: 'validation',
|
|
536
|
+
guidance: `Run 'pb method diff ${options.name}' to inspect differences.`,
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
// 6. Compute new version
|
|
540
|
+
const existingVersion = existing
|
|
541
|
+
? (typeof existing.version === 'string'
|
|
542
|
+
? parseInt(existing.version, 10)
|
|
543
|
+
: existing.version ?? 0)
|
|
544
|
+
: 0;
|
|
545
|
+
const newVersion = existingVersion + 1;
|
|
546
|
+
// 7. Serialize frontmatter for storage
|
|
547
|
+
const fm = source.frontmatter;
|
|
548
|
+
const frontmatterJson = JSON.stringify({
|
|
549
|
+
alwaysApply: fm.alwaysApply,
|
|
550
|
+
globs: fm.globs,
|
|
551
|
+
description: fm.description,
|
|
552
|
+
});
|
|
553
|
+
const publishedAt = new Date().toISOString();
|
|
554
|
+
const publishedBy = session.sessionId;
|
|
555
|
+
const entryData = {
|
|
556
|
+
name: source.name,
|
|
557
|
+
version: String(newVersion),
|
|
558
|
+
sourceType: source.type,
|
|
559
|
+
body: localBody,
|
|
560
|
+
frontmatter: frontmatterJson,
|
|
561
|
+
publishedAt,
|
|
562
|
+
publishedBy,
|
|
563
|
+
manifestHash,
|
|
564
|
+
};
|
|
565
|
+
// 8. Write to Chain — create or update
|
|
566
|
+
let created;
|
|
567
|
+
if (!existing || !existing._id) {
|
|
568
|
+
// No existing entry — createEntry
|
|
569
|
+
await kernelCallWithSession('chain.createEntry', {
|
|
570
|
+
collectionSlug: 'methods',
|
|
571
|
+
name: source.name,
|
|
572
|
+
// `pb method publish` is an explicit publish action — bypasses governance-mode
|
|
573
|
+
// resolution and commits directly (DEC-896 intentional, mirrors UI publish at
|
|
574
|
+
// src/routes/api/brain/capture/+server.ts).
|
|
575
|
+
status: 'active',
|
|
576
|
+
data: entryData,
|
|
577
|
+
sessionId: session.sessionId,
|
|
578
|
+
createdBy: `agent:${session.sessionId}`,
|
|
579
|
+
});
|
|
580
|
+
created = true;
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
// Existing entry — updateEntry (LWW: last-write-wins)
|
|
584
|
+
const updateResult = await kernelCallWithSession('chain.updateEntry', {
|
|
585
|
+
entryId: existing._id,
|
|
586
|
+
data: entryData,
|
|
587
|
+
changedBy: `agent:${session.sessionId}`,
|
|
588
|
+
changeNote: `Publish v${newVersion} via pb method publish`,
|
|
589
|
+
});
|
|
590
|
+
// WP-465 slice ⑤ (Option B): a coherency refusal RETURNS a structured payload — the
|
|
591
|
+
// entry is unchanged, so report a refusal instead of a successful publish.
|
|
592
|
+
if (updateResult?.outcome === 'refused') {
|
|
593
|
+
throw new CLIError(updateResult.refusal?.reason ?? `Publish of '${source.name}' was refused by the coherency gate.`, {
|
|
594
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
595
|
+
category: 'validation',
|
|
596
|
+
guidance: 'Link the entry to the strategic spine and retry, or resolve the coherency challenge before publishing.',
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
created = false;
|
|
600
|
+
}
|
|
601
|
+
return {
|
|
602
|
+
name: source.name,
|
|
603
|
+
version: newVersion,
|
|
604
|
+
manifestHash,
|
|
605
|
+
created,
|
|
606
|
+
previousVersion: newVersion > 1 ? existingVersion : undefined,
|
|
607
|
+
};
|
|
608
|
+
},
|
|
609
|
+
formatPretty: (result) => formatMethodPublish(result),
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
// ---------------------------------------------------------------------------
|
|
613
|
+
// Formatters
|
|
614
|
+
// ---------------------------------------------------------------------------
|
|
615
|
+
function statusIcon(published) {
|
|
616
|
+
return published ? 'yes' : 'no ';
|
|
617
|
+
}
|
|
618
|
+
function adapterIcon(ok) {
|
|
619
|
+
return ok ? '\u2713' : '-';
|
|
620
|
+
}
|
|
621
|
+
function adapterStatusLabel(status) {
|
|
622
|
+
if (status === 'ok')
|
|
623
|
+
return 'ok';
|
|
624
|
+
if (status === 'forked')
|
|
625
|
+
return 'forked';
|
|
626
|
+
return 'missing';
|
|
627
|
+
}
|
|
628
|
+
function formatMethodList(result) {
|
|
629
|
+
if (result.total === 0) {
|
|
630
|
+
return 'No methods found. Expected .productbrain/skills/ and .productbrain/rules/ directories.';
|
|
631
|
+
}
|
|
632
|
+
const lines = [];
|
|
633
|
+
lines.push(`Methods (${result.total}):`);
|
|
634
|
+
lines.push('');
|
|
635
|
+
const maxName = Math.max(...result.methods.map((m) => m.name.length), 4);
|
|
636
|
+
const maxVersion = Math.max(...result.methods.map((m) => m.version.length), 7);
|
|
637
|
+
const header = [
|
|
638
|
+
'Name'.padEnd(maxName),
|
|
639
|
+
'Type '.padEnd(6),
|
|
640
|
+
'Version'.padEnd(maxVersion),
|
|
641
|
+
'Published',
|
|
642
|
+
'Claude',
|
|
643
|
+
'Cursor',
|
|
644
|
+
'Codex',
|
|
645
|
+
].join(' ');
|
|
646
|
+
lines.push(` ${header}`);
|
|
647
|
+
lines.push(` ${'-'.repeat(header.length)}`);
|
|
648
|
+
// Group by type
|
|
649
|
+
const rules = result.methods.filter((m) => m.type === 'rule');
|
|
650
|
+
const skills = result.methods.filter((m) => m.type === 'skill');
|
|
651
|
+
const renderRow = (m) => {
|
|
652
|
+
return ' ' + [
|
|
653
|
+
m.name.padEnd(maxName),
|
|
654
|
+
m.type.padEnd(6),
|
|
655
|
+
m.version.padEnd(maxVersion),
|
|
656
|
+
statusIcon(m.published).padEnd(10),
|
|
657
|
+
adapterIcon(m.claude).padEnd(7),
|
|
658
|
+
adapterIcon(m.cursor).padEnd(7),
|
|
659
|
+
adapterIcon(m.codex),
|
|
660
|
+
].join(' ');
|
|
661
|
+
};
|
|
662
|
+
if (rules.length > 0) {
|
|
663
|
+
lines.push('');
|
|
664
|
+
lines.push(' Rules:');
|
|
665
|
+
for (const m of rules) {
|
|
666
|
+
lines.push(renderRow(m));
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
if (skills.length > 0) {
|
|
670
|
+
lines.push('');
|
|
671
|
+
lines.push(' Skills:');
|
|
672
|
+
for (const m of skills) {
|
|
673
|
+
lines.push(renderRow(m));
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
lines.push('');
|
|
677
|
+
lines.push(` ${rules.length} rules, ${skills.length} skills`);
|
|
678
|
+
lines.push(' Run `pb method show <name>` for fork status and Chain details.');
|
|
679
|
+
return lines.join('\n');
|
|
680
|
+
}
|
|
681
|
+
function formatMethodDetail(result) {
|
|
682
|
+
const lines = [];
|
|
683
|
+
const { name, type, frontmatter, chain, adapters } = result;
|
|
684
|
+
lines.push('');
|
|
685
|
+
lines.push(`Method: ${name}`);
|
|
686
|
+
lines.push(`Type: ${type}`);
|
|
687
|
+
if (frontmatter.description) {
|
|
688
|
+
lines.push(`Desc: ${frontmatter.description}`);
|
|
689
|
+
}
|
|
690
|
+
if (frontmatter.alwaysApply !== undefined) {
|
|
691
|
+
lines.push(`Always: ${frontmatter.alwaysApply}`);
|
|
692
|
+
}
|
|
693
|
+
if (frontmatter.globs) {
|
|
694
|
+
lines.push(`Globs: ${frontmatter.globs}`);
|
|
695
|
+
}
|
|
696
|
+
if (frontmatter.level) {
|
|
697
|
+
lines.push(`Level: ${frontmatter.level}`);
|
|
698
|
+
}
|
|
699
|
+
lines.push('');
|
|
700
|
+
if (chain) {
|
|
701
|
+
lines.push('Published:');
|
|
702
|
+
if (chain.version)
|
|
703
|
+
lines.push(` Version: ${chain.version}`);
|
|
704
|
+
if (chain.publishedAt)
|
|
705
|
+
lines.push(` Published: ${chain.publishedAt}`);
|
|
706
|
+
if (chain.publishedBy)
|
|
707
|
+
lines.push(` By: ${chain.publishedBy}`);
|
|
708
|
+
if (chain.manifestHash)
|
|
709
|
+
lines.push(` Hash: ${chain.manifestHash}`);
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
lines.push('Published: no (not in Chain methods collection)');
|
|
713
|
+
}
|
|
714
|
+
lines.push('');
|
|
715
|
+
lines.push('Adapter status:');
|
|
716
|
+
lines.push(` claude: ${adapterStatusLabel(adapters.claude)}`);
|
|
717
|
+
lines.push(` cursor: ${adapterStatusLabel(adapters.cursor)}`);
|
|
718
|
+
lines.push(` codex: ${adapterStatusLabel(adapters.codex)}`);
|
|
719
|
+
lines.push(` copilot: ${adapterStatusLabel(adapters.copilot)}`);
|
|
720
|
+
const forked = Object.entries(adapters).filter(([, v]) => v === 'forked').map(([k]) => k);
|
|
721
|
+
const missing = Object.entries(adapters).filter(([, v]) => v === 'missing').map(([k]) => k);
|
|
722
|
+
if (forked.length > 0 || missing.length > 0) {
|
|
723
|
+
lines.push('');
|
|
724
|
+
if (forked.length > 0) {
|
|
725
|
+
lines.push(` ! Forked adapters (out of sync): ${forked.join(', ')}`);
|
|
726
|
+
lines.push(' Run `pb handshake` to regenerate adapter files.');
|
|
727
|
+
}
|
|
728
|
+
if (missing.length > 0) {
|
|
729
|
+
lines.push(` - Missing adapters: ${missing.join(', ')}`);
|
|
730
|
+
lines.push(' Run `pb handshake` to generate adapter files.');
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
734
|
+
lines.push('');
|
|
735
|
+
lines.push(' All adapters in sync.');
|
|
736
|
+
}
|
|
737
|
+
return lines.join('\n');
|
|
738
|
+
}
|
|
739
|
+
function formatMethodPublish(result) {
|
|
740
|
+
const lines = [];
|
|
741
|
+
lines.push('');
|
|
742
|
+
lines.push(`Published: ${result.name} v${result.version}`);
|
|
743
|
+
lines.push(`Action: ${result.created ? 'created' : 'updated'}`);
|
|
744
|
+
lines.push(`Hash: ${result.manifestHash.slice(0, 16)}...`);
|
|
745
|
+
if (result.previousVersion !== undefined) {
|
|
746
|
+
lines.push('');
|
|
747
|
+
lines.push(`rollback with: pb method publish ${result.name} --version ${result.previousVersion}`);
|
|
748
|
+
}
|
|
749
|
+
lines.push('');
|
|
750
|
+
return lines.join('\n');
|
|
751
|
+
}
|
|
752
|
+
function formatMethodDiff(result) {
|
|
753
|
+
const lines = [];
|
|
754
|
+
if (!result.published) {
|
|
755
|
+
lines.push('');
|
|
756
|
+
lines.push(`Not published yet. Run \`pb method publish ${result.name}\` to publish.`);
|
|
757
|
+
lines.push('');
|
|
758
|
+
return lines.join('\n');
|
|
759
|
+
}
|
|
760
|
+
const diffLines = result.diffLines ?? [];
|
|
761
|
+
if (diffLines.length === 0) {
|
|
762
|
+
lines.push('');
|
|
763
|
+
lines.push(`Method: ${result.name}`);
|
|
764
|
+
lines.push('');
|
|
765
|
+
lines.push(' No changes. Local matches published version.');
|
|
766
|
+
lines.push('');
|
|
767
|
+
return lines.join('\n');
|
|
768
|
+
}
|
|
769
|
+
lines.push('');
|
|
770
|
+
lines.push(`Method: ${result.name}`);
|
|
771
|
+
lines.push('--- chain (published)');
|
|
772
|
+
lines.push('+++ local');
|
|
773
|
+
lines.push('');
|
|
774
|
+
for (const dl of diffLines) {
|
|
775
|
+
if (dl === '...') {
|
|
776
|
+
lines.push(' ...');
|
|
777
|
+
}
|
|
778
|
+
else if (dl.startsWith('+')) {
|
|
779
|
+
lines.push(`+ ${dl.slice(1)}`);
|
|
780
|
+
}
|
|
781
|
+
else if (dl.startsWith('-')) {
|
|
782
|
+
lines.push(`- ${dl.slice(1)}`);
|
|
783
|
+
}
|
|
784
|
+
else {
|
|
785
|
+
lines.push(` ${dl.slice(1)}`);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
if (result.hasFanOut) {
|
|
789
|
+
const n = result.hookChanges ?? 0;
|
|
790
|
+
lines.push('');
|
|
791
|
+
lines.push(`hooks: +${n} (claude-native, +fan-out to cursor,copilot via .claude/settings.json per INS-740)`);
|
|
792
|
+
}
|
|
793
|
+
lines.push('');
|
|
794
|
+
return lines.join('\n');
|
|
795
|
+
}
|
|
796
|
+
//# sourceMappingURL=method.js.map
|