create-principles-disciple 1.94.0 → 1.96.0
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/console/dist/server/config/WorkspaceConfigStore.js +2 -1
- package/console/dist/server/config/pd-config-store.d.ts +33 -0
- package/console/dist/server/config/pd-config-store.js +196 -0
- package/console/dist/server/index.js +19 -4
- package/console/dist/server/models/EvidenceChainConsoleModel.d.ts +0 -2
- package/console/dist/server/models/EvidenceChainConsoleModel.js +36 -2
- package/console/dist/server/models/HealthCheckModel.js +5 -3
- package/console/dist/server/models/IntentDecisionModel.d.ts +66 -0
- package/console/dist/server/models/IntentDecisionModel.js +207 -0
- package/console/dist/server/models/IntentPageModel.d.ts +52 -0
- package/console/dist/server/models/IntentPageModel.js +292 -0
- package/console/dist/server/models/PrinciplesConsoleModel.d.ts +2 -0
- package/console/dist/server/models/PrinciplesConsoleModel.js +37 -1
- package/console/dist/server/models/WorkspaceService.d.ts +0 -28
- package/console/dist/server/models/WorkspaceService.js +0 -115
- package/console/dist/server/routes/config.js +55 -1
- package/console/dist/server/routes/intent-decisions.d.ts +33 -0
- package/console/dist/server/routes/intent-decisions.js +499 -0
- package/console/dist/server/routes/intent.d.ts +7 -0
- package/console/dist/server/routes/intent.js +223 -0
- package/console/dist/server/routes/principles.js +67 -1
- package/console/dist/server/routes/update.d.ts +0 -1
- package/console/dist/server/routes/update.js +14 -11
- package/console/dist/types.d.ts +1 -0
- package/console/dist/ui/App.js +2 -60
- package/console/dist/ui/api.d.ts +58 -18
- package/console/dist/ui/api.js +78 -6
- package/console/dist/ui/components/layout/app-sidebar.js +13 -12
- package/console/dist/ui/components/ui/badge.d.ts +1 -1
- package/console/dist/ui/components/ui/button.d.ts +1 -1
- package/console/dist/ui/components/ui/shiny-text.d.ts +28 -0
- package/console/dist/ui/components/ui/shiny-text.js +46 -0
- package/console/dist/ui/i18n/en.json +306 -3
- package/console/dist/ui/i18n/zh-CN.json +306 -3
- package/console/dist/ui/pages/activation/ActivationPage.js +2 -1
- package/console/dist/ui/pages/control-center/AgentCard.d.ts +31 -0
- package/console/dist/ui/pages/control-center/AgentCard.js +156 -0
- package/console/dist/ui/pages/control-center/AgentGroup.d.ts +26 -0
- package/console/dist/ui/pages/control-center/AgentGroup.js +38 -0
- package/console/dist/ui/pages/control-center/ControlCenterPage.js +103 -41
- package/console/dist/ui/pages/control-center/EmpathyObserverCostHint.d.ts +28 -0
- package/console/dist/ui/pages/control-center/EmpathyObserverCostHint.js +38 -0
- package/console/dist/ui/pages/control-center/WorkflowDiagram.d.ts +17 -0
- package/console/dist/ui/pages/control-center/WorkflowDiagram.js +55 -0
- package/console/dist/ui/pages/debt/DebtPage.js +219 -2
- package/console/dist/ui/pages/focus/FocusPage.js +2 -1
- package/console/dist/ui/pages/intent/IntentOnboarding.d.ts +67 -0
- package/console/dist/ui/pages/intent/IntentOnboarding.js +289 -0
- package/console/dist/ui/pages/intent/IntentPage.d.ts +1 -0
- package/console/dist/ui/pages/intent/IntentPage.js +258 -0
- package/console/dist/ui/pages/pain/PainPage.js +234 -4
- package/console/dist/ui/pages/pain/pain-card-helpers.d.ts +75 -0
- package/console/dist/ui/pages/pain/pain-card-helpers.js +78 -0
- package/console/dist/ui/pages/principles/PrinciplesPage.js +2 -1
- package/console/dist/ui/utils/agent-metadata.d.ts +58 -0
- package/console/dist/ui/utils/agent-metadata.js +275 -0
- package/console/dist/ui/utils/control-center-helpers.d.ts +19 -0
- package/console/dist/ui/utils/control-center-helpers.js +37 -0
- package/console/dist/ui/utils/validators.d.ts +200 -0
- package/console/dist/ui/utils/validators.js +563 -0
- package/console/dist/web/assets/app.css +498 -3
- package/console/dist/web/assets/app.js +5063 -1418
- package/console/package.json +3 -0
- package/core/dist/principle-tree-ledger.d.ts +55 -4
- package/core/dist/principle-tree-ledger.d.ts.map +1 -1
- package/core/dist/principle-tree-ledger.js +472 -13
- package/core/dist/principle-tree-ledger.js.map +1 -1
- package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.js +58 -0
- package/core/dist/prompt-builder/__tests__/prompt-builder-core.test.js.map +1 -1
- package/core/dist/prompt-builder/empathy-keyword-matching.d.ts.map +1 -1
- package/core/dist/prompt-builder/empathy-keyword-matching.js +9 -6
- package/core/dist/prompt-builder/empathy-keyword-matching.js.map +1 -1
- package/core/dist/prompt-builder/size-guard.d.ts +1 -0
- package/core/dist/prompt-builder/size-guard.d.ts.map +1 -1
- package/core/dist/prompt-builder/size-guard.js +21 -0
- package/core/dist/prompt-builder/size-guard.js.map +1 -1
- package/core/dist/prompt-builder/types.d.ts +2 -0
- package/core/dist/prompt-builder/types.d.ts.map +1 -1
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +143 -65
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js +85 -7
- package/core/dist/runtime-v2/__tests__/evaluator-runner-vslice-v2.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.js +284 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-intent-tension.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js +70 -0
- package/core/dist/runtime-v2/__tests__/golden-trace-replay-validator.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/golden-trace.test.js +136 -1
- package/core/dist/runtime-v2/__tests__/golden-trace.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pain-signal-bridge-result-shaping.test.js +105 -0
- package/core/dist/runtime-v2/__tests__/pain-signal-bridge-result-shaping.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js +7 -5
- package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js +11 -0
- package/core/dist/runtime-v2/__tests__/pi-artifact-store.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js +15 -2
- package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/schema-float-precision.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/schema-float-precision.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/schema-float-precision.test.js +290 -0
- package/core/dist/runtime-v2/__tests__/schema-float-precision.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.js +158 -0
- package/core/dist/runtime-v2/__tests__/schema-orphan-detection.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.js +211 -0
- package/core/dist/runtime-v2/__tests__/v2-adversarial-cases.test.js.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js +15 -1
- package/core/dist/runtime-v2/activation/__tests__/approval-store-extended.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.d.ts +2 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.js +62 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store-fk.test.js.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js +12 -2
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.d.ts +2 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.js +56 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store-fk.test.js.map +1 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js +8 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.js +20 -0
- package/core/dist/runtime-v2/activation/__tests__/story-a-acceptance.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js +6 -0
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-approval-store.js +86 -32
- package/core/dist/runtime-v2/activation/sqlite-approval-store.js.map +1 -1
- package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js +158 -1
- package/core/dist/runtime-v2/activation/writers/__tests__/rule-host-writer.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts +11 -0
- package/core/dist/runtime-v2/activation/writers/rule-host-writer.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/writers/rule-host-writer.js +55 -11
- package/core/dist/runtime-v2/activation/writers/rule-host-writer.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js +134 -15
- package/core/dist/runtime-v2/diagnostician/__tests__/diag-rootcause-output.test.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.d.ts +18 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.js +251 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/intent-tension-schema.test.js.map +1 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js +73 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/rootcause-prompt-builder.test.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts +98 -0
- package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.js +131 -0
- package/core/dist/runtime-v2/diagnostician/diag-rootcause-output.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts +8 -0
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js +66 -3
- package/core/dist/runtime-v2/diagnostician/rootcause-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician-output.d.ts +23 -0
- package/core/dist/runtime-v2/diagnostician-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician-output.js +16 -0
- package/core/dist/runtime-v2/diagnostician-output.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts +32 -0
- package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/evidence-triage/source-descriptors.d.ts +1 -1
- package/core/dist/runtime-v2/evidence-triage/source-descriptors.js +1 -1
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +23 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.js +30 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/intent-engineering-flag.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.js +74 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/rulecode-context-v2-flag.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.js +246 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/surface-guard-policy.test.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +9 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/index.d.ts +2 -0
- package/core/dist/runtime-v2/feature-flags/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/index.js +2 -0
- package/core/dist/runtime-v2/feature-flags/index.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js +0 -9
- package/core/dist/runtime-v2/feature-flags/plugin-surface-registry.js.map +1 -1
- package/{plugin/dist/core/surface-guard.d.ts → core/dist/runtime-v2/feature-flags/surface-guard-policy.d.ts} +15 -5
- package/core/dist/runtime-v2/feature-flags/surface-guard-policy.d.ts.map +1 -0
- package/{plugin/dist/core/surface-guard.js → core/dist/runtime-v2/feature-flags/surface-guard-policy.js} +14 -2
- package/core/dist/runtime-v2/feature-flags/surface-guard-policy.js.map +1 -0
- package/core/dist/runtime-v2/golden-trace-replay-validator.js +1 -1
- package/core/dist/runtime-v2/golden-trace-replay-validator.js.map +1 -1
- package/core/dist/runtime-v2/golden-trace.d.ts +19 -3
- package/core/dist/runtime-v2/golden-trace.d.ts.map +1 -1
- package/core/dist/runtime-v2/golden-trace.js +2 -0
- package/core/dist/runtime-v2/golden-trace.js.map +1 -1
- package/core/dist/runtime-v2/index.d.ts +21 -4
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +21 -3
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.js +185 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-decision-record.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.js +88 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc-version.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.js +181 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-doc.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.js +168 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-friction-block.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.d.ts +2 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.js +121 -0
- package/core/dist/runtime-v2/intent/__tests__/intent-patch-proposal.test.js.map +1 -0
- package/core/dist/runtime-v2/intent/index.d.ts +8 -0
- package/core/dist/runtime-v2/intent/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/index.js +8 -0
- package/core/dist/runtime-v2/intent/index.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-browser.d.ts +23 -0
- package/core/dist/runtime-v2/intent/intent-browser.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-browser.js +21 -0
- package/core/dist/runtime-v2/intent/intent-browser.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-decision-record.d.ts +125 -0
- package/core/dist/runtime-v2/intent/intent-decision-record.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-decision-record.js +21 -0
- package/core/dist/runtime-v2/intent/intent-decision-record.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc-reader-port.d.ts +95 -0
- package/core/dist/runtime-v2/intent/intent-doc-reader-port.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc-reader-port.js +43 -0
- package/core/dist/runtime-v2/intent/intent-doc-reader-port.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc-version.d.ts +28 -0
- package/core/dist/runtime-v2/intent/intent-doc-version.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc-version.js +21 -0
- package/core/dist/runtime-v2/intent/intent-doc-version.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc.d.ts +35 -0
- package/core/dist/runtime-v2/intent/intent-doc.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-doc.js +158 -0
- package/core/dist/runtime-v2/intent/intent-doc.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-friction-block.d.ts +63 -0
- package/core/dist/runtime-v2/intent/intent-friction-block.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-friction-block.js +129 -0
- package/core/dist/runtime-v2/intent/intent-friction-block.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-hash.d.ts +2 -0
- package/core/dist/runtime-v2/intent/intent-hash.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-hash.js +10 -0
- package/core/dist/runtime-v2/intent/intent-hash.js.map +1 -0
- package/core/dist/runtime-v2/intent/intent-patch-proposal.d.ts +42 -0
- package/core/dist/runtime-v2/intent/intent-patch-proposal.d.ts.map +1 -0
- package/core/dist/runtime-v2/intent/intent-patch-proposal.js +81 -0
- package/core/dist/runtime-v2/intent/intent-patch-proposal.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts +54 -0
- package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.js +219 -0
- package/core/dist/runtime-v2/internalization/__tests__/__fixtures__/intent-tension-cases.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js +41 -1
- package/core/dist/runtime-v2/internalization/__tests__/artificer-prompt-builder.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.js +130 -2
- package/core/dist/runtime-v2/internalization/__tests__/artificer-rule-output.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.js +228 -0
- package/core/dist/runtime-v2/internalization/__tests__/behavior-example-pack.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js +41 -11
- package/core/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js +360 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-rootcause-intent-tension.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js +333 -0
- package/core/dist/runtime-v2/internalization/__tests__/diag-router-intent-tension.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.js +113 -0
- package/core/dist/runtime-v2/internalization/__tests__/intent-tension-cases.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js +135 -0
- package/core/dist/runtime-v2/internalization/__tests__/refiner-sandbox-wrapper.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.d.ts +2 -0
- package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.js +449 -0
- package/core/dist/runtime-v2/internalization/__tests__/rule-context-v2.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/adversarial-case.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/adversarial-case.js +24 -0
- package/core/dist/runtime-v2/internalization/adversarial-case.js.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-output.d.ts +10 -0
- package/core/dist/runtime-v2/internalization/artificer-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-output.js +45 -0
- package/core/dist/runtime-v2/internalization/artificer-output.js.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts +2 -2
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js +7 -2
- package/core/dist/runtime-v2/internalization/artificer-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/behavior-example-pack.d.ts +66 -0
- package/core/dist/runtime-v2/internalization/behavior-example-pack.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/behavior-example-pack.js +183 -0
- package/core/dist/runtime-v2/internalization/behavior-example-pack.js.map +1 -0
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts +13 -0
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js +42 -0
- package/core/dist/runtime-v2/internalization/diag-rootcause-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-router-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/diag-router-runner.js +27 -0
- package/core/dist/runtime-v2/internalization/diag-router-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.d.ts +8 -0
- package/core/dist/runtime-v2/internalization/evaluator-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-output.js +10 -0
- package/core/dist/runtime-v2/internalization/evaluator-output.js.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts +17 -0
- package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/evaluator-runner.js +118 -24
- package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js +1 -1
- package/core/dist/runtime-v2/internalization/refiner-sandbox-wrapper.js.map +1 -1
- package/core/dist/runtime-v2/internalization/rule-context-v2.d.ts +61 -0
- package/core/dist/runtime-v2/internalization/rule-context-v2.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/rule-context-v2.js +301 -0
- package/core/dist/runtime-v2/internalization/rule-context-v2.js.map +1 -0
- package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts +9 -0
- package/core/dist/runtime-v2/internalization/rule-host-contracts.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/v2-adversarial-cases.d.ts +55 -0
- package/core/dist/runtime-v2/internalization/v2-adversarial-cases.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/v2-adversarial-cases.js +131 -0
- package/core/dist/runtime-v2/internalization/v2-adversarial-cases.js.map +1 -0
- package/core/dist/runtime-v2/pain-signal-observability.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-observability.js +280 -56
- package/core/dist/runtime-v2/pain-signal-observability.js.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +12 -0
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime-v2/pain-to-principle-service.d.ts +6 -0
- package/core/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-to-principle-service.js +2 -0
- package/core/dist/runtime-v2/pain-to-principle-service.js.map +1 -1
- package/core/dist/runtime-v2/principle-tree/ledger-codec.js.map +1 -1
- package/core/dist/runtime-v2/proven-channel-baseline.js +1 -1
- package/core/dist/runtime-v2/proven-channel-baseline.js.map +1 -1
- package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.d.ts +2 -0
- package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.js +95 -0
- package/core/dist/runtime-v2/risk/__tests__/risk-calculator-policy.test.js.map +1 -0
- package/core/dist/runtime-v2/risk/index.d.ts +7 -0
- package/core/dist/runtime-v2/risk/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/risk/index.js +6 -0
- package/core/dist/runtime-v2/risk/index.js.map +1 -0
- package/core/dist/runtime-v2/risk/risk-calculator-policy.d.ts +18 -0
- package/core/dist/runtime-v2/risk/risk-calculator-policy.d.ts.map +1 -0
- package/core/dist/runtime-v2/risk/risk-calculator-policy.js +47 -0
- package/core/dist/runtime-v2/risk/risk-calculator-policy.js.map +1 -0
- package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.js +55 -0
- package/core/dist/runtime-v2/store/artifact/__tests__/sqlite-pi-artifact-store-fk.test.js.map +1 -0
- package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js +6 -0
- package/core/dist/runtime-v2/store/artifact/sqlite-pi-artifact-store.js.map +1 -1
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.js +272 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-decision-store.test.js.map +1 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.js +83 -0
- package/core/dist/runtime-v2/store/intent/__tests__/sqlite-intent-doc-version-store.test.js.map +1 -0
- package/core/dist/runtime-v2/store/intent/index.d.ts +7 -0
- package/core/dist/runtime-v2/store/intent/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/index.js +6 -0
- package/core/dist/runtime-v2/store/intent/index.js.map +1 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.d.ts +51 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.js +306 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-decision-store.js.map +1 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.d.ts +28 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.js +88 -0
- package/core/dist/runtime-v2/store/intent/sqlite-intent-doc-version-store.js.map +1 -0
- package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js +14 -3
- package/core/dist/runtime-v2/store/sqlite-connection-pragma.test.js.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.d.ts +2 -0
- package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.js +72 -0
- package/core/dist/runtime-v2/store/sqlite-connection-schema-version.test.js.map +1 -0
- package/core/dist/runtime-v2/store/sqlite-connection.d.ts +27 -0
- package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection.js +138 -12
- package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -1
- package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts +2 -0
- package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js +149 -0
- package/core/dist/runtime-v2/thinking-models/__tests__/thinking-models-policy.test.js.map +1 -0
- package/core/dist/runtime-v2/thinking-models/index.d.ts +3 -0
- package/core/dist/runtime-v2/thinking-models/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/thinking-models/index.js +3 -0
- package/core/dist/runtime-v2/thinking-models/index.js.map +1 -0
- package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts +73 -0
- package/core/dist/runtime-v2/thinking-models/thinking-models-policy.d.ts.map +1 -0
- package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js +227 -0
- package/core/dist/runtime-v2/thinking-models/thinking-models-policy.js.map +1 -0
- package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js +40 -1
- package/core/dist/runtime-v2/tools/__tests__/artificer-l2-tool-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js +28 -1
- package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js.map +1 -1
- package/core/dist/runtime-v2/tools/artificer-output-typebox.d.ts +3 -0
- package/core/dist/runtime-v2/tools/artificer-output-typebox.d.ts.map +1 -1
- package/core/dist/runtime-v2/tools/artificer-output-typebox.js +3 -0
- package/core/dist/runtime-v2/tools/artificer-output-typebox.js.map +1 -1
- package/core/dist/runtime-v2/types/event-payload.d.ts +1 -20
- package/core/dist/runtime-v2/types/event-payload.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/event-payload.js +0 -12
- package/core/dist/runtime-v2/types/event-payload.js.map +1 -1
- package/core/dist/runtime-v2/types/event-types.d.ts +5 -34
- package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/event-types.js +0 -19
- package/core/dist/runtime-v2/types/event-types.js.map +1 -1
- package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts +63 -0
- package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/evidence-chain-contract.js +234 -9
- package/core/dist/runtime-v2/types/evidence-chain-contract.js.map +1 -1
- package/core/dist/runtime-v2/types/index.d.ts +5 -5
- package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/index.js +5 -3
- package/core/dist/runtime-v2/types/index.js.map +1 -1
- package/core/dist/runtime-v2/types/ledger-store.d.ts +30 -30
- package/core/dist/runtime-v2/types/ledger-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/ledger-store.js +10 -5
- package/core/dist/runtime-v2/types/ledger-store.js.map +1 -1
- package/core/dist/workflow-funnel-loader.d.ts +2 -2
- package/core/dist/workflow-funnel-loader.d.ts.map +1 -1
- package/core/package.json +4 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +16 -0
- package/dist/installer.js.map +1 -1
- package/package.json +1 -1
- package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.d.ts +9 -0
- package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.d.ts.map +1 -0
- package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.js +237 -0
- package/pd-cli/dist/commands/__tests__/intent-flag-wiring.test.js.map +1 -0
- package/pd-cli/dist/commands/intent.d.ts +76 -0
- package/pd-cli/dist/commands/intent.d.ts.map +1 -0
- package/pd-cli/dist/commands/intent.js +411 -0
- package/pd-cli/dist/commands/intent.js.map +1 -0
- package/pd-cli/dist/commands/runtime-init.d.ts +43 -0
- package/pd-cli/dist/commands/runtime-init.d.ts.map +1 -0
- package/pd-cli/dist/commands/runtime-init.js +264 -0
- package/pd-cli/dist/commands/runtime-init.js.map +1 -0
- package/pd-cli/dist/index.js +25 -0
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.js +6 -0
- package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -1
- package/pd-cli/package.json +1 -0
- package/plugin/dist/commands/pain.js +2 -0
- package/plugin/dist/core/behavior-example-pack-assembler.d.ts +43 -0
- package/plugin/dist/core/behavior-example-pack-assembler.js +247 -0
- package/plugin/dist/core/control-ui-db.d.ts +11 -0
- package/plugin/dist/core/control-ui-db.js +40 -16
- package/plugin/dist/core/event-log.js +0 -5
- package/plugin/dist/core/intent-doc-reader-adapter.d.ts +36 -0
- package/plugin/dist/core/intent-doc-reader-adapter.js +76 -0
- package/plugin/dist/core/intent-doc-reader.d.ts +89 -0
- package/plugin/dist/core/intent-doc-reader.js +210 -0
- package/plugin/dist/core/principle-tree-ledger.d.ts +27 -79
- package/plugin/dist/core/principle-tree-ledger.js +39 -524
- package/plugin/dist/core/reflection/reflection-context.d.ts +2 -2
- package/plugin/dist/core/rule-context-assembler.d.ts +45 -0
- package/plugin/dist/core/rule-context-assembler.js +148 -0
- package/plugin/dist/core/thinking-models.d.ts +12 -57
- package/plugin/dist/core/thinking-models.js +18 -224
- package/plugin/dist/core/trajectory-types.d.ts +18 -0
- package/plugin/dist/core/trajectory.d.ts +50 -2
- package/plugin/dist/core/trajectory.js +435 -254
- package/plugin/dist/core/workspace-context.d.ts +2 -3
- package/plugin/dist/hooks/gate.js +59 -2
- package/plugin/dist/hooks/pain.js +5 -0
- package/plugin/dist/hooks/prompt-helpers.d.ts +19 -1
- package/plugin/dist/hooks/prompt-helpers.js +39 -2
- package/plugin/dist/hooks/prompt-types.d.ts +8 -0
- package/plugin/dist/hooks/prompt.js +81 -21
- package/plugin/dist/index.d.ts +3 -1
- package/plugin/dist/index.js +10 -6
- package/plugin/dist/service/runtime-summary-service.js +1 -1
- package/plugin/dist/service/subagent-workflow/workflow-store.d.ts +14 -0
- package/plugin/dist/service/subagent-workflow/workflow-store.js +91 -2
- package/plugin/dist/types/event-types.d.ts +1 -1
- package/plugin/package.json +6 -3
- package/plugin/scripts/acceptance-test.mjs +3 -3
- package/plugin/dist/core/evolution-migration.d.ts +0 -5
- package/plugin/dist/core/evolution-migration.js +0 -65
- package/plugin/dist/core/principle-tree-ledger-adapter.d.ts +0 -32
- package/plugin/dist/core/principle-tree-ledger-adapter.js +0 -125
- package/plugin/dist/core/risk-calculator.d.ts +0 -22
- package/plugin/dist/core/risk-calculator.js +0 -88
- package/plugin/dist/core/rule-host-helpers.d.ts +0 -8
- package/plugin/dist/core/rule-host-helpers.js +0 -7
- package/plugin/dist/core/rule-host-types.d.ts +0 -7
- package/plugin/dist/core/rule-host-types.js +0 -7
- package/plugin/dist/core/schema/db-types.d.ts +0 -11
- package/plugin/dist/core/schema/db-types.js +0 -5
- package/plugin/dist/core/schema/index.d.ts +0 -17
- package/plugin/dist/core/schema/index.js +0 -15
- package/plugin/dist/core/schema/migration-runner.d.ts +0 -53
- package/plugin/dist/core/schema/migration-runner.js +0 -170
- package/plugin/dist/core/schema/migrations/001-init-trajectory.d.ts +0 -6
- package/plugin/dist/core/schema/migrations/001-init-trajectory.js +0 -190
- package/plugin/dist/core/schema/migrations/002-init-central.d.ts +0 -5
- package/plugin/dist/core/schema/migrations/002-init-central.js +0 -108
- package/plugin/dist/core/schema/migrations/003-init-workflow.d.ts +0 -5
- package/plugin/dist/core/schema/migrations/003-init-workflow.js +0 -50
- package/plugin/dist/core/schema/migrations/004-add-thinking-and-gfi.d.ts +0 -8
- package/plugin/dist/core/schema/migrations/004-add-thinking-and-gfi.js +0 -66
- package/plugin/dist/core/schema/migrations/index.d.ts +0 -16
- package/plugin/dist/core/schema/migrations/index.js +0 -27
- package/plugin/dist/core/schema/schema-definitions.d.ts +0 -46
- package/plugin/dist/core/schema/schema-definitions.js +0 -599
- package/plugin/dist/service/central-database.d.ts +0 -138
- package/plugin/dist/service/central-database.js +0 -731
- package/plugin/dist/service/central-sync-service.d.ts +0 -8
- package/plugin/dist/service/central-sync-service.js +0 -71
- package/plugin/scripts/db-migrate.mjs +0 -170
- package/plugin/scripts/validate-live-path.ts +0 -462
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PRI-466: pd intent — parser-level flag wiring tests.
|
|
3
|
+
*
|
|
4
|
+
* Exercises the real Commander command tree via registerIntentCommand,
|
|
5
|
+
* verifying option metadata and parser-level dispatch (CLI Operator Gate
|
|
6
|
+
* rule 7). No handler logic is invoked — actions are captured.
|
|
7
|
+
*/
|
|
8
|
+
import { describe, it, expect } from 'vitest';
|
|
9
|
+
import { Command } from 'commander';
|
|
10
|
+
import { registerIntentCommand, parseLang } from '../intent.js';
|
|
11
|
+
function attachCapture(cmd, state) {
|
|
12
|
+
cmd.action(function captureAction(...args) {
|
|
13
|
+
let optsArg = null;
|
|
14
|
+
for (let i = args.length - 1; i >= 0; i--) {
|
|
15
|
+
const arg = args[i];
|
|
16
|
+
if (arg !== null && typeof arg === 'object' && !(arg instanceof Command)) {
|
|
17
|
+
optsArg = arg;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
state.opts = optsArg && typeof optsArg === 'object' ? optsArg : {};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function freshProgram() {
|
|
25
|
+
const program = new Command();
|
|
26
|
+
program.name('pd').exitOverride();
|
|
27
|
+
return program;
|
|
28
|
+
}
|
|
29
|
+
function requireCmd(cmd, name) {
|
|
30
|
+
if (cmd === undefined) {
|
|
31
|
+
throw new Error(`Command '${name}' not found in tree`);
|
|
32
|
+
}
|
|
33
|
+
return cmd;
|
|
34
|
+
}
|
|
35
|
+
describe('pd intent — command registration', () => {
|
|
36
|
+
it('registers "intent" command with "init" and "show" subcommands', () => {
|
|
37
|
+
const program = freshProgram();
|
|
38
|
+
registerIntentCommand(program);
|
|
39
|
+
const intentCmd = requireCmd(program.commands.find((c) => c.name() === 'intent'), 'intent');
|
|
40
|
+
const subNames = intentCmd.commands.map((c) => c.name());
|
|
41
|
+
expect(subNames).toContain('init');
|
|
42
|
+
expect(subNames).toContain('show');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
describe('pd intent init — option metadata', () => {
|
|
46
|
+
it('has --workspace (-w), --force, --dry-run, --confirm, --lang, and --json options', () => {
|
|
47
|
+
const program = freshProgram();
|
|
48
|
+
registerIntentCommand(program);
|
|
49
|
+
const intentCmd = requireCmd(program.commands.find((c) => c.name() === 'intent'), 'intent');
|
|
50
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
51
|
+
expect(initCmd.options.find((o) => o.long === '--workspace')).toBeDefined();
|
|
52
|
+
expect(initCmd.options.find((o) => o.long === '--workspace')?.short).toBe('-w');
|
|
53
|
+
expect(initCmd.options.find((o) => o.long === '--force')).toBeDefined();
|
|
54
|
+
expect(initCmd.options.find((o) => o.long === '--dry-run')).toBeDefined();
|
|
55
|
+
expect(initCmd.options.find((o) => o.long === '--confirm')).toBeDefined();
|
|
56
|
+
expect(initCmd.options.find((o) => o.long === '--lang')).toBeDefined();
|
|
57
|
+
expect(initCmd.options.find((o) => o.long === '--json')).toBeDefined();
|
|
58
|
+
});
|
|
59
|
+
it('does not register --no-json or --no-force negations', () => {
|
|
60
|
+
const program = freshProgram();
|
|
61
|
+
registerIntentCommand(program);
|
|
62
|
+
const intentCmd = requireCmd(program.commands.find((c) => c.name() === 'intent'), 'intent');
|
|
63
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
64
|
+
const noJson = initCmd.options.find((o) => o.long === '--no-json');
|
|
65
|
+
const noForce = initCmd.options.find((o) => o.long === '--no-force');
|
|
66
|
+
expect(noJson).toBeUndefined();
|
|
67
|
+
expect(noForce).toBeUndefined();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
describe('pd intent show — option metadata', () => {
|
|
71
|
+
it('has --workspace (-w), --lang, and --json options, no --force', () => {
|
|
72
|
+
const program = freshProgram();
|
|
73
|
+
registerIntentCommand(program);
|
|
74
|
+
const intentCmd = requireCmd(program.commands.find((c) => c.name() === 'intent'), 'intent');
|
|
75
|
+
const showCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'show'), 'show');
|
|
76
|
+
expect(showCmd.options.find((o) => o.long === '--workspace')).toBeDefined();
|
|
77
|
+
expect(showCmd.options.find((o) => o.long === '--workspace')?.short).toBe('-w');
|
|
78
|
+
expect(showCmd.options.find((o) => o.long === '--lang')).toBeDefined();
|
|
79
|
+
expect(showCmd.options.find((o) => o.long === '--json')).toBeDefined();
|
|
80
|
+
expect(showCmd.options.find((o) => o.long === '--force')).toBeUndefined();
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
describe('pd intent init — parser-level dispatch', () => {
|
|
84
|
+
it('parses --json as true', async () => {
|
|
85
|
+
const program = freshProgram();
|
|
86
|
+
const intentCmd = registerIntentCommand(program);
|
|
87
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
88
|
+
const captured = { opts: null };
|
|
89
|
+
attachCapture(initCmd, captured);
|
|
90
|
+
await program.parseAsync(['node', 'pd', 'intent', 'init', '--json']);
|
|
91
|
+
expect(captured.opts).not.toBeNull();
|
|
92
|
+
expect(captured.opts?.json).toBe(true);
|
|
93
|
+
});
|
|
94
|
+
it('parses --force as true', async () => {
|
|
95
|
+
const program = freshProgram();
|
|
96
|
+
const intentCmd = registerIntentCommand(program);
|
|
97
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
98
|
+
const captured = { opts: null };
|
|
99
|
+
attachCapture(initCmd, captured);
|
|
100
|
+
await program.parseAsync(['node', 'pd', 'intent', 'init', '--force']);
|
|
101
|
+
expect(captured.opts).not.toBeNull();
|
|
102
|
+
expect(captured.opts?.force).toBe(true);
|
|
103
|
+
});
|
|
104
|
+
it('parses -w as --workspace', async () => {
|
|
105
|
+
const program = freshProgram();
|
|
106
|
+
const intentCmd = registerIntentCommand(program);
|
|
107
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
108
|
+
const captured = { opts: null };
|
|
109
|
+
attachCapture(initCmd, captured);
|
|
110
|
+
await program.parseAsync(['node', 'pd', 'intent', 'init', '-w', '/tmp/ws']);
|
|
111
|
+
expect(captured.opts).not.toBeNull();
|
|
112
|
+
expect(captured.opts?.workspace).toBe('/tmp/ws');
|
|
113
|
+
});
|
|
114
|
+
it('defaults json and force to undefined when not passed', async () => {
|
|
115
|
+
const program = freshProgram();
|
|
116
|
+
const intentCmd = registerIntentCommand(program);
|
|
117
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
118
|
+
const captured = { opts: null };
|
|
119
|
+
attachCapture(initCmd, captured);
|
|
120
|
+
await program.parseAsync(['node', 'pd', 'intent', 'init']);
|
|
121
|
+
expect(captured.opts).not.toBeNull();
|
|
122
|
+
expect(captured.opts?.json).toBeUndefined();
|
|
123
|
+
expect(captured.opts?.force).toBeUndefined();
|
|
124
|
+
});
|
|
125
|
+
it('parses --dry-run as true', async () => {
|
|
126
|
+
const program = freshProgram();
|
|
127
|
+
const intentCmd = registerIntentCommand(program);
|
|
128
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
129
|
+
const captured = { opts: null };
|
|
130
|
+
attachCapture(initCmd, captured);
|
|
131
|
+
await program.parseAsync(['node', 'pd', 'intent', 'init', '--dry-run']);
|
|
132
|
+
expect(captured.opts).not.toBeNull();
|
|
133
|
+
expect(captured.opts?.dryRun).toBe(true);
|
|
134
|
+
});
|
|
135
|
+
it('parses --confirm as true', async () => {
|
|
136
|
+
const program = freshProgram();
|
|
137
|
+
const intentCmd = registerIntentCommand(program);
|
|
138
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
139
|
+
const captured = { opts: null };
|
|
140
|
+
attachCapture(initCmd, captured);
|
|
141
|
+
await program.parseAsync(['node', 'pd', 'intent', 'init', '--confirm']);
|
|
142
|
+
expect(captured.opts).not.toBeNull();
|
|
143
|
+
expect(captured.opts?.confirm).toBe(true);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
describe('pd intent show — parser-level dispatch', () => {
|
|
147
|
+
it('parses --json as true', async () => {
|
|
148
|
+
const program = freshProgram();
|
|
149
|
+
const intentCmd = registerIntentCommand(program);
|
|
150
|
+
const showCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'show'), 'show');
|
|
151
|
+
const captured = { opts: null };
|
|
152
|
+
attachCapture(showCmd, captured);
|
|
153
|
+
await program.parseAsync(['node', 'pd', 'intent', 'show', '--json']);
|
|
154
|
+
expect(captured.opts).not.toBeNull();
|
|
155
|
+
expect(captured.opts?.json).toBe(true);
|
|
156
|
+
});
|
|
157
|
+
it('parses -w as --workspace', async () => {
|
|
158
|
+
const program = freshProgram();
|
|
159
|
+
const intentCmd = registerIntentCommand(program);
|
|
160
|
+
const showCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'show'), 'show');
|
|
161
|
+
const captured = { opts: null };
|
|
162
|
+
attachCapture(showCmd, captured);
|
|
163
|
+
await program.parseAsync(['node', 'pd', 'intent', 'show', '-w', '/tmp/ws']);
|
|
164
|
+
expect(captured.opts).not.toBeNull();
|
|
165
|
+
expect(captured.opts?.workspace).toBe('/tmp/ws');
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
describe('pd intent --lang — parser-level dispatch (cli-7)', () => {
|
|
169
|
+
it('init: parses --lang zh-CN', async () => {
|
|
170
|
+
const program = freshProgram();
|
|
171
|
+
const intentCmd = registerIntentCommand(program);
|
|
172
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
173
|
+
const captured = { opts: null };
|
|
174
|
+
attachCapture(initCmd, captured);
|
|
175
|
+
await program.parseAsync(['node', 'pd', 'intent', 'init', '--lang', 'zh-CN']);
|
|
176
|
+
expect(captured.opts).not.toBeNull();
|
|
177
|
+
expect(captured.opts?.lang).toBe('zh-CN');
|
|
178
|
+
});
|
|
179
|
+
it('init: parses --lang en', async () => {
|
|
180
|
+
const program = freshProgram();
|
|
181
|
+
const intentCmd = registerIntentCommand(program);
|
|
182
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
183
|
+
const captured = { opts: null };
|
|
184
|
+
attachCapture(initCmd, captured);
|
|
185
|
+
await program.parseAsync(['node', 'pd', 'intent', 'init', '--lang', 'en']);
|
|
186
|
+
expect(captured.opts).not.toBeNull();
|
|
187
|
+
expect(captured.opts?.lang).toBe('en');
|
|
188
|
+
});
|
|
189
|
+
it('init: lang defaults to undefined when not passed', async () => {
|
|
190
|
+
const program = freshProgram();
|
|
191
|
+
const intentCmd = registerIntentCommand(program);
|
|
192
|
+
const initCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'init'), 'init');
|
|
193
|
+
const captured = { opts: null };
|
|
194
|
+
attachCapture(initCmd, captured);
|
|
195
|
+
await program.parseAsync(['node', 'pd', 'intent', 'init']);
|
|
196
|
+
expect(captured.opts).not.toBeNull();
|
|
197
|
+
expect(captured.opts?.lang).toBeUndefined();
|
|
198
|
+
});
|
|
199
|
+
it('show: parses --lang en', async () => {
|
|
200
|
+
const program = freshProgram();
|
|
201
|
+
const intentCmd = registerIntentCommand(program);
|
|
202
|
+
const showCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'show'), 'show');
|
|
203
|
+
const captured = { opts: null };
|
|
204
|
+
attachCapture(showCmd, captured);
|
|
205
|
+
await program.parseAsync(['node', 'pd', 'intent', 'show', '--lang', 'en']);
|
|
206
|
+
expect(captured.opts).not.toBeNull();
|
|
207
|
+
expect(captured.opts?.lang).toBe('en');
|
|
208
|
+
});
|
|
209
|
+
it('show: lang defaults to undefined when not passed', async () => {
|
|
210
|
+
const program = freshProgram();
|
|
211
|
+
const intentCmd = registerIntentCommand(program);
|
|
212
|
+
const showCmd = requireCmd(intentCmd.commands.find((c) => c.name() === 'show'), 'show');
|
|
213
|
+
const captured = { opts: null };
|
|
214
|
+
attachCapture(showCmd, captured);
|
|
215
|
+
await program.parseAsync(['node', 'pd', 'intent', 'show']);
|
|
216
|
+
expect(captured.opts).not.toBeNull();
|
|
217
|
+
expect(captured.opts?.lang).toBeUndefined();
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
describe('parseLang — invalid value rejection (rc-9)', () => {
|
|
221
|
+
it('returns zh-CN when value is undefined (default)', () => {
|
|
222
|
+
expect(parseLang(undefined)).toBe('zh-CN');
|
|
223
|
+
});
|
|
224
|
+
it('returns zh-CN when value is zh-CN', () => {
|
|
225
|
+
expect(parseLang('zh-CN')).toBe('zh-CN');
|
|
226
|
+
});
|
|
227
|
+
it('returns en when value is en', () => {
|
|
228
|
+
expect(parseLang('en')).toBe('en');
|
|
229
|
+
});
|
|
230
|
+
it('returns null for invalid value (no silent fallback)', () => {
|
|
231
|
+
expect(parseLang('fr')).toBeNull();
|
|
232
|
+
expect(parseLang('zh')).toBeNull();
|
|
233
|
+
expect(parseLang('english')).toBeNull();
|
|
234
|
+
expect(parseLang('')).toBeNull();
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
//# sourceMappingURL=intent-flag-wiring.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-flag-wiring.test.js","sourceRoot":"","sources":["../../../src/commands/__tests__/intent-flag-wiring.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAOhE,SAAS,aAAa,CAAC,GAAY,EAAE,KAAqB;IACxD,GAAG,CAAC,MAAM,CAAC,SAAS,aAAa,CAAC,GAAG,IAAe;QAClD,IAAI,OAAO,GAAY,IAAI,CAAC;QAC5B,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,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QAAQ,EAAE,CAAC;QACxC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pd intent — Owner-authored INTENT.md management (PRI-466).
|
|
3
|
+
*
|
|
4
|
+
* Subcommands:
|
|
5
|
+
* - init : create .principles/INTENT.{lang}.md from the canonical template
|
|
6
|
+
* - show : display a read-only summary of INTENT.{lang}.md (sections, hash, warnings)
|
|
7
|
+
*
|
|
8
|
+
* `init` is not gated by the intent_engineering flag — the Owner can
|
|
9
|
+
* initialise the intent doc at any time. `show` IS gated: flag-off returns
|
|
10
|
+
* a structured `flag_disabled` result without touching the filesystem,
|
|
11
|
+
* matching the Console backend contract.
|
|
12
|
+
*
|
|
13
|
+
* Bilingual: --lang zh-CN|en (default zh-CN) selects the intent doc language.
|
|
14
|
+
* File naming: INTENT.zh-CN.md / INTENT.en.md via getIntentFilename(lang).
|
|
15
|
+
*
|
|
16
|
+
* JSON mode is strict: --json outputs exactly one parseable JSON object on
|
|
17
|
+
* stdout (CLI Operator Gate rule 1). Failure paths include structured
|
|
18
|
+
* reason + nextAction (rule 6).
|
|
19
|
+
*
|
|
20
|
+
* ERR refs:
|
|
21
|
+
* - ERR-001 (no any): all types explicit
|
|
22
|
+
* - ERR-005 (no as bypass): no type casts on untrusted data
|
|
23
|
+
* - ERR-002 (graceful degradation with reason): all failure paths include
|
|
24
|
+
* reason + nextAction
|
|
25
|
+
* - ERR-009 (fail loud): missing file / flag-off surfaced explicitly
|
|
26
|
+
*/
|
|
27
|
+
import type { Command } from 'commander';
|
|
28
|
+
import type { IntentDocWarning, IntentLang } from '@principles/core/runtime-v2';
|
|
29
|
+
/**
|
|
30
|
+
* Parse and validate the --lang option.
|
|
31
|
+
*
|
|
32
|
+
* Returns:
|
|
33
|
+
* - 'zh-CN' | 'en' when value is undefined (default zh-CN) or a valid lang.
|
|
34
|
+
* - null when value is a non-empty string that is neither 'zh-CN' nor 'en'.
|
|
35
|
+
*
|
|
36
|
+
* rc-9: invalid values MUST NOT silently fall back to zh-CN — that would
|
|
37
|
+
* let a typo like `--lang zh` quietly write to INTENT.zh-CN.md. Callers
|
|
38
|
+
* emit a structured `invalid_lang` error when null is returned.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseLang(value: string | undefined): IntentLang | null;
|
|
41
|
+
export interface IntentInitOutput {
|
|
42
|
+
status: 'ok' | 'skipped' | 'dry_run' | 'read_error';
|
|
43
|
+
path: string;
|
|
44
|
+
overwritten: boolean;
|
|
45
|
+
reason?: string;
|
|
46
|
+
nextAction?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface IntentShowOutput {
|
|
49
|
+
status: 'ok' | 'skipped' | 'flag_disabled' | 'not_found' | 'oversized' | 'read_error';
|
|
50
|
+
flagEnabled: boolean;
|
|
51
|
+
found: boolean;
|
|
52
|
+
path?: string;
|
|
53
|
+
contentHash?: string;
|
|
54
|
+
lastEditedAt?: string;
|
|
55
|
+
sections?: Record<string, string>;
|
|
56
|
+
warnings: IntentDocWarning[];
|
|
57
|
+
reason?: string;
|
|
58
|
+
nextAction?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface IntentInitOptions {
|
|
61
|
+
workspace?: string;
|
|
62
|
+
force?: boolean;
|
|
63
|
+
json?: boolean;
|
|
64
|
+
dryRun?: boolean;
|
|
65
|
+
confirm?: boolean;
|
|
66
|
+
lang?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare function handleIntentInit(opts: IntentInitOptions): Promise<void>;
|
|
69
|
+
export interface IntentShowOptions {
|
|
70
|
+
workspace?: string;
|
|
71
|
+
json?: boolean;
|
|
72
|
+
lang?: string;
|
|
73
|
+
}
|
|
74
|
+
export declare function handleIntentShow(opts: IntentShowOptions): Promise<void>;
|
|
75
|
+
export declare function registerIntentCommand(parentCmd: Command): Command;
|
|
76
|
+
//#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