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.
Files changed (665) hide show
  1. package/LICENSE +186 -0
  2. package/README.md +724 -0
  3. package/bin/use-steady.js +13 -0
  4. package/dist/server-store.d.ts +68 -0
  5. package/dist/server-store.d.ts.map +1 -0
  6. package/dist/server-store.js +133 -0
  7. package/dist/server-store.js.map +1 -0
  8. package/dist/server.d.ts +35 -0
  9. package/dist/server.d.ts.map +1 -0
  10. package/dist/server.js +569 -0
  11. package/dist/server.js.map +1 -0
  12. package/dist/src/claude/adapters/api-adapter.d.ts +99 -0
  13. package/dist/src/claude/adapters/api-adapter.d.ts.map +1 -0
  14. package/dist/src/claude/adapters/api-adapter.js +415 -0
  15. package/dist/src/claude/adapters/api-adapter.js.map +1 -0
  16. package/dist/src/claude/adapters/stub-adapter.d.ts +73 -0
  17. package/dist/src/claude/adapters/stub-adapter.d.ts.map +1 -0
  18. package/dist/src/claude/adapters/stub-adapter.js +114 -0
  19. package/dist/src/claude/adapters/stub-adapter.js.map +1 -0
  20. package/dist/src/claude/artifact-mapper.d.ts +85 -0
  21. package/dist/src/claude/artifact-mapper.d.ts.map +1 -0
  22. package/dist/src/claude/artifact-mapper.js +187 -0
  23. package/dist/src/claude/artifact-mapper.js.map +1 -0
  24. package/dist/src/claude/delivery-gate.d.ts +136 -0
  25. package/dist/src/claude/delivery-gate.d.ts.map +1 -0
  26. package/dist/src/claude/delivery-gate.js +231 -0
  27. package/dist/src/claude/delivery-gate.js.map +1 -0
  28. package/dist/src/claude/index.d.ts +24 -0
  29. package/dist/src/claude/index.d.ts.map +1 -0
  30. package/dist/src/claude/index.js +23 -0
  31. package/dist/src/claude/index.js.map +1 -0
  32. package/dist/src/claude/types.d.ts +223 -0
  33. package/dist/src/claude/types.d.ts.map +1 -0
  34. package/dist/src/claude/types.js +64 -0
  35. package/dist/src/claude/types.js.map +1 -0
  36. package/dist/src/control/compiler.d.ts +125 -0
  37. package/dist/src/control/compiler.d.ts.map +1 -0
  38. package/dist/src/control/compiler.js +179 -0
  39. package/dist/src/control/compiler.js.map +1 -0
  40. package/dist/src/control/constraints.d.ts +42 -0
  41. package/dist/src/control/constraints.d.ts.map +1 -0
  42. package/dist/src/control/constraints.js +116 -0
  43. package/dist/src/control/constraints.js.map +1 -0
  44. package/dist/src/control/drift-detector.d.ts +49 -0
  45. package/dist/src/control/drift-detector.d.ts.map +1 -0
  46. package/dist/src/control/drift-detector.js +115 -0
  47. package/dist/src/control/drift-detector.js.map +1 -0
  48. package/dist/src/control/index.d.ts +44 -0
  49. package/dist/src/control/index.d.ts.map +1 -0
  50. package/dist/src/control/index.js +40 -0
  51. package/dist/src/control/index.js.map +1 -0
  52. package/dist/src/control/types.d.ts +144 -0
  53. package/dist/src/control/types.d.ts.map +1 -0
  54. package/dist/src/control/types.js +57 -0
  55. package/dist/src/control/types.js.map +1 -0
  56. package/dist/src/cursor/adapters/inprocess-adapter.d.ts +78 -0
  57. package/dist/src/cursor/adapters/inprocess-adapter.d.ts.map +1 -0
  58. package/dist/src/cursor/adapters/inprocess-adapter.js +308 -0
  59. package/dist/src/cursor/adapters/inprocess-adapter.js.map +1 -0
  60. package/dist/src/cursor/adapters/stub-adapter.d.ts +75 -0
  61. package/dist/src/cursor/adapters/stub-adapter.d.ts.map +1 -0
  62. package/dist/src/cursor/adapters/stub-adapter.js +120 -0
  63. package/dist/src/cursor/adapters/stub-adapter.js.map +1 -0
  64. package/dist/src/cursor/artifact-mapper.d.ts +81 -0
  65. package/dist/src/cursor/artifact-mapper.d.ts.map +1 -0
  66. package/dist/src/cursor/artifact-mapper.js +203 -0
  67. package/dist/src/cursor/artifact-mapper.js.map +1 -0
  68. package/dist/src/cursor/delivery-gate.d.ts +144 -0
  69. package/dist/src/cursor/delivery-gate.d.ts.map +1 -0
  70. package/dist/src/cursor/delivery-gate.js +208 -0
  71. package/dist/src/cursor/delivery-gate.js.map +1 -0
  72. package/dist/src/cursor/glob-matcher.d.ts +30 -0
  73. package/dist/src/cursor/glob-matcher.d.ts.map +1 -0
  74. package/dist/src/cursor/glob-matcher.js +68 -0
  75. package/dist/src/cursor/glob-matcher.js.map +1 -0
  76. package/dist/src/cursor/index.d.ts +43 -0
  77. package/dist/src/cursor/index.d.ts.map +1 -0
  78. package/dist/src/cursor/index.js +44 -0
  79. package/dist/src/cursor/index.js.map +1 -0
  80. package/dist/src/cursor/ocd-evaluator.d.ts +89 -0
  81. package/dist/src/cursor/ocd-evaluator.d.ts.map +1 -0
  82. package/dist/src/cursor/ocd-evaluator.js +142 -0
  83. package/dist/src/cursor/ocd-evaluator.js.map +1 -0
  84. package/dist/src/cursor/types.d.ts +309 -0
  85. package/dist/src/cursor/types.d.ts.map +1 -0
  86. package/dist/src/cursor/types.js +48 -0
  87. package/dist/src/cursor/types.js.map +1 -0
  88. package/dist/src/execution/claude/claude-execution-coordinator.d.ts +164 -0
  89. package/dist/src/execution/claude/claude-execution-coordinator.d.ts.map +1 -0
  90. package/dist/src/execution/claude/claude-execution-coordinator.js +198 -0
  91. package/dist/src/execution/claude/claude-execution-coordinator.js.map +1 -0
  92. package/dist/src/execution/claude/index.d.ts +13 -0
  93. package/dist/src/execution/claude/index.d.ts.map +1 -0
  94. package/dist/src/execution/claude/index.js +12 -0
  95. package/dist/src/execution/claude/index.js.map +1 -0
  96. package/dist/src/execution/cursor/cursor-execution-coordinator.d.ts +216 -0
  97. package/dist/src/execution/cursor/cursor-execution-coordinator.d.ts.map +1 -0
  98. package/dist/src/execution/cursor/cursor-execution-coordinator.js +233 -0
  99. package/dist/src/execution/cursor/cursor-execution-coordinator.js.map +1 -0
  100. package/dist/src/execution/cursor/index.d.ts +20 -0
  101. package/dist/src/execution/cursor/index.d.ts.map +1 -0
  102. package/dist/src/execution/cursor/index.js +18 -0
  103. package/dist/src/execution/cursor/index.js.map +1 -0
  104. package/dist/src/execution/reminders/index.d.ts +11 -0
  105. package/dist/src/execution/reminders/index.d.ts.map +1 -0
  106. package/dist/src/execution/reminders/index.js +9 -0
  107. package/dist/src/execution/reminders/index.js.map +1 -0
  108. package/dist/src/execution/reminders/reminder-execution-coordinator.d.ts +125 -0
  109. package/dist/src/execution/reminders/reminder-execution-coordinator.d.ts.map +1 -0
  110. package/dist/src/execution/reminders/reminder-execution-coordinator.js +129 -0
  111. package/dist/src/execution/reminders/reminder-execution-coordinator.js.map +1 -0
  112. package/dist/src/execution/reminders/reminder-execution-types.d.ts +161 -0
  113. package/dist/src/execution/reminders/reminder-execution-types.d.ts.map +1 -0
  114. package/dist/src/execution/reminders/reminder-execution-types.js +39 -0
  115. package/dist/src/execution/reminders/reminder-execution-types.js.map +1 -0
  116. package/dist/src/execution/reminders/reminder-execution-validator.d.ts +45 -0
  117. package/dist/src/execution/reminders/reminder-execution-validator.d.ts.map +1 -0
  118. package/dist/src/execution/reminders/reminder-execution-validator.js +92 -0
  119. package/dist/src/execution/reminders/reminder-execution-validator.js.map +1 -0
  120. package/dist/src/execution/reminders/reminder-executor.d.ts +62 -0
  121. package/dist/src/execution/reminders/reminder-executor.d.ts.map +1 -0
  122. package/dist/src/execution/reminders/reminder-executor.js +113 -0
  123. package/dist/src/execution/reminders/reminder-executor.js.map +1 -0
  124. package/dist/src/execution/reminders/reminder-time-parser.d.ts +41 -0
  125. package/dist/src/execution/reminders/reminder-time-parser.d.ts.map +1 -0
  126. package/dist/src/execution/reminders/reminder-time-parser.js +113 -0
  127. package/dist/src/execution/reminders/reminder-time-parser.js.map +1 -0
  128. package/dist/src/friction/auto-capture.d.ts +38 -0
  129. package/dist/src/friction/auto-capture.d.ts.map +1 -0
  130. package/dist/src/friction/auto-capture.js +133 -0
  131. package/dist/src/friction/auto-capture.js.map +1 -0
  132. package/dist/src/friction/client.d.ts +39 -0
  133. package/dist/src/friction/client.d.ts.map +1 -0
  134. package/dist/src/friction/client.js +165 -0
  135. package/dist/src/friction/client.js.map +1 -0
  136. package/dist/src/friction/config.d.ts +16 -0
  137. package/dist/src/friction/config.d.ts.map +1 -0
  138. package/dist/src/friction/config.js +56 -0
  139. package/dist/src/friction/config.js.map +1 -0
  140. package/dist/src/friction/github-auth.d.ts +41 -0
  141. package/dist/src/friction/github-auth.d.ts.map +1 -0
  142. package/dist/src/friction/github-auth.js +155 -0
  143. package/dist/src/friction/github-auth.js.map +1 -0
  144. package/dist/src/friction/github-issues.d.ts +51 -0
  145. package/dist/src/friction/github-issues.d.ts.map +1 -0
  146. package/dist/src/friction/github-issues.js +118 -0
  147. package/dist/src/friction/github-issues.js.map +1 -0
  148. package/dist/src/friction/payout-ledger.d.ts +45 -0
  149. package/dist/src/friction/payout-ledger.d.ts.map +1 -0
  150. package/dist/src/friction/payout-ledger.js +111 -0
  151. package/dist/src/friction/payout-ledger.js.map +1 -0
  152. package/dist/src/friction/queue.d.ts +42 -0
  153. package/dist/src/friction/queue.d.ts.map +1 -0
  154. package/dist/src/friction/queue.js +179 -0
  155. package/dist/src/friction/queue.js.map +1 -0
  156. package/dist/src/friction/reviewer.d.ts +42 -0
  157. package/dist/src/friction/reviewer.d.ts.map +1 -0
  158. package/dist/src/friction/reviewer.js +269 -0
  159. package/dist/src/friction/reviewer.js.map +1 -0
  160. package/dist/src/friction/types.d.ts +63 -0
  161. package/dist/src/friction/types.d.ts.map +1 -0
  162. package/dist/src/friction/types.js +18 -0
  163. package/dist/src/friction/types.js.map +1 -0
  164. package/dist/src/history/index.d.ts +39 -0
  165. package/dist/src/history/index.d.ts.map +1 -0
  166. package/dist/src/history/index.js +41 -0
  167. package/dist/src/history/index.js.map +1 -0
  168. package/dist/src/history/session-chain.d.ts +36 -0
  169. package/dist/src/history/session-chain.d.ts.map +1 -0
  170. package/dist/src/history/session-chain.js +91 -0
  171. package/dist/src/history/session-chain.js.map +1 -0
  172. package/dist/src/history/types.d.ts +130 -0
  173. package/dist/src/history/types.d.ts.map +1 -0
  174. package/dist/src/history/types.js +32 -0
  175. package/dist/src/history/types.js.map +1 -0
  176. package/dist/src/history/workflow-history.d.ts +48 -0
  177. package/dist/src/history/workflow-history.d.ts.map +1 -0
  178. package/dist/src/history/workflow-history.js +116 -0
  179. package/dist/src/history/workflow-history.js.map +1 -0
  180. package/dist/src/index.d.ts +88 -0
  181. package/dist/src/index.d.ts.map +1 -0
  182. package/dist/src/index.js +58 -0
  183. package/dist/src/index.js.map +1 -0
  184. package/dist/src/intake/classify-intent-state.d.ts +20 -0
  185. package/dist/src/intake/classify-intent-state.d.ts.map +1 -0
  186. package/dist/src/intake/classify-intent-state.js +29 -0
  187. package/dist/src/intake/classify-intent-state.js.map +1 -0
  188. package/dist/src/intake/intake-service.d.ts +105 -0
  189. package/dist/src/intake/intake-service.d.ts.map +1 -0
  190. package/dist/src/intake/intake-service.js +407 -0
  191. package/dist/src/intake/intake-service.js.map +1 -0
  192. package/dist/src/intake/response-planner.d.ts +25 -0
  193. package/dist/src/intake/response-planner.d.ts.map +1 -0
  194. package/dist/src/intake/response-planner.js +52 -0
  195. package/dist/src/intake/response-planner.js.map +1 -0
  196. package/dist/src/intake/signal-extractor.d.ts +25 -0
  197. package/dist/src/intake/signal-extractor.d.ts.map +1 -0
  198. package/dist/src/intake/signal-extractor.js +42 -0
  199. package/dist/src/intake/signal-extractor.js.map +1 -0
  200. package/dist/src/intake/trace.d.ts +157 -0
  201. package/dist/src/intake/trace.d.ts.map +1 -0
  202. package/dist/src/intake/trace.js +38 -0
  203. package/dist/src/intake/trace.js.map +1 -0
  204. package/dist/src/intake/types.d.ts +70 -0
  205. package/dist/src/intake/types.d.ts.map +1 -0
  206. package/dist/src/intake/types.js +30 -0
  207. package/dist/src/intake/types.js.map +1 -0
  208. package/dist/src/interaction/defaults.d.ts +12 -0
  209. package/dist/src/interaction/defaults.d.ts.map +1 -0
  210. package/dist/src/interaction/defaults.js +26 -0
  211. package/dist/src/interaction/defaults.js.map +1 -0
  212. package/dist/src/interaction/guidance-order.d.ts +53 -0
  213. package/dist/src/interaction/guidance-order.d.ts.map +1 -0
  214. package/dist/src/interaction/guidance-order.js +131 -0
  215. package/dist/src/interaction/guidance-order.js.map +1 -0
  216. package/dist/src/interaction/observe.d.ts +57 -0
  217. package/dist/src/interaction/observe.d.ts.map +1 -0
  218. package/dist/src/interaction/observe.js +77 -0
  219. package/dist/src/interaction/observe.js.map +1 -0
  220. package/dist/src/interaction/selectors.d.ts +16 -0
  221. package/dist/src/interaction/selectors.d.ts.map +1 -0
  222. package/dist/src/interaction/selectors.js +23 -0
  223. package/dist/src/interaction/selectors.js.map +1 -0
  224. package/dist/src/interaction/types.d.ts +105 -0
  225. package/dist/src/interaction/types.d.ts.map +1 -0
  226. package/dist/src/interaction/types.js +48 -0
  227. package/dist/src/interaction/types.js.map +1 -0
  228. package/dist/src/interaction/updater.d.ts +22 -0
  229. package/dist/src/interaction/updater.d.ts.map +1 -0
  230. package/dist/src/interaction/updater.js +87 -0
  231. package/dist/src/interaction/updater.js.map +1 -0
  232. package/dist/src/present/boundary-explanation/boundary-explanation-detector.d.ts +48 -0
  233. package/dist/src/present/boundary-explanation/boundary-explanation-detector.d.ts.map +1 -0
  234. package/dist/src/present/boundary-explanation/boundary-explanation-detector.js +107 -0
  235. package/dist/src/present/boundary-explanation/boundary-explanation-detector.js.map +1 -0
  236. package/dist/src/present/boundary-explanation/boundary-explanation-types.d.ts +43 -0
  237. package/dist/src/present/boundary-explanation/boundary-explanation-types.d.ts.map +1 -0
  238. package/dist/src/present/boundary-explanation/boundary-explanation-types.js +20 -0
  239. package/dist/src/present/boundary-explanation/boundary-explanation-types.js.map +1 -0
  240. package/dist/src/present/boundary-explanation/index.d.ts +10 -0
  241. package/dist/src/present/boundary-explanation/index.d.ts.map +1 -0
  242. package/dist/src/present/boundary-explanation/index.js +2 -0
  243. package/dist/src/present/boundary-explanation/index.js.map +1 -0
  244. package/dist/src/present/control-visibility/control-visibility-assertions.d.ts +70 -0
  245. package/dist/src/present/control-visibility/control-visibility-assertions.d.ts.map +1 -0
  246. package/dist/src/present/control-visibility/control-visibility-assertions.js +138 -0
  247. package/dist/src/present/control-visibility/control-visibility-assertions.js.map +1 -0
  248. package/dist/src/present/control-visibility/control-visibility-evaluator.d.ts +67 -0
  249. package/dist/src/present/control-visibility/control-visibility-evaluator.d.ts.map +1 -0
  250. package/dist/src/present/control-visibility/control-visibility-evaluator.js +146 -0
  251. package/dist/src/present/control-visibility/control-visibility-evaluator.js.map +1 -0
  252. package/dist/src/present/control-visibility/control-visibility-types.d.ts +113 -0
  253. package/dist/src/present/control-visibility/control-visibility-types.d.ts.map +1 -0
  254. package/dist/src/present/control-visibility/control-visibility-types.js +24 -0
  255. package/dist/src/present/control-visibility/control-visibility-types.js.map +1 -0
  256. package/dist/src/present/control-visibility/index.d.ts +16 -0
  257. package/dist/src/present/control-visibility/index.d.ts.map +1 -0
  258. package/dist/src/present/control-visibility/index.js +15 -0
  259. package/dist/src/present/control-visibility/index.js.map +1 -0
  260. package/dist/src/present/format.d.ts +57 -0
  261. package/dist/src/present/format.d.ts.map +1 -0
  262. package/dist/src/present/format.js +150 -0
  263. package/dist/src/present/format.js.map +1 -0
  264. package/dist/src/present/present-coordinator.d.ts +153 -0
  265. package/dist/src/present/present-coordinator.d.ts.map +1 -0
  266. package/dist/src/present/present-coordinator.js +213 -0
  267. package/dist/src/present/present-coordinator.js.map +1 -0
  268. package/dist/src/present/reminders/index.d.ts +22 -0
  269. package/dist/src/present/reminders/index.d.ts.map +1 -0
  270. package/dist/src/present/reminders/index.js +22 -0
  271. package/dist/src/present/reminders/index.js.map +1 -0
  272. package/dist/src/present/reminders/reminder-presenter.d.ts +76 -0
  273. package/dist/src/present/reminders/reminder-presenter.d.ts.map +1 -0
  274. package/dist/src/present/reminders/reminder-presenter.js +359 -0
  275. package/dist/src/present/reminders/reminder-presenter.js.map +1 -0
  276. package/dist/src/present/reminders/reminder-renderer.d.ts +82 -0
  277. package/dist/src/present/reminders/reminder-renderer.d.ts.map +1 -0
  278. package/dist/src/present/reminders/reminder-renderer.js +136 -0
  279. package/dist/src/present/reminders/reminder-renderer.js.map +1 -0
  280. package/dist/src/present/reminders/reminder-types.d.ts +131 -0
  281. package/dist/src/present/reminders/reminder-types.d.ts.map +1 -0
  282. package/dist/src/present/reminders/reminder-types.js +29 -0
  283. package/dist/src/present/reminders/reminder-types.js.map +1 -0
  284. package/dist/src/present/types.d.ts +114 -0
  285. package/dist/src/present/types.d.ts.map +1 -0
  286. package/dist/src/present/types.js +18 -0
  287. package/dist/src/present/types.js.map +1 -0
  288. package/dist/src/product/claude-product-session.d.ts +146 -0
  289. package/dist/src/product/claude-product-session.d.ts.map +1 -0
  290. package/dist/src/product/claude-product-session.js +362 -0
  291. package/dist/src/product/claude-product-session.js.map +1 -0
  292. package/dist/src/product/cursor-product-session.d.ts +211 -0
  293. package/dist/src/product/cursor-product-session.d.ts.map +1 -0
  294. package/dist/src/product/cursor-product-session.js +390 -0
  295. package/dist/src/product/cursor-product-session.js.map +1 -0
  296. package/dist/src/product/index.d.ts +28 -0
  297. package/dist/src/product/index.d.ts.map +1 -0
  298. package/dist/src/product/index.js +22 -0
  299. package/dist/src/product/index.js.map +1 -0
  300. package/dist/src/product/session-resilience/index.d.ts +17 -0
  301. package/dist/src/product/session-resilience/index.d.ts.map +1 -0
  302. package/dist/src/product/session-resilience/index.js +15 -0
  303. package/dist/src/product/session-resilience/index.js.map +1 -0
  304. package/dist/src/product/session-resilience/session-serializer.d.ts +43 -0
  305. package/dist/src/product/session-resilience/session-serializer.d.ts.map +1 -0
  306. package/dist/src/product/session-resilience/session-serializer.js +84 -0
  307. package/dist/src/product/session-resilience/session-serializer.js.map +1 -0
  308. package/dist/src/product/session-resilience/session-snapshot-types.d.ts +35 -0
  309. package/dist/src/product/session-resilience/session-snapshot-types.d.ts.map +1 -0
  310. package/dist/src/product/session-resilience/session-snapshot-types.js +21 -0
  311. package/dist/src/product/session-resilience/session-snapshot-types.js.map +1 -0
  312. package/dist/src/product/session-resilience/session-staleness.d.ts +54 -0
  313. package/dist/src/product/session-resilience/session-staleness.d.ts.map +1 -0
  314. package/dist/src/product/session-resilience/session-staleness.js +62 -0
  315. package/dist/src/product/session-resilience/session-staleness.js.map +1 -0
  316. package/dist/src/product/session-resilience/session-summary.d.ts +40 -0
  317. package/dist/src/product/session-resilience/session-summary.d.ts.map +1 -0
  318. package/dist/src/product/session-resilience/session-summary.js +72 -0
  319. package/dist/src/product/session-resilience/session-summary.js.map +1 -0
  320. package/dist/src/prv/patterns.d.ts +32 -0
  321. package/dist/src/prv/patterns.d.ts.map +1 -0
  322. package/dist/src/prv/patterns.js +40 -0
  323. package/dist/src/prv/patterns.js.map +1 -0
  324. package/dist/src/prv/prv.d.ts +13 -0
  325. package/dist/src/prv/prv.d.ts.map +1 -0
  326. package/dist/src/prv/prv.js +22 -0
  327. package/dist/src/prv/prv.js.map +1 -0
  328. package/dist/src/prv/types.d.ts +26 -0
  329. package/dist/src/prv/types.d.ts.map +1 -0
  330. package/dist/src/prv/types.js +15 -0
  331. package/dist/src/prv/types.js.map +1 -0
  332. package/dist/src/safety/detectors/arbitrary-exec.detector.d.ts +3 -0
  333. package/dist/src/safety/detectors/arbitrary-exec.detector.d.ts.map +1 -0
  334. package/dist/src/safety/detectors/arbitrary-exec.detector.js +31 -0
  335. package/dist/src/safety/detectors/arbitrary-exec.detector.js.map +1 -0
  336. package/dist/src/safety/detectors/bulk-data-exfil.detector.d.ts +21 -0
  337. package/dist/src/safety/detectors/bulk-data-exfil.detector.d.ts.map +1 -0
  338. package/dist/src/safety/detectors/bulk-data-exfil.detector.js +90 -0
  339. package/dist/src/safety/detectors/bulk-data-exfil.detector.js.map +1 -0
  340. package/dist/src/safety/detectors/destructive.detector.d.ts +3 -0
  341. package/dist/src/safety/detectors/destructive.detector.d.ts.map +1 -0
  342. package/dist/src/safety/detectors/destructive.detector.js +28 -0
  343. package/dist/src/safety/detectors/destructive.detector.js.map +1 -0
  344. package/dist/src/safety/detectors/evasion.detector.d.ts +3 -0
  345. package/dist/src/safety/detectors/evasion.detector.d.ts.map +1 -0
  346. package/dist/src/safety/detectors/evasion.detector.js +28 -0
  347. package/dist/src/safety/detectors/evasion.detector.js.map +1 -0
  348. package/dist/src/safety/detectors/secret-access.detector.d.ts +31 -0
  349. package/dist/src/safety/detectors/secret-access.detector.d.ts.map +1 -0
  350. package/dist/src/safety/detectors/secret-access.detector.js +78 -0
  351. package/dist/src/safety/detectors/secret-access.detector.js.map +1 -0
  352. package/dist/src/safety/registry.d.ts +9 -0
  353. package/dist/src/safety/registry.d.ts.map +1 -0
  354. package/dist/src/safety/registry.js +22 -0
  355. package/dist/src/safety/registry.js.map +1 -0
  356. package/dist/src/safety/safety-gate.d.ts +16 -0
  357. package/dist/src/safety/safety-gate.d.ts.map +1 -0
  358. package/dist/src/safety/safety-gate.js +26 -0
  359. package/dist/src/safety/safety-gate.js.map +1 -0
  360. package/dist/src/safety/types.d.ts +35 -0
  361. package/dist/src/safety/types.d.ts.map +1 -0
  362. package/dist/src/safety/types.js +14 -0
  363. package/dist/src/safety/types.js.map +1 -0
  364. package/dist/src/shell/claude-shell.d.ts +63 -0
  365. package/dist/src/shell/claude-shell.d.ts.map +1 -0
  366. package/dist/src/shell/claude-shell.js +81 -0
  367. package/dist/src/shell/claude-shell.js.map +1 -0
  368. package/dist/src/shell/cli/friction-admin.d.ts +14 -0
  369. package/dist/src/shell/cli/friction-admin.d.ts.map +1 -0
  370. package/dist/src/shell/cli/friction-admin.js +276 -0
  371. package/dist/src/shell/cli/friction-admin.js.map +1 -0
  372. package/dist/src/shell/cli/friction-report.d.ts +16 -0
  373. package/dist/src/shell/cli/friction-report.d.ts.map +1 -0
  374. package/dist/src/shell/cli/friction-report.js +156 -0
  375. package/dist/src/shell/cli/friction-report.js.map +1 -0
  376. package/dist/src/shell/cli/main.d.ts +68 -0
  377. package/dist/src/shell/cli/main.d.ts.map +1 -0
  378. package/dist/src/shell/cli/main.js +488 -0
  379. package/dist/src/shell/cli/main.js.map +1 -0
  380. package/dist/src/shell/cli/use-steady.d.ts +26 -0
  381. package/dist/src/shell/cli/use-steady.d.ts.map +1 -0
  382. package/dist/src/shell/cli/use-steady.js +117 -0
  383. package/dist/src/shell/cli/use-steady.js.map +1 -0
  384. package/dist/src/shell/cursor-shell.d.ts +63 -0
  385. package/dist/src/shell/cursor-shell.d.ts.map +1 -0
  386. package/dist/src/shell/cursor-shell.js +88 -0
  387. package/dist/src/shell/cursor-shell.js.map +1 -0
  388. package/dist/src/shell/defaults.d.ts +51 -0
  389. package/dist/src/shell/defaults.d.ts.map +1 -0
  390. package/dist/src/shell/defaults.js +78 -0
  391. package/dist/src/shell/defaults.js.map +1 -0
  392. package/dist/src/shell/history-render.d.ts +56 -0
  393. package/dist/src/shell/history-render.d.ts.map +1 -0
  394. package/dist/src/shell/history-render.js +166 -0
  395. package/dist/src/shell/history-render.js.map +1 -0
  396. package/dist/src/shell/index.d.ts +43 -0
  397. package/dist/src/shell/index.d.ts.map +1 -0
  398. package/dist/src/shell/index.js +45 -0
  399. package/dist/src/shell/index.js.map +1 -0
  400. package/dist/src/shell/render.d.ts +42 -0
  401. package/dist/src/shell/render.d.ts.map +1 -0
  402. package/dist/src/shell/render.js +122 -0
  403. package/dist/src/shell/render.js.map +1 -0
  404. package/dist/src/shell/types.d.ts +46 -0
  405. package/dist/src/shell/types.d.ts.map +1 -0
  406. package/dist/src/shell/types.js +19 -0
  407. package/dist/src/shell/types.js.map +1 -0
  408. package/dist/src/shell/workflow-defaults.d.ts +23 -0
  409. package/dist/src/shell/workflow-defaults.d.ts.map +1 -0
  410. package/dist/src/shell/workflow-defaults.js +27 -0
  411. package/dist/src/shell/workflow-defaults.js.map +1 -0
  412. package/dist/src/shell/workflow-render.d.ts +54 -0
  413. package/dist/src/shell/workflow-render.d.ts.map +1 -0
  414. package/dist/src/shell/workflow-render.js +319 -0
  415. package/dist/src/shell/workflow-render.js.map +1 -0
  416. package/dist/src/shell/workflow-shell.d.ts +110 -0
  417. package/dist/src/shell/workflow-shell.d.ts.map +1 -0
  418. package/dist/src/shell/workflow-shell.js +180 -0
  419. package/dist/src/shell/workflow-shell.js.map +1 -0
  420. package/dist/src/skills/audit.d.ts +118 -0
  421. package/dist/src/skills/audit.d.ts.map +1 -0
  422. package/dist/src/skills/audit.js +147 -0
  423. package/dist/src/skills/audit.js.map +1 -0
  424. package/dist/src/skills/invocation.d.ts +131 -0
  425. package/dist/src/skills/invocation.d.ts.map +1 -0
  426. package/dist/src/skills/invocation.js +165 -0
  427. package/dist/src/skills/invocation.js.map +1 -0
  428. package/dist/src/skills/loader.d.ts +70 -0
  429. package/dist/src/skills/loader.d.ts.map +1 -0
  430. package/dist/src/skills/loader.js +220 -0
  431. package/dist/src/skills/loader.js.map +1 -0
  432. package/dist/src/skills/local-recovery-adapter.d.ts +49 -0
  433. package/dist/src/skills/local-recovery-adapter.d.ts.map +1 -0
  434. package/dist/src/skills/local-recovery-adapter.js +184 -0
  435. package/dist/src/skills/local-recovery-adapter.js.map +1 -0
  436. package/dist/src/skills/parser.d.ts +53 -0
  437. package/dist/src/skills/parser.d.ts.map +1 -0
  438. package/dist/src/skills/parser.js +336 -0
  439. package/dist/src/skills/parser.js.map +1 -0
  440. package/dist/src/skills/registry.d.ts +123 -0
  441. package/dist/src/skills/registry.d.ts.map +1 -0
  442. package/dist/src/skills/registry.js +144 -0
  443. package/dist/src/skills/registry.js.map +1 -0
  444. package/dist/src/skills/types.d.ts +242 -0
  445. package/dist/src/skills/types.d.ts.map +1 -0
  446. package/dist/src/skills/types.js +50 -0
  447. package/dist/src/skills/types.js.map +1 -0
  448. package/dist/src/skills/validator.d.ts +31 -0
  449. package/dist/src/skills/validator.d.ts.map +1 -0
  450. package/dist/src/skills/validator.js +366 -0
  451. package/dist/src/skills/validator.js.map +1 -0
  452. package/dist/src/ucp/envelope.d.ts +165 -0
  453. package/dist/src/ucp/envelope.d.ts.map +1 -0
  454. package/dist/src/ucp/envelope.js +241 -0
  455. package/dist/src/ucp/envelope.js.map +1 -0
  456. package/dist/src/ucp/hashes.d.ts +36 -0
  457. package/dist/src/ucp/hashes.d.ts.map +1 -0
  458. package/dist/src/ucp/hashes.js +59 -0
  459. package/dist/src/ucp/hashes.js.map +1 -0
  460. package/dist/src/ucp/mappers/map-artifact.d.ts +58 -0
  461. package/dist/src/ucp/mappers/map-artifact.d.ts.map +1 -0
  462. package/dist/src/ucp/mappers/map-artifact.js +51 -0
  463. package/dist/src/ucp/mappers/map-artifact.js.map +1 -0
  464. package/dist/src/ucp/mappers/map-change-interpretation.d.ts +12 -0
  465. package/dist/src/ucp/mappers/map-change-interpretation.d.ts.map +1 -0
  466. package/dist/src/ucp/mappers/map-change-interpretation.js +18 -0
  467. package/dist/src/ucp/mappers/map-change-interpretation.js.map +1 -0
  468. package/dist/src/ucp/mappers/map-completion.d.ts +10 -0
  469. package/dist/src/ucp/mappers/map-completion.d.ts.map +1 -0
  470. package/dist/src/ucp/mappers/map-completion.js +24 -0
  471. package/dist/src/ucp/mappers/map-completion.js.map +1 -0
  472. package/dist/src/ucp/mappers/map-context.d.ts +9 -0
  473. package/dist/src/ucp/mappers/map-context.d.ts.map +1 -0
  474. package/dist/src/ucp/mappers/map-context.js +13 -0
  475. package/dist/src/ucp/mappers/map-context.js.map +1 -0
  476. package/dist/src/ucp/mappers/map-debug-trace.d.ts +10 -0
  477. package/dist/src/ucp/mappers/map-debug-trace.d.ts.map +1 -0
  478. package/dist/src/ucp/mappers/map-debug-trace.js +18 -0
  479. package/dist/src/ucp/mappers/map-debug-trace.js.map +1 -0
  480. package/dist/src/ucp/mappers/map-disambiguation.d.ts +10 -0
  481. package/dist/src/ucp/mappers/map-disambiguation.d.ts.map +1 -0
  482. package/dist/src/ucp/mappers/map-disambiguation.js +21 -0
  483. package/dist/src/ucp/mappers/map-disambiguation.js.map +1 -0
  484. package/dist/src/ucp/mappers/map-execution-trace.d.ts +64 -0
  485. package/dist/src/ucp/mappers/map-execution-trace.d.ts.map +1 -0
  486. package/dist/src/ucp/mappers/map-execution-trace.js +57 -0
  487. package/dist/src/ucp/mappers/map-execution-trace.js.map +1 -0
  488. package/dist/src/ucp/mappers/map-intent-interpretation.d.ts +11 -0
  489. package/dist/src/ucp/mappers/map-intent-interpretation.d.ts.map +1 -0
  490. package/dist/src/ucp/mappers/map-intent-interpretation.js +17 -0
  491. package/dist/src/ucp/mappers/map-intent-interpretation.js.map +1 -0
  492. package/dist/src/ucp/mappers/map-intent.d.ts +9 -0
  493. package/dist/src/ucp/mappers/map-intent.d.ts.map +1 -0
  494. package/dist/src/ucp/mappers/map-intent.js +11 -0
  495. package/dist/src/ucp/mappers/map-intent.js.map +1 -0
  496. package/dist/src/ucp/mappers/map-prv.d.ts +10 -0
  497. package/dist/src/ucp/mappers/map-prv.d.ts.map +1 -0
  498. package/dist/src/ucp/mappers/map-prv.js +14 -0
  499. package/dist/src/ucp/mappers/map-prv.js.map +1 -0
  500. package/dist/src/ucp/mappers/map-reminder-execution.d.ts +57 -0
  501. package/dist/src/ucp/mappers/map-reminder-execution.d.ts.map +1 -0
  502. package/dist/src/ucp/mappers/map-reminder-execution.js +69 -0
  503. package/dist/src/ucp/mappers/map-reminder-execution.js.map +1 -0
  504. package/dist/src/ucp/mappers/map-replay-report.d.ts +81 -0
  505. package/dist/src/ucp/mappers/map-replay-report.d.ts.map +1 -0
  506. package/dist/src/ucp/mappers/map-replay-report.js +76 -0
  507. package/dist/src/ucp/mappers/map-replay-report.js.map +1 -0
  508. package/dist/src/ucp/mappers/map-response.d.ts +13 -0
  509. package/dist/src/ucp/mappers/map-response.d.ts.map +1 -0
  510. package/dist/src/ucp/mappers/map-response.js +25 -0
  511. package/dist/src/ucp/mappers/map-response.js.map +1 -0
  512. package/dist/src/ucp/mappers/map-safety.d.ts +14 -0
  513. package/dist/src/ucp/mappers/map-safety.d.ts.map +1 -0
  514. package/dist/src/ucp/mappers/map-safety.js +22 -0
  515. package/dist/src/ucp/mappers/map-safety.js.map +1 -0
  516. package/dist/src/ucp/persistence/index.d.ts +24 -0
  517. package/dist/src/ucp/persistence/index.d.ts.map +1 -0
  518. package/dist/src/ucp/persistence/index.js +22 -0
  519. package/dist/src/ucp/persistence/index.js.map +1 -0
  520. package/dist/src/ucp/persistence/query.d.ts +164 -0
  521. package/dist/src/ucp/persistence/query.d.ts.map +1 -0
  522. package/dist/src/ucp/persistence/query.js +240 -0
  523. package/dist/src/ucp/persistence/query.js.map +1 -0
  524. package/dist/src/ucp/persistence/reader.d.ts +43 -0
  525. package/dist/src/ucp/persistence/reader.d.ts.map +1 -0
  526. package/dist/src/ucp/persistence/reader.js +104 -0
  527. package/dist/src/ucp/persistence/reader.js.map +1 -0
  528. package/dist/src/ucp/persistence/store.d.ts +77 -0
  529. package/dist/src/ucp/persistence/store.d.ts.map +1 -0
  530. package/dist/src/ucp/persistence/store.js +177 -0
  531. package/dist/src/ucp/persistence/store.js.map +1 -0
  532. package/dist/src/ucp/persistence/write.d.ts +48 -0
  533. package/dist/src/ucp/persistence/write.d.ts.map +1 -0
  534. package/dist/src/ucp/persistence/write.js +59 -0
  535. package/dist/src/ucp/persistence/write.js.map +1 -0
  536. package/dist/src/ucp/projection.d.ts +146 -0
  537. package/dist/src/ucp/projection.d.ts.map +1 -0
  538. package/dist/src/ucp/projection.js +139 -0
  539. package/dist/src/ucp/projection.js.map +1 -0
  540. package/dist/src/ucp/types.d.ts +585 -0
  541. package/dist/src/ucp/types.d.ts.map +1 -0
  542. package/dist/src/ucp/types.js +57 -0
  543. package/dist/src/ucp/types.js.map +1 -0
  544. package/dist/src/understand/completion/completion.d.ts +26 -0
  545. package/dist/src/understand/completion/completion.d.ts.map +1 -0
  546. package/dist/src/understand/completion/completion.js +45 -0
  547. package/dist/src/understand/completion/completion.js.map +1 -0
  548. package/dist/src/understand/completion/rules.d.ts +61 -0
  549. package/dist/src/understand/completion/rules.d.ts.map +1 -0
  550. package/dist/src/understand/completion/rules.js +268 -0
  551. package/dist/src/understand/completion/rules.js.map +1 -0
  552. package/dist/src/understand/completion/types.d.ts +68 -0
  553. package/dist/src/understand/completion/types.d.ts.map +1 -0
  554. package/dist/src/understand/completion/types.js +34 -0
  555. package/dist/src/understand/completion/types.js.map +1 -0
  556. package/dist/src/understand/context/context-alignment.d.ts +18 -0
  557. package/dist/src/understand/context/context-alignment.d.ts.map +1 -0
  558. package/dist/src/understand/context/context-alignment.js +61 -0
  559. package/dist/src/understand/context/context-alignment.js.map +1 -0
  560. package/dist/src/understand/context/types.d.ts +20 -0
  561. package/dist/src/understand/context/types.d.ts.map +1 -0
  562. package/dist/src/understand/context/types.js +13 -0
  563. package/dist/src/understand/context/types.js.map +1 -0
  564. package/dist/src/understand/disambiguation/detectors/missing-context.detector.d.ts +12 -0
  565. package/dist/src/understand/disambiguation/detectors/missing-context.detector.d.ts.map +1 -0
  566. package/dist/src/understand/disambiguation/detectors/missing-context.detector.js +60 -0
  567. package/dist/src/understand/disambiguation/detectors/missing-context.detector.js.map +1 -0
  568. package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.d.ts +13 -0
  569. package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.d.ts.map +1 -0
  570. package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.js +57 -0
  571. package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.js.map +1 -0
  572. package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.d.ts +16 -0
  573. package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.d.ts.map +1 -0
  574. package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.js +56 -0
  575. package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.js.map +1 -0
  576. package/dist/src/understand/disambiguation/registry.d.ts +14 -0
  577. package/dist/src/understand/disambiguation/registry.d.ts.map +1 -0
  578. package/dist/src/understand/disambiguation/registry.js +27 -0
  579. package/dist/src/understand/disambiguation/registry.js.map +1 -0
  580. package/dist/src/understand/disambiguation/types.d.ts +34 -0
  581. package/dist/src/understand/disambiguation/types.d.ts.map +1 -0
  582. package/dist/src/understand/disambiguation/types.js +15 -0
  583. package/dist/src/understand/disambiguation/types.js.map +1 -0
  584. package/dist/src/understand/intent-interpretation/intent-interpretation.d.ts +86 -0
  585. package/dist/src/understand/intent-interpretation/intent-interpretation.d.ts.map +1 -0
  586. package/dist/src/understand/intent-interpretation/intent-interpretation.js +141 -0
  587. package/dist/src/understand/intent-interpretation/intent-interpretation.js.map +1 -0
  588. package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.d.ts +33 -0
  589. package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.d.ts.map +1 -0
  590. package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.js +66 -0
  591. package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.js.map +1 -0
  592. package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.d.ts +20 -0
  593. package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.d.ts.map +1 -0
  594. package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.js +80 -0
  595. package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.js.map +1 -0
  596. package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.d.ts +25 -0
  597. package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.d.ts.map +1 -0
  598. package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.js +47 -0
  599. package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.js.map +1 -0
  600. package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.d.ts +35 -0
  601. package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.d.ts.map +1 -0
  602. package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.js +89 -0
  603. package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.js.map +1 -0
  604. package/dist/src/understand/intent-interpretation/registry.d.ts +18 -0
  605. package/dist/src/understand/intent-interpretation/registry.d.ts.map +1 -0
  606. package/dist/src/understand/intent-interpretation/registry.js +26 -0
  607. package/dist/src/understand/intent-interpretation/registry.js.map +1 -0
  608. package/dist/src/understand/intent-interpretation/types.d.ts +83 -0
  609. package/dist/src/understand/intent-interpretation/types.d.ts.map +1 -0
  610. package/dist/src/understand/intent-interpretation/types.js +40 -0
  611. package/dist/src/understand/intent-interpretation/types.js.map +1 -0
  612. package/dist/src/understand/interpretation/intent.d.ts +72 -0
  613. package/dist/src/understand/interpretation/intent.d.ts.map +1 -0
  614. package/dist/src/understand/interpretation/intent.js +414 -0
  615. package/dist/src/understand/interpretation/intent.js.map +1 -0
  616. package/dist/src/understand/interpretation/interpretation.d.ts +26 -0
  617. package/dist/src/understand/interpretation/interpretation.d.ts.map +1 -0
  618. package/dist/src/understand/interpretation/interpretation.js +43 -0
  619. package/dist/src/understand/interpretation/interpretation.js.map +1 -0
  620. package/dist/src/understand/interpretation/parser.d.ts +20 -0
  621. package/dist/src/understand/interpretation/parser.d.ts.map +1 -0
  622. package/dist/src/understand/interpretation/parser.js +88 -0
  623. package/dist/src/understand/interpretation/parser.js.map +1 -0
  624. package/dist/src/understand/interpretation/rules.d.ts +19 -0
  625. package/dist/src/understand/interpretation/rules.d.ts.map +1 -0
  626. package/dist/src/understand/interpretation/rules.js +222 -0
  627. package/dist/src/understand/interpretation/rules.js.map +1 -0
  628. package/dist/src/understand/interpretation/types.d.ts +90 -0
  629. package/dist/src/understand/interpretation/types.d.ts.map +1 -0
  630. package/dist/src/understand/interpretation/types.js +29 -0
  631. package/dist/src/understand/interpretation/types.js.map +1 -0
  632. package/dist/src/understand/shared/types.d.ts +13 -0
  633. package/dist/src/understand/shared/types.d.ts.map +1 -0
  634. package/dist/src/understand/shared/types.js +9 -0
  635. package/dist/src/understand/shared/types.js.map +1 -0
  636. package/dist/src/understand/silent-guidance/index.d.ts +4 -0
  637. package/dist/src/understand/silent-guidance/index.d.ts.map +1 -0
  638. package/dist/src/understand/silent-guidance/index.js +3 -0
  639. package/dist/src/understand/silent-guidance/index.js.map +1 -0
  640. package/dist/src/understand/silent-guidance/selector.d.ts +44 -0
  641. package/dist/src/understand/silent-guidance/selector.d.ts.map +1 -0
  642. package/dist/src/understand/silent-guidance/selector.js +158 -0
  643. package/dist/src/understand/silent-guidance/selector.js.map +1 -0
  644. package/dist/src/understand/silent-guidance/templates.d.ts +31 -0
  645. package/dist/src/understand/silent-guidance/templates.d.ts.map +1 -0
  646. package/dist/src/understand/silent-guidance/templates.js +109 -0
  647. package/dist/src/understand/silent-guidance/templates.js.map +1 -0
  648. package/dist/src/understand/silent-guidance/types.d.ts +36 -0
  649. package/dist/src/understand/silent-guidance/types.d.ts.map +1 -0
  650. package/dist/src/understand/silent-guidance/types.js +2 -0
  651. package/dist/src/understand/silent-guidance/types.js.map +1 -0
  652. package/dist/src/workflow/coordinator.d.ts +197 -0
  653. package/dist/src/workflow/coordinator.d.ts.map +1 -0
  654. package/dist/src/workflow/coordinator.js +682 -0
  655. package/dist/src/workflow/coordinator.js.map +1 -0
  656. package/dist/src/workflow/index.d.ts +30 -0
  657. package/dist/src/workflow/index.d.ts.map +1 -0
  658. package/dist/src/workflow/index.js +30 -0
  659. package/dist/src/workflow/index.js.map +1 -0
  660. package/dist/src/workflow/types.d.ts +213 -0
  661. package/dist/src/workflow/types.d.ts.map +1 -0
  662. package/dist/src/workflow/types.js +27 -0
  663. package/dist/src/workflow/types.js.map +1 -0
  664. package/package.json +54 -0
  665. package/ui/README.md +73 -0
