@productbrain/cli 0.1.0-beta.5 → 0.1.0-beta.50
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 +98 -30
- 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.d.ts +2 -0
- package/dist/__tests__/audit.test.d.ts.map +1 -0
- package/dist/__tests__/audit.test.js +394 -0
- package/dist/__tests__/audit.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__/capture.test.d.ts +2 -0
- package/dist/__tests__/capture.test.d.ts.map +1 -0
- package/dist/__tests__/capture.test.js +156 -0
- package/dist/__tests__/capture.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 +166 -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 +141 -0
- package/dist/__tests__/constants.test.js.map +1 -0
- package/dist/__tests__/constellation.test.d.ts +2 -0
- package/dist/__tests__/constellation.test.d.ts.map +1 -0
- package/dist/__tests__/constellation.test.js +254 -0
- package/dist/__tests__/constellation.test.js.map +1 -0
- package/dist/__tests__/context-strategy.test.d.ts +2 -0
- package/dist/__tests__/context-strategy.test.d.ts.map +1 -0
- package/dist/__tests__/context-strategy.test.js +79 -0
- package/dist/__tests__/context-strategy.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 +117 -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.d.ts +2 -0
- package/dist/__tests__/fields.test.d.ts.map +1 -0
- package/dist/__tests__/fields.test.js +238 -0
- package/dist/__tests__/fields.test.js.map +1 -0
- 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.test.d.ts +2 -0
- package/dist/__tests__/handshake.test.d.ts.map +1 -0
- package/dist/__tests__/handshake.test.js +196 -0
- package/dist/__tests__/handshake.test.js.map +1 -0
- package/dist/__tests__/ingest.test.js +98 -0
- 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__/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 +143 -0
- package/dist/__tests__/orient.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 +168 -0
- package/dist/__tests__/profiles.test.js.map +1 -0
- package/dist/__tests__/promote.test.d.ts +2 -0
- package/dist/__tests__/promote.test.d.ts.map +1 -0
- package/dist/__tests__/promote.test.js +161 -0
- package/dist/__tests__/promote.test.js.map +1 -0
- 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__/proposals.test.d.ts +2 -0
- package/dist/__tests__/proposals.test.d.ts.map +1 -0
- package/dist/__tests__/proposals.test.js +167 -0
- package/dist/__tests__/proposals.test.js.map +1 -0
- package/dist/__tests__/relate.test.d.ts +2 -0
- package/dist/__tests__/relate.test.d.ts.map +1 -0
- package/dist/__tests__/relate.test.js +103 -0
- package/dist/__tests__/relate.test.js.map +1 -0
- package/dist/__tests__/repo-detect.test.d.ts +2 -0
- package/dist/__tests__/repo-detect.test.d.ts.map +1 -0
- package/dist/__tests__/repo-detect.test.js +215 -0
- package/dist/__tests__/repo-detect.test.js.map +1 -0
- package/dist/__tests__/runner.test.d.ts +2 -0
- package/dist/__tests__/runner.test.d.ts.map +1 -0
- package/dist/__tests__/runner.test.js +219 -0
- package/dist/__tests__/runner.test.js.map +1 -0
- package/dist/__tests__/session-touch.test.d.ts +2 -0
- package/dist/__tests__/session-touch.test.d.ts.map +1 -0
- package/dist/__tests__/session-touch.test.js +134 -0
- package/dist/__tests__/session-touch.test.js.map +1 -0
- package/dist/__tests__/session.test.d.ts +2 -0
- package/dist/__tests__/session.test.d.ts.map +1 -0
- package/dist/__tests__/session.test.js +46 -0
- package/dist/__tests__/session.test.js.map +1 -0
- package/dist/__tests__/setup.test.d.ts +2 -0
- package/dist/__tests__/setup.test.d.ts.map +1 -0
- package/dist/__tests__/setup.test.js +141 -0
- package/dist/__tests__/setup.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__/strip.test.d.ts +2 -0
- package/dist/__tests__/strip.test.d.ts.map +1 -0
- package/dist/__tests__/strip.test.js +136 -0
- package/dist/__tests__/strip.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__/update.test.d.ts +2 -0
- package/dist/__tests__/update.test.d.ts.map +1 -0
- package/dist/__tests__/update.test.js +228 -0
- package/dist/__tests__/update.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 +308 -0
- package/dist/__tests__/workspace.test.js.map +1 -0
- package/dist/commands/accept.d.ts +18 -0
- package/dist/commands/accept.d.ts.map +1 -0
- package/dist/commands/accept.js +76 -0
- package/dist/commands/accept.js.map +1 -0
- package/dist/commands/admin/index.d.ts +17 -0
- package/dist/commands/admin/index.d.ts.map +1 -0
- package/dist/commands/admin/index.js +95 -0
- package/dist/commands/admin/index.js.map +1 -0
- package/dist/commands/admin/inspect.d.ts +12 -0
- package/dist/commands/admin/inspect.d.ts.map +1 -0
- package/dist/commands/admin/inspect.js +506 -0
- package/dist/commands/admin/inspect.js.map +1 -0
- package/dist/commands/admin/inspect.test.d.ts +5 -0
- package/dist/commands/admin/inspect.test.d.ts.map +1 -0
- package/dist/commands/admin/inspect.test.js +40 -0
- package/dist/commands/admin/inspect.test.js.map +1 -0
- package/dist/commands/admin/seed.d.ts +32 -0
- package/dist/commands/admin/seed.d.ts.map +1 -0
- package/dist/commands/admin/seed.js +527 -0
- package/dist/commands/admin/seed.js.map +1 -0
- package/dist/commands/admin/seed.test.d.ts +6 -0
- package/dist/commands/admin/seed.test.d.ts.map +1 -0
- package/dist/commands/admin/seed.test.js +65 -0
- package/dist/commands/admin/seed.test.js.map +1 -0
- package/dist/commands/audit.d.ts +25 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +188 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/brand-pack.d.ts +2 -0
- package/dist/commands/brand-pack.d.ts.map +1 -0
- package/dist/commands/brand-pack.js +25 -0
- package/dist/commands/brand-pack.js.map +1 -0
- package/dist/commands/brief.d.ts +28 -0
- package/dist/commands/brief.d.ts.map +1 -0
- package/dist/commands/brief.js +75 -0
- package/dist/commands/brief.js.map +1 -0
- package/dist/commands/capture.d.ts +25 -0
- package/dist/commands/capture.d.ts.map +1 -0
- package/dist/commands/capture.js +232 -0
- package/dist/commands/capture.js.map +1 -0
- package/dist/commands/chain-walk.d.ts +14 -0
- package/dist/commands/chain-walk.d.ts.map +1 -0
- package/dist/commands/chain-walk.js +38 -0
- package/dist/commands/chain-walk.js.map +1 -0
- package/dist/commands/changes.d.ts +11 -0
- package/dist/commands/changes.d.ts.map +1 -0
- package/dist/commands/changes.js +46 -0
- package/dist/commands/changes.js.map +1 -0
- package/dist/commands/codex-prep.d.ts +12 -0
- package/dist/commands/codex-prep.d.ts.map +1 -0
- package/dist/commands/codex-prep.js +122 -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-integration.test.d.ts +7 -0
- package/dist/commands/connect-integration.test.d.ts.map +1 -0
- package/dist/commands/connect-integration.test.js +200 -0
- package/dist/commands/connect-integration.test.js.map +1 -0
- package/dist/commands/connect.d.ts +21 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +279 -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 +230 -0
- package/dist/commands/connect.test.js.map +1 -0
- package/dist/commands/constellation.d.ts +11 -0
- package/dist/commands/constellation.d.ts.map +1 -0
- package/dist/commands/constellation.js +33 -0
- package/dist/commands/constellation.js.map +1 -0
- package/dist/commands/context.d.ts +2 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +20 -9
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/cross-cut.d.ts +11 -0
- package/dist/commands/cross-cut.d.ts.map +1 -0
- package/dist/commands/cross-cut.js +23 -0
- package/dist/commands/cross-cut.js.map +1 -0
- package/dist/commands/doctor.d.ts +18 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +231 -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 +311 -0
- package/dist/commands/doctor.test.js.map +1 -0
- package/dist/commands/fields.d.ts +9 -0
- package/dist/commands/fields.d.ts.map +1 -0
- package/dist/commands/fields.js +30 -0
- package/dist/commands/fields.js.map +1 -0
- package/dist/commands/get.d.ts +8 -1
- package/dist/commands/get.d.ts.map +1 -1
- package/dist/commands/get.js +60 -7
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/handshake.d.ts +28 -0
- package/dist/commands/handshake.d.ts.map +1 -0
- package/dist/commands/handshake.js +617 -0
- package/dist/commands/handshake.js.map +1 -0
- package/dist/commands/ingest.d.ts +8 -2
- package/dist/commands/ingest.d.ts.map +1 -1
- package/dist/commands/ingest.js +148 -25
- 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 +117 -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 +99 -37
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/orient.d.ts +103 -1
- package/dist/commands/orient.d.ts.map +1 -1
- package/dist/commands/orient.js +24 -8
- package/dist/commands/orient.js.map +1 -1
- package/dist/commands/profile.d.ts +24 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +82 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/promote.d.ts +12 -0
- package/dist/commands/promote.d.ts.map +1 -0
- package/dist/commands/promote.js +90 -0
- package/dist/commands/promote.js.map +1 -0
- package/dist/commands/proposals.d.ts +9 -0
- package/dist/commands/proposals.d.ts.map +1 -0
- package/dist/commands/proposals.js +24 -0
- package/dist/commands/proposals.js.map +1 -0
- package/dist/commands/reject.d.ts +14 -0
- package/dist/commands/reject.d.ts.map +1 -0
- package/dist/commands/reject.js +43 -0
- package/dist/commands/reject.js.map +1 -0
- package/dist/commands/relate.d.ts +16 -0
- package/dist/commands/relate.d.ts.map +1 -0
- package/dist/commands/relate.js +98 -0
- package/dist/commands/relate.js.map +1 -0
- package/dist/commands/search.d.ts +1 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +5 -3
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/session.d.ts +20 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +144 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/setup.d.ts +15 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +168 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/update.d.ts +17 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +178 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/verify.d.ts +13 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +49 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/commands/workspace.d.ts +41 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +239 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/formatters/audit.d.ts +46 -0
- package/dist/formatters/audit.d.ts.map +1 -0
- package/dist/formatters/audit.js +81 -0
- package/dist/formatters/audit.js.map +1 -0
- package/dist/formatters/brief.d.ts +112 -0
- package/dist/formatters/brief.d.ts.map +1 -0
- package/dist/formatters/brief.js +179 -0
- package/dist/formatters/brief.js.map +1 -0
- package/dist/formatters/capture.d.ts +48 -0
- package/dist/formatters/capture.d.ts.map +1 -0
- package/dist/formatters/capture.js +77 -0
- package/dist/formatters/capture.js.map +1 -0
- package/dist/formatters/chain-walk.d.ts +33 -0
- package/dist/formatters/chain-walk.d.ts.map +1 -0
- package/dist/formatters/chain-walk.js +54 -0
- package/dist/formatters/chain-walk.js.map +1 -0
- package/dist/formatters/changes.d.ts +25 -0
- package/dist/formatters/changes.d.ts.map +1 -0
- package/dist/formatters/changes.js +60 -0
- package/dist/formatters/changes.js.map +1 -0
- package/dist/formatters/collections.d.ts +40 -0
- package/dist/formatters/collections.d.ts.map +1 -0
- package/dist/formatters/collections.js +93 -0
- package/dist/formatters/collections.js.map +1 -0
- package/dist/formatters/constellation.d.ts +34 -0
- package/dist/formatters/constellation.d.ts.map +1 -0
- package/dist/formatters/constellation.js +38 -0
- package/dist/formatters/constellation.js.map +1 -0
- package/dist/formatters/cross-cut.d.ts +21 -0
- package/dist/formatters/cross-cut.d.ts.map +1 -0
- package/dist/formatters/cross-cut.js +32 -0
- package/dist/formatters/cross-cut.js.map +1 -0
- package/dist/formatters/entry.d.ts +11 -4
- package/dist/formatters/entry.d.ts.map +1 -1
- package/dist/formatters/entry.js +24 -8
- package/dist/formatters/entry.js.map +1 -1
- package/dist/formatters/fields.d.ts +32 -0
- package/dist/formatters/fields.d.ts.map +1 -0
- package/dist/formatters/fields.js +49 -0
- package/dist/formatters/fields.js.map +1 -0
- package/dist/formatters/handshake.d.ts +24 -0
- package/dist/formatters/handshake.d.ts.map +1 -0
- package/dist/formatters/handshake.js +69 -0
- package/dist/formatters/handshake.js.map +1 -0
- package/dist/formatters/orient.d.ts +100 -1
- package/dist/formatters/orient.d.ts.map +1 -1
- package/dist/formatters/orient.js +123 -17
- package/dist/formatters/orient.js.map +1 -1
- package/dist/formatters/promote.d.ts +30 -0
- package/dist/formatters/promote.d.ts.map +1 -0
- package/dist/formatters/promote.js +39 -0
- package/dist/formatters/promote.js.map +1 -0
- package/dist/formatters/proposals.d.ts +45 -0
- package/dist/formatters/proposals.d.ts.map +1 -0
- package/dist/formatters/proposals.js +62 -0
- package/dist/formatters/proposals.js.map +1 -0
- package/dist/formatters/relate.d.ts +14 -0
- package/dist/formatters/relate.d.ts.map +1 -0
- package/dist/formatters/relate.js +16 -0
- package/dist/formatters/relate.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 +11 -0
- package/dist/formatters/session.d.ts.map +1 -0
- package/dist/formatters/session.js +51 -0
- package/dist/formatters/session.js.map +1 -0
- package/dist/formatters/update.d.ts +17 -0
- package/dist/formatters/update.d.ts.map +1 -0
- package/dist/formatters/update.js +45 -0
- package/dist/formatters/update.js.map +1 -0
- package/dist/formatters/verify.d.ts +11 -0
- package/dist/formatters/verify.d.ts.map +1 -0
- package/dist/formatters/verify.js +11 -0
- package/dist/formatters/verify.js.map +1 -0
- package/dist/generators/__tests__/surface-profiles.test.d.ts +2 -0
- package/dist/generators/__tests__/surface-profiles.test.d.ts.map +1 -0
- package/dist/generators/__tests__/surface-profiles.test.js +89 -0
- package/dist/generators/__tests__/surface-profiles.test.js.map +1 -0
- package/dist/generators/adapters.d.ts +44 -0
- package/dist/generators/adapters.d.ts.map +1 -0
- package/dist/generators/adapters.js +290 -0
- package/dist/generators/adapters.js.map +1 -0
- 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 +153 -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 +237 -0
- package/dist/generators/archetypes.test.js.map +1 -0
- package/dist/generators/briefing-md.d.ts +8 -0
- package/dist/generators/briefing-md.d.ts.map +1 -0
- package/dist/generators/briefing-md.js +51 -0
- package/dist/generators/briefing-md.js.map +1 -0
- package/dist/generators/chain-classifier.d.ts +49 -0
- package/dist/generators/chain-classifier.d.ts.map +1 -0
- package/dist/generators/chain-classifier.js +180 -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 +257 -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 +144 -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 +179 -0
- package/dist/generators/chain-rules.test.js.map +1 -0
- package/dist/generators/context-md.d.ts +8 -0
- package/dist/generators/context-md.d.ts.map +1 -0
- package/dist/generators/context-md.js +134 -0
- package/dist/generators/context-md.js.map +1 -0
- 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/portable-knowledge.d.ts +143 -0
- package/dist/generators/portable-knowledge.d.ts.map +1 -0
- package/dist/generators/portable-knowledge.js +504 -0
- package/dist/generators/portable-knowledge.js.map +1 -0
- package/dist/generators/portable-knowledge.test.d.ts +2 -0
- package/dist/generators/portable-knowledge.test.d.ts.map +1 -0
- package/dist/generators/portable-knowledge.test.js +927 -0
- package/dist/generators/portable-knowledge.test.js.map +1 -0
- package/dist/generators/surface-profiles.d.ts +49 -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.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +637 -37
- 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/client.d.ts +61 -0
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +262 -12
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/config.d.ts +84 -4
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +318 -39
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/constants.d.ts +42 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +76 -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 +58 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +67 -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/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/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 +214 -0
- package/dist/lib/onboarding-path-b.js.map +1 -0
- package/dist/lib/onboarding-phases.d.ts +9 -0
- package/dist/lib/onboarding-phases.d.ts.map +1 -0
- package/dist/lib/onboarding-phases.js +120 -0
- package/dist/lib/onboarding-phases.js.map +1 -0
- package/dist/lib/onboarding-shared.d.ts +81 -0
- package/dist/lib/onboarding-shared.d.ts.map +1 -0
- package/dist/lib/onboarding-shared.js +190 -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 +39 -0
- package/dist/lib/profiles.d.ts.map +1 -0
- package/dist/lib/profiles.js +180 -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 +33 -0
- package/dist/lib/repo-detect.d.ts.map +1 -0
- package/dist/lib/repo-detect.js +83 -0
- package/dist/lib/repo-detect.js.map +1 -0
- package/dist/lib/runner.d.ts +33 -0
- package/dist/lib/runner.d.ts.map +1 -0
- package/dist/lib/runner.js +79 -0
- package/dist/lib/runner.js.map +1 -0
- package/dist/lib/session.d.ts +17 -0
- package/dist/lib/session.d.ts.map +1 -0
- package/dist/lib/session.js +43 -0
- package/dist/lib/session.js.map +1 -0
- 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/strip.d.ts +12 -0
- package/dist/lib/strip.d.ts.map +1 -0
- package/dist/lib/strip.js +41 -0
- package/dist/lib/strip.js.map +1 -0
- package/dist/lib/style.d.ts +94 -0
- package/dist/lib/style.d.ts.map +1 -0
- package/dist/lib/style.js +167 -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/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 +16 -0
- package/dist/lib/workspace-probe.d.ts.map +1 -0
- package/dist/lib/workspace-probe.js +33 -0
- package/dist/lib/workspace-probe.js.map +1 -0
- package/package.json +9 -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/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,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pb audit <BET-ID> [BET-ID...] — automated STD-113 hygiene checker.
|
|
3
|
+
* BET-182 Slice 2: CLI command + auto-fix.
|
|
4
|
+
*
|
|
5
|
+
* Calls chain.auditBet via MCP, formats result for TTY or JSON,
|
|
6
|
+
* and exits with code based on verdict:
|
|
7
|
+
* 0 = pass, 1 = fail, 2 = warn, 3 = error
|
|
8
|
+
*
|
|
9
|
+
* Flags:
|
|
10
|
+
* --phase shaping|handoff — override phase detection
|
|
11
|
+
* --gate gate-name — run only specified gate(s), repeatable
|
|
12
|
+
* --fix — auto-execute "exact" fixType fixes via pb update
|
|
13
|
+
* --verbose — show all gates including PASS detail
|
|
14
|
+
*
|
|
15
|
+
* Chain: BET-182, STD-113, STD-65 (structured output), STD-101
|
|
16
|
+
*/
|
|
17
|
+
export interface AuditOptions {
|
|
18
|
+
entryIds: string[];
|
|
19
|
+
phase?: 'shaping' | 'handoff';
|
|
20
|
+
gate?: string[];
|
|
21
|
+
fix?: boolean;
|
|
22
|
+
verbose?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function runAudit(options: AuditOptions): Promise<void>;
|
|
25
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAWH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAsJD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4CnE"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pb audit <BET-ID> [BET-ID...] — automated STD-113 hygiene checker.
|
|
3
|
+
* BET-182 Slice 2: CLI command + auto-fix.
|
|
4
|
+
*
|
|
5
|
+
* Calls chain.auditBet via MCP, formats result for TTY or JSON,
|
|
6
|
+
* and exits with code based on verdict:
|
|
7
|
+
* 0 = pass, 1 = fail, 2 = warn, 3 = error
|
|
8
|
+
*
|
|
9
|
+
* Flags:
|
|
10
|
+
* --phase shaping|handoff — override phase detection
|
|
11
|
+
* --gate gate-name — run only specified gate(s), repeatable
|
|
12
|
+
* --fix — auto-execute "exact" fixType fixes via pb update
|
|
13
|
+
* --verbose — show all gates including PASS detail
|
|
14
|
+
*
|
|
15
|
+
* Chain: BET-182, STD-113, STD-65 (structured output), STD-101
|
|
16
|
+
*/
|
|
17
|
+
import { getConfigOrGuide } from '../lib/config.js';
|
|
18
|
+
import { mcpCall, mcpCallWithSession } from '../lib/client.js';
|
|
19
|
+
import { isJsonMode } from '../lib/runner.js';
|
|
20
|
+
import { readSession } from '../lib/session.js';
|
|
21
|
+
import { stripConvexInternals } from '../lib/strip.js';
|
|
22
|
+
import { formatAudit, formatBatchSummary } from '../formatters/audit.js';
|
|
23
|
+
// Exit codes
|
|
24
|
+
const EXIT_PASS = 0;
|
|
25
|
+
const EXIT_FAIL = 1;
|
|
26
|
+
const EXIT_WARN = 2;
|
|
27
|
+
const EXIT_ERROR = 3;
|
|
28
|
+
function parseExactFixes(entryId, gates) {
|
|
29
|
+
const actions = [];
|
|
30
|
+
for (const gate of gates) {
|
|
31
|
+
if (gate.status !== 'fail' && gate.status !== 'warn')
|
|
32
|
+
continue;
|
|
33
|
+
if (gate.fixType !== 'exact' || !gate.fix)
|
|
34
|
+
continue;
|
|
35
|
+
// Parse "Set field '<key>' to '<value>'" pattern
|
|
36
|
+
const fieldMatch = gate.fix.match(/^Set field '([^']+)' to '([^']+)'$/);
|
|
37
|
+
if (fieldMatch) {
|
|
38
|
+
actions.push({
|
|
39
|
+
type: 'field',
|
|
40
|
+
entryId,
|
|
41
|
+
fieldKey: fieldMatch[1],
|
|
42
|
+
fieldValue: fieldMatch[2],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return actions;
|
|
47
|
+
}
|
|
48
|
+
async function executeFixActions(actions, json) {
|
|
49
|
+
let applied = 0;
|
|
50
|
+
for (const action of actions) {
|
|
51
|
+
if (action.type === 'field') {
|
|
52
|
+
try {
|
|
53
|
+
await mcpCallWithSession('chain.updateEntry', {
|
|
54
|
+
entryId: action.entryId,
|
|
55
|
+
data: { [action.fieldKey]: action.fieldValue },
|
|
56
|
+
changeNote: `Auto-fix via pb audit: set ${action.fieldKey}`,
|
|
57
|
+
});
|
|
58
|
+
applied++;
|
|
59
|
+
if (!json) {
|
|
60
|
+
process.stderr.write(` Fixed: ${action.fieldKey} = ${action.fieldValue}\n`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
65
|
+
if (!json) {
|
|
66
|
+
process.stderr.write(` Fix failed (${action.fieldKey}): ${msg}\n`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return applied;
|
|
72
|
+
}
|
|
73
|
+
// ─── Single audit ───────────────────────────────────────────────────────────
|
|
74
|
+
async function auditOne(entryId, options) {
|
|
75
|
+
const { phase, gate: gateFilter, fix, verbose } = options;
|
|
76
|
+
const json = isJsonMode();
|
|
77
|
+
// Build MCP args
|
|
78
|
+
const args = { entryId };
|
|
79
|
+
if (phase)
|
|
80
|
+
args.phase = phase;
|
|
81
|
+
let result;
|
|
82
|
+
try {
|
|
83
|
+
result = await mcpCall('chain.auditBet', args);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
87
|
+
if (json) {
|
|
88
|
+
process.stderr.write(JSON.stringify({ error: msg, entryId }) + '\n');
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
process.stderr.write(`Error auditing ${entryId}: ${msg}\n`);
|
|
92
|
+
}
|
|
93
|
+
return { result: null, exitCode: EXIT_ERROR };
|
|
94
|
+
}
|
|
95
|
+
// --fix: auto-execute exact fixes, then rerun once
|
|
96
|
+
if (fix) {
|
|
97
|
+
const session = readSession();
|
|
98
|
+
if (!session) {
|
|
99
|
+
if (!json) {
|
|
100
|
+
process.stderr.write('--fix requires an active session. Run `pb session start` first.\n');
|
|
101
|
+
}
|
|
102
|
+
// Still show the result, just skip fixing
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
const exactFixes = parseExactFixes(entryId, result.gates);
|
|
106
|
+
if (exactFixes.length > 0) {
|
|
107
|
+
if (!json)
|
|
108
|
+
process.stderr.write(`\nAuto-fixing ${exactFixes.length} issue(s) on ${entryId}...\n`);
|
|
109
|
+
const applied = await executeFixActions(exactFixes, json);
|
|
110
|
+
if (applied > 0) {
|
|
111
|
+
// Rerun audit once after fixes
|
|
112
|
+
if (!json)
|
|
113
|
+
process.stderr.write(`\nRe-auditing ${entryId} after ${applied} fix(es)...\n`);
|
|
114
|
+
try {
|
|
115
|
+
result = await mcpCall('chain.auditBet', args);
|
|
116
|
+
}
|
|
117
|
+
catch (err) {
|
|
118
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
119
|
+
if (!json)
|
|
120
|
+
process.stderr.write(`Re-audit failed: ${msg}\n`);
|
|
121
|
+
// Use original result
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Output
|
|
128
|
+
if (json) {
|
|
129
|
+
// Apply gate filter for JSON output too
|
|
130
|
+
const output = { ...stripConvexInternals(result) };
|
|
131
|
+
if (gateFilter && gateFilter.length > 0) {
|
|
132
|
+
output.gates = result.gates.filter((g) => gateFilter.includes(g.gate));
|
|
133
|
+
}
|
|
134
|
+
process.stdout.write(JSON.stringify(output) + '\n');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
process.stdout.write(formatAudit(result, { verbose, gateFilter }) + '\n');
|
|
138
|
+
}
|
|
139
|
+
// Map verdict to exit code
|
|
140
|
+
const exitCode = result.verdict === 'pass' ? EXIT_PASS
|
|
141
|
+
: result.verdict === 'fail' ? EXIT_FAIL
|
|
142
|
+
: EXIT_WARN;
|
|
143
|
+
return { result, exitCode };
|
|
144
|
+
}
|
|
145
|
+
// ─── Entry point ────────────────────────────────────────────────────────────
|
|
146
|
+
export async function runAudit(options) {
|
|
147
|
+
const config = await getConfigOrGuide(() => runAudit(options));
|
|
148
|
+
if (!config)
|
|
149
|
+
return;
|
|
150
|
+
const { entryIds, ...rest } = options;
|
|
151
|
+
if (entryIds.length === 1) {
|
|
152
|
+
// Single audit
|
|
153
|
+
const { exitCode } = await auditOne(entryIds[0], rest);
|
|
154
|
+
process.exit(exitCode);
|
|
155
|
+
}
|
|
156
|
+
// Batch mode: audit multiple bets sequentially
|
|
157
|
+
const json = isJsonMode();
|
|
158
|
+
const results = [];
|
|
159
|
+
let worstExit = EXIT_PASS;
|
|
160
|
+
for (const entryId of entryIds) {
|
|
161
|
+
const { result, exitCode } = await auditOne(entryId, rest);
|
|
162
|
+
if (result)
|
|
163
|
+
results.push(result);
|
|
164
|
+
if (exitCode > worstExit)
|
|
165
|
+
worstExit = exitCode;
|
|
166
|
+
// Separator between entries in TTY mode
|
|
167
|
+
if (!json && entryIds.indexOf(entryId) < entryIds.length - 1) {
|
|
168
|
+
process.stdout.write('\n---\n\n');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Batch summary
|
|
172
|
+
if (results.length > 1) {
|
|
173
|
+
if (json) {
|
|
174
|
+
process.stdout.write(JSON.stringify({
|
|
175
|
+
batch: true,
|
|
176
|
+
count: results.length,
|
|
177
|
+
passed: results.filter((r) => r.verdict === 'pass').length,
|
|
178
|
+
failed: results.filter((r) => r.verdict === 'fail').length,
|
|
179
|
+
warned: results.filter((r) => r.verdict === 'warn').length,
|
|
180
|
+
}) + '\n');
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
process.stdout.write(formatBatchSummary(results) + '\n');
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
process.exit(worstExit);
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAqC,MAAM,wBAAwB,CAAC;AAY5G,aAAa;AACb,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,UAAU,GAAG,CAAC,CAAC;AAsBrB,SAAS,eAAe,CAAC,OAAe,EAAE,KAAmB;IAC3D,MAAM,OAAO,GAAgB,EAAE,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM;YAAE,SAAS;QAC/D,IAAI,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG;YAAE,SAAS;QAEpD,iDAAiD;QACjD,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,C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AAC,CAAC;QACb,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-pack.d.ts","sourceRoot":"","sources":["../../src/commands/brand-pack.ts"],"names":[],"mappings":"AAeA,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAaxD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin wrapper: forwards argv to repo scripts/brand-pack.mjs (internal marketing, OpenRouter).
|
|
3
|
+
* Not a Chain feature — no session required.
|
|
4
|
+
*/
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { dirname, resolve } from 'node:path';
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
/** dist/commands -> dist -> packages/cli -> packages -> repo root */
|
|
10
|
+
function repoRootFromCliCommands() {
|
|
11
|
+
return resolve(__dirname, '../../../..');
|
|
12
|
+
}
|
|
13
|
+
export function runBrandPack(processArgv) {
|
|
14
|
+
const idx = processArgv.findIndex((a) => a === 'brand-pack');
|
|
15
|
+
const forwarded = idx >= 0 ? processArgv.slice(idx + 1) : [];
|
|
16
|
+
const root = repoRootFromCliCommands();
|
|
17
|
+
const script = resolve(root, 'scripts/brand-pack.mjs');
|
|
18
|
+
const result = spawnSync(process.execPath, [script, ...forwarded], {
|
|
19
|
+
cwd: root,
|
|
20
|
+
stdio: 'inherit',
|
|
21
|
+
env: process.env,
|
|
22
|
+
});
|
|
23
|
+
process.exit(result.status === null ? 1 : result.status);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=brand-pack.js.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C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pb brief — incremental brief delta or compound intelligence query.
|
|
3
|
+
* BET-239 Slice 4 (incremental) + Slice 5 (compound queries).
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* pb brief --skill <name> --since-last — incremental delta for a skill (E4)
|
|
7
|
+
* pb brief steering — compound steering brief (E6)
|
|
8
|
+
* pb brief confidence — compound confidence pass (E6)
|
|
9
|
+
* pb brief delta [--since <ISO>] — compound delta sync (E6)
|
|
10
|
+
*
|
|
11
|
+
* Chain: DEC-299 (agent-native, JSON-default), STD-65 (structured, parseable, minimal)
|
|
12
|
+
*/
|
|
13
|
+
declare const COMPOUND_TYPES: readonly ["steering", "confidence", "delta"];
|
|
14
|
+
type CompoundType = (typeof COMPOUND_TYPES)[number];
|
|
15
|
+
declare function isCompoundType(value: string): value is CompoundType;
|
|
16
|
+
/** Run incremental brief for a skill (existing E4 behavior). */
|
|
17
|
+
export declare function runBrief(options: {
|
|
18
|
+
skill: string;
|
|
19
|
+
sinceLast?: boolean;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
/** Run compound brief query (E6 — steering, confidence, delta). */
|
|
22
|
+
export declare function runCompoundBrief(options: {
|
|
23
|
+
type: CompoundType;
|
|
24
|
+
since?: string;
|
|
25
|
+
}): Promise<void>;
|
|
26
|
+
export { isCompoundType, COMPOUND_TYPES };
|
|
27
|
+
export type { CompoundType };
|
|
28
|
+
//# sourceMappingURL=brief.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brief.d.ts","sourceRoot":"","sources":["../../src/commands/brief.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAaH,QAAA,MAAM,cAAc,8CAA+C,CAAC;AACpE,KAAK,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAE5D;AAED,gEAAgE;AAChE,wBAAsB,QAAQ,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAyB7F;AAED,mEAAmE;AACnE,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAC9C,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhB;AAED,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pb brief — incremental brief delta or compound intelligence query.
|
|
3
|
+
* BET-239 Slice 4 (incremental) + Slice 5 (compound queries).
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* pb brief --skill <name> --since-last — incremental delta for a skill (E4)
|
|
7
|
+
* pb brief steering — compound steering brief (E6)
|
|
8
|
+
* pb brief confidence — compound confidence pass (E6)
|
|
9
|
+
* pb brief delta [--since <ISO>] — compound delta sync (E6)
|
|
10
|
+
*
|
|
11
|
+
* Chain: DEC-299 (agent-native, JSON-default), STD-65 (structured, parseable, minimal)
|
|
12
|
+
*/
|
|
13
|
+
import { getConfigOrGuide } from '../lib/config.js';
|
|
14
|
+
import { mcpCall } from '../lib/client.js';
|
|
15
|
+
import { runCliCommand } from '../lib/runner.js';
|
|
16
|
+
import { formatBrief, formatCompoundBrief, } from '../formatters/brief.js';
|
|
17
|
+
import { CLIError, ErrorCode } from '../lib/errors.js';
|
|
18
|
+
const COMPOUND_TYPES = ['steering', 'confidence', 'delta'];
|
|
19
|
+
function isCompoundType(value) {
|
|
20
|
+
return COMPOUND_TYPES.includes(value);
|
|
21
|
+
}
|
|
22
|
+
/** Run incremental brief for a skill (existing E4 behavior). */
|
|
23
|
+
export async function runBrief(options) {
|
|
24
|
+
const config = await getConfigOrGuide(() => runBrief(options));
|
|
25
|
+
if (!config)
|
|
26
|
+
return;
|
|
27
|
+
await runCliCommand({
|
|
28
|
+
fn: async () => {
|
|
29
|
+
const result = await mcpCall('chain.incrementalChanges', {
|
|
30
|
+
skill: options.skill,
|
|
31
|
+
});
|
|
32
|
+
// Record the brief run so the next call sees an updated "since last brief" timestamp.
|
|
33
|
+
// Fire-and-forget: recording failure should not block the CLI output.
|
|
34
|
+
const surfacedIds = result.newEntries
|
|
35
|
+
.map((e) => e.entryId)
|
|
36
|
+
.filter((id) => id !== null);
|
|
37
|
+
mcpCall('chain.recordBriefRun', {
|
|
38
|
+
skill: options.skill,
|
|
39
|
+
entriesSurfaced: surfacedIds,
|
|
40
|
+
timestamp: Date.now(),
|
|
41
|
+
}).catch(() => { });
|
|
42
|
+
return result;
|
|
43
|
+
},
|
|
44
|
+
formatPretty: (result) => formatBrief(result, options.skill),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** Run compound brief query (E6 — steering, confidence, delta). */
|
|
48
|
+
export async function runCompoundBrief(options) {
|
|
49
|
+
const config = await getConfigOrGuide(() => runCompoundBrief(options));
|
|
50
|
+
if (!config)
|
|
51
|
+
return;
|
|
52
|
+
await runCliCommand({
|
|
53
|
+
fn: async () => {
|
|
54
|
+
const args = {
|
|
55
|
+
type: options.type,
|
|
56
|
+
};
|
|
57
|
+
// For delta type, parse the --since option
|
|
58
|
+
if (options.type === 'delta' && options.since) {
|
|
59
|
+
const sinceMs = Date.parse(options.since);
|
|
60
|
+
if (isNaN(sinceMs)) {
|
|
61
|
+
throw new CLIError(`Invalid --since timestamp: '${options.since}'.`, {
|
|
62
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
63
|
+
category: 'validation',
|
|
64
|
+
guidance: `Use ISO 8601 format (e.g. '2026-03-24T00:00:00Z').`,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
args.since = sinceMs;
|
|
68
|
+
}
|
|
69
|
+
return await mcpCall('chain.compoundQuery', args);
|
|
70
|
+
},
|
|
71
|
+
formatPretty: (result) => formatCompoundBrief(result),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export { isCompoundType, COMPOUND_TYPES };
|
|
75
|
+
//# sourceMappingURL=brief.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brief.js","sourceRoot":"","sources":["../../src/commands/brief.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,WAAW,EACX,mBAAmB,GAGpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,CAAU,CAAC;AAGpE,SAAS,cAAc,CAAC,KAAa;IACnC,OAAO,cAAc,CAAC,QAAQ,CAAC,KAAqB,CAAC,CAAC;AACxD,CAAC;AAED,gEAAgE;AAChE,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAA+C;IAC5E,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,MAAM,aAAa,CAAc;QAC/B,EAAE,EAAE,KAAK,IAAI,EAAE;YACb,MAAM,MAAM,GAAG,MAAM,OAAO,CAAc,0BAA0B,EAAE;gBACpE,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC,CAAC;YAEH,sFAAsF;YACtF,sEAAsE;YACtE,MAAM,WAAW,GAAG,M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,YAAY;wBACtB,QAAQ,EAAE,oDAAoD;qBAC/D,CACF,CAAC;gBACJ,CAAC;gBACD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;YACvB,CAAC;YAED,OAAO,MAAM,OAAO,CAAsB,qBAAqB,EAAE,IAAI,CAAC,CAAC;QACzE,CAAC;QACD,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC;KACtD,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pb capture — write knowledge to the Chain during a CLI session.
|
|
3
|
+
* Calls resolveCollection (classification) → createEntry (draft).
|
|
4
|
+
* Shows rich receipt per FEAT-126 (capture receipts with correction affordance).
|
|
5
|
+
* Requires active session (DEC-9, BR-8).
|
|
6
|
+
* BET-181 Slice 0: uses isJsonMode() for output branching. Existing --json flag
|
|
7
|
+
* is preserved for backward compatibility (it sets output mode via the runner).
|
|
8
|
+
*/
|
|
9
|
+
interface CaptureOptions {
|
|
10
|
+
text: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
collection?: string;
|
|
14
|
+
link?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
/** BET-240 E2: Source reference URI (e.g. "meeting-2026-03-28.md"). */
|
|
17
|
+
sourceRef?: string;
|
|
18
|
+
/** BET-240 E2: Verbatim excerpt from the source. */
|
|
19
|
+
sourceExcerpt?: string;
|
|
20
|
+
/** @deprecated Use global --json flag instead. Preserved for backward compatibility. */
|
|
21
|
+
json?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function runCapture(options: CaptureOptions): Promise<void>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/commands/capture.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmDH,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA4ED,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAyJvE"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pb capture — write knowledge to the Chain during a CLI session.
|
|
3
|
+
* Calls resolveCollection (classification) → createEntry (draft).
|
|
4
|
+
* Shows rich receipt per FEAT-126 (capture receipts with correction affordance).
|
|
5
|
+
* Requires active session (DEC-9, BR-8).
|
|
6
|
+
* BET-181 Slice 0: uses isJsonMode() for output branching. Existing --json flag
|
|
7
|
+
* is preserved for backward compatibility (it sets output mode via the runner).
|
|
8
|
+
*/
|
|
9
|
+
import { getConfigOrGuide } from '../lib/config.js';
|
|
10
|
+
import { mcpCallWithSession } from '../lib/client.js';
|
|
11
|
+
import { readSession, addCapturedEntry } from '../lib/session.js';
|
|
12
|
+
import { isJsonMode } from '../lib/runner.js';
|
|
13
|
+
import { formatCaptureReceipt } from '../formatters/capture.js';
|
|
14
|
+
import { checkActivation } from '../lib/activation.js';
|
|
15
|
+
import { progress } from '../lib/style.js';
|
|
16
|
+
import { CLIError, ErrorCode } from '../lib/errors.js';
|
|
17
|
+
/**
|
|
18
|
+
* Infer an ISO date (YYYY-MM-DD) from free-text values.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: This function is duplicated in packages/mcp-server/src/tools/smart-capture.ts.
|
|
21
|
+
* The two packages build in isolation (TEN-174, BR-25) so they cannot share source.
|
|
22
|
+
* If you change the logic here, update the MCP server copy too.
|
|
23
|
+
*/
|
|
24
|
+
function inferSourceDate(...values) {
|
|
25
|
+
const combined = values
|
|
26
|
+
.filter((value) => typeof value === 'string' && value.trim().length > 0)
|
|
27
|
+
.join('\n');
|
|
28
|
+
if (!combined)
|
|
29
|
+
return undefined;
|
|
30
|
+
const isoMatch = combined.match(/\b(20\d{2}-\d{2}-\d{2})\b/);
|
|
31
|
+
if (isoMatch)
|
|
32
|
+
return isoMatch[1];
|
|
33
|
+
const monthMatch = combined.match(/\b(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:st|nd|rd|th)?(?:,?\s+(20\d{2}))?\b/i);
|
|
34
|
+
if (!monthMatch)
|
|
35
|
+
return undefined;
|
|
36
|
+
const monthIndex = [
|
|
37
|
+
'january',
|
|
38
|
+
'february',
|
|
39
|
+
'march',
|
|
40
|
+
'april',
|
|
41
|
+
'may',
|
|
42
|
+
'june',
|
|
43
|
+
'july',
|
|
44
|
+
'august',
|
|
45
|
+
'september',
|
|
46
|
+
'october',
|
|
47
|
+
'november',
|
|
48
|
+
'december',
|
|
49
|
+
].indexOf(monthMatch[1].toLowerCase());
|
|
50
|
+
if (monthIndex < 0)
|
|
51
|
+
return undefined;
|
|
52
|
+
const inferredYear = monthMatch[3] ?? combined.match(/\b(20\d{2})\b/)?.[1] ?? String(new Date().getUTCFullYear());
|
|
53
|
+
return `${inferredYear}-${String(monthIndex + 1).padStart(2, '0')}-${monthMatch[2].padStart(2, '0')}`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Known entry ID prefix → collection slug mapping.
|
|
57
|
+
* Mirrors idPrefix values from SEED_CLASSIFICATION_REGISTRY (convex/lib/seedClassificationRegistry.ts).
|
|
58
|
+
* CLI can't import from Convex (separate build, BR-25), so this is a local copy.
|
|
59
|
+
* If a new collection is added, update both places.
|
|
60
|
+
*/
|
|
61
|
+
const PREFIX_TO_COLLECTION = {
|
|
62
|
+
PRI: 'principles', STD: 'standards', BR: 'business-rules', POL: 'policies',
|
|
63
|
+
PAT: 'patterns', GLO: 'glossary', FEAT: 'features', ARCH: 'architecture',
|
|
64
|
+
DEC: 'decisions', STR: 'strategy', ST: 'semantic-types', MAP: 'maps',
|
|
65
|
+
TEN: 'tensions', TEAM: 'teams', ROL: 'roles', ASM: 'assumptions',
|
|
66
|
+
LAND: 'landscape', INS: 'insights', TASK: 'tasks', MIL: 'milestones',
|
|
67
|
+
WS: 'workstreams', INI: 'initiatives', WP: 'work-packages', BET: 'work-packages',
|
|
68
|
+
AUD: 'audiences', KEY: 'key-results', QUE: 'questions', PROD: 'products',
|
|
69
|
+
OPP: 'opportunities', EXP: 'experiments', FLO: 'flows',
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Extract a known ID prefix hint from capture text.
|
|
73
|
+
* Pattern: "FLO: description" or "TEN: something broken" — prefix must be uppercase,
|
|
74
|
+
* followed by colon and optional whitespace, then the actual text.
|
|
75
|
+
* Returns the resolved collection slug and the cleaned text (prefix stripped).
|
|
76
|
+
*/
|
|
77
|
+
function extractPrefixHint(text) {
|
|
78
|
+
const match = text.match(/^([A-Z]{2,4}):\s*(.+)$/s);
|
|
79
|
+
if (!match)
|
|
80
|
+
return { resolvedCollection: null, cleanText: text };
|
|
81
|
+
const [, prefix, rest] = match;
|
|
82
|
+
const slug = PREFIX_TO_COLLECTION[prefix];
|
|
83
|
+
if (!slug)
|
|
84
|
+
return { resolvedCollection: null, cleanText: text };
|
|
85
|
+
return { resolvedCollection: slug, cleanText: rest.trim() };
|
|
86
|
+
}
|
|
87
|
+
export async function runCapture(options) {
|
|
88
|
+
const config = await getConfigOrGuide(() => runCapture(options));
|
|
89
|
+
if (!config)
|
|
90
|
+
return;
|
|
91
|
+
// Support both legacy --json flag and global output mode (DEC-299, backward compat)
|
|
92
|
+
const json = isJsonMode() || options.json === true;
|
|
93
|
+
// Require active session (DEC-9, BR-8)
|
|
94
|
+
const session = readSession();
|
|
95
|
+
if (!session) {
|
|
96
|
+
throw new CLIError('No active session.', {
|
|
97
|
+
code: ErrorCode.SESSION_REQUIRED,
|
|
98
|
+
category: 'session',
|
|
99
|
+
guidance: 'Run `pb session start` first. Write access requires a tracked session (DEC-9).',
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// BET-277 fix: Extract known ID prefix hints (e.g. "FLO: description" → collection=flows).
|
|
103
|
+
// When the user explicitly prefixes with a known entry ID prefix, treat it as a collection
|
|
104
|
+
// override — strip the prefix from the name and route directly. No classification needed.
|
|
105
|
+
const { resolvedCollection: prefixCollection, cleanText } = extractPrefixHint(options.text);
|
|
106
|
+
const entryName = options.name ?? cleanText;
|
|
107
|
+
const entryDescription = options.description ?? cleanText;
|
|
108
|
+
// Phase 1: Resolve collection (classification)
|
|
109
|
+
let collectionSlug;
|
|
110
|
+
let classification = null;
|
|
111
|
+
if (options.collection) {
|
|
112
|
+
// Explicit collection — skip classification
|
|
113
|
+
collectionSlug = options.collection;
|
|
114
|
+
}
|
|
115
|
+
else if (prefixCollection) {
|
|
116
|
+
// Prefix hint detected (e.g. "FLO:" → flows) — treat as explicit collection
|
|
117
|
+
collectionSlug = prefixCollection;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
if (!json)
|
|
121
|
+
progress('Classifying...');
|
|
122
|
+
classification = await mcpCallWithSession('chain.resolveCollection', {
|
|
123
|
+
entryName,
|
|
124
|
+
entryDescription,
|
|
125
|
+
});
|
|
126
|
+
if (!classification) {
|
|
127
|
+
throw new CLIError('Classification needs review before capture can continue.', {
|
|
128
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
129
|
+
category: 'validation',
|
|
130
|
+
guidance: 'Re-run with `--collection <slug>` to specify the collection explicitly.',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
collectionSlug = classification.collection;
|
|
134
|
+
}
|
|
135
|
+
// Phase 2: Create entry as draft
|
|
136
|
+
if (!json)
|
|
137
|
+
progress(`Capturing to ${collectionSlug}...`);
|
|
138
|
+
const data = { description: entryDescription };
|
|
139
|
+
// Only set date when we can infer a source date from the capture itself.
|
|
140
|
+
const datedCollections = ['tensions', 'decisions', 'insights', 'standards', 'business-rules'];
|
|
141
|
+
const inferredSourceDate = inferSourceDate(entryName, entryDescription, options.sourceRef, options.sourceExcerpt);
|
|
142
|
+
if (datedCollections.includes(collectionSlug) && inferredSourceDate) {
|
|
143
|
+
data.date = inferredSourceDate;
|
|
144
|
+
}
|
|
145
|
+
const result = await mcpCallWithSession('chain.createEntry', {
|
|
146
|
+
collectionSlug,
|
|
147
|
+
name: entryName,
|
|
148
|
+
status: 'draft',
|
|
149
|
+
data,
|
|
150
|
+
sessionId: session.sessionId,
|
|
151
|
+
createdBy: `agent:${session.sessionId}`,
|
|
152
|
+
// BET-240 E2: source provenance — pass through when provided
|
|
153
|
+
...(options.sourceRef ? { sourceRef: options.sourceRef } : {}),
|
|
154
|
+
...(options.sourceExcerpt ? { sourceExcerpt: options.sourceExcerpt } : {}),
|
|
155
|
+
});
|
|
156
|
+
// Track in session state
|
|
157
|
+
addCapturedEntry(result.entryId);
|
|
158
|
+
// WP-301 S4: Activation ceremony — show contextual retrieval after first capture
|
|
159
|
+
if (!json) {
|
|
160
|
+
try {
|
|
161
|
+
const activation = await checkActivation(result.entryId);
|
|
162
|
+
if (activation?.isFirst && activation.relatedEntries.length > 0) {
|
|
163
|
+
process.stdout.write('\n Your first capture is on the Chain. Here\'s how it connects:\n');
|
|
164
|
+
for (const rel of activation.relatedEntries.slice(0, 3)) {
|
|
165
|
+
process.stdout.write(` \u2192 ${rel.entryId}: ${rel.name} (${rel.relation})\n`);
|
|
166
|
+
}
|
|
167
|
+
process.stdout.write('\n');
|
|
168
|
+
}
|
|
169
|
+
else if (activation?.isFirst) {
|
|
170
|
+
process.stdout.write('\n Your first capture is on the Chain! Run `pb orient -b` to see your workspace.\n\n');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
// Activation is additive — never blocks capture
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// BET-272 S3: Advisory quality hints — from createEntryWithClassification result (BR-144)
|
|
178
|
+
const qualityHints = result.qualityHints ?? [];
|
|
179
|
+
// Phase 3: Link to existing entry if --link provided (TEN-705)
|
|
180
|
+
if (options.link) {
|
|
181
|
+
const linkTarget = options.link.trim();
|
|
182
|
+
const relationType = options.type ?? 'surfaces_tension_in';
|
|
183
|
+
if (linkTarget) {
|
|
184
|
+
await mcpCallWithSession('chain.createEntryRelation', {
|
|
185
|
+
fromEntryId: result.entryId,
|
|
186
|
+
toEntryId: linkTarget,
|
|
187
|
+
type: relationType,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// BET-271 S1: Determine if any fields were rejected by normalization.
|
|
192
|
+
const rejectedFields = result.normalization?.rejected ?? [];
|
|
193
|
+
const hasRejected = rejectedFields.length > 0;
|
|
194
|
+
// Output
|
|
195
|
+
if (json) {
|
|
196
|
+
// Machine-readable output (TEN-709, DEC-299)
|
|
197
|
+
const output = {
|
|
198
|
+
id: result.entryId,
|
|
199
|
+
collection: collectionSlug,
|
|
200
|
+
confidence: classification?.tier ?? 'explicit',
|
|
201
|
+
};
|
|
202
|
+
if (hasRejected) {
|
|
203
|
+
output.fieldsRejected = true;
|
|
204
|
+
}
|
|
205
|
+
process.stdout.write(JSON.stringify(output) + '\n');
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
process.stdout.write('\n');
|
|
209
|
+
process.stdout.write(formatCaptureReceipt({
|
|
210
|
+
entryId: result.entryId,
|
|
211
|
+
name: entryName,
|
|
212
|
+
collection: collectionSlug,
|
|
213
|
+
status: 'draft',
|
|
214
|
+
classification,
|
|
215
|
+
warnings: result.warnings,
|
|
216
|
+
normalization: result.normalization,
|
|
217
|
+
linkedTo: options.link,
|
|
218
|
+
relationType: options.link ? (options.type ?? 'surfaces_tension_in') : undefined,
|
|
219
|
+
qualityHints,
|
|
220
|
+
relationSuggestions: result.relationSuggestions,
|
|
221
|
+
}) + '\n');
|
|
222
|
+
}
|
|
223
|
+
// BET-271 S1: Throw when fields were rejected — signals "not everything you asked for happened."
|
|
224
|
+
if (hasRejected) {
|
|
225
|
+
throw new CLIError(`Fields rejected: ${rejectedFields.join(', ')}.`, {
|
|
226
|
+
code: ErrorCode.VALIDATION_FAILED,
|
|
227
|
+
category: 'validation',
|
|
228
|
+
guidance: `Run \`pb fields ${collectionSlug}\` to see valid fields.`,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=capture.js.map
|