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,125 @@
1
+ /**
2
+ * ControlEnvelope compiler — assembles all five layers into a single envelope.
3
+ *
4
+ * ── Responsibility ────────────────────────────────────────────────────────────
5
+ *
6
+ * compileControlEnvelope() is the single entry point for the ControlEnvelope
7
+ * pipeline. It runs layers 1–5 in sequence and returns a fully populated
8
+ * ControlEnvelope.
9
+ *
10
+ * It does NOT write files. It does NOT call an LLM. It does NOT make network
11
+ * requests. It is a pure synchronous function over its input arguments.
12
+ *
13
+ * ── Invariants enforced here ─────────────────────────────────────────────────
14
+ *
15
+ * 1. plannedChanges.summary must not be empty.
16
+ * Empty summary → approval.status = "blocked", reason = "no_plan_summary".
17
+ *
18
+ * 2. Any drift conflict → approval.status = "blocked", reason = "drift_conflict".
19
+ *
20
+ * 3. Blocking conditions are checked in order: summary empty first, then drift.
21
+ * Both conditions are always evaluated (fail-full reporting).
22
+ *
23
+ * ── Usage ─────────────────────────────────────────────────────────────────────
24
+ *
25
+ * Cursor agents call this (conceptually) by filling in CompileInput and
26
+ * reading the returned ControlEnvelope. The Cursor rule in
27
+ * .cursor/rules/roadmap-discipline.mdc requires this to be shown before
28
+ * any code is written.
29
+ *
30
+ * CLI / manual usage:
31
+ * import { compileControlEnvelope } from "./src/control/index.js";
32
+ * const envelope = compileControlEnvelope({ ... });
33
+ *
34
+ * See: docs/control-envelope-v1-spec.md
35
+ */
36
+ import type { ControlEnvelope } from "./types.js";
37
+ export type CompileInput = {
38
+ /**
39
+ * The exact raw request as submitted by the user or agent.
40
+ * Used for Layer 1 (intent classification) and Layer 3 (early drift scan).
41
+ */
42
+ rawRequest: string;
43
+ /**
44
+ * Who is compiling this envelope.
45
+ * Agents invoked via .cursor/rules should use "cursor_rule".
46
+ */
47
+ source: ControlEnvelope["source"];
48
+ /**
49
+ * Layer 1 — intent fields.
50
+ * The agent must classify its own request before calling compileControlEnvelope.
51
+ * These are not inferred automatically in V1.
52
+ */
53
+ intent: {
54
+ intentClass: string;
55
+ target?: string | undefined;
56
+ goal?: string | undefined;
57
+ };
58
+ /**
59
+ * Layer 4 — planned changes.
60
+ * The agent must produce a concrete SYSTEM WILL summary before calling this.
61
+ * An empty summary array will result in approval.status = "blocked".
62
+ */
63
+ plannedChanges: {
64
+ /**
65
+ * Plain-language list of what will be done.
66
+ * Must not be empty. Example:
67
+ * ["Add WorkspacePicker to ui/src/pages/WorkflowPage.tsx"]
68
+ */
69
+ summary: string[];
70
+ /**
71
+ * File paths that may be touched. May be empty for pure-doc changes.
72
+ */
73
+ files: string[];
74
+ };
75
+ /**
76
+ * Optional: absolute path to the workspace root.
77
+ * Used to locate ROADMAP.md. Defaults to process.cwd().
78
+ */
79
+ workspaceRoot?: string | undefined;
80
+ /**
81
+ * Optional: caller-provided requestId.
82
+ * If omitted, a random UUID is generated.
83
+ */
84
+ requestId?: string | undefined;
85
+ };
86
+ /**
87
+ * Compile a ControlEnvelope from a build request.
88
+ *
89
+ * Runs all five layers:
90
+ * 1. Intent classification — from CompileInput.intent (caller-provided)
91
+ * 2. Constraint loading — from ROADMAP.md via loadPhaseConstraints()
92
+ * 3. Drift detection — scans rawRequest + plannedChanges for forbidden terms
93
+ * 4. Plan summary assembly — from CompileInput.plannedChanges
94
+ * 5. Approval gate — blocks if summary empty or drift detected
95
+ *
96
+ * Returns a fully populated ControlEnvelope. Never throws.
97
+ */
98
+ export declare function compileControlEnvelope(input: CompileInput): ControlEnvelope;
99
+ /**
100
+ * Format a ControlEnvelope as the canonical SYSTEM WILL display block.
101
+ * Used by CLI tools and Cursor agents to render the contract before approval.
102
+ *
103
+ * Output format:
104
+ *
105
+ * YOU ASKED
106
+ * <rawRequest>
107
+ *
108
+ * SYSTEM WILL
109
+ * - <summary[0]>
110
+ * - <summary[1]>
111
+ *
112
+ * FILES THAT MAY CHANGE
113
+ * - <files[0]>
114
+ *
115
+ * CONSTRAINT CHECK
116
+ * - <constraint>
117
+ *
118
+ * DRIFT CHECK: CLEAR | CONFLICT
119
+ * - <conflict[0]> (only if conflict)
120
+ *
121
+ * APPROVAL: PENDING | APPROVED | BLOCKED
122
+ * Reason: <reason> (only if blocked)
123
+ */
124
+ export declare function formatControlEnvelope(envelope: ControlEnvelope): string;
125
+ //# sourceMappingURL=compiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../../src/control/compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAUlD,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IAElC;;;;OAIG;IACH,MAAM,EAAE;QACN,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAC3B,CAAC;IAEF;;;;OAIG;IACH,cAAc,EAAE;QACd;;;;WAIG;QACH,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB;;WAEG;QACH,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IAEF;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAIF;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAqE3E;AAID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CA6CvE"}
@@ -0,0 +1,179 @@
1
+ /**
2
+ * ControlEnvelope compiler — assembles all five layers into a single envelope.
3
+ *
4
+ * ── Responsibility ────────────────────────────────────────────────────────────
5
+ *
6
+ * compileControlEnvelope() is the single entry point for the ControlEnvelope
7
+ * pipeline. It runs layers 1–5 in sequence and returns a fully populated
8
+ * ControlEnvelope.
9
+ *
10
+ * It does NOT write files. It does NOT call an LLM. It does NOT make network
11
+ * requests. It is a pure synchronous function over its input arguments.
12
+ *
13
+ * ── Invariants enforced here ─────────────────────────────────────────────────
14
+ *
15
+ * 1. plannedChanges.summary must not be empty.
16
+ * Empty summary → approval.status = "blocked", reason = "no_plan_summary".
17
+ *
18
+ * 2. Any drift conflict → approval.status = "blocked", reason = "drift_conflict".
19
+ *
20
+ * 3. Blocking conditions are checked in order: summary empty first, then drift.
21
+ * Both conditions are always evaluated (fail-full reporting).
22
+ *
23
+ * ── Usage ─────────────────────────────────────────────────────────────────────
24
+ *
25
+ * Cursor agents call this (conceptually) by filling in CompileInput and
26
+ * reading the returned ControlEnvelope. The Cursor rule in
27
+ * .cursor/rules/roadmap-discipline.mdc requires this to be shown before
28
+ * any code is written.
29
+ *
30
+ * CLI / manual usage:
31
+ * import { compileControlEnvelope } from "./src/control/index.js";
32
+ * const envelope = compileControlEnvelope({ ... });
33
+ *
34
+ * See: docs/control-envelope-v1-spec.md
35
+ */
36
+ import { randomUUID } from "node:crypto";
37
+ import { loadPhaseConstraints } from "./constraints.js";
38
+ import { detectForbiddenTermsInRequest, detectForbiddenTermsInPlan, toDriftField, } from "./drift-detector.js";
39
+ // ─── Compiler ─────────────────────────────────────────────────────────────────
40
+ /**
41
+ * Compile a ControlEnvelope from a build request.
42
+ *
43
+ * Runs all five layers:
44
+ * 1. Intent classification — from CompileInput.intent (caller-provided)
45
+ * 2. Constraint loading — from ROADMAP.md via loadPhaseConstraints()
46
+ * 3. Drift detection — scans rawRequest + plannedChanges for forbidden terms
47
+ * 4. Plan summary assembly — from CompileInput.plannedChanges
48
+ * 5. Approval gate — blocks if summary empty or drift detected
49
+ *
50
+ * Returns a fully populated ControlEnvelope. Never throws.
51
+ */
52
+ export function compileControlEnvelope(input) {
53
+ const requestId = input.requestId ?? randomUUID();
54
+ // ── Layer 2: load phase constraints ────────────────────────────────────────
55
+ const phaseConstraints = loadPhaseConstraints(input.workspaceRoot);
56
+ // ── Layer 3: drift detection ───────────────────────────────────────────────
57
+ // Scan both the raw request (catches obvious early signals) and the
58
+ // planned changes (the primary surface that matters).
59
+ const requestScan = detectForbiddenTermsInRequest(input.rawRequest);
60
+ const planScan = detectForbiddenTermsInPlan(input.plannedChanges.summary, input.plannedChanges.files);
61
+ // Merge all findings (deduplicate by message).
62
+ const allConflicts = deduplicateConflicts([
63
+ ...requestScan.conflicts,
64
+ ...planScan.conflicts,
65
+ ]);
66
+ const driftResult = toDriftField({
67
+ status: allConflicts.length > 0 ? "conflict" : "clear",
68
+ conflicts: allConflicts,
69
+ mode: "forbidden_term_scan",
70
+ });
71
+ // ── Layer 4: planned changes ───────────────────────────────────────────────
72
+ const plannedChanges = {
73
+ summary: input.plannedChanges.summary,
74
+ files: input.plannedChanges.files,
75
+ forbiddenFindings: allConflicts,
76
+ };
77
+ // ── Layer 5: approval gate ─────────────────────────────────────────────────
78
+ // Evaluate all blocking conditions. Collect all reasons.
79
+ const blockingReasons = [];
80
+ if (input.plannedChanges.summary.length === 0) {
81
+ blockingReasons.push("no_plan_summary");
82
+ }
83
+ if (driftResult.status === "conflict") {
84
+ blockingReasons.push("drift_conflict");
85
+ }
86
+ const approval = blockingReasons.length > 0
87
+ ? { status: "blocked", reason: blockingReasons.join(", ") }
88
+ : { status: "pending" };
89
+ // ── Assemble envelope ──────────────────────────────────────────────────────
90
+ return {
91
+ requestId,
92
+ source: input.source,
93
+ phase: phaseConstraints.phase,
94
+ rawRequest: input.rawRequest,
95
+ intent: {
96
+ intentClass: input.intent.intentClass,
97
+ ...(input.intent.target !== undefined ? { target: input.intent.target } : {}),
98
+ ...(input.intent.goal !== undefined ? { goal: input.intent.goal } : {}),
99
+ },
100
+ constraints: {
101
+ active: phaseConstraints.active,
102
+ source: phaseConstraints.source,
103
+ },
104
+ drift: driftResult,
105
+ plannedChanges,
106
+ approval,
107
+ };
108
+ }
109
+ // ─── Display helpers ──────────────────────────────────────────────────────────
110
+ /**
111
+ * Format a ControlEnvelope as the canonical SYSTEM WILL display block.
112
+ * Used by CLI tools and Cursor agents to render the contract before approval.
113
+ *
114
+ * Output format:
115
+ *
116
+ * YOU ASKED
117
+ * <rawRequest>
118
+ *
119
+ * SYSTEM WILL
120
+ * - <summary[0]>
121
+ * - <summary[1]>
122
+ *
123
+ * FILES THAT MAY CHANGE
124
+ * - <files[0]>
125
+ *
126
+ * CONSTRAINT CHECK
127
+ * - <constraint>
128
+ *
129
+ * DRIFT CHECK: CLEAR | CONFLICT
130
+ * - <conflict[0]> (only if conflict)
131
+ *
132
+ * APPROVAL: PENDING | APPROVED | BLOCKED
133
+ * Reason: <reason> (only if blocked)
134
+ */
135
+ export function formatControlEnvelope(envelope) {
136
+ const lines = [];
137
+ lines.push("YOU ASKED");
138
+ lines.push(envelope.rawRequest);
139
+ lines.push("");
140
+ lines.push("SYSTEM WILL");
141
+ if (envelope.plannedChanges.summary.length === 0) {
142
+ lines.push(" (no plan summary — blocked)");
143
+ }
144
+ else {
145
+ for (const item of envelope.plannedChanges.summary) {
146
+ lines.push(` - ${item}`);
147
+ }
148
+ }
149
+ lines.push("");
150
+ if (envelope.plannedChanges.files.length > 0) {
151
+ lines.push("FILES THAT MAY CHANGE");
152
+ for (const f of envelope.plannedChanges.files) {
153
+ lines.push(` - ${f}`);
154
+ }
155
+ lines.push("");
156
+ }
157
+ lines.push("CONSTRAINT CHECK");
158
+ for (const c of envelope.constraints.active) {
159
+ lines.push(` - ${c}`);
160
+ }
161
+ lines.push("");
162
+ const driftLabel = envelope.drift.status === "conflict" ? "CONFLICT" : "CLEAR";
163
+ lines.push(`DRIFT CHECK: ${driftLabel}`);
164
+ for (const conflict of envelope.drift.conflicts) {
165
+ lines.push(` ! ${conflict}`);
166
+ }
167
+ lines.push("");
168
+ const approvalLabel = envelope.approval.status.toUpperCase();
169
+ lines.push(`APPROVAL: ${approvalLabel}`);
170
+ if (envelope.approval.reason) {
171
+ lines.push(` Reason: ${envelope.approval.reason}`);
172
+ }
173
+ return lines.join("\n");
174
+ }
175
+ // ─── Internal ─────────────────────────────────────────────────────────────────
176
+ function deduplicateConflicts(conflicts) {
177
+ return [...new Set(conflicts)];
178
+ }
179
+ //# sourceMappingURL=compiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../../src/control/compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,CAAC,CAAC;IAEf,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/E,KAAK,CAAC,IAAI,CAAC,gBAAgB,UAAU,EAAE,CAAC,CAAC;IACzC,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAC;IAChC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;IAC7D,KAAK,CAAC,IAAI,CAAC,aAAa,aAAa,EAAE,CAAC,CAAC;IACzC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,aAAa,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,iFAAiF;AAEjF,SAAS,oBAAoB,CAAC,SAAmB;IAC/C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Constraint loading for ControlEnvelope — Layer 2.
3
+ *
4
+ * Provides:
5
+ * - FORBIDDEN_RUNTIME_TERMS — hardcoded set of terms that signal forbidden
6
+ * runtime/shell drift in any phase
7
+ * - PHASE_CONSTRAINTS — per-phase constraint list derived from ROADMAP.md
8
+ * - loadPhaseConstraints() — returns the active constraints for the current phase
9
+ * - CURRENT_PHASE — extracted from ROADMAP.md at module load time
10
+ *
11
+ * V1 design decision: forbidden terms are hardcoded, not parsed from ROADMAP.md.
12
+ * Dynamic roadmap semantic parsing is deferred to a future version.
13
+ * See: docs/control-envelope-v1-spec.md — Deferred items
14
+ */
15
+ export declare const FORBIDDEN_RUNTIME_TERMS: readonly ["electron", "electron-vite", "electronvite", "tauri", "forge", "desktop runtime", "new shell", "new runtime", "BrowserWindow", "ipcMain", "ipcRenderer", "contextBridge", "app.whenReady", "webContents"];
16
+ export type ForbiddenRuntimeTerm = (typeof FORBIDDEN_RUNTIME_TERMS)[number];
17
+ /**
18
+ * Attempt to extract the current PI/Iteration label from ROADMAP.md.
19
+ *
20
+ * Looks for the first line matching: ## PI-<N> — ...
21
+ * Returns the PI label (e.g. "PI-1") or "unknown" if the file cannot be read
22
+ * or no matching line is found.
23
+ *
24
+ * Kept deliberately simple — full semantic parsing is deferred to V2.
25
+ */
26
+ export declare function readCurrentPhaseFromRoadmap(workspaceRoot?: string): string;
27
+ export type PhaseConstraints = {
28
+ phase: string;
29
+ active: string[];
30
+ source: "roadmap" | "baseline" | "manual";
31
+ };
32
+ /**
33
+ * Load the active constraints for the current phase.
34
+ *
35
+ * Phase is determined by reading ROADMAP.md from the workspace root.
36
+ * Constraints are resolved from PHASE_CONSTRAINTS (hardcoded map).
37
+ * Falls back to DEFAULT_CONSTRAINTS when no matching entry exists.
38
+ *
39
+ * @param workspaceRoot - Absolute path to the workspace root. Defaults to cwd.
40
+ */
41
+ export declare function loadPhaseConstraints(workspaceRoot?: string): PhaseConstraints;
42
+ //# sourceMappingURL=constraints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../../src/control/constraints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAaH,eAAO,MAAM,uBAAuB,qNAmB1B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAiC5E;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,aAAa,GAAE,MAAsB,GAAG,MAAM,CAazF;AAID,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;CAC3C,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAiB7E"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Constraint loading for ControlEnvelope — Layer 2.
3
+ *
4
+ * Provides:
5
+ * - FORBIDDEN_RUNTIME_TERMS — hardcoded set of terms that signal forbidden
6
+ * runtime/shell drift in any phase
7
+ * - PHASE_CONSTRAINTS — per-phase constraint list derived from ROADMAP.md
8
+ * - loadPhaseConstraints() — returns the active constraints for the current phase
9
+ * - CURRENT_PHASE — extracted from ROADMAP.md at module load time
10
+ *
11
+ * V1 design decision: forbidden terms are hardcoded, not parsed from ROADMAP.md.
12
+ * Dynamic roadmap semantic parsing is deferred to a future version.
13
+ * See: docs/control-envelope-v1-spec.md — Deferred items
14
+ */
15
+ import { readFileSync } from "node:fs";
16
+ import { join } from "node:path";
17
+ // ─── Forbidden runtime terms (hardcoded in V1) ────────────────────────────────
18
+ //
19
+ // These terms, if found in a proposed plan or SYSTEM WILL description, indicate
20
+ // that the agent is introducing a forbidden runtime, shell, or architecture that
21
+ // violates the current phase constraints.
22
+ //
23
+ // Case-insensitive matching is applied at detection time.
24
+ export const FORBIDDEN_RUNTIME_TERMS = [
25
+ // Desktop runtimes
26
+ "electron",
27
+ "electron-vite",
28
+ "electronvite",
29
+ "tauri",
30
+ // Forge context (unrelated runtime shell in this workspace)
31
+ "forge",
32
+ // Generic forbidden patterns
33
+ "desktop runtime",
34
+ "new shell",
35
+ "new runtime",
36
+ // Electron-specific APIs (if a plan names these, it is introducing Electron)
37
+ "BrowserWindow",
38
+ "ipcMain",
39
+ "ipcRenderer",
40
+ "contextBridge",
41
+ "app.whenReady",
42
+ "webContents",
43
+ ];
44
+ // ─── Phase constraint definitions ─────────────────────────────────────────────
45
+ //
46
+ // Each entry maps a phase/iteration label (substring of the ROADMAP.md heading)
47
+ // to its active constraints.
48
+ //
49
+ // The key is matched case-insensitively against the phase name read from ROADMAP.md.
50
+ // The first match wins.
51
+ const PHASE_CONSTRAINTS = {
52
+ "PI-1": [
53
+ "use existing UseSteady web stack only",
54
+ "no new runtime shell",
55
+ "no Electron",
56
+ "no Tauri",
57
+ "no Forge context",
58
+ "no AI/Skills wiring",
59
+ "no autonomous execution",
60
+ "workspace entry and basic workflow only",
61
+ "every change must be E2E testable via a single user flow",
62
+ ],
63
+ };
64
+ // Fallback constraints applied when no phase-specific entry matches.
65
+ const DEFAULT_CONSTRAINTS = [
66
+ "stay within the current roadmap phase",
67
+ "no new runtime shells",
68
+ "no out-of-scope architecture changes",
69
+ ];
70
+ // ─── ROADMAP.md extraction ────────────────────────────────────────────────────
71
+ /**
72
+ * Attempt to extract the current PI/Iteration label from ROADMAP.md.
73
+ *
74
+ * Looks for the first line matching: ## PI-<N> — ...
75
+ * Returns the PI label (e.g. "PI-1") or "unknown" if the file cannot be read
76
+ * or no matching line is found.
77
+ *
78
+ * Kept deliberately simple — full semantic parsing is deferred to V2.
79
+ */
80
+ export function readCurrentPhaseFromRoadmap(workspaceRoot = process.cwd()) {
81
+ try {
82
+ const roadmapPath = join(workspaceRoot, "ROADMAP.md");
83
+ const content = readFileSync(roadmapPath, "utf-8");
84
+ // Match the first ## PI-N heading.
85
+ const match = content.match(/^##\s+(PI-\d+)/m);
86
+ if (match?.[1])
87
+ return match[1];
88
+ return "unknown";
89
+ }
90
+ catch {
91
+ return "unknown";
92
+ }
93
+ }
94
+ /**
95
+ * Load the active constraints for the current phase.
96
+ *
97
+ * Phase is determined by reading ROADMAP.md from the workspace root.
98
+ * Constraints are resolved from PHASE_CONSTRAINTS (hardcoded map).
99
+ * Falls back to DEFAULT_CONSTRAINTS when no matching entry exists.
100
+ *
101
+ * @param workspaceRoot - Absolute path to the workspace root. Defaults to cwd.
102
+ */
103
+ export function loadPhaseConstraints(workspaceRoot) {
104
+ const phase = readCurrentPhaseFromRoadmap(workspaceRoot);
105
+ // Find the first matching entry (case-insensitive key prefix match).
106
+ const matchingKey = Object.keys(PHASE_CONSTRAINTS).find((key) => phase.toLowerCase().startsWith(key.toLowerCase()));
107
+ const active = matchingKey !== undefined
108
+ ? (PHASE_CONSTRAINTS[matchingKey] ?? DEFAULT_CONSTRAINTS)
109
+ : DEFAULT_CONSTRAINTS;
110
+ return {
111
+ phase,
112
+ active,
113
+ source: "roadmap",
114
+ };
115
+ }
116
+ //# sourceMappingURL=constraints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constraints.js","sourceRoot":"","sources":["../../../src/control/constraints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,iFAAiF;AACjF,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,0CAA0C;AAC1C,EAAE;AACF,0DAA0D;AAE1D,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,mBAAmB;IACnB,UAAU;IACV,eAAe;IACf,cAAc;IACd,OAAO;IACP,4DAA4D;IAC5D,OAAO;IACP,6BAA6B;IAC7B,iBAAiB;IACjB,WAAW;IACX,aAAa;IACb,6EAA6E;IAC7E,eAAe;IACf,SAAS;IACT,aAAa;IACb,eAAe;IACf,eAAe;IACf,aAAa;CACL,CAAC;AAIX,iFAAiF;AACjF,EAAE;AACF,gFAAgF;AAChF,6BAA6B;AAC7B,EAAE;AACF,qFAAqF;AACrF,wBAAwB;AAExB,MAAM,iBAAiB,GAA6B;IAClD,MAAM,EAAE;QACN,uCAAuC;QACvC,sBAAsB;QACtB,aAAa;QACb,UAAU;QACV,kBAAkB;QAClB,qBAAqB;QACrB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 -0,0 +1,49 @@
1
+ /**
2
+ * Drift detector — Layer 3 of the ControlEnvelope pipeline.
3
+ *
4
+ * V1 strategy: forbidden_term_scan.
5
+ *
6
+ * Scans a proposed plan description (the SYSTEM WILL text) for any term from
7
+ * the FORBIDDEN_RUNTIME_TERMS list. Returns all findings as human-readable
8
+ * conflict strings.
9
+ *
10
+ * Design rules:
11
+ * - Case-insensitive matching only
12
+ * - Returns ALL findings, not just the first (fail-full, not fail-fast)
13
+ * - Each conflict string names the exact term found and where
14
+ * - Does not mutate input
15
+ * - Does not read the filesystem
16
+ * - Does not call the intake pipeline
17
+ *
18
+ * See: docs/control-envelope-v1-spec.md — Layer 3
19
+ */
20
+ import type { ControlEnvelope } from "./types.js";
21
+ export type DriftScanResult = {
22
+ status: "clear" | "conflict";
23
+ conflicts: string[];
24
+ mode: "forbidden_term_scan";
25
+ };
26
+ /**
27
+ * Scan a plan text for forbidden runtime / shell / architecture terms.
28
+ *
29
+ * @param planText - The SYSTEM WILL summary or proposed plan description.
30
+ * Pass the full text; multiple lines are fine.
31
+ * @returns DriftScanResult — status, all conflicts found, detection mode.
32
+ */
33
+ export declare function detectForbiddenTerms(planText: string): DriftScanResult;
34
+ /**
35
+ * Scan individual strings from plannedChanges.summary and plannedChanges.files.
36
+ * Convenience wrapper over detectForbiddenTerms for structured envelope fields.
37
+ *
38
+ * @param summary - The plannedChanges.summary array.
39
+ * @param files - The plannedChanges.files array.
40
+ */
41
+ export declare function detectForbiddenTermsInPlan(summary: string[], files: string[]): DriftScanResult;
42
+ /**
43
+ * Validate a raw request string for obvious forbidden terms.
44
+ * Used by the compiler before the plan is produced to catch early signals.
45
+ */
46
+ export declare function detectForbiddenTermsInRequest(rawRequest: string): DriftScanResult;
47
+ /** Convert a DriftScanResult to the drift field shape of ControlEnvelope. */
48
+ export declare function toDriftField(result: DriftScanResult): ControlEnvelope["drift"];
49
+ //# sourceMappingURL=drift-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drift-detector.d.ts","sourceRoot":"","sources":["../../../src/control/drift-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,OAAO,GAAG,UAAU,CAAC;IAC7B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,EAAE,qBAAqB,CAAC;CAC7B,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAetE;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,EAAE,MAAM,EAAE,GACd,eAAe,CAGjB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAEjF;AAqDD,6EAA6E;AAC7E,wBAAgB,YAAY,CAC1B,MAAM,EAAE,eAAe,GACtB,eAAe,CAAC,OAAO,CAAC,CAM1B"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Drift detector — Layer 3 of the ControlEnvelope pipeline.
3
+ *
4
+ * V1 strategy: forbidden_term_scan.
5
+ *
6
+ * Scans a proposed plan description (the SYSTEM WILL text) for any term from
7
+ * the FORBIDDEN_RUNTIME_TERMS list. Returns all findings as human-readable
8
+ * conflict strings.
9
+ *
10
+ * Design rules:
11
+ * - Case-insensitive matching only
12
+ * - Returns ALL findings, not just the first (fail-full, not fail-fast)
13
+ * - Each conflict string names the exact term found and where
14
+ * - Does not mutate input
15
+ * - Does not read the filesystem
16
+ * - Does not call the intake pipeline
17
+ *
18
+ * See: docs/control-envelope-v1-spec.md — Layer 3
19
+ */
20
+ import { FORBIDDEN_RUNTIME_TERMS } from "./constraints.js";
21
+ // ─── Public API ───────────────────────────────────────────────────────────────
22
+ /**
23
+ * Scan a plan text for forbidden runtime / shell / architecture terms.
24
+ *
25
+ * @param planText - The SYSTEM WILL summary or proposed plan description.
26
+ * Pass the full text; multiple lines are fine.
27
+ * @returns DriftScanResult — status, all conflicts found, detection mode.
28
+ */
29
+ export function detectForbiddenTerms(planText) {
30
+ const lower = planText.toLowerCase();
31
+ const conflicts = [];
32
+ for (const term of FORBIDDEN_RUNTIME_TERMS) {
33
+ if (containsTerm(lower, term.toLowerCase())) {
34
+ conflicts.push(buildConflictMessage(term, planText));
35
+ }
36
+ }
37
+ return {
38
+ status: conflicts.length > 0 ? "conflict" : "clear",
39
+ conflicts,
40
+ mode: "forbidden_term_scan",
41
+ };
42
+ }
43
+ /**
44
+ * Scan individual strings from plannedChanges.summary and plannedChanges.files.
45
+ * Convenience wrapper over detectForbiddenTerms for structured envelope fields.
46
+ *
47
+ * @param summary - The plannedChanges.summary array.
48
+ * @param files - The plannedChanges.files array.
49
+ */
50
+ export function detectForbiddenTermsInPlan(summary, files) {
51
+ const combined = [...summary, ...files].join("\n");
52
+ return detectForbiddenTerms(combined);
53
+ }
54
+ /**
55
+ * Validate a raw request string for obvious forbidden terms.
56
+ * Used by the compiler before the plan is produced to catch early signals.
57
+ */
58
+ export function detectForbiddenTermsInRequest(rawRequest) {
59
+ return detectForbiddenTerms(rawRequest);
60
+ }
61
+ // ─── Helpers ─────────────────────────────────────────────────────────────────
62
+ /**
63
+ * Check whether the (already-lowercased) text contains the (already-lowercased)
64
+ * term as a standalone word or substring.
65
+ *
66
+ * Word-boundary check: surround the match site with non-alphanumeric characters
67
+ * (or start/end of string) so "forge" doesn't trigger on "forgettable".
68
+ * Exception: terms that contain non-alpha characters (e.g. "electron-vite",
69
+ * "app.whenReady") are matched as plain substrings because word-boundary logic
70
+ * would incorrectly fragment them.
71
+ */
72
+ function containsTerm(lowerText, lowerTerm) {
73
+ if (!lowerText.includes(lowerTerm))
74
+ return false;
75
+ // Terms with non-alpha characters are matched as plain substrings.
76
+ if (/[^a-z]/.test(lowerTerm))
77
+ return true;
78
+ // Word-boundary check for pure-alpha terms.
79
+ const escaped = lowerTerm.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
80
+ const re = new RegExp(`(?<![a-z])${escaped}(?![a-z])`, "i");
81
+ return re.test(lowerText);
82
+ }
83
+ /**
84
+ * Build a human-readable conflict message for a found term.
85
+ * Includes a short context excerpt to help the reviewer locate the finding.
86
+ */
87
+ function buildConflictMessage(term, originalText) {
88
+ const excerpt = extractExcerpt(originalText, term);
89
+ return excerpt
90
+ ? `Forbidden runtime term "${term}" found in plan: "…${excerpt}…"`
91
+ : `Forbidden runtime term "${term}" found in plan.`;
92
+ }
93
+ /**
94
+ * Extract a short context excerpt around the first occurrence of a term.
95
+ * Returns an empty string if the term is not found (should not happen after
96
+ * containsTerm passes, but guards defensive code).
97
+ */
98
+ function extractExcerpt(text, term) {
99
+ const idx = text.toLowerCase().indexOf(term.toLowerCase());
100
+ if (idx === -1)
101
+ return "";
102
+ const start = Math.max(0, idx - 20);
103
+ const end = Math.min(text.length, idx + term.length + 20);
104
+ return text.slice(start, end).replace(/\n/g, " ").trim();
105
+ }
106
+ // ─── Narrowing helpers (for use by compiler and callers) ─────────────────────
107
+ /** Convert a DriftScanResult to the drift field shape of ControlEnvelope. */
108
+ export function toDriftField(result) {
109
+ return {
110
+ status: result.status,
111
+ conflicts: result.conflicts,
112
+ mode: result.mode,
113
+ };
114
+ }
115
+ //# sourceMappingURL=drift-detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drift-detector.js","sourceRoot":"","sources":["../../../src/control/drift-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAW3D,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACrC,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,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