@productbrain/cli 0.1.0-beta.9 → 0.1.0-beta.90
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 +77 -92
- 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.js +309 -18
- package/dist/__tests__/capture.test.js.map +1 -1
- 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.js +20 -26
- package/dist/__tests__/constellation.test.js.map +1 -1
- 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.js +68 -68
- 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-preview.test.d.ts +2 -0
- package/dist/__tests__/handshake-preview.test.d.ts.map +1 -0
- package/dist/__tests__/handshake-preview.test.js +156 -0
- package/dist/__tests__/handshake-preview.test.js.map +1 -0
- package/dist/__tests__/handshake.test.js +27 -18
- 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 +110 -12
- 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 +138 -0
- package/dist/__tests__/manifest.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__/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__/personal-layer.test.d.ts +12 -0
- package/dist/__tests__/personal-layer.test.d.ts.map +1 -0
- package/dist/__tests__/personal-layer.test.js +304 -0
- package/dist/__tests__/personal-layer.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.js +57 -33
- 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-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 +154 -0
- package/dist/__tests__/session-state-machine.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.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__/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__/strip.test.js +2 -2
- package/dist/__tests__/strip.test.js.map +1 -1
- 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.test.js +123 -43
- package/dist/__tests__/update.test.js.map +1 -1
- 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/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 +76 -0
- package/dist/commands/admin/manage.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 +533 -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 +9 -0
- package/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +256 -17
- package/dist/commands/capture.js.map +1 -1
- 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 +195 -0
- package/dist/commands/connect-integration.test.js.map +1 -0
- package/dist/commands/connect-screens.d.ts +21 -0
- package/dist/commands/connect-screens.d.ts.map +1 -0
- package/dist/commands/connect-screens.js +79 -0
- package/dist/commands/connect-screens.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 +237 -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 +234 -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.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 +232 -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.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 +12 -0
- package/dist/commands/handshake.d.ts.map +1 -1
- package/dist/commands/handshake.js +422 -74
- package/dist/commands/handshake.js.map +1 -1
- package/dist/commands/ingest.d.ts +7 -2
- package/dist/commands/ingest.d.ts.map +1 -1
- package/dist/commands/ingest.js +137 -31
- 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 +781 -0
- package/dist/commands/method.js.map +1 -0
- package/dist/commands/orient.d.ts +106 -1
- package/dist/commands/orient.d.ts.map +1 -1
- package/dist/commands/orient.js +13 -2
- 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 +1 -0
- package/dist/commands/relate.d.ts.map +1 -1
- package/dist/commands/relate.js +41 -15
- package/dist/commands/relate.js.map +1 -1
- package/dist/commands/search.js +2 -2
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +85 -16
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/setup.d.ts +15 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +148 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +102 -13
- package/dist/commands/update.js.map +1 -1
- 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 +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/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/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 +21 -3
- package/dist/formatters/capture.d.ts.map +1 -1
- package/dist/formatters/capture.js +20 -1
- package/dist/formatters/capture.js.map +1 -1
- 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/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/handshake.d.ts +29 -0
- package/dist/formatters/handshake.d.ts.map +1 -1
- package/dist/formatters/handshake.js +115 -3
- package/dist/formatters/handshake.js.map +1 -1
- package/dist/formatters/orient.d.ts +104 -1
- package/dist/formatters/orient.d.ts.map +1 -1
- package/dist/formatters/orient.js +140 -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 +3 -0
- package/dist/formatters/relate.d.ts.map +1 -1
- package/dist/formatters/relate.js +6 -0
- package/dist/formatters/relate.js.map +1 -1
- 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 +1 -1
- package/dist/formatters/session.d.ts.map +1 -1
- package/dist/formatters/session.js +3 -1
- 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/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 +37 -3
- package/dist/generators/adapters.d.ts.map +1 -1
- package/dist/generators/adapters.js +193 -5
- 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 +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/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 +1 -1
- package/dist/generators/context-md.d.ts.map +1 -1
- package/dist/generators/context-md.js +12 -1
- 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 +37 -0
- package/dist/generators/manifest.d.ts.map +1 -0
- package/dist/generators/manifest.js +166 -0
- package/dist/generators/manifest.js.map +1 -0
- package/dist/generators/portable-knowledge.d.ts +102 -9
- package/dist/generators/portable-knowledge.d.ts.map +1 -1
- package/dist/generators/portable-knowledge.js +384 -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/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.js +618 -138
- 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 +45 -3
- package/dist/lib/client.d.ts.map +1 -1
- package/dist/lib/client.js +188 -36
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/collectionRegistry.d.ts +38 -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/config.d.ts +84 -4
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +322 -42
- 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/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/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 +185 -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 +25 -0
- package/dist/lib/session.d.ts.map +1 -1
- package/dist/lib/session.js +70 -4
- 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/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 +17 -0
- package/dist/lib/tokenConstants.d.ts.map +1 -0
- package/dist/lib/tokenConstants.js +17 -0
- package/dist/lib/tokenConstants.js.map +1 -0
- package/dist/lib/update-check.d.ts +21 -0
- package/dist/lib/update-check.d.ts.map +1 -0
- package/dist/lib/update-check.js +145 -0
- package/dist/lib/update-check.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/surfaces/registry.d.ts +20 -0
- package/dist/surfaces/registry.d.ts.map +1 -0
- package/dist/surfaces/registry.js +42 -0
- package/dist/surfaces/registry.js.map +1 -0
- package/package.json +9 -3
- package/templates/archetypes/boundary.md +23 -0
- package/templates/archetypes/constraint.md +23 -0
- package/templates/archetypes/convention.md +23 -0
- package/templates/archetypes/policy.md +23 -0
- package/templates/archetypes/quality-gate.md +23 -0
- package/templates/archetypes/workflow.md +23 -0
- package/templates/general/code-integrity.md +11 -0
- package/templates/general/getting-started.md +12 -0
- package/templates/method-registry.json +16 -0
- package/templates/node-ts/code-integrity.md +13 -0
- package/templates/node-ts/testing.md +12 -0
- package/templates/python/code-integrity.md +13 -0
- package/templates/python/testing.md +12 -0
package/README.md
CHANGED
|
@@ -1,142 +1,127 @@
|
|
|
1
1
|
# Product Brain CLI (`pb`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Chain knowledge + write-back in the terminal. Read, search, capture, and update your product knowledge graph.
|
|
4
4
|
|
|
5
|
-
**Requirements:** Node 18+, API key from Product Brain
|
|
6
|
-
|
|
7
|
-
---
|
|
5
|
+
**Requirements:** Node 18+, API key from Product Brain Settings (`pb_sk_*`).
|
|
8
6
|
|
|
9
7
|
## Install
|
|
10
8
|
|
|
11
|
-
### From npm (beta)
|
|
12
|
-
|
|
13
9
|
```bash
|
|
14
10
|
npm install -g @productbrain/cli@beta
|
|
15
11
|
```
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### From main (no publish needed)
|
|
20
|
-
|
|
21
|
-
If you have the repo and want **latest from `main`** without publishing to npm:
|
|
13
|
+
From source (latest main):
|
|
22
14
|
|
|
23
15
|
```bash
|
|
24
16
|
git clone https://github.com/synergyai-os/Product-OS.git
|
|
25
|
-
cd Product-OS
|
|
26
|
-
npm ci
|
|
17
|
+
cd Product-OS && npm ci
|
|
27
18
|
cd packages/cli && npm run build && npm install -g .
|
|
28
19
|
```
|
|
29
20
|
|
|
30
|
-
|
|
21
|
+
## Login
|
|
31
22
|
|
|
32
23
|
```bash
|
|
33
|
-
|
|
24
|
+
pb login
|
|
34
25
|
```
|
|
35
26
|
|
|
36
|
-
|
|
27
|
+
Paste your API key (`pb_sk_...`). Saved to `~/.config/productbrain/.env`.
|
|
37
28
|
|
|
38
|
-
|
|
29
|
+
Or run any command without a key and follow the guided flow.
|
|
39
30
|
|
|
40
|
-
|
|
31
|
+
### Onboarding link (`pb connect`)
|
|
41
32
|
|
|
42
|
-
|
|
43
|
-
- **Or:** Run `pb login` to paste and save your key once. Get a key: Product Brain app → Settings → API Keys.
|
|
33
|
+
If you received a connect token (`pb_ct_...`) from Product Brain:
|
|
44
34
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
## Commands
|
|
50
|
-
|
|
51
|
-
### Read (no session required)
|
|
35
|
+
```bash
|
|
36
|
+
pb connect pb_ct_...
|
|
37
|
+
```
|
|
52
38
|
|
|
53
|
-
|
|
54
|
-
|--------|-------------|
|
|
55
|
-
| `pb orient` | Workspace stage, bets, governance, tensions. Use `-b` for a brief view. |
|
|
56
|
-
| `pb search <query>` | Full-text search across the Chain. |
|
|
57
|
-
| `pb get <entry-id>` | Full entry (data, relations, last 10 history events). |
|
|
58
|
-
| `pb context <entry-id>` | Constellation context (pipe-friendly markdown when not a TTY). |
|
|
59
|
-
| `pb handshake` | Generate context files for AI developer tools. See below. |
|
|
60
|
-
| `pb login` | Save your API key to `~/.config/productbrain/.env`. |
|
|
39
|
+
Redemption always targets a cloud Convex deployment (HTTP Actions are cloud-hosted, even during local dev). Resolution order: `--gateway` → `PB_CONNECT_GATEWAY_URL` → `CONVEX_SITE_URL` → production default (`gateway.productbrain.io`).
|
|
61
40
|
|
|
62
|
-
|
|
41
|
+
- **Dev deployments:** Set `CONVEX_SITE_URL` to your `*.convex.site` URL, or use `--gateway`.
|
|
42
|
+
- If a token fails, the CLI hints about setting `CONVEX_SITE_URL` or using `--gateway`.
|
|
63
43
|
|
|
64
|
-
|
|
65
|
-
|--------|-------------|
|
|
66
|
-
| `pb session start` | Open a tracked write session. Refreshes context files. |
|
|
67
|
-
| `pb capture "<text>"` | Capture a decision, tension, insight, or any knowledge to the Chain. Auto-classifies. |
|
|
68
|
-
| `pb session close` | Close the session. Shows captured entries, runs wrapup, refreshes context. |
|
|
44
|
+
## Quick Start
|
|
69
45
|
|
|
70
|
-
|
|
46
|
+
```bash
|
|
47
|
+
# 1. Check your setup
|
|
48
|
+
pb doctor
|
|
71
49
|
|
|
72
|
-
|
|
50
|
+
# 2. Orient — see where things stand
|
|
51
|
+
pb orient -b
|
|
73
52
|
|
|
74
|
-
|
|
53
|
+
# 3. Read an entry
|
|
54
|
+
pb get BET-123
|
|
75
55
|
|
|
76
|
-
|
|
56
|
+
# 4. Search the Chain
|
|
57
|
+
pb search "onboarding flow"
|
|
77
58
|
|
|
78
|
-
|
|
79
|
-
pb
|
|
59
|
+
# 5. Start a write session and capture knowledge
|
|
60
|
+
pb session start
|
|
61
|
+
pb capture "DEC: chose X because Y"
|
|
62
|
+
pb capture "TEN: blocked by missing API"
|
|
63
|
+
pb session close
|
|
80
64
|
```
|
|
81
65
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
| File | Purpose |
|
|
85
|
-
|------|---------|
|
|
86
|
-
| `.productbrain/context.md` | Workspace briefing — stage, bets, governance, architecture, tensions |
|
|
87
|
-
| `.productbrain/briefing.md` | Chain entries matched to this specific repo |
|
|
88
|
-
| `CLAUDE.md` | Adapter for Claude Code |
|
|
89
|
-
| `.cursor/rules/chain.mdc` | Adapter for Cursor |
|
|
90
|
-
| `.github/copilot-instructions.md` | Adapter for GitHub Copilot |
|
|
66
|
+
Running `pb` with no arguments shows contextual guidance based on your setup state.
|
|
91
67
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- `--force` — Overwrite adapter files even if they have custom content
|
|
95
|
-
- `--dry-run` — Preview what would be generated without writing files
|
|
96
|
-
|
|
97
|
-
**Safety:** Adapter files are marked with `auto-generated by pb handshake`. If you customize one and remove the marker, future runs skip it (unless `--force`). The `.productbrain/` directory contains workspace-specific context and should be in `.gitignore`.
|
|
68
|
+
## Commands
|
|
98
69
|
|
|
99
|
-
|
|
70
|
+
### Read (no session required)
|
|
100
71
|
|
|
101
|
-
|
|
72
|
+
| Command | Description |
|
|
73
|
+
|---------|-------------|
|
|
74
|
+
| `pb orient [-b]` | Workspace overview. `-b` for brief, `--task` for task-grounded context. |
|
|
75
|
+
| `pb get <id>` | Full entry: data, relations, history. |
|
|
76
|
+
| `pb search <query>` | Full-text search across all collections. |
|
|
77
|
+
| `pb context <id>` | Constellation context for an entry. |
|
|
78
|
+
| `pb fields <collection>` | Field definitions for a collection. |
|
|
79
|
+
| `pb constellation <id>` | Entry + all related entries grouped by relation type. |
|
|
80
|
+
| `pb collections list` | All collections with field counts. |
|
|
81
|
+
| `pb glossary` | Key Product Brain CLI terms. |
|
|
82
|
+
| `pb doctor` | Check configuration and connectivity. |
|
|
83
|
+
|
|
84
|
+
### Write (session required)
|
|
102
85
|
|
|
103
|
-
|
|
86
|
+
| Command | Description |
|
|
87
|
+
|---------|-------------|
|
|
88
|
+
| `pb session start` | Open a tracked write session. |
|
|
89
|
+
| `pb capture "<text>"` | Capture knowledge. Auto-classifies to the right collection. |
|
|
90
|
+
| `pb update <id>` | Update fields on an existing entry. |
|
|
91
|
+
| `pb relate <from> <type> <to>` | Add a typed relation between entries. |
|
|
92
|
+
| `pb promote <id>` | Promote entry from draft to active. |
|
|
93
|
+
| `pb session close` | Close session, show summary. |
|
|
104
94
|
|
|
105
|
-
|
|
95
|
+
### Profile Management
|
|
106
96
|
|
|
107
|
-
|
|
97
|
+
Config is read from (in order): environment variables, `~/.config/productbrain/.env`, `.env.mcp` in the current directory.
|
|
108
98
|
|
|
109
99
|
```bash
|
|
110
|
-
#
|
|
111
|
-
pb
|
|
100
|
+
pb login # Save API key
|
|
101
|
+
pb doctor # Verify configuration
|
|
102
|
+
pb setup # Guided first-time setup
|
|
103
|
+
```
|
|
112
104
|
|
|
113
|
-
|
|
114
|
-
pb capture "TEN: topology query returns stale containers when initiatives are archived"
|
|
115
|
-
pb capture "DEC: excluded archived initiatives at the query level, not the UI filter"
|
|
116
|
-
pb capture "INS: learned that the containerIds array references soft-deleted entries"
|
|
105
|
+
### AI Developer Onboarding
|
|
117
106
|
|
|
118
|
-
|
|
119
|
-
pb
|
|
107
|
+
```bash
|
|
108
|
+
pb handshake # Generate context files for Codex, Cursor, Claude, Copilot
|
|
120
109
|
```
|
|
121
110
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
1. Text is sent to the Chain's classification pipeline — auto-assigns collection
|
|
125
|
-
2. Entry is created as a **draft** (nothing auto-commits)
|
|
126
|
-
3. Receipt shows: entry ID, collection, confidence, reasoning, alternatives
|
|
127
|
-
4. You review and commit drafts in Product Brain Studio
|
|
111
|
+
Generates `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/chain.mdc`, `.productbrain/context.md`, and more.
|
|
128
112
|
|
|
129
|
-
|
|
113
|
+
## Output Modes
|
|
130
114
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
115
|
+
| Context | Output |
|
|
116
|
+
|---------|--------|
|
|
117
|
+
| TTY (terminal) | Human-readable formatting |
|
|
118
|
+
| Piped / non-TTY | JSON |
|
|
119
|
+
| `--json` | Force JSON |
|
|
120
|
+
| `--pretty` | Force human-readable |
|
|
134
121
|
|
|
135
|
-
|
|
122
|
+
## Reference
|
|
136
123
|
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
- Addresses TEN-27 (strategic conversations generate decisions that never reach the Chain)
|
|
142
|
-
- Implements INS-80 (proactive capture during coding)
|
|
124
|
+
- `pb --help` for full command list
|
|
125
|
+
- `pb <command> --help` for command-specific options
|
|
126
|
+
- `pb glossary` for key terms
|
|
127
|
+
- Chain: WP-302 (CLI Maturity)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapters.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/adapters.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* adapters — unit tests for generateAgentsMd and generateCopilotMd.
|
|
3
|
+
* BET-270 Slice 2: governance-enriched AGENTS.md adapter.
|
|
4
|
+
* BET-270 Slice 3: profile-driven single-file Copilot adapter.
|
|
5
|
+
*/
|
|
6
|
+
import { describe, expect, it } from 'vitest';
|
|
7
|
+
import { MARKER, generateAgentsMd, generateCopilotMd } from '../generators/adapters.js';
|
|
8
|
+
import { SURFACE_PROFILES } from '../generators/surface-profiles.js';
|
|
9
|
+
const TIMESTAMP = '2026-04-05T12:00:00.000Z';
|
|
10
|
+
// ── Auto-generated marker ─────────────────────────────────────────────
|
|
11
|
+
describe('generateAgentsMd — marker', () => {
|
|
12
|
+
it('always includes the auto-generated marker', () => {
|
|
13
|
+
expect(generateAgentsMd(TIMESTAMP)).toContain(MARKER);
|
|
14
|
+
});
|
|
15
|
+
it('always includes the marker when options are provided', () => {
|
|
16
|
+
expect(generateAgentsMd(TIMESTAMP, {
|
|
17
|
+
workspaceContext: { stage: 'grounded' },
|
|
18
|
+
skills: [{ name: 'my-skill', description: 'does things' }],
|
|
19
|
+
})).toContain(MARKER);
|
|
20
|
+
});
|
|
21
|
+
it('embeds the timestamp in the marker line', () => {
|
|
22
|
+
const result = generateAgentsMd(TIMESTAMP);
|
|
23
|
+
expect(result).toContain(`<!-- ${MARKER} — ${TIMESTAMP} -->`);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
// ── Backward compatibility (no options) ──────────────────────────────
|
|
27
|
+
describe('generateAgentsMd — no options (backward compat)', () => {
|
|
28
|
+
it('produces the command reference table', () => {
|
|
29
|
+
const result = generateAgentsMd(TIMESTAMP);
|
|
30
|
+
expect(result).toContain('pb orient -b');
|
|
31
|
+
expect(result).toContain('pb get <ID>');
|
|
32
|
+
expect(result).toContain('pb search <query>');
|
|
33
|
+
expect(result).toContain('pb handshake');
|
|
34
|
+
});
|
|
35
|
+
it('produces the session lifecycle section', () => {
|
|
36
|
+
const result = generateAgentsMd(TIMESTAMP);
|
|
37
|
+
expect(result).toContain('pb session start');
|
|
38
|
+
expect(result).toContain('pb capture');
|
|
39
|
+
expect(result).toContain('pb session close');
|
|
40
|
+
});
|
|
41
|
+
it('does not include workspace context section when no options given', () => {
|
|
42
|
+
const result = generateAgentsMd(TIMESTAMP);
|
|
43
|
+
expect(result).not.toContain('## Workspace Context');
|
|
44
|
+
});
|
|
45
|
+
it('does not include skill directory when no options given', () => {
|
|
46
|
+
const result = generateAgentsMd(TIMESTAMP);
|
|
47
|
+
expect(result).not.toContain('## Skill Directory');
|
|
48
|
+
});
|
|
49
|
+
it('includes governance summary', () => {
|
|
50
|
+
const result = generateAgentsMd(TIMESTAMP);
|
|
51
|
+
expect(result).toContain('## Governance Summary');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
// ── Workspace Context section ─────────────────────────────────────────
|
|
55
|
+
describe('generateAgentsMd — workspaceContext', () => {
|
|
56
|
+
it('includes workspace context section when workspaceContext is provided', () => {
|
|
57
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
58
|
+
workspaceContext: { stage: 'grounded', governanceMode: 'active', totalEntries: 42 },
|
|
59
|
+
});
|
|
60
|
+
expect(result).toContain('## Workspace Context');
|
|
61
|
+
});
|
|
62
|
+
it('renders stage in workspace context table', () => {
|
|
63
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
64
|
+
workspaceContext: { stage: 'grounded' },
|
|
65
|
+
});
|
|
66
|
+
expect(result).toContain('grounded');
|
|
67
|
+
expect(result).toContain('Stage');
|
|
68
|
+
});
|
|
69
|
+
it('renders focus in workspace context table', () => {
|
|
70
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
71
|
+
workspaceContext: { focus: 'Ship BET-270' },
|
|
72
|
+
});
|
|
73
|
+
expect(result).toContain('Ship BET-270');
|
|
74
|
+
expect(result).toContain('Current focus');
|
|
75
|
+
});
|
|
76
|
+
it('renders governanceMode in workspace context table', () => {
|
|
77
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
78
|
+
workspaceContext: { governanceMode: 'structured' },
|
|
79
|
+
});
|
|
80
|
+
expect(result).toContain('structured');
|
|
81
|
+
expect(result).toContain('Governance mode');
|
|
82
|
+
});
|
|
83
|
+
it('renders totalEntries in workspace context table', () => {
|
|
84
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
85
|
+
workspaceContext: { totalEntries: 99 },
|
|
86
|
+
});
|
|
87
|
+
expect(result).toContain('99');
|
|
88
|
+
expect(result).toContain('Chain entries');
|
|
89
|
+
});
|
|
90
|
+
it('omits workspace context section when workspaceContext is undefined', () => {
|
|
91
|
+
const result = generateAgentsMd(TIMESTAMP, { skills: [] });
|
|
92
|
+
expect(result).not.toContain('## Workspace Context');
|
|
93
|
+
});
|
|
94
|
+
it('omits workspace context section when workspaceContext is empty object', () => {
|
|
95
|
+
const result = generateAgentsMd(TIMESTAMP, { workspaceContext: {} });
|
|
96
|
+
expect(result).not.toContain('## Workspace Context');
|
|
97
|
+
});
|
|
98
|
+
it('omits skill directory when only workspaceContext provided (no skills)', () => {
|
|
99
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
100
|
+
workspaceContext: { stage: 'grounded' },
|
|
101
|
+
});
|
|
102
|
+
expect(result).not.toContain('## Skill Directory');
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
// ── Skill Directory section ───────────────────────────────────────────
|
|
106
|
+
describe('generateAgentsMd — skills', () => {
|
|
107
|
+
it('includes skill directory when skills array provided', () => {
|
|
108
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
109
|
+
skills: [{ name: 'my-skill', description: 'does things' }],
|
|
110
|
+
});
|
|
111
|
+
expect(result).toContain('## Skill Directory');
|
|
112
|
+
});
|
|
113
|
+
it('renders skill name in the table', () => {
|
|
114
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
115
|
+
skills: [{ name: 'commit', description: 'commit changes to main' }],
|
|
116
|
+
});
|
|
117
|
+
expect(result).toContain('commit');
|
|
118
|
+
expect(result).toContain('commit changes to main');
|
|
119
|
+
});
|
|
120
|
+
it('renders skill triggers (up to 3) in the table', () => {
|
|
121
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
122
|
+
skills: [
|
|
123
|
+
{
|
|
124
|
+
name: 'review',
|
|
125
|
+
description: 'review changes',
|
|
126
|
+
triggers: ['review', 'implementation review', 'review this'],
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
});
|
|
130
|
+
expect(result).toContain('review');
|
|
131
|
+
expect(result).toContain('implementation review');
|
|
132
|
+
expect(result).toContain('review this');
|
|
133
|
+
});
|
|
134
|
+
it('caps triggers at 3 items', () => {
|
|
135
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
136
|
+
skills: [
|
|
137
|
+
{
|
|
138
|
+
name: 'shape',
|
|
139
|
+
description: 'shape a bet',
|
|
140
|
+
triggers: ['shape', 'shape this', 'shape a bet', 'shape up', 'let\'s shape'],
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
});
|
|
144
|
+
// Should have at most 3 triggers shown — 4th and 5th should not appear if they are unique
|
|
145
|
+
// The row should contain up to 3 triggers joined by ', '
|
|
146
|
+
const lines = result.split('\n');
|
|
147
|
+
const skillRow = lines.find((l) => l.includes('shape') && l.includes('shape a bet'));
|
|
148
|
+
expect(skillRow).toBeDefined();
|
|
149
|
+
const parts = skillRow.split('|');
|
|
150
|
+
// triggers cell is the 4th column (index 3)
|
|
151
|
+
const triggersCell = parts[3]?.trim() ?? '';
|
|
152
|
+
const triggerCount = triggersCell.split(',').length;
|
|
153
|
+
expect(triggerCount).toBeLessThanOrEqual(3);
|
|
154
|
+
});
|
|
155
|
+
it('renders "—" when no triggers provided for a skill', () => {
|
|
156
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
157
|
+
skills: [{ name: 'my-skill', description: 'does things' }],
|
|
158
|
+
});
|
|
159
|
+
expect(result).toContain('—');
|
|
160
|
+
});
|
|
161
|
+
it('renders multiple skills as separate rows', () => {
|
|
162
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
163
|
+
skills: [
|
|
164
|
+
{ name: 'skill-a', description: 'skill A description' },
|
|
165
|
+
{ name: 'skill-b', description: 'skill B description' },
|
|
166
|
+
],
|
|
167
|
+
});
|
|
168
|
+
expect(result).toContain('skill-a');
|
|
169
|
+
expect(result).toContain('skill-b');
|
|
170
|
+
expect(result).toContain('skill A description');
|
|
171
|
+
expect(result).toContain('skill B description');
|
|
172
|
+
});
|
|
173
|
+
it('omits skill directory when skills array is empty', () => {
|
|
174
|
+
const result = generateAgentsMd(TIMESTAMP, { skills: [] });
|
|
175
|
+
expect(result).not.toContain('## Skill Directory');
|
|
176
|
+
});
|
|
177
|
+
it('omits skill directory when skills option is undefined', () => {
|
|
178
|
+
const result = generateAgentsMd(TIMESTAMP, { workspaceContext: { stage: 'grounded' } });
|
|
179
|
+
expect(result).not.toContain('## Skill Directory');
|
|
180
|
+
});
|
|
181
|
+
it('includes workspace context AND skill directory together', () => {
|
|
182
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
183
|
+
workspaceContext: { stage: 'grounded', totalEntries: 10 },
|
|
184
|
+
skills: [{ name: 'orient', description: 'orient the workspace' }],
|
|
185
|
+
});
|
|
186
|
+
expect(result).toContain('## Workspace Context');
|
|
187
|
+
expect(result).toContain('## Skill Directory');
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
// ── Governance summary (always present) ─────────────────────────────
|
|
191
|
+
describe('generateAgentsMd — governance summary', () => {
|
|
192
|
+
it('is present with no options', () => {
|
|
193
|
+
expect(generateAgentsMd(TIMESTAMP)).toContain('## Governance Summary');
|
|
194
|
+
});
|
|
195
|
+
it('is present with full context', () => {
|
|
196
|
+
const result = generateAgentsMd(TIMESTAMP, {
|
|
197
|
+
workspaceContext: { stage: 'grounded' },
|
|
198
|
+
skills: [{ name: 'commit', description: 'commit to main' }],
|
|
199
|
+
});
|
|
200
|
+
expect(result).toContain('## Governance Summary');
|
|
201
|
+
});
|
|
202
|
+
it('mentions Product Brain governance', () => {
|
|
203
|
+
const result = generateAgentsMd(TIMESTAMP);
|
|
204
|
+
expect(result).toContain('Product Brain governance');
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
// ────────────────────────────────────────────────────────────────────
|
|
208
|
+
// generateCopilotMd
|
|
209
|
+
// ────────────────────────────────────────────────────────────────────
|
|
210
|
+
// ── Marker always present ────────────────────────────────────────────
|
|
211
|
+
describe('generateCopilotMd — marker', () => {
|
|
212
|
+
it('always includes the auto-generated marker with no options', () => {
|
|
213
|
+
expect(generateCopilotMd(TIMESTAMP)).toContain(MARKER);
|
|
214
|
+
});
|
|
215
|
+
it('always includes the marker when options are provided', () => {
|
|
216
|
+
expect(generateCopilotMd(TIMESTAMP, {
|
|
217
|
+
skills: [{ name: 'my-skill', description: 'does things' }],
|
|
218
|
+
})).toContain(MARKER);
|
|
219
|
+
});
|
|
220
|
+
it('embeds the timestamp in the marker line', () => {
|
|
221
|
+
const result = generateCopilotMd(TIMESTAMP);
|
|
222
|
+
expect(result).toContain(`<!-- ${MARKER} — ${TIMESTAMP} -->`);
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
// ── Backward compatibility (no options) ─────────────────────────────
|
|
226
|
+
describe('generateCopilotMd — no options (backward compat)', () => {
|
|
227
|
+
it('produces the command reference section', () => {
|
|
228
|
+
const result = generateCopilotMd(TIMESTAMP);
|
|
229
|
+
expect(result).toContain('pb orient -b');
|
|
230
|
+
expect(result).toContain('pb get <ID>');
|
|
231
|
+
expect(result).toContain('pb search <query>');
|
|
232
|
+
expect(result).toContain('pb handshake');
|
|
233
|
+
});
|
|
234
|
+
it('produces the session lifecycle section', () => {
|
|
235
|
+
const result = generateCopilotMd(TIMESTAMP);
|
|
236
|
+
expect(result).toContain('pb session start');
|
|
237
|
+
expect(result).toContain('pb capture');
|
|
238
|
+
expect(result).toContain('pb session close');
|
|
239
|
+
});
|
|
240
|
+
it('does not include Skills section when no options given', () => {
|
|
241
|
+
const result = generateCopilotMd(TIMESTAMP);
|
|
242
|
+
expect(result).not.toContain('## Skills');
|
|
243
|
+
});
|
|
244
|
+
it('does not include Rules section when no options given', () => {
|
|
245
|
+
const result = generateCopilotMd(TIMESTAMP);
|
|
246
|
+
expect(result).not.toContain('## Rules');
|
|
247
|
+
});
|
|
248
|
+
it('does not include workspace context section when no options given', () => {
|
|
249
|
+
const result = generateCopilotMd(TIMESTAMP);
|
|
250
|
+
expect(result).not.toContain('## Workspace Context');
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
// ── Full context ─────────────────────────────────────────────────────
|
|
254
|
+
describe('generateCopilotMd — full context', () => {
|
|
255
|
+
it('produces all sections when all options provided', () => {
|
|
256
|
+
const result = generateCopilotMd(TIMESTAMP, {
|
|
257
|
+
profile: SURFACE_PROFILES.copilot,
|
|
258
|
+
workspaceContext: { stage: 'grounded', focus: 'Ship BET-270', governanceMode: 'active', totalEntries: 55 },
|
|
259
|
+
skills: [{ name: 'commit', description: 'commit changes', triggers: ['commit'] }],
|
|
260
|
+
rules: [{ name: 'git-workflow', description: 'two-track git workflow' }],
|
|
261
|
+
});
|
|
262
|
+
expect(result).toContain('## Workspace Context');
|
|
263
|
+
expect(result).toContain('## Skills');
|
|
264
|
+
expect(result).toContain('## Rules');
|
|
265
|
+
expect(result).toContain('commit');
|
|
266
|
+
expect(result).toContain('git-workflow');
|
|
267
|
+
});
|
|
268
|
+
it('renders workspace context fields', () => {
|
|
269
|
+
const result = generateCopilotMd(TIMESTAMP, {
|
|
270
|
+
workspaceContext: { stage: 'grounded', governanceMode: 'active', totalEntries: 42, focus: 'BET-270' },
|
|
271
|
+
});
|
|
272
|
+
expect(result).toContain('grounded');
|
|
273
|
+
expect(result).toContain('active');
|
|
274
|
+
expect(result).toContain('42');
|
|
275
|
+
expect(result).toContain('BET-270');
|
|
276
|
+
});
|
|
277
|
+
it('renders skill name and description', () => {
|
|
278
|
+
const result = generateCopilotMd(TIMESTAMP, {
|
|
279
|
+
skills: [{ name: 'review', description: 'review implementation changes' }],
|
|
280
|
+
});
|
|
281
|
+
expect(result).toContain('### review');
|
|
282
|
+
expect(result).toContain('review implementation changes');
|
|
283
|
+
});
|
|
284
|
+
it('renders skill triggers (up to 3)', () => {
|
|
285
|
+
const result = generateCopilotMd(TIMESTAMP, {
|
|
286
|
+
skills: [
|
|
287
|
+
{ name: 'shape', description: 'shape a bet', triggers: ['shape', 'shape this', 'shape a bet', 'let\'s shape'] },
|
|
288
|
+
],
|
|
289
|
+
});
|
|
290
|
+
expect(result).toContain('shape');
|
|
291
|
+
expect(result).toContain('shape this');
|
|
292
|
+
expect(result).toContain('shape a bet');
|
|
293
|
+
// 4th trigger should not appear as it was sliced
|
|
294
|
+
expect(result).not.toContain('let\'s shape');
|
|
295
|
+
});
|
|
296
|
+
it('renders rule name and description', () => {
|
|
297
|
+
const result = generateCopilotMd(TIMESTAMP, {
|
|
298
|
+
rules: [{ name: 'feature-flags', description: 'three-tier feature flag resolution' }],
|
|
299
|
+
});
|
|
300
|
+
expect(result).toContain('### feature-flags');
|
|
301
|
+
expect(result).toContain('three-tier feature flag resolution');
|
|
302
|
+
});
|
|
303
|
+
it('renders multiple skills as separate headings', () => {
|
|
304
|
+
const result = generateCopilotMd(TIMESTAMP, {
|
|
305
|
+
skills: [
|
|
306
|
+
{ name: 'skill-a', description: 'alpha skill' },
|
|
307
|
+
{ name: 'skill-b', description: 'beta skill' },
|
|
308
|
+
],
|
|
309
|
+
});
|
|
310
|
+
expect(result).toContain('### skill-a');
|
|
311
|
+
expect(result).toContain('### skill-b');
|
|
312
|
+
expect(result).toContain('alpha skill');
|
|
313
|
+
expect(result).toContain('beta skill');
|
|
314
|
+
});
|
|
315
|
+
it('renders multiple rules as separate headings', () => {
|
|
316
|
+
const result = generateCopilotMd(TIMESTAMP, {
|
|
317
|
+
rules: [
|
|
318
|
+
{ name: 'rule-one', description: 'first rule' },
|
|
319
|
+
{ name: 'rule-two', description: 'second rule' },
|
|
320
|
+
],
|
|
321
|
+
});
|
|
322
|
+
expect(result).toContain('### rule-one');
|
|
323
|
+
expect(result).toContain('### rule-two');
|
|
324
|
+
});
|
|
325
|
+
it('does not include skill bodies — only summaries', () => {
|
|
326
|
+
// Summaries contain just name + description + optional triggers, no full markdown content
|
|
327
|
+
const result = generateCopilotMd(TIMESTAMP, {
|
|
328
|
+
skills: [{ name: 'orchestrate', description: 'run bounded implementation slices' }],
|
|
329
|
+
});
|
|
330
|
+
// Should have a heading and description but NOT multi-paragraph content from the skill body
|
|
331
|
+
expect(result).toContain('### orchestrate');
|
|
332
|
+
expect(result).toContain('run bounded implementation slices');
|
|
333
|
+
// Confirm no "Run Contract" section from skill body is present
|
|
334
|
+
expect(result).not.toContain('## Run Contract');
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
// ── Token budget enforcement ─────────────────────────────────────────
|
|
338
|
+
describe('generateCopilotMd — token budget enforcement', () => {
|
|
339
|
+
it('output length does not exceed profile token budget', () => {
|
|
340
|
+
const profile = SURFACE_PROFILES.copilot; // 30000 chars
|
|
341
|
+
// Generate a large payload
|
|
342
|
+
const manySkills = Array.from({ length: 100 }, (_, i) => ({
|
|
343
|
+
name: `skill-${i}`,
|
|
344
|
+
description: `Description for skill ${i} — a moderately long description to consume budget`,
|
|
345
|
+
triggers: [`trigger-${i}-a`, `trigger-${i}-b`, `trigger-${i}-c`],
|
|
346
|
+
}));
|
|
347
|
+
const manyRules = Array.from({ length: 50 }, (_, i) => ({
|
|
348
|
+
name: `rule-${i}`,
|
|
349
|
+
description: `Description for rule ${i} — another moderately long description`,
|
|
350
|
+
}));
|
|
351
|
+
const result = generateCopilotMd(TIMESTAMP, { profile, skills: manySkills, rules: manyRules });
|
|
352
|
+
expect(result.length).toBeLessThanOrEqual(profile.tokenBudget);
|
|
353
|
+
});
|
|
354
|
+
it('includes a truncation note when content is truncated', () => {
|
|
355
|
+
const profile = { ...SURFACE_PROFILES.copilot, tokenBudget: 2000 };
|
|
356
|
+
const manySkills = Array.from({ length: 50 }, (_, i) => ({
|
|
357
|
+
name: `skill-${i}`,
|
|
358
|
+
description: `Description for skill ${i}`,
|
|
359
|
+
}));
|
|
360
|
+
const result = generateCopilotMd(TIMESTAMP, { profile, skills: manySkills });
|
|
361
|
+
expect(result).toContain('Truncated');
|
|
362
|
+
expect(result).toContain('token budget');
|
|
363
|
+
});
|
|
364
|
+
it('does not include a truncation note when everything fits', () => {
|
|
365
|
+
const result = generateCopilotMd(TIMESTAMP, {
|
|
366
|
+
profile: SURFACE_PROFILES.copilot,
|
|
367
|
+
skills: [{ name: 'one-skill', description: 'a single skill that easily fits' }],
|
|
368
|
+
rules: [{ name: 'one-rule', description: 'a single rule that easily fits' }],
|
|
369
|
+
});
|
|
370
|
+
expect(result).not.toContain('Truncated');
|
|
371
|
+
});
|
|
372
|
+
it('respects a custom small token budget', () => {
|
|
373
|
+
// Budget must be larger than the base template (~1437 chars) + truncation note (~80 chars)
|
|
374
|
+
const smallBudget = 2500;
|
|
375
|
+
const profile = { ...SURFACE_PROFILES.copilot, tokenBudget: smallBudget };
|
|
376
|
+
const manySkills = Array.from({ length: 30 }, (_, i) => ({
|
|
377
|
+
name: `skill-${i}`,
|
|
378
|
+
description: `Description for skill ${i} with enough text to consume budget`,
|
|
379
|
+
triggers: [`trigger-${i}`],
|
|
380
|
+
}));
|
|
381
|
+
const result = generateCopilotMd(TIMESTAMP, { profile, skills: manySkills });
|
|
382
|
+
expect(result.length).toBeLessThanOrEqual(smallBudget);
|
|
383
|
+
expect(result).toContain('Truncated');
|
|
384
|
+
});
|
|
385
|
+
it('stays within budget even when base nearly fills it', () => {
|
|
386
|
+
// Budget barely above base template — should not exceed budget
|
|
387
|
+
const tightBudget = 1500;
|
|
388
|
+
const profile = { ...SURFACE_PROFILES.copilot, tokenBudget: tightBudget };
|
|
389
|
+
const manySkills = Array.from({ length: 20 }, (_, i) => ({
|
|
390
|
+
name: `skill-${i}`,
|
|
391
|
+
description: `Description ${i}`,
|
|
392
|
+
}));
|
|
393
|
+
const result = generateCopilotMd(TIMESTAMP, { profile, skills: manySkills });
|
|
394
|
+
expect(result.length).toBeLessThanOrEqual(tightBudget);
|
|
395
|
+
});
|
|
396
|
+
it('respects a large custom token budget without unnecessary truncation', () => {
|
|
397
|
+
const largeBudget = 200000;
|
|
398
|
+
const profile = { ...SURFACE_PROFILES.copilot, tokenBudget: largeBudget };
|
|
399
|
+
const fewSkills = Array.from({ length: 5 }, (_, i) => ({
|
|
400
|
+
name: `skill-${i}`,
|
|
401
|
+
description: `Short desc ${i}`,
|
|
402
|
+
}));
|
|
403
|
+
const result = generateCopilotMd(TIMESTAMP, { profile, skills: fewSkills });
|
|
404
|
+
expect(result.length).toBeLessThanOrEqual(largeBudget);
|
|
405
|
+
expect(result).not.toContain('Truncated');
|
|
406
|
+
});
|
|
407
|
+
it('truncated output still contains the marker', () => {
|
|
408
|
+
const profile = { ...SURFACE_PROFILES.copilot, tokenBudget: 2000 };
|
|
409
|
+
const manySkills = Array.from({ length: 50 }, (_, i) => ({
|
|
410
|
+
name: `skill-${i}`,
|
|
411
|
+
description: `Description for skill ${i}`,
|
|
412
|
+
}));
|
|
413
|
+
const result = generateCopilotMd(TIMESTAMP, { profile, skills: manySkills });
|
|
414
|
+
expect(result).toContain(MARKER);
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
//# sourceMappingURL=adapters.test.js.map
|