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,359 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reminder Presenter — Phase 5, Present Layer.
|
|
3
|
+
*
|
|
4
|
+
* ── Responsibility ────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* Takes raw input text and produces a ReminderPresentation, or null if the
|
|
7
|
+
* input does not contain sufficient reminder signal.
|
|
8
|
+
*
|
|
9
|
+
* ── What this is NOT ─────────────────────────────────────────────────────────
|
|
10
|
+
*
|
|
11
|
+
* NOT a new interpreter — does not enter the intake pipeline
|
|
12
|
+
* NOT an intake pipeline step — does not affect mode, signal, or intentState
|
|
13
|
+
* NOT an execution layer — does not schedule, store, or trigger anything
|
|
14
|
+
* NOT a UCP participant — produces no envelopes
|
|
15
|
+
*
|
|
16
|
+
* ── Architecture position ────────────────────────────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* Raw input → extractReminderCandidate() → ReminderCandidate | null
|
|
19
|
+
* ↓
|
|
20
|
+
* presentReminder() → ReminderPresentation | null
|
|
21
|
+
*
|
|
22
|
+
* presentReminder() is the sole public entry point.
|
|
23
|
+
* extractReminderCandidate() is exported for testing; internal to this module.
|
|
24
|
+
*
|
|
25
|
+
* ── Extraction philosophy ────────────────────────────────────────────────────
|
|
26
|
+
*
|
|
27
|
+
* Conservative: extract only what is EXPLICITLY present.
|
|
28
|
+
* If a field cannot be cleanly extracted, it becomes null.
|
|
29
|
+
* Null is never defaulted, assumed, or guessed.
|
|
30
|
+
* This is a hard contract — the Present Layer does not invent missing facts.
|
|
31
|
+
*
|
|
32
|
+
* ── No interpreter changes ───────────────────────────────────────────────────
|
|
33
|
+
*
|
|
34
|
+
* This module does not modify the interpreter registry.
|
|
35
|
+
* It does not affect guided_recovery, incomplete, or any pipeline decision.
|
|
36
|
+
* Reminder extraction is purely a PRESENTATION-LAYER concern.
|
|
37
|
+
*/
|
|
38
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
39
|
+
// Detection — must match before any extraction is attempted
|
|
40
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
41
|
+
/**
|
|
42
|
+
* A reminder signal MUST be present before extraction.
|
|
43
|
+
* If this does not match, presentReminder() returns null immediately.
|
|
44
|
+
*
|
|
45
|
+
* Recognised signals (case-insensitive):
|
|
46
|
+
* "remind me" — most common
|
|
47
|
+
* "set a reminder" — explicit creation verb
|
|
48
|
+
* "create a reminder" — explicit creation verb
|
|
49
|
+
* "add a reminder" — explicit creation verb
|
|
50
|
+
*
|
|
51
|
+
* Deliberately excluded:
|
|
52
|
+
* "don't forget" — too broad; could be a note or instruction
|
|
53
|
+
* "make sure I" — too broad; could be many things
|
|
54
|
+
* "I should remember" — too indirect
|
|
55
|
+
*/
|
|
56
|
+
const REMINDER_SIGNAL_RE = /\b(remind\s+me|set\s+(?:a\s+)?reminder|create\s+(?:a\s+)?reminder|add\s+(?:a\s+)?reminder)\b/i;
|
|
57
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
58
|
+
// Time extraction — ordered from most specific to least specific
|
|
59
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
60
|
+
/**
|
|
61
|
+
* Time patterns, evaluated in priority order.
|
|
62
|
+
* Only the FIRST match is used. More specific patterns come first.
|
|
63
|
+
*
|
|
64
|
+
* What we extract: the entire time phrase as it appears in the input.
|
|
65
|
+
* What we do NOT do: normalise to a timestamp, guess timezone, or assume date.
|
|
66
|
+
*
|
|
67
|
+
* Examples:
|
|
68
|
+
* "tomorrow morning at 9am" → "tomorrow morning at 9am"
|
|
69
|
+
* "tomorrow at 9" → "tomorrow at 9"
|
|
70
|
+
* "tomorrow morning" → "tomorrow morning"
|
|
71
|
+
* "tomorrow" → "tomorrow"
|
|
72
|
+
* "at 3pm" → "at 3pm"
|
|
73
|
+
* "in 30 minutes" → "in 30 minutes"
|
|
74
|
+
* "next Monday" → "next Monday"
|
|
75
|
+
* "on Friday" → "on Friday"
|
|
76
|
+
* "this morning" → "this morning"
|
|
77
|
+
*/
|
|
78
|
+
const TIME_PATTERNS = [
|
|
79
|
+
// "tomorrow morning/afternoon/evening at HH:MM am/pm" (most specific)
|
|
80
|
+
/\btomorrow\s+(?:morning|afternoon|evening)\s+at\s+\d{1,2}(?::\d{2})?\s*(?:am|pm)?\b/i,
|
|
81
|
+
// "tomorrow at HH:MM am/pm"
|
|
82
|
+
/\btomorrow\s+at\s+\d{1,2}(?::\d{2})?\s*(?:am|pm)?\b/i,
|
|
83
|
+
// "tomorrow morning/afternoon/evening"
|
|
84
|
+
/\btomorrow\s+(?:morning|afternoon|evening)\b/i,
|
|
85
|
+
// "tomorrow" alone
|
|
86
|
+
/\btomorrow\b/i,
|
|
87
|
+
// "today morning/afternoon/evening at HH:MM am/pm"
|
|
88
|
+
/\btoday\s+(?:morning|afternoon|evening)\s+at\s+\d{1,2}(?::\d{2})?\s*(?:am|pm)?\b/i,
|
|
89
|
+
// "today at HH:MM am/pm"
|
|
90
|
+
/\btoday\s+at\s+\d{1,2}(?::\d{2})?\s*(?:am|pm)?\b/i,
|
|
91
|
+
// "today" alone
|
|
92
|
+
/\btoday\b/i,
|
|
93
|
+
// "at HH:MM am/pm" or "at HH am/pm"
|
|
94
|
+
/\bat\s+\d{1,2}(?::\d{2})?\s*(?:am|pm)?\b/i,
|
|
95
|
+
// "in N minutes/hours/days"
|
|
96
|
+
/\bin\s+\d+\s+(?:minutes?|hours?|days?)\b/i,
|
|
97
|
+
// "next Monday/Tuesday/.../week/month"
|
|
98
|
+
/\bnext\s+(?:monday|tuesday|wednesday|thursday|friday|saturday|sunday|week|month)\b/i,
|
|
99
|
+
// "on Monday/Tuesday/..."
|
|
100
|
+
/\bon\s+(?:monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i,
|
|
101
|
+
// "this morning/afternoon/evening/weekend"
|
|
102
|
+
/\bthis\s+(?:morning|afternoon|evening|weekend)\b/i,
|
|
103
|
+
];
|
|
104
|
+
/**
|
|
105
|
+
* Extract the first matching time phrase from the input.
|
|
106
|
+
* Returns the phrase exactly as it appears in the input.
|
|
107
|
+
* Returns null if no time phrase is found.
|
|
108
|
+
*/
|
|
109
|
+
function extractTime(input) {
|
|
110
|
+
for (const pattern of TIME_PATTERNS) {
|
|
111
|
+
const match = pattern.exec(input);
|
|
112
|
+
if (match)
|
|
113
|
+
return match[0];
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
118
|
+
// Recurrence extraction
|
|
119
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
120
|
+
/**
|
|
121
|
+
* Extract an explicit recurrence phrase if present.
|
|
122
|
+
* Returns the phrase exactly as it appears in the input.
|
|
123
|
+
* Returns null if no recurrence phrase is found.
|
|
124
|
+
*
|
|
125
|
+
* Only "every [X]" patterns are considered recurrence.
|
|
126
|
+
* "daily", "weekly" without "every" are not extracted (too ambiguous without context).
|
|
127
|
+
*/
|
|
128
|
+
const RECURRENCE_RE = /\b(every\s+(?:day|morning|evening|hour|week|month|monday|tuesday|wednesday|thursday|friday|saturday|sunday|\d+\s+(?:hours?|days?|weeks?|minutes?)))\b/i;
|
|
129
|
+
function extractRecurrence(input) {
|
|
130
|
+
const match = RECURRENCE_RE.exec(input);
|
|
131
|
+
return match ? match[0] : null;
|
|
132
|
+
}
|
|
133
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
134
|
+
// Subject extraction
|
|
135
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
136
|
+
/**
|
|
137
|
+
* The time boundary regex.
|
|
138
|
+
* Used to clip the subject string at the point where time/recurrence begins.
|
|
139
|
+
* This ensures subject and time do not bleed into each other.
|
|
140
|
+
*/
|
|
141
|
+
const TIME_BOUNDARY_RE = /\s+(?:at\s+\d|tomorrow\b|today\b|in\s+\d|next\s+|on\s+(?:monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b|every\s+|this\s+(?:morning|afternoon|evening|weekend))|[,.]/i;
|
|
142
|
+
/**
|
|
143
|
+
* Subject extraction patterns — in priority order.
|
|
144
|
+
*
|
|
145
|
+
* Pattern 1: "remind me to [X]"
|
|
146
|
+
* Pattern 2: "remind me about [X]"
|
|
147
|
+
* Pattern 3: "(set|create|add) a reminder (to|for) [X]"
|
|
148
|
+
*
|
|
149
|
+
* The subject is the text between the signal and the first time/recurrence marker.
|
|
150
|
+
*
|
|
151
|
+
* "remind me" alone (with no following clause) → null (ambiguous, state = "ambiguous")
|
|
152
|
+
*/
|
|
153
|
+
const SUBJECT_PATTERNS = [
|
|
154
|
+
// "remind me to [X]"
|
|
155
|
+
/\bremind\s+me\s+to\s+(.+)/i,
|
|
156
|
+
// "remind me about [X]"
|
|
157
|
+
/\bremind\s+me\s+about\s+(.+)/i,
|
|
158
|
+
// "set/create/add a reminder to/for [X]"
|
|
159
|
+
/\b(?:set|create|add)\s+(?:a\s+)?reminder\s+(?:to|for)\s+(.+)/i,
|
|
160
|
+
];
|
|
161
|
+
/**
|
|
162
|
+
* Extract the subject from the input, given an already-extracted time_text.
|
|
163
|
+
*
|
|
164
|
+
* Strategy:
|
|
165
|
+
* 1. Find the subject candidate text using the SUBJECT_PATTERNS.
|
|
166
|
+
* 2. If time_text is known, clip the candidate just before time_text appears.
|
|
167
|
+
* 3. Otherwise, clip at the first time boundary marker.
|
|
168
|
+
* 4. Return the cleaned subject, or null if it's empty after clipping.
|
|
169
|
+
*
|
|
170
|
+
* This guarantees the subject never contains time information.
|
|
171
|
+
*/
|
|
172
|
+
function extractSubject(input, time_text) {
|
|
173
|
+
let candidate = null;
|
|
174
|
+
for (const pattern of SUBJECT_PATTERNS) {
|
|
175
|
+
const match = pattern.exec(input);
|
|
176
|
+
if (match) {
|
|
177
|
+
candidate = match[1] ?? null;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (!candidate)
|
|
182
|
+
return null;
|
|
183
|
+
// Clip at the known time_text position (exact substring match)
|
|
184
|
+
if (time_text) {
|
|
185
|
+
const idx = candidate.toLowerCase().indexOf(time_text.toLowerCase());
|
|
186
|
+
if (idx === 0) {
|
|
187
|
+
// time_text starts at the very beginning of the candidate —
|
|
188
|
+
// the entire candidate is time, not subject (e.g. "for tomorrow morning")
|
|
189
|
+
candidate = "";
|
|
190
|
+
}
|
|
191
|
+
else if (idx > 0) {
|
|
192
|
+
candidate = candidate.slice(0, idx);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
// time_text not literally in candidate — clip at any time boundary
|
|
196
|
+
const boundaryMatch = TIME_BOUNDARY_RE.exec(candidate);
|
|
197
|
+
if (boundaryMatch) {
|
|
198
|
+
candidate = candidate.slice(0, boundaryMatch.index);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
// No time_text known — clip at any time boundary in the candidate
|
|
204
|
+
const boundaryMatch = TIME_BOUNDARY_RE.exec(candidate);
|
|
205
|
+
if (boundaryMatch) {
|
|
206
|
+
candidate = candidate.slice(0, boundaryMatch.index);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const trimmed = candidate.trim();
|
|
210
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
211
|
+
}
|
|
212
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
213
|
+
// Candidate assembly
|
|
214
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
215
|
+
/**
|
|
216
|
+
* Extract all reminder candidate fields from the raw input.
|
|
217
|
+
*
|
|
218
|
+
* Returns null if no reminder signal is found.
|
|
219
|
+
* Returns a ReminderCandidate with null fields where extraction failed.
|
|
220
|
+
*
|
|
221
|
+
* The confidence level reflects what was successfully extracted:
|
|
222
|
+
* explicit = subject AND time present
|
|
223
|
+
* partial = exactly one of subject/time present
|
|
224
|
+
* ambiguous = signal matched but neither subject nor time found
|
|
225
|
+
*
|
|
226
|
+
* Exported for testing. Not part of the public barrel API.
|
|
227
|
+
*/
|
|
228
|
+
export function extractReminderCandidate(input) {
|
|
229
|
+
if (!REMINDER_SIGNAL_RE.test(input))
|
|
230
|
+
return null;
|
|
231
|
+
const time_text = extractTime(input);
|
|
232
|
+
const recurrence_text = extractRecurrence(input);
|
|
233
|
+
const subject = extractSubject(input, time_text);
|
|
234
|
+
const hasSubject = subject !== null;
|
|
235
|
+
const hasTime = time_text !== null;
|
|
236
|
+
let confidence;
|
|
237
|
+
if (hasSubject && hasTime)
|
|
238
|
+
confidence = "explicit";
|
|
239
|
+
else if (hasSubject || hasTime)
|
|
240
|
+
confidence = "partial";
|
|
241
|
+
else
|
|
242
|
+
confidence = "ambiguous";
|
|
243
|
+
return { subject, time_text, recurrence_text, confidence };
|
|
244
|
+
}
|
|
245
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
246
|
+
// State logic
|
|
247
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
248
|
+
function determineState(candidate) {
|
|
249
|
+
const { subject, time_text, confidence } = candidate;
|
|
250
|
+
// Ambiguous confidence → always ambiguous state regardless of fields
|
|
251
|
+
if (confidence === "ambiguous")
|
|
252
|
+
return "ambiguous";
|
|
253
|
+
// Both present → ready
|
|
254
|
+
if (subject !== null && time_text !== null)
|
|
255
|
+
return "ready_to_confirm";
|
|
256
|
+
// Subject only → ask for time
|
|
257
|
+
if (subject !== null && time_text === null)
|
|
258
|
+
return "needs_time";
|
|
259
|
+
// Time only → ask for subject
|
|
260
|
+
if (subject === null && time_text !== null)
|
|
261
|
+
return "needs_subject";
|
|
262
|
+
// Fallback (should not be reachable given confidence check above)
|
|
263
|
+
return "ambiguous";
|
|
264
|
+
}
|
|
265
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
266
|
+
// Missing fields
|
|
267
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
268
|
+
function buildMissingFields(candidate) {
|
|
269
|
+
const missing = [];
|
|
270
|
+
if (candidate.subject === null)
|
|
271
|
+
missing.push("subject");
|
|
272
|
+
if (candidate.time_text === null)
|
|
273
|
+
missing.push("time");
|
|
274
|
+
return missing;
|
|
275
|
+
}
|
|
276
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
277
|
+
// Actions
|
|
278
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
279
|
+
/**
|
|
280
|
+
* Build the three standard actions for a reminder presentation.
|
|
281
|
+
*
|
|
282
|
+
* ── Action rules ─────────────────────────────────────────────────────────────
|
|
283
|
+
*
|
|
284
|
+
* confirm — enabled ONLY when state === "ready_to_confirm"
|
|
285
|
+
* Requiring both subject and time prevents confirming incomplete data.
|
|
286
|
+
*
|
|
287
|
+
* edit — always enabled
|
|
288
|
+
* Label changes to "Clarify" in ambiguous state to reflect that
|
|
289
|
+
* the user needs to clarify intent, not just edit known fields.
|
|
290
|
+
*
|
|
291
|
+
* reject — always enabled
|
|
292
|
+
* The user can always dismiss a reminder presentation.
|
|
293
|
+
*
|
|
294
|
+
* These are PRESENTATION descriptors. They do not execute anything.
|
|
295
|
+
* The consumer is responsible for routing action IDs to actual behavior.
|
|
296
|
+
*/
|
|
297
|
+
function buildActions(state) {
|
|
298
|
+
return [
|
|
299
|
+
{
|
|
300
|
+
id: "confirm",
|
|
301
|
+
label: "Confirm",
|
|
302
|
+
enabled: state === "ready_to_confirm",
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: "edit",
|
|
306
|
+
label: state === "ambiguous" ? "Clarify" : "Edit",
|
|
307
|
+
enabled: true,
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "reject",
|
|
311
|
+
label: "Reject",
|
|
312
|
+
enabled: true,
|
|
313
|
+
},
|
|
314
|
+
];
|
|
315
|
+
}
|
|
316
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
317
|
+
// Public entry point
|
|
318
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
319
|
+
/**
|
|
320
|
+
* presentReminder(input) — the sole public function of this module.
|
|
321
|
+
*
|
|
322
|
+
* Takes raw input text and produces a ReminderPresentation, or null if the
|
|
323
|
+
* input does not contain enough reminder signal to justify reminder shaping.
|
|
324
|
+
*
|
|
325
|
+
* ── Return null when ─────────────────────────────────────────────────────────
|
|
326
|
+
*
|
|
327
|
+
* The input contains no reminder signal (no "remind me", "set a reminder", etc.)
|
|
328
|
+
* In this case, callers should fall back to existing presentation behavior.
|
|
329
|
+
*
|
|
330
|
+
* ── Return ReminderPresentation when ────────────────────────────────────────
|
|
331
|
+
*
|
|
332
|
+
* The input contains a reminder signal, even if fields are missing.
|
|
333
|
+
* The state field tells the consumer how complete the reminder is.
|
|
334
|
+
* Missing fields are listed in missing_fields.
|
|
335
|
+
*
|
|
336
|
+
* ── Determinism guarantee ────────────────────────────────────────────────────
|
|
337
|
+
*
|
|
338
|
+
* Same input → same output, always.
|
|
339
|
+
* No randomness. No session state. No side effects.
|
|
340
|
+
*/
|
|
341
|
+
export function presentReminder(input) {
|
|
342
|
+
const candidate = extractReminderCandidate(input);
|
|
343
|
+
if (candidate === null)
|
|
344
|
+
return null;
|
|
345
|
+
const state = determineState(candidate);
|
|
346
|
+
const missing_fields = buildMissingFields(candidate);
|
|
347
|
+
const actions = buildActions(state);
|
|
348
|
+
return {
|
|
349
|
+
kind: "reminder",
|
|
350
|
+
state,
|
|
351
|
+
subject: candidate.subject,
|
|
352
|
+
time_text: candidate.time_text,
|
|
353
|
+
recurrence_text: candidate.recurrence_text,
|
|
354
|
+
confidence: candidate.confidence,
|
|
355
|
+
missing_fields,
|
|
356
|
+
actions,
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
//# sourceMappingURL=reminder-presenter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reminder-presenter.js","sourceRoot":"","sources":["../../../../src/present/reminders/reminder-presenter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAUH,gFAAgF;AAChF,4DAA4D;AAC5D,gFAAgF;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,kBAAkB,GACtB,+FAA+F,CAAC;AAElG,gFAAgF;AAChF,iEAAiE;AACjE,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,aAAa,GAAa;IAC9B,sEAAsE;IACtE,sFAAsF;IACtF,4BAA4B;IAC5B,sDAAsD;IACtD,uCAAuC;IACvC,+CAA+C;IAC/C,mBAAmB;IACnB,eAAe;IACf,mDAAmD;IACnD,mFAAmF;IACnF,yBAAyB;IACzB,mDAAmD;IACnD,gBAAgB;IAChB,YAAY;IACZ,oCAAoC;IACpC,2CAA2C;IAC3C,4BAA4B;IAC5B,2CAA2C;IAC3C,uCAAuC;IACvC,qFAAqF;IACrF,0BAA0B;IAC1B,wEAAwE;IACxE,2CAA2C;IAC3C,mDAAmD;CACpD,CAAC;AAEF;;;;GAIG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,KAAK,MAAM,OAAO,IAAI,aAAa,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,gFAAg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AAE,EAAO,SAAS;YAClB,KAAK,EAAI,SAAS;YAClB,OAAO,EAAE,KAAK,KAAK,kBAAkB;SACtC;QACD;YACE,EAAE,EAAO,MAAM;YACf,KAAK,EAAI,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;YACnD,OAAO,EAAE,IAAI;SACd;QACD;YACE,EAAE,EAAO,QAAQ;YACjB,KAAK,EAAI,QAAQ;YACjB,OAAO,EAAE,IAAI;SACd;KACF,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,qBAAqB;AACrB,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,MAAM,SAAS,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEpC,MAAM,KAAK,GAAW,cAAc,CAAC,SAAS,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACrD,MAAM,OAAO,GAAS,YAAY,CAAC,KAAK,CAAC,CAAC;IAE1C,OAAO;QACL,IAAI,EAAa,UAAU;QAC3B,KAAK;QACL,OAAO,EAAU,SAAS,CAAC,OAAO;QAClC,SAAS,EAAQ,SAAS,CAAC,SAAS;QACpC,eAAe,EAAE,SAAS,CAAC,eAAe;QAC1C,UAAU,EAAO,SAAS,CAAC,UAAU;QACrC,cAAc;QACd,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reminder Renderer — Phase 5, Present Layer.
|
|
3
|
+
*
|
|
4
|
+
* ── Responsibility ────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* Takes a ReminderPresentation (already-built by the presenter) and produces
|
|
7
|
+
* a RenderedReminder — the human-readable string output ready for display.
|
|
8
|
+
*
|
|
9
|
+
* ── What this does NOT do ─────────────────────────────────────────────────────
|
|
10
|
+
*
|
|
11
|
+
* Does NOT invent new information — renders only what the presentation has
|
|
12
|
+
* Does NOT execute anything — pure string formatting
|
|
13
|
+
* Does NOT make decisions — all state logic is in reminder-presenter.ts
|
|
14
|
+
* Does NOT produce HTML or markup — plain structured text only
|
|
15
|
+
*
|
|
16
|
+
* ── Rendering contract ────────────────────────────────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* RenderedReminder is the final consumer-facing shape.
|
|
19
|
+
* All fields are plain strings (or null where absent).
|
|
20
|
+
* Consumers may combine them in any layout they choose.
|
|
21
|
+
*
|
|
22
|
+
* headline — always present; the top line
|
|
23
|
+
* body — lines describing known fields (subject, time, recurrence)
|
|
24
|
+
* array is empty when nothing is known yet
|
|
25
|
+
* prompt — the question to ask the user for missing fields
|
|
26
|
+
* null when state === "ready_to_confirm" (nothing is missing)
|
|
27
|
+
* actions_label — a single formatted string like "Confirm · Edit · Reject"
|
|
28
|
+
* only includes ENABLED actions
|
|
29
|
+
* missing — copy of missing_fields from the presentation for convenience
|
|
30
|
+
*
|
|
31
|
+
* ── Template logic ────────────────────────────────────────────────────────────
|
|
32
|
+
*
|
|
33
|
+
* Case A (ready_to_confirm):
|
|
34
|
+
* headline: "Reminder"
|
|
35
|
+
* body: "Task: {subject}" / "Time: {time}" / "Repeats: {recurrence}"
|
|
36
|
+
* prompt: null
|
|
37
|
+
* actions: "Confirm · Edit · Reject"
|
|
38
|
+
*
|
|
39
|
+
* Case B (needs_time):
|
|
40
|
+
* headline: "Reminder (incomplete)"
|
|
41
|
+
* body: "Task: {subject}"
|
|
42
|
+
* prompt: "When should this reminder trigger?"
|
|
43
|
+
* actions: "Edit · Reject"
|
|
44
|
+
*
|
|
45
|
+
* Case C (needs_subject):
|
|
46
|
+
* headline: "Reminder (incomplete)"
|
|
47
|
+
* body: "Time: {time}" / "Repeats: {recurrence}"
|
|
48
|
+
* prompt: "What should this reminder be for?"
|
|
49
|
+
* actions: "Edit · Reject"
|
|
50
|
+
*
|
|
51
|
+
* Case D (ambiguous):
|
|
52
|
+
* headline: "Possible reminder"
|
|
53
|
+
* body: [] (empty — nothing is confirmed)
|
|
54
|
+
* prompt: "Is this a reminder? If so, what would you like to be reminded about, and when?"
|
|
55
|
+
* actions: "Clarify · Reject"
|
|
56
|
+
*/
|
|
57
|
+
import type { ReminderPresentation } from "./reminder-types.js";
|
|
58
|
+
/**
|
|
59
|
+
* RenderedReminder — the final display-ready shape.
|
|
60
|
+
*
|
|
61
|
+
* headline — the primary heading line
|
|
62
|
+
* body — array of detail lines (Task, Time, Repeats)
|
|
63
|
+
* each line is a complete display-ready string
|
|
64
|
+
* prompt — what to ask the user next; null if nothing is missing
|
|
65
|
+
* actions_label — display string of enabled actions joined by " · "
|
|
66
|
+
* missing — mirror of ReminderPresentation.missing_fields
|
|
67
|
+
*/
|
|
68
|
+
export type RenderedReminder = {
|
|
69
|
+
readonly headline: string;
|
|
70
|
+
readonly body: readonly string[];
|
|
71
|
+
readonly prompt: string | null;
|
|
72
|
+
readonly actions_label: string;
|
|
73
|
+
readonly missing: readonly string[];
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* renderReminder(presentation) — convert a ReminderPresentation to display strings.
|
|
77
|
+
*
|
|
78
|
+
* Deterministic: same ReminderPresentation → same RenderedReminder, always.
|
|
79
|
+
* No side effects. No decisions. Pure formatting.
|
|
80
|
+
*/
|
|
81
|
+
export declare function renderReminder(p: ReminderPresentation): RenderedReminder;
|
|
82
|
+
//# sourceMappingURL=reminder-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reminder-renderer.d.ts","sourceRoot":"","sources":["../../../../src/present/reminders/reminder-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAUhE;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,QAAQ,EAAO,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAW,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAS,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAQ,SAAS,MAAM,EAAE,CAAC;CAC3C,CAAC;AAMF;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,oBAAoB,GAAG,gBAAgB,CAuExE"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reminder Renderer — Phase 5, Present Layer.
|
|
3
|
+
*
|
|
4
|
+
* ── Responsibility ────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* Takes a ReminderPresentation (already-built by the presenter) and produces
|
|
7
|
+
* a RenderedReminder — the human-readable string output ready for display.
|
|
8
|
+
*
|
|
9
|
+
* ── What this does NOT do ─────────────────────────────────────────────────────
|
|
10
|
+
*
|
|
11
|
+
* Does NOT invent new information — renders only what the presentation has
|
|
12
|
+
* Does NOT execute anything — pure string formatting
|
|
13
|
+
* Does NOT make decisions — all state logic is in reminder-presenter.ts
|
|
14
|
+
* Does NOT produce HTML or markup — plain structured text only
|
|
15
|
+
*
|
|
16
|
+
* ── Rendering contract ────────────────────────────────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* RenderedReminder is the final consumer-facing shape.
|
|
19
|
+
* All fields are plain strings (or null where absent).
|
|
20
|
+
* Consumers may combine them in any layout they choose.
|
|
21
|
+
*
|
|
22
|
+
* headline — always present; the top line
|
|
23
|
+
* body — lines describing known fields (subject, time, recurrence)
|
|
24
|
+
* array is empty when nothing is known yet
|
|
25
|
+
* prompt — the question to ask the user for missing fields
|
|
26
|
+
* null when state === "ready_to_confirm" (nothing is missing)
|
|
27
|
+
* actions_label — a single formatted string like "Confirm · Edit · Reject"
|
|
28
|
+
* only includes ENABLED actions
|
|
29
|
+
* missing — copy of missing_fields from the presentation for convenience
|
|
30
|
+
*
|
|
31
|
+
* ── Template logic ────────────────────────────────────────────────────────────
|
|
32
|
+
*
|
|
33
|
+
* Case A (ready_to_confirm):
|
|
34
|
+
* headline: "Reminder"
|
|
35
|
+
* body: "Task: {subject}" / "Time: {time}" / "Repeats: {recurrence}"
|
|
36
|
+
* prompt: null
|
|
37
|
+
* actions: "Confirm · Edit · Reject"
|
|
38
|
+
*
|
|
39
|
+
* Case B (needs_time):
|
|
40
|
+
* headline: "Reminder (incomplete)"
|
|
41
|
+
* body: "Task: {subject}"
|
|
42
|
+
* prompt: "When should this reminder trigger?"
|
|
43
|
+
* actions: "Edit · Reject"
|
|
44
|
+
*
|
|
45
|
+
* Case C (needs_subject):
|
|
46
|
+
* headline: "Reminder (incomplete)"
|
|
47
|
+
* body: "Time: {time}" / "Repeats: {recurrence}"
|
|
48
|
+
* prompt: "What should this reminder be for?"
|
|
49
|
+
* actions: "Edit · Reject"
|
|
50
|
+
*
|
|
51
|
+
* Case D (ambiguous):
|
|
52
|
+
* headline: "Possible reminder"
|
|
53
|
+
* body: [] (empty — nothing is confirmed)
|
|
54
|
+
* prompt: "Is this a reminder? If so, what would you like to be reminded about, and when?"
|
|
55
|
+
* actions: "Clarify · Reject"
|
|
56
|
+
*/
|
|
57
|
+
import { evaluateControlVisibility, assertControlVisibilityConsistency, } from "../control-visibility/index.js";
|
|
58
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
59
|
+
// Renderer
|
|
60
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
61
|
+
/**
|
|
62
|
+
* renderReminder(presentation) — convert a ReminderPresentation to display strings.
|
|
63
|
+
*
|
|
64
|
+
* Deterministic: same ReminderPresentation → same RenderedReminder, always.
|
|
65
|
+
* No side effects. No decisions. Pure formatting.
|
|
66
|
+
*/
|
|
67
|
+
export function renderReminder(p) {
|
|
68
|
+
// CVG read-only hook — compute and assert, output shape unchanged.
|
|
69
|
+
const cvg = evaluateControlVisibility({ kind: "reminder_presentation", presentation: p });
|
|
70
|
+
assertControlVisibilityConsistency(cvg);
|
|
71
|
+
// Build the actions label from enabled actions only
|
|
72
|
+
const actions_label = p.actions
|
|
73
|
+
.filter((a) => a.enabled)
|
|
74
|
+
.map((a) => a.label)
|
|
75
|
+
.join(" · ");
|
|
76
|
+
switch (p.state) {
|
|
77
|
+
// ── Case A: ready_to_confirm ────────────────────────────────────────────
|
|
78
|
+
case "ready_to_confirm": {
|
|
79
|
+
const body = [];
|
|
80
|
+
// subject and time_text are guaranteed non-null in ready_to_confirm
|
|
81
|
+
// (state logic in reminder-presenter.ts ensures this)
|
|
82
|
+
if (p.subject !== null)
|
|
83
|
+
body.push(`Task: ${p.subject}`);
|
|
84
|
+
if (p.time_text !== null)
|
|
85
|
+
body.push(`Time: ${p.time_text}`);
|
|
86
|
+
if (p.recurrence_text !== null)
|
|
87
|
+
body.push(`Repeats: ${p.recurrence_text}`);
|
|
88
|
+
return {
|
|
89
|
+
headline: "Reminder",
|
|
90
|
+
body,
|
|
91
|
+
prompt: null,
|
|
92
|
+
actions_label,
|
|
93
|
+
missing: p.missing_fields,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
// ── Case B: needs_time ──────────────────────────────────────────────────
|
|
97
|
+
case "needs_time": {
|
|
98
|
+
const body = [];
|
|
99
|
+
if (p.subject !== null)
|
|
100
|
+
body.push(`Task: ${p.subject}`);
|
|
101
|
+
return {
|
|
102
|
+
headline: "Reminder (incomplete)",
|
|
103
|
+
body,
|
|
104
|
+
prompt: "When should this reminder trigger?",
|
|
105
|
+
actions_label,
|
|
106
|
+
missing: p.missing_fields,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
// ── Case C: needs_subject ───────────────────────────────────────────────
|
|
110
|
+
case "needs_subject": {
|
|
111
|
+
const body = [];
|
|
112
|
+
if (p.time_text !== null)
|
|
113
|
+
body.push(`Time: ${p.time_text}`);
|
|
114
|
+
if (p.recurrence_text !== null)
|
|
115
|
+
body.push(`Repeats: ${p.recurrence_text}`);
|
|
116
|
+
return {
|
|
117
|
+
headline: "Reminder (incomplete)",
|
|
118
|
+
body,
|
|
119
|
+
prompt: "What should this reminder be for?",
|
|
120
|
+
actions_label,
|
|
121
|
+
missing: p.missing_fields,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
// ── Case D: ambiguous ───────────────────────────────────────────────────
|
|
125
|
+
case "ambiguous": {
|
|
126
|
+
return {
|
|
127
|
+
headline: "Possible reminder",
|
|
128
|
+
body: [],
|
|
129
|
+
prompt: "Is this a reminder? If so, what would you like to be reminded about, and when?",
|
|
130
|
+
actions_label,
|
|
131
|
+
missing: p.missing_fields,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=reminder-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reminder-renderer.js","sourceRoot":"","sources":["../../../../src/present/reminders/reminder-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAGH,OAAO,EACL,yBAAyB,EACzB,kCAAkC,GACnC,MAAM,gCAAgC,CAAC;AAwBxC,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,CAAuB;IACpD,mEAAmE;IACnE,MAAM,GAAG,GAAG,yBAAyB,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1F,kCAAkC,CAAC,GAAG,CAAC,CAAC;IAExC,oDAAoD;IACpD,MAAM,aAAa,GAAG,CAAC,CAAC,OAAO;SAC5B,MAAM,CAAC,CAAC,CAAC,EAAE,EA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