usesteady 0.1.0-alpha.1
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/LICENSE +186 -0
- package/README.md +724 -0
- package/bin/use-steady.js +13 -0
- package/dist/server-store.d.ts +68 -0
- package/dist/server-store.d.ts.map +1 -0
- package/dist/server-store.js +133 -0
- package/dist/server-store.js.map +1 -0
- package/dist/server.d.ts +35 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +569 -0
- package/dist/server.js.map +1 -0
- package/dist/src/claude/adapters/api-adapter.d.ts +99 -0
- package/dist/src/claude/adapters/api-adapter.d.ts.map +1 -0
- package/dist/src/claude/adapters/api-adapter.js +415 -0
- package/dist/src/claude/adapters/api-adapter.js.map +1 -0
- package/dist/src/claude/adapters/stub-adapter.d.ts +73 -0
- package/dist/src/claude/adapters/stub-adapter.d.ts.map +1 -0
- package/dist/src/claude/adapters/stub-adapter.js +114 -0
- package/dist/src/claude/adapters/stub-adapter.js.map +1 -0
- package/dist/src/claude/artifact-mapper.d.ts +85 -0
- package/dist/src/claude/artifact-mapper.d.ts.map +1 -0
- package/dist/src/claude/artifact-mapper.js +187 -0
- package/dist/src/claude/artifact-mapper.js.map +1 -0
- package/dist/src/claude/delivery-gate.d.ts +136 -0
- package/dist/src/claude/delivery-gate.d.ts.map +1 -0
- package/dist/src/claude/delivery-gate.js +231 -0
- package/dist/src/claude/delivery-gate.js.map +1 -0
- package/dist/src/claude/index.d.ts +24 -0
- package/dist/src/claude/index.d.ts.map +1 -0
- package/dist/src/claude/index.js +23 -0
- package/dist/src/claude/index.js.map +1 -0
- package/dist/src/claude/types.d.ts +223 -0
- package/dist/src/claude/types.d.ts.map +1 -0
- package/dist/src/claude/types.js +64 -0
- package/dist/src/claude/types.js.map +1 -0
- package/dist/src/control/compiler.d.ts +125 -0
- package/dist/src/control/compiler.d.ts.map +1 -0
- package/dist/src/control/compiler.js +179 -0
- package/dist/src/control/compiler.js.map +1 -0
- package/dist/src/control/constraints.d.ts +42 -0
- package/dist/src/control/constraints.d.ts.map +1 -0
- package/dist/src/control/constraints.js +116 -0
- package/dist/src/control/constraints.js.map +1 -0
- package/dist/src/control/drift-detector.d.ts +49 -0
- package/dist/src/control/drift-detector.d.ts.map +1 -0
- package/dist/src/control/drift-detector.js +115 -0
- package/dist/src/control/drift-detector.js.map +1 -0
- package/dist/src/control/index.d.ts +44 -0
- package/dist/src/control/index.d.ts.map +1 -0
- package/dist/src/control/index.js +40 -0
- package/dist/src/control/index.js.map +1 -0
- package/dist/src/control/types.d.ts +144 -0
- package/dist/src/control/types.d.ts.map +1 -0
- package/dist/src/control/types.js +57 -0
- package/dist/src/control/types.js.map +1 -0
- package/dist/src/cursor/adapters/inprocess-adapter.d.ts +78 -0
- package/dist/src/cursor/adapters/inprocess-adapter.d.ts.map +1 -0
- package/dist/src/cursor/adapters/inprocess-adapter.js +308 -0
- package/dist/src/cursor/adapters/inprocess-adapter.js.map +1 -0
- package/dist/src/cursor/adapters/stub-adapter.d.ts +75 -0
- package/dist/src/cursor/adapters/stub-adapter.d.ts.map +1 -0
- package/dist/src/cursor/adapters/stub-adapter.js +120 -0
- package/dist/src/cursor/adapters/stub-adapter.js.map +1 -0
- package/dist/src/cursor/artifact-mapper.d.ts +81 -0
- package/dist/src/cursor/artifact-mapper.d.ts.map +1 -0
- package/dist/src/cursor/artifact-mapper.js +203 -0
- package/dist/src/cursor/artifact-mapper.js.map +1 -0
- package/dist/src/cursor/delivery-gate.d.ts +144 -0
- package/dist/src/cursor/delivery-gate.d.ts.map +1 -0
- package/dist/src/cursor/delivery-gate.js +208 -0
- package/dist/src/cursor/delivery-gate.js.map +1 -0
- package/dist/src/cursor/glob-matcher.d.ts +30 -0
- package/dist/src/cursor/glob-matcher.d.ts.map +1 -0
- package/dist/src/cursor/glob-matcher.js +68 -0
- package/dist/src/cursor/glob-matcher.js.map +1 -0
- package/dist/src/cursor/index.d.ts +43 -0
- package/dist/src/cursor/index.d.ts.map +1 -0
- package/dist/src/cursor/index.js +44 -0
- package/dist/src/cursor/index.js.map +1 -0
- package/dist/src/cursor/ocd-evaluator.d.ts +89 -0
- package/dist/src/cursor/ocd-evaluator.d.ts.map +1 -0
- package/dist/src/cursor/ocd-evaluator.js +142 -0
- package/dist/src/cursor/ocd-evaluator.js.map +1 -0
- package/dist/src/cursor/types.d.ts +309 -0
- package/dist/src/cursor/types.d.ts.map +1 -0
- package/dist/src/cursor/types.js +48 -0
- package/dist/src/cursor/types.js.map +1 -0
- package/dist/src/execution/claude/claude-execution-coordinator.d.ts +164 -0
- package/dist/src/execution/claude/claude-execution-coordinator.d.ts.map +1 -0
- package/dist/src/execution/claude/claude-execution-coordinator.js +198 -0
- package/dist/src/execution/claude/claude-execution-coordinator.js.map +1 -0
- package/dist/src/execution/claude/index.d.ts +13 -0
- package/dist/src/execution/claude/index.d.ts.map +1 -0
- package/dist/src/execution/claude/index.js +12 -0
- package/dist/src/execution/claude/index.js.map +1 -0
- package/dist/src/execution/cursor/cursor-execution-coordinator.d.ts +216 -0
- package/dist/src/execution/cursor/cursor-execution-coordinator.d.ts.map +1 -0
- package/dist/src/execution/cursor/cursor-execution-coordinator.js +233 -0
- package/dist/src/execution/cursor/cursor-execution-coordinator.js.map +1 -0
- package/dist/src/execution/cursor/index.d.ts +20 -0
- package/dist/src/execution/cursor/index.d.ts.map +1 -0
- package/dist/src/execution/cursor/index.js +18 -0
- package/dist/src/execution/cursor/index.js.map +1 -0
- package/dist/src/execution/reminders/index.d.ts +11 -0
- package/dist/src/execution/reminders/index.d.ts.map +1 -0
- package/dist/src/execution/reminders/index.js +9 -0
- package/dist/src/execution/reminders/index.js.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-coordinator.d.ts +125 -0
- package/dist/src/execution/reminders/reminder-execution-coordinator.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-coordinator.js +129 -0
- package/dist/src/execution/reminders/reminder-execution-coordinator.js.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-types.d.ts +161 -0
- package/dist/src/execution/reminders/reminder-execution-types.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-types.js +39 -0
- package/dist/src/execution/reminders/reminder-execution-types.js.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-validator.d.ts +45 -0
- package/dist/src/execution/reminders/reminder-execution-validator.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-validator.js +92 -0
- package/dist/src/execution/reminders/reminder-execution-validator.js.map +1 -0
- package/dist/src/execution/reminders/reminder-executor.d.ts +62 -0
- package/dist/src/execution/reminders/reminder-executor.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-executor.js +113 -0
- package/dist/src/execution/reminders/reminder-executor.js.map +1 -0
- package/dist/src/execution/reminders/reminder-time-parser.d.ts +41 -0
- package/dist/src/execution/reminders/reminder-time-parser.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-time-parser.js +113 -0
- package/dist/src/execution/reminders/reminder-time-parser.js.map +1 -0
- package/dist/src/friction/auto-capture.d.ts +38 -0
- package/dist/src/friction/auto-capture.d.ts.map +1 -0
- package/dist/src/friction/auto-capture.js +133 -0
- package/dist/src/friction/auto-capture.js.map +1 -0
- package/dist/src/friction/client.d.ts +39 -0
- package/dist/src/friction/client.d.ts.map +1 -0
- package/dist/src/friction/client.js +165 -0
- package/dist/src/friction/client.js.map +1 -0
- package/dist/src/friction/config.d.ts +16 -0
- package/dist/src/friction/config.d.ts.map +1 -0
- package/dist/src/friction/config.js +56 -0
- package/dist/src/friction/config.js.map +1 -0
- package/dist/src/friction/github-auth.d.ts +41 -0
- package/dist/src/friction/github-auth.d.ts.map +1 -0
- package/dist/src/friction/github-auth.js +155 -0
- package/dist/src/friction/github-auth.js.map +1 -0
- package/dist/src/friction/github-issues.d.ts +51 -0
- package/dist/src/friction/github-issues.d.ts.map +1 -0
- package/dist/src/friction/github-issues.js +118 -0
- package/dist/src/friction/github-issues.js.map +1 -0
- package/dist/src/friction/payout-ledger.d.ts +45 -0
- package/dist/src/friction/payout-ledger.d.ts.map +1 -0
- package/dist/src/friction/payout-ledger.js +111 -0
- package/dist/src/friction/payout-ledger.js.map +1 -0
- package/dist/src/friction/queue.d.ts +42 -0
- package/dist/src/friction/queue.d.ts.map +1 -0
- package/dist/src/friction/queue.js +179 -0
- package/dist/src/friction/queue.js.map +1 -0
- package/dist/src/friction/reviewer.d.ts +42 -0
- package/dist/src/friction/reviewer.d.ts.map +1 -0
- package/dist/src/friction/reviewer.js +269 -0
- package/dist/src/friction/reviewer.js.map +1 -0
- package/dist/src/friction/types.d.ts +63 -0
- package/dist/src/friction/types.d.ts.map +1 -0
- package/dist/src/friction/types.js +18 -0
- package/dist/src/friction/types.js.map +1 -0
- package/dist/src/history/index.d.ts +39 -0
- package/dist/src/history/index.d.ts.map +1 -0
- package/dist/src/history/index.js +41 -0
- package/dist/src/history/index.js.map +1 -0
- package/dist/src/history/session-chain.d.ts +36 -0
- package/dist/src/history/session-chain.d.ts.map +1 -0
- package/dist/src/history/session-chain.js +91 -0
- package/dist/src/history/session-chain.js.map +1 -0
- package/dist/src/history/types.d.ts +130 -0
- package/dist/src/history/types.d.ts.map +1 -0
- package/dist/src/history/types.js +32 -0
- package/dist/src/history/types.js.map +1 -0
- package/dist/src/history/workflow-history.d.ts +48 -0
- package/dist/src/history/workflow-history.d.ts.map +1 -0
- package/dist/src/history/workflow-history.js +116 -0
- package/dist/src/history/workflow-history.js.map +1 -0
- package/dist/src/index.d.ts +88 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +58 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/intake/classify-intent-state.d.ts +20 -0
- package/dist/src/intake/classify-intent-state.d.ts.map +1 -0
- package/dist/src/intake/classify-intent-state.js +29 -0
- package/dist/src/intake/classify-intent-state.js.map +1 -0
- package/dist/src/intake/intake-service.d.ts +105 -0
- package/dist/src/intake/intake-service.d.ts.map +1 -0
- package/dist/src/intake/intake-service.js +407 -0
- package/dist/src/intake/intake-service.js.map +1 -0
- package/dist/src/intake/response-planner.d.ts +25 -0
- package/dist/src/intake/response-planner.d.ts.map +1 -0
- package/dist/src/intake/response-planner.js +52 -0
- package/dist/src/intake/response-planner.js.map +1 -0
- package/dist/src/intake/signal-extractor.d.ts +25 -0
- package/dist/src/intake/signal-extractor.d.ts.map +1 -0
- package/dist/src/intake/signal-extractor.js +42 -0
- package/dist/src/intake/signal-extractor.js.map +1 -0
- package/dist/src/intake/trace.d.ts +157 -0
- package/dist/src/intake/trace.d.ts.map +1 -0
- package/dist/src/intake/trace.js +38 -0
- package/dist/src/intake/trace.js.map +1 -0
- package/dist/src/intake/types.d.ts +70 -0
- package/dist/src/intake/types.d.ts.map +1 -0
- package/dist/src/intake/types.js +30 -0
- package/dist/src/intake/types.js.map +1 -0
- package/dist/src/interaction/defaults.d.ts +12 -0
- package/dist/src/interaction/defaults.d.ts.map +1 -0
- package/dist/src/interaction/defaults.js +26 -0
- package/dist/src/interaction/defaults.js.map +1 -0
- package/dist/src/interaction/guidance-order.d.ts +53 -0
- package/dist/src/interaction/guidance-order.d.ts.map +1 -0
- package/dist/src/interaction/guidance-order.js +131 -0
- package/dist/src/interaction/guidance-order.js.map +1 -0
- package/dist/src/interaction/observe.d.ts +57 -0
- package/dist/src/interaction/observe.d.ts.map +1 -0
- package/dist/src/interaction/observe.js +77 -0
- package/dist/src/interaction/observe.js.map +1 -0
- package/dist/src/interaction/selectors.d.ts +16 -0
- package/dist/src/interaction/selectors.d.ts.map +1 -0
- package/dist/src/interaction/selectors.js +23 -0
- package/dist/src/interaction/selectors.js.map +1 -0
- package/dist/src/interaction/types.d.ts +105 -0
- package/dist/src/interaction/types.d.ts.map +1 -0
- package/dist/src/interaction/types.js +48 -0
- package/dist/src/interaction/types.js.map +1 -0
- package/dist/src/interaction/updater.d.ts +22 -0
- package/dist/src/interaction/updater.d.ts.map +1 -0
- package/dist/src/interaction/updater.js +87 -0
- package/dist/src/interaction/updater.js.map +1 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-detector.d.ts +48 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-detector.d.ts.map +1 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-detector.js +107 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-detector.js.map +1 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-types.d.ts +43 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-types.d.ts.map +1 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-types.js +20 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-types.js.map +1 -0
- package/dist/src/present/boundary-explanation/index.d.ts +10 -0
- package/dist/src/present/boundary-explanation/index.d.ts.map +1 -0
- package/dist/src/present/boundary-explanation/index.js +2 -0
- package/dist/src/present/boundary-explanation/index.js.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-assertions.d.ts +70 -0
- package/dist/src/present/control-visibility/control-visibility-assertions.d.ts.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-assertions.js +138 -0
- package/dist/src/present/control-visibility/control-visibility-assertions.js.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-evaluator.d.ts +67 -0
- package/dist/src/present/control-visibility/control-visibility-evaluator.d.ts.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-evaluator.js +146 -0
- package/dist/src/present/control-visibility/control-visibility-evaluator.js.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-types.d.ts +113 -0
- package/dist/src/present/control-visibility/control-visibility-types.d.ts.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-types.js +24 -0
- package/dist/src/present/control-visibility/control-visibility-types.js.map +1 -0
- package/dist/src/present/control-visibility/index.d.ts +16 -0
- package/dist/src/present/control-visibility/index.d.ts.map +1 -0
- package/dist/src/present/control-visibility/index.js +15 -0
- package/dist/src/present/control-visibility/index.js.map +1 -0
- package/dist/src/present/format.d.ts +57 -0
- package/dist/src/present/format.d.ts.map +1 -0
- package/dist/src/present/format.js +150 -0
- package/dist/src/present/format.js.map +1 -0
- package/dist/src/present/present-coordinator.d.ts +153 -0
- package/dist/src/present/present-coordinator.d.ts.map +1 -0
- package/dist/src/present/present-coordinator.js +213 -0
- package/dist/src/present/present-coordinator.js.map +1 -0
- package/dist/src/present/reminders/index.d.ts +22 -0
- package/dist/src/present/reminders/index.d.ts.map +1 -0
- package/dist/src/present/reminders/index.js +22 -0
- package/dist/src/present/reminders/index.js.map +1 -0
- package/dist/src/present/reminders/reminder-presenter.d.ts +76 -0
- package/dist/src/present/reminders/reminder-presenter.d.ts.map +1 -0
- package/dist/src/present/reminders/reminder-presenter.js +359 -0
- package/dist/src/present/reminders/reminder-presenter.js.map +1 -0
- package/dist/src/present/reminders/reminder-renderer.d.ts +82 -0
- package/dist/src/present/reminders/reminder-renderer.d.ts.map +1 -0
- package/dist/src/present/reminders/reminder-renderer.js +136 -0
- package/dist/src/present/reminders/reminder-renderer.js.map +1 -0
- package/dist/src/present/reminders/reminder-types.d.ts +131 -0
- package/dist/src/present/reminders/reminder-types.d.ts.map +1 -0
- package/dist/src/present/reminders/reminder-types.js +29 -0
- package/dist/src/present/reminders/reminder-types.js.map +1 -0
- package/dist/src/present/types.d.ts +114 -0
- package/dist/src/present/types.d.ts.map +1 -0
- package/dist/src/present/types.js +18 -0
- package/dist/src/present/types.js.map +1 -0
- package/dist/src/product/claude-product-session.d.ts +146 -0
- package/dist/src/product/claude-product-session.d.ts.map +1 -0
- package/dist/src/product/claude-product-session.js +362 -0
- package/dist/src/product/claude-product-session.js.map +1 -0
- package/dist/src/product/cursor-product-session.d.ts +211 -0
- package/dist/src/product/cursor-product-session.d.ts.map +1 -0
- package/dist/src/product/cursor-product-session.js +390 -0
- package/dist/src/product/cursor-product-session.js.map +1 -0
- package/dist/src/product/index.d.ts +28 -0
- package/dist/src/product/index.d.ts.map +1 -0
- package/dist/src/product/index.js +22 -0
- package/dist/src/product/index.js.map +1 -0
- package/dist/src/product/session-resilience/index.d.ts +17 -0
- package/dist/src/product/session-resilience/index.d.ts.map +1 -0
- package/dist/src/product/session-resilience/index.js +15 -0
- package/dist/src/product/session-resilience/index.js.map +1 -0
- package/dist/src/product/session-resilience/session-serializer.d.ts +43 -0
- package/dist/src/product/session-resilience/session-serializer.d.ts.map +1 -0
- package/dist/src/product/session-resilience/session-serializer.js +84 -0
- package/dist/src/product/session-resilience/session-serializer.js.map +1 -0
- package/dist/src/product/session-resilience/session-snapshot-types.d.ts +35 -0
- package/dist/src/product/session-resilience/session-snapshot-types.d.ts.map +1 -0
- package/dist/src/product/session-resilience/session-snapshot-types.js +21 -0
- package/dist/src/product/session-resilience/session-snapshot-types.js.map +1 -0
- package/dist/src/product/session-resilience/session-staleness.d.ts +54 -0
- package/dist/src/product/session-resilience/session-staleness.d.ts.map +1 -0
- package/dist/src/product/session-resilience/session-staleness.js +62 -0
- package/dist/src/product/session-resilience/session-staleness.js.map +1 -0
- package/dist/src/product/session-resilience/session-summary.d.ts +40 -0
- package/dist/src/product/session-resilience/session-summary.d.ts.map +1 -0
- package/dist/src/product/session-resilience/session-summary.js +72 -0
- package/dist/src/product/session-resilience/session-summary.js.map +1 -0
- package/dist/src/prv/patterns.d.ts +32 -0
- package/dist/src/prv/patterns.d.ts.map +1 -0
- package/dist/src/prv/patterns.js +40 -0
- package/dist/src/prv/patterns.js.map +1 -0
- package/dist/src/prv/prv.d.ts +13 -0
- package/dist/src/prv/prv.d.ts.map +1 -0
- package/dist/src/prv/prv.js +22 -0
- package/dist/src/prv/prv.js.map +1 -0
- package/dist/src/prv/types.d.ts +26 -0
- package/dist/src/prv/types.d.ts.map +1 -0
- package/dist/src/prv/types.js +15 -0
- package/dist/src/prv/types.js.map +1 -0
- package/dist/src/safety/detectors/arbitrary-exec.detector.d.ts +3 -0
- package/dist/src/safety/detectors/arbitrary-exec.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/arbitrary-exec.detector.js +31 -0
- package/dist/src/safety/detectors/arbitrary-exec.detector.js.map +1 -0
- package/dist/src/safety/detectors/bulk-data-exfil.detector.d.ts +21 -0
- package/dist/src/safety/detectors/bulk-data-exfil.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/bulk-data-exfil.detector.js +90 -0
- package/dist/src/safety/detectors/bulk-data-exfil.detector.js.map +1 -0
- package/dist/src/safety/detectors/destructive.detector.d.ts +3 -0
- package/dist/src/safety/detectors/destructive.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/destructive.detector.js +28 -0
- package/dist/src/safety/detectors/destructive.detector.js.map +1 -0
- package/dist/src/safety/detectors/evasion.detector.d.ts +3 -0
- package/dist/src/safety/detectors/evasion.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/evasion.detector.js +28 -0
- package/dist/src/safety/detectors/evasion.detector.js.map +1 -0
- package/dist/src/safety/detectors/secret-access.detector.d.ts +31 -0
- package/dist/src/safety/detectors/secret-access.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/secret-access.detector.js +78 -0
- package/dist/src/safety/detectors/secret-access.detector.js.map +1 -0
- package/dist/src/safety/registry.d.ts +9 -0
- package/dist/src/safety/registry.d.ts.map +1 -0
- package/dist/src/safety/registry.js +22 -0
- package/dist/src/safety/registry.js.map +1 -0
- package/dist/src/safety/safety-gate.d.ts +16 -0
- package/dist/src/safety/safety-gate.d.ts.map +1 -0
- package/dist/src/safety/safety-gate.js +26 -0
- package/dist/src/safety/safety-gate.js.map +1 -0
- package/dist/src/safety/types.d.ts +35 -0
- package/dist/src/safety/types.d.ts.map +1 -0
- package/dist/src/safety/types.js +14 -0
- package/dist/src/safety/types.js.map +1 -0
- package/dist/src/shell/claude-shell.d.ts +63 -0
- package/dist/src/shell/claude-shell.d.ts.map +1 -0
- package/dist/src/shell/claude-shell.js +81 -0
- package/dist/src/shell/claude-shell.js.map +1 -0
- package/dist/src/shell/cli/friction-admin.d.ts +14 -0
- package/dist/src/shell/cli/friction-admin.d.ts.map +1 -0
- package/dist/src/shell/cli/friction-admin.js +276 -0
- package/dist/src/shell/cli/friction-admin.js.map +1 -0
- package/dist/src/shell/cli/friction-report.d.ts +16 -0
- package/dist/src/shell/cli/friction-report.d.ts.map +1 -0
- package/dist/src/shell/cli/friction-report.js +156 -0
- package/dist/src/shell/cli/friction-report.js.map +1 -0
- package/dist/src/shell/cli/main.d.ts +68 -0
- package/dist/src/shell/cli/main.d.ts.map +1 -0
- package/dist/src/shell/cli/main.js +488 -0
- package/dist/src/shell/cli/main.js.map +1 -0
- package/dist/src/shell/cli/use-steady.d.ts +26 -0
- package/dist/src/shell/cli/use-steady.d.ts.map +1 -0
- package/dist/src/shell/cli/use-steady.js +117 -0
- package/dist/src/shell/cli/use-steady.js.map +1 -0
- package/dist/src/shell/cursor-shell.d.ts +63 -0
- package/dist/src/shell/cursor-shell.d.ts.map +1 -0
- package/dist/src/shell/cursor-shell.js +88 -0
- package/dist/src/shell/cursor-shell.js.map +1 -0
- package/dist/src/shell/defaults.d.ts +51 -0
- package/dist/src/shell/defaults.d.ts.map +1 -0
- package/dist/src/shell/defaults.js +78 -0
- package/dist/src/shell/defaults.js.map +1 -0
- package/dist/src/shell/history-render.d.ts +56 -0
- package/dist/src/shell/history-render.d.ts.map +1 -0
- package/dist/src/shell/history-render.js +166 -0
- package/dist/src/shell/history-render.js.map +1 -0
- package/dist/src/shell/index.d.ts +43 -0
- package/dist/src/shell/index.d.ts.map +1 -0
- package/dist/src/shell/index.js +45 -0
- package/dist/src/shell/index.js.map +1 -0
- package/dist/src/shell/render.d.ts +42 -0
- package/dist/src/shell/render.d.ts.map +1 -0
- package/dist/src/shell/render.js +122 -0
- package/dist/src/shell/render.js.map +1 -0
- package/dist/src/shell/types.d.ts +46 -0
- package/dist/src/shell/types.d.ts.map +1 -0
- package/dist/src/shell/types.js +19 -0
- package/dist/src/shell/types.js.map +1 -0
- package/dist/src/shell/workflow-defaults.d.ts +23 -0
- package/dist/src/shell/workflow-defaults.d.ts.map +1 -0
- package/dist/src/shell/workflow-defaults.js +27 -0
- package/dist/src/shell/workflow-defaults.js.map +1 -0
- package/dist/src/shell/workflow-render.d.ts +54 -0
- package/dist/src/shell/workflow-render.d.ts.map +1 -0
- package/dist/src/shell/workflow-render.js +319 -0
- package/dist/src/shell/workflow-render.js.map +1 -0
- package/dist/src/shell/workflow-shell.d.ts +110 -0
- package/dist/src/shell/workflow-shell.d.ts.map +1 -0
- package/dist/src/shell/workflow-shell.js +180 -0
- package/dist/src/shell/workflow-shell.js.map +1 -0
- package/dist/src/skills/audit.d.ts +118 -0
- package/dist/src/skills/audit.d.ts.map +1 -0
- package/dist/src/skills/audit.js +147 -0
- package/dist/src/skills/audit.js.map +1 -0
- package/dist/src/skills/invocation.d.ts +131 -0
- package/dist/src/skills/invocation.d.ts.map +1 -0
- package/dist/src/skills/invocation.js +165 -0
- package/dist/src/skills/invocation.js.map +1 -0
- package/dist/src/skills/loader.d.ts +70 -0
- package/dist/src/skills/loader.d.ts.map +1 -0
- package/dist/src/skills/loader.js +220 -0
- package/dist/src/skills/loader.js.map +1 -0
- package/dist/src/skills/local-recovery-adapter.d.ts +49 -0
- package/dist/src/skills/local-recovery-adapter.d.ts.map +1 -0
- package/dist/src/skills/local-recovery-adapter.js +184 -0
- package/dist/src/skills/local-recovery-adapter.js.map +1 -0
- package/dist/src/skills/parser.d.ts +53 -0
- package/dist/src/skills/parser.d.ts.map +1 -0
- package/dist/src/skills/parser.js +336 -0
- package/dist/src/skills/parser.js.map +1 -0
- package/dist/src/skills/registry.d.ts +123 -0
- package/dist/src/skills/registry.d.ts.map +1 -0
- package/dist/src/skills/registry.js +144 -0
- package/dist/src/skills/registry.js.map +1 -0
- package/dist/src/skills/types.d.ts +242 -0
- package/dist/src/skills/types.d.ts.map +1 -0
- package/dist/src/skills/types.js +50 -0
- package/dist/src/skills/types.js.map +1 -0
- package/dist/src/skills/validator.d.ts +31 -0
- package/dist/src/skills/validator.d.ts.map +1 -0
- package/dist/src/skills/validator.js +366 -0
- package/dist/src/skills/validator.js.map +1 -0
- package/dist/src/ucp/envelope.d.ts +165 -0
- package/dist/src/ucp/envelope.d.ts.map +1 -0
- package/dist/src/ucp/envelope.js +241 -0
- package/dist/src/ucp/envelope.js.map +1 -0
- package/dist/src/ucp/hashes.d.ts +36 -0
- package/dist/src/ucp/hashes.d.ts.map +1 -0
- package/dist/src/ucp/hashes.js +59 -0
- package/dist/src/ucp/hashes.js.map +1 -0
- package/dist/src/ucp/mappers/map-artifact.d.ts +58 -0
- package/dist/src/ucp/mappers/map-artifact.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-artifact.js +51 -0
- package/dist/src/ucp/mappers/map-artifact.js.map +1 -0
- package/dist/src/ucp/mappers/map-change-interpretation.d.ts +12 -0
- package/dist/src/ucp/mappers/map-change-interpretation.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-change-interpretation.js +18 -0
- package/dist/src/ucp/mappers/map-change-interpretation.js.map +1 -0
- package/dist/src/ucp/mappers/map-completion.d.ts +10 -0
- package/dist/src/ucp/mappers/map-completion.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-completion.js +24 -0
- package/dist/src/ucp/mappers/map-completion.js.map +1 -0
- package/dist/src/ucp/mappers/map-context.d.ts +9 -0
- package/dist/src/ucp/mappers/map-context.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-context.js +13 -0
- package/dist/src/ucp/mappers/map-context.js.map +1 -0
- package/dist/src/ucp/mappers/map-debug-trace.d.ts +10 -0
- package/dist/src/ucp/mappers/map-debug-trace.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-debug-trace.js +18 -0
- package/dist/src/ucp/mappers/map-debug-trace.js.map +1 -0
- package/dist/src/ucp/mappers/map-disambiguation.d.ts +10 -0
- package/dist/src/ucp/mappers/map-disambiguation.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-disambiguation.js +21 -0
- package/dist/src/ucp/mappers/map-disambiguation.js.map +1 -0
- package/dist/src/ucp/mappers/map-execution-trace.d.ts +64 -0
- package/dist/src/ucp/mappers/map-execution-trace.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-execution-trace.js +57 -0
- package/dist/src/ucp/mappers/map-execution-trace.js.map +1 -0
- package/dist/src/ucp/mappers/map-intent-interpretation.d.ts +11 -0
- package/dist/src/ucp/mappers/map-intent-interpretation.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-intent-interpretation.js +17 -0
- package/dist/src/ucp/mappers/map-intent-interpretation.js.map +1 -0
- package/dist/src/ucp/mappers/map-intent.d.ts +9 -0
- package/dist/src/ucp/mappers/map-intent.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-intent.js +11 -0
- package/dist/src/ucp/mappers/map-intent.js.map +1 -0
- package/dist/src/ucp/mappers/map-prv.d.ts +10 -0
- package/dist/src/ucp/mappers/map-prv.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-prv.js +14 -0
- package/dist/src/ucp/mappers/map-prv.js.map +1 -0
- package/dist/src/ucp/mappers/map-reminder-execution.d.ts +57 -0
- package/dist/src/ucp/mappers/map-reminder-execution.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-reminder-execution.js +69 -0
- package/dist/src/ucp/mappers/map-reminder-execution.js.map +1 -0
- package/dist/src/ucp/mappers/map-replay-report.d.ts +81 -0
- package/dist/src/ucp/mappers/map-replay-report.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-replay-report.js +76 -0
- package/dist/src/ucp/mappers/map-replay-report.js.map +1 -0
- package/dist/src/ucp/mappers/map-response.d.ts +13 -0
- package/dist/src/ucp/mappers/map-response.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-response.js +25 -0
- package/dist/src/ucp/mappers/map-response.js.map +1 -0
- package/dist/src/ucp/mappers/map-safety.d.ts +14 -0
- package/dist/src/ucp/mappers/map-safety.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-safety.js +22 -0
- package/dist/src/ucp/mappers/map-safety.js.map +1 -0
- package/dist/src/ucp/persistence/index.d.ts +24 -0
- package/dist/src/ucp/persistence/index.d.ts.map +1 -0
- package/dist/src/ucp/persistence/index.js +22 -0
- package/dist/src/ucp/persistence/index.js.map +1 -0
- package/dist/src/ucp/persistence/query.d.ts +164 -0
- package/dist/src/ucp/persistence/query.d.ts.map +1 -0
- package/dist/src/ucp/persistence/query.js +240 -0
- package/dist/src/ucp/persistence/query.js.map +1 -0
- package/dist/src/ucp/persistence/reader.d.ts +43 -0
- package/dist/src/ucp/persistence/reader.d.ts.map +1 -0
- package/dist/src/ucp/persistence/reader.js +104 -0
- package/dist/src/ucp/persistence/reader.js.map +1 -0
- package/dist/src/ucp/persistence/store.d.ts +77 -0
- package/dist/src/ucp/persistence/store.d.ts.map +1 -0
- package/dist/src/ucp/persistence/store.js +177 -0
- package/dist/src/ucp/persistence/store.js.map +1 -0
- package/dist/src/ucp/persistence/write.d.ts +48 -0
- package/dist/src/ucp/persistence/write.d.ts.map +1 -0
- package/dist/src/ucp/persistence/write.js +59 -0
- package/dist/src/ucp/persistence/write.js.map +1 -0
- package/dist/src/ucp/projection.d.ts +146 -0
- package/dist/src/ucp/projection.d.ts.map +1 -0
- package/dist/src/ucp/projection.js +139 -0
- package/dist/src/ucp/projection.js.map +1 -0
- package/dist/src/ucp/types.d.ts +585 -0
- package/dist/src/ucp/types.d.ts.map +1 -0
- package/dist/src/ucp/types.js +57 -0
- package/dist/src/ucp/types.js.map +1 -0
- package/dist/src/understand/completion/completion.d.ts +26 -0
- package/dist/src/understand/completion/completion.d.ts.map +1 -0
- package/dist/src/understand/completion/completion.js +45 -0
- package/dist/src/understand/completion/completion.js.map +1 -0
- package/dist/src/understand/completion/rules.d.ts +61 -0
- package/dist/src/understand/completion/rules.d.ts.map +1 -0
- package/dist/src/understand/completion/rules.js +268 -0
- package/dist/src/understand/completion/rules.js.map +1 -0
- package/dist/src/understand/completion/types.d.ts +68 -0
- package/dist/src/understand/completion/types.d.ts.map +1 -0
- package/dist/src/understand/completion/types.js +34 -0
- package/dist/src/understand/completion/types.js.map +1 -0
- package/dist/src/understand/context/context-alignment.d.ts +18 -0
- package/dist/src/understand/context/context-alignment.d.ts.map +1 -0
- package/dist/src/understand/context/context-alignment.js +61 -0
- package/dist/src/understand/context/context-alignment.js.map +1 -0
- package/dist/src/understand/context/types.d.ts +20 -0
- package/dist/src/understand/context/types.d.ts.map +1 -0
- package/dist/src/understand/context/types.js +13 -0
- package/dist/src/understand/context/types.js.map +1 -0
- package/dist/src/understand/disambiguation/detectors/missing-context.detector.d.ts +12 -0
- package/dist/src/understand/disambiguation/detectors/missing-context.detector.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/detectors/missing-context.detector.js +60 -0
- package/dist/src/understand/disambiguation/detectors/missing-context.detector.js.map +1 -0
- package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.d.ts +13 -0
- package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.js +57 -0
- package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.js.map +1 -0
- package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.d.ts +16 -0
- package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.js +56 -0
- package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.js.map +1 -0
- package/dist/src/understand/disambiguation/registry.d.ts +14 -0
- package/dist/src/understand/disambiguation/registry.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/registry.js +27 -0
- package/dist/src/understand/disambiguation/registry.js.map +1 -0
- package/dist/src/understand/disambiguation/types.d.ts +34 -0
- package/dist/src/understand/disambiguation/types.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/types.js +15 -0
- package/dist/src/understand/disambiguation/types.js.map +1 -0
- package/dist/src/understand/intent-interpretation/intent-interpretation.d.ts +86 -0
- package/dist/src/understand/intent-interpretation/intent-interpretation.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/intent-interpretation.js +141 -0
- package/dist/src/understand/intent-interpretation/intent-interpretation.js.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.d.ts +33 -0
- package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.js +66 -0
- package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.js.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.d.ts +20 -0
- package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.js +80 -0
- package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.js.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.d.ts +25 -0
- package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.js +47 -0
- package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.js.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.d.ts +35 -0
- package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.js +89 -0
- package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.js.map +1 -0
- package/dist/src/understand/intent-interpretation/registry.d.ts +18 -0
- package/dist/src/understand/intent-interpretation/registry.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/registry.js +26 -0
- package/dist/src/understand/intent-interpretation/registry.js.map +1 -0
- package/dist/src/understand/intent-interpretation/types.d.ts +83 -0
- package/dist/src/understand/intent-interpretation/types.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/types.js +40 -0
- package/dist/src/understand/intent-interpretation/types.js.map +1 -0
- package/dist/src/understand/interpretation/intent.d.ts +72 -0
- package/dist/src/understand/interpretation/intent.d.ts.map +1 -0
- package/dist/src/understand/interpretation/intent.js +414 -0
- package/dist/src/understand/interpretation/intent.js.map +1 -0
- package/dist/src/understand/interpretation/interpretation.d.ts +26 -0
- package/dist/src/understand/interpretation/interpretation.d.ts.map +1 -0
- package/dist/src/understand/interpretation/interpretation.js +43 -0
- package/dist/src/understand/interpretation/interpretation.js.map +1 -0
- package/dist/src/understand/interpretation/parser.d.ts +20 -0
- package/dist/src/understand/interpretation/parser.d.ts.map +1 -0
- package/dist/src/understand/interpretation/parser.js +88 -0
- package/dist/src/understand/interpretation/parser.js.map +1 -0
- package/dist/src/understand/interpretation/rules.d.ts +19 -0
- package/dist/src/understand/interpretation/rules.d.ts.map +1 -0
- package/dist/src/understand/interpretation/rules.js +222 -0
- package/dist/src/understand/interpretation/rules.js.map +1 -0
- package/dist/src/understand/interpretation/types.d.ts +90 -0
- package/dist/src/understand/interpretation/types.d.ts.map +1 -0
- package/dist/src/understand/interpretation/types.js +29 -0
- package/dist/src/understand/interpretation/types.js.map +1 -0
- package/dist/src/understand/shared/types.d.ts +13 -0
- package/dist/src/understand/shared/types.d.ts.map +1 -0
- package/dist/src/understand/shared/types.js +9 -0
- package/dist/src/understand/shared/types.js.map +1 -0
- package/dist/src/understand/silent-guidance/index.d.ts +4 -0
- package/dist/src/understand/silent-guidance/index.d.ts.map +1 -0
- package/dist/src/understand/silent-guidance/index.js +3 -0
- package/dist/src/understand/silent-guidance/index.js.map +1 -0
- package/dist/src/understand/silent-guidance/selector.d.ts +44 -0
- package/dist/src/understand/silent-guidance/selector.d.ts.map +1 -0
- package/dist/src/understand/silent-guidance/selector.js +158 -0
- package/dist/src/understand/silent-guidance/selector.js.map +1 -0
- package/dist/src/understand/silent-guidance/templates.d.ts +31 -0
- package/dist/src/understand/silent-guidance/templates.d.ts.map +1 -0
- package/dist/src/understand/silent-guidance/templates.js +109 -0
- package/dist/src/understand/silent-guidance/templates.js.map +1 -0
- package/dist/src/understand/silent-guidance/types.d.ts +36 -0
- package/dist/src/understand/silent-guidance/types.d.ts.map +1 -0
- package/dist/src/understand/silent-guidance/types.js +2 -0
- package/dist/src/understand/silent-guidance/types.js.map +1 -0
- package/dist/src/workflow/coordinator.d.ts +197 -0
- package/dist/src/workflow/coordinator.d.ts.map +1 -0
- package/dist/src/workflow/coordinator.js +682 -0
- package/dist/src/workflow/coordinator.js.map +1 -0
- package/dist/src/workflow/index.d.ts +30 -0
- package/dist/src/workflow/index.d.ts.map +1 -0
- package/dist/src/workflow/index.js +30 -0
- package/dist/src/workflow/index.js.map +1 -0
- package/dist/src/workflow/types.d.ts +213 -0
- package/dist/src/workflow/types.d.ts.map +1 -0
- package/dist/src/workflow/types.js +27 -0
- package/dist/src/workflow/types.js.map +1 -0
- package/package.json +54 -0
- package/ui/README.md +73 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor artifact mapper — builds the initial CursorHandoffArtifact.
|
|
3
|
+
*
|
|
4
|
+
* ── Role ───────────────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* Translates an IntakeResult (mode === "execute") into a CursorHandoffArtifact
|
|
7
|
+
* with eligibility: "pending_confirmation" and an initial scopeConstraint.
|
|
8
|
+
*
|
|
9
|
+
* This is the ONLY place that proposes allowedFiles. Specifically, it reads
|
|
10
|
+
* parsedChange.filePath when present. When absent, allowedFiles starts empty.
|
|
11
|
+
*
|
|
12
|
+
* ── What this mapper does ──────────────────────────────────────────────────────
|
|
13
|
+
*
|
|
14
|
+
* 1. Extracts changeSpec from InterpretationResult (execute + structured) or
|
|
15
|
+
* IntentInterpretation (execute + vague).
|
|
16
|
+
* 2. Sets initial allowedFiles = [parsedChange.filePath] or [].
|
|
17
|
+
* 3. Sets initial prohibitedPatterns from OCD policy (defensive defaults).
|
|
18
|
+
* 4. Sets eligibility = "pending_confirmation".
|
|
19
|
+
* 5. Sets ocdClearance = { status: "cleared", rulesFired: [], conflictsDetected: [] }
|
|
20
|
+
* (OCD evaluator updates this separately — see ocd-evaluator.ts).
|
|
21
|
+
*
|
|
22
|
+
* ── What this mapper does NOT do ──────────────────────────────────────────────
|
|
23
|
+
*
|
|
24
|
+
* - Does not read the filesystem (no path resolution)
|
|
25
|
+
* - Does not call OCD (that is a separate step)
|
|
26
|
+
* - Does not set eligibility to "approved_for_cursor" (only H does that)
|
|
27
|
+
* - Does not validate H-provided paths (that is the delivery gate's job)
|
|
28
|
+
* - Does not invent file paths from intent category
|
|
29
|
+
*
|
|
30
|
+
* ── CONSTRUCTION RULE: undefined-free payloads ────────────────────────────────
|
|
31
|
+
*
|
|
32
|
+
* All payload objects must be undefined-free per UCP protocol invariant.
|
|
33
|
+
* Optional fields are omitted entirely when absent. Never assigned undefined.
|
|
34
|
+
*
|
|
35
|
+
* See: docs/cursor-allowedfiles-policy.md — population source hierarchy
|
|
36
|
+
* docs/cursor-integration-architecture.md — authority model
|
|
37
|
+
*/
|
|
38
|
+
import { hashObject } from "../ucp/hashes.js";
|
|
39
|
+
// ─── Public API ───────────────────────────────────────────────────────────────
|
|
40
|
+
/**
|
|
41
|
+
* Build the initial CursorHandoffArtifact from an IntakeResult.
|
|
42
|
+
*
|
|
43
|
+
* PRECONDITION: intake.mode === "execute". Callers must verify this before calling.
|
|
44
|
+
* Passing a non-execute IntakeResult is a caller contract violation.
|
|
45
|
+
*
|
|
46
|
+
* @param intake The completed intake result (mode must be "execute").
|
|
47
|
+
* @param intentId The ucp.intent.v1 envelope id — links back to the root intent.
|
|
48
|
+
* @param responseId The ucp.response.v1 envelope id — links back to the mode decision.
|
|
49
|
+
* @param policy The OCD policy config (for defensive prohibitedPatterns).
|
|
50
|
+
* @returns A CursorHandoffArtifact with eligibility: "pending_confirmation".
|
|
51
|
+
*/
|
|
52
|
+
export function buildCursorHandoffArtifact(intake, intentId, responseId, policy, parsedChange) {
|
|
53
|
+
const changeSpec = buildChangeSpec(intake, parsedChange);
|
|
54
|
+
const scopeConstraint = buildInitialScopeConstraint(changeSpec, policy);
|
|
55
|
+
const ocdClearance = buildInitialOCDClearance();
|
|
56
|
+
// id is content-addressed: same inputs → same id.
|
|
57
|
+
// ts is excluded (per UCP protocol). eligibility and approvedAt are NOT included
|
|
58
|
+
// in the id input — they are mutable fields that change as the flow progresses.
|
|
59
|
+
// The content identity is determined by what the edit IS, not its current state.
|
|
60
|
+
const idInput = {
|
|
61
|
+
intentId,
|
|
62
|
+
mode: "execute",
|
|
63
|
+
changeSpec,
|
|
64
|
+
responseId,
|
|
65
|
+
scopeConstraint,
|
|
66
|
+
};
|
|
67
|
+
const id = hashObject(idInput);
|
|
68
|
+
return {
|
|
69
|
+
id,
|
|
70
|
+
intentId,
|
|
71
|
+
responseId,
|
|
72
|
+
mode: "execute",
|
|
73
|
+
changeSpec,
|
|
74
|
+
ocdClearance,
|
|
75
|
+
eligibility: "pending_confirmation",
|
|
76
|
+
scopeConstraint,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Rebuild a CursorHandoffArtifact with a narrowed scopeConstraint.
|
|
81
|
+
*
|
|
82
|
+
* Called when H narrows the scope at ready_for_confirmation, or when a scope
|
|
83
|
+
* clarification answer updates allowedFiles. Produces a new artifact with a
|
|
84
|
+
* new content address (different scopeConstraint → different id).
|
|
85
|
+
*
|
|
86
|
+
* The new artifact retains the same intentId, responseId, and changeSpec.
|
|
87
|
+
* eligibility is reset to "pending_confirmation" — H must re-confirm.
|
|
88
|
+
*
|
|
89
|
+
* PRECONDITION: newAllowedFiles ⊆ current artifact.scopeConstraint.allowedFiles
|
|
90
|
+
* OR current artifact.scopeConstraint.allowedFiles is empty (H setting from empty).
|
|
91
|
+
* Callers must enforce the non-widening rule before calling.
|
|
92
|
+
*/
|
|
93
|
+
export function narrowArtifactScope(artifact, newAllowedFiles, newAllowedScopes) {
|
|
94
|
+
const newScopeConstraint = {
|
|
95
|
+
allowedFiles: newAllowedFiles,
|
|
96
|
+
allowedScopes: newAllowedScopes ?? artifact.scopeConstraint.allowedScopes,
|
|
97
|
+
prohibitedPatterns: artifact.scopeConstraint.prohibitedPatterns,
|
|
98
|
+
};
|
|
99
|
+
const idInput = {
|
|
100
|
+
intentId: artifact.intentId,
|
|
101
|
+
mode: "execute",
|
|
102
|
+
changeSpec: artifact.changeSpec,
|
|
103
|
+
responseId: artifact.responseId,
|
|
104
|
+
scopeConstraint: newScopeConstraint,
|
|
105
|
+
};
|
|
106
|
+
const id = hashObject(idInput);
|
|
107
|
+
return {
|
|
108
|
+
id,
|
|
109
|
+
intentId: artifact.intentId,
|
|
110
|
+
responseId: artifact.responseId,
|
|
111
|
+
mode: "execute",
|
|
112
|
+
changeSpec: artifact.changeSpec,
|
|
113
|
+
ocdClearance: artifact.ocdClearance,
|
|
114
|
+
eligibility: "pending_confirmation",
|
|
115
|
+
scopeConstraint: newScopeConstraint,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Approve a CursorHandoffArtifact — set eligibility to "approved_for_cursor".
|
|
120
|
+
*
|
|
121
|
+
* This is the ONLY place that sets eligibility to "approved_for_cursor".
|
|
122
|
+
* Callers must verify that H has explicitly confirmed before calling.
|
|
123
|
+
*
|
|
124
|
+
* Returns a new artifact reference. The id does NOT change (eligibility and
|
|
125
|
+
* approvedAt are not part of the content-addressed id input).
|
|
126
|
+
*/
|
|
127
|
+
export function approveArtifact(artifact, confirmedAt) {
|
|
128
|
+
return {
|
|
129
|
+
...artifact,
|
|
130
|
+
eligibility: "approved_for_cursor",
|
|
131
|
+
approvedAt: confirmedAt,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
// ─── Internal builders ────────────────────────────────────────────────────────
|
|
135
|
+
function buildChangeSpec(intake, parsedChange) {
|
|
136
|
+
const interp = intake.interpretation;
|
|
137
|
+
const intent = intake.guidance?.interpretation;
|
|
138
|
+
if (interp !== undefined) {
|
|
139
|
+
return buildChangeSpecFromInterpretation(interp, parsedChange);
|
|
140
|
+
}
|
|
141
|
+
if (intent !== undefined) {
|
|
142
|
+
return buildChangeSpecFromIntentInterpretation(intent);
|
|
143
|
+
}
|
|
144
|
+
// No interpretation of either kind — vague execute with no classification.
|
|
145
|
+
// certaintyLevel will be "unknown". changeSpec carries what we know.
|
|
146
|
+
return {
|
|
147
|
+
category: "unknown",
|
|
148
|
+
summary: intake.reason,
|
|
149
|
+
impact: [],
|
|
150
|
+
confidence: "low",
|
|
151
|
+
basis: [],
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function buildChangeSpecFromInterpretation(interp, parsedChange) {
|
|
155
|
+
// InterpretationResult carries summary/impact/confidence/category.
|
|
156
|
+
// ParsedChange (oldValue, newValue, filePath) is threaded in separately by the
|
|
157
|
+
// coordinator, which has access to both simultaneously (e.g. from parseChange(input)).
|
|
158
|
+
return {
|
|
159
|
+
category: interp.category,
|
|
160
|
+
summary: interp.summary,
|
|
161
|
+
impact: interp.impact,
|
|
162
|
+
confidence: interp.confidence,
|
|
163
|
+
basis: [],
|
|
164
|
+
...(parsedChange !== undefined ? { parsedChange } : {}),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function buildChangeSpecFromIntentInterpretation(intent) {
|
|
168
|
+
return {
|
|
169
|
+
category: intent.category,
|
|
170
|
+
summary: intent.summary,
|
|
171
|
+
impact: [],
|
|
172
|
+
confidence: intent.confidence,
|
|
173
|
+
basis: [...intent.basis],
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function buildInitialScopeConstraint(changeSpec, policy) {
|
|
177
|
+
// PROPOSE: from parsedChange.filePath only.
|
|
178
|
+
const allowedFiles = changeSpec.parsedChange?.filePath != null
|
|
179
|
+
? [changeSpec.parsedChange.filePath]
|
|
180
|
+
: [];
|
|
181
|
+
// CONSTRAIN: defensive prohibitions always applied.
|
|
182
|
+
const prohibitedPatterns = [
|
|
183
|
+
...policy.alwaysProhibitedGlobs,
|
|
184
|
+
...(allowedFiles.length === 0
|
|
185
|
+
? policy.emptyAllowedFilesAdditionalProhibitions
|
|
186
|
+
: []),
|
|
187
|
+
];
|
|
188
|
+
return {
|
|
189
|
+
allowedFiles,
|
|
190
|
+
allowedScopes: [],
|
|
191
|
+
prohibitedPatterns,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function buildInitialOCDClearance() {
|
|
195
|
+
// OCD clearance starts as "cleared" with no rules evaluated.
|
|
196
|
+
// The OCD evaluator (ocd-evaluator.ts) runs next and updates this.
|
|
197
|
+
return {
|
|
198
|
+
status: "cleared",
|
|
199
|
+
rulesFired: [],
|
|
200
|
+
conflictsDetected: [],
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=artifact-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-mapper.js","sourceRoot":"","sources":["../../../src/cursor/artifact-mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAOH,OAAO,EAAE,UAAU,EAAE,MAAqB,kBAAkB,CAAC;AAS7D,iFAAiF;AAEjF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,0BAA0B,CACxC,MAA0B,EAC1B,QAAoB,EACpB,UAAoB,EACpB,MAA6B,EAC7B,YAA2B;IAE3B,MAAM,UAAU,GAAM,eAAe,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC5D,MAAM,eAAe,GAAG,2BAA2B,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACxE,MAAM,YAAY,GAAI,wBAAwB,EAAE,CAAC;IAEjD,kDAAkD;IAClD,iFAAiF;IACjF,gFAAgF;IAChF,iFAAiF;IACjF,MAAM,OAAO,GAAG;QACd,QAAQ;QACR,IAAI,EAAE,SAAkB;QACxB,UAAU;QACV,UAAU;QACV,eAAe;KAChB,CAAC;IACF,MAAM,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAE/B,OAAO;QACL,EAAE;QACF,QAAQ;QACR,UAAU;QACV,IAAI,EAAE,SAA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AAU,CAAC,YAAY,CAAC,QAAQ,CAAC;QACpC,CAAC,CAAC,EAAE,CAAC;IAET,oDAAoD;IACpD,MAAM,kBAAkB,GAAsB;QAC5C,GAAG,MAAM,CAAC,qBAAqB;QAC/B,GAAG,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;YAC3B,CAAC,CAAC,MAAM,CAAC,uCAAuC;YAChD,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,aAAa,EAAO,EAAE;QACtB,kBAAkB;KACnB,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB;IAC/B,6DAA6D;IAC7D,mEAAmE;IACnE,OAAO;QACL,MAAM,EAAc,SAAS;QAC7B,UAAU,EAAU,EAAE;QACtB,iBAAiB,EAAG,EAAE;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor Delivery Gate — the boundary between UseSteady's authority system and Cursor.
|
|
3
|
+
*
|
|
4
|
+
* ── Role ───────────────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* The delivery gate is the ONLY path through which a CursorHandoffArtifact
|
|
7
|
+
* reaches Cursor. It enforces three invariants before any delivery occurs:
|
|
8
|
+
*
|
|
9
|
+
* 1. Eligibility check: artifact.eligibility === "approved_for_cursor"
|
|
10
|
+
* 2. Persistence: ucp.cursor_handoff.v1 persisted before Cursor is called
|
|
11
|
+
* 3. Immutability: artifact delivered === artifact persisted (same id)
|
|
12
|
+
*
|
|
13
|
+
* After delivery, it persists either ucp.cursor_receipt.v1 (accepted) or
|
|
14
|
+
* ucp.cursor_refused.v1 (refused) based on Cursor's response.
|
|
15
|
+
*
|
|
16
|
+
* ── Delivery mechanism ─────────────────────────────────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* Currently: function call via injected CursorEditorPlugin.
|
|
19
|
+
* This is the mechanism-agnostic contract: the same shapes apply regardless
|
|
20
|
+
* of transport (function call, IPC, file drop, CLI pipe).
|
|
21
|
+
*
|
|
22
|
+
* The plugin is injected at construction time so that:
|
|
23
|
+
* - Tests can inject a stub plugin without coupling to Cursor internals
|
|
24
|
+
* - The transport can be replaced without changing this module
|
|
25
|
+
*
|
|
26
|
+
* ── Three delivery paths ───────────────────────────────────────────────────────
|
|
27
|
+
*
|
|
28
|
+
* Path A (happy): persist handoff → call Cursor → accepted → persist receipt
|
|
29
|
+
* Path B (scope): persist handoff → call Cursor → refused_due_to_scope
|
|
30
|
+
* → persist refused → surface scope question
|
|
31
|
+
* Path C (error): persist handoff → call Cursor → refused_due_to_execution_error
|
|
32
|
+
* → persist refused → rejected
|
|
33
|
+
*
|
|
34
|
+
* ── Cursor plugin contract ─────────────────────────────────────────────────────
|
|
35
|
+
*
|
|
36
|
+
* CursorEditorPlugin.receive() is the only call the gate makes into Cursor.
|
|
37
|
+
* The plugin must:
|
|
38
|
+
* - Accept only CursorDeliveryRequest
|
|
39
|
+
* - Return only CursorResponse (one of three kinds)
|
|
40
|
+
* - NOT reach back into the intake pipeline
|
|
41
|
+
* - NOT call persistEnvelope (the gate owns all persistence)
|
|
42
|
+
*
|
|
43
|
+
* ── deliveryId semantics ───────────────────────────────────────────────────────
|
|
44
|
+
*
|
|
45
|
+
* deliveryId is a delivery-attempt identifier, NOT a content identifier.
|
|
46
|
+
* It is unique per attempt. Never use it for provenance chain links —
|
|
47
|
+
* use artifact.id for those. See cursor-delivery-contract.md section 8.
|
|
48
|
+
*
|
|
49
|
+
* See: docs/cursor-delivery-contract.md — full delivery contract
|
|
50
|
+
* docs/cursor-integration-architecture.md — boundary rules R1–R9
|
|
51
|
+
*/
|
|
52
|
+
import type { UCPEnvelope } from "../ucp/types.js";
|
|
53
|
+
import type { CursorHandoffArtifact, CursorDeliveryRequest, CursorResponse, CursorRefusedDueToScope, CursorRefusedDueToExecutionError } from "./types.js";
|
|
54
|
+
/**
|
|
55
|
+
* The interface the delivery gate uses to communicate with Cursor.
|
|
56
|
+
*
|
|
57
|
+
* This is the mechanism-agnostic seam. Implementations may use:
|
|
58
|
+
* - Direct function calls (same process / module boundary)
|
|
59
|
+
* - Local IPC (separate process)
|
|
60
|
+
* - File drop (audit/debug path)
|
|
61
|
+
*
|
|
62
|
+
* The plugin is responsible for:
|
|
63
|
+
* - Receiving the CursorDeliveryRequest
|
|
64
|
+
* - Applying the edit within the artifact's scopeConstraint
|
|
65
|
+
* - Returning exactly one CursorResponse kind
|
|
66
|
+
* - Emitting ucp.execution_trace.v1 on completion (after accepted)
|
|
67
|
+
*
|
|
68
|
+
* The plugin must NOT:
|
|
69
|
+
* - Re-derive intent from context
|
|
70
|
+
* - Reach back to the intake pipeline
|
|
71
|
+
* - Write files outside allowedFiles (when non-empty)
|
|
72
|
+
* - Call persistEnvelope (the gate owns all persistence)
|
|
73
|
+
*/
|
|
74
|
+
export interface CursorEditorPlugin {
|
|
75
|
+
receive(request: CursorDeliveryRequest): Promise<CursorResponse>;
|
|
76
|
+
}
|
|
77
|
+
export type DeliveryGateResult = {
|
|
78
|
+
readonly outcome: "accepted";
|
|
79
|
+
readonly deliveryId: string;
|
|
80
|
+
readonly handoffEnvelopeId: string;
|
|
81
|
+
readonly receiptEnvelopeId: string;
|
|
82
|
+
} | {
|
|
83
|
+
readonly outcome: "refused_due_to_scope";
|
|
84
|
+
readonly deliveryId: string;
|
|
85
|
+
readonly handoffEnvelopeId: string;
|
|
86
|
+
readonly refusedEnvelopeId: string;
|
|
87
|
+
readonly scopeQuestion: CursorRefusedDueToScope["scopeQuestion"];
|
|
88
|
+
} | {
|
|
89
|
+
readonly outcome: "refused_due_to_execution_error";
|
|
90
|
+
readonly deliveryId: string;
|
|
91
|
+
readonly handoffEnvelopeId: string;
|
|
92
|
+
readonly refusedEnvelopeId: string;
|
|
93
|
+
readonly errorCode: CursorRefusedDueToExecutionError["errorCode"];
|
|
94
|
+
readonly detail: string;
|
|
95
|
+
} | {
|
|
96
|
+
readonly outcome: "blocked_ineligible";
|
|
97
|
+
readonly reason: string;
|
|
98
|
+
} | {
|
|
99
|
+
readonly outcome: "blocked_persistence_failure";
|
|
100
|
+
readonly reason: string;
|
|
101
|
+
};
|
|
102
|
+
export type CursorGateDeps = {
|
|
103
|
+
/**
|
|
104
|
+
* Persistence function for the critical handoff envelope.
|
|
105
|
+
* MUST throw on failure — a failure blocks delivery entirely.
|
|
106
|
+
* Default: persistEnvelopeOrThrow(storeDir, envelope)
|
|
107
|
+
*/
|
|
108
|
+
persistStrict?: (envelope: UCPEnvelope<unknown>) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Persistence function for non-critical envelopes (receipt, refused).
|
|
111
|
+
* Must NOT throw — errors are swallowed and logged.
|
|
112
|
+
* Default: persistEnvelope(storeDir, envelope)
|
|
113
|
+
*/
|
|
114
|
+
persistBestEffort?: (envelope: UCPEnvelope<unknown>) => void;
|
|
115
|
+
};
|
|
116
|
+
export declare class CursorDeliveryGate {
|
|
117
|
+
private readonly plugin;
|
|
118
|
+
private readonly storeDir;
|
|
119
|
+
private readonly persistStrict;
|
|
120
|
+
private readonly persistBestEffort;
|
|
121
|
+
constructor(plugin: CursorEditorPlugin, storeDir: string, deps?: CursorGateDeps);
|
|
122
|
+
/**
|
|
123
|
+
* Deliver a CursorHandoffArtifact to Cursor.
|
|
124
|
+
*
|
|
125
|
+
* CONTRACT — callers must ensure:
|
|
126
|
+
* - artifact.eligibility === "approved_for_cursor" (gate re-checks and blocks if not)
|
|
127
|
+
* - artifact.ocdClearance.status is "cleared" or "conflict_accepted"
|
|
128
|
+
* - artifact.approvedAt is set (H has confirmed)
|
|
129
|
+
*
|
|
130
|
+
* CONTRACT — this function guarantees:
|
|
131
|
+
* - ucp.cursor_handoff.v1 is persisted BEFORE Cursor is called
|
|
132
|
+
* - If persistence fails, Cursor is NOT called (blocked_persistence_failure)
|
|
133
|
+
* - ucp.cursor_receipt.v1 is persisted when Cursor returns "accepted"
|
|
134
|
+
* - ucp.cursor_refused.v1 is persisted when Cursor returns either refusal
|
|
135
|
+
* - Receipt/refusal persistence failures are logged but do not block state transitions
|
|
136
|
+
* (Cursor has already taken a position; the gate cannot undo that)
|
|
137
|
+
*
|
|
138
|
+
* @param artifact The approved CursorHandoffArtifact to deliver.
|
|
139
|
+
* @returns DeliveryGateResult describing the delivery outcome.
|
|
140
|
+
*/
|
|
141
|
+
deliver(artifact: CursorHandoffArtifact): Promise<DeliveryGateResult>;
|
|
142
|
+
private tryPersistBestEffort;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=delivery-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-gate.d.ts","sourceRoot":"","sources":["../../../src/cursor/delivery-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAA2B,iBAAiB,CAAC;AAQxE,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,gCAAgC,EACjC,MAAM,YAAY,CAAC;AAIpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAClE;AAID,MAAM,MAAM,kBAAkB,GAC1B;IACE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC,GACD;IACE,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,C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CAS7B"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor Delivery Gate — the boundary between UseSteady's authority system and Cursor.
|
|
3
|
+
*
|
|
4
|
+
* ── Role ───────────────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* The delivery gate is the ONLY path through which a CursorHandoffArtifact
|
|
7
|
+
* reaches Cursor. It enforces three invariants before any delivery occurs:
|
|
8
|
+
*
|
|
9
|
+
* 1. Eligibility check: artifact.eligibility === "approved_for_cursor"
|
|
10
|
+
* 2. Persistence: ucp.cursor_handoff.v1 persisted before Cursor is called
|
|
11
|
+
* 3. Immutability: artifact delivered === artifact persisted (same id)
|
|
12
|
+
*
|
|
13
|
+
* After delivery, it persists either ucp.cursor_receipt.v1 (accepted) or
|
|
14
|
+
* ucp.cursor_refused.v1 (refused) based on Cursor's response.
|
|
15
|
+
*
|
|
16
|
+
* ── Delivery mechanism ─────────────────────────────────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* Currently: function call via injected CursorEditorPlugin.
|
|
19
|
+
* This is the mechanism-agnostic contract: the same shapes apply regardless
|
|
20
|
+
* of transport (function call, IPC, file drop, CLI pipe).
|
|
21
|
+
*
|
|
22
|
+
* The plugin is injected at construction time so that:
|
|
23
|
+
* - Tests can inject a stub plugin without coupling to Cursor internals
|
|
24
|
+
* - The transport can be replaced without changing this module
|
|
25
|
+
*
|
|
26
|
+
* ── Three delivery paths ───────────────────────────────────────────────────────
|
|
27
|
+
*
|
|
28
|
+
* Path A (happy): persist handoff → call Cursor → accepted → persist receipt
|
|
29
|
+
* Path B (scope): persist handoff → call Cursor → refused_due_to_scope
|
|
30
|
+
* → persist refused → surface scope question
|
|
31
|
+
* Path C (error): persist handoff → call Cursor → refused_due_to_execution_error
|
|
32
|
+
* → persist refused → rejected
|
|
33
|
+
*
|
|
34
|
+
* ── Cursor plugin contract ─────────────────────────────────────────────────────
|
|
35
|
+
*
|
|
36
|
+
* CursorEditorPlugin.receive() is the only call the gate makes into Cursor.
|
|
37
|
+
* The plugin must:
|
|
38
|
+
* - Accept only CursorDeliveryRequest
|
|
39
|
+
* - Return only CursorResponse (one of three kinds)
|
|
40
|
+
* - NOT reach back into the intake pipeline
|
|
41
|
+
* - NOT call persistEnvelope (the gate owns all persistence)
|
|
42
|
+
*
|
|
43
|
+
* ── deliveryId semantics ───────────────────────────────────────────────────────
|
|
44
|
+
*
|
|
45
|
+
* deliveryId is a delivery-attempt identifier, NOT a content identifier.
|
|
46
|
+
* It is unique per attempt. Never use it for provenance chain links —
|
|
47
|
+
* use artifact.id for those. See cursor-delivery-contract.md section 8.
|
|
48
|
+
*
|
|
49
|
+
* See: docs/cursor-delivery-contract.md — full delivery contract
|
|
50
|
+
* docs/cursor-integration-architecture.md — boundary rules R1–R9
|
|
51
|
+
*/
|
|
52
|
+
import { hashObject } from "../ucp/hashes.js";
|
|
53
|
+
import { persistEnvelope, persistEnvelopeOrThrow } from "../ucp/persistence/write.js";
|
|
54
|
+
import { createCursorHandoffEnvelope, createCursorReceiptEnvelope, createCursorRefusedEnvelope, } from "../ucp/envelope.js";
|
|
55
|
+
// ─── Delivery gate ────────────────────────────────────────────────────────────
|
|
56
|
+
export class CursorDeliveryGate {
|
|
57
|
+
plugin;
|
|
58
|
+
storeDir;
|
|
59
|
+
persistStrict;
|
|
60
|
+
persistBestEffort;
|
|
61
|
+
constructor(plugin, storeDir, deps = {}) {
|
|
62
|
+
this.plugin = plugin;
|
|
63
|
+
this.storeDir = storeDir;
|
|
64
|
+
this.persistStrict = deps.persistStrict
|
|
65
|
+
?? ((e) => persistEnvelopeOrThrow(storeDir, e));
|
|
66
|
+
this.persistBestEffort = deps.persistBestEffort
|
|
67
|
+
?? ((e) => persistEnvelope(storeDir, e));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Deliver a CursorHandoffArtifact to Cursor.
|
|
71
|
+
*
|
|
72
|
+
* CONTRACT — callers must ensure:
|
|
73
|
+
* - artifact.eligibility === "approved_for_cursor" (gate re-checks and blocks if not)
|
|
74
|
+
* - artifact.ocdClearance.status is "cleared" or "conflict_accepted"
|
|
75
|
+
* - artifact.approvedAt is set (H has confirmed)
|
|
76
|
+
*
|
|
77
|
+
* CONTRACT — this function guarantees:
|
|
78
|
+
* - ucp.cursor_handoff.v1 is persisted BEFORE Cursor is called
|
|
79
|
+
* - If persistence fails, Cursor is NOT called (blocked_persistence_failure)
|
|
80
|
+
* - ucp.cursor_receipt.v1 is persisted when Cursor returns "accepted"
|
|
81
|
+
* - ucp.cursor_refused.v1 is persisted when Cursor returns either refusal
|
|
82
|
+
* - Receipt/refusal persistence failures are logged but do not block state transitions
|
|
83
|
+
* (Cursor has already taken a position; the gate cannot undo that)
|
|
84
|
+
*
|
|
85
|
+
* @param artifact The approved CursorHandoffArtifact to deliver.
|
|
86
|
+
* @returns DeliveryGateResult describing the delivery outcome.
|
|
87
|
+
*/
|
|
88
|
+
async deliver(artifact) {
|
|
89
|
+
// ── Eligibility check (R2 — Boundary Rule 2) ─────────────────────────────
|
|
90
|
+
if (artifact.eligibility !== "approved_for_cursor") {
|
|
91
|
+
return {
|
|
92
|
+
outcome: "blocked_ineligible",
|
|
93
|
+
reason: `Artifact eligibility is "${artifact.eligibility}", not "approved_for_cursor".`,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const sentAt = Date.now();
|
|
97
|
+
const deliveryId = computeDeliveryId(artifact.id, sentAt);
|
|
98
|
+
// ── Point 1: Persist handoff BEFORE calling Cursor ───────────────────────
|
|
99
|
+
const handoffEnvelope = createCursorHandoffEnvelope({
|
|
100
|
+
intentId: artifact.intentId,
|
|
101
|
+
responseId: artifact.responseId,
|
|
102
|
+
eligibility: "approved_for_cursor",
|
|
103
|
+
ocdStatus: artifact.ocdClearance.status,
|
|
104
|
+
rulesFired: [...artifact.ocdClearance.rulesFired],
|
|
105
|
+
changeCategory: artifact.changeSpec.category,
|
|
106
|
+
scopeAllowedFiles: [...artifact.scopeConstraint.allowedFiles],
|
|
107
|
+
confirmedByHuman: true,
|
|
108
|
+
confirmedAt: artifact.approvedAt ?? sentAt,
|
|
109
|
+
}, { parentId: artifact.responseId, rootId: artifact.intentId });
|
|
110
|
+
try {
|
|
111
|
+
this.persistStrict(handoffEnvelope);
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
return {
|
|
115
|
+
outcome: "blocked_persistence_failure",
|
|
116
|
+
reason: `Failed to persist ucp.cursor_handoff.v1 before delivery: ${String(err)}`,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// ── Call Cursor ───────────────────────────────────────────────────────────
|
|
120
|
+
const request = { deliveryId, sentAt, artifact };
|
|
121
|
+
const response = await this.plugin.receive(request);
|
|
122
|
+
// ── Point 2a/2b: Persist based on Cursor's response ──────────────────────
|
|
123
|
+
if (response.kind === "accepted") {
|
|
124
|
+
const receiptEnvelope = createCursorReceiptEnvelope({
|
|
125
|
+
deliveryId: response.deliveryId,
|
|
126
|
+
handoffId: handoffEnvelope.id,
|
|
127
|
+
artifactId: response.artifactId,
|
|
128
|
+
receivedAt: response.receivedAt,
|
|
129
|
+
}, { parentId: handoffEnvelope.id, rootId: artifact.intentId });
|
|
130
|
+
this.tryPersistBestEffort(receiptEnvelope);
|
|
131
|
+
return {
|
|
132
|
+
outcome: "accepted",
|
|
133
|
+
deliveryId,
|
|
134
|
+
handoffEnvelopeId: handoffEnvelope.id,
|
|
135
|
+
receiptEnvelopeId: receiptEnvelope.id,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (response.kind === "refused_due_to_scope") {
|
|
139
|
+
const refusedEnvelope = createCursorRefusedEnvelope(buildRefusedPayloadFromScope(response, handoffEnvelope.id, deliveryId), { parentId: handoffEnvelope.id, rootId: artifact.intentId });
|
|
140
|
+
this.tryPersistBestEffort(refusedEnvelope);
|
|
141
|
+
return {
|
|
142
|
+
outcome: "refused_due_to_scope",
|
|
143
|
+
deliveryId,
|
|
144
|
+
handoffEnvelopeId: handoffEnvelope.id,
|
|
145
|
+
refusedEnvelopeId: refusedEnvelope.id,
|
|
146
|
+
scopeQuestion: response.scopeQuestion,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
// refused_due_to_execution_error (or unknown kind — treated as execution error)
|
|
150
|
+
const executionErrorResponse = response.kind === "refused_due_to_execution_error"
|
|
151
|
+
? response
|
|
152
|
+
: null;
|
|
153
|
+
const refusedEnvelope = createCursorRefusedEnvelope({
|
|
154
|
+
deliveryId: deliveryId,
|
|
155
|
+
handoffId: handoffEnvelope.id,
|
|
156
|
+
artifactId: artifact.id,
|
|
157
|
+
receivedAt: Date.now(),
|
|
158
|
+
refusalKind: "refused_due_to_execution_error",
|
|
159
|
+
...(executionErrorResponse !== null
|
|
160
|
+
? { errorCode: executionErrorResponse.errorCode }
|
|
161
|
+
: { errorCode: "delivery_timeout" }),
|
|
162
|
+
}, { parentId: handoffEnvelope.id, rootId: artifact.intentId });
|
|
163
|
+
this.tryPersistBestEffort(refusedEnvelope);
|
|
164
|
+
return {
|
|
165
|
+
outcome: "refused_due_to_execution_error",
|
|
166
|
+
deliveryId,
|
|
167
|
+
handoffEnvelopeId: handoffEnvelope.id,
|
|
168
|
+
refusedEnvelopeId: refusedEnvelope.id,
|
|
169
|
+
errorCode: executionErrorResponse?.errorCode ?? "delivery_timeout",
|
|
170
|
+
detail: executionErrorResponse?.detail ?? "Cursor did not respond.",
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
// ── Internal ────────────────────────────────────────────────────────────────
|
|
174
|
+
tryPersistBestEffort(envelope) {
|
|
175
|
+
try {
|
|
176
|
+
this.persistBestEffort(envelope);
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
console.warn(`[cursor-delivery-gate] Non-critical persistence failed for envelope id=${envelope.id.slice(0, 8)}… type=${envelope.type}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
184
|
+
/**
|
|
185
|
+
* Compute a delivery-attempt identifier.
|
|
186
|
+
*
|
|
187
|
+
* IMPORTANT: deliveryId is an ATTEMPT identity, not a content identity.
|
|
188
|
+
* It is unique per delivery attempt, not per artifact.
|
|
189
|
+
* Use artifact.id for provenance chain links and content deduplication.
|
|
190
|
+
* Use deliveryId for transport-level correlation only.
|
|
191
|
+
*/
|
|
192
|
+
function computeDeliveryId(artifactId, sentAt) {
|
|
193
|
+
return hashObject({ artifactId, sentAt });
|
|
194
|
+
}
|
|
195
|
+
function buildRefusedPayloadFromScope(response, handoffId, deliveryId) {
|
|
196
|
+
const { scopeQuestion } = response;
|
|
197
|
+
return {
|
|
198
|
+
deliveryId,
|
|
199
|
+
handoffId,
|
|
200
|
+
artifactId: response.artifactId,
|
|
201
|
+
receivedAt: response.receivedAt,
|
|
202
|
+
refusalKind: "refused_due_to_scope",
|
|
203
|
+
scopeQuestionKind: scopeQuestion.questionKind,
|
|
204
|
+
scopeCandidates: [...scopeQuestion.candidates],
|
|
205
|
+
scopeSearchedFor: scopeQuestion.searchedFor,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=delivery-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-gate.js","sourceRoot":"","sources":["../../../src/cursor/delivery-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAkC,kBAAkB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAsF5B,iFAAiF;AAEjF,MAAM,OAAO,kBAAkB;IAKV;IACA;IALF,aAAa,CAA2C;IACxD,iBAAiB,CAA2C;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AAS,IAAI,kBAAkB;YAC3E,MAAM,EAAc,sBAAsB,EAAE,MAAM,IAAI,yBAAyB;SAChF,CAAC;IACJ,CAAC;IAED,+EAA+E;IAEvE,oBAAoB,CAAC,QAA8B;QACzD,IAAI,CAAC;YACH,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QACnC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,IAAI,CACV,0EAA0E,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,QAAQ,CAAC,IAAI,EAAE,CAC3H,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,gFAAgF;AAEhF;;;;;;;GAOG;AACH,SAAS,iBAAiB,CAAC,UAAkB,EAAE,MAAc;IAC3D,OAAO,UAAU,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,4BAA4B,CACnC,QAAkC,EAClC,SAAiB,EACjB,UAAkB;IAElB,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;IACnC,OAAO;QACL,UAAU;QACV,SAAS;QACT,UAAU,EAAS,QAAQ,CAAC,UAAU;QACtC,UAAU,EAAS,QAAQ,CAAC,UAAU;QACtC,WAAW,EAAQ,sBAA+B;QAClD,iBAAiB,EAAE,aAAa,CAAC,YAAY;QAC7C,eAAe,EAAI,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC;QAChD,gBAAgB,EAAG,aAAa,CAAC,WAAW;KAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal glob matcher for OCD policy checks.
|
|
3
|
+
*
|
|
4
|
+
* Supports the glob features required for cursor integration:
|
|
5
|
+
* double-star - matches any sequence including path separators
|
|
6
|
+
* single-star - matches any sequence NOT including path separators
|
|
7
|
+
* question - matches exactly one non-separator character
|
|
8
|
+
*
|
|
9
|
+
* Matching rules:
|
|
10
|
+
* Paths are normalized to forward slashes before matching.
|
|
11
|
+
* Patterns are anchored (full match required, not substring).
|
|
12
|
+
* Matching is case-insensitive.
|
|
13
|
+
*
|
|
14
|
+
* See: docs/cursor-allowedfiles-policy.md
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Return true if filePath matches the given glob pattern.
|
|
18
|
+
*
|
|
19
|
+
* @param filePath File path to test. Backslashes are normalized to forward slashes.
|
|
20
|
+
* @param pattern Glob pattern. Supports double-star, single-star, and question-mark.
|
|
21
|
+
*/
|
|
22
|
+
export declare function matchesGlob(filePath: string, pattern: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Convert a glob pattern to an anchored, case-insensitive RegExp.
|
|
25
|
+
*
|
|
26
|
+
* Uses a character-by-character scan to avoid string placeholders that
|
|
27
|
+
* could introduce control characters or confuse source parsers.
|
|
28
|
+
*/
|
|
29
|
+
export declare function globToRegex(glob: string): RegExp;
|
|
30
|
+
//# sourceMappingURL=glob-matcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob-matcher.d.ts","sourceRoot":"","sources":["../../../src/cursor/glob-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAItE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkChD"}
|