@@ -0,0 +1,58 @@
1
+ /**
2
+ * usesteady-core-v2 — public API surface.
3
+ *
4
+ * This is the only import path consumers should use.
5
+ * Internal modules may be accessed directly for testing.
6
+ */
7
+ export { createEnvelope, createIntentEnvelope, createPRVEnvelope, createSafetyEnvelope, createContextAlignmentEnvelope, createDisambiguationEnvelope, createCompletionEnvelope, createIntentInterpretationEnvelope, createChangeInterpretationEnvelope, createResponseEnvelope, createInteractionContractEnvelope, createInteractionEventEnvelope, createDebugTraceEnvelope, } from "./ucp/envelope.js";
8
+ export { hashObject, stableStringify } from "./ucp/hashes.js";
9
+ // UCP mappers (pure, one per envelope family)
10
+ export { mapIntentToEnvelope } from "./ucp/mappers/map-intent.js";
11
+ export { mapPRVToEnvelope } from "./ucp/mappers/map-prv.js";
12
+ export { mapSafetyToEnvelope } from "./ucp/mappers/map-safety.js";
13
+ export { mapContextToEnvelope } from "./ucp/mappers/map-context.js";
14
+ export { mapDisambiguationToEnvelope } from "./ucp/mappers/map-disambiguation.js";
15
+ export { mapCompletionToEnvelope } from "./ucp/mappers/map-completion.js";
16
+ export { mapIntentInterpretationToEnvelope } from "./ucp/mappers/map-intent-interpretation.js";
17
+ export { mapChangeInterpretationToEnvelope } from "./ucp/mappers/map-change-interpretation.js";
18
+ export { mapResponseToEnvelope } from "./ucp/mappers/map-response.js";
19
+ export { mapDebugTraceToEnvelope } from "./ucp/mappers/map-debug-trace.js";
20
+ export { runPRV } from "./prv/prv.js";
21
+ export { runSafetyGate } from "./safety/safety-gate.js";
22
+ export { DEFAULT_CONTRACT, DEFAULT_OBSERVED_INTENT_PATTERNS, createDefaultContract } from "./interaction/defaults.js";
23
+ export { getAmbiguityPolicy, getExplanationPolicy, getUnsupportedGuidancePolicy } from "./interaction/selectors.js";
24
+ export { applyInteractionEvent } from "./interaction/updater.js";
25
+ export { observeIntentPattern } from "./interaction/observe.js";
26
+ export { applyGuidanceOrdering, FAMILIARITY_THRESHOLD } from "./interaction/guidance-order.js";
27
+ export { runContextAlignment } from "./understand/context/context-alignment.js";
28
+ export { runDisambiguation } from "./understand/disambiguation/registry.js";
29
+ export { runCompletion } from "./understand/completion/completion.js";
30
+ export { interpretChange } from "./understand/interpretation/interpretation.js";
31
+ export { parseChange } from "./understand/interpretation/parser.js";
32
+ export { runIntentInterpretation, enrichGuidance } from "./understand/intent-interpretation/intent-interpretation.js";
33
+ export { selectSilentGuidanceMode, getSilentGuidanceSteps } from "./understand/silent-guidance/index.js";
34
+ export { runIntake, runIntakeWithTrace, runIntakeWithUCP } from "./intake/intake-service.js";
35
+ export { formatIntakeResult } from "./present/format.js";
36
+ export { presentFromInput, isReminderConfirmable, getReminderPrompt } from "./present/present-coordinator.js";
37
+ export { presentReminder, renderReminder } from "./present/reminders/index.js";
38
+ export { projectUCPBundle } from "./ucp/projection.js";
39
+ export { createArtifactEnvelope, createExecutionTraceEnvelope } from "./ucp/envelope.js";
40
+ export { mapArtifactToEnvelope } from "./ucp/mappers/map-artifact.js";
41
+ export { mapExecutionTraceToEnvelope } from "./ucp/mappers/map-execution-trace.js";
42
+ export { createReplayReportEnvelope } from "./ucp/envelope.js";
43
+ export { mapReplayReportToEnvelope } from "./ucp/mappers/map-replay-report.js";
44
+ export { LOG_FILENAME, INDEX_FILENAME, emptyIndex, ensureStoreDir, appendEnvelope, loadIndex, updateIndex, rebuildIndex, persistEnvelope, } from "./ucp/persistence/index.js";
45
+ export { parseTimeText } from "./execution/reminders/index.js";
46
+ export { validateExecutionRequest } from "./execution/reminders/index.js";
47
+ export { buildExecutionRequest, executeReminder } from "./execution/reminders/index.js";
48
+ export { executeFromPresent, isExecutionAccepted, getExecutionNote } from "./execution/reminders/index.js";
49
+ export { createReminderExecutionEnvelope } from "./ucp/envelope.js";
50
+ export { mapReminderExecutionToEnvelope } from "./ucp/mappers/map-reminder-execution.js";
51
+ export { prepareCursorExecution, deliverCursorExecution, hasConflicts, isCursorExecutionAccepted, getCursorExecutionNote, } from "./execution/cursor/index.js";
52
+ export { buildCursorHandoffArtifact, narrowArtifactScope, approveArtifact, evaluateOCDForHandoff, applyOCDClearance, acceptOCDConflict, validateHProvidedPath, CursorDeliveryGate, } from "./cursor/index.js";
53
+ // ── UCP Phase 4B — query layer ────────────────────────────────────────────────
54
+ // Read-only navigation over the persisted UCP envelope history.
55
+ // All queries follow refs only — no inference, no caching, no mutation.
56
+ export { readEnvelopeAt, readAllEnvelopes } from "./ucp/persistence/index.js";
57
+ export { getEnvelopeById, getByType, getChain, getArtifactByRunId, getTraceByArtifactId, getReplayByArtifactId, getReminderExecutionByResponseId, getTimeline, } from "./ucp/persistence/index.js";
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmCH,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,8BAA8B,EAC9B,4BAA4B,EAC5B,wBAAwB,EACxB,kCAAkC,EAClC,kCAAkC,EAClC,sBAAsB,EACtB,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC9D,8CAA8C;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAmB,6BAA6B,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAsB,0BAA0B,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAmB,6BAA6B,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAkB,8BAA8B,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAW,qCAAqC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAe,iCAAiC,CAAC;AACnF,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAiB,+BAA+B,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAe,kCAAkC,CAAC;AAIpF,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAIxD,OAAO,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACtH,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AACpH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAI/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAIhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAQ5E,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAStE,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AASpE,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,6DAA6D,CAAC;AAItH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAWzG,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAK7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIzD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAU9G,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAKvD,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AAGzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAKnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAM/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAM/E,OAAO,EACL,YAAY,EACZ,cAAc,EACd,UAAU,EACV,cAAc,EACd,cAAc,EACd,SAAS,EACT,WAAW,EACX,YAAY,EACZ,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAWpC,OAAO,EAAE,aAAa,EAAE,MAAkB,gCAAgC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAO,gCAAgC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAKxF,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAK3G,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAO,yCAAyC,CAAC;AAU1F,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,EACZ,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AAoBrC,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAG3B,iFAAiF;AACjF,gEAAgE;AAChE,wEAAwE;AACxE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9E,OAAO,EACL,eAAe,EACf,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,gCAAgC,EAChC,WAAW,GACZ,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Intent state classifier — maps IntakeSignals to IntentStates.
3
+ *
4
+ * Deterministic, exhaustive mapping. No logic.
5
+ *
6
+ * `unknown` from disambiguation is no longer a public signal,
7
+ * so there is no case for it here.
8
+ *
9
+ * Mapping:
10
+ * unsafe → unsafe
11
+ * non_literal → non_literal
12
+ * hard_mismatch → ambiguous (requires clarification)
13
+ * ambiguous → ambiguous
14
+ * incomplete → incomplete (intent clear, field missing)
15
+ * guided_recovery → guided_recovery (vague intent, path available)
16
+ * complete → clear
17
+ */
18
+ import type { IntakeSignal, IntentState } from "./types.js";
19
+ export declare function classifyIntentState(signal: IntakeSignal): IntentState;
20
+ //# sourceMappingURL=classify-intent-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classify-intent-state.d.ts","sourceRoot":"","sources":["../../../src/intake/classify-intent-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CAUrE"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Intent state classifier — maps IntakeSignals to IntentStates.
3
+ *
4
+ * Deterministic, exhaustive mapping. No logic.
5
+ *
6
+ * `unknown` from disambiguation is no longer a public signal,
7
+ * so there is no case for it here.
8
+ *
9
+ * Mapping:
10
+ * unsafe → unsafe
11
+ * non_literal → non_literal
12
+ * hard_mismatch → ambiguous (requires clarification)
13
+ * ambiguous → ambiguous
14
+ * incomplete → incomplete (intent clear, field missing)
15
+ * guided_recovery → guided_recovery (vague intent, path available)
16
+ * complete → clear
17
+ */
18
+ export function classifyIntentState(signal) {
19
+ switch (signal.type) {
20
+ case "unsafe": return "unsafe";
21
+ case "non_literal": return "non_literal";
22
+ case "hard_mismatch": return "ambiguous";
23
+ case "ambiguous": return "ambiguous";
24
+ case "incomplete": return "incomplete";
25
+ case "guided_recovery": return "guided_recovery";
26
+ case "complete": return "clear";
27
+ }
28
+ }
29
+ //# sourceMappingURL=classify-intent-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classify-intent-state.js","sourceRoot":"","sources":["../../../src/intake/classify-intent-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,UAAU,mBAAmB,CAAC,MAAoB;IACtD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,QAAQ,CAAC,CAAU,OAAO,QAAQ,CAAC;QACxC,KAAK,aAAa,CAAC,CAAK,OAAO,aAAa,CAAC;QAC7C,KAAK,eAAe,CAAC,CAAG,OAAO,WAAW,CAAC;QAC3C,KAAK,WAAW,CAAC,CAAO,OAAO,WAAW,CAAC;QAC3C,KAAK,YAAY,CAAC,CAAM,OAAO,YAAY,CAAC;QAC5C,KAAK,iBAAiB,CAAC,CAAC,OAAO,iBAAiB,CAAC;QACjD,KAAK,UAAU,CAAC,CAAQ,OAAO,OAAO,CAAC;IACzC,CAAC;AACH,CAAC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Intake Service — the full Signal → Gate spine of UseSteady.
3
+ *
4
+ * Pipeline order (non-negotiable):
5
+ * 1. PRV — lexical context-dependency check
6
+ * 2. Safety Gate — unsafe inputs blocked here; never reach understanding
7
+ * 3. Context Alignment — semantic: social/mismatch classification
8
+ * 4. Disambiguation — ambiguous term detection; unknown falls through
9
+ * 5. Completion — executability authority, receives full context
10
+ * 6. Classify intent state
11
+ * 7. Plan response
12
+ *
13
+ * ── Public API ────────────────────────────────────────────────────────────────
14
+ *
15
+ * runIntake(input, ctx) → IntakeResult (production use)
16
+ * runIntakeWithTrace(input, ctx) → { result, trace } (observability / debug)
17
+ *
18
+ * Both call the same internal runPipeline. runIntake discards the trace.
19
+ * DebugTrace is zero-authority: it never affects the result.
20
+ *
21
+ * ── Contracts ──────────────────────────────────────────────────────────────────
22
+ *
23
+ * CONTRACT 1: execute is only reachable via complete (step 5).
24
+ * No other path produces execute.
25
+ *
26
+ * CONTRACT 2: Completion receives UnderstandContext.
27
+ * Context-dependent inputs ("run again") are resolvable in step 5.
28
+ *
29
+ * CONTRACT 3: guidance is present if and only if mode === "guide".
30
+ * No consumer re-runs completion to get next steps.
31
+ *
32
+ * CONTRACT 4: PRV is lexical, Context Alignment is semantic.
33
+ * No broad semantic reasoning in PRV.
34
+ *
35
+ * CONTRACT 5: Public result exposes final outcome, not internal intermediates.
36
+ * disambiguation `unknown` is not returned as a signal.
37
+ */
38
+ import type { IntakeContext, IntakeResult } from "./types.js";
39
+ import type { DebugTrace } from "./trace.js";
40
+ /**
41
+ * Run the intake pipeline and return the result.
42
+ * Trace is computed internally but discarded.
43
+ * Use for all production code paths.
44
+ */
45
+ export declare function runIntake(input: string, ctx: IntakeContext): IntakeResult;
46
+ /**
47
+ * Run the intake pipeline and return both the result and the debug trace.
48
+ * Use for observability, debugging, and developer tooling only.
49
+ *
50
+ * CONTRACT: DebugTrace is zero-authority.
51
+ * It records what happened; it changes nothing.
52
+ * Any code that reads DebugTrace to make a decision is wrong.
53
+ */
54
+ export declare function runIntakeWithTrace(input: string, ctx: IntakeContext): {
55
+ result: IntakeResult;
56
+ trace: DebugTrace;
57
+ };
58
+ import type { IntentEnvelope, PRVEnvelope, SafetyEnvelope, ContextAlignmentEnvelope, DisambiguationEnvelope, CompletionEnvelope, IntentInterpretationEnvelope, ChangeInterpretationEnvelope, ResponseEnvelope, DebugTraceEnvelope } from "../ucp/types.js";
59
+ /**
60
+ * UCP bundle — all envelopes produced during one intake run.
61
+ *
62
+ * Optional fields are absent when the pipeline short-circuited before
63
+ * that step ran. `intent` and `response` and `debugTrace` are always present.
64
+ *
65
+ * Ownership contract:
66
+ * - Envelopes are read-only views of pipeline outputs.
67
+ * - No envelope may mutate the pipeline.
68
+ * - Consumers must read `response.payload.mode` — never derive decisions
69
+ * from other envelopes.
70
+ */
71
+ export type UCPBundle = {
72
+ readonly intent: IntentEnvelope;
73
+ readonly prv?: PRVEnvelope;
74
+ readonly safety?: SafetyEnvelope;
75
+ readonly context?: ContextAlignmentEnvelope;
76
+ readonly disambiguation?: DisambiguationEnvelope;
77
+ readonly completion?: CompletionEnvelope;
78
+ readonly intentInterpretation?: IntentInterpretationEnvelope;
79
+ readonly changeInterpretation?: ChangeInterpretationEnvelope;
80
+ readonly response: ResponseEnvelope;
81
+ readonly debugTrace: DebugTraceEnvelope;
82
+ };
83
+ export type RunIntakeWithUCPResult = {
84
+ readonly result: IntakeResult;
85
+ readonly trace: DebugTrace;
86
+ readonly ucp: UCPBundle;
87
+ };
88
+ /**
89
+ * Run the intake pipeline and return the full result, debug trace, AND a UCP bundle.
90
+ *
91
+ * CONTRACT:
92
+ * - The authoritative result comes from runIntakeWithTrace (unchanged).
93
+ * - UCP envelopes are built by re-running each pure pipeline step to obtain
94
+ * exact native types for mapper fidelity.
95
+ * - Re-running pure steps is safe because all steps are deterministic functions.
96
+ * - The pipeline short-circuit logic is mirrored: envelopes are only created
97
+ * for steps that ran.
98
+ * - runIntakeWithUCP.result === runIntakeWithTrace.result for the same inputs.
99
+ * - UCP presence does NOT affect mode, guidance, safety, or any decision.
100
+ *
101
+ * DO NOT use the ucp bundle for routing or decision-making.
102
+ * Mode is the only handoff authority — and mode lives in result.mode.
103
+ */
104
+ export declare function runIntakeWithUCP(input: string, ctx: IntakeContext): RunIntakeWithUCPResult;
105
+ //# sourceMappingURL=intake-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intake-service.d.ts","sourceRoot":"","sources":["../../../src/intake/intake-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAoQ7C;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,YAAY,CAEzE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,aAAa,GACjB;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAE7C;AAID,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,cAAc,EACd,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,4BAA4B,EAC5B,4BAA4B,EAC5B,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAYzB;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,MAAM,EAAgB,cAAc,CAAC;IAC9C,QAAQ,CAAC,GAAG,CAAC,EAAkB,WAAW,CAAC;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAe,cAAc,CAAC;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAc,wBAAwB,CAAC;IACxD,QAAQ,CAAC,cAAc,CAAC,EAAO,sBAAsB,CAAC;IACtD,QAAQ,CAAC,UAAU,CAAC,EAAW,kBAAkB,CAAC;IAClD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IAC7D,QAAQ,CAAC,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IAC7D,QAAQ,CAAC,QAAQ,EAAc,gBAAgB,CAAC;IAChD,QAAQ,CAAC,UAAU,EAAY,kBAAkB,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAG,UAAU,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAK,SAAS,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,aAAa,GACjB,sBAAsB,CA4HxB"}
@@ -0,0 +1,407 @@
1
+ /**
2
+ * Intake Service — the full Signal → Gate spine of UseSteady.
3
+ *
4
+ * Pipeline order (non-negotiable):
5
+ * 1. PRV — lexical context-dependency check
6
+ * 2. Safety Gate — unsafe inputs blocked here; never reach understanding
7
+ * 3. Context Alignment — semantic: social/mismatch classification
8
+ * 4. Disambiguation — ambiguous term detection; unknown falls through
9
+ * 5. Completion — executability authority, receives full context
10
+ * 6. Classify intent state
11
+ * 7. Plan response
12
+ *
13
+ * ── Public API ────────────────────────────────────────────────────────────────
14
+ *
15
+ * runIntake(input, ctx) → IntakeResult (production use)
16
+ * runIntakeWithTrace(input, ctx) → { result, trace } (observability / debug)
17
+ *
18
+ * Both call the same internal runPipeline. runIntake discards the trace.
19
+ * DebugTrace is zero-authority: it never affects the result.
20
+ *
21
+ * ── Contracts ──────────────────────────────────────────────────────────────────
22
+ *
23
+ * CONTRACT 1: execute is only reachable via complete (step 5).
24
+ * No other path produces execute.
25
+ *
26
+ * CONTRACT 2: Completion receives UnderstandContext.
27
+ * Context-dependent inputs ("run again") are resolvable in step 5.
28
+ *
29
+ * CONTRACT 3: guidance is present if and only if mode === "guide".
30
+ * No consumer re-runs completion to get next steps.
31
+ *
32
+ * CONTRACT 4: PRV is lexical, Context Alignment is semantic.
33
+ * No broad semantic reasoning in PRV.
34
+ *
35
+ * CONTRACT 5: Public result exposes final outcome, not internal intermediates.
36
+ * disambiguation `unknown` is not returned as a signal.
37
+ */
38
+ import { interpretChange } from "../understand/interpretation/interpretation.js";
39
+ import { enrichGuidance } from "../understand/intent-interpretation/intent-interpretation.js";
40
+ import { applyGuidanceOrdering } from "../interaction/guidance-order.js";
41
+ import { selectSilentGuidanceMode, getSilentGuidanceSteps, } from "../understand/silent-guidance/index.js";
42
+ import { runPRV } from "../prv/prv.js";
43
+ import { runSafetyGate } from "../safety/safety-gate.js";
44
+ import { runContextAlignment } from "../understand/context/context-alignment.js";
45
+ import { runDisambiguation } from "../understand/disambiguation/registry.js";
46
+ import { runCompletion } from "../understand/completion/completion.js";
47
+ import { safetyToSignal, contextAlignmentToSignal, disambiguationToSignal, completionToSignal, } from "./signal-extractor.js";
48
+ import { classifyIntentState } from "./classify-intent-state.js";
49
+ import { planResponse } from "./response-planner.js";
50
+ function runPipeline(input, ctx) {
51
+ // Build UnderstandContext once — passed to context-aware layers.
52
+ const understandCtx = {
53
+ hasPriorSession: ctx.prvContext.hasPriorSession,
54
+ ...(ctx.prvContext.lastInput !== undefined ? { lastInput: ctx.prvContext.lastInput } : {}),
55
+ ...(ctx.prvContext.lastResult !== undefined ? { lastResult: ctx.prvContext.lastResult } : {}),
56
+ };
57
+ // ── Step 1: PRV ─────────────────────────────────────────────────────────────
58
+ const prvResult = runPRV(input, ctx.prvContext);
59
+ if (!prvResult.ok) {
60
+ const signal = { type: "hard_mismatch", source: "context" };
61
+ return {
62
+ result: { mode: "clarify", reason: prvResult.reason, signal, intentState: "ambiguous" },
63
+ trace: {
64
+ prvPassed: false,
65
+ safetyVerdict: "not_reached",
66
+ contextKind: "not_reached",
67
+ disambigKind: "not_reached",
68
+ completionKind: "not_reached",
69
+ bridgeFired: false,
70
+ },
71
+ };
72
+ }
73
+ // ── Step 2: Safety Gate ──────────────────────────────────────────────────────
74
+ const safetyResult = runSafetyGate(input);
75
+ const safetySignal = safetyToSignal(safetyResult);
76
+ if (safetySignal !== null) {
77
+ const state = classifyIntentState(safetySignal);
78
+ const decision = planResponse(state);
79
+ return {
80
+ result: {
81
+ mode: decision.mode,
82
+ reason: safetyResult.note ?? decision.reason,
83
+ signal: safetySignal,
84
+ intentState: state,
85
+ },
86
+ trace: {
87
+ prvPassed: true,
88
+ safetyVerdict: "block",
89
+ contextKind: "not_reached",
90
+ disambigKind: "not_reached",
91
+ completionKind: "not_reached",
92
+ bridgeFired: false,
93
+ },
94
+ };
95
+ }
96
+ // ── Step 3: Context Alignment ────────────────────────────────────────────────
97
+ const contextResult = runContextAlignment(input, understandCtx);
98
+ const contextSignal = contextAlignmentToSignal(contextResult);
99
+ if (contextSignal !== null) {
100
+ const state = classifyIntentState(contextSignal);
101
+ const decision = planResponse(state);
102
+ return {
103
+ result: {
104
+ mode: decision.mode,
105
+ reason: contextResult.kind === "hard_mismatch" ? contextResult.reason : decision.reason,
106
+ signal: contextSignal,
107
+ intentState: state,
108
+ },
109
+ trace: {
110
+ prvPassed: true,
111
+ safetyVerdict: "allow",
112
+ contextKind: contextResult.kind,
113
+ disambigKind: "not_reached",
114
+ completionKind: "not_reached",
115
+ bridgeFired: false,
116
+ },
117
+ };
118
+ }
119
+ // ── Step 4: Disambiguation ───────────────────────────────────────────────────
120
+ // `unknown` → null (falls through to completion per contract).
121
+ // `ambiguous` → short-circuit with clarify.
122
+ // We record the kind regardless, since both clear and unknown fall through.
123
+ const disambigResult = runDisambiguation(input);
124
+ const disambigSignal = disambiguationToSignal(disambigResult);
125
+ if (disambigSignal !== null) {
126
+ const state = classifyIntentState(disambigSignal);
127
+ const decision = planResponse(state);
128
+ return {
129
+ result: {
130
+ mode: decision.mode,
131
+ reason: disambigResult.kind === "ambiguous" ? disambigResult.reason : decision.reason,
132
+ signal: disambigSignal,
133
+ intentState: state,
134
+ },
135
+ trace: {
136
+ prvPassed: true,
137
+ safetyVerdict: "allow",
138
+ contextKind: "aligned",
139
+ disambigKind: disambigResult.kind,
140
+ completionKind: "not_reached",
141
+ bridgeFired: false,
142
+ },
143
+ };
144
+ }
145
+ // Record disambig kind for the trace even when falling through.
146
+ const tracedDisambigKind = disambigResult.kind;
147
+ // ── Step 5: Completion — authority on executability ──────────────────────────
148
+ // Receives full UnderstandContext so context-dependent inputs can be resolved.
149
+ const completionResult = runCompletion(input, understandCtx);
150
+ const completionSignal = completionToSignal(completionResult);
151
+ const state = classifyIntentState(completionSignal);
152
+ const decision = planResponse(state);
153
+ // CONTRACT: interpretation attempted when mode === "execute" (change interpretation, advisory).
154
+ if (completionResult.kind === "complete") {
155
+ const interpretation = interpretChange(input) ?? undefined;
156
+ const result = {
157
+ mode: decision.mode,
158
+ reason: decision.reason,
159
+ signal: completionSignal,
160
+ intentState: state,
161
+ };
162
+ return {
163
+ result: interpretation !== undefined ? { ...result, interpretation } : result,
164
+ trace: {
165
+ prvPassed: true,
166
+ safetyVerdict: "allow",
167
+ contextKind: "aligned",
168
+ disambigKind: tracedDisambigKind,
169
+ completionKind: "complete",
170
+ bridgeFired: false,
171
+ },
172
+ };
173
+ }
174
+ // CONTRACT: guidance present iff mode === "guide".
175
+ //
176
+ // For guided_recovery: run the Intent Interpretation Bridge to enrich guidance
177
+ // with intent classification and context-aware step labels.
178
+ //
179
+ // For incomplete: intent is already unambiguous (e.g. commit missing message).
180
+ // Bridge does not run — guidance is already specific, no interpretation needed.
181
+ //
182
+ // enrichGuidance returns null for non-guided_recovery, so the ?? fallback
183
+ // handles incomplete cleanly without branching.
184
+ const enrichedGuidance = enrichGuidance(input, completionResult, understandCtx) ?? {
185
+ missing: completionResult.missing,
186
+ nextSteps: completionResult.nextSteps,
187
+ };
188
+ // bridgeFired: bridge ran (guided_recovery OR incomplete) AND produced a classification.
189
+ // Both completion kinds lead to guide mode; both are eligible for bridge enrichment.
190
+ const bridgeEligible = completionResult.kind === "guided_recovery" || completionResult.kind === "incomplete";
191
+ const bridgeFired = bridgeEligible && enrichedGuidance.interpretation !== undefined;
192
+ // bridgeSilenceReason: set only when the bridge was eligible but no interpreter
193
+ // claimed the input. This is the observable runtime fact — it does not explain
194
+ // WHY no interpreter claimed it (that requires the formal human gate evaluation).
195
+ const bridgeSilenceReason = bridgeEligible && !bridgeFired ? "no_interpreter_claimed" : undefined;
196
+ // Phase 4C — Silent Guidance Mode (presentation-level template selection).
197
+ //
198
+ // For bridge-silent flows only, inspect the raw input for shape-level signals
199
+ // and replace the default code-patch nextSteps with mode-appropriate steps.
200
+ //
201
+ // CONTRACTS (non-negotiable):
202
+ // - Only runs when bridgeSilenceReason === "no_interpreter_claimed"
203
+ // - Does NOT produce a category, confidence, or interpretation
204
+ // - Does NOT affect mode, signal, intentState, or missing[]
205
+ // - Does NOT enter UCP envelopes
206
+ // - Does NOT imply executability
207
+ // - missing[] is always preserved unchanged
208
+ // - interpretation is always preserved unchanged (undefined for silent flows)
209
+ const silentGuidanceMode = bridgeSilenceReason === "no_interpreter_claimed"
210
+ ? selectSilentGuidanceMode(input)
211
+ : undefined;
212
+ const postBridgeGuidance = silentGuidanceMode !== undefined
213
+ ? {
214
+ missing: enrichedGuidance.missing,
215
+ nextSteps: getSilentGuidanceSteps(silentGuidanceMode),
216
+ // interpretation is undefined for silent flows; spread only if present
217
+ ...(enrichedGuidance.interpretation !== undefined
218
+ ? { interpretation: enrichedGuidance.interpretation }
219
+ : {}),
220
+ }
221
+ : enrichedGuidance;
222
+ // B2 — Session-aware guidance ordering (purely presentational).
223
+ // Reorders steps (read_first first) and adjusts read_first label emphasis
224
+ // when the user is familiar with the current guidance category
225
+ // (FAMILIARITY_THRESHOLD observations of that category).
226
+ //
227
+ // CONTRACTS:
228
+ // - Step count never changes (no add, no remove)
229
+ // - missing[] never changes
230
+ // - interpretation never changes
231
+ // - mode, reason, intentState are already decided — this cannot affect them
232
+ const guidance = applyGuidanceOrdering(postBridgeGuidance, ctx.interactionContract.observedIntentPatterns);
233
+ return {
234
+ result: {
235
+ mode: decision.mode,
236
+ reason: completionResult.reason,
237
+ signal: completionSignal,
238
+ intentState: state,
239
+ guidance,
240
+ },
241
+ trace: {
242
+ prvPassed: true,
243
+ safetyVerdict: "allow",
244
+ contextKind: "aligned",
245
+ disambigKind: tracedDisambigKind,
246
+ completionKind: completionResult.kind,
247
+ bridgeFired,
248
+ ...(bridgeSilenceReason !== undefined ? { bridgeSilenceReason } : {}),
249
+ ...(silentGuidanceMode !== undefined ? { silentGuidanceMode } : {}),
250
+ },
251
+ };
252
+ }
253
+ // ─── Public API ───────────────────────────────────────────────────────────────
254
+ /**
255
+ * Run the intake pipeline and return the result.
256
+ * Trace is computed internally but discarded.
257
+ * Use for all production code paths.
258
+ */
259
+ export function runIntake(input, ctx) {
260
+ return runPipeline(input, ctx).result;
261
+ }
262
+ /**
263
+ * Run the intake pipeline and return both the result and the debug trace.
264
+ * Use for observability, debugging, and developer tooling only.
265
+ *
266
+ * CONTRACT: DebugTrace is zero-authority.
267
+ * It records what happened; it changes nothing.
268
+ * Any code that reads DebugTrace to make a decision is wrong.
269
+ */
270
+ export function runIntakeWithTrace(input, ctx) {
271
+ return runPipeline(input, ctx);
272
+ }
273
+ import { mapIntentToEnvelope } from "../ucp/mappers/map-intent.js";
274
+ import { mapPRVToEnvelope } from "../ucp/mappers/map-prv.js";
275
+ import { mapSafetyToEnvelope } from "../ucp/mappers/map-safety.js";
276
+ import { mapContextToEnvelope } from "../ucp/mappers/map-context.js";
277
+ import { mapDisambiguationToEnvelope } from "../ucp/mappers/map-disambiguation.js";
278
+ import { mapCompletionToEnvelope } from "../ucp/mappers/map-completion.js";
279
+ import { mapIntentInterpretationToEnvelope } from "../ucp/mappers/map-intent-interpretation.js";
280
+ import { mapChangeInterpretationToEnvelope } from "../ucp/mappers/map-change-interpretation.js";
281
+ import { mapResponseToEnvelope } from "../ucp/mappers/map-response.js";
282
+ import { mapDebugTraceToEnvelope } from "../ucp/mappers/map-debug-trace.js";
283
+ /**
284
+ * Run the intake pipeline and return the full result, debug trace, AND a UCP bundle.
285
+ *
286
+ * CONTRACT:
287
+ * - The authoritative result comes from runIntakeWithTrace (unchanged).
288
+ * - UCP envelopes are built by re-running each pure pipeline step to obtain
289
+ * exact native types for mapper fidelity.
290
+ * - Re-running pure steps is safe because all steps are deterministic functions.
291
+ * - The pipeline short-circuit logic is mirrored: envelopes are only created
292
+ * for steps that ran.
293
+ * - runIntakeWithUCP.result === runIntakeWithTrace.result for the same inputs.
294
+ * - UCP presence does NOT affect mode, guidance, safety, or any decision.
295
+ *
296
+ * DO NOT use the ucp bundle for routing or decision-making.
297
+ * Mode is the only handoff authority — and mode lives in result.mode.
298
+ */
299
+ export function runIntakeWithUCP(input, ctx) {
300
+ // Step 0: Run the authoritative pipeline. This is the source of truth.
301
+ const { result, trace } = runPipeline(input, ctx);
302
+ // Intent envelope is always present — the raw input is always captured.
303
+ const intentEnvelope = mapIntentToEnvelope(input);
304
+ // Build UnderstandContext (mirrors the pipeline's internal construction).
305
+ const understandCtx = {
306
+ hasPriorSession: ctx.prvContext.hasPriorSession,
307
+ ...(ctx.prvContext.lastInput !== undefined ? { lastInput: ctx.prvContext.lastInput } : {}),
308
+ ...(ctx.prvContext.lastResult !== undefined ? { lastResult: ctx.prvContext.lastResult } : {}),
309
+ };
310
+ // ── Step 1: PRV ────────────────────────────────────────────────────────────
311
+ const prvResult = runPRV(input, ctx.prvContext);
312
+ const prvEnvelope = mapPRVToEnvelope(prvResult);
313
+ // Response refs: parentId + rootId always point to the intent envelope.
314
+ // This makes the response linkable via byParent and byRoot in the query layer.
315
+ const responseRefs = { parentId: intentEnvelope.id, rootId: intentEnvelope.id };
316
+ if (!prvResult.ok) {
317
+ // Pipeline short-circuited at PRV. Only intent + prv + response + trace.
318
+ return {
319
+ result,
320
+ trace,
321
+ ucp: {
322
+ intent: intentEnvelope,
323
+ prv: prvEnvelope,
324
+ response: mapResponseToEnvelope(result, responseRefs),
325
+ debugTrace: mapDebugTraceToEnvelope(trace),
326
+ },
327
+ };
328
+ }
329
+ // ── Step 2: Safety Gate ────────────────────────────────────────────────────
330
+ const safetyResult = runSafetyGate(input);
331
+ const safetyEnvelope = mapSafetyToEnvelope(safetyResult);
332
+ if (safetyResult.verdict === "block") {
333
+ return {
334
+ result,
335
+ trace,
336
+ ucp: {
337
+ intent: intentEnvelope,
338
+ prv: prvEnvelope,
339
+ safety: safetyEnvelope,
340
+ response: mapResponseToEnvelope(result, responseRefs),
341
+ debugTrace: mapDebugTraceToEnvelope(trace),
342
+ },
343
+ };
344
+ }
345
+ // ── Step 3: Context Alignment ──────────────────────────────────────────────
346
+ const contextResult = runContextAlignment(input, understandCtx);
347
+ const contextEnvelope = mapContextToEnvelope(contextResult);
348
+ if (contextResult.kind !== "aligned") {
349
+ return {
350
+ result,
351
+ trace,
352
+ ucp: {
353
+ intent: intentEnvelope,
354
+ prv: prvEnvelope,
355
+ safety: safetyEnvelope,
356
+ context: contextEnvelope,
357
+ response: mapResponseToEnvelope(result, responseRefs),
358
+ debugTrace: mapDebugTraceToEnvelope(trace),
359
+ },
360
+ };
361
+ }
362
+ // ── Step 4: Disambiguation ─────────────────────────────────────────────────
363
+ const disambigResult = runDisambiguation(input);
364
+ const disambigEnvelope = mapDisambiguationToEnvelope(disambigResult);
365
+ if (disambigResult.kind === "ambiguous") {
366
+ return {
367
+ result,
368
+ trace,
369
+ ucp: {
370
+ intent: intentEnvelope,
371
+ prv: prvEnvelope,
372
+ safety: safetyEnvelope,
373
+ context: contextEnvelope,
374
+ disambiguation: disambigEnvelope,
375
+ response: mapResponseToEnvelope(result, responseRefs),
376
+ debugTrace: mapDebugTraceToEnvelope(trace),
377
+ },
378
+ };
379
+ }
380
+ // ── Step 5: Completion ─────────────────────────────────────────────────────
381
+ const completionResult = runCompletion(input, understandCtx);
382
+ const completionEnvelope = mapCompletionToEnvelope(completionResult);
383
+ // ── Interpretation envelopes (advisory, present only when applicable) ──────
384
+ const changeInterpEnvelope = result.interpretation !== undefined
385
+ ? mapChangeInterpretationToEnvelope(result.interpretation)
386
+ : undefined;
387
+ const intentInterpEnvelope = result.guidance?.interpretation !== undefined
388
+ ? mapIntentInterpretationToEnvelope(result.guidance.interpretation)
389
+ : undefined;
390
+ return {
391
+ result,
392
+ trace,
393
+ ucp: {
394
+ intent: intentEnvelope,
395
+ prv: prvEnvelope,
396
+ safety: safetyEnvelope,
397
+ context: contextEnvelope,
398
+ disambiguation: disambigEnvelope,
399
+ completion: completionEnvelope,
400
+ ...(intentInterpEnvelope !== undefined ? { intentInterpretation: intentInterpEnvelope } : {}),
401
+ ...(changeInterpEnvelope !== undefined ? { changeInterpretation: changeInterpEnvelope } : {}),
402
+ response: mapResponseToEnvelope(result, responseRefs),
403
+ debugTrace: mapDebugTraceToEnvelope(trace),
404
+ },
405
+ };
406
+ }
407
+ //# sourceMappingURL=intake-service.js.map