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,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion orchestrator.
|
|
3
|
+
*
|
|
4
|
+
* CONTRACT (written, not implied):
|
|
5
|
+
* 1. Completion is the sole authority on executability.
|
|
6
|
+
* 2. Disambiguation returning `unknown` does NOT block completion from
|
|
7
|
+
* returning `complete`. The pipeline always reaches completion.
|
|
8
|
+
* 3. Context-dependent executable inputs ("run again") are resolved HERE
|
|
9
|
+
* when ctx provides the required data. Completion receives full context.
|
|
10
|
+
* 4. Completion never guesses missing values. It returns guided_recovery or
|
|
11
|
+
* incomplete with explicit next steps when values are absent.
|
|
12
|
+
*
|
|
13
|
+
* Flow:
|
|
14
|
+
* 1. Iterate rules in priority order.
|
|
15
|
+
* 2. First matching non-null result is returned.
|
|
16
|
+
* 3. If no rule matches, fallback guided_recovery is returned.
|
|
17
|
+
*
|
|
18
|
+
* The fallback ensures the function always returns a result — there is no
|
|
19
|
+
* "completion does not know" state. Unknown inputs become guided_recovery.
|
|
20
|
+
*/
|
|
21
|
+
import type { CompletionResult } from "./types.js";
|
|
22
|
+
import type { UnderstandContext } from "../shared/types.js";
|
|
23
|
+
import { ALL_COMPLETION_RULES } from "./rules.js";
|
|
24
|
+
export declare function runCompletion(input: string, ctx: UnderstandContext): CompletionResult;
|
|
25
|
+
export { ALL_COMPLETION_RULES as getCompletionRules };
|
|
26
|
+
//# sourceMappingURL=completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../../../src/understand/completion/completion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,iBAAiB,GACrB,gBAAgB,CAqBlB;AAED,OAAO,EAAE,oBAAoB,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion orchestrator.
|
|
3
|
+
*
|
|
4
|
+
* CONTRACT (written, not implied):
|
|
5
|
+
* 1. Completion is the sole authority on executability.
|
|
6
|
+
* 2. Disambiguation returning `unknown` does NOT block completion from
|
|
7
|
+
* returning `complete`. The pipeline always reaches completion.
|
|
8
|
+
* 3. Context-dependent executable inputs ("run again") are resolved HERE
|
|
9
|
+
* when ctx provides the required data. Completion receives full context.
|
|
10
|
+
* 4. Completion never guesses missing values. It returns guided_recovery or
|
|
11
|
+
* incomplete with explicit next steps when values are absent.
|
|
12
|
+
*
|
|
13
|
+
* Flow:
|
|
14
|
+
* 1. Iterate rules in priority order.
|
|
15
|
+
* 2. First matching non-null result is returned.
|
|
16
|
+
* 3. If no rule matches, fallback guided_recovery is returned.
|
|
17
|
+
*
|
|
18
|
+
* The fallback ensures the function always returns a result — there is no
|
|
19
|
+
* "completion does not know" state. Unknown inputs become guided_recovery.
|
|
20
|
+
*/
|
|
21
|
+
import { ALL_COMPLETION_RULES } from "./rules.js";
|
|
22
|
+
export function runCompletion(input, ctx) {
|
|
23
|
+
for (const rule of ALL_COMPLETION_RULES) {
|
|
24
|
+
if (rule.matches(input, ctx)) {
|
|
25
|
+
const result = rule.evaluate(input, ctx);
|
|
26
|
+
if (result !== null)
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Fallback: no rule matched.
|
|
31
|
+
// Input is unrecognised — guide with explicit format options.
|
|
32
|
+
return {
|
|
33
|
+
kind: "guided_recovery",
|
|
34
|
+
reason: "Request does not match a supported deterministic format.",
|
|
35
|
+
missing: ["specific action", "target"],
|
|
36
|
+
nextSteps: [
|
|
37
|
+
{ type: "use_exact_format", label: 'replace "" with "" in ""' },
|
|
38
|
+
{ type: "use_exact_format", label: 'commit ""' },
|
|
39
|
+
{ type: "use_exact_format", label: "run tests" },
|
|
40
|
+
{ type: "use_exact_format", label: 'read ""' },
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export { ALL_COMPLETION_RULES as getCompletionRules };
|
|
45
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../../../src/understand/completion/completion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,UAAU,aAAa,CAC3B,KAAa,EACb,GAAsB;IAEtB,KAAK,MAAM,IAAI,IAAI,oBAAoB,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YACzC,IAAI,MAAM,KAAK,IAAI;gBAAE,OAAO,MAAM,CAAC;QACrC,CAAC;IACH,CAAC;IAED,6BAA6B;IAC7B,8DAA8D;IAC9D,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,0DAA0D;QAClE,OAAO,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;QACtC,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,0BAA0B,EAAE;YAC/D,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE;YAChD,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE;YAChD,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE;SAC/C;KACF,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,oBAAoB,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion rules registry.
|
|
3
|
+
*
|
|
4
|
+
* Each rule owns a named, prioritised, testable pattern.
|
|
5
|
+
* Priority: lower number = runs first.
|
|
6
|
+
*
|
|
7
|
+
* Groups (by priority band):
|
|
8
|
+
* 1–20 Context-aware complete rules (require prior session)
|
|
9
|
+
* 21–50 Stateless complete rules (exact deterministic format)
|
|
10
|
+
* 51–70 Incomplete rules (intent clear, field missing)
|
|
11
|
+
* 71–100 Guided-recovery rules (vague intent)
|
|
12
|
+
*
|
|
13
|
+
* Rules MUST NOT guess or infer values.
|
|
14
|
+
* Rules MUST return null if the input is outside their scope.
|
|
15
|
+
*/
|
|
16
|
+
import type { CompletionRule } from "./types.js";
|
|
17
|
+
/**
|
|
18
|
+
* "run again" / "redo" when a prior session with a known last input exists.
|
|
19
|
+
* Resolves the context-dependent request to complete — the effective command
|
|
20
|
+
* is ctx.lastInput, which the caller must use for execution.
|
|
21
|
+
*/
|
|
22
|
+
export declare const rerunPreviousRule: CompletionRule;
|
|
23
|
+
export declare const runTestsRule: CompletionRule;
|
|
24
|
+
export declare const readFileRule: CompletionRule;
|
|
25
|
+
export declare const replaceExactRule: CompletionRule;
|
|
26
|
+
export declare const commitWithMessageRule: CompletionRule;
|
|
27
|
+
export declare const patchStructuredRule: CompletionRule;
|
|
28
|
+
export declare const gitOpsRule: CompletionRule;
|
|
29
|
+
/**
|
|
30
|
+
* "change bg-blue-500 to bg-red-500" — both old and new values are explicit
|
|
31
|
+
* (CSS class-name tokens), but a file path is missing. This is incomplete,
|
|
32
|
+
* not vague: the user has specified what to change but not where.
|
|
33
|
+
*
|
|
34
|
+
* Pattern: change / set <css-class> to <css-class>
|
|
35
|
+
* The CSS class token regex matches e.g. bg-red-500, text-blue-700, p-4, etc.
|
|
36
|
+
* Both sides of "to" must look like CSS tokens; otherwise falls through.
|
|
37
|
+
*/
|
|
38
|
+
export declare const changeCssClassMissingFileRule: CompletionRule;
|
|
39
|
+
/**
|
|
40
|
+
* "commit my changes", "commit everything", "commit this" — intent is commit,
|
|
41
|
+
* message is missing. Not vague; just incomplete.
|
|
42
|
+
*/
|
|
43
|
+
export declare const commitMissingMessageRule: CompletionRule;
|
|
44
|
+
/**
|
|
45
|
+
* "show latest change", "show recent change" — intent is show git history,
|
|
46
|
+
* but the exact target is underspecified. Missing: what specifically to show.
|
|
47
|
+
*/
|
|
48
|
+
export declare const showLatestChangeRule: CompletionRule;
|
|
49
|
+
export declare const vagueStyleChangeRule: CompletionRule;
|
|
50
|
+
/**
|
|
51
|
+
* "patch the file", "apply the patch" without structured params.
|
|
52
|
+
* Patch intent is present, but required fields are absent.
|
|
53
|
+
*/
|
|
54
|
+
export declare const vaguePatchRule: CompletionRule;
|
|
55
|
+
/**
|
|
56
|
+
* "update the styles", "fix the bug", "improve the performance" — generic
|
|
57
|
+
* imperative with no concrete target. Too vague to prepare any deterministic action.
|
|
58
|
+
*/
|
|
59
|
+
export declare const vagueTaskRule: CompletionRule;
|
|
60
|
+
export declare const ALL_COMPLETION_RULES: ReadonlyArray<CompletionRule>;
|
|
61
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../../src/understand/completion/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAoB,MAAM,YAAY,CAAC;AAInE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,cAe/B,CAAC;AAIF,eAAO,MAAM,YAAY,EAAE,cAS1B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAS1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAS9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,cASnC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,cASjC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cASxB,CAAC;AAKF;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,EAAE,cAiB3C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,cAiBtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAgBlC,CAAC;AAoBF,eAAO,MAAM,oBAAoB,EAAE,cAmBlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,cAiB5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,cAiB3B,CAAC;AAIF,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,cAAc,CActB,CAAC"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion rules registry.
|
|
3
|
+
*
|
|
4
|
+
* Each rule owns a named, prioritised, testable pattern.
|
|
5
|
+
* Priority: lower number = runs first.
|
|
6
|
+
*
|
|
7
|
+
* Groups (by priority band):
|
|
8
|
+
* 1–20 Context-aware complete rules (require prior session)
|
|
9
|
+
* 21–50 Stateless complete rules (exact deterministic format)
|
|
10
|
+
* 51–70 Incomplete rules (intent clear, field missing)
|
|
11
|
+
* 71–100 Guided-recovery rules (vague intent)
|
|
12
|
+
*
|
|
13
|
+
* Rules MUST NOT guess or infer values.
|
|
14
|
+
* Rules MUST return null if the input is outside their scope.
|
|
15
|
+
*/
|
|
16
|
+
// ─── Context-aware complete rules (priority 1–20) ─────────────────────────────
|
|
17
|
+
/**
|
|
18
|
+
* "run again" / "redo" when a prior session with a known last input exists.
|
|
19
|
+
* Resolves the context-dependent request to complete — the effective command
|
|
20
|
+
* is ctx.lastInput, which the caller must use for execution.
|
|
21
|
+
*/
|
|
22
|
+
export const rerunPreviousRule = {
|
|
23
|
+
id: "rerun_previous",
|
|
24
|
+
priority: 5,
|
|
25
|
+
matches(input, ctx) {
|
|
26
|
+
return (/\b(run\s+again|redo|repeat\s+last)\b/i.test(input) &&
|
|
27
|
+
ctx.hasPriorSession === true &&
|
|
28
|
+
ctx.lastInput !== undefined &&
|
|
29
|
+
ctx.lastInput.length > 0);
|
|
30
|
+
},
|
|
31
|
+
evaluate(_input, ctx) {
|
|
32
|
+
if (!ctx.hasPriorSession || !ctx.lastInput)
|
|
33
|
+
return null;
|
|
34
|
+
return { kind: "complete" };
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
// ─── Stateless complete rules (priority 21–50) ────────────────────────────────
|
|
38
|
+
export const runTestsRule = {
|
|
39
|
+
id: "run_tests",
|
|
40
|
+
priority: 21,
|
|
41
|
+
matches(input) {
|
|
42
|
+
return /^\s*(run\s+(?:the\s+)?(?:tests?|test\s+suite|unit\s+tests?|specs?|vitest)|vitest)\s*$/i.test(input);
|
|
43
|
+
},
|
|
44
|
+
evaluate() {
|
|
45
|
+
return { kind: "complete" };
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export const readFileRule = {
|
|
49
|
+
id: "read_file",
|
|
50
|
+
priority: 22,
|
|
51
|
+
matches(input) {
|
|
52
|
+
return /^\s*read\s+["']?[^\s"']+/i.test(input);
|
|
53
|
+
},
|
|
54
|
+
evaluate() {
|
|
55
|
+
return { kind: "complete" };
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export const replaceExactRule = {
|
|
59
|
+
id: "replace_exact",
|
|
60
|
+
priority: 23,
|
|
61
|
+
matches(input) {
|
|
62
|
+
return /^\s*replace\s+"[^"]+"\s+with\s+"[^"]+"\s+in\s+/i.test(input);
|
|
63
|
+
},
|
|
64
|
+
evaluate() {
|
|
65
|
+
return { kind: "complete" };
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
export const commitWithMessageRule = {
|
|
69
|
+
id: "commit_with_message",
|
|
70
|
+
priority: 24,
|
|
71
|
+
matches(input) {
|
|
72
|
+
return /^\s*(commit|git\s+commit)\s+"[^"]+"\s*$/i.test(input);
|
|
73
|
+
},
|
|
74
|
+
evaluate() {
|
|
75
|
+
return { kind: "complete" };
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
export const patchStructuredRule = {
|
|
79
|
+
id: "patch_structured",
|
|
80
|
+
priority: 25,
|
|
81
|
+
matches(input) {
|
|
82
|
+
return /^\s*patch\s+\S+\s+search="[^"]+"\s+replace="[^"]+"/i.test(input);
|
|
83
|
+
},
|
|
84
|
+
evaluate() {
|
|
85
|
+
return { kind: "complete" };
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
export const gitOpsRule = {
|
|
89
|
+
id: "git_ops",
|
|
90
|
+
priority: 26,
|
|
91
|
+
matches(input) {
|
|
92
|
+
return /^\s*(git\s+status|show\s+git\s+status|git\s+log\b|git\s+show\b|show\s+last\s+commit|show\s+(recent|last|latest)\s+commits?|show\s+commit\b|list\s*$|ls\b|stat\b|info\b)/i.test(input);
|
|
93
|
+
},
|
|
94
|
+
evaluate() {
|
|
95
|
+
return { kind: "complete" };
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
// ─── Incomplete rules (priority 51–70) ────────────────────────────────────────
|
|
99
|
+
// Intent is clear; a specific required field is absent.
|
|
100
|
+
/**
|
|
101
|
+
* "change bg-blue-500 to bg-red-500" — both old and new values are explicit
|
|
102
|
+
* (CSS class-name tokens), but a file path is missing. This is incomplete,
|
|
103
|
+
* not vague: the user has specified what to change but not where.
|
|
104
|
+
*
|
|
105
|
+
* Pattern: change / set <css-class> to <css-class>
|
|
106
|
+
* The CSS class token regex matches e.g. bg-red-500, text-blue-700, p-4, etc.
|
|
107
|
+
* Both sides of "to" must look like CSS tokens; otherwise falls through.
|
|
108
|
+
*/
|
|
109
|
+
export const changeCssClassMissingFileRule = {
|
|
110
|
+
id: "change_css_class_missing_file",
|
|
111
|
+
priority: 51,
|
|
112
|
+
matches(input) {
|
|
113
|
+
return /\b(change|set)\s+[a-z][\w-]*-\d+\s+to\s+[a-z][\w-]*-\d+\b/i.test(input);
|
|
114
|
+
},
|
|
115
|
+
evaluate() {
|
|
116
|
+
return {
|
|
117
|
+
kind: "incomplete",
|
|
118
|
+
reason: "The old and new values are clear, but a file path is required.",
|
|
119
|
+
missing: ["file path"],
|
|
120
|
+
nextSteps: [
|
|
121
|
+
{ type: "read_first", label: 'read ""' },
|
|
122
|
+
{ type: "use_exact_format", label: 'replace "" with "" in ""' },
|
|
123
|
+
],
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* "commit my changes", "commit everything", "commit this" — intent is commit,
|
|
129
|
+
* message is missing. Not vague; just incomplete.
|
|
130
|
+
*/
|
|
131
|
+
export const commitMissingMessageRule = {
|
|
132
|
+
id: "commit_missing_message",
|
|
133
|
+
priority: 55,
|
|
134
|
+
matches(input) {
|
|
135
|
+
// Commit intent without a quoted message string
|
|
136
|
+
return /\b(commit|git\s+commit)\b(?!\s*")/i.test(input);
|
|
137
|
+
},
|
|
138
|
+
evaluate() {
|
|
139
|
+
return {
|
|
140
|
+
kind: "incomplete",
|
|
141
|
+
reason: "A commit message is required.",
|
|
142
|
+
missing: ["commit message"],
|
|
143
|
+
nextSteps: [
|
|
144
|
+
{ type: "use_exact_format", label: 'commit ""' },
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* "show latest change", "show recent change" — intent is show git history,
|
|
151
|
+
* but the exact target is underspecified. Missing: what specifically to show.
|
|
152
|
+
*/
|
|
153
|
+
export const showLatestChangeRule = {
|
|
154
|
+
id: "show_latest_change",
|
|
155
|
+
priority: 60,
|
|
156
|
+
matches(input) {
|
|
157
|
+
return /\bshow\s+(latest|recent|last)\s+change\b/i.test(input);
|
|
158
|
+
},
|
|
159
|
+
evaluate() {
|
|
160
|
+
return {
|
|
161
|
+
kind: "incomplete",
|
|
162
|
+
reason: "'show latest change' requires a specific target.",
|
|
163
|
+
missing: ["specific target"],
|
|
164
|
+
nextSteps: [
|
|
165
|
+
{ type: "use_exact_format", label: "show last commit" },
|
|
166
|
+
],
|
|
167
|
+
};
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
// ─── Guided-recovery rules (priority 71–100) ──────────────────────────────────
|
|
171
|
+
// Intent is vague; the system provides a safe path without guessing values.
|
|
172
|
+
/**
|
|
173
|
+
* "make button blue", "change color to dark", "set header red" — vague visual
|
|
174
|
+
* change. File path, current value, and new value are all unknown.
|
|
175
|
+
*
|
|
176
|
+
* Exclusions (must not fire):
|
|
177
|
+
* 1. "dark mode" compound noun — config concept, not a shade change.
|
|
178
|
+
* Consistent with the dark-mode guard in color-intent.interpreter.ts.
|
|
179
|
+
* 2. Inputs whose values are explicit CSS class-name tokens (e.g., bg-red-500,
|
|
180
|
+
* text-blue-700). These have exact values but are missing only a file path;
|
|
181
|
+
* they should fall through to the completionFallback or a more specific
|
|
182
|
+
* incomplete rule — not be labelled "values unknown".
|
|
183
|
+
*/
|
|
184
|
+
const DARK_MODE_COMPOUND_RE = /\bdark\s+mode\b/i;
|
|
185
|
+
const CSS_CLASS_TOKEN_RE = /\b[a-z]+-[a-z0-9]+-\d{2,3}\b/i; // e.g. bg-red-500, text-blue-700
|
|
186
|
+
export const vagueStyleChangeRule = {
|
|
187
|
+
id: "vague_style_change",
|
|
188
|
+
priority: 75,
|
|
189
|
+
matches(input) {
|
|
190
|
+
if (DARK_MODE_COMPOUND_RE.test(input))
|
|
191
|
+
return false;
|
|
192
|
+
if (CSS_CLASS_TOKEN_RE.test(input))
|
|
193
|
+
return false;
|
|
194
|
+
return /\b(make|change|set|update)\b.{0,40}\b(blue|red|green|dark|light|white|black|color)\b/i.test(input);
|
|
195
|
+
},
|
|
196
|
+
evaluate() {
|
|
197
|
+
return {
|
|
198
|
+
kind: "guided_recovery",
|
|
199
|
+
reason: "Visual style changes require an exact file path and search/replace values.",
|
|
200
|
+
missing: ["file path", "current value", "new value"],
|
|
201
|
+
nextSteps: [
|
|
202
|
+
{ type: "read_first", label: 'read ""' },
|
|
203
|
+
{ type: "use_exact_format", label: 'replace "" with "" in ""' },
|
|
204
|
+
],
|
|
205
|
+
};
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* "patch the file", "apply the patch" without structured params.
|
|
210
|
+
* Patch intent is present, but required fields are absent.
|
|
211
|
+
*/
|
|
212
|
+
export const vaguePatchRule = {
|
|
213
|
+
id: "vague_patch",
|
|
214
|
+
priority: 80,
|
|
215
|
+
matches(input) {
|
|
216
|
+
return /\b(patch|apply\s+patch)\b(?!\s+\S+\s+search=)/i.test(input);
|
|
217
|
+
},
|
|
218
|
+
evaluate() {
|
|
219
|
+
return {
|
|
220
|
+
kind: "guided_recovery",
|
|
221
|
+
reason: "Patch requires a file path and exact search/replace values.",
|
|
222
|
+
missing: ["file path", "search value", "replace value"],
|
|
223
|
+
nextSteps: [
|
|
224
|
+
{ type: "read_first", label: 'read ""' },
|
|
225
|
+
{ type: "use_exact_format", label: 'replace "" with "" in ""' },
|
|
226
|
+
],
|
|
227
|
+
};
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* "update the styles", "fix the bug", "improve the performance" — generic
|
|
232
|
+
* imperative with no concrete target. Too vague to prepare any deterministic action.
|
|
233
|
+
*/
|
|
234
|
+
export const vagueTaskRule = {
|
|
235
|
+
id: "vague_task",
|
|
236
|
+
priority: 90,
|
|
237
|
+
matches(input) {
|
|
238
|
+
return /^\s*(update|fix|improve|refactor|clean\s+up)\b/i.test(input);
|
|
239
|
+
},
|
|
240
|
+
evaluate() {
|
|
241
|
+
return {
|
|
242
|
+
kind: "guided_recovery",
|
|
243
|
+
reason: "The request is too vague to prepare a deterministic action.",
|
|
244
|
+
missing: ["exact target", "specific change"],
|
|
245
|
+
nextSteps: [
|
|
246
|
+
{ type: "read_first", label: 'read ""' },
|
|
247
|
+
{ type: "use_exact_format", label: 'replace "" with "" in ""' },
|
|
248
|
+
],
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
};
|
|
252
|
+
// ─── Ordered registry ─────────────────────────────────────────────────────────
|
|
253
|
+
export const ALL_COMPLETION_RULES = [
|
|
254
|
+
rerunPreviousRule,
|
|
255
|
+
runTestsRule,
|
|
256
|
+
readFileRule,
|
|
257
|
+
replaceExactRule,
|
|
258
|
+
commitWithMessageRule,
|
|
259
|
+
patchStructuredRule,
|
|
260
|
+
gitOpsRule,
|
|
261
|
+
changeCssClassMissingFileRule,
|
|
262
|
+
commitMissingMessageRule,
|
|
263
|
+
showLatestChangeRule,
|
|
264
|
+
vagueStyleChangeRule,
|
|
265
|
+
vaguePatchRule,
|
|
266
|
+
vagueTaskRule,
|
|
267
|
+
].sort((a, b) => a.priority - b.priority);
|
|
268
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../../src/understand/completion/rules.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent Completion types.
|
|
3
|
+
*
|
|
4
|
+
* ── Result kinds ──────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* complete — input is deterministically actionable
|
|
7
|
+
*
|
|
8
|
+
* incomplete — intent is unambiguous, a required field is MISSING
|
|
9
|
+
* e.g. "commit my changes" → missing commit message
|
|
10
|
+
* The user knows what they want; the system knows what's needed.
|
|
11
|
+
*
|
|
12
|
+
* guided_recovery — intent is vague; system can offer a safe path forward
|
|
13
|
+
* e.g. "make button blue" → read file first, then replace
|
|
14
|
+
* The user may not know the exact form; the system guides.
|
|
15
|
+
*
|
|
16
|
+
* ── Semantic contract ─────────────────────────────────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* incomplete ≠ guided_recovery
|
|
19
|
+
*
|
|
20
|
+
* incomplete: commit my changes → missing message → commit ""
|
|
21
|
+
* guided_recovery: make button blue → vague intent → read "" then replace "" with "" in ""
|
|
22
|
+
*
|
|
23
|
+
* ── CompletionRule ────────────────────────────────────────────────────────────
|
|
24
|
+
*
|
|
25
|
+
* Completion is registry-driven. Each rule owns a named, testable pattern.
|
|
26
|
+
* Rules receive UnderstandContext so context-dependent inputs
|
|
27
|
+
* ("run again", "same as before") can be resolved when prior session exists.
|
|
28
|
+
*
|
|
29
|
+
* CONTRACT: Completion is the sole authority on executability.
|
|
30
|
+
* Disambiguation returning unknown does NOT block completion from returning complete.
|
|
31
|
+
* Context-dependent executable intent is resolved HERE, not upstream.
|
|
32
|
+
*/
|
|
33
|
+
import type { UnderstandContext } from "../shared/types.js";
|
|
34
|
+
export type CompletionNextStep = {
|
|
35
|
+
readonly type: "read_first" | "use_exact_format" | "add_missing_field";
|
|
36
|
+
readonly label: string;
|
|
37
|
+
};
|
|
38
|
+
export type CompletionResult = {
|
|
39
|
+
readonly kind: "complete";
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: "incomplete";
|
|
42
|
+
readonly reason: string;
|
|
43
|
+
readonly missing: readonly string[];
|
|
44
|
+
readonly nextSteps: readonly CompletionNextStep[];
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: "guided_recovery";
|
|
47
|
+
readonly reason: string;
|
|
48
|
+
readonly missing: readonly string[];
|
|
49
|
+
readonly nextSteps: readonly CompletionNextStep[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* A CompletionRule owns a named, prioritised, testable completion pattern.
|
|
53
|
+
*
|
|
54
|
+
* Rules MUST:
|
|
55
|
+
* - Be deterministic (same input + ctx → same output, always)
|
|
56
|
+
* - Return null only when the input is outside the rule's scope
|
|
57
|
+
* - Never guess or infer missing values
|
|
58
|
+
*
|
|
59
|
+
* Priority: lower number = runs first.
|
|
60
|
+
* First matching non-null result wins.
|
|
61
|
+
*/
|
|
62
|
+
export type CompletionRule = {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly priority: number;
|
|
65
|
+
matches(input: string, ctx: UnderstandContext): boolean;
|
|
66
|
+
evaluate(input: string, ctx: UnderstandContext): CompletionResult | null;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/understand/completion/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAC7B;IACE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACnD,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACnD,CAAC;AAEN;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,IAAI,CAAC;CAC1E,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent Completion types.
|
|
3
|
+
*
|
|
4
|
+
* ── Result kinds ──────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* complete — input is deterministically actionable
|
|
7
|
+
*
|
|
8
|
+
* incomplete — intent is unambiguous, a required field is MISSING
|
|
9
|
+
* e.g. "commit my changes" → missing commit message
|
|
10
|
+
* The user knows what they want; the system knows what's needed.
|
|
11
|
+
*
|
|
12
|
+
* guided_recovery — intent is vague; system can offer a safe path forward
|
|
13
|
+
* e.g. "make button blue" → read file first, then replace
|
|
14
|
+
* The user may not know the exact form; the system guides.
|
|
15
|
+
*
|
|
16
|
+
* ── Semantic contract ─────────────────────────────────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* incomplete ≠ guided_recovery
|
|
19
|
+
*
|
|
20
|
+
* incomplete: commit my changes → missing message → commit ""
|
|
21
|
+
* guided_recovery: make button blue → vague intent → read "" then replace "" with "" in ""
|
|
22
|
+
*
|
|
23
|
+
* ── CompletionRule ────────────────────────────────────────────────────────────
|
|
24
|
+
*
|
|
25
|
+
* Completion is registry-driven. Each rule owns a named, testable pattern.
|
|
26
|
+
* Rules receive UnderstandContext so context-dependent inputs
|
|
27
|
+
* ("run again", "same as before") can be resolved when prior session exists.
|
|
28
|
+
*
|
|
29
|
+
* CONTRACT: Completion is the sole authority on executability.
|
|
30
|
+
* Disambiguation returning unknown does NOT block completion from returning complete.
|
|
31
|
+
* Context-dependent executable intent is resolved HERE, not upstream.
|
|
32
|
+
*/
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/understand/completion/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Alignment — semantic classification of input vs. session context.
|
|
3
|
+
*
|
|
4
|
+
* CONTRACT (PRV / Context Alignment boundary):
|
|
5
|
+
* Context Alignment is SEMANTIC. It handles context-reference patterns that are
|
|
6
|
+
* too specific or phrase-dependent for PRV's lexical approach.
|
|
7
|
+
*
|
|
8
|
+
* PRV handles: again, continue, previous, same as
|
|
9
|
+
* Context Alignment handles: same file, use same, that file, my project, the config
|
|
10
|
+
*
|
|
11
|
+
* Both layers may detect context-dependency, but for different reasons:
|
|
12
|
+
* PRV: "is this input lexically dependent on missing state?"
|
|
13
|
+
* Context Alignment: "does this input reference a specific artifact that requires context?"
|
|
14
|
+
*/
|
|
15
|
+
import type { ContextAlignmentResult } from "./types.js";
|
|
16
|
+
import type { UnderstandContext } from "../shared/types.js";
|
|
17
|
+
export declare function runContextAlignment(input: string, ctx: UnderstandContext): ContextAlignmentResult;
|
|
18
|
+
//# sourceMappingURL=context-alignment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-alignment.d.ts","sourceRoot":"","sources":["../../../../src/understand/context/context-alignment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAwC5D,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,iBAAiB,GACrB,sBAAsB,CAgBxB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Alignment — semantic classification of input vs. session context.
|
|
3
|
+
*
|
|
4
|
+
* CONTRACT (PRV / Context Alignment boundary):
|
|
5
|
+
* Context Alignment is SEMANTIC. It handles context-reference patterns that are
|
|
6
|
+
* too specific or phrase-dependent for PRV's lexical approach.
|
|
7
|
+
*
|
|
8
|
+
* PRV handles: again, continue, previous, same as
|
|
9
|
+
* Context Alignment handles: same file, use same, that file, my project, the config
|
|
10
|
+
*
|
|
11
|
+
* Both layers may detect context-dependency, but for different reasons:
|
|
12
|
+
* PRV: "is this input lexically dependent on missing state?"
|
|
13
|
+
* Context Alignment: "does this input reference a specific artifact that requires context?"
|
|
14
|
+
*/
|
|
15
|
+
// ─── Non-literal patterns (social / conversational) ───────────────────────────
|
|
16
|
+
const NON_LITERAL_PATTERNS = [
|
|
17
|
+
/^\s*good\s+(morning|afternoon|evening|night)\b/i,
|
|
18
|
+
/^\s*(hello|hi|hey)\b/i,
|
|
19
|
+
/^\s*let'?s?\s+(?:get\s+)?start(?:ed)?\b/i,
|
|
20
|
+
/^\s*how\s+are\s+you\b/i,
|
|
21
|
+
/^\s*thanks?\b/i,
|
|
22
|
+
/^\s*thank\s+you\b/i,
|
|
23
|
+
/^\s*ok(ay)?\b/i,
|
|
24
|
+
/^\s*great\b/i,
|
|
25
|
+
/^\s*sounds\s+good\b/i,
|
|
26
|
+
];
|
|
27
|
+
// ─── Context-reference patterns ────────────────────────────────────────────────
|
|
28
|
+
// Specific semantic references to prior session artifacts or state.
|
|
29
|
+
// These are narrower than PRV's lexical markers — they identify the OBJECT
|
|
30
|
+
// being referenced, not just the existence of a reference word.
|
|
31
|
+
const CONTEXT_REFERENCE_PATTERNS = [
|
|
32
|
+
// File / artifact references
|
|
33
|
+
/\bsame\s+file\b/i,
|
|
34
|
+
/\bthat\s+file\b/i,
|
|
35
|
+
/\bthat\s+result\b/i,
|
|
36
|
+
/\bthat\s+approach\b/i,
|
|
37
|
+
// Session / execution references
|
|
38
|
+
/\bprevious\s+run\b/i,
|
|
39
|
+
/\bcontinue\s+from\s+before\b/i,
|
|
40
|
+
/\buse\s+the\s+same\b/i,
|
|
41
|
+
/\buse\s+same\b/i, // "use same file" (without "the")
|
|
42
|
+
// Config / project references without concrete identifiers
|
|
43
|
+
// (these are moved here from disambiguation to keep responsibility clear)
|
|
44
|
+
/\bmy\s+project\b/i,
|
|
45
|
+
/\bthe\s+config\b(?![\s".])/i, // "the config" without a following path/quote
|
|
46
|
+
];
|
|
47
|
+
export function runContextAlignment(input, ctx) {
|
|
48
|
+
if (NON_LITERAL_PATTERNS.some((p) => p.test(input))) {
|
|
49
|
+
return { kind: "non_literal" };
|
|
50
|
+
}
|
|
51
|
+
if (CONTEXT_REFERENCE_PATTERNS.some((p) => p.test(input))) {
|
|
52
|
+
if (!ctx.hasPriorSession) {
|
|
53
|
+
return {
|
|
54
|
+
kind: "hard_mismatch",
|
|
55
|
+
reason: "Input references a prior session or result, but no prior context is available.",
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return { kind: "aligned" };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=context-alignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-alignment.js","sourceRoot":"","sources":["../../../../src/understand/context/context-alignment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,iFAAiF;AAEjF,MAAM,oBAAoB,GAA0B;IAClD,iDAAiD;IACjD,uBAAuB;IACvB,0CAA0C;IAC1C,wBAAwB;IACxB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,cAAc;IACd,sBAAsB;CACvB,CAAC;AAEF,kFAAkF;AAClF,oEAAoE;AACpE,2EAA2E;AAC3E,gEAAgE;AAEhE,MAAM,0BAA0B,GAA0B;IACxD,6BAA6B;IAC7B,kBAAkB;IAClB,kBAAkB;IAClB,oBAAoB;IACpB,sBAAsB;IAEtB,iCAAiC;IACjC,qBAAqB;IACrB,+BAA+B;IAC/B,uBAAuB;IACvB,iBAAiB,EAAY,kCAAkC;IAE/D,2DAA2D;IAC3D,0EAA0E;IAC1E,mBAAmB;IACnB,6BAA6B,EAAG,8CAA8C;CAC/E,CAAC;AAEF,MAAM,UAAU,mBAAmB,CACjC,KAAa,EACb,GAAsB;IAEtB,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACpD,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IACjC,CAAC;IAED,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC1D,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC;YACzB,OAAO;gBACL,IAAI,EAAE,eAAe;gBACrB,MAAM,EACJ,gFAAgF;aACnF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Alignment types.
|
|
3
|
+
*
|
|
4
|
+
* Context Alignment classifies whether an input makes sense to process given
|
|
5
|
+
* the current session context. It is the first subsystem of the Understand layer.
|
|
6
|
+
*
|
|
7
|
+
* Results:
|
|
8
|
+
* aligned — normal processable input
|
|
9
|
+
* non_literal — conversational/social input, not a task request
|
|
10
|
+
* hard_mismatch — input requires context that does not exist
|
|
11
|
+
*/
|
|
12
|
+
export type ContextAlignmentResult = {
|
|
13
|
+
readonly kind: "aligned";
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: "non_literal";
|
|
16
|
+
} | {
|
|
17
|
+
readonly kind: "hard_mismatch";
|
|
18
|
+
readonly reason: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/understand/context/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,sBAAsB,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;CAAE,GAChC;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|