@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,158 @@
1
+ import { existsSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
2
+ import { z } from 'zod';
3
+ import { layoutPath } from '../../../shared/core/contract.js';
4
+ import { ensureDir } from '../../../shared/core/json.js';
5
+ // ── Known skills enum ────────────────────────────────────────────────────────
6
+ export const KNOWN_SKILLS = ['ralph', 'ralplan', 'team', 'ultrawork', 'autopilot', 'ultragoal', 'ultraqa'];
7
+ export function isKnownSkill(name) {
8
+ return KNOWN_SKILLS.includes(name);
9
+ }
10
+ // ── Schema ───────────────────────────────────────────────────────────────────
11
+ const SCHEMA_VERSION = 1;
12
+ export const ActiveSkillStateSchema = z.object({
13
+ schemaVersion: z.literal(SCHEMA_VERSION),
14
+ skill: z.enum(KNOWN_SKILLS).nullable(),
15
+ activeSkills: z.array(z.enum(KNOWN_SKILLS)).default([]),
16
+ since: z.string().nullable(),
17
+ setBy: z.string().nullable(),
18
+ });
19
+ // ── Defaults ─────────────────────────────────────────────────────────────────
20
+ const NULL_STATE = {
21
+ schemaVersion: SCHEMA_VERSION,
22
+ skill: null,
23
+ activeSkills: [],
24
+ since: null,
25
+ setBy: null,
26
+ };
27
+ // ── Path helper ───────────────────────────────────────────────────────────────
28
+ function activeSkillPath(root) {
29
+ return layoutPath(root, 'state', 'active-skill.json');
30
+ }
31
+ // ── Public API ────────────────────────────────────────────────────────────────
32
+ /**
33
+ * Read and validate the active-skill state file.
34
+ * Returns null-skill default when file is absent, corrupt, or schema version mismatches.
35
+ */
36
+ export function readActiveSkill(root) {
37
+ const path = activeSkillPath(root);
38
+ if (!existsSync(path)) {
39
+ return { ...NULL_STATE };
40
+ }
41
+ let raw;
42
+ try {
43
+ raw = JSON.parse(readFileSync(path, 'utf8'));
44
+ }
45
+ catch {
46
+ return { ...NULL_STATE };
47
+ }
48
+ // Schema version mismatch → return null-skill default (not an error)
49
+ if (raw !== null &&
50
+ typeof raw === 'object' &&
51
+ !Array.isArray(raw) &&
52
+ raw.schemaVersion !== SCHEMA_VERSION) {
53
+ return { ...NULL_STATE };
54
+ }
55
+ const parsed = ActiveSkillStateSchema.safeParse(raw);
56
+ if (!parsed.success) {
57
+ return { ...NULL_STATE };
58
+ }
59
+ return normalizeActiveSkillState(parsed.data);
60
+ }
61
+ /**
62
+ * Write the active-skill state file atomically.
63
+ * Validates skill against the known enum — throws on unknown skill name.
64
+ */
65
+ export function writeActiveSkill(root, skill, setBy) {
66
+ if (skill !== null && !isKnownSkill(skill)) {
67
+ throw new Error(`Unknown skill "${skill}". Valid skills are: ${KNOWN_SKILLS.join(', ')}.`);
68
+ }
69
+ const state = {
70
+ schemaVersion: SCHEMA_VERSION,
71
+ skill: skill,
72
+ activeSkills: skill === null ? [] : [skill],
73
+ since: new Date().toISOString(),
74
+ setBy,
75
+ };
76
+ writeState(root, state);
77
+ }
78
+ /**
79
+ * Clear the active skill (sets skill=null). Convenience wrapper around writeActiveSkill.
80
+ */
81
+ export function clearActiveSkill(root, setBy) {
82
+ writeActiveSkill(root, null, setBy);
83
+ }
84
+ export function activateActiveSkill(root, skill, setBy) {
85
+ const current = readActiveSkill(root);
86
+ const nextSkills = current.activeSkills.filter((entry) => entry !== skill);
87
+ nextSkills.push(skill);
88
+ const nextState = normalizeActiveSkillState({
89
+ schemaVersion: SCHEMA_VERSION,
90
+ skill,
91
+ activeSkills: nextSkills,
92
+ since: new Date().toISOString(),
93
+ setBy,
94
+ });
95
+ writeState(root, nextState);
96
+ return nextState;
97
+ }
98
+ export function deactivateActiveSkill(root, setBy, skill) {
99
+ const current = readActiveSkill(root);
100
+ if (current.activeSkills.length === 0) {
101
+ const cleared = normalizeActiveSkillState({
102
+ schemaVersion: SCHEMA_VERSION,
103
+ skill: null,
104
+ activeSkills: [],
105
+ since: new Date().toISOString(),
106
+ setBy,
107
+ });
108
+ writeState(root, cleared);
109
+ return cleared;
110
+ }
111
+ const target = skill ?? current.skill;
112
+ if (target === null) {
113
+ const cleared = normalizeActiveSkillState({
114
+ schemaVersion: SCHEMA_VERSION,
115
+ skill: null,
116
+ activeSkills: [],
117
+ since: new Date().toISOString(),
118
+ setBy,
119
+ });
120
+ writeState(root, cleared);
121
+ return cleared;
122
+ }
123
+ const remaining = current.activeSkills.filter((entry) => entry !== target);
124
+ const nextState = normalizeActiveSkillState({
125
+ schemaVersion: SCHEMA_VERSION,
126
+ skill: remaining.at(-1) ?? null,
127
+ activeSkills: remaining,
128
+ since: new Date().toISOString(),
129
+ setBy,
130
+ });
131
+ writeState(root, nextState);
132
+ return nextState;
133
+ }
134
+ export function listActiveSkills(state) {
135
+ return [...state.activeSkills];
136
+ }
137
+ function normalizeActiveSkillState(state) {
138
+ const deduped = Array.from(new Set((state.activeSkills ?? []).filter(isKnownSkill)));
139
+ if (state.skill !== null && isKnownSkill(state.skill) && !deduped.includes(state.skill)) {
140
+ deduped.push(state.skill);
141
+ }
142
+ return {
143
+ schemaVersion: SCHEMA_VERSION,
144
+ skill: deduped.length === 0 ? null : (state.skill ?? deduped[deduped.length - 1]),
145
+ activeSkills: deduped,
146
+ since: state.since,
147
+ setBy: state.setBy,
148
+ };
149
+ }
150
+ function writeState(root, state) {
151
+ const path = activeSkillPath(root);
152
+ const dir = path.slice(0, path.lastIndexOf('/'));
153
+ ensureDir(dir);
154
+ const tmp = `${path}.tmp`;
155
+ writeFileSync(tmp, JSON.stringify(state, null, 2), 'utf8');
156
+ renameSync(tmp, path);
157
+ }
158
+ //# sourceMappingURL=activeSkill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activeSkill.js","sourceRoot":"","sources":["../../../../src/shared/workflow/activation/activeSkill.ts"],"names":[],"mapp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-replacement' | 'benchmark-harness';
2
+ export type GoalScope = 'repo-local' | 'operator-runtime' | 'operator-replacement';
3
+ export type GateId = string;
4
+ /**
5
+ * Returns the gate id array for the given profile name.
6
+ */
7
+ export declare function resolveGateProfile(name: GateProfile): GateId[];
8
+ /**
9
+ * Infers a gate profile from goal text and repo root path using keyword
10
+ * heuristics. Returns null if no profile can be confidently inferred.
11
+ * Callers apply the repo-identity default from Q1 when null is returned.
12
+ */
13
+ export declare function inferGateProfile(goal: string, root: string): GateProfile | null;
14
+ /**
15
+ * Returns the default GoalScope based on repo identity.
16
+ * Non-operator repos → 'repo-local'.
17
+ * Operator repo → caller must refuse or require explicit selection.
18
+ */
19
+ export declare function defaultGoalScopeForRoot(root: string): GoalScope;
20
+ /**
21
+ * Returns true when the given root path is the enact-operator repo itself.
22
+ */
23
+ export declare function isOperatorRepo(root: string): boolean;
24
+ export declare function goalScopeRank(scope?: GoalScope | null): number;
25
+ export declare function compareGoalScopes(active?: GoalScope | null, incoming?: GoalScope | null): 'same' | 'narrower' | 'broader';
26
+ //# sourceMappingURL=gateProfiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateProfiles.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/activation/gateProfiles.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,kBAAkB,GAAG,sBAAsB,GAAG,mBAAmB,CAAC;AAC9G,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,kBAAkB,GAAG,sBAAsB,CAAC;AACnF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAa5B;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,CAE9D;AAoBD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CA4B/E;AAID;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAO/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,aAAa,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM,CAW9D;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,EACzB,QAAQ,CAAC,EAAE,SAAS,GAAG,IAAI,GAC1B,MAAM,GAAG,UAAU,GAAG,SAAS,CASjC"}
@@ -0,0 +1,102 @@
1
+ import { basename } from 'node:path';
2
+ // ── Profile constants ─────────────────────────────────────────────────────────
3
+ const PROFILE_GATES = {
4
+ 'repo-delivery': ['tests', 'typecheck', 'lint', 'docs-drift', 'state-hygiene'],
5
+ 'operator-runtime': ['doctor', 'tests', 'state-hygiene'],
6
+ 'operator-replacement': ['doctor', 'tests'],
7
+ 'benchmark-harness': ['doctor', 'tests', 'contract-parity', 'state-hygiene'],
8
+ };
9
+ // ── Profile resolution ────────────────────────────────────────────────────────
10
+ /**
11
+ * Returns the gate id array for the given profile name.
12
+ */
13
+ export function resolveGateProfile(name) {
14
+ return [...PROFILE_GATES[name]];
15
+ }
16
+ // ── Inference heuristic ───────────────────────────────────────────────────────
17
+ /** Keywords that suggest operator-replacement work. */
18
+ const REPLACEMENT_KEYWORDS = [
19
+ 'replac',
20
+ 'self-host',
21
+ 'operator-replacement',
22
+ ];
23
+ /** Keywords that suggest operator-runtime work. */
24
+ const RUNTIME_KEYWORDS = [
25
+ 'operator-runtime',
26
+ 'runtime',
27
+ 'doctor',
28
+ 'health',
29
+ 'diagnos',
30
+ ];
31
+ /**
32
+ * Infers a gate profile from goal text and repo root path using keyword
33
+ * heuristics. Returns null if no profile can be confidently inferred.
34
+ * Callers apply the repo-identity default from Q1 when null is returned.
35
+ */
36
+ export function inferGateProfile(goal, root) {
37
+ const lower = goal.toLowerCase();
38
+ const lowerRoot = root.toLowerCase();
39
+ if (lowerRoot.includes('/harness-benchmarks/') || basename(root).startsWith('tmp-benchmark-')) {
40
+ return 'benchmark-harness';
41
+ }
42
+ // operator-replacement takes priority: explicit replacement signals
43
+ for (const kw of REPLACEMENT_KEYWORDS) {
44
+ if (lower.includes(kw)) {
45
+ return 'operator-replacement';
46
+ }
47
+ }
48
+ // operator-runtime: runtime/health signals
49
+ for (const kw of RUNTIME_KEYWORDS) {
50
+ if (lower.includes(kw)) {
51
+ return 'operator-runtime';
52
+ }
53
+ }
54
+ // Check root basename: non-enact-operator repos default toward repo-delivery
55
+ if (basename(root) !== 'enact-operator') {
56
+ return 'repo-delivery';
57
+ }
58
+ return null;
59
+ }
60
+ // ── Default scope for repo ────────────────────────────────────────────────────
61
+ /**
62
+ * Returns the default GoalScope based on repo identity.
63
+ * Non-operator repos → 'repo-local'.
64
+ * Operator repo → caller must refuse or require explicit selection.
65
+ */
66
+ export function defaultGoalScopeForRoot(root) {
67
+ if (basename(root) === 'enact-operator') {
68
+ // Caller is responsible for surfacing the structured error; we return the
69
+ // safest non-operator default here so the function is always callable.
70
+ return 'repo-local';
71
+ }
72
+ return 'repo-local';
73
+ }
74
+ /**
75
+ * Returns true when the given root path is the enact-operator repo itself.
76
+ */
77
+ export function isOperatorRepo(root) {
78
+ return basename(root) === 'enact-operator';
79
+ }
80
+ export function goalScopeRank(scope) {
81
+ switch (scope) {
82
+ case 'repo-local':
83
+ return 1;
84
+ case 'operator-runtime':
85
+ return 2;
86
+ case 'operator-replacement':
87
+ return 3;
88
+ default:
89
+ return 0;
90
+ }
91
+ }
92
+ export function compareGoalScopes(active, incoming) {
93
+ if (active === null || active === undefined || incoming === null || incoming === undefined) {
94
+ return 'same';
95
+ }
96
+ const activeRank = goalScopeRank(active);
97
+ const incomingRank = goalScopeRank(incoming);
98
+ if (activeRank === incomingRank)
99
+ return 'same';
100
+ return incomingRank < activeRank ? 'narrower' : 'broader';
101
+ }
102
+ //# sourceMappingURL=gateProfiles.js.map
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AO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,YAAY,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,UAAU,KAAK,YAAY;QAAE,OAAO,MAAM,CAAC;IAC/C,OAAO,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { type GoalScope } from '../../../operator/operatorCore.js';
2
+ export type ModeType = 'ralph' | 'ultrawork' | 'autopilot' | 'ultragoal' | 'team';
3
+ export type RetargetMode = 'replace-intent' | 'narrow-scope' | 'resume-unchanged' | 'fork-child-task';
4
+ export type ActivationDecision = 'start' | 'reuse' | 'retarget' | 'fork-child' | 'reject';
5
+ export type PreservedState = 'preserved' | 'narrowed' | 'replaced' | 'forked';
6
+ export interface ActiveModeContext {
7
+ mode: ModeType;
8
+ goal: string;
9
+ goalScope?: GoalScope | null;
10
+ id?: string;
11
+ }
12
+ export interface IncomingModeContext {
13
+ mode: ModeType;
14
+ goal: string;
15
+ goalScope?: GoalScope | null;
16
+ /** When set, the incoming activation is explicitly declared as a child of this
17
+ * active session id. Presence of this field (pointing to the active session)
18
+ * is the only signal that triggers a `fork-child` decision. */
19
+ parentGoalId?: string;
20
+ }
21
+ export interface CompatibilityRule {
22
+ decision: ActivationDecision;
23
+ reason: string;
24
+ retargetMode?: RetargetMode;
25
+ preservedState?: PreservedState;
26
+ }
27
+ export declare function getModeCompatibility(active: ActiveModeContext | null, incoming: IncomingModeContext): CompatibilityRule;
28
+ //# sourceMappingURL=modeMatrix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modeMatrix.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/activation/modeMatrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE/E,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC;AAClF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,cAAc,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AACtG,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,YAAY,GAAG,QAAQ,CAAC;AAC1F,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE9E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC7B;;oEAEgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AA4BD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAChC,QAAQ,EAAE,mBAAmB,GAC5B,iBAAiB,CA0EnB"}
@@ -0,0 +1,91 @@
1
+ import { compareGoalScopes } from '../../../operator/operatorCore.js';
2
+ function normalizeGoal(goal) {
3
+ return goal.trim().replace(/\s+/g, ' ').toLowerCase();
4
+ }
5
+ /**
6
+ * Returns true when the incoming activation is a provably narrower child of the
7
+ * active session, determined by structured signals only:
8
+ *
9
+ * The sole signal is `incoming.parentGoalId` matching `active.id` — the caller
10
+ * has explicitly declared the parent/child relationship. This is the only way
11
+ * to trigger a `fork-child` decision.
12
+ *
13
+ * Scope narrowing (incoming goalScope ranks lower than active) is already handled
14
+ * by the `compareGoalScopes === 'narrower'` branch as a `retarget/narrow-scope`
15
+ * decision and must not also trigger `fork-child`.
16
+ *
17
+ * No free-form text analysis is performed. False-positive fork-child decisions
18
+ * caused by token-set overlap in goal strings are eliminated by design.
19
+ */
20
+ function isStructuredNarrowerGoal(active, incoming) {
21
+ return incoming.parentGoalId !== undefined && incoming.parentGoalId === active.id;
22
+ }
23
+ export function getModeCompatibility(active, incoming) {
24
+ if (!active) {
25
+ return {
26
+ decision: 'start',
27
+ reason: `No active mode conflicts with starting ${incoming.mode}.`,
28
+ preservedState: 'preserved',
29
+ };
30
+ }
31
+ const activeGoal = normalizeGoal(active.goal);
32
+ const incomingGoal = normalizeGoal(incoming.goal);
33
+ const scopeComparison = compareGoalScopes(active.goalScope, incoming.goalScope);
34
+ if (active.mode !== incoming.mode) {
35
+ if (active.mode === 'ultrawork' && incoming.mode === 'ralph') {
36
+ return {
37
+ decision: 'start',
38
+ reason: 'Ralph may wrap verification/completion for an active Ultrawork session when explicitly invoked.',
39
+ preservedState: 'preserved',
40
+ };
41
+ }
42
+ if (active.mode === 'ralph' && incoming.mode === 'ultrawork') {
43
+ return {
44
+ decision: 'start',
45
+ reason: 'Ultrawork may begin while Ralph remains active, provided the operator explicitly requested a new execution burst.',
46
+ preservedState: 'preserved',
47
+ };
48
+ }
49
+ return {
50
+ decision: 'reject',
51
+ reason: `Mode switch from ${active.mode} to ${incoming.mode} is blocked for continuity safety. Stop the active session before starting ${incoming.mode}.`,
52
+ };
53
+ }
54
+ if (activeGoal === incomingGoal) {
55
+ return {
56
+ decision: 'reuse',
57
+ reason: `Active ${incoming.mode} already matches goal "${incoming.goal}".`,
58
+ retargetMode: 'resume-unchanged',
59
+ preservedState: 'preserved',
60
+ };
61
+ }
62
+ if (scopeComparison === 'broader') {
63
+ return {
64
+ decision: 'reject',
65
+ reason: 'Retarget would expand scope beyond the active session boundary. Start a new session instead.',
66
+ };
67
+ }
68
+ if (incoming.mode === 'ultrawork' && isStructuredNarrowerGoal(active, incoming)) {
69
+ return {
70
+ decision: 'fork-child',
71
+ reason: `Incoming goal "${incoming.goal}" is an explicitly narrower child of active ultrawork "${active.goal}". Fork a child task instead of replacing the parent goal.`,
72
+ retargetMode: 'fork-child-task',
73
+ preservedState: 'forked',
74
+ };
75
+ }
76
+ if (scopeComparison === 'narrower') {
77
+ return {
78
+ decision: 'retarget',
79
+ reason: `Incoming goal narrows scope from ${active.goalScope ?? 'unspecified'} to ${incoming.goalScope ?? 'unspecified'}.`,
80
+ retargetMode: 'narrow-scope',
81
+ preservedState: 'narrowed',
82
+ };
83
+ }
84
+ return {
85
+ decision: 'retarget',
86
+ reason: `Incoming goal differs from the active ${incoming.mode} intent and requires an explicit retarget.`,
87
+ retargetMode: 'replace-intent',
88
+ preservedState: 'replaced',
89
+ };
90
+ }
91
+ //# sourceMappingURL=modeMatrix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modeMatrix.js","sourceRoot":"","sources":["../../../../src/shared/workflow/activation/modeMatrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAkB,MAAM,4BAA4B,CAAC;AA+B/E,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AACxD,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAS,wBAAwB,CAC/B,MAAyB,EACzB,QAA6B;IAE7B,OAAO,QAAQ,CAAC,YAAY,KAAK,SAAS,IAAI,QAAQ,CAAC,YAAY,KAAK,MAAM,CAAC,EAAE,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,MAAgC,EAChC,QAA6B;IAE7B,IAAI,CAAC,MAAM,EAAE,CAAC;QAC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ACJ,CAAC;IAED,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,OAAO;YACL,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,8FAA8F;SACvG,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,IAAI,wBAAwB,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC;QAChF,OAAO;YACL,QAAQ,EAAE,YAAY;YACtB,MAAM,EAAE,kBAAkB,QAAQ,CAAC,IAAI,0DAA0D,MAAM,CAAC,IAAI,4DAA4D;YACxK,YAAY,EAAE,iBAAiB;YAC/B,cAAc,EAAE,QAAQ;SACzB,CAAC;IACJ,CAAC;IAED,IAAI,eAAe,KAAK,UAAU,EAAE,CAAC;QACnC,OAAO;YACL,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,oCAAoC,MAAM,CAAC,SAAS,IAAI,aAAa,OAAO,QAAQ,CAAC,SAAS,IAAI,aAAa,GAAG;YAC1H,YAAY,EAAE,cAAc;YAC5B,cAAc,EAAE,UAAU;SAC3B,CAAC;IACJ,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,yCAAyC,QAAQ,CAAC,IAAI,4CAA4C;QAC1G,YAAY,EAAE,gBAAgB;QAC9B,cAAc,EAAE,UAAU;KAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { type GoalScope, type GateProfile } from '../../../operator/operatorRuntimeCore.js';
2
+ import { type AutopilotActivationMetadata } from '../../../lanes/autopilot/index.js';
3
+ import { type RalphActivationMetadata } from '../../../lanes/ralph/index.js';
4
+ import { type UltraworkActivationMetadata } from '../../../lanes/ultrawork/index.js';
5
+ import { type ActivationDecision, type RetargetMode } from '../../../shared/workflow/activation/modeMatrix.js';
6
+ export type ActivationClass = 'runtime' | 'operator';
7
+ export declare const KNOWN_SKILL_MARKERS: readonly ["ai-slop-cleaner", "analyze", "ask", "autopilot", "autoresearch-goal", "cancel", "configure-notifications", "deep-interview", "doctor", "hud", "plan", "ralph", "ralplan", "research", "review", "setup", "skill", "tdd", "team", "trace", "ultragoal", "ultraqa", "ultrawork", "wiki"];
8
+ export type ActivationMetadata = RalphActivationMetadata | UltraworkActivationMetadata | AutopilotActivationMetadata;
9
+ export interface OperatorDescriptor {
10
+ skill: string;
11
+ class: ActivationClass;
12
+ startFn?: (root: string, goal: string, metadata?: ActivationMetadata) => {
13
+ id: string;
14
+ };
15
+ isActiveFn?: (root: string) => boolean;
16
+ }
17
+ export declare const OPERATOR_ACTIVATIONS: Record<string, OperatorDescriptor>;
18
+ export interface OperatorActivationIntent {
19
+ skill: string;
20
+ goal?: string;
21
+ goalScope?: GoalScope;
22
+ gateProfile?: GateProfile;
23
+ rawMarker: string;
24
+ source: 'hook' | 'cli' | 'mcp';
25
+ detectedAt: string;
26
+ }
27
+ export interface OperatorActivationResult {
28
+ intent: OperatorActivationIntent;
29
+ activated: boolean;
30
+ decision?: ActivationDecision;
31
+ reason?: string;
32
+ requiredAction?: {
33
+ tool: string;
34
+ params: Record<string, unknown>;
35
+ } | null;
36
+ retargetMode?: RetargetMode;
37
+ alreadyActive?: boolean;
38
+ needsGoal?: boolean;
39
+ startedStateId?: string;
40
+ error?: string;
41
+ }
42
+ export interface OperatorActivationLog {
43
+ entries: OperatorActivationResult[];
44
+ }
45
+ export interface ActiveOperatorState {
46
+ mode: string;
47
+ activatedAt: string;
48
+ source: OperatorActivationIntent['source'];
49
+ rawMarker: string;
50
+ goal: string | null;
51
+ startedStateId: string | null;
52
+ }
53
+ /**
54
+ * Normalize raw post-marker text into a clean operator intent string.
55
+ *
56
+ * Strips artifacts that come from skill prompt injection rather than the
57
+ * operator's own words:
58
+ * - Skill-file path references: `(/path/to/SKILL.md)`
59
+ * - Bracketed marker remnants: `[$enact-operator:ralph]`, `[$ralph]`, `[$]`
60
+ * - Leading `$` bare markers (e.g. `$ralph `)
61
+ * - Skill-prompt wrapper prefixes like "loop until ..." that the skill
62
+ * SKILL.md injects before handing control to the operator goal
63
+ *
64
+ * Conservative: does not strip legitimate operator text that happens to
65
+ * contain parentheses, brackets, or common words.
66
+ */
67
+ export declare function normalizeOperatorGoal(rawGoal: string): string;
68
+ export declare function listKnownSkills(_pluginsRoot: string): string[];
69
+ export declare function parseSkillActivation(prompt: string, source?: OperatorActivationIntent['source'], knownSkills?: string[]): OperatorActivationIntent | null;
70
+ export declare function executeActivation(root: string, intent: OperatorActivationIntent): OperatorActivationResult;
71
+ export declare function recordActivation(root: string, result: OperatorActivationResult): OperatorActivationLog;
72
+ export declare function readActivationLog(root: string): OperatorActivationLog;
73
+ export declare function readActiveOperator(root: string): ActiveOperatorState | null;
74
+ //# sourceMappingURL=skillActivation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillActivation.d.ts","sourceRoot":"","sources":["../../../../src/shared/workflow/activation/skillActivation.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAgC,KAAK,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC5G,OAAO,EAAwB,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAE5F,OAAO,EAAgC,KAAK,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC5G,OAAO,EAEL,KAAK,kBAAkB,EAGvB,KAAK,YAAY,EAClB,MAAM,4CAA4C,CAAC;AACpD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,CAAC;AAErD,eAAO,MAAM,mBAAmB,mSAyBtB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG,2BAA2B,GAAG,2BAA2B,CAAC;AAErH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,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