@amsterdamdatalabs/enact-operator 0.1.2

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 (377) hide show
  1. package/README.md +33 -0
  2. package/dist/index.d.ts +24 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +24 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lanes/autopilot/index.d.ts +95 -0
  7. package/dist/lanes/autopilot/index.d.ts.map +1 -0
  8. package/dist/lanes/autopilot/index.js +499 -0
  9. package/dist/lanes/autopilot/index.js.map +1 -0
  10. package/dist/lanes/ralph/index.d.ts +118 -0
  11. package/dist/lanes/ralph/index.d.ts.map +1 -0
  12. package/dist/lanes/ralph/index.js +680 -0
  13. package/dist/lanes/ralph/index.js.map +1 -0
  14. package/dist/lanes/team/index.d.ts +110 -0
  15. package/dist/lanes/team/index.d.ts.map +1 -0
  16. package/dist/lanes/team/index.js +748 -0
  17. package/dist/lanes/team/index.js.map +1 -0
  18. package/dist/lanes/team/roles.d.ts +15 -0
  19. package/dist/lanes/team/roles.d.ts.map +1 -0
  20. package/dist/lanes/team/roles.js +89 -0
  21. package/dist/lanes/team/roles.js.map +1 -0
  22. package/dist/lanes/ultrawork/burst.d.ts +69 -0
  23. package/dist/lanes/ultrawork/burst.d.ts.map +1 -0
  24. package/dist/lanes/ultrawork/burst.js +254 -0
  25. package/dist/lanes/ultrawork/burst.js.map +1 -0
  26. package/dist/lanes/ultrawork/index.d.ts +159 -0
  27. package/dist/lanes/ultrawork/index.d.ts.map +1 -0
  28. package/dist/lanes/ultrawork/index.js +919 -0
  29. package/dist/lanes/ultrawork/index.js.map +1 -0
  30. package/dist/lanes/ultrawork/phases.d.ts +57 -0
  31. package/dist/lanes/ultrawork/phases.d.ts.map +1 -0
  32. package/dist/lanes/ultrawork/phases.js +116 -0
  33. package/dist/lanes/ultrawork/phases.js.map +1 -0
  34. package/dist/mcp/activation.d.ts +5 -0
  35. package/dist/mcp/activation.d.ts.map +1 -0
  36. package/dist/mcp/activation.js +234 -0
  37. package/dist/mcp/activation.js.map +1 -0
  38. package/dist/mcp/cli.d.ts +11 -0
  39. package/dist/mcp/cli.d.ts.map +1 -0
  40. package/dist/mcp/cli.js +140 -0
  41. package/dist/mcp/cli.js.map +1 -0
  42. package/dist/mcp/continuation.d.ts +5 -0
  43. package/dist/mcp/continuation.d.ts.map +1 -0
  44. package/dist/mcp/continuation.js +360 -0
  45. package/dist/mcp/continuation.js.map +1 -0
  46. package/dist/mcp/jobs.d.ts +5 -0
  47. package/dist/mcp/jobs.d.ts.map +1 -0
  48. package/dist/mcp/jobs.js +212 -0
  49. package/dist/mcp/jobs.js.map +1 -0
  50. package/dist/mcp/laneSupport.d.ts +19 -0
  51. package/dist/mcp/laneSupport.d.ts.map +1 -0
  52. package/dist/mcp/laneSupport.js +21 -0
  53. package/dist/mcp/laneSupport.js.map +1 -0
  54. package/dist/mcp/lanes/autopilot.d.ts +5 -0
  55. package/dist/mcp/lanes/autopilot.d.ts.map +1 -0
  56. package/dist/mcp/lanes/autopilot.js +227 -0
  57. package/dist/mcp/lanes/autopilot.js.map +1 -0
  58. package/dist/mcp/lanes/ralph.d.ts +5 -0
  59. package/dist/mcp/lanes/ralph.d.ts.map +1 -0
  60. package/dist/mcp/lanes/ralph.js +392 -0
  61. package/dist/mcp/lanes/ralph.js.map +1 -0
  62. package/dist/mcp/lanes/team.d.ts +5 -0
  63. package/dist/mcp/lanes/team.d.ts.map +1 -0
  64. package/dist/mcp/lanes/team.js +413 -0
  65. package/dist/mcp/lanes/team.js.map +1 -0
  66. package/dist/mcp/lanes/ultrawork.d.ts +5 -0
  67. package/dist/mcp/lanes/ultrawork.d.ts.map +1 -0
  68. package/dist/mcp/lanes/ultrawork.js +497 -0
  69. package/dist/mcp/lanes/ultrawork.js.map +1 -0
  70. package/dist/mcp/linkage.d.ts +5 -0
  71. package/dist/mcp/linkage.d.ts.map +1 -0
  72. package/dist/mcp/linkage.js +126 -0
  73. package/dist/mcp/linkage.js.map +1 -0
  74. package/dist/mcp/planning.d.ts +5 -0
  75. package/dist/mcp/planning.d.ts.map +1 -0
  76. package/dist/mcp/planning.js +584 -0
  77. package/dist/mcp/planning.js.map +1 -0
  78. package/dist/mcp/rpcTransport.d.ts +17 -0
  79. package/dist/mcp/rpcTransport.d.ts.map +1 -0
  80. package/dist/mcp/rpcTransport.js +90 -0
  81. package/dist/mcp/rpcTransport.js.map +1 -0
  82. package/dist/mcp/schemas/ralphVerify.d.ts +32 -0
  83. package/dist/mcp/schemas/ralphVerify.d.ts.map +1 -0
  84. package/dist/mcp/schemas/ralphVerify.js +20 -0
  85. package/dist/mcp/schemas/ralphVerify.js.map +1 -0
  86. package/dist/mcp/server.d.ts +5 -0
  87. package/dist/mcp/server.d.ts.map +1 -0
  88. package/dist/mcp/server.js +176 -0
  89. package/dist/mcp/server.js.map +1 -0
  90. package/dist/mcp/system.d.ts +5 -0
  91. package/dist/mcp/system.d.ts.map +1 -0
  92. package/dist/mcp/system.js +445 -0
  93. package/dist/mcp/system.js.map +1 -0
  94. package/dist/mcp/toolFilter.d.ts +2 -0
  95. package/dist/mcp/toolFilter.d.ts.map +1 -0
  96. package/dist/mcp/toolFilter.js +2 -0
  97. package/dist/mcp/toolFilter.js.map +1 -0
  98. package/dist/mcp/toolPartitions.d.ts +20 -0
  99. package/dist/mcp/toolPartitions.d.ts.map +1 -0
  100. package/dist/mcp/toolPartitions.js +280 -0
  101. package/dist/mcp/toolPartitions.js.map +1 -0
  102. package/dist/mcp/toolRuntime.d.ts +9 -0
  103. package/dist/mcp/toolRuntime.d.ts.map +1 -0
  104. package/dist/mcp/toolRuntime.js +179 -0
  105. package/dist/mcp/toolRuntime.js.map +1 -0
  106. package/dist/mcp/workflow.d.ts +12 -0
  107. package/dist/mcp/workflow.d.ts.map +1 -0
  108. package/dist/mcp/workflow.js +723 -0
  109. package/dist/mcp/workflow.js.map +1 -0
  110. package/dist/operator/hooks/hookDispatcher.d.ts +39 -0
  111. package/dist/operator/hooks/hookDispatcher.d.ts.map +1 -0
  112. package/dist/operator/hooks/hookDispatcher.js +58 -0
  113. package/dist/operator/hooks/hookDispatcher.js.map +1 -0
  114. package/dist/operator/hooks/hookGating.d.ts +28 -0
  115. package/dist/operator/hooks/hookGating.d.ts.map +1 -0
  116. package/dist/operator/hooks/hookGating.js +61 -0
  117. package/dist/operator/hooks/hookGating.js.map +1 -0
  118. package/dist/operator/hooks/hooks.d.ts +20 -0
  119. package/dist/operator/hooks/hooks.d.ts.map +1 -0
  120. package/dist/operator/hooks/hooks.js +124 -0
  121. package/dist/operator/hooks/hooks.js.map +1 -0
  122. package/dist/operator/hooks/toolGuardHooks.d.ts +86 -0
  123. package/dist/operator/hooks/toolGuardHooks.d.ts.map +1 -0
  124. package/dist/operator/hooks/toolGuardHooks.js +163 -0
  125. package/dist/operator/hooks/toolGuardHooks.js.map +1 -0
  126. package/dist/operator/hud.d.ts +115 -0
  127. package/dist/operator/hud.d.ts.map +1 -0
  128. package/dist/operator/hud.js +229 -0
  129. package/dist/operator/hud.js.map +1 -0
  130. package/dist/operator/missions.d.ts +125 -0
  131. package/dist/operator/missions.d.ts.map +1 -0
  132. package/dist/operator/missions.js +304 -0
  133. package/dist/operator/missions.js.map +1 -0
  134. package/dist/operator/operatorCore.d.ts +11 -0
  135. package/dist/operator/operatorCore.d.ts.map +1 -0
  136. package/dist/operator/operatorCore.js +9 -0
  137. package/dist/operator/operatorCore.js.map +1 -0
  138. package/dist/operator/operatorRuntimeCore.d.ts +17 -0
  139. package/dist/operator/operatorRuntimeCore.d.ts.map +1 -0
  140. package/dist/operator/operatorRuntimeCore.js +17 -0
  141. package/dist/operator/operatorRuntimeCore.js.map +1 -0
  142. package/dist/operator/runtime.d.ts +74 -0
  143. package/dist/operator/runtime.d.ts.map +1 -0
  144. package/dist/operator/runtime.js +357 -0
  145. package/dist/operator/runtime.js.map +1 -0
  146. package/dist/shared/core/bootstrap.d.ts +16 -0
  147. package/dist/shared/core/bootstrap.d.ts.map +1 -0
  148. package/dist/shared/core/bootstrap.js +77 -0
  149. package/dist/shared/core/bootstrap.js.map +1 -0
  150. package/dist/shared/core/contract.d.ts +71 -0
  151. package/dist/shared/core/contract.d.ts.map +1 -0
  152. package/dist/shared/core/contract.js +452 -0
  153. package/dist/shared/core/contract.js.map +1 -0
  154. package/dist/shared/core/events.d.ts +57 -0
  155. package/dist/shared/core/events.d.ts.map +1 -0
  156. package/dist/shared/core/events.js +36 -0
  157. package/dist/shared/core/events.js.map +1 -0
  158. package/dist/shared/core/jobs.d.ts +46 -0
  159. package/dist/shared/core/jobs.d.ts.map +1 -0
  160. package/dist/shared/core/jobs.js +137 -0
  161. package/dist/shared/core/jobs.js.map +1 -0
  162. package/dist/shared/core/json.d.ts +12 -0
  163. package/dist/shared/core/json.d.ts.map +1 -0
  164. package/dist/shared/core/json.js +52 -0
  165. package/dist/shared/core/json.js.map +1 -0
  166. package/dist/shared/core/layoutMigration.d.ts +11 -0
  167. package/dist/shared/core/layoutMigration.d.ts.map +1 -0
  168. package/dist/shared/core/layoutMigration.js +56 -0
  169. package/dist/shared/core/layoutMigration.js.map +1 -0
  170. package/dist/shared/core/lifecycle.d.ts +61 -0
  171. package/dist/shared/core/lifecycle.d.ts.map +1 -0
  172. package/dist/shared/core/lifecycle.js +123 -0
  173. package/dist/shared/core/lifecycle.js.map +1 -0
  174. package/dist/shared/core/packagePaths.d.ts +2 -0
  175. package/dist/shared/core/packagePaths.d.ts.map +1 -0
  176. package/dist/shared/core/packagePaths.js +9 -0
  177. package/dist/shared/core/packagePaths.js.map +1 -0
  178. package/dist/shared/core/terminology.d.ts +38 -0
  179. package/dist/shared/core/terminology.d.ts.map +1 -0
  180. package/dist/shared/core/terminology.js +54 -0
  181. package/dist/shared/core/terminology.js.map +1 -0
  182. package/dist/shared/core/types.d.ts +30 -0
  183. package/dist/shared/core/types.d.ts.map +1 -0
  184. package/dist/shared/core/types.js +2 -0
  185. package/dist/shared/core/types.js.map +1 -0
  186. package/dist/shared/diagnostics/doctor.d.ts +19 -0
  187. package/dist/shared/diagnostics/doctor.d.ts.map +1 -0
  188. package/dist/shared/diagnostics/doctor.js +82 -0
  189. package/dist/shared/diagnostics/doctor.js.map +1 -0
  190. package/dist/shared/diagnostics/hostRollout.d.ts +16 -0
  191. package/dist/shared/diagnostics/hostRollout.d.ts.map +1 -0
  192. package/dist/shared/diagnostics/hostRollout.js +78 -0
  193. package/dist/shared/diagnostics/hostRollout.js.map +1 -0
  194. package/dist/shared/observability/emit.d.ts +3 -0
  195. package/dist/shared/observability/emit.d.ts.map +1 -0
  196. package/dist/shared/observability/emit.js +17 -0
  197. package/dist/shared/observability/emit.js.map +1 -0
  198. package/dist/shared/observability/testWorkspace.d.ts +4 -0
  199. package/dist/shared/observability/testWorkspace.d.ts.map +1 -0
  200. package/dist/shared/observability/testWorkspace.js +35 -0
  201. package/dist/shared/observability/testWorkspace.js.map +1 -0
  202. package/dist/shared/state/installRegistry.d.ts +22 -0
  203. package/dist/shared/state/installRegistry.d.ts.map +1 -0
  204. package/dist/shared/state/installRegistry.js +51 -0
  205. package/dist/shared/state/installRegistry.js.map +1 -0
  206. package/dist/shared/state/session.d.ts +18 -0
  207. package/dist/shared/state/session.d.ts.map +1 -0
  208. package/dist/shared/state/session.js +127 -0
  209. package/dist/shared/state/session.js.map +1 -0
  210. package/dist/shared/state/state.d.ts +16 -0
  211. package/dist/shared/state/state.d.ts.map +1 -0
  212. package/dist/shared/state/state.js +91 -0
  213. package/dist/shared/state/state.js.map +1 -0
  214. package/dist/shared/state/tasks.d.ts +113 -0
  215. package/dist/shared/state/tasks.d.ts.map +1 -0
  216. package/dist/shared/state/tasks.js +274 -0
  217. package/dist/shared/state/tasks.js.map +1 -0
  218. package/dist/shared/workflow/activation/activeSkill.d.ts +46 -0
  219. package/dist/shared/workflow/activation/activeSkill.d.ts.map +1 -0
  220. package/dist/shared/workflow/activation/activeSkill.js +158 -0
  221. package/dist/shared/workflow/activation/activeSkill.js.map +1 -0
  222. package/dist/shared/workflow/activation/gateProfiles.d.ts +26 -0
  223. package/dist/shared/workflow/activation/gateProfiles.d.ts.map +1 -0
  224. package/dist/shared/workflow/activation/gateProfiles.js +102 -0
  225. package/dist/shared/workflow/activation/gateProfiles.js.map +1 -0
  226. package/dist/shared/workflow/activation/modeMatrix.d.ts +28 -0
  227. package/dist/shared/workflow/activation/modeMatrix.d.ts.map +1 -0
  228. package/dist/shared/workflow/activation/modeMatrix.js +91 -0
  229. package/dist/shared/workflow/activation/modeMatrix.js.map +1 -0
  230. package/dist/shared/workflow/activation/skillActivation.d.ts +74 -0
  231. package/dist/shared/workflow/activation/skillActivation.d.ts.map +1 -0
  232. package/dist/shared/workflow/activation/skillActivation.js +485 -0
  233. package/dist/shared/workflow/activation/skillActivation.js.map +1 -0
  234. package/dist/shared/workflow/activation/skillVariant.d.ts +18 -0
  235. package/dist/shared/workflow/activation/skillVariant.d.ts.map +1 -0
  236. package/dist/shared/workflow/activation/skillVariant.js +44 -0
  237. package/dist/shared/workflow/activation/skillVariant.js.map +1 -0
  238. package/dist/shared/workflow/authority/authority.d.ts +34 -0
  239. package/dist/shared/workflow/authority/authority.d.ts.map +1 -0
  240. package/dist/shared/workflow/authority/authority.js +64 -0
  241. package/dist/shared/workflow/authority/authority.js.map +1 -0
  242. package/dist/shared/workflow/closure/closureManifest.d.ts +39 -0
  243. package/dist/shared/workflow/closure/closureManifest.d.ts.map +1 -0
  244. package/dist/shared/workflow/closure/closureManifest.js +62 -0
  245. package/dist/shared/workflow/closure/closureManifest.js.map +1 -0
  246. package/dist/shared/workflow/closure/closureRequirements.d.ts +12 -0
  247. package/dist/shared/workflow/closure/closureRequirements.d.ts.map +1 -0
  248. package/dist/shared/workflow/closure/closureRequirements.js +30 -0
  249. package/dist/shared/workflow/closure/closureRequirements.js.map +1 -0
  250. package/dist/shared/workflow/closure/contractParity.d.ts +24 -0
  251. package/dist/shared/workflow/closure/contractParity.d.ts.map +1 -0
  252. package/dist/shared/workflow/closure/contractParity.js +238 -0
  253. package/dist/shared/workflow/closure/contractParity.js.map +1 -0
  254. package/dist/shared/workflow/closure/contractParityContext.d.ts +8 -0
  255. package/dist/shared/workflow/closure/contractParityContext.d.ts.map +1 -0
  256. package/dist/shared/workflow/closure/contractParityContext.js +50 -0
  257. package/dist/shared/workflow/closure/contractParityContext.js.map +1 -0
  258. package/dist/shared/workflow/closure/scopeGuard.d.ts +11 -0
  259. package/dist/shared/workflow/closure/scopeGuard.d.ts.map +1 -0
  260. package/dist/shared/workflow/closure/scopeGuard.js +69 -0
  261. package/dist/shared/workflow/closure/scopeGuard.js.map +1 -0
  262. package/dist/shared/workflow/closure/ultragoalArtifact.d.ts +13 -0
  263. package/dist/shared/workflow/closure/ultragoalArtifact.d.ts.map +1 -0
  264. package/dist/shared/workflow/closure/ultragoalArtifact.js +31 -0
  265. package/dist/shared/workflow/closure/ultragoalArtifact.js.map +1 -0
  266. package/dist/shared/workflow/closure/workflowReconcile.d.ts +70 -0
  267. package/dist/shared/workflow/closure/workflowReconcile.d.ts.map +1 -0
  268. package/dist/shared/workflow/closure/workflowReconcile.js +267 -0
  269. package/dist/shared/workflow/closure/workflowReconcile.js.map +1 -0
  270. package/dist/shared/workflow/continuation/continuation.d.ts +109 -0
  271. package/dist/shared/workflow/continuation/continuation.d.ts.map +1 -0
  272. package/dist/shared/workflow/continuation/continuation.js +550 -0
  273. package/dist/shared/workflow/continuation/continuation.js.map +1 -0
  274. package/dist/shared/workflow/continuation/continuationEventReservations.d.ts +17 -0
  275. package/dist/shared/workflow/continuation/continuationEventReservations.d.ts.map +1 -0
  276. package/dist/shared/workflow/continuation/continuationEventReservations.js +88 -0
  277. package/dist/shared/workflow/continuation/continuationEventReservations.js.map +1 -0
  278. package/dist/shared/workflow/continuation/continuationFollowUp.d.ts +114 -0
  279. package/dist/shared/workflow/continuation/continuationFollowUp.d.ts.map +1 -0
  280. package/dist/shared/workflow/continuation/continuationFollowUp.js +330 -0
  281. package/dist/shared/workflow/continuation/continuationFollowUp.js.map +1 -0
  282. package/dist/shared/workflow/continuation/continuationOrchestrator.d.ts +66 -0
  283. package/dist/shared/workflow/continuation/continuationOrchestrator.d.ts.map +1 -0
  284. package/dist/shared/workflow/continuation/continuationOrchestrator.js +144 -0
  285. package/dist/shared/workflow/continuation/continuationOrchestrator.js.map +1 -0
  286. package/dist/shared/workflow/continuation/hookContinuation.d.ts +44 -0
  287. package/dist/shared/workflow/continuation/hookContinuation.d.ts.map +1 -0
  288. package/dist/shared/workflow/continuation/hookContinuation.js +85 -0
  289. package/dist/shared/workflow/continuation/hookContinuation.js.map +1 -0
  290. package/dist/shared/workflow/continuation/stopPolicy.d.ts +38 -0
  291. package/dist/shared/workflow/continuation/stopPolicy.d.ts.map +1 -0
  292. package/dist/shared/workflow/continuation/stopPolicy.js +435 -0
  293. package/dist/shared/workflow/continuation/stopPolicy.js.map +1 -0
  294. package/dist/shared/workflow/continuation/stopVerdict.d.ts +31 -0
  295. package/dist/shared/workflow/continuation/stopVerdict.d.ts.map +1 -0
  296. package/dist/shared/workflow/continuation/stopVerdict.js +98 -0
  297. package/dist/shared/workflow/continuation/stopVerdict.js.map +1 -0
  298. package/dist/shared/workflow/delegation/delegatedSession.d.ts +118 -0
  299. package/dist/shared/workflow/delegation/delegatedSession.d.ts.map +1 -0
  300. package/dist/shared/workflow/delegation/delegatedSession.js +496 -0
  301. package/dist/shared/workflow/delegation/delegatedSession.js.map +1 -0
  302. package/dist/shared/workflow/delegation/delegationPrompt.d.ts +3 -0
  303. package/dist/shared/workflow/delegation/delegationPrompt.d.ts.map +1 -0
  304. package/dist/shared/workflow/delegation/delegationPrompt.js +15 -0
  305. package/dist/shared/workflow/delegation/delegationPrompt.js.map +1 -0
  306. package/dist/shared/workflow/delegation/sessionTasks.d.ts +40 -0
  307. package/dist/shared/workflow/delegation/sessionTasks.d.ts.map +1 -0
  308. package/dist/shared/workflow/delegation/sessionTasks.js +73 -0
  309. package/dist/shared/workflow/delegation/sessionTasks.js.map +1 -0
  310. package/dist/shared/workflow/delegation/subagentRuntime.d.ts +26 -0
  311. package/dist/shared/workflow/delegation/subagentRuntime.d.ts.map +1 -0
  312. package/dist/shared/workflow/delegation/subagentRuntime.js +231 -0
  313. package/dist/shared/workflow/delegation/subagentRuntime.js.map +1 -0
  314. package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.d.ts +79 -0
  315. package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.d.ts.map +1 -0
  316. package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.js +166 -0
  317. package/dist/shared/workflow/delivery/adoAuxiliaryRuntime.js.map +1 -0
  318. package/dist/shared/workflow/delivery/finalWave.d.ts +57 -0
  319. package/dist/shared/workflow/delivery/finalWave.d.ts.map +1 -0
  320. package/dist/shared/workflow/delivery/finalWave.js +123 -0
  321. package/dist/shared/workflow/delivery/finalWave.js.map +1 -0
  322. package/dist/shared/workflow/delivery/lifecyclePushMap.d.ts +68 -0
  323. package/dist/shared/workflow/delivery/lifecyclePushMap.d.ts.map +1 -0
  324. package/dist/shared/workflow/delivery/lifecyclePushMap.js +82 -0
  325. package/dist/shared/workflow/delivery/lifecyclePushMap.js.map +1 -0
  326. package/dist/shared/workflow/delivery/prSidecar.d.ts +7 -0
  327. package/dist/shared/workflow/delivery/prSidecar.d.ts.map +1 -0
  328. package/dist/shared/workflow/delivery/prSidecar.js +4 -0
  329. package/dist/shared/workflow/delivery/prSidecar.js.map +1 -0
  330. package/dist/shared/workflow/delivery/reviewStaleness.d.ts +37 -0
  331. package/dist/shared/workflow/delivery/reviewStaleness.d.ts.map +1 -0
  332. package/dist/shared/workflow/delivery/reviewStaleness.js +94 -0
  333. package/dist/shared/workflow/delivery/reviewStaleness.js.map +1 -0
  334. package/dist/shared/workflow/planning/hyperplan.d.ts +40 -0
  335. package/dist/shared/workflow/planning/hyperplan.d.ts.map +1 -0
  336. package/dist/shared/workflow/planning/hyperplan.js +133 -0
  337. package/dist/shared/workflow/planning/hyperplan.js.map +1 -0
  338. package/dist/shared/workflow/planning/notepad.d.ts +17 -0
  339. package/dist/shared/workflow/planning/notepad.d.ts.map +1 -0
  340. package/dist/shared/workflow/planning/notepad.js +84 -0
  341. package/dist/shared/workflow/planning/notepad.js.map +1 -0
  342. package/dist/shared/workflow/planning/planFormat.d.ts +3 -0
  343. package/dist/shared/workflow/planning/planFormat.d.ts.map +1 -0
  344. package/dist/shared/workflow/planning/planFormat.js +14 -0
  345. package/dist/shared/workflow/planning/planFormat.js.map +1 -0
  346. package/package.json +155 -0
  347. package/runtime/hooks/_continuation.mjs +2 -0
  348. package/runtime/hooks/_lib.mjs +2 -0
  349. package/runtime/hooks/_toolGuards.mjs +2 -0
  350. package/runtime/hooks/lanes/resolveSkillActivation.mjs +241 -0
  351. package/runtime/hooks/lanes/user-prompt-submit.mjs +326 -0
  352. package/runtime/hooks/layout-dir.mjs +2 -0
  353. package/runtime/hooks/lifecycle/pre-compact.mjs +121 -0
  354. package/runtime/hooks/lifecycle/session-start.mjs +356 -0
  355. package/runtime/hooks/lifecycle/stop.mjs +223 -0
  356. package/runtime/hooks/observability.mjs +2 -0
  357. package/runtime/hooks/post-tool-use-failure.mjs +5 -0
  358. package/runtime/hooks/post-tool-use.mjs +4 -0
  359. package/runtime/hooks/pre-compact.mjs +4 -0
  360. package/runtime/hooks/pre-tool-use.mjs +4 -0
  361. package/runtime/hooks/resolveSkillActivation.mjs +4 -0
  362. package/runtime/hooks/root-dir.mjs +2 -0
  363. package/runtime/hooks/session-start.mjs +4 -0
  364. package/runtime/hooks/shared/_continuation.mjs +341 -0
  365. package/runtime/hooks/shared/_lib.mjs +60 -0
  366. package/runtime/hooks/shared/_toolGuards.mjs +237 -0
  367. package/runtime/hooks/shared/config.mjs +143 -0
  368. package/runtime/hooks/shared/layout-dir.mjs +12 -0
  369. package/runtime/hooks/shared/observability.mjs +257 -0
  370. package/runtime/hooks/shared/root-dir.mjs +9 -0
  371. package/runtime/hooks/stop.mjs +4 -0
  372. package/runtime/hooks/subagent-tracker.mjs +4 -0
  373. package/runtime/hooks/subagents/subagent-tracker.mjs +106 -0
  374. package/runtime/hooks/tools/post-tool-use-failure.mjs +251 -0
  375. package/runtime/hooks/tools/post-tool-use.mjs +205 -0
  376. package/runtime/hooks/tools/pre-tool-use.mjs +268 -0
  377. package/runtime/hooks/user-prompt-submit.mjs +4 -0
