@agimon-ai/doompi-task 0.0.1-alpha.11 → 0.0.1-alpha.111

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 (463) hide show
  1. package/README.md +123 -15
  2. package/dist/apiContracts.cjs +54 -0
  3. package/dist/apiContracts.cjs.map +1 -0
  4. package/dist/apiContracts.d.mts +53 -0
  5. package/dist/apiContracts.d.mts.map +1 -0
  6. package/dist/apiContracts.mjs +49 -0
  7. package/dist/apiContracts.mjs.map +1 -0
  8. package/dist/commands.cjs +4 -1
  9. package/dist/commands.d.mts +20 -2
  10. package/dist/commands.d.mts.map +1 -0
  11. package/dist/commands.mjs +2 -1
  12. package/dist/config-BPNE_wEU.cjs +173 -0
  13. package/dist/config-BPNE_wEU.cjs.map +1 -0
  14. package/dist/config-DmsCPDuF.mjs +72 -0
  15. package/dist/config-DmsCPDuF.mjs.map +1 -0
  16. package/dist/config.cjs +19 -1
  17. package/dist/config.d.mts +2 -2
  18. package/dist/config.mjs +2 -1
  19. package/dist/delegation-3hMdTFXF.cjs +661 -0
  20. package/dist/delegation-3hMdTFXF.cjs.map +1 -0
  21. package/dist/delegation-BiOy3_7g.mjs +7 -0
  22. package/dist/delegation-BiOy3_7g.mjs.map +1 -0
  23. package/dist/delegation-CkGbRaOl.mjs +626 -0
  24. package/dist/delegation-CkGbRaOl.mjs.map +1 -0
  25. package/dist/delegation-LDpHP2CC.cjs +12 -0
  26. package/dist/delegation-LDpHP2CC.cjs.map +1 -0
  27. package/dist/delegation-Ot2xltLi.d.mts +6 -0
  28. package/dist/delegation-Ot2xltLi.d.mts.map +1 -0
  29. package/dist/delegationManager.cjs +10 -0
  30. package/dist/delegationManager.d.mts +3 -0
  31. package/dist/delegationManager.mjs +3 -0
  32. package/dist/delegationPlatform-Cfn-Lqew.cjs +95 -0
  33. package/dist/delegationPlatform-Cfn-Lqew.cjs.map +1 -0
  34. package/dist/delegationPlatform-DZ4SZ8a5.mjs +64 -0
  35. package/dist/delegationPlatform-DZ4SZ8a5.mjs.map +1 -0
  36. package/dist/extensions/mcp-ui.mjs +23 -0
  37. package/dist/extensions/mcp-ui.mjs.map +1 -0
  38. package/dist/extensions/mcp.cjs +1876 -0
  39. package/dist/extensions/mcp.cjs.map +1 -0
  40. package/dist/extensions/mcp.d.mts +5 -0
  41. package/dist/extensions/mcp.d.mts.map +1 -0
  42. package/dist/extensions/mcp.mjs +1846 -0
  43. package/dist/extensions/mcp.mjs.map +1 -0
  44. package/dist/extensions/pi.cjs +437 -1
  45. package/dist/extensions/pi.cjs.map +1 -1
  46. package/dist/extensions/pi.d.mts +5 -2
  47. package/dist/extensions/pi.d.mts.map +1 -0
  48. package/dist/extensions/pi.mjs +432 -1
  49. package/dist/extensions/pi.mjs.map +1 -1
  50. package/dist/extensions/server.cjs +380 -0
  51. package/dist/extensions/server.cjs.map +1 -0
  52. package/dist/extensions/server.d.mts +5 -0
  53. package/dist/extensions/server.d.mts.map +1 -0
  54. package/dist/extensions/server.mjs +375 -0
  55. package/dist/extensions/server.mjs.map +1 -0
  56. package/dist/extensions/web.mjs +1013 -0
  57. package/dist/extensions/web.mjs.map +1 -0
  58. package/dist/format.cli-ChQsP1MQ.cjs +393 -0
  59. package/dist/format.cli-ChQsP1MQ.cjs.map +1 -0
  60. package/dist/format.cli-Cnc591eb.mjs +322 -0
  61. package/dist/format.cli-Cnc591eb.mjs.map +1 -0
  62. package/dist/{services/delegation/manager.d.cts → index-3-3ZJlaH.d.mts} +35 -31
  63. package/dist/index-3-3ZJlaH.d.mts.map +1 -0
  64. package/dist/{adapters/store/taskStore.d.cts → index-B7oVjSey.d.mts} +11 -28
  65. package/dist/index-B7oVjSey.d.mts.map +1 -0
  66. package/dist/{services/store/reconcile.d.cts → index-BNMm9g0K.d.mts} +4 -4
  67. package/dist/index-BNMm9g0K.d.mts.map +1 -0
  68. package/dist/{commands/task/responseEnvelope.d.cts → index-C3DgOhEm.d.mts} +17 -5
  69. package/dist/index-C3DgOhEm.d.mts.map +1 -0
  70. package/dist/{types/config.d.cts → index-D4goIk4Z.d.mts} +8 -3
  71. package/dist/index-D4goIk4Z.d.mts.map +1 -0
  72. package/dist/{services/store/reducer.d.cts → index-DIpc6_uJ.d.mts} +5 -5
  73. package/dist/index-DIpc6_uJ.d.mts.map +1 -0
  74. package/dist/{adapters/store/paths.d.cts → index-XY9VPmfm.d.mts} +6 -6
  75. package/dist/index-XY9VPmfm.d.mts.map +1 -0
  76. package/dist/index.cjs +106 -1
  77. package/dist/index.d.mts +16 -16
  78. package/dist/index.mjs +16 -1
  79. package/dist/invariants-DhjEjBPU.cjs +79 -0
  80. package/dist/invariants-DhjEjBPU.cjs.map +1 -0
  81. package/dist/invariants-q_UamF7D.mjs +62 -0
  82. package/dist/invariants-q_UamF7D.mjs.map +1 -0
  83. package/dist/logSinkTelemetry-C5QjZipw.mjs +41 -0
  84. package/dist/logSinkTelemetry-C5QjZipw.mjs.map +1 -0
  85. package/dist/logSinkTelemetry-CqiTuh3a.cjs +52 -0
  86. package/dist/logSinkTelemetry-CqiTuh3a.cjs.map +1 -0
  87. package/dist/logSinkTelemetry.cjs +6 -1
  88. package/dist/logSinkTelemetry.d.mts +23 -2
  89. package/dist/logSinkTelemetry.d.mts.map +1 -0
  90. package/dist/logSinkTelemetry.mjs +3 -1
  91. package/dist/paths-Bg8EEbk1.mjs +218 -0
  92. package/dist/paths-Bg8EEbk1.mjs.map +1 -0
  93. package/dist/paths-BsFVRulr.cjs +320 -0
  94. package/dist/paths-BsFVRulr.cjs.map +1 -0
  95. package/dist/processLiveness-Ccd9wenT.mjs +20 -0
  96. package/dist/processLiveness-Ccd9wenT.mjs.map +1 -0
  97. package/dist/processLiveness-umpNgsPR.cjs +25 -0
  98. package/dist/processLiveness-umpNgsPR.cjs.map +1 -0
  99. package/dist/promptGuidelines-DaxWrqud.d.mts +14 -0
  100. package/dist/promptGuidelines-DaxWrqud.d.mts.map +1 -0
  101. package/dist/promptGuidelines-g4QT8GNM.mjs +26 -0
  102. package/dist/promptGuidelines-g4QT8GNM.mjs.map +1 -0
  103. package/dist/promptGuidelines-j_SZTzlH.cjs +31 -0
  104. package/dist/promptGuidelines-j_SZTzlH.cjs.map +1 -0
  105. package/dist/reconcile-BcD-hTbd.mjs +63 -0
  106. package/dist/reconcile-BcD-hTbd.mjs.map +1 -0
  107. package/dist/reconcile-cRL0NjDr.cjs +80 -0
  108. package/dist/reconcile-cRL0NjDr.cjs.map +1 -0
  109. package/dist/reducer-BEfJFM5L.mjs +345 -0
  110. package/dist/reducer-BEfJFM5L.mjs.map +1 -0
  111. package/dist/reducer-BV0YIZ2o.cjs +380 -0
  112. package/dist/reducer-BV0YIZ2o.cjs.map +1 -0
  113. package/dist/root.cli-swHZqusx.d.mts +56 -0
  114. package/dist/root.cli-swHZqusx.d.mts.map +1 -0
  115. package/dist/selectors-BaS6dObz.mjs +142 -0
  116. package/dist/selectors-BaS6dObz.mjs.map +1 -0
  117. package/dist/{tui/selectors.d.cts → selectors-DPDPPjH3.d.mts} +11 -4
  118. package/dist/selectors-DPDPPjH3.d.mts.map +1 -0
  119. package/dist/selectors-b-69vb4W.cjs +189 -0
  120. package/dist/selectors-b-69vb4W.cjs.map +1 -0
  121. package/dist/storeInvariants.cjs +5 -0
  122. package/dist/storeInvariants.d.mts +23 -0
  123. package/dist/storeInvariants.d.mts.map +1 -0
  124. package/dist/storeInvariants.mjs +2 -0
  125. package/dist/storePaths.cjs +14 -0
  126. package/dist/storePaths.d.mts +2 -0
  127. package/dist/storePaths.mjs +2 -0
  128. package/dist/storeProcessLiveness.cjs +3 -0
  129. package/dist/{services/store/processLiveness.d.cts → storeProcessLiveness.d.mts} +3 -4
  130. package/dist/storeProcessLiveness.d.mts.map +1 -0
  131. package/dist/storeProcessLiveness.mjs +2 -0
  132. package/dist/storeReconcile.cjs +5 -0
  133. package/dist/storeReconcile.d.mts +2 -0
  134. package/dist/storeReconcile.mjs +2 -0
  135. package/dist/storeReducer.cjs +8 -0
  136. package/dist/storeReducer.d.mts +2 -0
  137. package/dist/storeReducer.mjs +2 -0
  138. package/dist/storeTaskGraph.cjs +7 -0
  139. package/dist/storeTaskGraph.d.mts +2 -0
  140. package/dist/storeTaskGraph.mjs +2 -0
  141. package/dist/storeTaskStore.cjs +3 -0
  142. package/dist/storeTaskStore.d.mts +2 -0
  143. package/dist/storeTaskStore.mjs +2 -0
  144. package/dist/storeTypes.cjs +6 -0
  145. package/dist/storeTypes.d.mts +2 -0
  146. package/dist/storeTypes.mjs +2 -0
  147. package/dist/task-B4aF5J9s.mjs +6 -0
  148. package/dist/task-B4aF5J9s.mjs.map +1 -0
  149. package/dist/task-CXF9VULl.cjs +49 -0
  150. package/dist/task-CXF9VULl.cjs.map +1 -0
  151. package/dist/task-CkFjC3Fo.d.mts +5 -0
  152. package/dist/task-CkFjC3Fo.d.mts.map +1 -0
  153. package/dist/{schemas/task.d.mts → task-DHSvdK6E.d.mts} +33 -17
  154. package/dist/task-DHSvdK6E.d.mts.map +1 -0
  155. package/dist/task-DKHKuems.mjs +116 -0
  156. package/dist/task-DKHKuems.mjs.map +1 -0
  157. package/dist/task-DaagqdPK.cjs +11 -0
  158. package/dist/task-DaagqdPK.cjs.map +1 -0
  159. package/dist/task-Dqy88_rr.cjs +193 -0
  160. package/dist/task-Dqy88_rr.cjs.map +1 -0
  161. package/dist/task-giCbpKzV.mjs +26 -0
  162. package/dist/task-giCbpKzV.mjs.map +1 -0
  163. package/dist/{services/store/types.d.mts → task-hLh4BOO7.d.mts} +37 -15
  164. package/dist/task-hLh4BOO7.d.mts.map +1 -0
  165. package/dist/task-space.cli-BH4Iy_7m.cjs +372 -0
  166. package/dist/task-space.cli-BH4Iy_7m.cjs.map +1 -0
  167. package/dist/task-space.cli-CMYNjgOW.mjs +355 -0
  168. package/dist/task-space.cli-CMYNjgOW.mjs.map +1 -0
  169. package/dist/task.cli-BM34E7GG.mjs +157 -0
  170. package/dist/task.cli-BM34E7GG.mjs.map +1 -0
  171. package/dist/task.cli-CiTkjUaX.cjs +174 -0
  172. package/dist/task.cli-CiTkjUaX.cjs.map +1 -0
  173. package/dist/taskGraph-BOQvT0-M.mjs +63 -0
  174. package/dist/taskGraph-BOQvT0-M.mjs.map +1 -0
  175. package/dist/taskGraph-BskRslrr.cjs +92 -0
  176. package/dist/taskGraph-BskRslrr.cjs.map +1 -0
  177. package/dist/{services/store/taskGraph.d.cts → taskGraph-YQXCfXTn.d.mts} +4 -4
  178. package/dist/taskGraph-YQXCfXTn.d.mts.map +1 -0
  179. package/dist/taskOverlay-B5wJHiml.cjs +175 -0
  180. package/dist/taskOverlay-B5wJHiml.cjs.map +1 -0
  181. package/dist/taskOverlay-CljDoTj_.mjs +164 -0
  182. package/dist/taskOverlay-CljDoTj_.mjs.map +1 -0
  183. package/dist/taskResult-D2G7b4w-.cjs +224 -0
  184. package/dist/taskResult-D2G7b4w-.cjs.map +1 -0
  185. package/dist/taskResult-edBAAKSH.mjs +165 -0
  186. package/dist/taskResult-edBAAKSH.mjs.map +1 -0
  187. package/dist/taskStore-CFx12KJk.mjs +213 -0
  188. package/dist/taskStore-CFx12KJk.mjs.map +1 -0
  189. package/dist/taskStore-T1pPy-UJ.cjs +220 -0
  190. package/dist/taskStore-T1pPy-UJ.cjs.map +1 -0
  191. package/dist/tasks.cli-8VvuN9YQ.cjs +40 -0
  192. package/dist/tasks.cli-8VvuN9YQ.cjs.map +1 -0
  193. package/dist/tasks.cli-BZj83YD_.mjs +29 -0
  194. package/dist/tasks.cli-BZj83YD_.mjs.map +1 -0
  195. package/dist/telemetry-DOyZLj8E.d.mts +36 -0
  196. package/dist/telemetry-DOyZLj8E.d.mts.map +1 -0
  197. package/dist/telemetry-I4md7Xzz.cjs +31 -0
  198. package/dist/telemetry-I4md7Xzz.cjs.map +1 -0
  199. package/dist/telemetry-PmX_1Y8a.mjs +26 -0
  200. package/dist/telemetry-PmX_1Y8a.mjs.map +1 -0
  201. package/dist/toolPromptGuidelines.cjs +3 -0
  202. package/dist/toolPromptGuidelines.d.mts +2 -0
  203. package/dist/toolPromptGuidelines.mjs +2 -0
  204. package/dist/toolResponseEnvelope.cjs +12 -0
  205. package/dist/toolResponseEnvelope.d.mts +2 -0
  206. package/dist/toolResponseEnvelope.mjs +2 -0
  207. package/dist/toolSchema.cjs +17 -0
  208. package/dist/toolSchema.d.mts +3 -0
  209. package/dist/toolSchema.mjs +3 -0
  210. package/dist/toolTaskTool.cjs +6 -0
  211. package/dist/toolTaskTool.d.mts +3 -0
  212. package/dist/toolTaskTool.mjs +3 -0
  213. package/dist/tuiFormat.cjs +14 -0
  214. package/dist/tuiFormat.d.mts +61 -0
  215. package/dist/tuiFormat.d.mts.map +1 -0
  216. package/dist/tuiFormat.mjs +2 -0
  217. package/dist/tuiSelectors.cjs +10 -0
  218. package/dist/tuiSelectors.d.mts +2 -0
  219. package/dist/tuiSelectors.mjs +2 -0
  220. package/dist/tuiTaskOverlay.cjs +4 -0
  221. package/dist/{tui/taskOverlay.d.cts → tuiTaskOverlay.d.mts} +9 -8
  222. package/dist/tuiTaskOverlay.d.mts.map +1 -0
  223. package/dist/tuiTaskOverlay.mjs +2 -0
  224. package/dist/tuiTaskSpace.cjs +5 -0
  225. package/dist/{tui/taskSpace.d.cts → tuiTaskSpace.d.mts} +11 -13
  226. package/dist/tuiTaskSpace.d.mts.map +1 -0
  227. package/dist/tuiTaskSpace.mjs +2 -0
  228. package/package.json +175 -109
  229. package/src/types/webTasks.ts +24 -0
  230. package/dist/_virtual/_rolldown/runtime.cjs +0 -1
  231. package/dist/adapters/pi/extension.cjs +0 -3
  232. package/dist/adapters/pi/extension.cjs.map +0 -1
  233. package/dist/adapters/pi/extension.d.cts +0 -12
  234. package/dist/adapters/pi/extension.d.cts.map +0 -1
  235. package/dist/adapters/pi/extension.d.mts +0 -12
  236. package/dist/adapters/pi/extension.d.mts.map +0 -1
  237. package/dist/adapters/pi/extension.mjs +0 -3
  238. package/dist/adapters/pi/extension.mjs.map +0 -1
  239. package/dist/adapters/store/paths.cjs +0 -2
  240. package/dist/adapters/store/paths.cjs.map +0 -1
  241. package/dist/adapters/store/paths.d.cts.map +0 -1
  242. package/dist/adapters/store/paths.d.mts +0 -26
  243. package/dist/adapters/store/paths.d.mts.map +0 -1
  244. package/dist/adapters/store/paths.mjs +0 -2
  245. package/dist/adapters/store/paths.mjs.map +0 -1
  246. package/dist/adapters/store/taskStore.cjs +0 -2
  247. package/dist/adapters/store/taskStore.cjs.map +0 -1
  248. package/dist/adapters/store/taskStore.d.cts.map +0 -1
  249. package/dist/adapters/store/taskStore.d.mts +0 -87
  250. package/dist/adapters/store/taskStore.d.mts.map +0 -1
  251. package/dist/adapters/store/taskStore.mjs +0 -2
  252. package/dist/adapters/store/taskStore.mjs.map +0 -1
  253. package/dist/adapters/telemetry/logSinkTelemetry.cjs +0 -2
  254. package/dist/adapters/telemetry/logSinkTelemetry.cjs.map +0 -1
  255. package/dist/adapters/telemetry/logSinkTelemetry.d.cts +0 -52
  256. package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +0 -1
  257. package/dist/adapters/telemetry/logSinkTelemetry.d.mts +0 -52
  258. package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +0 -1
  259. package/dist/adapters/telemetry/logSinkTelemetry.mjs +0 -2
  260. package/dist/adapters/telemetry/logSinkTelemetry.mjs.map +0 -1
  261. package/dist/commands/index.cjs +0 -2
  262. package/dist/commands/index.cjs.map +0 -1
  263. package/dist/commands/index.d.cts +0 -15
  264. package/dist/commands/index.d.cts.map +0 -1
  265. package/dist/commands/index.d.mts +0 -15
  266. package/dist/commands/index.d.mts.map +0 -1
  267. package/dist/commands/index.mjs +0 -2
  268. package/dist/commands/index.mjs.map +0 -1
  269. package/dist/commands/task/promptGuidelines.cjs +0 -2
  270. package/dist/commands/task/promptGuidelines.cjs.map +0 -1
  271. package/dist/commands/task/promptGuidelines.d.cts +0 -5
  272. package/dist/commands/task/promptGuidelines.d.cts.map +0 -1
  273. package/dist/commands/task/promptGuidelines.d.mts +0 -5
  274. package/dist/commands/task/promptGuidelines.d.mts.map +0 -1
  275. package/dist/commands/task/promptGuidelines.mjs +0 -2
  276. package/dist/commands/task/promptGuidelines.mjs.map +0 -1
  277. package/dist/commands/task/responseEnvelope.cjs +0 -6
  278. package/dist/commands/task/responseEnvelope.cjs.map +0 -1
  279. package/dist/commands/task/responseEnvelope.d.cts.map +0 -1
  280. package/dist/commands/task/responseEnvelope.d.mts +0 -39
  281. package/dist/commands/task/responseEnvelope.d.mts.map +0 -1
  282. package/dist/commands/task/responseEnvelope.mjs +0 -6
  283. package/dist/commands/task/responseEnvelope.mjs.map +0 -1
  284. package/dist/commands/task/taskTool.cjs +0 -3
  285. package/dist/commands/task/taskTool.cjs.map +0 -1
  286. package/dist/commands/task/taskTool.d.cts +0 -18
  287. package/dist/commands/task/taskTool.d.cts.map +0 -1
  288. package/dist/commands/task/taskTool.d.mts +0 -18
  289. package/dist/commands/task/taskTool.d.mts.map +0 -1
  290. package/dist/commands/task/taskTool.mjs +0 -3
  291. package/dist/commands/task/taskTool.mjs.map +0 -1
  292. package/dist/commands.d.cts +0 -2
  293. package/dist/config.d.cts +0 -2
  294. package/dist/delegation/manager.cjs +0 -1
  295. package/dist/delegation/manager.d.cts +0 -2
  296. package/dist/delegation/manager.d.mts +0 -2
  297. package/dist/delegation/manager.mjs +0 -1
  298. package/dist/extension.cjs +0 -1
  299. package/dist/extension.d.cts +0 -2
  300. package/dist/extension.d.mts +0 -2
  301. package/dist/extension.mjs +0 -1
  302. package/dist/extensions/doom.cjs +0 -2
  303. package/dist/extensions/doom.cjs.map +0 -1
  304. package/dist/extensions/doom.d.cts +0 -6
  305. package/dist/extensions/doom.d.cts.map +0 -1
  306. package/dist/extensions/doom.d.mts +0 -7
  307. package/dist/extensions/doom.d.mts.map +0 -1
  308. package/dist/extensions/doom.mjs +0 -2
  309. package/dist/extensions/doom.mjs.map +0 -1
  310. package/dist/extensions/pi.d.cts +0 -2
  311. package/dist/index.d.cts +0 -16
  312. package/dist/logSinkTelemetry.d.cts +0 -2
  313. package/dist/schemas/task.cjs +0 -2
  314. package/dist/schemas/task.cjs.map +0 -1
  315. package/dist/schemas/task.d.cts +0 -86
  316. package/dist/schemas/task.d.cts.map +0 -1
  317. package/dist/schemas/task.d.mts.map +0 -1
  318. package/dist/schemas/task.mjs +0 -2
  319. package/dist/schemas/task.mjs.map +0 -1
  320. package/dist/services/delegation/manager.cjs +0 -6
  321. package/dist/services/delegation/manager.cjs.map +0 -1
  322. package/dist/services/delegation/manager.d.cts.map +0 -1
  323. package/dist/services/delegation/manager.d.mts +0 -188
  324. package/dist/services/delegation/manager.d.mts.map +0 -1
  325. package/dist/services/delegation/manager.mjs +0 -6
  326. package/dist/services/delegation/manager.mjs.map +0 -1
  327. package/dist/services/narration/taskNarration.cjs +0 -2
  328. package/dist/services/narration/taskNarration.cjs.map +0 -1
  329. package/dist/services/narration/taskNarration.mjs +0 -2
  330. package/dist/services/narration/taskNarration.mjs.map +0 -1
  331. package/dist/services/store/invariants.cjs +0 -2
  332. package/dist/services/store/invariants.cjs.map +0 -1
  333. package/dist/services/store/invariants.d.cts +0 -14
  334. package/dist/services/store/invariants.d.cts.map +0 -1
  335. package/dist/services/store/invariants.d.mts +0 -14
  336. package/dist/services/store/invariants.d.mts.map +0 -1
  337. package/dist/services/store/invariants.mjs +0 -2
  338. package/dist/services/store/invariants.mjs.map +0 -1
  339. package/dist/services/store/paths.cjs +0 -1
  340. package/dist/services/store/paths.mjs +0 -1
  341. package/dist/services/store/processLiveness.cjs +0 -2
  342. package/dist/services/store/processLiveness.cjs.map +0 -1
  343. package/dist/services/store/processLiveness.d.cts.map +0 -1
  344. package/dist/services/store/processLiveness.d.mts +0 -12
  345. package/dist/services/store/processLiveness.d.mts.map +0 -1
  346. package/dist/services/store/processLiveness.mjs +0 -2
  347. package/dist/services/store/processLiveness.mjs.map +0 -1
  348. package/dist/services/store/reconcile.cjs +0 -2
  349. package/dist/services/store/reconcile.cjs.map +0 -1
  350. package/dist/services/store/reconcile.d.cts.map +0 -1
  351. package/dist/services/store/reconcile.d.mts +0 -34
  352. package/dist/services/store/reconcile.d.mts.map +0 -1
  353. package/dist/services/store/reconcile.mjs +0 -2
  354. package/dist/services/store/reconcile.mjs.map +0 -1
  355. package/dist/services/store/reducer.cjs +0 -3
  356. package/dist/services/store/reducer.cjs.map +0 -1
  357. package/dist/services/store/reducer.d.cts.map +0 -1
  358. package/dist/services/store/reducer.d.mts +0 -72
  359. package/dist/services/store/reducer.d.mts.map +0 -1
  360. package/dist/services/store/reducer.mjs +0 -3
  361. package/dist/services/store/reducer.mjs.map +0 -1
  362. package/dist/services/store/taskGraph.cjs +0 -2
  363. package/dist/services/store/taskGraph.cjs.map +0 -1
  364. package/dist/services/store/taskGraph.d.cts.map +0 -1
  365. package/dist/services/store/taskGraph.d.mts +0 -25
  366. package/dist/services/store/taskGraph.d.mts.map +0 -1
  367. package/dist/services/store/taskGraph.mjs +0 -2
  368. package/dist/services/store/taskGraph.mjs.map +0 -1
  369. package/dist/services/store/taskStore.cjs +0 -1
  370. package/dist/services/store/taskStore.d.cts +0 -2
  371. package/dist/services/store/taskStore.d.mts +0 -2
  372. package/dist/services/store/taskStore.mjs +0 -1
  373. package/dist/services/store/types.cjs +0 -2
  374. package/dist/services/store/types.cjs.map +0 -1
  375. package/dist/services/store/types.d.cts +0 -165
  376. package/dist/services/store/types.d.cts.map +0 -1
  377. package/dist/services/store/types.d.mts.map +0 -1
  378. package/dist/services/store/types.mjs +0 -2
  379. package/dist/services/store/types.mjs.map +0 -1
  380. package/dist/store/invariants.cjs +0 -1
  381. package/dist/store/invariants.d.cts +0 -2
  382. package/dist/store/invariants.d.mts +0 -2
  383. package/dist/store/invariants.mjs +0 -1
  384. package/dist/store/paths.cjs +0 -1
  385. package/dist/store/paths.d.cts +0 -2
  386. package/dist/store/paths.d.mts +0 -2
  387. package/dist/store/paths.mjs +0 -1
  388. package/dist/store/processLiveness.cjs +0 -1
  389. package/dist/store/processLiveness.d.cts +0 -2
  390. package/dist/store/processLiveness.d.mts +0 -2
  391. package/dist/store/processLiveness.mjs +0 -1
  392. package/dist/store/reconcile.cjs +0 -1
  393. package/dist/store/reconcile.d.cts +0 -2
  394. package/dist/store/reconcile.d.mts +0 -2
  395. package/dist/store/reconcile.mjs +0 -1
  396. package/dist/store/reducer.cjs +0 -1
  397. package/dist/store/reducer.d.cts +0 -2
  398. package/dist/store/reducer.d.mts +0 -2
  399. package/dist/store/reducer.mjs +0 -1
  400. package/dist/store/taskGraph.cjs +0 -1
  401. package/dist/store/taskGraph.d.cts +0 -2
  402. package/dist/store/taskGraph.d.mts +0 -2
  403. package/dist/store/taskGraph.mjs +0 -1
  404. package/dist/store/taskStore.cjs +0 -1
  405. package/dist/store/taskStore.d.cts +0 -3
  406. package/dist/store/taskStore.d.mts +0 -3
  407. package/dist/store/taskStore.mjs +0 -1
  408. package/dist/store/types.cjs +0 -1
  409. package/dist/store/types.d.cts +0 -2
  410. package/dist/store/types.d.mts +0 -2
  411. package/dist/store/types.mjs +0 -1
  412. package/dist/tool/promptGuidelines.cjs +0 -1
  413. package/dist/tool/promptGuidelines.d.cts +0 -2
  414. package/dist/tool/promptGuidelines.d.mts +0 -2
  415. package/dist/tool/promptGuidelines.mjs +0 -1
  416. package/dist/tool/responseEnvelope.cjs +0 -1
  417. package/dist/tool/responseEnvelope.d.cts +0 -2
  418. package/dist/tool/responseEnvelope.d.mts +0 -2
  419. package/dist/tool/responseEnvelope.mjs +0 -1
  420. package/dist/tool/schema.cjs +0 -1
  421. package/dist/tool/schema.d.cts +0 -2
  422. package/dist/tool/schema.d.mts +0 -2
  423. package/dist/tool/schema.mjs +0 -1
  424. package/dist/tool/taskTool.cjs +0 -1
  425. package/dist/tool/taskTool.d.cts +0 -3
  426. package/dist/tool/taskTool.d.mts +0 -3
  427. package/dist/tool/taskTool.mjs +0 -1
  428. package/dist/tui/format.cjs +0 -4
  429. package/dist/tui/format.cjs.map +0 -1
  430. package/dist/tui/format.d.cts +0 -62
  431. package/dist/tui/format.d.cts.map +0 -1
  432. package/dist/tui/format.d.mts +0 -62
  433. package/dist/tui/format.d.mts.map +0 -1
  434. package/dist/tui/format.mjs +0 -4
  435. package/dist/tui/format.mjs.map +0 -1
  436. package/dist/tui/selectors.cjs +0 -2
  437. package/dist/tui/selectors.cjs.map +0 -1
  438. package/dist/tui/selectors.d.cts.map +0 -1
  439. package/dist/tui/selectors.d.mts +0 -53
  440. package/dist/tui/selectors.d.mts.map +0 -1
  441. package/dist/tui/selectors.mjs +0 -2
  442. package/dist/tui/selectors.mjs.map +0 -1
  443. package/dist/tui/taskOverlay.cjs +0 -2
  444. package/dist/tui/taskOverlay.cjs.map +0 -1
  445. package/dist/tui/taskOverlay.d.cts.map +0 -1
  446. package/dist/tui/taskOverlay.d.mts +0 -38
  447. package/dist/tui/taskOverlay.d.mts.map +0 -1
  448. package/dist/tui/taskOverlay.mjs +0 -2
  449. package/dist/tui/taskOverlay.mjs.map +0 -1
  450. package/dist/tui/taskSpace.cjs +0 -5
  451. package/dist/tui/taskSpace.cjs.map +0 -1
  452. package/dist/tui/taskSpace.d.cts.map +0 -1
  453. package/dist/tui/taskSpace.d.mts +0 -62
  454. package/dist/tui/taskSpace.d.mts.map +0 -1
  455. package/dist/tui/taskSpace.mjs +0 -5
  456. package/dist/tui/taskSpace.mjs.map +0 -1
  457. package/dist/types/config.cjs +0 -2
  458. package/dist/types/config.cjs.map +0 -1
  459. package/dist/types/config.d.cts.map +0 -1
  460. package/dist/types/config.d.mts +0 -38
  461. package/dist/types/config.d.mts.map +0 -1
  462. package/dist/types/config.mjs +0 -2
  463. package/dist/types/config.mjs.map +0 -1
