@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,163 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ /**
4
+ * Truncates large tool output — but ONLY for successful (exitCode === 0) runs.
5
+ * Error output (non-zero exitCode) is always preserved in full so diagnostics
6
+ * are never lost.
7
+ */
8
+ export function toolOutputTruncator(input) {
9
+ const { exitCode, output, maxLength = 8_000 } = input;
10
+ if (exitCode !== 0) {
11
+ return { output, truncated: false };
12
+ }
13
+ if (output.length <= maxLength) {
14
+ return { output, truncated: false };
15
+ }
16
+ const truncated = `${output.slice(0, maxLength)}\n[output truncated: ${output.length - maxLength} chars omitted]`;
17
+ return { output: truncated, truncated: true };
18
+ }
19
+ /**
20
+ * Attempts to parse a JSON string. On failure, surfaces the ORIGINAL parse
21
+ * error text — never silently returns a default.
22
+ */
23
+ export function jsonErrorRecovery(raw) {
24
+ const trimmed = String(raw ?? '').trim();
25
+ if (!trimmed || !looksLikeJson(trimmed)) {
26
+ return { attempted: false, recovered: false };
27
+ }
28
+ try {
29
+ const value = JSON.parse(trimmed);
30
+ return { attempted: true, recovered: true, value };
31
+ }
32
+ catch (err) {
33
+ const errorMessage = err instanceof Error ? err.message : String(err);
34
+ return { attempted: true, recovered: false, errorMessage };
35
+ }
36
+ }
37
+ /**
38
+ * Injects AGENTS.md content from the working directory when the file exists.
39
+ * No injection when AGENTS.md is absent.
40
+ */
41
+ export function directoryAgentsInjector(input) {
42
+ const filePath = join(input.workingDirectory, 'AGENTS.md');
43
+ if (!existsSync(filePath)) {
44
+ return { injected: false };
45
+ }
46
+ const content = readFileSync(filePath, 'utf8');
47
+ return { injected: true, content };
48
+ }
49
+ // ── directoryReadmeInjector ───────────────────────────────────────────────────
50
+ /**
51
+ * Injects README.md content from the working directory when the file exists.
52
+ * No injection when README.md is absent.
53
+ */
54
+ export function directoryReadmeInjector(input) {
55
+ const filePath = join(input.workingDirectory, 'README.md');
56
+ if (!existsSync(filePath)) {
57
+ return { injected: false };
58
+ }
59
+ const content = readFileSync(filePath, 'utf8');
60
+ return { injected: true, content };
61
+ }
62
+ // ── readImageResizer ──────────────────────────────────────────────────────────
63
+ // Threshold: only resize if the base64 payload exceeds this character count.
64
+ const IMAGE_RESIZE_THRESHOLD = 200;
65
+ // Image data URI prefix pattern
66
+ const IMAGE_DATA_URI_RE = /^data:image\/[a-z]+;base64,/i;
67
+ /**
68
+ * Detects image data URIs in tool output (Read tool on image files) and marks
69
+ * them for resizing. Does NOT alter non-image tool output.
70
+ *
71
+ * In a full implementation, actual pixel-level resizing would happen here via
72
+ * a canvas/sharp integration. This implementation detects the image and marks
73
+ * the result — non-image output is always passed through unchanged.
74
+ */
75
+ export function readImageResizer(input) {
76
+ const { output } = input;
77
+ if (!IMAGE_DATA_URI_RE.test(output)) {
78
+ return { output, resized: false };
79
+ }
80
+ // Strip the data URI prefix to measure the raw base64 payload length
81
+ const payloadStart = output.indexOf(',') + 1;
82
+ const payloadLength = output.length - payloadStart;
83
+ if (payloadLength <= IMAGE_RESIZE_THRESHOLD) {
84
+ return { output, resized: false };
85
+ }
86
+ // Replace the oversized data URI with a compact placeholder
87
+ const placeholder = `[image data omitted: ${output.length} chars]`;
88
+ return { output: placeholder, resized: true };
89
+ }
90
+ // ── looksLikeJson ─────────────────────────────────────────────────────────────
91
+ /**
92
+ * Cheap structural check: is this string plausibly a JSON document?
93
+ * Plain tool stdout (ls/find/git output) and empty payloads are NOT JSON and
94
+ * must never be flagged as "parse errors". Only output that is trimmed,
95
+ * non-empty, and starts with an object/array opener is worth attempting.
96
+ */
97
+ export function looksLikeJson(raw) {
98
+ if (typeof raw !== 'string')
99
+ return false;
100
+ const trimmed = raw.trim();
101
+ if (trimmed.length === 0)
102
+ return false;
103
+ const first = trimmed[0];
104
+ return first === '{' || first === '[';
105
+ }
106
+ /**
107
+ * Build the tool-guard HookHandlerEntry list for a PostToolUse event context.
108
+ * Per-tool-call guards only: output truncation, JSON-shaped parse-error
109
+ * surfacing, and image resizing. Directory-content injection (AGENTS.md /
110
+ * README.md) is deliberately excluded — that is a SessionStart concern.
111
+ */
112
+ export function buildToolGuardHandlers(ctx) {
113
+ return [
114
+ {
115
+ id: 'toolOutputTruncator',
116
+ run: async () => {
117
+ const result = toolOutputTruncator({ exitCode: ctx.exitCode, output: ctx.output });
118
+ return {
119
+ hookSpecificOutput: { additionalContext: result.truncated ? `[output truncated]` : '' },
120
+ exitCode: 0,
121
+ stderr: '',
122
+ };
123
+ },
124
+ },
125
+ {
126
+ id: 'jsonErrorRecovery',
127
+ run: async () => {
128
+ // Only attempt recovery on output that is actually JSON-shaped. Plain
129
+ // text / empty tool stdout must never be reported as a parse error.
130
+ if (!looksLikeJson(ctx.output)) {
131
+ return { hookSpecificOutput: { additionalContext: '' }, exitCode: 0, stderr: '' };
132
+ }
133
+ const result = jsonErrorRecovery(ctx.output);
134
+ return {
135
+ hookSpecificOutput: {
136
+ additionalContext: result.attempted && !result.recovered && result.errorMessage
137
+ ? `[json parse error: ${result.errorMessage}]`
138
+ : '',
139
+ },
140
+ exitCode: 0,
141
+ stderr: '',
142
+ };
143
+ },
144
+ },
145
+ // NOTE: directoryAgentsInjector / directoryReadmeInjector are intentionally
146
+ // NOT in the PostToolUse chain. AGENTS.md / README.md are loaded once at
147
+ // SessionStart; re-injecting the full file after every tool call floods the
148
+ // context window. The standalone functions remain exported for SessionStart
149
+ // / on-demand consumers.
150
+ {
151
+ id: 'readImageResizer',
152
+ run: async () => {
153
+ const result = readImageResizer({ toolName: ctx.toolName, output: ctx.output });
154
+ return {
155
+ hookSpecificOutput: { additionalContext: result.resized ? `[image resized for context]` : '' },
156
+ exitCode: 0,
157
+ stderr: '',
158
+ };
159
+ },
160
+ },
161
+ ];
162
+ }
163
+ //# sourceMappingURL=toolGuardHooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolGuardHooks.js","sourceRoot":"","sources":["../../../src/operator/hooks/toolGuardHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA8BjC;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAqB;IACvD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IACtD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACtC,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;QAC/B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACtC,CAAC;IACD,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,wBAAwB,MAAM,CAAC,MAAM,GAAG,SAAS,iBAAiB,CAAC;IAClH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAChD,CAAC;AAWD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACzC,IAAI,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAChD,CAAC;IACD,IAAI,CAAC;QACH,MAAM,KAAK,G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AM,MAAM,GAAG,gBAAgB,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;gBAChF,OAAO;oBACL,kBAAkB,EAAE,EAAE,iBAAiB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,EAAE,EAAE;oBAC9F,QAAQ,EAAE,CAAC;oBACX,MAAM,EAAE,EAAE;iBACX,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,115 @@
1
+ import { type OperatorReviewItem, type OperatorTask, type OperatorTaskStatus, type GateProfile, type GoalScope } from '../operator/operatorRuntimeCore.js';
2
+ import { type ContinuationState, type LogicalIdleStatus } from '../shared/workflow/continuation/continuation.js';
3
+ export type HudView = 'raw' | 'converged';
4
+ export interface HudStaleCounts {
5
+ staleReviews: number;
6
+ supersededReviews: number;
7
+ staleTasks: number;
8
+ outdatedEvidence: number;
9
+ }
10
+ export interface OperatorHudSnapshot {
11
+ root: string;
12
+ updatedAt: string;
13
+ /** Which view mode produced this snapshot. */
14
+ view: HudView;
15
+ /** Drift summary — present in both raw and converged modes. */
16
+ staleCounts: HudStaleCounts;
17
+ session: {
18
+ id: string | null;
19
+ branch: string | null;
20
+ cwd: string | null;
21
+ lastCommand: string | null;
22
+ };
23
+ tasks: {
24
+ total: number;
25
+ byStatus: Record<OperatorTaskStatus, number>;
26
+ reviewPending: number;
27
+ blocked: number;
28
+ completed: number;
29
+ worktreeBound: number;
30
+ };
31
+ reviews: {
32
+ total: number;
33
+ pending: number;
34
+ approved: number;
35
+ changesRequested: number;
36
+ };
37
+ inbox: {
38
+ open: number;
39
+ acknowledged: number;
40
+ resolved: number;
41
+ };
42
+ ledger: {
43
+ total: number;
44
+ recent: number;
45
+ };
46
+ team: {
47
+ active: boolean;
48
+ backend: 'tmux' | 'mock' | 'none';
49
+ executors: number;
50
+ busy: number;
51
+ idle: number;
52
+ stale: number;
53
+ offline: number;
54
+ tmuxAvailable: boolean;
55
+ };
56
+ subagents: {
57
+ active: number;
58
+ total: number;
59
+ byBackend: Record<string, number>;
60
+ ids: string[];
61
+ };
62
+ installRegistry: {
63
+ total: number;
64
+ byKind: Record<string, number>;
65
+ };
66
+ doctor: {
67
+ passed: number;
68
+ warnings: number;
69
+ failed: number;
70
+ };
71
+ alerts: string[];
72
+ activeRalph: {
73
+ active: boolean;
74
+ phase: string | null;
75
+ goal: string | null;
76
+ gateProfile: GateProfile | null;
77
+ goalScope: GoalScope | null;
78
+ };
79
+ activeAutopilot: {
80
+ active: boolean;
81
+ phase: string | null;
82
+ intent: string | null;
83
+ gateProfile: GateProfile | null;
84
+ goalScope: GoalScope | null;
85
+ };
86
+ activeUltrawork: {
87
+ active: boolean;
88
+ phase: string | null;
89
+ intent: string | null;
90
+ gateProfile: GateProfile | null;
91
+ goalScope: GoalScope | null;
92
+ };
93
+ activeJobs: {
94
+ scheduled: number;
95
+ paused: number;
96
+ monitors: number;
97
+ nextFireAt?: string;
98
+ };
99
+ continuation: ContinuationState;
100
+ logicalIdle: LogicalIdleStatus;
101
+ }
102
+ /**
103
+ * Pure function: compute staleness counts from raw reviews + tasks.
104
+ * Testable in isolation — no side effects.
105
+ */
106
+ export declare function computeStaleCounts(reviews: OperatorReviewItem[], tasks: OperatorTask[]): HudStaleCounts;
107
+ /**
108
+ * Pure function: apply the converged-view filter to a list of reviews.
109
+ * Superseded reviews are removed; stale reviews are kept (flagged by their staleState field).
110
+ * Testable in isolation.
111
+ */
112
+ export declare function applyConvergedReviewFilter(reviews: OperatorReviewItem[]): OperatorReviewItem[];
113
+ export declare function buildHudSnapshot(root: string, view?: HudView): OperatorHudSnapshot;
114
+ export declare function renderHud(snapshot: OperatorHudSnapshot): string;
115
+ //# sourceMappingURL=hud.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hud.d.ts","sourceRoot":"","sources":["../../src/operator/hud.ts"],"names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CAAC;QACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;QAChC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;KAC7B,CAAC;IACF,eAAe,EAAE;QACf,MAAM,EAAE,OAAO,CAAC;QAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;QAChC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;KAC7B,CAAC;IACF,UAAU,EAAE;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,YAAY,EAAE,iBAAiB,CAAC;IAChC,WAAW,EAAE,iBAAiB,CAAC;CAChC;AAgBD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,kBAAkB,EAAE,EAC7B,KAAK,EAAE,YAAY,EAAE,GACpB,cAAc,CAOhB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,EAAE,CAE9F;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,OAAqB,GAAG,mBAAmB,CAiK/F;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CA+B/D"}
@@ -0,0 +1,229 @@
1
+ import { listInstallRegistry, runDoctor, listInbox, listLedger, listReviews, readSession, listTasks, listJobs, } from '../operator/operatorRuntimeCore.js';
2
+ import { probeTmux, readTeam } from '../lanes/team/index.js';
3
+ import { getAutopilot } from '../lanes/autopilot/index.js';
4
+ import { getRalph } from '../lanes/ralph/index.js';
5
+ import { getUltrawork } from '../lanes/ultrawork/index.js';
6
+ import { logicalIdleStatus, readContinuationState } from '../shared/workflow/continuation/continuation.js';
7
+ import { readSubagentRuntimeState } from '../shared/workflow/delegation/subagentRuntime.js';
8
+ function emptyStatusCounts() {
9
+ return {
10
+ pending: 0,
11
+ queued: 0,
12
+ in_progress: 0,
13
+ blocked: 0,
14
+ review: 0,
15
+ superseded: 0,
16
+ completed: 0,
17
+ failed: 0,
18
+ cancelled: 0,
19
+ };
20
+ }
21
+ /**
22
+ * Pure function: compute staleness counts from raw reviews + tasks.
23
+ * Testable in isolation — no side effects.
24
+ */
25
+ export function computeStaleCounts(reviews, tasks) {
26
+ return {
27
+ staleReviews: reviews.filter((r) => r.staleState === 'stale').length,
28
+ supersededReviews: reviews.filter((r) => r.staleState === 'superseded').length,
29
+ staleTasks: tasks.filter((t) => t.reviewStale === true || t.blockerStale === true).length,
30
+ outdatedEvidence: tasks.filter((t) => t.evidenceOutdated === true).length,
31
+ };
32
+ }
33
+ /**
34
+ * Pure function: apply the converged-view filter to a list of reviews.
35
+ * Superseded reviews are removed; stale reviews are kept (flagged by their staleState field).
36
+ * Testable in isolation.
37
+ */
38
+ export function applyConvergedReviewFilter(reviews) {
39
+ return reviews.filter((r) => r.staleState !== 'superseded');
40
+ }
41
+ export function buildHudSnapshot(root, view = 'converged') {
42
+ const allTasks = listTasks(root);
43
+ const allReviews = listReviews(root);
44
+ const inbox = listInbox(root);
45
+ const ledger = listLedger(root, 20);
46
+ const registry = listInstallRegistry(root);
47
+ const session = readSession(root);
48
+ const team = readTeam(root);
49
+ const tmux = probeTmux();
50
+ const doctor = runDoctor(root);
51
+ const autopilot = getAutopilot(root);
52
+ const ralph = getRalph(root);
53
+ const ultrawork = getUltrawork(root);
54
+ const continuation = readContinuationState(root);
55
+ const idle = logicalIdleStatus(continuation);
56
+ const subagentState = readSubagentRuntimeState(root);
57
+ const allJobs = listJobs(root);
58
+ const scheduledJobs = allJobs.filter((j) => j.status === 'scheduled');
59
+ const pausedJobs = allJobs.filter((j) => j.status === 'paused');
60
+ const monitorJobs = allJobs.filter((j) => j.kind === 'monitor' && j.status === 'scheduled');
61
+ const nextJobFireAt = scheduledJobs
62
+ .filter((j) => j.scheduledFor !== undefined)
63
+ .map((j) => j.scheduledFor)
64
+ .sort()[0];
65
+ // Always compute staleCounts from the full unfiltered sets.
66
+ const staleCounts = computeStaleCounts(allReviews, allTasks);
67
+ // Apply view filter: converged removes superseded reviews; raw shows everything.
68
+ const reviews = view === 'converged' ? applyConvergedReviewFilter(allReviews) : allReviews;
69
+ // Tasks with staleState === 'superseded' on the task itself are filtered in converged view.
70
+ // Note: task staleness lives in reviewStale/blockerStale/evidenceOutdated (additive flags),
71
+ // not in a staleState field — so we only filter tasks by their status field.
72
+ const tasks = allTasks;
73
+ const byStatus = emptyStatusCounts();
74
+ for (const task of tasks) {
75
+ byStatus[task.status] += 1;
76
+ }
77
+ const alerts = [];
78
+ if (!session) {
79
+ alerts.push('No active Enact Operator session recorded');
80
+ }
81
+ if (byStatus.blocked > 0) {
82
+ alerts.push(`${byStatus.blocked} blocked task(s) need attention`);
83
+ }
84
+ if (doctor.summary.failed > 0) {
85
+ alerts.push(`${doctor.summary.failed} doctor check(s) failed`);
86
+ }
87
+ if (doctor.summary.warnings > 0) {
88
+ alerts.push(`${doctor.summary.warnings} doctor warning(s) remain`);
89
+ }
90
+ if (continuation.status === 'blocked') {
91
+ alerts.push(`Continuation blocked for ${continuation.lane}${continuation.laneId ? ` (${continuation.laneId})` : ''}`);
92
+ }
93
+ if (idle.isLogicalIdle) {
94
+ alerts.push(`Logical idle active (${idle.idleDurationMs ?? 0}ms since ${idle.lastActivitySource ?? 'unknown activity'})`);
95
+ }
96
+ return {
97
+ root,
98
+ updatedAt: new Date().toISOString(),
99
+ view,
100
+ staleCounts,
101
+ session: {
102
+ id: session?.id ?? null,
103
+ branch: session?.branch ?? null,
104
+ cwd: session?.cwd ?? null,
105
+ lastCommand: session?.lastCommand ?? null,
106
+ },
107
+ tasks: {
108
+ total: tasks.length,
109
+ byStatus,
110
+ reviewPending: tasks.filter((task) => task.reviewStatus === 'pending').length,
111
+ blocked: byStatus.blocked,
112
+ completed: byStatus.completed,
113
+ worktreeBound: tasks.filter((task) => Boolean(task.worktree?.worktreePath || task.worktree?.branchName)).length,
114
+ },
115
+ reviews: {
116
+ total: reviews.length,
117
+ pending: reviews.filter((review) => review.status === 'pending').length,
118
+ approved: reviews.filter((review) => review.status === 'approved').length,
119
+ changesRequested: reviews.filter((review) => review.status === 'changes_requested').length,
120
+ },
121
+ inbox: {
122
+ open: inbox.filter((item) => item.status === 'open').length,
123
+ acknowledged: inbox.filter((item) => item.status === 'acknowledged').length,
124
+ resolved: inbox.filter((item) => item.status === 'resolved').length,
125
+ },
126
+ ledger: {
127
+ total: listLedger(root, Number.MAX_SAFE_INTEGER).length,
128
+ recent: ledger.length,
129
+ },
130
+ team: {
131
+ active: team?.active ?? false,
132
+ backend: team?.backend.kind ?? 'none',
133
+ executors: team?.executors.length ?? 0,
134
+ busy: team?.executors.filter((executor) => executor.status === 'busy').length ?? 0,
135
+ idle: team?.executors.filter((executor) => executor.status === 'idle').length ?? 0,
136
+ stale: team?.executors.filter((executor) => executor.status === 'stale').length ?? 0,
137
+ offline: team?.executors.filter((executor) => executor.status === 'offline').length ?? 0,
138
+ tmuxAvailable: tmux.available,
139
+ },
140
+ subagents: (() => {
141
+ const active = subagentState.children.filter((c) => c.status === 'active');
142
+ const byBackend = {};
143
+ for (const c of active) {
144
+ const backend = 'multi_agent_v1';
145
+ byBackend[backend] = (byBackend[backend] ?? 0) + 1;
146
+ }
147
+ return {
148
+ active: active.length,
149
+ total: subagentState.children.length,
150
+ byBackend,
151
+ ids: active.map((c) => c.agentId),
152
+ };
153
+ })(),
154
+ installRegistry: {
155
+ total: registry.length,
156
+ byKind: registry.reduce((acc, entry) => {
157
+ acc[entry.kind] = (acc[entry.kind] ?? 0) + 1;
158
+ return acc;
159
+ }, {}),
160
+ },
161
+ doctor: {
162
+ passed: doctor.summary.passed,
163
+ warnings: doctor.summary.warnings,
164
+ failed: doctor.summary.failed,
165
+ },
166
+ alerts,
167
+ activeRalph: {
168
+ active: ralph?.active ?? false,
169
+ phase: ralph?.phase ?? null,
170
+ goal: ralph?.goal ?? null,
171
+ gateProfile: ralph?.gateProfile ?? null,
172
+ goalScope: ralph?.goalScope ?? null,
173
+ },
174
+ activeAutopilot: {
175
+ active: autopilot?.active ?? false,
176
+ phase: autopilot?.phase ?? null,
177
+ intent: autopilot?.intent ?? null,
178
+ gateProfile: autopilot?.gateProfile ?? null,
179
+ goalScope: autopilot?.goalScope ?? null,
180
+ },
181
+ activeUltrawork: {
182
+ active: ultrawork?.active ?? false,
183
+ phase: ultrawork?.phase ?? null,
184
+ intent: ultrawork?.intent ?? null,
185
+ gateProfile: ultrawork?.gateProfile ?? null,
186
+ goalScope: ultrawork?.goalScope ?? null,
187
+ },
188
+ activeJobs: {
189
+ scheduled: scheduledJobs.length,
190
+ paused: pausedJobs.length,
191
+ monitors: monitorJobs.length,
192
+ nextFireAt: nextJobFireAt,
193
+ },
194
+ continuation,
195
+ logicalIdle: idle,
196
+ };
197
+ }
198
+ export function renderHud(snapshot) {
199
+ const taskSummary = Object.entries(snapshot.tasks.byStatus)
200
+ .filter(([, count]) => count > 0)
201
+ .map(([status, count]) => `${status}=${count}`)
202
+ .join(', ') || 'none';
203
+ const installSummary = Object.entries(snapshot.installRegistry.byKind)
204
+ .map(([kind, count]) => `${kind}=${count}`)
205
+ .join(', ') || 'none';
206
+ const { staleCounts } = snapshot;
207
+ return [
208
+ `Operator HUD`,
209
+ `view: ${snapshot.view}`,
210
+ `root: ${snapshot.root}`,
211
+ `updated: ${snapshot.updatedAt}`,
212
+ `session: ${snapshot.session.id ?? 'none'} branch=${snapshot.session.branch ?? 'unknown'} last=${snapshot.session.lastCommand ?? 'none'}`,
213
+ `tasks: total=${snapshot.tasks.total} statuses=[${taskSummary}] reviewPending=${snapshot.tasks.reviewPending} worktreeBound=${snapshot.tasks.worktreeBound}`,
214
+ `reviews: total=${snapshot.reviews.total} pending=${snapshot.reviews.pending} approved=${snapshot.reviews.approved} changesRequested=${snapshot.reviews.changesRequested}`,
215
+ `staleCounts: staleReviews=${staleCounts.staleReviews} supersededReviews=${staleCounts.supersededReviews} staleTasks=${staleCounts.staleTasks} outdatedEvidence=${staleCounts.outdatedEvidence}`,
216
+ `inbox: open=${snapshot.inbox.open} acknowledged=${snapshot.inbox.acknowledged} resolved=${snapshot.inbox.resolved}`,
217
+ `team: active=${snapshot.team.active} backend=${snapshot.team.backend} executors=${snapshot.team.executors} busy=${snapshot.team.busy} idle=${snapshot.team.idle} stale=${snapshot.team.stale} offline=${snapshot.team.offline} tmux=${snapshot.team.tmuxAvailable}`,
218
+ `subagents: active=${snapshot.subagents.active} total=${snapshot.subagents.total} byBackend=[${Object.entries(snapshot.subagents.byBackend).map(([k, v]) => `${k}=${v}`).join(', ') || 'none'}]`,
219
+ `install-registry: total=${snapshot.installRegistry.total} kinds=[${installSummary}]`,
220
+ `doctor: passed=${snapshot.doctor.passed} warnings=${snapshot.doctor.warnings} failed=${snapshot.doctor.failed}`,
221
+ `alerts: ${snapshot.alerts.length > 0 ? snapshot.alerts.join(' | ') : 'none'}`,
222
+ `ralph: active=${snapshot.activeRalph.active} phase=${snapshot.activeRalph.phase ?? 'none'} gateProfile=${snapshot.activeRalph.gateProfile ?? 'none'} goalScope=${snapshot.activeRalph.goalScope ?? 'none'}`,
223
+ `ultrawork: active=${snapshot.activeUltrawork.active} phase=${snapshot.activeUltrawork.phase ?? 'none'} gateProfile=${snapshot.activeUltrawork.gateProfile ?? 'none'} goalScope=${snapshot.activeUltrawork.goalScope ?? 'none'}`,
224
+ `activeJobs: scheduled=${snapshot.activeJobs.scheduled} paused=${snapshot.activeJobs.paused} monitors=${snapshot.activeJobs.monitors} nextFireAt=${snapshot.activeJobs.nextFireAt ?? 'none'}`,
225
+ `continuation: status=${snapshot.continuation.status} lane=${snapshot.continuation.lane} denyCount=${snapshot.continuation.denyCount} resumeHint=${snapshot.continuation.resumeHint ?? 'none'}`,
226
+ `logicalIdle: active=${snapshot.logicalIdle.isLogicalIdle} idleDurationMs=${snapshot.logicalIdle.idleDurationMs ?? 'none'} thresholdMs=${snapshot.logicalIdle.idleThresholdMs} lastActivity=${snapshot.logicalIdle.lastActivitySource ?? 'none'}`,
227
+ ].join('\n');
228
+ }
229
+ //# sourceMappingURL=hud.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hud.js","sourceRoot":"","sources":["../../src/operator/hud.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,UAAU,EACV,WAAW,EAEX,WAAW,EACX,SAAS,EAGT,QAAQ,GAGT,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAkD,MAAM,gDAAgD,CAAC;AAC1J,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAuG3F,SAAS,iBAAiB;IACxB,OAAO;QACL,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,CAAC;QACT,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,CAAC;QACT,SAAS,EAAE,CAAC;KACb,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAA6B,EAC7B,KAAqB;IAErB,OAAO;QACL,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,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