@@ -0,0 +1,94 @@
1
+ /**
2
+ * D2 — Review convergence / staleness logic.
3
+ *
4
+ * computeReviewStaleState implements the three-predicate model from Phase 5 Q1:
5
+ * P1: newer run post-dates review evidenceHorizon.verificationRunTimestamp AND commit hash differs → stale
6
+ * P2: newer run on same OR different commit explicitly passes gates the review flagged failing → superseded
7
+ * P3: same commit, ≥2 newer runs all agree previously-failing gates now pass → stale (flake guard)
8
+ *
9
+ * Priority: P2 > P1 > P3 (first match wins in priority order).
10
+ */
11
+ /**
12
+ * Extract the set of gate IDs that the review flagged as failing.
13
+ * A review has no explicit gate-level data by default; callers may pass
14
+ * gate IDs embedded in notes as 'gate:<id>:failed' tags, or provide
15
+ * them via the `failingGateIds` option.
16
+ */
17
+ function extractFailingGateIds(review, failingGateIds) {
18
+ if (failingGateIds)
19
+ return failingGateIds;
20
+ // Parse gate IDs from notes using convention: 'gate:<id>:failed'
21
+ const ids = [];
22
+ for (const note of review.notes) {
23
+ const match = /gate:([^:]+):failed/.exec(note);
24
+ if (match) {
25
+ ids.push(match[1]);
26
+ }
27
+ }
28
+ return ids;
29
+ }
30
+ /**
31
+ * Compute whether a review is current, stale, or superseded relative to
32
+ * a list of verification runs that happened after the review was created.
33
+ *
34
+ * @param review The review item to assess.
35
+ * @param runs All verification runs to compare against (order irrelevant).
36
+ * @param failingGateIds Optional explicit list of gate IDs the review flagged failing.
37
+ * If omitted, gate IDs are parsed from review.notes.
38
+ */
39
+ export function computeReviewStaleState(review, runs, failingGateIds) {
40
+ const horizon = review.evidenceHorizon;
41
+ // No horizon means the review predates evidence tracking — treat as current.
42
+ if (!horizon) {
43
+ return { staleState: 'current', trigger: null };
44
+ }
45
+ const reviewTimestamp = horizon.verificationRunTimestamp;
46
+ const reviewCommit = horizon.commitHash;
47
+ const citedGates = extractFailingGateIds(review, failingGateIds);
48
+ // Collect only runs that are strictly newer than the review's horizon timestamp.
49
+ const newerRuns = runs.filter((r) => r.runTimestamp > reviewTimestamp);
50
+ if (newerRuns.length === 0) {
51
+ return { staleState: 'current', trigger: null };
52
+ }
53
+ // ── P2 check (strongest) ─────────────────────────────────────────────────
54
+ // A newer run (any commit) explicitly passes ALL gates the review flagged failing.
55
+ if (citedGates.length > 0) {
56
+ for (const run of newerRuns) {
57
+ const allCitedGatesPass = citedGates.every((gateId) => {
58
+ const result = run.gateResults.find((g) => g.gateId === gateId);
59
+ return result?.passed === true;
60
+ });
61
+ if (allCitedGatesPass) {
62
+ return { staleState: 'superseded', trigger: 'P2' };
63
+ }
64
+ }
65
+ }
66
+ // ── P1 check ─────────────────────────────────────────────────────────────
67
+ // A newer run post-dates the review AND the commit hash differs.
68
+ for (const run of newerRuns) {
69
+ if (run.commitHash !== reviewCommit) {
70
+ return { staleState: 'stale', trigger: 'P1' };
71
+ }
72
+ }
73
+ // ── P3 check (flake guard) ────────────────────────────────────────────────
74
+ // Same commit, ≥2 distinct newer runs all agree previously-failing gates now pass.
75
+ // Single re-run with different result = flake, not signal.
76
+ if (citedGates.length > 0) {
77
+ const sameCommitNewerRuns = newerRuns.filter((r) => r.commitHash === reviewCommit);
78
+ // Require quorum of 2 distinct runs.
79
+ const distinctRunIds = new Set(sameCommitNewerRuns.map((r) => r.runId));
80
+ if (distinctRunIds.size >= 2) {
81
+ const allAgree = sameCommitNewerRuns.every((run) => {
82
+ return citedGates.every((gateId) => {
83
+ const result = run.gateResults.find((g) => g.gateId === gateId);
84
+ return result?.passed === true;
85
+ });
86
+ });
87
+ if (allAgree) {
88
+ return { staleState: 'stale', trigger: 'P3' };
89
+ }
90
+ }
91
+ }
92
+ return { staleState: 'current', trigger: null };
93
+ }
94
+ //# sourceMappingURL=reviewStaleness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewStaleness.js","sourceRoot":"","sources":["../../../../src/shared/workflow/delivery/reviewStaleness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAqBH;;;;;GAKG;AACH,SAAS,qBAAqB,CAAC,MAA0B,EAAE,cAAyB;IAClF,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC;IAC1C,iEAAiE;IACjE,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAChC,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,KAAK,EAAE,CAAC;YACV,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAA0B,EAC1B,IAAuB,EACvB,cAAyB;IAEzB,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;IAEvC,6EAA6E;IAC7E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAClD,CAAC;IAED,MAAM,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;IACzD,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;IACxC,MAAM,UAAU,GAAG,qBAAqB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAEjE,iFAAiF;IACjF,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,GAAG,eAAe,CAAC,CAAC;IAEvE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,C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AAC,CAAC;QACxE,IAAI,cAAc,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC;YAC7B,MAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACjD,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;oBACjC,MAAM,MAAM,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;oBAChE,OAAO,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;gBACjC,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YACH,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAChD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAClD,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { z } from 'zod';
2
+ import { type OperatorTeamState } from '../../../lanes/team/index.js';
3
+ declare const HyperplanRoundSchema: z.ZodObject<{
4
+ round: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
5
+ content: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export type HyperplanRound = z.infer<typeof HyperplanRoundSchema>;
8
+ export declare function startHyperplan(sessionId: string, root?: string): {
9
+ sessionId: string;
10
+ teamId: string;
11
+ roundPaths: string[];
12
+ statePath: string;
13
+ team: OperatorTeamState;
14
+ roundTaskIds: string[];
15
+ currentRound: 1;
16
+ };
17
+ export declare function completeHyperplanRound(input: {
18
+ sessionId: string;
19
+ round: 1 | 2 | 3;
20
+ content: string;
21
+ }, root?: string): {
22
+ sessionId: string;
23
+ currentRound: 1 | 2 | 3;
24
+ completedRounds: number[];
25
+ readyForPlan: boolean;
26
+ roundPath: string;
27
+ };
28
+ export declare function prepareHyperplan(input: {
29
+ sessionId: string;
30
+ rounds: HyperplanRound[];
31
+ distilledBundle: string;
32
+ }, root?: string): {
33
+ sessionId: string;
34
+ roundPaths: string[];
35
+ bundlePath: string;
36
+ handoffPath: string;
37
+ nextSkill: 'plan';
38
+ };
39
+ export {};
40
+ //# sourceMappingURL=hyperplan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperplan.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/planning/hyperplan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAwB,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAGrF,QAAA,MAAM,oBAAoB;;;iBAGxB,CAAC;AAQH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAiClE,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,IAAI,SAAwB,GAC3B;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,iBAAiB,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,CAAC,CAAC;CACjB,CA0CA;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC/D,IAAI,SAAwB,GAC3B;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,CA2BA;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE;IACL,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB,EACD,IAAI,SAAwB,GAC3B;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAoCA"}
@@ -0,0 +1,133 @@
1
+ import { join } from 'node:path';
2
+ import { z } from 'zod';
3
+ import { layoutPath, resolveOperatorRoot } from '../../../shared/core/contract.js';
4
+ import { readJson, writeJson } from '../../../shared/core/json.js';
5
+ import { ensureDir } from '../../../shared/core/json.js';
6
+ import { writeFileSync } from 'node:fs';
7
+ import { createTeam, readTeam } from '../../../lanes/team/index.js';
8
+ import { queueTeamTask } from '../../../lanes/team/index.js';
9
+ const HyperplanRoundSchema = z.object({
10
+ round: z.union([z.literal(1), z.literal(2), z.literal(3)]),
11
+ content: z.string().min(1),
12
+ });
13
+ const HyperplanPrepareInputSchema = z.object({
14
+ sessionId: z.string().min(1),
15
+ rounds: z.array(HyperplanRoundSchema).length(3),
16
+ distilledBundle: z.string().min(1),
17
+ });
18
+ function hyperplanDir(root, sessionId) {
19
+ return layoutPath(root, 'hyperplan', sessionId);
20
+ }
21
+ function hyperplanRoundPath(root, sessionId, round) {
22
+ return join(hyperplanDir(root, sessionId), `round-${round}.md`);
23
+ }
24
+ function hyperplanBundlePath(root, sessionId) {
25
+ return join(hyperplanDir(root, sessionId), 'distilled-bundle.md');
26
+ }
27
+ function hyperplanHandoffPath(root, sessionId) {
28
+ return join(hyperplanDir(root, sessionId), 'handoff.json');
29
+ }
30
+ function hyperplanStatePath(root, sessionId) {
31
+ return join(hyperplanDir(root, sessionId), 'state.json');
32
+ }
33
+ export function startHyperplan(sessionId, root = resolveOperatorRoot()) {
34
+ const safeSessionId = z.string().min(1).parse(sessionId);
35
+ const team = createTeam(root, `hyperplan-${safeSessionId}`, [
36
+ { id: 'critic-a', role: 'critic' },
37
+ { id: 'critic-b', role: 'critic' },
38
+ { id: 'architect', role: 'architect' },
39
+ { id: 'explore', role: 'explore' },
40
+ ]);
41
+ ensureDir(hyperplanDir(root, safeSessionId));
42
+ const roundPaths = [1, 2, 3].map((round) => {
43
+ const path = hyperplanRoundPath(root, safeSessionId, round);
44
+ writeFileSync(path, `# Round ${round}\n\nPending ${round === 1 ? 'independent analysis' : round === 2 ? 'cross-attack' : 'defend/refine/concede'}.\n`, 'utf8');
45
+ return path;
46
+ });
47
+ const roundTaskIds = [
48
+ queueTeamTask(root, 'Hyperplan round 1: independent analysis').id,
49
+ queueTeamTask(root, 'Hyperplan round 2: cross-attack').id,
50
+ queueTeamTask(root, 'Hyperplan round 3: defend/refine/concede').id,
51
+ ];
52
+ const statePath = hyperplanStatePath(root, safeSessionId);
53
+ writeJson(statePath, {
54
+ sessionId: safeSessionId,
55
+ teamId: team.id,
56
+ roundPaths,
57
+ roundTaskIds,
58
+ currentRound: 1,
59
+ createdAt: new Date().toISOString(),
60
+ });
61
+ const liveTeam = readTeam(root) ?? team;
62
+ return {
63
+ sessionId: safeSessionId,
64
+ teamId: team.id,
65
+ roundPaths,
66
+ statePath,
67
+ team: liveTeam,
68
+ roundTaskIds,
69
+ currentRound: 1,
70
+ };
71
+ }
72
+ export function completeHyperplanRound(input, root = resolveOperatorRoot()) {
73
+ const statePath = hyperplanStatePath(root, input.sessionId);
74
+ const state = readJson(statePath, null);
75
+ if (!state) {
76
+ throw new Error(`Hyperplan session "${input.sessionId}" not found.`);
77
+ }
78
+ if (state.currentRound !== input.round) {
79
+ throw new Error(`Hyperplan session "${input.sessionId}" expected round ${state.currentRound}, received round ${input.round}.`);
80
+ }
81
+ const roundPath = hyperplanRoundPath(root, input.sessionId, input.round);
82
+ writeFileSync(roundPath, input.content, 'utf8');
83
+ const completedRounds = [...new Set([...(state.completedRounds ?? []), input.round])].sort((a, b) => a - b);
84
+ const readyForPlan = input.round === 3;
85
+ const currentRound = input.round === 1 ? 2 : input.round === 2 ? 3 : 3;
86
+ writeJson(statePath, {
87
+ ...state,
88
+ currentRound,
89
+ completedRounds,
90
+ readyForPlan,
91
+ });
92
+ return {
93
+ sessionId: input.sessionId,
94
+ currentRound,
95
+ completedRounds,
96
+ readyForPlan,
97
+ roundPath,
98
+ };
99
+ }
100
+ export function prepareHyperplan(input, root = resolveOperatorRoot()) {
101
+ const parsed = HyperplanPrepareInputSchema.parse(input);
102
+ const seen = new Set(parsed.rounds.map((round) => round.round));
103
+ for (const required of [1, 2, 3]) {
104
+ if (!seen.has(required)) {
105
+ throw new Error(`hyperplan requires round-${required} content before handoff`);
106
+ }
107
+ }
108
+ ensureDir(hyperplanDir(root, parsed.sessionId));
109
+ const sortedRounds = [...parsed.rounds].sort((a, b) => a.round - b.round);
110
+ const roundPaths = sortedRounds.map((round) => {
111
+ const path = hyperplanRoundPath(root, parsed.sessionId, round.round);
112
+ writeFileSync(path, round.content, 'utf8');
113
+ return path;
114
+ });
115
+ const bundlePath = hyperplanBundlePath(root, parsed.sessionId);
116
+ writeFileSync(bundlePath, parsed.distilledBundle, 'utf8');
117
+ const handoffPath = hyperplanHandoffPath(root, parsed.sessionId);
118
+ writeJson(handoffPath, {
119
+ sessionId: parsed.sessionId,
120
+ nextSkill: 'plan',
121
+ roundPaths,
122
+ bundlePath,
123
+ createdAt: new Date().toISOString(),
124
+ });
125
+ return {
126
+ sessionId: parsed.sessionId,
127
+ roundPaths,
128
+ bundlePath,
129
+ handoffPath,
130
+ nextSkill: 'plan',
131
+ };
132
+ }
133
+ //# sourceMappingURL=hyperplan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperplan.js","sourceRoot":"","sources":["../../../../src/shared/workflow/planning/hyperplan.ts"],"names":[],"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,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAE1D,MAAM,WAAW,GAAG,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IACjE,SAAS,CAAC,WAAW,EAAE;QACrB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,SAAS,EAAE,MAAM;QACjB,UAAU;QACV,UAAU;QACV,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC,CAAC;IAEH,OAAO;QACL,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,UAAU;QACV,UAAU;QACV,WAAW;QACX,SAAS,EAAE,MAAM;KAClB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare const NOTEPAD_FILES: readonly ["learnings", "decisions", "issues", "problems"];
2
+ export type NotepadFile = (typeof NOTEPAD_FILES)[number];
3
+ export interface NotepadEntry {
4
+ path: string;
5
+ content: string;
6
+ exists: boolean;
7
+ }
8
+ export interface NotepadBundle {
9
+ lane: string;
10
+ sessionId: string;
11
+ dir: string;
12
+ files: Record<NotepadFile, NotepadEntry>;
13
+ }
14
+ export declare function renderNotepadContextSection(bundle: NotepadBundle): string;
15
+ export declare function readNotepad(lane: string, sessionId: string, root?: string): NotepadBundle;
16
+ export declare function appendNotepad(lane: string, sessionId: string, file: NotepadFile, entry: string, root?: string): void;
17
+ //# sourceMappingURL=notepad.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notepad.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/planning/notepad.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,2DAA4D,CAAC;AACvF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;CAC1C;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAczE;AAgCD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,SAAwB,GAAG,aAAa,CAuBxG;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,MAAM,EACb,IAAI,SAAwB,GAC3B,IAAI,CAiBN"}
@@ -0,0 +1,84 @@
1
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { resolveOperatorRoot } from '../../../shared/core/contract.js';
4
+ import { layoutPath } from '../../../shared/core/contract.js';
5
+ import { ensureDir } from '../../../shared/core/json.js';
6
+ export const NOTEPAD_FILES = ['learnings', 'decisions', 'issues', 'problems'];
7
+ export function renderNotepadContextSection(bundle) {
8
+ const sections = NOTEPAD_FILES
9
+ .map((file) => {
10
+ const content = bundle.files[file].content.trim();
11
+ if (!content)
12
+ return null;
13
+ return `### ${file}\n${content}`;
14
+ })
15
+ .filter((section) => section !== null);
16
+ if (sections.length === 0) {
17
+ return `## CONTEXT\nNotepad lane=${bundle.lane} session=${bundle.sessionId}\n(no notepad entries)\n`;
18
+ }
19
+ return `## CONTEXT\nNotepad lane=${bundle.lane} session=${bundle.sessionId}\n\n${sections.join('\n\n')}\n`;
20
+ }
21
+ function validateSegment(value, name) {
22
+ const trimmed = value.trim();
23
+ if (!trimmed) {
24
+ throw new Error(`notepad ${name} must be a non-empty string`);
25
+ }
26
+ if (trimmed.includes('/') || trimmed.includes('\\') || trimmed.includes('..')) {
27
+ throw new Error(`notepad ${name} must be a single safe path segment`);
28
+ }
29
+ return trimmed;
30
+ }
31
+ function notepadDir(root, lane, sessionId) {
32
+ return layoutPath(root, lane, sessionId, 'notepad');
33
+ }
34
+ function notepadFilePath(root, lane, sessionId, file) {
35
+ return join(notepadDir(root, lane, sessionId), `${file}.md`);
36
+ }
37
+ function ensureCanonicalLayout(root, lane, sessionId) {
38
+ const dir = notepadDir(root, lane, sessionId);
39
+ ensureDir(dir);
40
+ for (const file of NOTEPAD_FILES) {
41
+ const path = notepadFilePath(root, lane, sessionId, file);
42
+ if (!existsSync(path)) {
43
+ writeFileSync(path, '', 'utf8');
44
+ }
45
+ }
46
+ }
47
+ export function readNotepad(lane, sessionId, root = resolveOperatorRoot()) {
48
+ const safeLane = validateSegment(lane, 'lane');
49
+ const safeSessionId = validateSegment(sessionId, 'sessionId');
50
+ const dir = notepadDir(root, safeLane, safeSessionId);
51
+ const files = Object.fromEntries(NOTEPAD_FILES.map((file) => {
52
+ const path = notepadFilePath(root, safeLane, safeSessionId, file);
53
+ const exists = existsSync(path);
54
+ return [file, {
55
+ path,
56
+ content: exists ? readFileSync(path, 'utf8') : '',
57
+ exists,
58
+ }];
59
+ }));
60
+ return {
61
+ lane: safeLane,
62
+ sessionId: safeSessionId,
63
+ dir,
64
+ files,
65
+ };
66
+ }
67
+ export function appendNotepad(lane, sessionId, file, entry, root = resolveOperatorRoot()) {
68
+ const safeLane = validateSegment(lane, 'lane');
69
+ const safeSessionId = validateSegment(sessionId, 'sessionId');
70
+ if (!NOTEPAD_FILES.includes(file)) {
71
+ throw new Error(`notepad file must be one of: ${NOTEPAD_FILES.join(', ')}`);
72
+ }
73
+ const trimmedEntry = entry.trim();
74
+ if (!trimmedEntry) {
75
+ throw new Error('notepad entry must be a non-empty string');
76
+ }
77
+ ensureCanonicalLayout(root, safeLane, safeSessionId);
78
+ const path = notepadFilePath(root, safeLane, safeSessionId, file);
79
+ const timestamp = new Date().toISOString();
80
+ const block = `## ${timestamp}\n${trimmedEntry}\n\n`;
81
+ const prefix = existsSync(path) ? readFileSync(path, 'utf8') : '';
82
+ writeFileSync(path, `${prefix}${block}`, 'utf8');
83
+ }
84
+ //# sourceMappingURL=notepad.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notepad.js","sourceRoot":"","sources":["../../../../src/shared/workflow/planning/notepad.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAgBvF,MAAM,UAAU,2BAA2B,CAAC,MAAqB;IAC/D,MAAM,QAAQ,GAAG,aAAa;SAC3B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAClD,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,OAAO,OAAO,IAAI,KAAK,OAAO,EAAE,CAAC;IACnC,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,OAAO,EAAqB,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;IAE5D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,4BAA4B,MAAM,CAAC,IAAI,YAAY,MAAM,CAAC,SAAS,0BAA0B,CAAC;IACvG,CAAC;IAED,OAAO,4BAA4B,MAAM,CAAC,IAAI,YAAY,MAAM,CAAC,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,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,gCAAgC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAClC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,qBAAqB,CAAC,IAAI,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;IAClE,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,MAAM,SAAS,KAAK,YAAY,MAAM,CAAC;IACrD,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,aAAa,CAAC,IAAI,EAAE,GAAG,MAAM,GAAG,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type PlanFormatKind = 'ralph' | 'ultragoal';
2
+ export declare function validatePlanFormat(planPath: string, kind: PlanFormatKind): void;
3
+ //# sourceMappingURL=planFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planFormat.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/planning/planFormat.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,WAAW,CAAC;AAOnD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CAO/E"}
@@ -0,0 +1,14 @@
1
+ import { readFileSync } from 'node:fs';
2
+ const REQUIRED_HEADERS = {
3
+ ralph: ['## TL;DR', '## Waves', '## Must Have', '## Must NOT Have', '## Final Verification Wave'],
4
+ ultragoal: ['## TL;DR', '## Waves', '## Must Have', '## Must NOT Have', '## Final Verification Wave'],
5
+ };
6
+ export function validatePlanFormat(planPath, kind) {
7
+ const requiredHeaders = REQUIRED_HEADERS[kind];
8
+ const content = readFileSync(planPath, 'utf8');
9
+ const missing = requiredHeaders.filter((header) => !content.includes(header));
10
+ if (missing.length > 0) {
11
+ throw new Error(`Invalid ${kind} plan format at "${planPath}": missing section(s): ${missing.join(', ')}.`);
12
+ }
13
+ }
14
+ //# sourceMappingURL=planFormat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planFormat.js","sourceRoot":"","sources":["../../../../src/shared/workflow/planning/planFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,MAAM,gBAAgB,GAAqC;IACzD,KAAK,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,4BAA4B,CAAC;IACjG,SAAS,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,4BAA4B,CAAC;CACtG,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,IAAoB;IACvE,MAAM,eAAe,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,WAAW,IAAI,oBAAoB,QAAQ,0BAA0B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9G,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,155 @@
1
+ {
2
+ "name": "@amsterdamdatalabs/enact-operator",
3
+ "version": "0.1.2",
4
+ "description": "Enact Operator package — runtime CLI, MCP server, and hook handlers",
5
+ "license": "UNLICENSED",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://dev.azure.com/amsterdamdatalabs/Enact/_git/enact-operator"
9
+ },
10
+ "type": "module",
11
+ "main": "dist/index.js",
12
+ "types": "dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ },
18
+ "./autopilot": {
19
+ "types": "./dist/lanes/autopilot/index.d.ts",
20
+ "default": "./dist/lanes/autopilot/index.js"
21
+ },
22
+ "./activeSkill": {
23
+ "types": "./dist/shared/workflow/activation/activeSkill.d.ts",
24
+ "default": "./dist/shared/workflow/activation/activeSkill.js"
25
+ },
26
+ "./authority": {
27
+ "types": "./dist/shared/workflow/authority/authority.d.ts",
28
+ "default": "./dist/shared/workflow/authority/authority.js"
29
+ },
30
+ "./continuation": {
31
+ "types": "./dist/shared/workflow/continuation/continuation.d.ts",
32
+ "default": "./dist/shared/workflow/continuation/continuation.js"
33
+ },
34
+ "./continuationEventReservations": {
35
+ "types": "./dist/shared/workflow/continuation/continuationEventReservations.d.ts",
36
+ "default": "./dist/shared/workflow/continuation/continuationEventReservations.js"
37
+ },
38
+ "./continuationFollowUp": {
39
+ "types": "./dist/shared/workflow/continuation/continuationFollowUp.d.ts",
40
+ "default": "./dist/shared/workflow/continuation/continuationFollowUp.js"
41
+ },
42
+ "./subagentRuntime": {
43
+ "types": "./dist/shared/workflow/delegation/subagentRuntime.d.ts",
44
+ "default": "./dist/shared/workflow/delegation/subagentRuntime.js"
45
+ },
46
+ "./delegatedSession": {
47
+ "types": "./dist/shared/workflow/delegation/delegatedSession.d.ts",
48
+ "default": "./dist/shared/workflow/delegation/delegatedSession.js"
49
+ },
50
+ "./delegationPrompt": {
51
+ "types": "./dist/shared/workflow/delegation/delegationPrompt.d.ts",
52
+ "default": "./dist/shared/workflow/delegation/delegationPrompt.js"
53
+ },
54
+ "./hostRollout": {
55
+ "types": "./dist/shared/diagnostics/hostRollout.d.ts",
56
+ "default": "./dist/shared/diagnostics/hostRollout.js"
57
+ },
58
+ "./hookContinuation": {
59
+ "types": "./dist/shared/workflow/continuation/hookContinuation.d.ts",
60
+ "default": "./dist/shared/workflow/continuation/hookContinuation.js"
61
+ },
62
+ "./hooks": {
63
+ "types": "./dist/operator/hooks/hooks.d.ts",
64
+ "default": "./dist/operator/hooks/hooks.js"
65
+ },
66
+ "./hud": {
67
+ "types": "./dist/operator/hud.d.ts",
68
+ "default": "./dist/operator/hud.js"
69
+ },
70
+ "./modeMatrix": {
71
+ "types": "./dist/shared/workflow/activation/modeMatrix.d.ts",
72
+ "default": "./dist/shared/workflow/activation/modeMatrix.js"
73
+ },
74
+ "./runtime": {
75
+ "types": "./dist/operator/runtime.d.ts",
76
+ "default": "./dist/operator/runtime.js"
77
+ },
78
+ "./ralph": {
79
+ "types": "./dist/lanes/ralph/index.d.ts",
80
+ "default": "./dist/lanes/ralph/index.js"
81
+ },
82
+ "./skillActivation": {
83
+ "types": "./dist/shared/workflow/activation/skillActivation.d.ts",
84
+ "default": "./dist/shared/workflow/activation/skillActivation.js"
85
+ },
86
+ "./skillVariant": {
87
+ "types": "./dist/shared/workflow/activation/skillVariant.d.ts",
88
+ "default": "./dist/shared/workflow/activation/skillVariant.js"
89
+ },
90
+ "./stopPolicy": {
91
+ "types": "./dist/shared/workflow/continuation/stopPolicy.d.ts",
92
+ "default": "./dist/shared/workflow/continuation/stopPolicy.js"
93
+ },
94
+ "./stopVerdict": {
95
+ "types": "./dist/shared/workflow/continuation/stopVerdict.d.ts",
96
+ "default": "./dist/shared/workflow/continuation/stopVerdict.js"
97
+ },
98
+ "./team": {
99
+ "types": "./dist/lanes/team/index.d.ts",
100
+ "default": "./dist/lanes/team/index.js"
101
+ },
102
+ "./ultrawork": {
103
+ "types": "./dist/lanes/ultrawork/index.d.ts",
104
+ "default": "./dist/lanes/ultrawork/index.js"
105
+ },
106
+ "./operatorCore": {
107
+ "types": "./dist/operator/operatorCore.d.ts",
108
+ "default": "./dist/operator/operatorCore.js"
109
+ },
110
+ "./operatorRuntimeCore": {
111
+ "types": "./dist/operator/operatorRuntimeCore.d.ts",
112
+ "default": "./dist/operator/operatorRuntimeCore.js"
113
+ },
114
+ "./hookGating": {
115
+ "types": "./dist/operator/hooks/hookGating.d.ts",
116
+ "default": "./dist/operator/hooks/hookGating.js"
117
+ }
118
+ },
119
+ "bin": {
120
+ "enact-operator": "dist/mcp/server.js"
121
+ },
122
+ "files": [
123
+ "dist",
124
+ "runtime"
125
+ ],
126
+ "publishConfig": {
127
+ "access": "public"
128
+ },
129
+ "scripts": {
130
+ "test:vitest": "node --experimental-vm-modules node_modules/vitest/vitest.mjs run",
131
+ "test:hooks": "node tests/hooks/run-all.mjs",
132
+ "build": "rm -rf dist && tsc -p tsconfig.json --noEmitOnError false && tsc-alias -p tsconfig.json && chmod +x dist/mcp/server.js",
133
+ "typecheck": "tsc -p tsconfig.json --noEmit",
134
+ "test": "npm run test:vitest && npm run test:hooks",
135
+ "test:parity-proof": "node --experimental-vm-modules node_modules/vitest/vitest.mjs run src/parityProof.test.ts",
136
+ "test:watch": "node --experimental-vm-modules node_modules/vitest/vitest.mjs"
137
+ },
138
+ "dependencies": {
139
+ "@iarna/toml": "^2.2.5",
140
+ "@modelcontextprotocol/sdk": "^1.29.0",
141
+ "yaml": "^2.9.0",
142
+ "zod": "4.3.6"
143
+ },
144
+ "devDependencies": {
145
+ "@emnapi/core": "1.11.1",
146
+ "@emnapi/runtime": "1.11.1",
147
+ "@types/node": "^22.0.0",
148
+ "tsc-alias": "^1.8.10",
149
+ "typescript": "^5.9.3",
150
+ "vitest": "^4.1.7"
151
+ },
152
+ "engines": {
153
+ "node": ">=22"
154
+ }
155
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./shared/_continuation.mjs";
2
+
@@ -0,0 +1,2 @@
1
+ export * from "./shared/_lib.mjs";
2
+
@@ -0,0 +1,2 @@
1
+ export * from "./shared/_toolGuards.mjs";
2
+