@@ -1,39 +0,0 @@
1
- import { TaskAction, TaskDetails, TaskDocument, TaskMutationParams } from "../../services/store/types.mjs";
2
- import { Op } from "../../services/store/reducer.mjs";
3
- //#region src/commands/task/responseEnvelope.d.ts
4
- declare const MSG_ALL_COMPLETE_CLEAR = "All tasks are completed. Review the full task list once more, then close it with task {\"action\":\"clear\"}.";
5
- /**
6
- * Steering for a mixed batch. Unlike a batch of spawned subagents, a failed
7
- * entry here had no side effect at all, so retrying the failures is the safe
8
- * move and the model must be told so or it will do nothing. The hazard is the
9
- * other half: resending an applied create would make a second task.
10
- */
11
- declare const MSG_UPSERT_PARTIAL = "The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.";
12
- declare const MSG_UPSERT_NONE_APPLIED = "No task changed, so the whole call can be resent once corrected.";
13
- /**
14
- * The thrown message when an upsert applied nothing. Kept separate from
15
- * `formatContent` because the caller wraps it in the actionable Options block
16
- * rather than returning it as a successful result.
17
- */
18
- declare function formatUpsertFailureText(op: Extract<Op, {
19
- kind: 'upsert';
20
- }>): string;
21
- /**
22
- * Pure formatter: `(op, document) -> string`. The switch is closed over `Op`,
23
- * so a new reducer variant fails to compile until it is handled here.
24
- */
25
- declare function formatContent(op: Op, document: TaskDocument): string;
26
- interface ToolResult {
27
- content: Array<{
28
- type: 'text';
29
- text: string;
30
- }>;
31
- details: TaskDetails;
32
- }
33
- /** Build the LLM-facing envelope. `details` carries the post-mutation snapshot. */
34
- declare function buildToolResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, op: Op): ToolResult;
35
- /** Envelope for delegation actions, which do not flow through the reducer. */
36
- declare function buildTextResult(action: TaskAction, params: TaskMutationParams, document: TaskDocument, text: string, error?: string): ToolResult;
37
- //#endregion
38
- export { MSG_ALL_COMPLETE_CLEAR, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildTextResult, buildToolResult, formatContent, formatUpsertFailureText };
39
- //# sourceMappingURL=responseEnvelope.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"responseEnvelope.d.mts","names":[],"sources":["../../../src/commands/task/responseEnvelope.ts"],"mappings":";;;cAWa;;;;;;;cASA;cAGA;;;;;;iBA0DG,wBAAwB,IAAI,QAAQ;EAAM;;;;;;iBAa1C,cAAc,IAAI,IAAI,UAAU;UAmC/B;EACf,SAAS;IAAQ;IAAc;;EAC/B,SAAS;;;iBAIK,gBACd,QAAQ,YACR,QAAQ,oBACR,UAAU,cACV,IAAI,KACH;;iBA0Ba,gBACd,QAAQ,YACR,QAAQ,oBACR,UAAU,cACV,cACA,iBACC"}
@@ -1,6 +0,0 @@
1
- import{deriveBlocks as e,isTaskListComplete as t}from"../../services/store/taskGraph.mjs";const n=`All tasks are completed. Review the full task list once more, then close it with task {"action":"clear"}.`,r=`The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.`,i=`No task changed, so the whole call can be resent once corrected.`;function a(e){let t=e.blockedBy?.length?` ⛓ ${e.blockedBy.map(e=>`#${e}`).join(`,`)}`:``,n=e.status===`in_progress`&&e.activeForm?` (${e.activeForm})`:``,r=e.delegation&&e.delegation.state!==`cancelled`?` [${e.delegation.agent}]`:``;return`[${e.status}] #${e.id} ${e.subject}${n}${r}${t}`}function o(e){let t=e.delegation;if(!t)return[];let n=[` delegated to: ${t.agent} (${t.state})`];return t.model&&n.push(` model: ${t.model}`),t.result?.error&&n.push(` error: ${t.result.error}`),t.result?.outputPath&&n.push(` output file: ${t.result.outputPath}`),t.result?.output&&n.push(` output: ${t.result.output}`),n}function s(t,n){let r=e(n.tasks).get(t.id)??[],i=[`#${t.id} [${t.status}] ${t.subject}`];return t.description&&i.push(` description: ${t.description}`),t.activeForm&&i.push(` activeForm: ${t.activeForm}`),t.blockedBy?.length&&i.push(` blockedBy: ${t.blockedBy.map(e=>`#${e}`).join(`, `)}`),r.length&&i.push(` blocks: ${r.map(e=>`#${e}`).join(`, `)}`),t.owner&&i.push(` owner: ${t.owner}`),i.push(...o(t)),i.join(`
2
- `)}function c(e){switch(e.kind){case`created`:{let t=e.ref?` (ref "${e.ref}")`:``,n=e.blockedBy?.length?` — blocked by ${e.blockedBy.map(e=>`#${e}`).join(`, `)}`:``;return`Created #${e.id}${t}: ${e.subject} (${e.status})${n}`}case`updated`:{let t=e.fromStatus===e.toStatus?``:` (${e.fromStatus} -> ${e.toStatus})`;return`Updated #${e.id}${t}`}case`unchanged`:return`No change: #${e.id} already matches the requested values (status: ${e.status})`;case`failed`:return`Failed${e.id===void 0?``:` #${e.id}`}: ${e.message}`}}function l(e){return e.items.length===1?e.items[0].kind===`failed`?e.items[0].message:`no entry was applied`:[`no entry was applied.`,...e.items.map(e=>`- [${e.index}] ${c(e)}`),i].join(`
3
- `)}function u(e,i){switch(e.kind){case`upsert`:{let a=e.items.length===1?[c(e.items[0])]:[`Upsert applied ${e.applied}/${e.items.length} entries${e.failed>0?`; ${e.failed} failed`:``}.`,...e.items.map(e=>`- [${e.index}] ${c(e)}`),...e.failed>0?[``,r]:[]];return e.applied>0&&t(i.tasks)&&a.push(n),a.join(`
4
- `)}case`delete`:return`Deleted #${e.id}: ${e.subject}`;case`clear`:return`Closed task list (cleared ${e.count} tasks)`;case`list`:{let t=i.tasks;return e.includeDeleted||(t=t.filter(e=>e.status!==`deleted`)),e.statusFilter&&(t=t.filter(t=>t.status===e.statusFilter)),t.length===0?`No tasks`:t.map(a).join(`
5
- `)}case`get`:return s(e.task,i);case`error`:return`Error: ${e.message}`}}function d(e,t,n,r){return{content:[{type:`text`,text:u(r,n)}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...r.kind===`error`?{error:r.message}:{},...r.kind===`upsert`?{upsert:{applied:r.items.flatMap(e=>e.kind===`failed`?[]:[e.id]),failed:r.failed}}:{}}}}function f(e,t,n,r,i){return{content:[{type:`text`,text:i?`Error: ${i}`:r}],details:{action:e,params:t,tasks:n.tasks,nextId:n.nextId,rev:n.rev,...i?{error:i}:{}}}}export{n as MSG_ALL_COMPLETE_CLEAR,i as MSG_UPSERT_NONE_APPLIED,r as MSG_UPSERT_PARTIAL,f as buildTextResult,d as buildToolResult,u as formatContent,l as formatUpsertFailureText};
6
- //# sourceMappingURL=responseEnvelope.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"responseEnvelope.mjs","names":[],"sources":["../../../src/commands/task/responseEnvelope.ts"],"sourcesContent":["import type { Op } from '../../services/store/reducer.ts';\nimport { deriveBlocks, isTaskListComplete } from '../../services/store/taskGraph.ts';\nimport type {\n Task,\n TaskAction,\n TaskDetails,\n TaskDocument,\n TaskMutationParams,\n UpsertItemOutcome,\n} from '../../services/store/types.ts';\n\nexport const MSG_ALL_COMPLETE_CLEAR =\n 'All tasks are completed. Review the full task list once more, then close it with task {\"action\":\"clear\"}.';\n\n/**\n * Steering for a mixed batch. Unlike a batch of spawned subagents, a failed\n * entry here had no side effect at all, so retrying the failures is the safe\n * move and the model must be told so or it will do nothing. The hazard is the\n * other half: resending an applied create would make a second task.\n */\nexport const MSG_UPSERT_PARTIAL =\n 'The applied entries are committed. Resend only the failed entries, corrected — a failed entry changed nothing, so a corrected retry is safe. Do not resend an entry that already applied: an entry without an id creates a second task.';\n\nexport const MSG_UPSERT_NONE_APPLIED = 'No task changed, so the whole call can be resent once corrected.';\n\n/** `[status] #id subject (activeForm) [agent] ⛓ #dep` — the `list` line format. */\nfunction formatListLine(task: Task): string {\n const block = task.blockedBy?.length ? ` ⛓ ${task.blockedBy.map((id) => `#${id}`).join(',')}` : '';\n const form = task.status === 'in_progress' && task.activeForm ? ` (${task.activeForm})` : '';\n const delegated = task.delegation && task.delegation.state !== 'cancelled' ? ` [${task.delegation.agent}]` : '';\n return `[${task.status}] #${task.id} ${task.subject}${form}${delegated}${block}`;\n}\n\nfunction formatDelegationLines(task: Task): string[] {\n const delegation = task.delegation;\n if (!delegation) return [];\n\n const lines = [` delegated to: ${delegation.agent} (${delegation.state})`];\n if (delegation.model) lines.push(` model: ${delegation.model}`);\n if (delegation.result?.error) lines.push(` error: ${delegation.result.error}`);\n if (delegation.result?.outputPath) lines.push(` output file: ${delegation.result.outputPath}`);\n if (delegation.result?.output) lines.push(` output: ${delegation.result.output}`);\n return lines;\n}\n\nfunction formatGetLines(task: Task, document: TaskDocument): string {\n const blocks = deriveBlocks(document.tasks).get(task.id) ?? [];\n const lines = [`#${task.id} [${task.status}] ${task.subject}`];\n if (task.description) lines.push(` description: ${task.description}`);\n if (task.activeForm) lines.push(` activeForm: ${task.activeForm}`);\n if (task.blockedBy?.length) lines.push(` blockedBy: ${task.blockedBy.map((id) => `#${id}`).join(', ')}`);\n if (blocks.length) lines.push(` blocks: ${blocks.map((id) => `#${id}`).join(', ')}`);\n if (task.owner) lines.push(` owner: ${task.owner}`);\n lines.push(...formatDelegationLines(task));\n return lines.join('\\n');\n}\n\n/** One entry's outcome. Batch lines prefix this with `- [n] `. */\nfunction formatUpsertItem(item: UpsertItemOutcome): string {\n switch (item.kind) {\n case 'created': {\n const ref = item.ref ? ` (ref \"${item.ref}\")` : '';\n const deps = item.blockedBy?.length ? ` — blocked by ${item.blockedBy.map((id) => `#${id}`).join(', ')}` : '';\n return `Created #${item.id}${ref}: ${item.subject} (${item.status})${deps}`;\n }\n case 'updated': {\n const transition = item.fromStatus === item.toStatus ? '' : ` (${item.fromStatus} -> ${item.toStatus})`;\n return `Updated #${item.id}${transition}`;\n }\n case 'unchanged':\n return `No change: #${item.id} already matches the requested values (status: ${item.status})`;\n case 'failed':\n return `Failed${item.id === undefined ? '' : ` #${item.id}`}: ${item.message}`;\n }\n}\n\n/**\n * The thrown message when an upsert applied nothing. Kept separate from\n * `formatContent` because the caller wraps it in the actionable Options block\n * rather than returning it as a successful result.\n */\nexport function formatUpsertFailureText(op: Extract<Op, { kind: 'upsert' }>): string {\n if (op.items.length === 1) return op.items[0].kind === 'failed' ? op.items[0].message : 'no entry was applied';\n return [\n 'no entry was applied.',\n ...op.items.map((item) => `- [${item.index}] ${formatUpsertItem(item)}`),\n MSG_UPSERT_NONE_APPLIED,\n ].join('\\n');\n}\n\n/**\n * Pure formatter: `(op, document) -> string`. The switch is closed over `Op`,\n * so a new reducer variant fails to compile until it is handled here.\n */\nexport function formatContent(op: Op, document: TaskDocument): string {\n switch (op.kind) {\n case 'upsert': {\n // A batch of one is the common case and must not read like a bulk\n // report, so it keeps the exact single-line shape it has always had.\n const lines =\n op.items.length === 1\n ? [formatUpsertItem(op.items[0])]\n : [\n `Upsert applied ${op.applied}/${op.items.length} entries${op.failed > 0 ? `; ${op.failed} failed` : ''}.`,\n ...op.items.map((item) => `- [${item.index}] ${formatUpsertItem(item)}`),\n ...(op.failed > 0 ? ['', MSG_UPSERT_PARTIAL] : []),\n ];\n // Once, last, and only when something landed: emitting it per entry\n // would repeat it for every completion in a batch.\n if (op.applied > 0 && isTaskListComplete(document.tasks)) lines.push(MSG_ALL_COMPLETE_CLEAR);\n return lines.join('\\n');\n }\n case 'delete':\n return `Deleted #${op.id}: ${op.subject}`;\n case 'clear':\n return `Closed task list (cleared ${op.count} tasks)`;\n case 'list': {\n let view = document.tasks;\n if (!op.includeDeleted) view = view.filter((task) => task.status !== 'deleted');\n if (op.statusFilter) view = view.filter((task) => task.status === op.statusFilter);\n return view.length === 0 ? 'No tasks' : view.map(formatListLine).join('\\n');\n }\n case 'get':\n return formatGetLines(op.task, document);\n case 'error':\n return `Error: ${op.message}`;\n }\n}\n\nexport interface ToolResult {\n content: Array<{ type: 'text'; text: string }>;\n details: TaskDetails;\n}\n\n/** Build the LLM-facing envelope. `details` carries the post-mutation snapshot. */\nexport function buildToolResult(\n action: TaskAction,\n params: TaskMutationParams,\n document: TaskDocument,\n op: Op,\n): ToolResult {\n return {\n content: [{ type: 'text', text: formatContent(op, document) }],\n details: {\n action,\n params: params as Record<string, unknown>,\n tasks: document.tasks,\n nextId: document.nextId,\n rev: document.rev,\n ...(op.kind === 'error' ? { error: op.message } : {}),\n // Deliberately no `error` on a partial success: renderResult treats\n // `details.error` as total failure and would hide the rows for the\n // entries that did land.\n ...(op.kind === 'upsert'\n ? {\n upsert: {\n applied: op.items.flatMap((item) => (item.kind === 'failed' ? [] : [item.id])),\n failed: op.failed,\n },\n }\n : {}),\n },\n };\n}\n\n/** Envelope for delegation actions, which do not flow through the reducer. */\nexport function buildTextResult(\n action: TaskAction,\n params: TaskMutationParams,\n document: TaskDocument,\n text: string,\n error?: string,\n): ToolResult {\n return {\n content: [{ type: 'text', text: error ? `Error: ${error}` : text }],\n details: {\n action,\n params: params as Record<string, unknown>,\n tasks: document.tasks,\n nextId: document.nextId,\n rev: document.rev,\n ...(error ? { error } : {}),\n },\n };\n}\n"],"mappings":"0FAWA,MAAa,EACX,4GAQW,EACX,0OAEW,EAA0B,mEAGvC,SAAS,EAAe,EAAoB,CAC1C,IAAM,EAAQ,EAAK,WAAW,OAAS,MAAM,EAAK,UAAU,IAAK,GAAO,IAAI,GAAI,CAAC,CAAC,KAAK,GAAG,IAAM,GAC1F,EAAO,EAAK,SAAW,eAAiB,EAAK,WAAa,KAAK,EAAK,WAAW,GAAK,GACpF,EAAY,EAAK,YAAc,EAAK,WAAW,QAAU,YAAc,KAAK,EAAK,WAAW,MAAM,GAAK,GAC7G,MAAO,IAAI,EAAK,OAAO,KAAK,EAAK,GAAG,GAAG,EAAK,UAAU,IAAO,IAAY,GAC3E,CAEA,SAAS,EAAsB,EAAsB,CACnD,IAAM,EAAa,EAAK,WACxB,GAAI,CAAC,EAAY,MAAO,CAAC,EAEzB,IAAM,EAAQ,CAAC,mBAAmB,EAAW,MAAM,IAAI,EAAW,MAAM,EAAE,EAK1E,OAJI,EAAW,OAAO,EAAM,KAAK,YAAY,EAAW,OAAO,EAC3D,EAAW,QAAQ,OAAO,EAAM,KAAK,YAAY,EAAW,OAAO,OAAO,EAC1E,EAAW,QAAQ,YAAY,EAAM,KAAK,kBAAkB,EAAW,OAAO,YAAY,EAC1F,EAAW,QAAQ,QAAQ,EAAM,KAAK,aAAa,EAAW,OAAO,QAAQ,EAC1E,CACT,CAEA,SAAS,EAAe,EAAY,EAAgC,CAClE,IAAM,EAAS,EAAa,EAAS,KAAK,CAAC,CAAC,IAAI,EAAK,EAAE,GAAK,CAAC,EACvD,EA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AAC,EAC7D,QAAS,CACP,SACQ,SACR,MAAO,EAAS,MAChB,OAAQ,EAAS,OACjB,IAAK,EAAS,IACd,GAAI,EAAG,OAAS,QAAU,CAAE,MAAO,EAAG,OAAQ,EAAI,CAAC,EAInD,GAAI,EAAG,OAAS,SACZ,CACE,OAAQ,CACN,QAAS,EAAG,MAAM,QAAS,GAAU,EAAK,OAAS,SAAW,CAAC,EAAI,CAAC,EAAK,EAAE,CAAE,EAC7E,OAAQ,EAAG,MACb,CACF,EACA,CAAC,CACP,CACF,CACF,CAGA,SAAgB,EACd,EACA,EACA,EACA,EACA,EACY,CACZ,MAAO,CACL,QAAS,CAAC,CAAE,KAAM,OAAQ,KAAM,EAAQ,UAAU,IAAU,CAAK,CAAC,EAClE,QAAS,CACP,SACQ,SACR,MAAO,EAAS,MAChB,OAAQ,EAAS,OACjB,IAAK,EAAS,IACd,GAAI,EAAQ,CAAE,OAAM,EAAI,CAAC,CAC3B,CACF,CACF"}
@@ -1,3 +0,0 @@
1
- const e=require("../../adapters/telemetry/logSinkTelemetry.cjs"),t=require("../../schemas/task.cjs"),n=require("../../services/store/reducer.cjs"),r=require("../../tui/format.cjs"),i=require("./promptGuidelines.cjs"),a=require("./responseEnvelope.cjs"),o=`Manage a shared task list to track multi-step progress, and delegate tasks to subagents`,s=new Set([`upsert`,`list`,`get`,`delete`,`clear`]);var c=class extends Error{};function l(e,t){return new c([`Task ${e} failed: ${t}`,``,`Options:`,`- List the task board and inspect the current ids, states, and blockers.`,`- Correct the arguments or state conflict, then retry once.`,`- Ask the user before cancelling work or changing dependencies to recover.`].join(`
2
- `))}function u(e,n){let r=Object.keys(n).filter(r=>n[r]!==void 0&&!t.taskActionAcceptsField(e,r));if(r.length===0)return;let i=e===`upsert`?` ${t.MSG_UPSERT_FIELD_MISPLACED}`:``;throw l(e,`${e} does not accept ${r.join(`, `)}.${i}`)}async function d(e,t,r){let{document:i,value:o}=await e.mutate(e=>{let i=n.applyTaskMutation(e,t,r);return{...n.isCommittingOp(i.op)?{document:i.document}:{},value:i}});if(o.op.kind===`error`)throw l(t,o.op.message);if(o.op.kind===`upsert`&&o.op.applied===0)throw l(t,a.formatUpsertFailureText(o.op));return a.buildToolResult(t,r,i,o.op)}function f(n,f){let{store:p,delegation:m}=f;n.registerTool({name:t.TOOL_NAME,label:t.TOOL_LABEL,description:`Manage a shared task list for tracking multi-step progress, and delegate tasks to subagents. Actions: upsert (write tasks — a tasks[] array where an entry with an id changes that task and an entry without an id creates one, so one call can capture a whole plan), list, get, delete (tombstone), clear (close/reset the list), assign (hand the task to a named subagent that works it in the background), cancel (stop a delegated run). upsert applies each entry independently: successes are committed and failures are reported by array index, and an entry can depend on a task created by an earlier entry in the same call via a ref. Batch when writing a plan down; report progress one task at a time. Status: pending → in_progress → completed, plus failed and a deleted tombstone. The list is shared within the current session tree, including delegated subagents, while unrelated sessions start empty. Session stores persist until retention cleanup.`,promptSnippet:o,promptGuidelines:i.DEFAULT_PROMPT_GUIDELINES,parameters:t.TaskParamsSchema,async execute(t,n,r,i,o){let h=n.action,g=n;try{if(u(h,g),s.has(h)){let e=await d(p,h,g);return f.onChange?.(),e}let e;if(h===`assign`?(i?.(a.buildTextResult(h,g,p.snapshot,`Delegating task #${g.id??`unknown`}...`)),e=await m.assign(g.id??NaN,{agent:g.agent,inlineAgent:g.inlineAgent,instructions:g.instructions,relevantFiles:g.relevantFiles,priorFindings:g.priorFindings,model:g.model,context:g.context,signal:r})):(i?.(a.buildTextResult(h,g,p.snapshot,`Requesting cancellation for task #${g.id??`unknown`}...`)),e=await m.cancel(g.id??NaN)),f.onChange?.(),!e.ok)throw l(h,e.message);return a.buildTextResult(h,g,p.snapshot,e.message,void 0)}catch(t){throw f.report?.error(e.TASK_EVENT.toolFailed,t,{"tool.action":h,...g.id===void 0?{}:{"task.id":g.id}}),t instanceof c?t:l(h,t instanceof Error?t.message:String(t))}},renderCall(e,t,n){return r.renderTaskCall(e,t,p.snapshot.tasks)},renderResult(e,t,n,i){return r.renderTaskResult(e,t,n)}})}exports.DEFAULT_PROMPT_GUIDELINES=i.DEFAULT_PROMPT_GUIDELINES,exports.DEFAULT_PROMPT_SNIPPET=o,exports.registerTaskTool=f;
3
- //# sourceMappingURL=taskTool.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taskTool.cjs","names":["taskActionAcceptsField","MSG_UPSERT_FIELD_MISPLACED","applyTaskMutation","isCommittingOp","formatUpsertFailureText","buildToolResult","TOOL_NAME","TOOL_LABEL","DEFAULT_PROMPT_GUIDELINES","TaskParamsSchema","buildTextResult","TASK_EVENT","renderTaskCall","renderTaskResult"],"sources":["../../../src/commands/task/taskTool.ts"],"sourcesContent":["import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport { TASK_EVENT, type TaskFailureReporter } from '../../adapters/telemetry/logSinkTelemetry.ts';\nimport {\n MSG_UPSERT_FIELD_MISPLACED,\n TaskParamsSchema,\n TOOL_LABEL,\n TOOL_NAME,\n taskActionAcceptsField,\n} from '../../schemas/task.ts';\nimport type { DelegationManager, DelegationOutcome } from '../../services/delegation/manager.ts';\nimport { applyTaskMutation, isCommittingOp, type ReducerAction } from '../../services/store/reducer.ts';\nimport type { TaskStore } from '../../services/store/taskStore.ts';\nimport type { TaskAction, TaskMutationParams } from '../../services/store/types.ts';\nimport { renderTaskCall, renderTaskResult } from '../../tui/format.ts';\nimport { DEFAULT_PROMPT_GUIDELINES } from './promptGuidelines.ts';\nimport { buildTextResult, buildToolResult, formatUpsertFailureText, type ToolResult } from './responseEnvelope.ts';\n\nexport { DEFAULT_PROMPT_GUIDELINES } from './promptGuidelines.ts';\n\nexport const DEFAULT_PROMPT_SNIPPET =\n 'Manage a shared task list to track multi-step progress, and delegate tasks to subagents';\n\nexport interface TaskToolDependencies {\n store: TaskStore;\n delegation: DelegationManager;\n onChange?: () => void;\n report?: TaskFailureReporter;\n}\n\nconst ACTION_ATTRIBUTE = 'tool.action';\nconst TASK_ID_ATTRIBUTE = 'task.id';\n\nconst REDUCER_ACTIONS = new Set<TaskAction>(['upsert', 'list', 'get', 'delete', 'clear']);\n\nclass TaskToolExecutionError extends Error {}\n\nfunction actionableTaskError(action: TaskAction, message: string): TaskToolExecutionError {\n return new TaskToolExecutionError(\n [\n `Task ${action} failed: ${message}`,\n '',\n 'Options:',\n '- List the task board and inspect the current ids, states, and blockers.',\n '- Correct the arguments or state conflict, then retry once.',\n '- Ask the user before cancelling work or changing dependencies to recover.',\n ].join('\\n'),\n );\n}\n\n/**\n * Reject a field that belongs to a different action.\n *\n * The params schema is flat and shared across every action, so this is the only\n * place `{\"action\":\"upsert\",\"id\":3}` can be caught — and it must be, because\n * the entry it carries has no id and would silently create a duplicate task.\n */\nfunction rejectStrayFields(action: TaskAction, params: TaskMutationParams): void {\n const stray = Object.keys(params).filter((key) => params[key] !== undefined && !taskActionAcceptsField(action, key));\n if (stray.length === 0) return;\n const hint = action === 'upsert' ? ` ${MSG_UPSERT_FIELD_MISPLACED}` : '';\n throw actionableTaskError(action, `${action} does not accept ${stray.join(', ')}.${hint}`);\n}\n\n/** Run an action through the reducer, persisting only when it produced a change. */\nasync function executeReducerAction(\n store: TaskStore,\n action: ReducerAction,\n params: TaskMutationParams,\n): Promise<ToolResult> {\n const { document, value } = await store.mutate((current) => {\n const result = applyTaskMutation(current, action, params);\n return {\n ...(isCommittingOp(result.op) ? { document: result.document } : {}),\n value: result,\n };\n });\n if (value.op.kind === 'error') throw actionableTaskError(action, value.op.message);\n // An upsert that applied nothing is a failed call: it wrote nothing and left\n // `rev` alone, so it must not read to the model as a success. A batch where\n // some entries landed returns normally — that is what partial apply means.\n if (value.op.kind === 'upsert' && value.op.applied === 0) {\n throw actionableTaskError(action, formatUpsertFailureText(value.op));\n }\n // `document` is the committed document, so `details.rev` matches what landed\n // on disk; `value.document` is the pre-write copy and lags by one.\n return buildToolResult(action, params, document, value.op);\n}\n\nexport function registerTaskTool(pi: ExtensionAPI, dependencies: TaskToolDependencies): void {\n const { store, delegation } = dependencies;\n\n pi.registerTool({\n name: TOOL_NAME,\n label: TOOL_LABEL,\n description:\n 'Manage a shared task list for tracking multi-step progress, and delegate tasks to subagents. Actions: upsert (write tasks — a tasks[] array where an entry with an id changes that task and an entry without an id creates one, so one call can capture a whole plan), list, get, delete (tombstone), clear (close/reset the list), assign (hand the task to a named subagent that works it in the background), cancel (stop a delegated run). upsert applies each entry independently: successes are committed and failures are reported by array index, and an entry can depend on a task created by an earlier entry in the same call via a ref. Batch when writing a plan down; report progress one task at a time. Status: pending → in_progress → completed, plus failed and a deleted tombstone. The list is shared within the current session tree, including delegated subagents, while unrelated sessions start empty. Session stores persist until retention cleanup.',\n promptSnippet: DEFAULT_PROMPT_SNIPPET,\n promptGuidelines: DEFAULT_PROMPT_GUIDELINES,\n parameters: TaskParamsSchema,\n\n async execute(_toolCallId, params, signal, onUpdate, _ctx) {\n const action = params.action as TaskAction;\n const mutationParams = params as TaskMutationParams;\n\n try {\n rejectStrayFields(action, mutationParams);\n if (REDUCER_ACTIONS.has(action)) {\n const result = await executeReducerAction(store, action as ReducerAction, mutationParams);\n dependencies.onChange?.();\n return result;\n }\n\n let outcome: DelegationOutcome;\n if (action === 'assign') {\n onUpdate?.(\n buildTextResult(\n action,\n mutationParams,\n store.snapshot,\n `Delegating task #${mutationParams.id ?? 'unknown'}...`,\n ),\n );\n outcome = await delegation.assign(mutationParams.id ?? Number.NaN, {\n agent: mutationParams.agent,\n inlineAgent: mutationParams.inlineAgent,\n instructions: mutationParams.instructions,\n relevantFiles: mutationParams.relevantFiles,\n priorFindings: mutationParams.priorFindings,\n model: mutationParams.model,\n context: mutationParams.context,\n signal,\n });\n } else {\n onUpdate?.(\n buildTextResult(\n action,\n mutationParams,\n store.snapshot,\n `Requesting cancellation for task #${mutationParams.id ?? 'unknown'}...`,\n ),\n );\n outcome = await delegation.cancel(mutationParams.id ?? Number.NaN);\n }\n\n dependencies.onChange?.();\n if (!outcome.ok) throw actionableTaskError(action, outcome.message);\n return buildTextResult(action, mutationParams, store.snapshot, outcome.message, undefined);\n } catch (error) {\n // Rethrown so pi still renders the failure to the model; recorded\n // because this is where a store fault becomes visible to the user.\n dependencies.report?.error(TASK_EVENT.toolFailed, error, {\n [ACTION_ATTRIBUTE]: action,\n ...(mutationParams.id === undefined ? {} : { [TASK_ID_ATTRIBUTE]: mutationParams.id }),\n });\n if (error instanceof TaskToolExecutionError) throw error;\n throw actionableTaskError(action, error instanceof Error ? error.message : String(error));\n }\n },\n\n // Render hooks receive no session identity, so they read the store snapshot\n // that the executing session last loaded. That is the foreground session's\n // own view, which is exactly what its transcript should show.\n renderCall(args, theme, _context) {\n return renderTaskCall(args as never, theme, store.snapshot.tasks);\n },\n\n renderResult(result, options, theme, _context) {\n return renderTaskResult(result, options, theme);\n },\n });\n}\n"],"mappings":"6PAmBa,EACX,0FAYI,EAAkB,IAAI,IAAgB,CAAC,SAAU,OAAQ,MAAO,SAAU,OAAO,CAAC,EAExF,IAAM,EAAN,cAAqC,KAAM,CAAC,EAE5C,SAAS,EAAoB,EAAoB,EAAyC,CACxF,OAAO,IAAI,EACT,CACE,QAAQ,EAAO,WAAW,IAC1B,GACA,WACA,2EACA,8DACA,4EACF,CAAC,CAAC,KAAK;CAAI,CACb,CACF,CASA,SAAS,EAAkB,EAAoB,EAAkC,CAC/E,IAAM,EAAQ,OAAO,KAAK,CAAM,CAAC,CAAC,OAAQ,GAAQ,EAAO,KAAS,IAAA,IAAa,CAACA,EAAAA,uBAAuB,EAAQ,CAAG,CAAC,EACnH,GAAI,EAAM,SAAW,EAAG,OACxB,IAAM,EAAO,IAAW,SAAW,IAAIC,EAAAA,6BAA+B,GACtE,MAAM,EAAoB,EAAQ,GAAG,EAAO,mBAAmB,EAAM,KAAK,IAAI,EAAE,GAAG,GAAM,CAC3F,CAGA,eAAe,EACb,EACA,EACA,EACqB,CACrB,GAAM,CAAE,WAAU,SAAU,MAAM,EAAM,OAAQ,GAAY,CAC1D,IAAM,EAASC,EAAAA,kBAAkB,EAAS,EAAQ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AAM,EAAW,OAAO,EAAe,IAAM,GAAU,GAGnE,EAAa,WAAW,EACpB,CAAC,EAAQ,GAAI,MAAM,EAAoB,EAAQ,EAAQ,OAAO,EAClE,OAAOA,EAAAA,gBAAgB,EAAQ,EAAgB,EAAM,SAAU,EAAQ,QAAS,IAAA,EAAS,CAC3F,OAAS,EAAO,CAQd,MALA,EAAa,QAAQ,MAAMC,EAAAA,WAAW,WAAY,EAAO,CACtD,cAAmB,EACpB,GAAI,EAAe,KAAO,IAAA,GAAY,CAAC,EAAI,CAAG,UAAoB,EAAe,EAAG,CACtF,CAAC,EACG,aAAiB,EAA8B,EAC7C,EAAoB,EAAQ,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,CAAC,CAC1F,CACF,EAKA,WAAW,EAAM,EAAO,EAAU,CAChC,OAAOC,EAAAA,eAAe,EAAe,EAAO,EAAM,SAAS,KAAK,CAClE,EAEA,aAAa,EAAQ,EAAS,EAAO,EAAU,CAC7C,OAAOC,EAAAA,iBAAiB,EAAQ,EAAS,CAAK,CAChD,CACF,CAAC,CACH"}
@@ -1,18 +0,0 @@
1
- import { TaskFailureReporter } from "../../adapters/telemetry/logSinkTelemetry.cjs";
2
- import { TaskStore } from "../../adapters/store/taskStore.cjs";
3
- import "../../services/store/taskStore.cjs";
4
- import { DelegationManager } from "../../services/delegation/manager.cjs";
5
- import { DEFAULT_PROMPT_GUIDELINES } from "./promptGuidelines.cjs";
6
- import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
7
- //#region src/commands/task/taskTool.d.ts
8
- declare const DEFAULT_PROMPT_SNIPPET = "Manage a shared task list to track multi-step progress, and delegate tasks to subagents";
9
- interface TaskToolDependencies {
10
- store: TaskStore;
11
- delegation: DelegationManager;
12
- onChange?: () => void;
13
- report?: TaskFailureReporter;
14
- }
15
- declare function registerTaskTool(pi: ExtensionAPI, dependencies: TaskToolDependencies): void;
16
- //#endregion
17
- export { DEFAULT_PROMPT_GUIDELINES, DEFAULT_PROMPT_SNIPPET, TaskToolDependencies, registerTaskTool };
18
- //# sourceMappingURL=taskTool.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taskTool.d.cts","names":[],"sources":["../../../src/commands/task/taskTool.ts"],"mappings":";;;;;;;cAmBa;UAGI;EACf,OAAO;EACP,YAAY;EACZ;EACA,SAAS;;iBA8DK,iBAAiB,IAAI,cAAc,cAAc"}
@@ -1,18 +0,0 @@
1
- import { TaskFailureReporter } from "../../adapters/telemetry/logSinkTelemetry.mjs";
2
- import { TaskStore } from "../../adapters/store/taskStore.mjs";
3
- import "../../services/store/taskStore.mjs";
4
- import { DelegationManager } from "../../services/delegation/manager.mjs";
5
- import { DEFAULT_PROMPT_GUIDELINES } from "./promptGuidelines.mjs";
6
- import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
7
- //#region src/commands/task/taskTool.d.ts
8
- declare const DEFAULT_PROMPT_SNIPPET = "Manage a shared task list to track multi-step progress, and delegate tasks to subagents";
9
- interface TaskToolDependencies {
10
- store: TaskStore;
11
- delegation: DelegationManager;
12
- onChange?: () => void;
13
- report?: TaskFailureReporter;
14
- }
15
- declare function registerTaskTool(pi: ExtensionAPI, dependencies: TaskToolDependencies): void;
16
- //#endregion
17
- export { DEFAULT_PROMPT_GUIDELINES, DEFAULT_PROMPT_SNIPPET, TaskToolDependencies, registerTaskTool };
18
- //# sourceMappingURL=taskTool.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taskTool.d.mts","names":[],"sources":["../../../src/commands/task/taskTool.ts"],"mappings":";;;;;;;cAmBa;UAGI;EACf,OAAO;EACP,YAAY;EACZ;EACA,SAAS;;iBA8DK,iBAAiB,IAAI,cAAc,cAAc"}
@@ -1,3 +0,0 @@
1
- import{TASK_EVENT as e}from"../../adapters/telemetry/logSinkTelemetry.mjs";import{MSG_UPSERT_FIELD_MISPLACED as t,TOOL_LABEL as n,TOOL_NAME as r,TaskParamsSchema as i,taskActionAcceptsField as a}from"../../schemas/task.mjs";import{applyTaskMutation as o,isCommittingOp as s}from"../../services/store/reducer.mjs";import{renderTaskCall as c,renderTaskResult as l}from"../../tui/format.mjs";import{DEFAULT_PROMPT_GUIDELINES as u}from"./promptGuidelines.mjs";import{buildTextResult as d,buildToolResult as f,formatUpsertFailureText as p}from"./responseEnvelope.mjs";const m=`Manage a shared task list to track multi-step progress, and delegate tasks to subagents`,h=new Set([`upsert`,`list`,`get`,`delete`,`clear`]);var g=class extends Error{};function _(e,t){return new g([`Task ${e} failed: ${t}`,``,`Options:`,`- List the task board and inspect the current ids, states, and blockers.`,`- Correct the arguments or state conflict, then retry once.`,`- Ask the user before cancelling work or changing dependencies to recover.`].join(`
2
- `))}function v(e,n){let r=Object.keys(n).filter(t=>n[t]!==void 0&&!a(e,t));if(r.length===0)return;let i=e===`upsert`?` ${t}`:``;throw _(e,`${e} does not accept ${r.join(`, `)}.${i}`)}async function y(e,t,n){let{document:r,value:i}=await e.mutate(e=>{let r=o(e,t,n);return{...s(r.op)?{document:r.document}:{},value:r}});if(i.op.kind===`error`)throw _(t,i.op.message);if(i.op.kind===`upsert`&&i.op.applied===0)throw _(t,p(i.op));return f(t,n,r,i.op)}function b(t,a){let{store:o,delegation:s}=a;t.registerTool({name:r,label:n,description:`Manage a shared task list for tracking multi-step progress, and delegate tasks to subagents. Actions: upsert (write tasks — a tasks[] array where an entry with an id changes that task and an entry without an id creates one, so one call can capture a whole plan), list, get, delete (tombstone), clear (close/reset the list), assign (hand the task to a named subagent that works it in the background), cancel (stop a delegated run). upsert applies each entry independently: successes are committed and failures are reported by array index, and an entry can depend on a task created by an earlier entry in the same call via a ref. Batch when writing a plan down; report progress one task at a time. Status: pending → in_progress → completed, plus failed and a deleted tombstone. The list is shared within the current session tree, including delegated subagents, while unrelated sessions start empty. Session stores persist until retention cleanup.`,promptSnippet:m,promptGuidelines:u,parameters:i,async execute(t,n,r,i,c){let l=n.action,u=n;try{if(v(l,u),h.has(l)){let e=await y(o,l,u);return a.onChange?.(),e}let e;if(l===`assign`?(i?.(d(l,u,o.snapshot,`Delegating task #${u.id??`unknown`}...`)),e=await s.assign(u.id??NaN,{agent:u.agent,inlineAgent:u.inlineAgent,instructions:u.instructions,relevantFiles:u.relevantFiles,priorFindings:u.priorFindings,model:u.model,context:u.context,signal:r})):(i?.(d(l,u,o.snapshot,`Requesting cancellation for task #${u.id??`unknown`}...`)),e=await s.cancel(u.id??NaN)),a.onChange?.(),!e.ok)throw _(l,e.message);return d(l,u,o.snapshot,e.message,void 0)}catch(t){throw a.report?.error(e.toolFailed,t,{"tool.action":l,...u.id===void 0?{}:{"task.id":u.id}}),t instanceof g?t:_(l,t instanceof Error?t.message:String(t))}},renderCall(e,t,n){return c(e,t,o.snapshot.tasks)},renderResult(e,t,n,r){return l(e,t,n)}})}export{u as DEFAULT_PROMPT_GUIDELINES,m as DEFAULT_PROMPT_SNIPPET,b as registerTaskTool};
3
- //# sourceMappingURL=taskTool.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taskTool.mjs","names":[],"sources":["../../../src/commands/task/taskTool.ts"],"sourcesContent":["import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport { TASK_EVENT, type TaskFailureReporter } from '../../adapters/telemetry/logSinkTelemetry.ts';\nimport {\n MSG_UPSERT_FIELD_MISPLACED,\n TaskParamsSchema,\n TOOL_LABEL,\n TOOL_NAME,\n taskActionAcceptsField,\n} from '../../schemas/task.ts';\nimport type { DelegationManager, DelegationOutcome } from '../../services/delegation/manager.ts';\nimport { applyTaskMutation, isCommittingOp, type ReducerAction } from '../../services/store/reducer.ts';\nimport type { TaskStore } from '../../services/store/taskStore.ts';\nimport type { TaskAction, TaskMutationParams } from '../../services/store/types.ts';\nimport { renderTaskCall, renderTaskResult } from '../../tui/format.ts';\nimport { DEFAULT_PROMPT_GUIDELINES } from './promptGuidelines.ts';\nimport { buildTextResult, buildToolResult, formatUpsertFailureText, type ToolResult } from './responseEnvelope.ts';\n\nexport { DEFAULT_PROMPT_GUIDELINES } from './promptGuidelines.ts';\n\nexport const DEFAULT_PROMPT_SNIPPET =\n 'Manage a shared task list to track multi-step progress, and delegate tasks to subagents';\n\nexport interface TaskToolDependencies {\n store: TaskStore;\n delegation: DelegationManager;\n onChange?: () => void;\n report?: TaskFailureReporter;\n}\n\nconst ACTION_ATTRIBUTE = 'tool.action';\nconst TASK_ID_ATTRIBUTE = 'task.id';\n\nconst REDUCER_ACTIONS = new Set<TaskAction>(['upsert', 'list', 'get', 'delete', 'clear']);\n\nclass TaskToolExecutionError extends Error {}\n\nfunction actionableTaskError(action: TaskAction, message: string): TaskToolExecutionError {\n return new TaskToolExecutionError(\n [\n `Task ${action} failed: ${message}`,\n '',\n 'Options:',\n '- List the task board and inspect the current ids, states, and blockers.',\n '- Correct the arguments or state conflict, then retry once.',\n '- Ask the user before cancelling work or changing dependencies to recover.',\n ].join('\\n'),\n );\n}\n\n/**\n * Reject a field that belongs to a different action.\n *\n * The params schema is flat and shared across every action, so this is the only\n * place `{\"action\":\"upsert\",\"id\":3}` can be caught — and it must be, because\n * the entry it carries has no id and would silently create a duplicate task.\n */\nfunction rejectStrayFields(action: TaskAction, params: TaskMutationParams): void {\n const stray = Object.keys(params).filter((key) => params[key] !== undefined && !taskActionAcceptsField(action, key));\n if (stray.length === 0) return;\n const hint = action === 'upsert' ? ` ${MSG_UPSERT_FIELD_MISPLACED}` : '';\n throw actionableTaskError(action, `${action} does not accept ${stray.join(', ')}.${hint}`);\n}\n\n/** Run an action through the reducer, persisting only when it produced a change. */\nasync function executeReducerAction(\n store: TaskStore,\n action: ReducerAction,\n params: TaskMutationParams,\n): Promise<ToolResult> {\n const { document, value } = await store.mutate((current) => {\n const result = applyTaskMutation(current, action, params);\n return {\n ...(isCommittingOp(result.op) ? { document: result.document } : {}),\n value: result,\n };\n });\n if (value.op.kind === 'error') throw actionableTaskError(action, value.op.message);\n // An upsert that applied nothing is a failed call: it wrote nothing and left\n // `rev` alone, so it must not read to the model as a success. A batch where\n // some entries landed returns normally — that is what partial apply means.\n if (value.op.kind === 'upsert' && value.op.applied === 0) {\n throw actionableTaskError(action, formatUpsertFailureText(value.op));\n }\n // `document` is the committed document, so `details.rev` matches what landed\n // on disk; `value.document` is the pre-write copy and lags by one.\n return buildToolResult(action, params, document, value.op);\n}\n\nexport function registerTaskTool(pi: ExtensionAPI, dependencies: TaskToolDependencies): void {\n const { store, delegation } = dependencies;\n\n pi.registerTool({\n name: TOOL_NAME,\n label: TOOL_LABEL,\n description:\n 'Manage a shared task list for tracking multi-step progress, and delegate tasks to subagents. Actions: upsert (write tasks — a tasks[] array where an entry with an id changes that task and an entry without an id creates one, so one call can capture a whole plan), list, get, delete (tombstone), clear (close/reset the list), assign (hand the task to a named subagent that works it in the background), cancel (stop a delegated run). upsert applies each entry independently: successes are committed and failures are reported by array index, and an entry can depend on a task created by an earlier entry in the same call via a ref. Batch when writing a plan down; report progress one task at a time. Status: pending → in_progress → completed, plus failed and a deleted tombstone. The list is shared within the current session tree, including delegated subagents, while unrelated sessions start empty. Session stores persist until retention cleanup.',\n promptSnippet: DEFAULT_PROMPT_SNIPPET,\n promptGuidelines: DEFAULT_PROMPT_GUIDELINES,\n parameters: TaskParamsSchema,\n\n async execute(_toolCallId, params, signal, onUpdate, _ctx) {\n const action = params.action as TaskAction;\n const mutationParams = params as TaskMutationParams;\n\n try {\n rejectStrayFields(action, mutationParams);\n if (REDUCER_ACTIONS.has(action)) {\n const result = await executeReducerAction(store, action as ReducerAction, mutationParams);\n dependencies.onChange?.();\n return result;\n }\n\n let outcome: DelegationOutcome;\n if (action === 'assign') {\n onUpdate?.(\n buildTextResult(\n action,\n mutationParams,\n store.snapshot,\n `Delegating task #${mutationParams.id ?? 'unknown'}...`,\n ),\n );\n outcome = await delegation.assign(mutationParams.id ?? Number.NaN, {\n agent: mutationParams.agent,\n inlineAgent: mutationParams.inlineAgent,\n instructions: mutationParams.instructions,\n relevantFiles: mutationParams.relevantFiles,\n priorFindings: mutationParams.priorFindings,\n model: mutationParams.model,\n context: mutationParams.context,\n signal,\n });\n } else {\n onUpdate?.(\n buildTextResult(\n action,\n mutationParams,\n store.snapshot,\n `Requesting cancellation for task #${mutationParams.id ?? 'unknown'}...`,\n ),\n );\n outcome = await delegation.cancel(mutationParams.id ?? Number.NaN);\n }\n\n dependencies.onChange?.();\n if (!outcome.ok) throw actionableTaskError(action, outcome.message);\n return buildTextResult(action, mutationParams, store.snapshot, outcome.message, undefined);\n } catch (error) {\n // Rethrown so pi still renders the failure to the model; recorded\n // because this is where a store fault becomes visible to the user.\n dependencies.report?.error(TASK_EVENT.toolFailed, error, {\n [ACTION_ATTRIBUTE]: action,\n ...(mutationParams.id === undefined ? {} : { [TASK_ID_ATTRIBUTE]: mutationParams.id }),\n });\n if (error instanceof TaskToolExecutionError) throw error;\n throw actionableTaskError(action, error instanceof Error ? error.message : String(error));\n }\n },\n\n // Render hooks receive no session identity, so they read the store snapshot\n // that the executing session last loaded. That is the foreground session's\n // own view, which is exactly what its transcript should show.\n renderCall(args, theme, _context) {\n return renderTaskCall(args as never, theme, store.snapshot.tasks);\n },\n\n renderResult(result, options, theme, _context) {\n return renderTaskResult(result, options, theme);\n },\n });\n}\n"],"mappings":"mjBAmBA,MAAa,EACX,0FAYI,EAAkB,IAAI,IAAgB,CAAC,SAAU,OAAQ,MAAO,SAAU,OAAO,CAAC,EAExF,IAAM,EAAN,cAAqC,KAAM,CAAC,EAE5C,SAAS,EAAoB,EAAoB,EAAyC,CACxF,OAAO,IAAI,EACT,CACE,QAAQ,EAAO,WAAW,IAC1B,GACA,WACA,2EACA,8DACA,4EACF,CAAC,CAAC,KAAK;CAAI,CACb,CACF,CASA,SAAS,EAAkB,EAAoB,EAAkC,CAC/E,IAAM,EAAQ,OAAO,KAAK,CAAM,CAAC,CAAC,OAAQ,GAAQ,EAAO,KAAS,IAAA,IAAa,CAAC,EAAuB,EAAQ,CAAG,CAAC,EACnH,GAAI,EAAM,SAAW,EAAG,OACxB,IAAM,EAAO,IAAW,SAAW,IAAI,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Ae,cAC9B,MAAO,EAAe,MACtB,QAAS,EAAe,QACxB,QACF,CAAC,IAED,IACE,EACE,EACA,EACA,EAAM,SACN,qCAAqC,EAAe,IAAM,UAAU,IACtE,CACF,EACA,EAAU,MAAM,EAAW,OAAO,EAAe,IAAM,GAAU,GAGnE,EAAa,WAAW,EACpB,CAAC,EAAQ,GAAI,MAAM,EAAoB,EAAQ,EAAQ,OAAO,EAClE,OAAO,EAAgB,EAAQ,EAAgB,EAAM,SAAU,EAAQ,QAAS,IAAA,EAAS,CAC3F,OAAS,EAAO,CAQd,MALA,EAAa,QAAQ,MAAM,EAAW,WAAY,EAAO,CACtD,cAAmB,EACpB,GAAI,EAAe,KAAO,IAAA,GAAY,CAAC,EAAI,CAAG,UAAoB,EAAe,EAAG,CACtF,CAAC,EACG,aAAiB,EAA8B,EAC7C,EAAoB,EAAQ,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,CAAC,CAC1F,CACF,EAKA,WAAW,EAAM,EAAO,EAAU,CAChC,OAAO,EAAe,EAAe,EAAO,EAAM,SAAS,KAAK,CAClE,EAEA,aAAa,EAAQ,EAAS,EAAO,EAAU,CAC7C,OAAO,EAAiB,EAAQ,EAAS,CAAK,CAChD,CACF,CAAC,CACH"}
@@ -1,2 +0,0 @@
1
- import { registerTasksCommand } from "./commands/index.cjs";
2
- export { registerTasksCommand };
package/dist/config.d.cts DELETED
@@ -1,2 +0,0 @@
1
- import { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey } from "./types/config.cjs";
2
- export { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey };
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../services/delegation/manager.cjs");exports.BACKGROUND_WORK_PROVIDER=e.BACKGROUND_WORK_PROVIDER,exports.DelegationManager=e.DelegationManager,exports.ERR_CANCEL_UNACKNOWLEDGED=e.ERR_CANCEL_UNACKNOWLEDGED,exports.ERR_CHILD_SESSION=e.ERR_CHILD_SESSION,exports.ERR_NO_RUNTIME=e.ERR_NO_RUNTIME,exports.MAX_BRIEF_FILES=e.MAX_BRIEF_FILES,exports.NOTIFY_CUSTOM_TYPE=e.NOTIFY_CUSTOM_TYPE;
@@ -1,2 +0,0 @@
1
- import { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, MAX_BRIEF_FILES, NOTIFY_CUSTOM_TYPE } from "../services/delegation/manager.cjs";
2
- export { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, MAX_BRIEF_FILES, NOTIFY_CUSTOM_TYPE };
@@ -1,2 +0,0 @@
1
- import { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, MAX_BRIEF_FILES, NOTIFY_CUSTOM_TYPE } from "../services/delegation/manager.mjs";
2
- export { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, MAX_BRIEF_FILES, NOTIFY_CUSTOM_TYPE };
@@ -1 +0,0 @@
1
- import{BACKGROUND_WORK_PROVIDER as e,DelegationManager as t,ERR_CANCEL_UNACKNOWLEDGED as n,ERR_CHILD_SESSION as r,ERR_NO_RUNTIME as i,MAX_BRIEF_FILES as a,NOTIFY_CUSTOM_TYPE as o}from"../services/delegation/manager.mjs";export{e as BACKGROUND_WORK_PROVIDER,t as DelegationManager,n as ERR_CANCEL_UNACKNOWLEDGED,r as ERR_CHILD_SESSION,i as ERR_NO_RUNTIME,a as MAX_BRIEF_FILES,o as NOTIFY_CUSTOM_TYPE};
@@ -1 +0,0 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./adapters/pi/extension.cjs");exports.default=e.default,exports.taskExtension=e.default;
@@ -1,2 +0,0 @@
1
- import taskExtension from "./adapters/pi/extension.cjs";
2
- export { taskExtension as default, taskExtension };
@@ -1,2 +0,0 @@
1
- import taskExtension from "./adapters/pi/extension.mjs";
2
- export { taskExtension as default, taskExtension };
@@ -1 +0,0 @@
1
- import e from"./adapters/pi/extension.mjs";export{e as default,e as taskExtension};
@@ -1,2 +0,0 @@
1
- const e=require("../adapters/pi/extension.cjs");function t(t){e.default(t)}module.exports=t;
2
- //# sourceMappingURL=doom.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doom.cjs","names":[],"sources":["../../src/extensions/doom.ts"],"sourcesContent":["import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport { taskExtension } from '../adapters/pi/extension.ts';\n\n/** Explicit adapter for Doom hosts. Standard Pi discovery remains in pi.ts. */\nexport default function doomTaskExtension(pi: ExtensionAPI): void {\n taskExtension(pi);\n}\n"],"mappings":"gDAIA,SAAwB,EAAkB,EAAwB,CAChE,EAAA,QAAc,CAAE,CAClB"}
@@ -1,6 +0,0 @@
1
- import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
- //#region src/extensions/doom.d.ts
3
- /** Explicit adapter for Doom hosts. Standard Pi discovery remains in pi.ts. */
4
- declare function doomTaskExtension(pi: ExtensionAPI): void;
5
- export = doomTaskExtension;
6
- //# sourceMappingURL=doom.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doom.d.cts","names":[],"sources":["../../src/extensions/doom.ts"],"mappings":";;;iBAIwB,kBAAkB,IAAI"}
@@ -1,7 +0,0 @@
1
- import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
- //#region src/extensions/doom.d.ts
3
- /** Explicit adapter for Doom hosts. Standard Pi discovery remains in pi.ts. */
4
- declare function doomTaskExtension(pi: ExtensionAPI): void;
5
- //#endregion
6
- export { doomTaskExtension as default };
7
- //# sourceMappingURL=doom.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doom.d.mts","names":[],"sources":["../../src/extensions/doom.ts"],"mappings":";;;iBAIwB,kBAAkB,IAAI"}
@@ -1,2 +0,0 @@
1
- import e from"../adapters/pi/extension.mjs";function t(t){e(t)}export{t as default};
2
- //# sourceMappingURL=doom.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doom.mjs","names":[],"sources":["../../src/extensions/doom.ts"],"sourcesContent":["import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\nimport { taskExtension } from '../adapters/pi/extension.ts';\n\n/** Explicit adapter for Doom hosts. Standard Pi discovery remains in pi.ts. */\nexport default function doomTaskExtension(pi: ExtensionAPI): void {\n taskExtension(pi);\n}\n"],"mappings":"4CAIA,SAAwB,EAAkB,EAAwB,CAChE,EAAc,CAAE,CAClB"}
@@ -1,2 +0,0 @@
1
- import taskExtension from "../adapters/pi/extension.cjs";
2
- export = taskExtension;
package/dist/index.d.cts DELETED
@@ -1,16 +0,0 @@
1
- import { DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive } from "./services/store/types.cjs";
2
- import { TaskStore, TaskStoreCommitListener, TaskStoreOptions } from "./adapters/store/taskStore.cjs";
3
- import "./services/store/taskStore.cjs";
4
- import { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey } from "./types/config.cjs";
5
- import { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, MAX_BRIEF_FILES, NOTIFY_CUSTOM_TYPE } from "./services/delegation/manager.cjs";
6
- import taskExtension from "./adapters/pi/extension.cjs";
7
- import { ApplyResult, MAX_UPSERT_ITEMS, Op, REF_PATTERN, ReducerAction, applyTaskMutation, formatUpsertFailure, isCommittingOp, singleItemOutcome } from "./services/store/reducer.cjs";
8
- import { MSG_ALL_COMPLETE_CLEAR, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildTextResult, buildToolResult, formatContent, formatUpsertFailureText } from "./commands/task/responseEnvelope.cjs";
9
- import { DEFAULT_PROMPT_GUIDELINES } from "./commands/task/promptGuidelines.cjs";
10
- import { DEFAULT_PROMPT_SNIPPET, TaskToolDependencies, registerTaskTool } from "./commands/task/taskTool.cjs";
11
- import { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE, MSG_NO_TASKS, MSG_UPSERT_FIELD_MISPLACED, TASK_ACTIONS, TASK_ACTION_FIELDS, TASK_CONTEXTS, TASK_STATUSES, TOOL_LABEL, TOOL_NAME, TaskItemParams, TaskItemSchema, TaskParams, TaskParamsSchema, taskActionAcceptsField } from "./schemas/task.cjs";
12
- import { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, sweepStoreFiles, sweepStoreFilesAsync, tempPathFor } from "./adapters/store/paths.cjs";
13
- import { ERR_ORPHANED_BY_RESTART, ERR_ORPHANED_BY_SESSION, ReconcileResult, ReconcileSelf, reconcileOrphanedDelegations } from "./services/store/reconcile.cjs";
14
- import { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers } from "./services/store/taskGraph.cjs";
15
- import { OverlayLayout, TaskCounts, TaskGroups, TaskProjection, countTasks, deriveTaskProjection, groupTasks, hasActiveWork, selectOverlayLayout, selectOverlayLayoutFromProjection, shouldShowIds, visibleTasks } from "./tui/selectors.cjs";
16
- export { ApplyResult, AssignOptions, BACKGROUND_WORK_PROVIDER, COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, COMMAND_NAME, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_PROMPT_GUIDELINES, DEFAULT_PROMPT_SNIPPET, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, DELETED_STATUS, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationProgress, DelegationResult, DelegationState, DepToken, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, ERR_ORPHANED_BY_RESTART, ERR_ORPHANED_BY_SESSION, ERR_REQUIRES_INTERACTIVE, MAX_BRIEF_FILES, MAX_UPSERT_ITEMS, MAX_WIDGET_LINES_ENV, MSG_ALL_COMPLETE_CLEAR, MSG_NO_TASKS, MSG_UPSERT_FIELD_MISPLACED, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, NOTIFY_CUSTOM_TYPE, Op, OverlayLayout, PiTaskConfig, REF_PATTERN, ReconcileResult, ReconcileSelf, ReducerAction, STORE_PATH_ENV, STORE_SCHEMA_VERSION, STORE_TTL_MS_ENV, type StoreSweepResult, TASK_ACTIONS, TASK_ACTION_FIELDS, TASK_CONTEXTS, TASK_STATUSES, TOOL_LABEL, TOOL_NAME, Task, TaskAction, TaskCounts, TaskDelegation, TaskDetails, TaskDocument, TaskGroups, TaskItemMutation, TaskItemParams, TaskItemSchema, TaskMutationParams, TaskParams, TaskParamsSchema, TaskProjection, TaskStatus, TaskStore, type TaskStoreCommitListener, type TaskStoreOptions, TaskToolDependencies, ToolResult, UpsertItemOutcome, UpsertSummary, applyTaskMutation, buildTextResult, buildToolResult, countTasks, deriveBlocks, deriveTaskProjection, detectCycle, emptyDocument, formatContent, formatUpsertFailure, formatUpsertFailureText, getDelegationTimeoutMs, getMaxWidgetLines, getStoreTtlMs, groupTasks, hasActiveWork, hasStorePathOverride, isBlocked, isCommittingOp, isDelegationActive, isTaskListComplete, lockPathFor, parsePiTaskConfig, reconcileOrphanedDelegations, registerTaskTool, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveCollapseKey, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, selectOverlayLayout, selectOverlayLayoutFromProjection, shouldShowIds, singleItemOutcome, sweepStoreFiles, sweepStoreFilesAsync, taskActionAcceptsField, taskExtension, tempPathFor, unresolvedBlockers, visibleTasks };
@@ -1,2 +0,0 @@
1
- import { TASK_EVENT, TaskErrorAttributes, TaskErrorReporter, TaskErrorReporterOptions, TaskErrorSink, TaskEventName, TaskEventSink, TaskFailureReporter, createTaskErrorReporter, toFailureReporter } from "./adapters/telemetry/logSinkTelemetry.cjs";
2
- export { TASK_EVENT, TaskErrorAttributes, TaskErrorReporter, TaskErrorReporterOptions, TaskErrorSink, TaskEventName, TaskEventSink, TaskFailureReporter, createTaskErrorReporter, toFailureReporter };
@@ -1,2 +0,0 @@
1
- require("../services/delegation/manager.cjs");let e=require("@agimon-ai/doompi-extension-contracts/subagent-tool"),t=require("typebox");const n=[`upsert`,`list`,`get`,`delete`,`clear`,`assign`,`cancel`],r=[`pending`,`in_progress`,`completed`,`failed`,`deleted`],i=[`fresh`,`fork`],a={upsert:[`action`,`tasks`],list:[`action`,`status`,`includeDeleted`],get:[`action`,`id`],delete:[`action`,`id`],clear:[`action`],assign:[`action`,`id`,`agent`,`inlineAgent`,`instructions`,`relevantFiles`,`priorFindings`,`model`,`context`],cancel:[`action`,`id`]};function o(e,t){return a[e].includes(t)}const s=t.Type.Union([t.Type.Integer(),t.Type.String()]),c=t.Type.Object({id:t.Type.Optional(t.Type.Integer({description:`Existing task id to change. Omit to create a new task. An entry with an id never creates: if the id is unknown, only that entry fails.`})),ref:t.Type.Optional(t.Type.String({description:`Temporary name for a task created by this entry, so a LATER entry in the same tasks[] can list it in blockedBy before its real id exists. Must start with a letter. Scoped to this one call and never stored; the response reports which real id it became.`})),subject:t.Type.Optional(t.Type.String({description:`Short imperative subject line (e.g. 'Research existing tool'). Required when the entry has no id; on an entry with an id it renames the task.`})),description:t.Type.Optional(t.Type.String({description:`Long-form task detail. This becomes the brief handed to the subagent when the task is assigned.`})),activeForm:t.Type.Optional(t.Type.String({description:`Present-continuous spinner label shown while status is in_progress (e.g. 'writing tests')`})),status:t.Type.Optional(t.Type.String({enum:[...r],description:`Starting status for a new entry (default pending; deleted is rejected), or the target status for an entry with an id, where the transition must be legal.`})),blockedBy:t.Type.Optional(t.Type.Array(s,{description:`Dependencies for a NEW entry (one with no id): this task is blocked by each target. A number is an existing task id; a string is the ref of a task created by an EARLIER entry in this same array. Use addBlockedBy / removeBlockedBy on an entry that has an id.`})),addBlockedBy:t.Type.Optional(t.Type.Array(s,{description:`Dependencies to add, for an entry with an id. Task ids, or refs declared by an earlier entry. Additive merge — do not resend the full array.`})),removeBlockedBy:t.Type.Optional(t.Type.Array(s,{description:`Dependencies to remove, for an entry with an id. Additive merge — do not resend the full array.`})),owner:t.Type.Optional(t.Type.String({description:`Owner label for this task. assign sets this to the subagent name automatically.`})),metadata:t.Type.Optional(t.Type.Record(t.Type.String(),t.Type.Unknown(),{description:`Arbitrary metadata merged into the task; pass null as a value to delete that key`}))},{additionalProperties:!1}),l=t.Type.Object({action:t.Type.String({enum:[...n],description:`upsert (create new tasks and change existing ones, one or many per call), list, get, delete (tombstone), clear (close/reset the list), assign (delegate to a subagent), cancel (stop a delegated run)`}),tasks:t.Type.Optional(t.Type.Array(c,{minItems:1,description:`upsert only. One entry per task: an entry with an id changes that task, an entry without an id creates one. Entries apply in array order, so a later entry can depend on an earlier one by ref. Each entry succeeds or fails on its own: the ones that succeed are committed and the ones that fail are reported by their array index.`})),id:t.Type.Optional(t.Type.Integer({description:`Task id, for get, delete, assign and cancel. upsert does not accept this field — put the id inside the tasks[] entry you want to change.`})),status:t.Type.Optional(t.Type.String({enum:[...r],description:`list only: return just the tasks in this status. To SET a status, use upsert with the task id inside tasks[].`})),includeDeleted:t.Type.Optional(t.Type.Boolean({description:`If true, list returns deleted (tombstoned) tasks as well. Default: false.`})),agent:t.Type.Optional(t.Type.String({description:`Name of the subagent to delegate this task to (required for assign)`})),inlineAgent:t.Type.Optional(e.InlineAgentSchema),instructions:t.Type.Optional(t.Type.String({description:`Extra instructions appended to the delegated brief (assign only)`})),relevantFiles:t.Type.Optional(t.Type.Array(t.Type.String(),{description:`Files you have ALREADY read or located that the subagent should open first (assign only). Paths relative to the working directory. A child starts with none of your context and otherwise spends most of its run rediscovering the repo. Send only files you actually looked at — a guessed path costs the child more than an omitted one. At most 12; extras are dropped.`})),priorFindings:t.Type.Optional(t.Type.String({description:`What you already established about this task and the subagent should not re-derive (assign only): symbol names, call sites, the approach you chose, what you already ruled out. Facts you discovered, not directives — put directives in instructions. Keep it to a few lines; it is truncated past ~1500 characters.`})),model:t.Type.Optional(t.Type.String({description:`Model override for the delegated run (assign only)`})),context:t.Type.Optional(t.Type.String({enum:[...i],description:`Subagent starting context (assign only): 'fresh' starts clean, 'fork' inherits this conversation. If omitted, uses the agent default, then fresh.`}))});exports.COMMAND_NAME=`tasks`,exports.ERR_REQUIRES_INTERACTIVE=`/tasks requires interactive mode`,exports.MSG_NO_TASKS=`No tasks yet. Ask the agent to add some!`,exports.MSG_UPSERT_FIELD_MISPLACED=`Per-task fields belong inside each tasks[] entry, not at the top level: {"action":"upsert","tasks":[{"id":3,"status":"completed"}]}.`,exports.TASK_ACTIONS=n,exports.TASK_ACTION_FIELDS=a,exports.TASK_CONTEXTS=i,exports.TASK_STATUSES=r,exports.TOOL_LABEL=`Task`,exports.TOOL_NAME=`task`,exports.TaskItemSchema=c,exports.TaskParamsSchema=l,exports.taskActionAcceptsField=o;
2
- //# sourceMappingURL=task.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task.cjs","names":["Type","InlineAgentSchema"],"sources":["../../src/schemas/task.ts"],"sourcesContent":["import { InlineAgentSchema } from '@agimon-ai/doompi-extension-contracts/subagent-tool';\nimport { type Static, Type } from 'typebox';\nimport { MAX_BRIEF_FILES } from '../services/delegation/manager.ts';\nimport type { TaskAction } from '../services/store/types.ts';\n\nexport const TASK_ACTIONS = ['upsert', 'list', 'get', 'delete', 'clear', 'assign', 'cancel'] as const;\nexport const TASK_STATUSES = ['pending', 'in_progress', 'completed', 'failed', 'deleted'] as const;\nexport const TASK_CONTEXTS = ['fresh', 'fork'] as const;\n\nexport const TOOL_NAME = 'task';\nexport const TOOL_LABEL = 'Task';\nexport const COMMAND_NAME = 'tasks';\n\nexport const ERR_REQUIRES_INTERACTIVE = '/tasks requires interactive mode';\nexport const MSG_NO_TASKS = 'No tasks yet. Ask the agent to add some!';\n\n/**\n * Which top-level fields each action accepts.\n *\n * The params object is flat and shared across every action, so the schema alone\n * cannot express \"upsert has no top-level id\". That gap matters: a call like\n * `{\"action\":\"upsert\",\"id\":3,\"tasks\":[{\"status\":\"completed\"}]}` would otherwise\n * silently create a duplicate task, because the entry itself carries no id.\n */\nexport const TASK_ACTION_FIELDS = {\n upsert: ['action', 'tasks'],\n list: ['action', 'status', 'includeDeleted'],\n get: ['action', 'id'],\n delete: ['action', 'id'],\n clear: ['action'],\n assign: [\n 'action',\n 'id',\n 'agent',\n 'inlineAgent',\n 'instructions',\n 'relevantFiles',\n 'priorFindings',\n 'model',\n 'context',\n ],\n cancel: ['action', 'id'],\n} as const satisfies Record<TaskAction, readonly string[]>;\n\nexport function taskActionAcceptsField(action: TaskAction, field: string): boolean {\n return (TASK_ACTION_FIELDS[action] as readonly string[]).includes(field);\n}\n\n/** Correction hint appended when a per-task field lands at the top level. */\nexport const MSG_UPSERT_FIELD_MISPLACED =\n 'Per-task fields belong inside each tasks[] entry, not at the top level: {\"action\":\"upsert\",\"tasks\":[{\"id\":3,\"status\":\"completed\"}]}.';\n\n/**\n * A dependency target: an existing task id, or the `ref` of a task created\n * earlier in the same call.\n */\nconst DepTokenSchema = Type.Union([Type.Integer(), Type.String()]);\n\n/**\n * One entry of an upsert. `additionalProperties: false` is load-bearing: pi\n * validates tool arguments against this schema before `execute` runs, so a\n * stray `{\"action\":\"update\"}` inside an entry is rejected at the boundary.\n */\nexport const TaskItemSchema = Type.Object(\n {\n id: Type.Optional(\n Type.Integer({\n description:\n 'Existing task id to change. Omit to create a new task. An entry with an id never creates: if the id is unknown, only that entry fails.',\n }),\n ),\n ref: Type.Optional(\n Type.String({\n description:\n 'Temporary name for a task created by this entry, so a LATER entry in the same tasks[] can list it in blockedBy before its real id exists. Must start with a letter. Scoped to this one call and never stored; the response reports which real id it became.',\n }),\n ),\n subject: Type.Optional(\n Type.String({\n description:\n \"Short imperative subject line (e.g. 'Research existing tool'). Required when the entry has no id; on an entry with an id it renames the task.\",\n }),\n ),\n description: Type.Optional(\n Type.String({\n description: 'Long-form task detail. This becomes the brief handed to the subagent when the task is assigned.',\n }),\n ),\n activeForm: Type.Optional(\n Type.String({\n description: \"Present-continuous spinner label shown while status is in_progress (e.g. 'writing tests')\",\n }),\n ),\n status: Type.Optional(\n Type.String({\n enum: [...TASK_STATUSES],\n description:\n 'Starting status for a new entry (default pending; deleted is rejected), or the target status for an entry with an id, where the transition must be legal.',\n }),\n ),\n blockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description:\n 'Dependencies for a NEW entry (one with no id): this task is blocked by each target. A number is an existing task id; a string is the ref of a task created by an EARLIER entry in this same array. Use addBlockedBy / removeBlockedBy on an entry that has an id.',\n }),\n ),\n addBlockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description:\n 'Dependencies to add, for an entry with an id. Task ids, or refs declared by an earlier entry. Additive merge — do not resend the full array.',\n }),\n ),\n removeBlockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description: 'Dependencies to remove, for an entry with an id. Additive merge — do not resend the full array.',\n }),\n ),\n owner: Type.Optional(\n Type.String({ description: 'Owner label for this task. assign sets this to the subagent name automatically.' }),\n ),\n metadata: Type.Optional(\n Type.Record(Type.String(), Type.Unknown(), {\n description: 'Arbitrary metadata merged into the task; pass null as a value to delete that key',\n }),\n ),\n },\n { additionalProperties: false },\n);\n\n/**\n * Tool parameters. Every `description` doubles as LLM-facing prompt copy, so\n * wording changes here change model behaviour.\n */\nexport const TaskParamsSchema = Type.Object({\n action: Type.String({\n enum: [...TASK_ACTIONS],\n description:\n 'upsert (create new tasks and change existing ones, one or many per call), list, get, delete (tombstone), clear (close/reset the list), assign (delegate to a subagent), cancel (stop a delegated run)',\n }),\n tasks: Type.Optional(\n Type.Array(TaskItemSchema, {\n minItems: 1,\n description:\n 'upsert only. One entry per task: an entry with an id changes that task, an entry without an id creates one. Entries apply in array order, so a later entry can depend on an earlier one by ref. Each entry succeeds or fails on its own: the ones that succeed are committed and the ones that fail are reported by their array index.',\n }),\n ),\n id: Type.Optional(\n Type.Integer({\n description:\n 'Task id, for get, delete, assign and cancel. upsert does not accept this field — put the id inside the tasks[] entry you want to change.',\n }),\n ),\n status: Type.Optional(\n Type.String({\n enum: [...TASK_STATUSES],\n description:\n 'list only: return just the tasks in this status. To SET a status, use upsert with the task id inside tasks[].',\n }),\n ),\n includeDeleted: Type.Optional(\n Type.Boolean({\n description: 'If true, list returns deleted (tombstoned) tasks as well. Default: false.',\n }),\n ),\n agent: Type.Optional(\n Type.String({\n description: 'Name of the subagent to delegate this task to (required for assign)',\n }),\n ),\n inlineAgent: Type.Optional(InlineAgentSchema),\n instructions: Type.Optional(\n Type.String({\n description: 'Extra instructions appended to the delegated brief (assign only)',\n }),\n ),\n relevantFiles: Type.Optional(\n Type.Array(Type.String(), {\n description: `Files you have ALREADY read or located that the subagent should open first (assign only). Paths relative to the working directory. A child starts with none of your context and otherwise spends most of its run rediscovering the repo. Send only files you actually looked at — a guessed path costs the child more than an omitted one. At most ${MAX_BRIEF_FILES}; extras are dropped.`,\n }),\n ),\n priorFindings: Type.Optional(\n Type.String({\n description:\n 'What you already established about this task and the subagent should not re-derive (assign only): symbol names, call sites, the approach you chose, what you already ruled out. Facts you discovered, not directives — put directives in instructions. Keep it to a few lines; it is truncated past ~1500 characters.',\n }),\n ),\n model: Type.Optional(Type.String({ description: 'Model override for the delegated run (assign only)' })),\n context: Type.Optional(\n Type.String({\n enum: [...TASK_CONTEXTS],\n description:\n \"Subagent starting context (assign only): 'fresh' starts clean, 'fork' inherits this conversation. If omitted, uses the agent default, then fresh.\",\n }),\n ),\n});\n\nexport type TaskItemParams = Static<typeof TaskItemSchema>;\nexport type TaskParams = Static<typeof TaskParamsSchema>;\n"],"mappings":"wIAKA,MAAa,EAAe,CAAC,SAAU,OAAQ,MAAO,SAAU,QAAS,S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AO,CACV,YACE,uTACJ,CAAC,CACH,EACA,MAAOA,EAAAA,KAAK,SAASA,EAAAA,KAAK,OAAO,CAAE,YAAa,oDAAqD,CAAC,CAAC,EACvG,QAASA,EAAAA,KAAK,SACZA,EAAAA,KAAK,OAAO,CACV,KAAM,CAAC,GAAG,CAAa,EACvB,YACE,mJACJ,CAAC,CACH,CACF,CAAC"}
@@ -1,86 +0,0 @@
1
- import { TaskAction } from "../services/store/types.cjs";
2
- import { Static, Type } from "typebox";
3
- //#region src/schemas/task.d.ts
4
- declare const TASK_ACTIONS: readonly ["upsert", "list", "get", "delete", "clear", "assign", "cancel"];
5
- declare const TASK_STATUSES: readonly ["pending", "in_progress", "completed", "failed", "deleted"];
6
- declare const TASK_CONTEXTS: readonly ["fresh", "fork"];
7
- declare const TOOL_NAME = "task";
8
- declare const TOOL_LABEL = "Task";
9
- declare const COMMAND_NAME = "tasks";
10
- declare const ERR_REQUIRES_INTERACTIVE = "/tasks requires interactive mode";
11
- declare const MSG_NO_TASKS = "No tasks yet. Ask the agent to add some!";
12
- /**
13
- * Which top-level fields each action accepts.
14
- *
15
- * The params object is flat and shared across every action, so the schema alone
16
- * cannot express "upsert has no top-level id". That gap matters: a call like
17
- * `{"action":"upsert","id":3,"tasks":[{"status":"completed"}]}` would otherwise
18
- * silently create a duplicate task, because the entry itself carries no id.
19
- */
20
- declare const TASK_ACTION_FIELDS: {
21
- readonly upsert: readonly ["action", "tasks"];
22
- readonly list: readonly ["action", "status", "includeDeleted"];
23
- readonly get: readonly ["action", "id"];
24
- readonly delete: readonly ["action", "id"];
25
- readonly clear: readonly ["action"];
26
- readonly assign: readonly ["action", "id", "agent", "inlineAgent", "instructions", "relevantFiles", "priorFindings", "model", "context"];
27
- readonly cancel: readonly ["action", "id"];
28
- };
29
- declare function taskActionAcceptsField(action: TaskAction, field: string): boolean;
30
- /** Correction hint appended when a per-task field lands at the top level. */
31
- declare const MSG_UPSERT_FIELD_MISPLACED = "Per-task fields belong inside each tasks[] entry, not at the top level: {\"action\":\"upsert\",\"tasks\":[{\"id\":3,\"status\":\"completed\"}]}.";
32
- /**
33
- * One entry of an upsert. `additionalProperties: false` is load-bearing: pi
34
- * validates tool arguments against this schema before `execute` runs, so a
35
- * stray `{"action":"update"}` inside an entry is rejected at the boundary.
36
- */
37
- declare const TaskItemSchema: Type.TObject<{
38
- id: Type.TOptional<Type.TInteger>;
39
- ref: Type.TOptional<Type.TString>;
40
- subject: Type.TOptional<Type.TString>;
41
- description: Type.TOptional<Type.TString>;
42
- activeForm: Type.TOptional<Type.TString>;
43
- status: Type.TOptional<Type.TString>;
44
- blockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
45
- addBlockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
46
- removeBlockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
47
- owner: Type.TOptional<Type.TString>;
48
- metadata: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
49
- }>;
50
- /**
51
- * Tool parameters. Every `description` doubles as LLM-facing prompt copy, so
52
- * wording changes here change model behaviour.
53
- */
54
- declare const TaskParamsSchema: Type.TObject<{
55
- action: Type.TString;
56
- tasks: Type.TOptional<Type.TArray<Type.TObject<{
57
- id: Type.TOptional<Type.TInteger>;
58
- ref: Type.TOptional<Type.TString>;
59
- subject: Type.TOptional<Type.TString>;
60
- description: Type.TOptional<Type.TString>;
61
- activeForm: Type.TOptional<Type.TString>;
62
- status: Type.TOptional<Type.TString>;
63
- blockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
64
- addBlockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
65
- removeBlockedBy: Type.TOptional<Type.TArray<Type.TUnion<[Type.TInteger, Type.TString]>>>;
66
- owner: Type.TOptional<Type.TString>;
67
- metadata: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
68
- }>>>;
69
- id: Type.TOptional<Type.TInteger>;
70
- status: Type.TOptional<Type.TString>;
71
- includeDeleted: Type.TOptional<Type.TBoolean>;
72
- agent: Type.TOptional<Type.TString>;
73
- inlineAgent: Type.TOptional<Type.TObject<{
74
- systemPrompt: Type.TString;
75
- }>>;
76
- instructions: Type.TOptional<Type.TString>;
77
- relevantFiles: Type.TOptional<Type.TArray<Type.TString>>;
78
- priorFindings: Type.TOptional<Type.TString>;
79
- model: Type.TOptional<Type.TString>;
80
- context: Type.TOptional<Type.TString>;
81
- }>;
82
- type TaskItemParams = Static<typeof TaskItemSchema>;
83
- type TaskParams = Static<typeof TaskParamsSchema>;
84
- //#endregion
85
- export { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE, MSG_NO_TASKS, MSG_UPSERT_FIELD_MISPLACED, TASK_ACTIONS, TASK_ACTION_FIELDS, TASK_CONTEXTS, TASK_STATUSES, TOOL_LABEL, TOOL_NAME, TaskItemParams, TaskItemSchema, TaskParams, TaskParamsSchema, taskActionAcceptsField };
86
- //# sourceMappingURL=task.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task.d.cts","names":[],"sources":["../../src/schemas/task.ts"],"mappings":";;;cAKa;cACA;cACA;cAEA;cACA;cACA;cAEA;cACA;;;;;;;;;cAUA;;;;;;;;;iBAoBG,uBAAuB,QAAQ,YAAY;;cAK9C;;;;;;cAcA,gBAAc,KAAA;;;;;;;;;;;;;;;;;cAsEd,kBAAgB,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+DjB,iBAAiB,cAAc;KAC/B,aAAa,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"task.d.mts","names":[],"sources":["../../src/schemas/task.ts"],"mappings":";;;cAKa;cACA;cACA;cAEA;cACA;cACA;cAEA;cACA;;;;;;;;;cAUA;;;;;;;;;iBAoBG,uBAAuB,QAAQ,YAAY;;cAK9C;;;;;;cAcA,gBAAc,KAAA;;;;;;;;;;;;;;;;;cAsEd,kBAAgB,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+DjB,iBAAiB,cAAc;KAC/B,aAAa,cAAc"}
@@ -1,2 +0,0 @@
1
- import"../services/delegation/manager.mjs";import{InlineAgentSchema as e}from"@agimon-ai/doompi-extension-contracts/subagent-tool";import{Type as t}from"typebox";const n=[`upsert`,`list`,`get`,`delete`,`clear`,`assign`,`cancel`],r=[`pending`,`in_progress`,`completed`,`failed`,`deleted`],i=[`fresh`,`fork`],a=`task`,o=`Task`,s=`tasks`,c=`/tasks requires interactive mode`,l=`No tasks yet. Ask the agent to add some!`,u={upsert:[`action`,`tasks`],list:[`action`,`status`,`includeDeleted`],get:[`action`,`id`],delete:[`action`,`id`],clear:[`action`],assign:[`action`,`id`,`agent`,`inlineAgent`,`instructions`,`relevantFiles`,`priorFindings`,`model`,`context`],cancel:[`action`,`id`]};function d(e,t){return u[e].includes(t)}const f=`Per-task fields belong inside each tasks[] entry, not at the top level: {"action":"upsert","tasks":[{"id":3,"status":"completed"}]}.`,p=t.Union([t.Integer(),t.String()]),m=t.Object({id:t.Optional(t.Integer({description:`Existing task id to change. Omit to create a new task. An entry with an id never creates: if the id is unknown, only that entry fails.`})),ref:t.Optional(t.String({description:`Temporary name for a task created by this entry, so a LATER entry in the same tasks[] can list it in blockedBy before its real id exists. Must start with a letter. Scoped to this one call and never stored; the response reports which real id it became.`})),subject:t.Optional(t.String({description:`Short imperative subject line (e.g. 'Research existing tool'). Required when the entry has no id; on an entry with an id it renames the task.`})),description:t.Optional(t.String({description:`Long-form task detail. This becomes the brief handed to the subagent when the task is assigned.`})),activeForm:t.Optional(t.String({description:`Present-continuous spinner label shown while status is in_progress (e.g. 'writing tests')`})),status:t.Optional(t.String({enum:[...r],description:`Starting status for a new entry (default pending; deleted is rejected), or the target status for an entry with an id, where the transition must be legal.`})),blockedBy:t.Optional(t.Array(p,{description:`Dependencies for a NEW entry (one with no id): this task is blocked by each target. A number is an existing task id; a string is the ref of a task created by an EARLIER entry in this same array. Use addBlockedBy / removeBlockedBy on an entry that has an id.`})),addBlockedBy:t.Optional(t.Array(p,{description:`Dependencies to add, for an entry with an id. Task ids, or refs declared by an earlier entry. Additive merge — do not resend the full array.`})),removeBlockedBy:t.Optional(t.Array(p,{description:`Dependencies to remove, for an entry with an id. Additive merge — do not resend the full array.`})),owner:t.Optional(t.String({description:`Owner label for this task. assign sets this to the subagent name automatically.`})),metadata:t.Optional(t.Record(t.String(),t.Unknown(),{description:`Arbitrary metadata merged into the task; pass null as a value to delete that key`}))},{additionalProperties:!1}),h=t.Object({action:t.String({enum:[...n],description:`upsert (create new tasks and change existing ones, one or many per call), list, get, delete (tombstone), clear (close/reset the list), assign (delegate to a subagent), cancel (stop a delegated run)`}),tasks:t.Optional(t.Array(m,{minItems:1,description:`upsert only. One entry per task: an entry with an id changes that task, an entry without an id creates one. Entries apply in array order, so a later entry can depend on an earlier one by ref. Each entry succeeds or fails on its own: the ones that succeed are committed and the ones that fail are reported by their array index.`})),id:t.Optional(t.Integer({description:`Task id, for get, delete, assign and cancel. upsert does not accept this field — put the id inside the tasks[] entry you want to change.`})),status:t.Optional(t.String({enum:[...r],description:`list only: return just the tasks in this status. To SET a status, use upsert with the task id inside tasks[].`})),includeDeleted:t.Optional(t.Boolean({description:`If true, list returns deleted (tombstoned) tasks as well. Default: false.`})),agent:t.Optional(t.String({description:`Name of the subagent to delegate this task to (required for assign)`})),inlineAgent:t.Optional(e),instructions:t.Optional(t.String({description:`Extra instructions appended to the delegated brief (assign only)`})),relevantFiles:t.Optional(t.Array(t.String(),{description:`Files you have ALREADY read or located that the subagent should open first (assign only). Paths relative to the working directory. A child starts with none of your context and otherwise spends most of its run rediscovering the repo. Send only files you actually looked at — a guessed path costs the child more than an omitted one. At most 12; extras are dropped.`})),priorFindings:t.Optional(t.String({description:`What you already established about this task and the subagent should not re-derive (assign only): symbol names, call sites, the approach you chose, what you already ruled out. Facts you discovered, not directives — put directives in instructions. Keep it to a few lines; it is truncated past ~1500 characters.`})),model:t.Optional(t.String({description:`Model override for the delegated run (assign only)`})),context:t.Optional(t.String({enum:[...i],description:`Subagent starting context (assign only): 'fresh' starts clean, 'fork' inherits this conversation. If omitted, uses the agent default, then fresh.`}))});export{s as COMMAND_NAME,c as ERR_REQUIRES_INTERACTIVE,l as MSG_NO_TASKS,f as MSG_UPSERT_FIELD_MISPLACED,n as TASK_ACTIONS,u as TASK_ACTION_FIELDS,i as TASK_CONTEXTS,r as TASK_STATUSES,o as TOOL_LABEL,a as TOOL_NAME,m as TaskItemSchema,h as TaskParamsSchema,d as taskActionAcceptsField};
2
- //# sourceMappingURL=task.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"task.mjs","names":[],"sources":["../../src/schemas/task.ts"],"sourcesContent":["import { InlineAgentSchema } from '@agimon-ai/doompi-extension-contracts/subagent-tool';\nimport { type Static, Type } from 'typebox';\nimport { MAX_BRIEF_FILES } from '../services/delegation/manager.ts';\nimport type { TaskAction } from '../services/store/types.ts';\n\nexport const TASK_ACTIONS = ['upsert', 'list', 'get', 'delete', 'clear', 'assign', 'cancel'] as const;\nexport const TASK_STATUSES = ['pending', 'in_progress', 'completed', 'failed', 'deleted'] as const;\nexport const TASK_CONTEXTS = ['fresh', 'fork'] as const;\n\nexport const TOOL_NAME = 'task';\nexport const TOOL_LABEL = 'Task';\nexport const COMMAND_NAME = 'tasks';\n\nexport const ERR_REQUIRES_INTERACTIVE = '/tasks requires interactive mode';\nexport const MSG_NO_TASKS = 'No tasks yet. Ask the agent to add some!';\n\n/**\n * Which top-level fields each action accepts.\n *\n * The params object is flat and shared across every action, so the schema alone\n * cannot express \"upsert has no top-level id\". That gap matters: a call like\n * `{\"action\":\"upsert\",\"id\":3,\"tasks\":[{\"status\":\"completed\"}]}` would otherwise\n * silently create a duplicate task, because the entry itself carries no id.\n */\nexport const TASK_ACTION_FIELDS = {\n upsert: ['action', 'tasks'],\n list: ['action', 'status', 'includeDeleted'],\n get: ['action', 'id'],\n delete: ['action', 'id'],\n clear: ['action'],\n assign: [\n 'action',\n 'id',\n 'agent',\n 'inlineAgent',\n 'instructions',\n 'relevantFiles',\n 'priorFindings',\n 'model',\n 'context',\n ],\n cancel: ['action', 'id'],\n} as const satisfies Record<TaskAction, readonly string[]>;\n\nexport function taskActionAcceptsField(action: TaskAction, field: string): boolean {\n return (TASK_ACTION_FIELDS[action] as readonly string[]).includes(field);\n}\n\n/** Correction hint appended when a per-task field lands at the top level. */\nexport const MSG_UPSERT_FIELD_MISPLACED =\n 'Per-task fields belong inside each tasks[] entry, not at the top level: {\"action\":\"upsert\",\"tasks\":[{\"id\":3,\"status\":\"completed\"}]}.';\n\n/**\n * A dependency target: an existing task id, or the `ref` of a task created\n * earlier in the same call.\n */\nconst DepTokenSchema = Type.Union([Type.Integer(), Type.String()]);\n\n/**\n * One entry of an upsert. `additionalProperties: false` is load-bearing: pi\n * validates tool arguments against this schema before `execute` runs, so a\n * stray `{\"action\":\"update\"}` inside an entry is rejected at the boundary.\n */\nexport const TaskItemSchema = Type.Object(\n {\n id: Type.Optional(\n Type.Integer({\n description:\n 'Existing task id to change. Omit to create a new task. An entry with an id never creates: if the id is unknown, only that entry fails.',\n }),\n ),\n ref: Type.Optional(\n Type.String({\n description:\n 'Temporary name for a task created by this entry, so a LATER entry in the same tasks[] can list it in blockedBy before its real id exists. Must start with a letter. Scoped to this one call and never stored; the response reports which real id it became.',\n }),\n ),\n subject: Type.Optional(\n Type.String({\n description:\n \"Short imperative subject line (e.g. 'Research existing tool'). Required when the entry has no id; on an entry with an id it renames the task.\",\n }),\n ),\n description: Type.Optional(\n Type.String({\n description: 'Long-form task detail. This becomes the brief handed to the subagent when the task is assigned.',\n }),\n ),\n activeForm: Type.Optional(\n Type.String({\n description: \"Present-continuous spinner label shown while status is in_progress (e.g. 'writing tests')\",\n }),\n ),\n status: Type.Optional(\n Type.String({\n enum: [...TASK_STATUSES],\n description:\n 'Starting status for a new entry (default pending; deleted is rejected), or the target status for an entry with an id, where the transition must be legal.',\n }),\n ),\n blockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description:\n 'Dependencies for a NEW entry (one with no id): this task is blocked by each target. A number is an existing task id; a string is the ref of a task created by an EARLIER entry in this same array. Use addBlockedBy / removeBlockedBy on an entry that has an id.',\n }),\n ),\n addBlockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description:\n 'Dependencies to add, for an entry with an id. Task ids, or refs declared by an earlier entry. Additive merge — do not resend the full array.',\n }),\n ),\n removeBlockedBy: Type.Optional(\n Type.Array(DepTokenSchema, {\n description: 'Dependencies to remove, for an entry with an id. Additive merge — do not resend the full array.',\n }),\n ),\n owner: Type.Optional(\n Type.String({ description: 'Owner label for this task. assign sets this to the subagent name automatically.' }),\n ),\n metadata: Type.Optional(\n Type.Record(Type.String(), Type.Unknown(), {\n description: 'Arbitrary metadata merged into the task; pass null as a value to delete that key',\n }),\n ),\n },\n { additionalProperties: false },\n);\n\n/**\n * Tool parameters. Every `description` doubles as LLM-facing prompt copy, so\n * wording changes here change model behaviour.\n */\nexport const TaskParamsSchema = Type.Object({\n action: Type.String({\n enum: [...TASK_ACTIONS],\n description:\n 'upsert (create new tasks and change existing ones, one or many per call), list, get, delete (tombstone), clear (close/reset the list), assign (delegate to a subagent), cancel (stop a delegated run)',\n }),\n tasks: Type.Optional(\n Type.Array(TaskItemSchema, {\n minItems: 1,\n description:\n 'upsert only. One entry per task: an entry with an id changes that task, an entry without an id creates one. Entries apply in array order, so a later entry can depend on an earlier one by ref. Each entry succeeds or fails on its own: the ones that succeed are committed and the ones that fail are reported by their array index.',\n }),\n ),\n id: Type.Optional(\n Type.Integer({\n description:\n 'Task id, for get, delete, assign and cancel. upsert does not accept this field — put the id inside the tasks[] entry you want to change.',\n }),\n ),\n status: Type.Optional(\n Type.String({\n enum: [...TASK_STATUSES],\n description:\n 'list only: return just the tasks in this status. To SET a status, use upsert with the task id inside tasks[].',\n }),\n ),\n includeDeleted: Type.Optional(\n Type.Boolean({\n description: 'If true, list returns deleted (tombstoned) tasks as well. Default: false.',\n }),\n ),\n agent: Type.Optional(\n Type.String({\n description: 'Name of the subagent to delegate this task to (required for assign)',\n }),\n ),\n inlineAgent: Type.Optional(InlineAgentSchema),\n instructions: Type.Optional(\n Type.String({\n description: 'Extra instructions appended to the delegated brief (assign only)',\n }),\n ),\n relevantFiles: Type.Optional(\n Type.Array(Type.String(), {\n description: `Files you have ALREADY read or located that the subagent should open first (assign only). Paths relative to the working directory. A child starts with none of your context and otherwise spends most of its run rediscovering the repo. Send only files you actually looked at — a guessed path costs the child more than an omitted one. At most ${MAX_BRIEF_FILES}; extras are dropped.`,\n }),\n ),\n priorFindings: Type.Optional(\n Type.String({\n description:\n 'What you already established about this task and the subagent should not re-derive (assign only): symbol names, call sites, the approach you chose, what you already ruled out. Facts you discovered, not directives — put directives in instructions. Keep it to a few lines; it is truncated past ~1500 characters.',\n }),\n ),\n model: Type.Optional(Type.String({ description: 'Model override for the delegated run (assign only)' })),\n context: Type.Optional(\n Type.String({\n enum: [...TASK_CONTEXTS],\n description:\n \"Subagent starting context (assign only): 'fresh' starts clean, 'fork' inherits this conversation. If omitted, uses the agent default, then fresh.\",\n }),\n ),\n});\n\nexport type TaskItemParams = Static<typeof TaskItemSchema>;\nexport type TaskParams = Static<typeof TaskParamsSchema>;\n"],"mappings":"kKAKA,MAAa,EAAe,CAAC,SAAU,OAAQ,MAAO,SAAU,QAAS,SAAU,QAAQ,EAC9E,EAAgB,CAAC,UAAW,cAAe,YAAa,SAAU,SAAS,EAC3E,EAAgB,CAAC,QAAS,MAAM,EAEhC,EAAY,OACZ,EAAa,OACb,EAAe,QAEf,EAA2B,mCAC3B,EAAe,2CAUf,EAAqB,CAChC,OAAQ,CAAC,SAAU,OAAO,EAC1B,KAAM,CAAC,SAAU,SAAU,gBAAgB,EAC3C,IAAK,CAAC,SAAU,IAAI,EACpB,OAAQ,CAAC,SAAU,IAAI,EACvB,MAAO,CAAC,QAAQ,EAChB,OAAQ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AK,SACV,EAAK,MAAM,EAAgB,CACzB,SAAU,EACV,YACE,wUACJ,CAAC,CACH,EACA,GAAI,EAAK,SACP,EAAK,QAAQ,CACX,YACE,0IACJ,CAAC,CACH,EACA,OAAQ,EAAK,SACX,EAAK,OAAO,CACV,KAAM,CAAC,GAAG,CAAa,EACvB,YACE,+GACJ,CAAC,CACH,EACA,eAAgB,EAAK,SACnB,EAAK,QAAQ,CACX,YAAa,2EACf,CAAC,CACH,EACA,MAAO,EAAK,SACV,EAAK,OAAO,CACV,YAAa,qEACf,CAAC,CACH,EACA,YAAa,EAAK,SAAS,CAAiB,EAC5C,aAAc,EAAK,SACjB,EAAK,OAAO,CACV,YAAa,kEACf,CAAC,CACH,EACA,cAAe,EAAK,SAClB,EAAK,MAAM,EAAK,OAAO,EAAG,CACxB,YAAa,4WACf,CAAC,CACH,EACA,cAAe,EAAK,SAClB,EAAK,OAAO,CACV,YACE,uTACJ,CAAC,CACH,EACA,MAAO,EAAK,SAAS,EAAK,OAAO,CAAE,YAAa,oDAAqD,CAAC,CAAC,EACvG,QAAS,EAAK,SACZ,EAAK,OAAO,CACV,KAAM,CAAC,GAAG,CAAa,EACvB,YACE,mJACJ,CAAC,CACH,CACF,CAAC"}
@@ -1,6 +0,0 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../adapters/telemetry/logSinkTelemetry.cjs"),n=require("../store/types.cjs"),r=require("../store/reconcile.cjs"),i=require("../store/taskGraph.cjs");let a=require("@agimon-ai/doompi-extension-contracts/protocol"),o=require("node:crypto"),s=require("node:path");s=e.__toESM(s,1);let c=require("@agimon-ai/doompi-extension-contracts/delegation");const l=`doom-task-notify`,u=`completed`,d=`failed`,f=`cancelled`,p=`task.id`,m=`delegation.request_id`,h=`delegation.agent_name`,g=`delegation.context_present`,_=`delegation.context_file_count`,v=`delegation.context_notes_length`,y=`No subagent runtime responded. Delegation needs the subagents extension — relaunch doom-pi with agents enabled.`,b=`assign is only available in the main session. Update this task directly instead of re-delegating it.`,x=`Subagent did not acknowledge the cancel request`;function S(e,t=4e3){if(e)return e.length<=t?e:`${e.slice(0,t)}\n… (truncated)`}function C(e){return e instanceof Error?e.message:String(e)}function w(e,t){if(!s.default.isAbsolute(e))return s.default.normalize(e);let n=s.default.relative(t,e);return n&&!n.startsWith(`..`)?n:e}function T(e,t){let n=new Set;for(let r of e.relevantFiles??[]){if(n.size>=12)break;let e=w(r.trim(),t);e&&e!==`.`&&n.add(e)}return{files:[...n],notes:S(e.priorFindings?.trim(),1500)}}function E(e,t,n){let r=[`Task #${e.id}: ${e.subject}`];if(e.description&&r.push(e.description),t&&r.push(t),n.files.length>0||n.notes){let e=[`Parent context — consume before repository discovery:`];n.files.length>0&&e.push(`- Parent-verified files (read these first with direct reads): ${n.files.join(`, `)}`),n.notes&&e.push(`- Established facts (do not re-derive unless direct evidence contradicts them): ${n.notes}`),e.push(`This pack satisfies initial repository/context exploration. Do not begin with repository-wide listing, find, or grep. Expand only after consuming the pack and naming a concrete missing dependency or invalid path; search narrowly for that item and state why.`),r.push(e.join(`
2
- `))}return r.push(`Coordination: work directly without changing the task record; ask main through intercom only for blockers or decisions; report changed files and verification when done.`),r.join(`
3
-
4
- `)}var D=class e{options;progress=new Map;pendingTasks=new Map;timers=new Map;subscriptions=[];protocol;constructor(e){this.options=e}now(){return this.options.now?.()??new Date().toISOString()}nowMs(){return this.options.nowMs?.()??Date.now()}get env(){return this.options.env??process.env}get runTimeoutMs(){return this.options.runTimeoutMs??12e5}report(e,t,n){this.options.report?.error(e,t,n)}get isChildSession(){return!!this.env.PI_SUBAGENT_CHILD}progressFor(e){let t=e.delegation?.requestId;return t?this.progress.get(t):void 0}static elapsedMs(e,t=Date.now()){let n=e.durationMs??0,r=e.durationObservedAt??t;return n+Math.max(0,t-r)}start(){if(this.subscriptions.length>0)return;let e=this.options.getSessionId?.();e&&(this.protocol=(0,a.createProtocolRuntime)({bus:this.options.events,source:`@agimon-ai/doompi-task`,sessionId:e}),this.subscriptions.push(this.protocol.onNotification(c.DelegationAccepted,e=>{this.handleAccepted(e)}),this.protocol.onNotification(c.DelegationStarted,e=>{this.handleStarted(e)}),this.protocol.onNotification(c.DelegationUpdated,e=>{this.handleUpdate(e)}),this.protocol.onNotification(c.DelegationFinished,e=>{this.handleResponse(e).catch(n=>{this.report(t.TASK_EVENT.delegationResponseFailed,n,{[m]:e.requestId})})})))}listActiveWork(){let e=this.options.getSessionId?.()??``;return[...this.pendingTasks.entries()].map(([t,n])=>({id:`task-${n}:${t}`,sessionId:e}))}async reconcile(){let{value:e}=await this.options.store.mutate(e=>{let t=r.reconcileOrphanedDelegations(e,this.now(),void 0,{pid:process.pid,liveRequestIds:new Set(this.pendingTasks.keys())});return t.orphaned.length===0?{value:[]}:{document:t.document,value:t.orphaned}});for(let n of e)this.options.report?.warn(t.TASK_EVENT.delegationOrphaned,Error(n.delegation?.result?.error??``),{[p]:n.id,...n.delegation?.agent?{[h]:n.delegation.agent}:{},...n.delegation?.pid===void 0?{}:{"delegation.pid":n.delegation.pid}});return e.length>0&&this.options.onChange?.(),e}async assign(e,r){let a=r.agent?.trim();if(!a)return{ok:!1,message:`agent required for assign`};if(this.isChildSession)return{ok:!1,message:b};if(r.signal?.aborted)return{ok:!1,message:`delegation cancelled before it started`};let s=(0,o.randomUUID)(),l=this.now(),f=T(r,this.options.cwd),{value:x}=await this.options.store.mutate(t=>{let o=t.tasks.findIndex(t=>t.id===e);if(o===-1)return{value:{ok:!1,message:`#${e} not found`}};let c=t.tasks[o];if(c.status===`deleted`)return{value:{ok:!1,message:`#${e} is deleted`}};if(c.status===u)return{value:{ok:!1,message:`#${e} is already completed`}};if(n.isDelegationActive(c))return{value:{ok:!1,message:`#${e} is already delegated to ${c.delegation?.agent}`}};if(i.isBlocked(t.tasks,c))return{value:{ok:!1,message:`#${e} is blocked by ${(c.blockedBy??[]).map(e=>`#${e}`).join(`, `)}`}};let d={requestId:s,agent:a,state:`requested`,pid:process.pid,startedAt:l,...this.options.getSessionId?.()?{sessionId:this.options.getSessionId()}:{},...r.model?{model:r.model}:{}},f=[...t.tasks];return f[o]={...c,owner:a,updatedAt:l,delegation:d},{document:{...t,tasks:f},value:{ok:!0,message:``,task:f[o]}}});if(!x.ok||!x.task)return{ok:!1,message:x.message};let S=f.notes?.length??0;this.pendingTasks.set(s,e),this.progress.set(s,{agent:a,contextFileCount:f.files.length,contextNotesLength:S}),this.armStartedTimeout(s);let w={requestId:s,taskId:e,agent:a,...r.inlineAgent?{inlineAgent:r.inlineAgent}:{},prompt:E(x.task,r.instructions,f),...r.context?{context:r.context}:{},cwd:this.options.cwd,artifacts:!0,timeoutMs:this.runTimeoutMs,runMode:`detached`,teamTask:{id:String(x.task.id),subject:x.task.subject},...r.model?{model:r.model}:{}};try{if(!this.protocol)throw Error(y);this.protocol.notify(c.DelegationRequested,w)}catch(n){this.report(t.TASK_EVENT.delegationRequestFailed,n,{[p]:e,[m]:s,[h]:a});let r=C(n);return await this.settle(s,d,{status:d,error:`Delegation request failed: ${r}`}),{ok:!1,message:`Could not dispatch #${e} to ${a}: ${r}`}}return this.options.report?.event(t.TASK_EVENT.delegationAssigned,{[p]:e,[m]:s,[h]:a,[g]:f.files.length>0||S>0,[_]:f.files.length,[v]:S,"delegation.brief_length":w.prompt.length}),this.options.onChange?.(),{ok:!0,message:`Delegated #${e} to ${a} in the background. It runs independently of this turn and will notify you when it finishes. Continue non-overlapping work, or end your turn.`}}async cancel(e){let t=this.options.store.read().tasks.find(t=>t.id===e);if(!t)return{ok:!1,message:`#${e} not found`};if(!t.delegation||!n.isDelegationActive(t))return{ok:!1,message:`#${e} has no running delegation`};let{requestId:r}=t.delegation;return this.protocol?.notify(c.DelegationCancelled,{requestId:r}),this.armCancelTimeout(r),{ok:!0,message:`Cancelling delegation for #${e} (${t.delegation.agent})`}}settleDetached(e,n,r,i=t.TASK_EVENT.delegationSettleFailed){this.settle(e,n,r).catch(t=>{this.report(i,t,{[m]:e})})}armStartedTimeout(e){this.armTimer(e,this.options.startedTimeoutMs??5e3,()=>{this.settleDetached(e,d,{status:d,error:y})})}armRunTimeout(e){let n=Math.min(6e4,this.runTimeoutMs);this.armTimer(e,this.runTimeoutMs+n,()=>{let n=this.pendingTasks.get(e),r=this.progress.get(e)?.agent,i=Error(`Delegation produced no result within ${this.runTimeoutMs}ms`);this.options.report?.warn(t.TASK_EVENT.delegationTimedOut,i,{...n===void 0?{}:{[p]:n},[m]:e,...r?{[h]:r}:{}}),this.protocol?.notify(c.DelegationCancelled,{requestId:e,reason:i.message}),this.settleDetached(e,d,{status:`timed_out`,error:i.message})})}armCancelTimeout(e){this.pendingTasks.has(e)&&this.armTimer(e,this.options.cancelTimeoutMs??1e4,()=>{this.settleDetached(e,f,{status:f,error:x})})}armTimer(e,t,n){this.clearTimer(e);let r=setTimeout(n,t);r.unref?.(),this.timers.set(e,r)}clearTimer(e){let t=this.timers.get(e);t&&clearTimeout(t),this.timers.delete(e)}handleAccepted(e){this.pendingTasks.has(e.requestId)&&this.armRunTimeout(e.requestId)}handleStarted(e){let{runId:n}=e,r=this.pendingTasks.get(e.requestId);if(r===void 0)return;this.armRunTimeout(e.requestId);let i=this.progress.get(e.requestId);i&&this.progress.set(e.requestId,{...i,durationMs:i.durationMs??0,durationObservedAt:i.durationObservedAt??this.nowMs()}),this.options.store.mutate(t=>this.patchDelegation(t,e.requestId,(e,t)=>({...e,status:e.status===u?e.status:`in_progress`,delegation:{...t,state:`running`,startedAt:t.startedAt??this.now(),...n?{runId:n}:{}}}))).then(()=>this.options.onChange?.()).catch(n=>{this.report(t.TASK_EVENT.delegationStartFailed,n,{[p]:r,[m]:e.requestId})})}handleUpdate(t){let n=this.progress.get(t.requestId);if(!n)return;let r=this.nowMs(),i=e.elapsedMs(n,r),a=t.durationMs!==void 0;this.progress.set(t.requestId,{...n,currentTool:t.currentTool??n.currentTool,toolCount:t.toolCount===void 0?n.toolCount:Math.max(n.toolCount??0,t.toolCount),tokens:t.tokens===void 0?n.tokens:Math.max(n.tokens??0,t.tokens),durationMs:a?Math.max(i,t.durationMs):n.durationMs,durationObservedAt:a?r:n.durationObservedAt}),this.options.onChange?.()}async handleResponse(e){if(!this.pendingTasks.has(e.requestId))return;let t=e.status===u&&!e.error?u:e.status===f?f:d;await this.settle(e.requestId,t,{status:e.status,error:e.error,output:S(e.output),outputPath:e.outputPath,sessionFile:e.sessionFile,durationMs:e.durationMs,toolCount:e.toolCount})}async settle(e,n,r){let a=this.pendingTasks.get(e);if(a===void 0)return;this.pendingTasks.delete(e),this.clearTimer(e);let o=this.progress.get(e);this.progress.delete(e);let s=this.now(),c;try{let{value:t}=await this.options.store.mutate(t=>this.patchDelegation(t,e,(e,t)=>({...e,status:n===u?u:n===f?`pending`:d,updatedAt:s,delegation:{...t,state:n,endedAt:s,...r?{result:r}:{}}})));c=t}catch(n){this.report(t.TASK_EVENT.delegationSettleFailed,n,{[p]:a,[m]:e})}this.options.onChange?.();let l=c?.delegation?.agent??o?.agent??`subagent`,y=c?.subject??`#${a}`;this.options.report?.event(t.TASK_EVENT.delegationCompleted,{[p]:a,[m]:e,[h]:l,"delegation.outcome":n,[g]:(o?.contextFileCount??0)>0||(o?.contextNotesLength??0)>0,[_]:o?.contextFileCount??0,[v]:o?.contextNotesLength??0,...r?.toolCount===void 0?{}:{"delegation.tool_count":r.toolCount},...r?.durationMs===void 0?{}:{"delegation.duration_ms":r.durationMs}});let b=n===u&&c!==void 0&&i.isTaskListComplete(this.options.store.snapshot.tasks);this.notifyModel(n,a,y,l,r,b)}notifyModel(e,t,n,r,i,a){let o=this.options.notify;if(!o)return;let s=[e===u?`Subagent ${r} completed task #${t}: ${n}`:e===f?`Subagent ${r} was cancelled on task #${t}: ${n} (returned to pending)`:`Subagent ${r} failed task #${t}: ${n}`];a&&s.push(``,`All tasks are completed. Review the full task list once more, then close it with task {"action":"clear"}.`),i?.error&&s.push(`Error: ${i.error}`),i?.output&&s.push(``,i.output),i?.outputPath&&s.push(``,`Full output: ${i.outputPath}`);try{o({customType:l,content:s.join(`
5
- `),display:!0},{triggerTurn:!0,deliverAs:`steer`})}catch(e){this.options.onNotifyError(e,t)}}patchDelegation(e,t,r){let i=e.tasks.findIndex(e=>e.delegation?.requestId===t);if(i===-1)return{value:void 0};let a=e.tasks[i];if(!n.isDelegationActive(a))return{value:a};let o=r(a,a.delegation);if(o===a)return{value:a};let s=[...e.tasks];return s[i]=o,{document:{...e,tasks:s},value:o}}dispose(){for(let e of this.subscriptions)e();this.subscriptions.length=0,this.protocol=void 0;for(let e of this.timers.values())clearTimeout(e);this.timers.clear(),this.pendingTasks.clear(),this.progress.clear()}};exports.BACKGROUND_WORK_PROVIDER=`doom-task`,exports.DelegationManager=D,exports.ERR_CANCEL_UNACKNOWLEDGED=x,exports.ERR_CHILD_SESSION=b,exports.ERR_NO_RUNTIME=y,exports.MAX_BRIEF_FILES=12,exports.NOTIFY_CUSTOM_TYPE=l;
6
- //# sourceMappingURL=manager.cjs.map