@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,121 @@
1
+ #!/usr/bin/env node
2
+ import { appendFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
+ import { dirname, join } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { randomUUID } from "node:crypto";
6
+ import { rootDirFrom } from "../shared/root-dir.mjs";
7
+ import { layoutPath } from "../shared/layout-dir.mjs";
8
+ import { emitHookFired } from "../shared/observability.mjs";
9
+ import { readHooksVerbose, verboseLog } from "../shared/_lib.mjs";
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+ const repoRoot = join(__dirname, "..", "..", "..");
13
+ const { readOperatorAuthority } = await import("@amsterdamdatalabs/enact-operator/authority");
14
+ const { buildContinuationGuidance, hasPendingLocalTasks } = await import("@amsterdamdatalabs/enact-operator/continuation");
15
+
16
+ function readStdin() {
17
+ try {
18
+ return JSON.parse(readFileSync(0, "utf8") || "{}");
19
+ } catch {
20
+ return {};
21
+ }
22
+ }
23
+
24
+ function readJson(path, fallback) {
25
+ try {
26
+ return JSON.parse(readFileSync(path, "utf8"));
27
+ } catch {
28
+ return fallback;
29
+ }
30
+ }
31
+
32
+ function appendLedger(root, entry) {
33
+ const dir = layoutPath(root, "logs");
34
+ mkdirSync(dir, { recursive: true });
35
+ const line = JSON.stringify({
36
+ schemaVersion: 1,
37
+ id: `ledger_${randomUUID().replace(/-/g, "").slice(0, 13)}`,
38
+ ...entry,
39
+ createdAt: new Date().toISOString(),
40
+ });
41
+ appendFileSync(layoutPath(root, "logs", "ledger.json"), line + "\n");
42
+ }
43
+
44
+ const payload = readStdin();
45
+ const root = rootDirFrom(payload?.cwd ?? process.cwd());
46
+ const startedAt = Date.now();
47
+
48
+ const ultraworkState = readJson(layoutPath(root, "state", "ultrawork.json"), null);
49
+ const ralphState = readJson(layoutPath(root, "state", "ralph.json"), null);
50
+
51
+ const ultraworkActive = !!(ultraworkState && ultraworkState.active);
52
+ const ultraworkPhase = ultraworkState?.phase ?? null;
53
+ const ralphActive = !!(ralphState && ralphState.active);
54
+ const ralphPhase = ralphState?.phase ?? null;
55
+
56
+ const timestamp = new Date().toISOString();
57
+
58
+ // Log to hooks.log
59
+ try {
60
+ mkdirSync(layoutPath(root, "logs"), { recursive: true });
61
+ appendFileSync(
62
+ layoutPath(root, "logs", "hooks.log"),
63
+ `${timestamp} PreCompact ultraworkActive=${ultraworkActive} ralphActive=${ralphActive}\n`,
64
+ "utf8",
65
+ );
66
+ } catch {
67
+ // best-effort
68
+ }
69
+
70
+ // Append to ledger
71
+ try {
72
+ appendLedger(root, {
73
+ kind: "session",
74
+ action: "pre_compact",
75
+ detail: "Context compaction triggered",
76
+ actor: "enact-operator-hook",
77
+ metadata: { ultraworkPhase, ultraworkActive, ralphPhase, ralphActive },
78
+ });
79
+ } catch {
80
+ // best-effort
81
+ }
82
+
83
+ // Persist pending local task context for compaction recovery
84
+ try {
85
+ const authority = readOperatorAuthority(root);
86
+ const guidance = buildContinuationGuidance(authority);
87
+ if (hasPendingLocalTasks(guidance)) {
88
+ const compactionContext = {
89
+ capturedAt: timestamp,
90
+ pendingLocalTaskIds: guidance.pendingLocalTaskIds,
91
+ pendingLocalTaskTitles: guidance.pendingLocalTaskTitles,
92
+ resumeHint: guidance.resumeHint,
93
+ lane: guidance.lane,
94
+ laneId: guidance.laneId,
95
+ };
96
+ writeFileSync(
97
+ layoutPath(root, "state", "compaction-context.json"),
98
+ JSON.stringify(compactionContext, null, 2),
99
+ "utf8",
100
+ );
101
+ }
102
+ } catch {
103
+ // best-effort
104
+ }
105
+
106
+ await emitHookFired({
107
+ payload,
108
+ hookEvent: "PreCompact",
109
+ outcome: "noop",
110
+ latencyMs: Date.now() - startedAt,
111
+ });
112
+ if (readHooksVerbose(root)) {
113
+ const detail = ultraworkActive
114
+ ? `ultrawork active (phase: ${ultraworkPhase})`
115
+ : ralphActive
116
+ ? `ralph active (phase: ${ralphPhase})`
117
+ : "no autonomous lane active";
118
+ verboseLog("pre-compact", `context compaction triggered — ${detail}`);
119
+ }
120
+
121
+ process.stdout.write(JSON.stringify({ continue: true }));
@@ -0,0 +1,356 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Phase 7 — Session-start: consume prior stop verdict.
4
+ * At session start, reads the last stop-verdict artifact.
5
+ * If the verdict is deny and NOT yet acknowledged, surfaces a system-reminder-style
6
+ * context block describing the prior unsafe stop attempt with a concrete checklist.
7
+ * Calls markStopVerdictAcknowledged after surfacing.
8
+ * Allow / already-acknowledged verdicts pass silently.
9
+ */
10
+ import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
11
+ import { dirname, join } from "node:path";
12
+ import { fileURLToPath } from "node:url";
13
+ import { readMergedOperatorConfig } from "../shared/config.mjs";
14
+ import { rootDirFrom } from "../shared/root-dir.mjs";
15
+ import { layoutDir, layoutPath } from "../shared/layout-dir.mjs";
16
+ import { emitHookFired, registerHookFailureTrap } from "../shared/observability.mjs";
17
+ import { readHooksVerbose, verboseLog } from "../shared/_lib.mjs";
18
+ // _continuation.mjs: self-contained runtime continuation orchestrator (no dist/ dependency).
19
+ // Twin: src/continuationOrchestrator.ts (typed twin — keep in sync).
20
+ import { buildContinuationContext } from "../shared/_continuation.mjs";
21
+ const __filename = fileURLToPath(import.meta.url);
22
+ const __dirname = dirname(__filename);
23
+ const repoRoot = join(__dirname, "..", "..", "..");
24
+ const { touchContinuationActivity, formatMandatoryLocalContinuationContext } = await import("@amsterdamdatalabs/enact-operator/continuation");
25
+ const { captureActiveWorkflows, formatContinuationContext } = await import("@amsterdamdatalabs/enact-operator/hookContinuation");
26
+
27
+ function readJson(path, fallback) {
28
+ try {
29
+ return JSON.parse(readFileSync(path, "utf8"));
30
+ } catch {
31
+ return fallback;
32
+ }
33
+ }
34
+
35
+ function writeJson(path, value) {
36
+ mkdirSync(dirname(path), { recursive: true });
37
+ writeFileSync(path, JSON.stringify(value, null, 2), "utf8");
38
+ }
39
+
40
+ function readStdin() {
41
+ try {
42
+ return JSON.parse(readFileSync(0, "utf8") || "{}");
43
+ } catch {
44
+ return {};
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Format the unsafe-stop context block surfaced to the operator.
50
+ * Returns a system-reminder-style string describing the prior stop attempt.
51
+ */
52
+ function formatUnsafeStopContext(verdict) {
53
+ const lines = [
54
+ "PRIOR UNSAFE STOP DETECTED",
55
+ `The previous session attempted to stop while work was still open (${verdict.capturedAt}).`,
56
+ `Stop policy verdict: DENY (${verdict.reasons.length} blocker(s) remained unresolved).`,
57
+ "",
58
+ "Unresolved blockers:",
59
+ ];
60
+
61
+ for (const reason of verdict.reasons) {
62
+ const laneTag = reason.laneId ? `[${reason.lane}:${reason.laneId}]` : `[${reason.lane}]`;
63
+ lines.push(` - ${laneTag} ${reason.blocker}`);
64
+ }
65
+
66
+ lines.push(
67
+ "",
68
+ "Resolve checklist before stopping again:",
69
+ " [ ] Review each blocker above and address it explicitly.",
70
+ " [ ] If Ralph is active: advance to 'completed' or 'aborted' and pass all verification gates.",
71
+ " [ ] If Ultrawork is active: advance to 'completed' or 'aborted' and close all linked tasks.",
72
+ " [ ] If Team is active: ensure all claimed tasks are completed and all reviews have verdicts.",
73
+ " [ ] Run operator_stop_evaluate (dry-run) to confirm stop policy is now allow before stopping.",
74
+ " [ ] Or use operator_stop_acknowledge with an explicit reason to override (operator escape hatch).",
75
+ "",
76
+ "This notice will not repeat -- it has been acknowledged for this session.",
77
+ );
78
+
79
+ return lines.join("\n");
80
+ }
81
+
82
+ function readContinuationState(path) {
83
+ return readJson(path, {
84
+ status: "idle",
85
+ resumeHint: null,
86
+ });
87
+ }
88
+
89
+ function buildDelegatedSessionScopes(continuationState, activeWorkflows) {
90
+ const scopes = [];
91
+ const pushScope = (lane, laneId = null) => {
92
+ if (!lane || lane === "none") return;
93
+ const key = `${lane}:${laneId ?? ""}`;
94
+ if (scopes.some((scope) => `${scope.lane}:${scope.laneId ?? ""}` === key)) return;
95
+ scopes.push({ lane, laneId });
96
+ };
97
+
98
+ pushScope(continuationState.lane, continuationState.laneId ?? null);
99
+ if (activeWorkflows.ralph?.active) pushScope("ralph", activeWorkflows.ralph.id);
100
+ if (activeWorkflows.ultrawork?.active) pushScope("ultrawork", activeWorkflows.ultrawork.id);
101
+ if (activeWorkflows.autopilot?.active) pushScope("autopilot", activeWorkflows.autopilot.id);
102
+ if (activeWorkflows.team?.active) pushScope("team", activeWorkflows.team.id);
103
+
104
+ return scopes;
105
+ }
106
+
107
+ function delegatedSessionMatchesScope(session, scope) {
108
+ if (session.parentLane !== scope.lane) return false;
109
+ if (!scope.laneId) return true;
110
+ if (!session.parentLaneId) return true;
111
+ return session.parentLaneId === scope.laneId;
112
+ }
113
+
114
+ function buildDelegatedSessionNote(continuationCtx, continuationState, activeWorkflows) {
115
+ if (!continuationCtx.hasDelegatedSessions) return null;
116
+ const scopes = buildDelegatedSessionScopes(continuationState, activeWorkflows);
117
+ if (scopes.length === 0) return null;
118
+
119
+ const focusSessions = [];
120
+ for (const session of continuationCtx.delegatedSessions) {
121
+ if (!scopes.some((scope) => delegatedSessionMatchesScope(session, scope))) continue;
122
+ if (focusSessions.some((existing) => existing.continuationId === session.continuationId)) continue;
123
+ focusSessions.push(session);
124
+ }
125
+
126
+ const focusIds = new Set(focusSessions.map((session) => session.continuationId));
127
+ const outsideStaleCount = continuationCtx.delegatedSessions.filter(
128
+ (session) => session.status === "stale" && !focusIds.has(session.continuationId),
129
+ ).length;
130
+
131
+ if (focusSessions.length === 0 && outsideStaleCount === 0) return null;
132
+
133
+ const sentences = [];
134
+ if (focusSessions.length > 0) {
135
+ sentences.push(
136
+ `Delegated sessions for current lane: ${focusSessions.map((session) => `${session.continuationId} (${session.kind}, ${session.status})`).join(", ")}.`,
137
+ );
138
+ }
139
+ if (outsideStaleCount > 0) {
140
+ const noun = outsideStaleCount === 1 ? "session exists" : "sessions exist";
141
+ sentences.push(`${outsideStaleCount} stale delegated ${noun} outside the current lane.`);
142
+ }
143
+ sentences.push("Check delegated session status before stopping.");
144
+ return sentences.join(" ");
145
+ }
146
+
147
+ /**
148
+ * Build a workspace domain identity block for session-start context injection.
149
+ *
150
+ * Gate: only fires when [hooks].prime_workspace_domain = true in the workspace
151
+ * config.toml (opt-in, default false per R2 risk mitigation).
152
+ *
153
+ * Reads domain metadata from the [workspace] section and injects a compact
154
+ * identity block so the agent knows its domain context at session start without
155
+ * requiring explicit user instruction. Does NOT inject vault content — only
156
+ * metadata (INV-002: no cross-workspace content leakage).
157
+ *
158
+ * Returns a string block to push onto contextSections, or null to skip silently.
159
+ */
160
+ function buildWorkspaceDomainPrimingBlock(workspaceRoot) {
161
+ const config = readMergedOperatorConfig(workspaceRoot);
162
+ if (!config) return null;
163
+
164
+ // Gate: opt-in flag must be explicitly true
165
+ if (config?.hooks?.prime_workspace_domain !== true) return null;
166
+
167
+ const ws = config?.workspace;
168
+ if (!ws || !ws.name) {
169
+ // [workspace] section absent — nothing to inject (R2 mitigation: default to no injection)
170
+ return null;
171
+ }
172
+
173
+ const lines = [
174
+ "WORKSPACE DOMAIN CONTEXT",
175
+ `This agent session is operating inside the "${ws.name}" workspace.`,
176
+ ];
177
+
178
+ if (ws.domain) {
179
+ lines.push(`Domain: ${ws.domain}`);
180
+ }
181
+ if (ws.ontology) {
182
+ lines.push(`Ontology: ${ws.ontology}`);
183
+ }
184
+ if (ws.primary_language) {
185
+ lines.push(`Primary language: ${ws.primary_language}`);
186
+ }
187
+ if (Array.isArray(ws.constraint_categories) && ws.constraint_categories.length > 0) {
188
+ lines.push(`Key constraint categories: ${ws.constraint_categories.join(", ")}`);
189
+ }
190
+
191
+ lines.push(
192
+ "",
193
+ "Use domain-specific vocabulary, entities, and constraints from the workspace wiki vault",
194
+ "when answering questions. Prefer wiki vault content over generic LLM knowledge for",
195
+ "domain queries (products, formulations, regulations, SKUs, etc.).",
196
+ );
197
+
198
+ return lines.join("\n");
199
+ }
200
+
201
+ // ── Main ──────────────────────────────────────────────────────────────────────
202
+
203
+ const payload = readStdin();
204
+ const root = rootDirFrom(payload?.cwd ?? process.cwd());
205
+ const startedAt = Date.now();
206
+ const completeHook = registerHookFailureTrap({
207
+ payload,
208
+ hookEvent: "SessionStart",
209
+ startedAt,
210
+ });
211
+ const operatorLayout = layoutDir(root);
212
+ mkdirSync(layoutPath(root, "logs"), { recursive: true });
213
+ mkdirSync(layoutPath(root, "state"), { recursive: true });
214
+ const runtime = readJson(layoutPath(root, "state", "operator-hook-runtime.json"), {});
215
+
216
+ const activeWorkflows = captureActiveWorkflows(root);
217
+
218
+ appendFileSync(layoutPath(root, "logs", "hooks.log"), `${new Date().toISOString()} SessionStart ${JSON.stringify(payload)}\n`, "utf8");
219
+ writeJson(layoutPath(root, "state", "operator-hook-runtime.json"), {
220
+ ...runtime,
221
+ lastSessionStartAt: new Date().toISOString(),
222
+ cwd: root,
223
+ trigger: payload.session_type ?? "unknown",
224
+ activeWorkflows,
225
+ });
226
+ touchContinuationActivity(root, "session-start");
227
+
228
+ const workflowContext = formatContinuationContext(activeWorkflows);
229
+
230
+ // Build continuation context via _continuation.mjs (no dist/ dependency).
231
+ // Wires all five predecessor surfaces: compaction-context, delegated-session ledger,
232
+ // protected-state guard, member-turn injection, and manual-close filter.
233
+ const continuationCtx = buildContinuationContext(operatorLayout);
234
+ const continuationState = continuationCtx.continuationState;
235
+
236
+ // Build guidance using the lane read from continuation-state.json (Surface 4).
237
+ // pendingLocalTaskIds from continuationCtx feeds formatMandatoryLocalContinuationContext
238
+ // without requiring readOperatorAuthority (dist-free path).
239
+ const guidanceFromCtx = {
240
+ lane: continuationState.lane,
241
+ laneId: continuationState.laneId,
242
+ pendingLocalTaskIds: continuationState.pendingLocalTaskIds,
243
+ pendingLocalTaskTitles: continuationState.pendingLocalTaskTitles ?? [],
244
+ resumeHint: continuationState.resumeHint ?? "",
245
+ pendingTaskIds: continuationState.pendingTaskIds,
246
+ pendingReviewTaskIds: [],
247
+ pendingMessageIds: [],
248
+ };
249
+ const mandatoryContinuation = formatMandatoryLocalContinuationContext(guidanceFromCtx, "proceeding with new work");
250
+
251
+ // Compaction recovery: restore pending local task context (Surface 1).
252
+ // Uses compactionContext from _continuation.mjs (filtered for manual-close via Surface 5).
253
+ const compactionContext = continuationCtx.compactionContext;
254
+ const compactionRecovery = (
255
+ compactionContext &&
256
+ compactionContext.pendingLocalTaskIds.length > 0 &&
257
+ !mandatoryContinuation // don't double-surface if mandatory is already shown
258
+ )
259
+ ? `Compaction recovery: resume with pending local task(s) first — ` +
260
+ `${compactionContext.pendingLocalTaskIds.map((id, i) => `${id} "${compactionContext.pendingLocalTaskTitles?.[i] ?? ''}"`).join(', ')}. ` +
261
+ `${compactionContext.resumeHint ?? ''}`
262
+ : null;
263
+
264
+ // Delegated sessions (Surface 2): focus the current lane and summarize residue.
265
+ const delegatedSessionNote = buildDelegatedSessionNote(
266
+ continuationCtx,
267
+ continuationState,
268
+ activeWorkflows,
269
+ );
270
+
271
+ const {
272
+ findHeadQueuedFollowUp,
273
+ pickFollowUpForReplay,
274
+ reserveFollowUpReplay,
275
+ markFollowUpReplayed,
276
+ } = await import("@amsterdamdatalabs/enact-operator/continuationFollowUp");
277
+ const sid = typeof payload.session_id === "string" ? payload.session_id : null;
278
+ const stopDeny = findHeadQueuedFollowUp(root, "stop-deny");
279
+ let replayCandidate = stopDeny;
280
+ if (!replayCandidate && guidanceFromCtx.lane !== "none") {
281
+ replayCandidate = pickFollowUpForReplay(root, guidanceFromCtx.lane, sid);
282
+ }
283
+
284
+ // Check for unacknowledged deny verdict from prior session
285
+ const verdictPath = join(operatorLayout, "state", "stop-verdict.json");
286
+ const lastVerdict = readJson(verdictPath, null);
287
+ const contextSections = [];
288
+
289
+ if (replayCandidate) {
290
+ const r = reserveFollowUpReplay(root, { followUpId: replayCandidate.id, sessionId: sid });
291
+ if (r.reserved && r.reinjectionText) {
292
+ contextSections.push(r.reinjectionText);
293
+ markFollowUpReplayed(root, replayCandidate.id, sid);
294
+ }
295
+ }
296
+
297
+ if (lastVerdict && lastVerdict.outcome === "deny" && !lastVerdict.acknowledgedAt) {
298
+ // Surface the unsafe-stop context block
299
+ const unsafeStopContext = formatUnsafeStopContext(lastVerdict);
300
+ const resumeHint = continuationState.status === "blocked" && continuationState.resumeHint
301
+ ? `\n\nResume hint: ${continuationState.resumeHint}`
302
+ : "";
303
+ contextSections.push(`${unsafeStopContext}${resumeHint}`);
304
+
305
+ // Acknowledge: mark as consumed by this session-start so it won't repeat
306
+ const acknowledged = {
307
+ ...lastVerdict,
308
+ acknowledgedAt: new Date().toISOString(),
309
+ acknowledgedReason: "session-start auto-acknowledge after surfacing to operator",
310
+ };
311
+ writeJson(verdictPath, acknowledged);
312
+ }
313
+
314
+ if (compactionRecovery) {
315
+ contextSections.push(compactionRecovery);
316
+ }
317
+
318
+ if (delegatedSessionNote) {
319
+ contextSections.push(delegatedSessionNote);
320
+ }
321
+
322
+ if (mandatoryContinuation) {
323
+ contextSections.push(mandatoryContinuation);
324
+ }
325
+
326
+ const workspacePrimingBlock = buildWorkspaceDomainPrimingBlock(root);
327
+ if (workspacePrimingBlock) {
328
+ contextSections.push(workspacePrimingBlock);
329
+ } else if (readHooksVerbose(root)) {
330
+ // When verbose, emit a note that priming was skipped (not enabled or no [workspace] section)
331
+ verboseLog("session-start", "workspace domain priming skipped (prime_workspace_domain not set or no [workspace] section)");
332
+ }
333
+
334
+ contextSections.push(`Operator hook runtime initialized. ${workflowContext}`);
335
+ const additionalContext = contextSections.join("\n\n");
336
+
337
+ await emitHookFired({
338
+ payload,
339
+ hookEvent: "SessionStart",
340
+ outcome: "noop",
341
+ latencyMs: Date.now() - startedAt,
342
+ });
343
+ if (readHooksVerbose(root)) {
344
+ const wfSummary = activeWorkflows?.workflows?.length
345
+ ? `${activeWorkflows.workflows.length} active workflow(s)`
346
+ : "no workflows active";
347
+ verboseLog("session-start", `initialized — ${wfSummary}, ${contextSections.length} context section(s) injected`);
348
+ }
349
+ completeHook();
350
+ process.stdout.write(JSON.stringify({
351
+ continue: true,
352
+ hookSpecificOutput: {
353
+ hookEventName: "SessionStart",
354
+ additionalContext,
355
+ },
356
+ }));