@agimon-ai/doompi-task 0.0.1-alpha.4 → 0.0.1-alpha.40

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 (399) hide show
  1. package/README.md +110 -15
  2. package/dist/adapters/node/delegationPlatform.cjs +2 -0
  3. package/dist/adapters/node/delegationPlatform.cjs.map +1 -0
  4. package/dist/adapters/node/delegationPlatform.mjs +2 -0
  5. package/dist/adapters/node/delegationPlatform.mjs.map +1 -0
  6. package/dist/adapters/pi/extension.cjs +3 -0
  7. package/dist/adapters/pi/extension.cjs.map +1 -0
  8. package/dist/adapters/pi/extension.d.cts +10 -0
  9. package/dist/adapters/pi/extension.d.cts.map +1 -0
  10. package/dist/adapters/pi/extension.d.mts +10 -0
  11. package/dist/adapters/pi/extension.d.mts.map +1 -0
  12. package/dist/adapters/pi/extension.mjs +3 -0
  13. package/dist/adapters/pi/extension.mjs.map +1 -0
  14. package/dist/adapters/store/paths.cjs +2 -0
  15. package/dist/adapters/store/paths.cjs.map +1 -0
  16. package/dist/adapters/store/paths.d.cts +26 -0
  17. package/dist/adapters/store/paths.d.cts.map +1 -0
  18. package/dist/adapters/store/paths.d.mts +26 -0
  19. package/dist/adapters/store/paths.d.mts.map +1 -0
  20. package/dist/adapters/store/paths.mjs +2 -0
  21. package/dist/adapters/store/paths.mjs.map +1 -0
  22. package/dist/adapters/store/taskStore.cjs +2 -0
  23. package/dist/adapters/store/taskStore.cjs.map +1 -0
  24. package/dist/adapters/store/taskStore.d.cts +87 -0
  25. package/dist/adapters/store/taskStore.d.cts.map +1 -0
  26. package/dist/adapters/store/taskStore.d.mts +87 -0
  27. package/dist/adapters/store/taskStore.d.mts.map +1 -0
  28. package/dist/adapters/store/taskStore.mjs +2 -0
  29. package/dist/adapters/store/taskStore.mjs.map +1 -0
  30. package/dist/adapters/telemetry/logSinkTelemetry.cjs +2 -0
  31. package/dist/adapters/telemetry/logSinkTelemetry.cjs.map +1 -0
  32. package/dist/adapters/telemetry/logSinkTelemetry.d.cts +23 -0
  33. package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -0
  34. package/dist/adapters/telemetry/logSinkTelemetry.d.mts +23 -0
  35. package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -0
  36. package/dist/adapters/telemetry/logSinkTelemetry.mjs +2 -0
  37. package/dist/adapters/telemetry/logSinkTelemetry.mjs.map +1 -0
  38. package/dist/adapters/webTasksChannel.cjs +2 -0
  39. package/dist/adapters/webTasksChannel.cjs.map +1 -0
  40. package/dist/adapters/webTasksChannel.d.cts +20 -0
  41. package/dist/adapters/webTasksChannel.d.cts.map +1 -0
  42. package/dist/adapters/webTasksChannel.d.mts +20 -0
  43. package/dist/adapters/webTasksChannel.d.mts.map +1 -0
  44. package/dist/adapters/webTasksChannel.mjs +2 -0
  45. package/dist/adapters/webTasksChannel.mjs.map +1 -0
  46. package/dist/commands/index.cjs +2 -0
  47. package/dist/commands/index.cjs.map +1 -0
  48. package/dist/commands/index.d.cts +14 -0
  49. package/dist/commands/index.d.cts.map +1 -0
  50. package/dist/commands/index.d.mts +14 -0
  51. package/dist/commands/index.d.mts.map +1 -0
  52. package/dist/commands/index.mjs +2 -0
  53. package/dist/commands/index.mjs.map +1 -0
  54. package/dist/commands/task/promptGuidelines.cjs +2 -0
  55. package/dist/commands/task/promptGuidelines.cjs.map +1 -0
  56. package/dist/commands/task/promptGuidelines.d.cts +5 -0
  57. package/dist/commands/task/promptGuidelines.d.cts.map +1 -0
  58. package/dist/commands/task/promptGuidelines.d.mts +5 -0
  59. package/dist/commands/task/promptGuidelines.d.mts.map +1 -0
  60. package/dist/commands/task/promptGuidelines.mjs +2 -0
  61. package/dist/commands/task/promptGuidelines.mjs.map +1 -0
  62. package/dist/commands/task/responseEnvelope.cjs +7 -0
  63. package/dist/commands/task/responseEnvelope.cjs.map +1 -0
  64. package/dist/commands/task/responseEnvelope.d.cts +51 -0
  65. package/dist/commands/task/responseEnvelope.d.cts.map +1 -0
  66. package/dist/commands/task/responseEnvelope.d.mts +51 -0
  67. package/dist/commands/task/responseEnvelope.d.mts.map +1 -0
  68. package/dist/commands/task/responseEnvelope.mjs +7 -0
  69. package/dist/commands/task/responseEnvelope.mjs.map +1 -0
  70. package/dist/commands/task/taskTool.cjs +3 -0
  71. package/dist/commands/task/taskTool.cjs.map +1 -0
  72. package/dist/commands/task/taskTool.d.cts +20 -0
  73. package/dist/commands/task/taskTool.d.cts.map +1 -0
  74. package/dist/commands/task/taskTool.d.mts +20 -0
  75. package/dist/commands/task/taskTool.d.mts.map +1 -0
  76. package/dist/commands/task/taskTool.mjs +3 -0
  77. package/dist/commands/task/taskTool.mjs.map +1 -0
  78. package/dist/commands.cjs +1 -2
  79. package/dist/commands.d.cts +2 -14
  80. package/dist/commands.d.mts +2 -14
  81. package/dist/commands.mjs +1 -2
  82. package/dist/config.cjs +1 -2
  83. package/dist/config.d.cts +2 -38
  84. package/dist/config.d.mts +2 -38
  85. package/dist/config.mjs +1 -2
  86. package/dist/delegation/manager.cjs +1 -6
  87. package/dist/delegation/manager.d.cts +3 -189
  88. package/dist/delegation/manager.d.mts +3 -189
  89. package/dist/delegation/manager.mjs +1 -6
  90. package/dist/extension.cjs +1 -3
  91. package/dist/extension.d.cts +2 -12
  92. package/dist/extension.d.mts +2 -12
  93. package/dist/extension.mjs +1 -3
  94. package/dist/extensions/pi.cjs +1 -2
  95. package/dist/extensions/pi.d.cts +1 -1
  96. package/dist/extensions/pi.d.mts +1 -1
  97. package/dist/extensions/pi.mjs +1 -2
  98. package/dist/index.cjs +1 -1
  99. package/dist/index.d.cts +15 -14
  100. package/dist/index.d.mts +15 -14
  101. package/dist/index.mjs +1 -1
  102. package/dist/logSinkTelemetry.cjs +1 -2
  103. package/dist/logSinkTelemetry.d.cts +3 -51
  104. package/dist/logSinkTelemetry.d.mts +3 -51
  105. package/dist/logSinkTelemetry.mjs +1 -2
  106. package/dist/schemas/task.cjs +2 -0
  107. package/dist/schemas/task.cjs.map +1 -0
  108. package/dist/schemas/task.d.cts +103 -0
  109. package/dist/schemas/task.d.cts.map +1 -0
  110. package/dist/schemas/task.d.mts +103 -0
  111. package/dist/schemas/task.d.mts.map +1 -0
  112. package/dist/schemas/task.mjs +2 -0
  113. package/dist/schemas/task.mjs.map +1 -0
  114. package/dist/services/contextContribution.cjs +3 -0
  115. package/dist/services/contextContribution.cjs.map +1 -0
  116. package/dist/services/contextContribution.mjs +3 -0
  117. package/dist/services/contextContribution.mjs.map +1 -0
  118. package/dist/services/delegation/manager.cjs +6 -0
  119. package/dist/services/delegation/manager.cjs.map +1 -0
  120. package/dist/services/delegation/manager.d.cts +192 -0
  121. package/dist/services/delegation/manager.d.cts.map +1 -0
  122. package/dist/services/delegation/manager.d.mts +192 -0
  123. package/dist/services/delegation/manager.d.mts.map +1 -0
  124. package/dist/services/delegation/manager.mjs +6 -0
  125. package/dist/services/delegation/manager.mjs.map +1 -0
  126. package/dist/services/narration/taskNarration.cjs +2 -0
  127. package/dist/services/narration/taskNarration.cjs.map +1 -0
  128. package/dist/services/narration/taskNarration.mjs +2 -0
  129. package/dist/services/narration/taskNarration.mjs.map +1 -0
  130. package/dist/services/store/invariants.cjs +2 -0
  131. package/dist/services/store/invariants.cjs.map +1 -0
  132. package/dist/services/store/invariants.d.cts +24 -0
  133. package/dist/services/store/invariants.d.cts.map +1 -0
  134. package/dist/services/store/invariants.d.mts +24 -0
  135. package/dist/services/store/invariants.d.mts.map +1 -0
  136. package/dist/services/store/invariants.mjs +2 -0
  137. package/dist/services/store/invariants.mjs.map +1 -0
  138. package/dist/services/store/processLiveness.cjs +2 -0
  139. package/dist/services/store/processLiveness.cjs.map +1 -0
  140. package/dist/services/store/processLiveness.d.cts +12 -0
  141. package/dist/services/store/processLiveness.d.cts.map +1 -0
  142. package/dist/services/store/processLiveness.d.mts +12 -0
  143. package/dist/services/store/processLiveness.d.mts.map +1 -0
  144. package/dist/services/store/processLiveness.mjs +2 -0
  145. package/dist/services/store/processLiveness.mjs.map +1 -0
  146. package/dist/services/store/reconcile.cjs +2 -0
  147. package/dist/services/store/reconcile.cjs.map +1 -0
  148. package/dist/services/store/reconcile.d.cts +34 -0
  149. package/dist/services/store/reconcile.d.cts.map +1 -0
  150. package/dist/services/store/reconcile.d.mts +34 -0
  151. package/dist/services/store/reconcile.d.mts.map +1 -0
  152. package/dist/services/store/reconcile.mjs +2 -0
  153. package/dist/services/store/reconcile.mjs.map +1 -0
  154. package/dist/services/store/reducer.cjs +3 -0
  155. package/dist/services/store/reducer.cjs.map +1 -0
  156. package/dist/services/store/reducer.d.cts +72 -0
  157. package/dist/services/store/reducer.d.cts.map +1 -0
  158. package/dist/services/store/reducer.d.mts +72 -0
  159. package/dist/services/store/reducer.d.mts.map +1 -0
  160. package/dist/services/store/reducer.mjs +3 -0
  161. package/dist/services/store/reducer.mjs.map +1 -0
  162. package/dist/services/store/taskGraph.cjs +2 -0
  163. package/dist/services/store/taskGraph.cjs.map +1 -0
  164. package/dist/services/store/taskGraph.d.cts +25 -0
  165. package/dist/services/store/taskGraph.d.cts.map +1 -0
  166. package/dist/services/store/taskGraph.d.mts +25 -0
  167. package/dist/services/store/taskGraph.d.mts.map +1 -0
  168. package/dist/services/store/taskGraph.mjs +2 -0
  169. package/dist/services/store/taskGraph.mjs.map +1 -0
  170. package/dist/services/store/types.cjs +2 -0
  171. package/dist/services/store/types.cjs.map +1 -0
  172. package/dist/services/store/types.d.cts +177 -0
  173. package/dist/services/store/types.d.cts.map +1 -0
  174. package/dist/services/store/types.d.mts +177 -0
  175. package/dist/services/store/types.d.mts.map +1 -0
  176. package/dist/services/store/types.mjs +2 -0
  177. package/dist/services/store/types.mjs.map +1 -0
  178. package/dist/store/invariants.cjs +1 -2
  179. package/dist/store/invariants.d.cts +2 -14
  180. package/dist/store/invariants.d.mts +2 -14
  181. package/dist/store/invariants.mjs +1 -2
  182. package/dist/store/paths.cjs +1 -2
  183. package/dist/store/paths.d.cts +2 -23
  184. package/dist/store/paths.d.mts +2 -23
  185. package/dist/store/paths.mjs +1 -2
  186. package/dist/store/processLiveness.cjs +1 -2
  187. package/dist/store/processLiveness.d.cts +2 -12
  188. package/dist/store/processLiveness.d.mts +2 -12
  189. package/dist/store/processLiveness.mjs +1 -2
  190. package/dist/store/reconcile.cjs +1 -2
  191. package/dist/store/reconcile.d.cts +2 -34
  192. package/dist/store/reconcile.d.mts +2 -34
  193. package/dist/store/reconcile.mjs +1 -2
  194. package/dist/store/reducer.cjs +1 -3
  195. package/dist/store/reducer.d.cts +2 -72
  196. package/dist/store/reducer.d.mts +2 -72
  197. package/dist/store/reducer.mjs +1 -3
  198. package/dist/store/taskGraph.cjs +1 -2
  199. package/dist/store/taskGraph.d.cts +2 -25
  200. package/dist/store/taskGraph.d.mts +2 -25
  201. package/dist/store/taskGraph.mjs +1 -2
  202. package/dist/store/taskStore.cjs +1 -2
  203. package/dist/store/taskStore.d.cts +2 -77
  204. package/dist/store/taskStore.d.mts +2 -77
  205. package/dist/store/taskStore.mjs +1 -2
  206. package/dist/store/types.cjs +1 -2
  207. package/dist/store/types.d.cts +2 -165
  208. package/dist/store/types.d.mts +2 -165
  209. package/dist/store/types.mjs +1 -2
  210. package/dist/tool/promptGuidelines.cjs +1 -2
  211. package/dist/tool/promptGuidelines.d.cts +2 -5
  212. package/dist/tool/promptGuidelines.d.mts +2 -5
  213. package/dist/tool/promptGuidelines.mjs +1 -2
  214. package/dist/tool/responseEnvelope.cjs +1 -6
  215. package/dist/tool/responseEnvelope.d.cts +2 -39
  216. package/dist/tool/responseEnvelope.d.mts +2 -39
  217. package/dist/tool/responseEnvelope.mjs +1 -6
  218. package/dist/tool/schema.cjs +1 -2
  219. package/dist/tool/schema.d.cts +2 -86
  220. package/dist/tool/schema.d.mts +2 -86
  221. package/dist/tool/schema.mjs +1 -2
  222. package/dist/tool/taskTool.cjs +1 -3
  223. package/dist/tool/taskTool.d.cts +3 -17
  224. package/dist/tool/taskTool.d.mts +3 -17
  225. package/dist/tool/taskTool.mjs +1 -3
  226. package/dist/tui/format.cjs +1 -4
  227. package/dist/tui/format.d.cts +5 -5
  228. package/dist/tui/format.d.cts.map +1 -1
  229. package/dist/tui/format.d.mts +5 -5
  230. package/dist/tui/format.d.mts.map +1 -1
  231. package/dist/tui/format.mjs +1 -4
  232. package/dist/tui/format2.cjs +4 -0
  233. package/dist/tui/format2.cjs.map +1 -0
  234. package/dist/tui/format2.d.cts +2 -0
  235. package/dist/tui/format2.d.mts +2 -0
  236. package/dist/tui/format2.mjs +4 -0
  237. package/dist/tui/format2.mjs.map +1 -0
  238. package/dist/tui/selectors.cjs +1 -2
  239. package/dist/tui/selectors.d.cts +8 -1
  240. package/dist/tui/selectors.d.cts.map +1 -1
  241. package/dist/tui/selectors.d.mts +8 -1
  242. package/dist/tui/selectors.d.mts.map +1 -1
  243. package/dist/tui/selectors.mjs +1 -2
  244. package/dist/tui/selectors2.cjs +2 -0
  245. package/dist/tui/selectors2.cjs.map +1 -0
  246. package/dist/tui/selectors2.d.cts +2 -0
  247. package/dist/tui/selectors2.d.mts +2 -0
  248. package/dist/tui/selectors2.mjs +2 -0
  249. package/dist/tui/selectors2.mjs.map +1 -0
  250. package/dist/tui/taskOverlay.cjs +1 -2
  251. package/dist/tui/taskOverlay.d.cts +2 -2
  252. package/dist/tui/taskOverlay.d.cts.map +1 -1
  253. package/dist/tui/taskOverlay.d.mts +2 -2
  254. package/dist/tui/taskOverlay.d.mts.map +1 -1
  255. package/dist/tui/taskOverlay.mjs +1 -2
  256. package/dist/tui/taskOverlay2.cjs +2 -0
  257. package/dist/tui/taskOverlay2.cjs.map +1 -0
  258. package/dist/tui/taskOverlay2.d.cts +2 -0
  259. package/dist/tui/taskOverlay2.d.mts +2 -0
  260. package/dist/tui/taskOverlay2.mjs +2 -0
  261. package/dist/tui/taskOverlay2.mjs.map +1 -0
  262. package/dist/tui/taskSpace.cjs +1 -5
  263. package/dist/tui/taskSpace.d.cts +4 -4
  264. package/dist/tui/taskSpace.d.cts.map +1 -1
  265. package/dist/tui/taskSpace.d.mts +4 -4
  266. package/dist/tui/taskSpace.d.mts.map +1 -1
  267. package/dist/tui/taskSpace.mjs +1 -5
  268. package/dist/tui/taskSpace2.cjs +5 -0
  269. package/dist/tui/taskSpace2.cjs.map +1 -0
  270. package/dist/tui/taskSpace2.d.cts +2 -0
  271. package/dist/tui/taskSpace2.d.mts +2 -0
  272. package/dist/tui/taskSpace2.mjs +5 -0
  273. package/dist/tui/taskSpace2.mjs.map +1 -0
  274. package/dist/types/config.cjs +2 -0
  275. package/dist/types/config.cjs.map +1 -0
  276. package/dist/types/config.d.cts +43 -0
  277. package/dist/types/config.d.cts.map +1 -0
  278. package/dist/types/config.d.mts +43 -0
  279. package/dist/types/config.d.mts.map +1 -0
  280. package/dist/types/config.mjs +2 -0
  281. package/dist/types/config.mjs.map +1 -0
  282. package/dist/types/delegation.cjs +2 -0
  283. package/dist/types/delegation.cjs.map +1 -0
  284. package/dist/types/delegation.d.cts +6 -0
  285. package/dist/types/delegation.d.cts.map +1 -0
  286. package/dist/types/delegation.d.mts +6 -0
  287. package/dist/types/delegation.d.mts.map +1 -0
  288. package/dist/types/delegation.mjs +2 -0
  289. package/dist/types/delegation.mjs.map +1 -0
  290. package/dist/types/telemetry.cjs +2 -0
  291. package/dist/types/telemetry.cjs.map +1 -0
  292. package/dist/types/telemetry.d.cts +35 -0
  293. package/dist/types/telemetry.d.cts.map +1 -0
  294. package/dist/types/telemetry.d.mts +35 -0
  295. package/dist/types/telemetry.d.mts.map +1 -0
  296. package/dist/types/telemetry.mjs +2 -0
  297. package/dist/types/telemetry.mjs.map +1 -0
  298. package/dist/types/webTasks.cjs +2 -0
  299. package/dist/types/webTasks.cjs.map +1 -0
  300. package/dist/types/webTasks.mjs +2 -0
  301. package/dist/types/webTasks.mjs.map +1 -0
  302. package/dist/webHub.cjs +1 -0
  303. package/dist/webHub.d.cts +2 -0
  304. package/dist/webHub.d.mts +2 -0
  305. package/dist/webHub.mjs +1 -0
  306. package/package.json +60 -20
  307. package/src/types/webTasks.ts +24 -0
  308. package/web/TaskToolMessage.tsx +119 -0
  309. package/web/TasksActivitySection.tsx +207 -0
  310. package/web/index.ts +15 -0
  311. package/web/taskToolFormat.ts +330 -0
  312. package/web/tasksStore.ts +72 -0
  313. package/web/tsconfig.json +23 -0
  314. package/dist/commands.cjs.map +0 -1
  315. package/dist/commands.d.cts.map +0 -1
  316. package/dist/commands.d.mts.map +0 -1
  317. package/dist/commands.mjs.map +0 -1
  318. package/dist/config.cjs.map +0 -1
  319. package/dist/config.d.cts.map +0 -1
  320. package/dist/config.d.mts.map +0 -1
  321. package/dist/config.mjs.map +0 -1
  322. package/dist/delegation/manager.cjs.map +0 -1
  323. package/dist/delegation/manager.d.cts.map +0 -1
  324. package/dist/delegation/manager.d.mts.map +0 -1
  325. package/dist/delegation/manager.mjs.map +0 -1
  326. package/dist/extension.cjs.map +0 -1
  327. package/dist/extension.d.cts.map +0 -1
  328. package/dist/extension.d.mts.map +0 -1
  329. package/dist/extension.mjs.map +0 -1
  330. package/dist/extensions/doom.cjs +0 -2
  331. package/dist/extensions/doom.cjs.map +0 -1
  332. package/dist/extensions/doom.d.cts +0 -6
  333. package/dist/extensions/doom.d.cts.map +0 -1
  334. package/dist/extensions/doom.d.mts +0 -7
  335. package/dist/extensions/doom.d.mts.map +0 -1
  336. package/dist/extensions/doom.mjs +0 -2
  337. package/dist/extensions/doom.mjs.map +0 -1
  338. package/dist/extensions/pi.cjs.map +0 -1
  339. package/dist/extensions/pi.mjs.map +0 -1
  340. package/dist/logSinkTelemetry.cjs.map +0 -1
  341. package/dist/logSinkTelemetry.d.cts.map +0 -1
  342. package/dist/logSinkTelemetry.d.mts.map +0 -1
  343. package/dist/logSinkTelemetry.mjs.map +0 -1
  344. package/dist/store/invariants.cjs.map +0 -1
  345. package/dist/store/invariants.d.cts.map +0 -1
  346. package/dist/store/invariants.d.mts.map +0 -1
  347. package/dist/store/invariants.mjs.map +0 -1
  348. package/dist/store/paths.cjs.map +0 -1
  349. package/dist/store/paths.d.cts.map +0 -1
  350. package/dist/store/paths.d.mts.map +0 -1
  351. package/dist/store/paths.mjs.map +0 -1
  352. package/dist/store/processLiveness.cjs.map +0 -1
  353. package/dist/store/processLiveness.d.cts.map +0 -1
  354. package/dist/store/processLiveness.d.mts.map +0 -1
  355. package/dist/store/processLiveness.mjs.map +0 -1
  356. package/dist/store/reconcile.cjs.map +0 -1
  357. package/dist/store/reconcile.d.cts.map +0 -1
  358. package/dist/store/reconcile.d.mts.map +0 -1
  359. package/dist/store/reconcile.mjs.map +0 -1
  360. package/dist/store/reducer.cjs.map +0 -1
  361. package/dist/store/reducer.d.cts.map +0 -1
  362. package/dist/store/reducer.d.mts.map +0 -1
  363. package/dist/store/reducer.mjs.map +0 -1
  364. package/dist/store/taskGraph.cjs.map +0 -1
  365. package/dist/store/taskGraph.d.cts.map +0 -1
  366. package/dist/store/taskGraph.d.mts.map +0 -1
  367. package/dist/store/taskGraph.mjs.map +0 -1
  368. package/dist/store/taskStore.cjs.map +0 -1
  369. package/dist/store/taskStore.d.cts.map +0 -1
  370. package/dist/store/taskStore.d.mts.map +0 -1
  371. package/dist/store/taskStore.mjs.map +0 -1
  372. package/dist/store/types.cjs.map +0 -1
  373. package/dist/store/types.d.cts.map +0 -1
  374. package/dist/store/types.d.mts.map +0 -1
  375. package/dist/store/types.mjs.map +0 -1
  376. package/dist/tool/promptGuidelines.cjs.map +0 -1
  377. package/dist/tool/promptGuidelines.d.cts.map +0 -1
  378. package/dist/tool/promptGuidelines.d.mts.map +0 -1
  379. package/dist/tool/promptGuidelines.mjs.map +0 -1
  380. package/dist/tool/responseEnvelope.cjs.map +0 -1
  381. package/dist/tool/responseEnvelope.d.cts.map +0 -1
  382. package/dist/tool/responseEnvelope.d.mts.map +0 -1
  383. package/dist/tool/responseEnvelope.mjs.map +0 -1
  384. package/dist/tool/schema.cjs.map +0 -1
  385. package/dist/tool/schema.d.cts.map +0 -1
  386. package/dist/tool/schema.d.mts.map +0 -1
  387. package/dist/tool/schema.mjs.map +0 -1
  388. package/dist/tool/taskTool.cjs.map +0 -1
  389. package/dist/tool/taskTool.d.cts.map +0 -1
  390. package/dist/tool/taskTool.d.mts.map +0 -1
  391. package/dist/tool/taskTool.mjs.map +0 -1
  392. package/dist/tui/format.cjs.map +0 -1
  393. package/dist/tui/format.mjs.map +0 -1
  394. package/dist/tui/selectors.cjs.map +0 -1
  395. package/dist/tui/selectors.mjs.map +0 -1
  396. package/dist/tui/taskOverlay.cjs.map +0 -1
  397. package/dist/tui/taskOverlay.mjs.map +0 -1
  398. package/dist/tui/taskSpace.cjs.map +0 -1
  399. package/dist/tui/taskSpace.mjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ const e=`completed`,t=`deleted`;function n(n){let r=n.filter(e=>e.status!==t);return r.length>0&&r.every(t=>t.status===e)}function r(e,t,n){let r=new Map;for(let i of e)i.id===t?r.set(i.id,[...new Set([...i.blockedBy??[],...n])]):r.set(i.id,i.blockedBy?[...i.blockedBy]:[]);let i=new Set,a=new Set,o=e=>{if(i.has(e))return!0;if(a.has(e))return!1;i.add(e);for(let t of r.get(e)??[])if(o(t))return!0;return i.delete(e),a.add(e),!1};for(let e of r.keys())if(o(e))return!0;return!1}function i(e){let t=new Map;for(let n of e)for(let e of n.blockedBy??[]){let r=t.get(e)??[];r.push(n.id),t.set(e,r)}return t}function a(n,r){return(r.blockedBy??[]).filter(r=>{let i=n.find(e=>e.id===r);return i?i.status!==e&&i.status!==t:!1})}function o(e,t){return a(e,t).length>0}exports.deriveBlocks=i,exports.detectCycle=r,exports.isBlocked=o,exports.isTaskListComplete=n,exports.unresolvedBlockers=a;
2
+ //# sourceMappingURL=taskGraph.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskGraph.cjs","names":[],"sources":["../../../src/services/store/taskGraph.ts"],"sourcesContent":["import type { Task } from './types.ts';\n\nconst COMPLETED_STATUS: Task['status'] = 'completed';\nconst DELETED_STATUS: Task['status'] = 'deleted';\n\n/** True when a non-empty list has no visible work left to finish. */\nexport function isTaskListComplete(taskList: readonly Task[]): boolean {\n const visible = taskList.filter((task) => task.status !== DELETED_STATUS);\n return visible.length > 0 && visible.every((task) => task.status === COMPLETED_STATUS);\n}\n\n/**\n * Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?\n *\n * Takes the proposed additions explicitly so the reducer can ask the question\n * before mutating anything.\n */\nexport function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean {\n const edges = new Map<number, number[]>();\n for (const task of taskList) {\n if (task.id === taskId) {\n edges.set(task.id, [...new Set([...(task.blockedBy ?? []), ...newBlockedBy])]);\n } else {\n edges.set(task.id, task.blockedBy ? [...task.blockedBy] : []);\n }\n }\n\n const visiting = new Set<number>();\n const visited = new Set<number>();\n const hasCycleFrom = (node: number): boolean => {\n if (visiting.has(node)) return true;\n if (visited.has(node)) return false;\n visiting.add(node);\n for (const next of edges.get(node) ?? []) {\n if (hasCycleFrom(next)) return true;\n }\n visiting.delete(node);\n visited.add(node);\n return false;\n };\n\n for (const node of edges.keys()) {\n if (hasCycleFrom(node)) return true;\n }\n return false;\n}\n\n/** Inverse adjacency: for each task, which tasks list it in their blockedBy. */\nexport function deriveBlocks(taskList: readonly Task[]): Map<number, number[]> {\n const blocks = new Map<number, number[]>();\n for (const task of taskList) {\n for (const dep of task.blockedBy ?? []) {\n const dependents = blocks.get(dep) ?? [];\n dependents.push(task.id);\n blocks.set(dep, dependents);\n }\n }\n return blocks;\n}\n\n/**\n * Blocking dependencies of a task that are not yet resolved.\n *\n * `completed` clears a dependency; `failed` deliberately does not, so a failed\n * delegation keeps its dependents blocked instead of silently releasing work\n * that was never actually finished.\n */\nexport function unresolvedBlockers(taskList: readonly Task[], task: Task): number[] {\n return (task.blockedBy ?? []).filter((dep) => {\n const blocker = taskList.find((candidate) => candidate.id === dep);\n if (!blocker) return false;\n return blocker.status !== COMPLETED_STATUS && blocker.status !== DELETED_STATUS;\n });\n}\n\nexport function isBlocked(taskList: readonly Task[], task: Task): boolean {\n return unresolvedBlockers(taskList, task).length > 0;\n}\n"],"mappings":"AAEA,MAAM,EAAmC,YACnC,EAAiC,UAGvC,SAAgB,EAAmB,EAAoC,CACrE,IAAM,EAAU,EAAS,OAAQ,GAAS,EAAK,SAAW,CAAc,EACxE,OAAO,EAAQ,OAAS,GAAK,EAAQ,MAAO,GAAS,EAAK,SAAW,CAAgB,CACvF,CAQA,SAAgB,EAAY,EAA2B,EAAgB,EAA0C,CAC/G,IAAM,EAAQ,IAAI,IAClB,IAAK,IAAM,KAAQ,EACb,EAAK,KAAO,EACd,EAAM,IAAI,EAAK,GAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAI,EAAK,WAAa,CAAC,EAAI,GAAG,CAAY,CAAC,CAAC,CAAC,EAE7E,EAAM,IAAI,EAAK,GAAI,EAAK,UAAY,CAAC,GAAG,EAAK,SAAS,EAAI,CAAC,CAAC,EAIhE,IAAM,EAAW,IAAI,IACf,EAAU,IAAI,IACd,EAAgB,GAA0B,CAC9C,GAAI,EAAS,IAAI,CAAI,EAAG,MAAO,GAC/B,GAAI,EAAQ,IAAI,CAAI,EAAG,MAAO,GAC9B,EAAS,IAAI,CAAI,EACjB,IAAK,IAAM,KAAQ,EAAM,IAAI,CAAI,GAAK,CAAC,EACrC,GAAI,EAAa,CAAI,EAAG,MAAO,GAIjC,OAFA,EAAS,OAAO,CAAI,EACpB,EAAQ,IAAI,CAAI,EACT,EACT,EAEA,IAAK,IAAM,KAAQ,EAAM,KAAK,EAC5B,GAAI,EAAa,CAAI,EAAG,MAAO,GAEjC,MAAO,EACT,CAGA,SAAgB,EAAa,EAAkD,CAC7E,IAAM,EAAS,IAAI,IACnB,IAAK,IAAM,KAAQ,EACjB,IAAK,IAAM,KAAO,EAAK,WAAa,CAAC,EAAG,CACtC,IAAM,EAAa,EAAO,IAAI,CAAG,GAAK,CAAC,EACvC,EAAW,KAAK,EAAK,EAAE,EACvB,EAAO,IAAI,EAAK,CAAU,CAC5B,CAEF,OAAO,CACT,CASA,SAAgB,EAAmB,EAA2B,EAAsB,CAClF,OAAQ,EAAK,WAAa,CAAC,EAAA,CAAG,OAAQ,GAAQ,CAC5C,IAAM,EAAU,EAAS,KAAM,GAAc,EAAU,KAAO,CAAG,EAEjE,OADK,EACE,EAAQ,SAAW,GAAoB,EAAQ,SAAW,EAD5C,EAEvB,CAAC,CACH,CAEA,SAAgB,EAAU,EAA2B,EAAqB,CACxE,OAAO,EAAmB,EAAU,CAAI,CAAC,CAAC,OAAS,CACrD"}
@@ -0,0 +1,25 @@
1
+ import { Task } from "./types.cjs";
2
+ //#region src/services/store/taskGraph.d.ts
3
+ /** True when a non-empty list has no visible work left to finish. */
4
+ declare function isTaskListComplete(taskList: readonly Task[]): boolean;
5
+ /**
6
+ * Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?
7
+ *
8
+ * Takes the proposed additions explicitly so the reducer can ask the question
9
+ * before mutating anything.
10
+ */
11
+ declare function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean;
12
+ /** Inverse adjacency: for each task, which tasks list it in their blockedBy. */
13
+ declare function deriveBlocks(taskList: readonly Task[]): Map<number, number[]>;
14
+ /**
15
+ * Blocking dependencies of a task that are not yet resolved.
16
+ *
17
+ * `completed` clears a dependency; `failed` deliberately does not, so a failed
18
+ * delegation keeps its dependents blocked instead of silently releasing work
19
+ * that was never actually finished.
20
+ */
21
+ declare function unresolvedBlockers(taskList: readonly Task[], task: Task): number[];
22
+ declare function isBlocked(taskList: readonly Task[], task: Task): boolean;
23
+ //#endregion
24
+ export { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers };
25
+ //# sourceMappingURL=taskGraph.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskGraph.d.cts","names":[],"sources":["../../../src/services/store/taskGraph.ts"],"mappings":";;;iBAMgB,mBAAmB,mBAAmB;;;;;;;iBAWtC,YAAY,mBAAmB,QAAQ,gBAAgB;;iBA+BvD,aAAa,mBAAmB,SAAS;;;;;;;;iBAmBzC,mBAAmB,mBAAmB,QAAQ,MAAM;iBAQpD,UAAU,mBAAmB,QAAQ,MAAM"}
@@ -0,0 +1,25 @@
1
+ import { Task } from "./types.mjs";
2
+ //#region src/services/store/taskGraph.d.ts
3
+ /** True when a non-empty list has no visible work left to finish. */
4
+ declare function isTaskListComplete(taskList: readonly Task[]): boolean;
5
+ /**
6
+ * Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?
7
+ *
8
+ * Takes the proposed additions explicitly so the reducer can ask the question
9
+ * before mutating anything.
10
+ */
11
+ declare function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean;
12
+ /** Inverse adjacency: for each task, which tasks list it in their blockedBy. */
13
+ declare function deriveBlocks(taskList: readonly Task[]): Map<number, number[]>;
14
+ /**
15
+ * Blocking dependencies of a task that are not yet resolved.
16
+ *
17
+ * `completed` clears a dependency; `failed` deliberately does not, so a failed
18
+ * delegation keeps its dependents blocked instead of silently releasing work
19
+ * that was never actually finished.
20
+ */
21
+ declare function unresolvedBlockers(taskList: readonly Task[], task: Task): number[];
22
+ declare function isBlocked(taskList: readonly Task[], task: Task): boolean;
23
+ //#endregion
24
+ export { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers };
25
+ //# sourceMappingURL=taskGraph.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskGraph.d.mts","names":[],"sources":["../../../src/services/store/taskGraph.ts"],"mappings":";;;iBAMgB,mBAAmB,mBAAmB;;;;;;;iBAWtC,YAAY,mBAAmB,QAAQ,gBAAgB;;iBA+BvD,aAAa,mBAAmB,SAAS;;;;;;;;iBAmBzC,mBAAmB,mBAAmB,QAAQ,MAAM;iBAQpD,UAAU,mBAAmB,QAAQ,MAAM"}
@@ -0,0 +1,2 @@
1
+ const e=`completed`,t=`deleted`;function n(n){let r=n.filter(e=>e.status!==t);return r.length>0&&r.every(t=>t.status===e)}function r(e,t,n){let r=new Map;for(let i of e)i.id===t?r.set(i.id,[...new Set([...i.blockedBy??[],...n])]):r.set(i.id,i.blockedBy?[...i.blockedBy]:[]);let i=new Set,a=new Set,o=e=>{if(i.has(e))return!0;if(a.has(e))return!1;i.add(e);for(let t of r.get(e)??[])if(o(t))return!0;return i.delete(e),a.add(e),!1};for(let e of r.keys())if(o(e))return!0;return!1}function i(e){let t=new Map;for(let n of e)for(let e of n.blockedBy??[]){let r=t.get(e)??[];r.push(n.id),t.set(e,r)}return t}function a(n,r){return(r.blockedBy??[]).filter(r=>{let i=n.find(e=>e.id===r);return i?i.status!==e&&i.status!==t:!1})}function o(e,t){return a(e,t).length>0}export{i as deriveBlocks,r as detectCycle,o as isBlocked,n as isTaskListComplete,a as unresolvedBlockers};
2
+ //# sourceMappingURL=taskGraph.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskGraph.mjs","names":[],"sources":["../../../src/services/store/taskGraph.ts"],"sourcesContent":["import type { Task } from './types.ts';\n\nconst COMPLETED_STATUS: Task['status'] = 'completed';\nconst DELETED_STATUS: Task['status'] = 'deleted';\n\n/** True when a non-empty list has no visible work left to finish. */\nexport function isTaskListComplete(taskList: readonly Task[]): boolean {\n const visible = taskList.filter((task) => task.status !== DELETED_STATUS);\n return visible.length > 0 && visible.every((task) => task.status === COMPLETED_STATUS);\n}\n\n/**\n * Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?\n *\n * Takes the proposed additions explicitly so the reducer can ask the question\n * before mutating anything.\n */\nexport function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean {\n const edges = new Map<number, number[]>();\n for (const task of taskList) {\n if (task.id === taskId) {\n edges.set(task.id, [...new Set([...(task.blockedBy ?? []), ...newBlockedBy])]);\n } else {\n edges.set(task.id, task.blockedBy ? [...task.blockedBy] : []);\n }\n }\n\n const visiting = new Set<number>();\n const visited = new Set<number>();\n const hasCycleFrom = (node: number): boolean => {\n if (visiting.has(node)) return true;\n if (visited.has(node)) return false;\n visiting.add(node);\n for (const next of edges.get(node) ?? []) {\n if (hasCycleFrom(next)) return true;\n }\n visiting.delete(node);\n visited.add(node);\n return false;\n };\n\n for (const node of edges.keys()) {\n if (hasCycleFrom(node)) return true;\n }\n return false;\n}\n\n/** Inverse adjacency: for each task, which tasks list it in their blockedBy. */\nexport function deriveBlocks(taskList: readonly Task[]): Map<number, number[]> {\n const blocks = new Map<number, number[]>();\n for (const task of taskList) {\n for (const dep of task.blockedBy ?? []) {\n const dependents = blocks.get(dep) ?? [];\n dependents.push(task.id);\n blocks.set(dep, dependents);\n }\n }\n return blocks;\n}\n\n/**\n * Blocking dependencies of a task that are not yet resolved.\n *\n * `completed` clears a dependency; `failed` deliberately does not, so a failed\n * delegation keeps its dependents blocked instead of silently releasing work\n * that was never actually finished.\n */\nexport function unresolvedBlockers(taskList: readonly Task[], task: Task): number[] {\n return (task.blockedBy ?? []).filter((dep) => {\n const blocker = taskList.find((candidate) => candidate.id === dep);\n if (!blocker) return false;\n return blocker.status !== COMPLETED_STATUS && blocker.status !== DELETED_STATUS;\n });\n}\n\nexport function isBlocked(taskList: readonly Task[], task: Task): boolean {\n return unresolvedBlockers(taskList, task).length > 0;\n}\n"],"mappings":"AAEA,MAAM,EAAmC,YACnC,EAAiC,UAGvC,SAAgB,EAAmB,EAAoC,CACrE,IAAM,EAAU,EAAS,OAAQ,GAAS,EAAK,SAAW,CAAc,EACxE,OAAO,EAAQ,OAAS,GAAK,EAAQ,MAAO,GAAS,EAAK,SAAW,CAAgB,CACvF,CAQA,SAAgB,EAAY,EAA2B,EAAgB,EAA0C,CAC/G,IAAM,EAAQ,IAAI,IAClB,IAAK,IAAM,KAAQ,EACb,EAAK,KAAO,EACd,EAAM,IAAI,EAAK,GAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAI,EAAK,WAAa,CAAC,EAAI,GAAG,CAAY,CAAC,CAAC,CAAC,EAE7E,EAAM,IAAI,EAAK,GAAI,EAAK,UAAY,CAAC,GAAG,EAAK,SAAS,EAAI,CAAC,CAAC,EAIhE,IAAM,EAAW,IAAI,IACf,EAAU,IAAI,IACd,EAAgB,GAA0B,CAC9C,GAAI,EAAS,IAAI,CAAI,EAAG,MAAO,GAC/B,GAAI,EAAQ,IAAI,CAAI,EAAG,MAAO,GAC9B,EAAS,IAAI,CAAI,EACjB,IAAK,IAAM,KAAQ,EAAM,IAAI,CAAI,GAAK,CAAC,EACrC,GAAI,EAAa,CAAI,EAAG,MAAO,GAIjC,OAFA,EAAS,OAAO,CAAI,EACpB,EAAQ,IAAI,CAAI,EACT,EACT,EAEA,IAAK,IAAM,KAAQ,EAAM,KAAK,EAC5B,GAAI,EAAa,CAAI,EAAG,MAAO,GAEjC,MAAO,EACT,CAGA,SAAgB,EAAa,EAAkD,CAC7E,IAAM,EAAS,IAAI,IACnB,IAAK,IAAM,KAAQ,EACjB,IAAK,IAAM,KAAO,EAAK,WAAa,CAAC,EAAG,CACtC,IAAM,EAAa,EAAO,IAAI,CAAG,GAAK,CAAC,EACvC,EAAW,KAAK,EAAK,EAAE,EACvB,EAAO,IAAI,EAAK,CAAU,CAC5B,CAEF,OAAO,CACT,CASA,SAAgB,EAAmB,EAA2B,EAAsB,CAClF,OAAQ,EAAK,WAAa,CAAC,EAAA,CAAG,OAAQ,GAAQ,CAC5C,IAAM,EAAU,EAAS,KAAM,GAAc,EAAU,KAAO,CAAG,EAEjE,OADK,EACE,EAAQ,SAAW,GAAoB,EAAQ,SAAW,EAD5C,EAEvB,CAAC,CACH,CAEA,SAAgB,EAAU,EAA2B,EAAqB,CACxE,OAAO,EAAmB,EAAU,CAAI,CAAC,CAAC,OAAS,CACrD"}
@@ -0,0 +1,2 @@
1
+ function e(){return{version:1,rev:0,nextId:1,tasks:[]}}function t(e){let t=e.delegation?.state;return t===`requested`||t===`running`}exports.DELETED_STATUS=`deleted`,exports.STORE_SCHEMA_VERSION=1,exports.emptyDocument=e,exports.isDelegationActive=t;
2
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../../src/services/store/types.ts"],"sourcesContent":["/**\n * Domain types for the file-backed task store.\n *\n * The on-disk document is the durable source of truth (unlike rpiv-todo, which\n * replayed state from the transcript). Every field here round-trips through\n * JSON, so nothing may hold non-serializable values.\n */\n\nimport type { InlineAgent } from '@agimon-ai/doompi-extension-contracts/subagent-tool';\n\nexport type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';\n\nexport const DELETED_STATUS: TaskStatus = 'deleted';\n\nexport type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';\n\nexport type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';\n\n/** Terminal result of a delegated subagent run, copied off the delegation response. */\nexport interface DelegationResult {\n status: string;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n error?: string;\n durationMs?: number;\n toolCount?: number;\n}\n\n/**\n * Delegation bookkeeping attached to a task that was handed to a subagent.\n *\n * `pid` is the harness process that owns the run: it is the only way to tell an\n * genuinely-running delegation from one orphaned by a harness crash, since the\n * child dies with its parent but the file survives.\n */\nexport interface TaskDelegation {\n requestId: string;\n agent: string;\n state: DelegationState;\n sessionId?: string;\n pid?: number;\n runId?: string;\n model?: string;\n startedAt?: string;\n endedAt?: string;\n result?: DelegationResult;\n}\n\nexport interface Task {\n id: number;\n subject: string;\n description?: string;\n activeForm?: string;\n status: TaskStatus;\n blockedBy?: number[];\n owner?: string;\n metadata?: Record<string, unknown>;\n createdAt?: string;\n updatedAt?: string;\n delegation?: TaskDelegation;\n}\n\nexport const STORE_SCHEMA_VERSION = 1;\n\n/** The complete on-disk document. `rev` increments on every committed write. */\nexport interface TaskDocument {\n version: number;\n rev: number;\n nextId: number;\n tasks: Task[];\n}\n\nexport function emptyDocument(): TaskDocument {\n return { version: STORE_SCHEMA_VERSION, rev: 0, nextId: 1, tasks: [] };\n}\n\n/**\n * A dependency target inside an upsert item: an existing task id, or the `ref`\n * of a task created earlier in the same call.\n *\n * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally\n * unconfusable with a stringified id and the discrimination is just `typeof`.\n */\nexport type DepToken = number | string;\n\n/**\n * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.\n *\n * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`\n * (additive merge) are update-only, matching the split the two former actions\n * had. A field used against the wrong kind fails that item rather than being\n * silently ignored.\n */\nexport interface TaskItemMutation {\n id?: number;\n ref?: string;\n subject?: string;\n description?: string;\n activeForm?: string;\n status?: TaskStatus;\n blockedBy?: DepToken[];\n addBlockedBy?: DepToken[];\n removeBlockedBy?: DepToken[];\n owner?: string;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * What one upsert item did. `index` is its position in the request array, so a\n * model reading a partial result can tell which entries still need resending.\n *\n * `message` is unprefixed: the `item[N] failed:` framing belongs to the\n * formatter, because the Task Space overlay shows this text on its own.\n */\nexport type UpsertItemOutcome =\n | {\n index: number;\n kind: 'created';\n id: number;\n subject: string;\n status: TaskStatus;\n ref?: string;\n blockedBy?: number[];\n }\n | { index: number; kind: 'updated'; id: number; fromStatus: TaskStatus; toStatus: TaskStatus }\n | { index: number; kind: 'unchanged'; id: number; status: TaskStatus }\n | { index: number; kind: 'failed'; message: string; id?: number; ref?: string };\n\n/** Which tasks an upsert touched, so renderResult names them instead of guessing. */\nexport interface UpsertSummary {\n /** Ids of applied entries, in request order. A failed entry contributes nothing. */\n applied: number[];\n failed: number;\n}\n\n/** One task-to-agent handoff inside a native assignment batch. */\nexport interface TaskAssignment {\n id: number;\n agent: string;\n inlineAgent?: InlineAgent;\n instructions?: string;\n relevantFiles?: string[];\n priorFindings?: string;\n model?: string;\n context?: 'fresh' | 'fork';\n}\n\n/** Which assignment entries started, so renderResult can show one consolidated batch. */\nexport interface AssignmentSummary {\n /** Ids of successful entries, in request order. A failed entry contributes nothing. */\n assigned: number[];\n failed: number;\n}\n\n/**\n * Open-shape input bag the reducer accepts. The index signature lets the\n * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without\n * casting each field.\n *\n * Per-task fields live on `tasks[]`, not here: a top-level `subject` or\n * `status` would be ambiguous once one call can carry many tasks.\n */\nexport interface TaskMutationParams {\n [key: string]: unknown;\n tasks?: TaskItemMutation[];\n /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */\n assignments?: TaskAssignment[];\n /** `list` filter only. To set a status, upsert the task by id. */\n status?: TaskStatus;\n /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */\n id?: number;\n includeDeleted?: boolean;\n}\n\n/** Snapshot returned under a tool result's `details` for renderResult. */\nexport interface TaskDetails {\n action: TaskAction;\n params: Record<string, unknown>;\n tasks: Task[];\n nextId: number;\n rev: number;\n error?: string;\n upsert?: UpsertSummary;\n assignment?: AssignmentSummary;\n}\n\n/** A delegation is \"live\" while the owning run may still produce a response. */\nexport function isDelegationActive(task: Task): boolean {\n const state = task.delegation?.state;\n return state === 'requested' || state === 'running';\n}\n"],"mappings":"AAyEA,SAAgB,GAA8B,CAC5C,MAAO,CAAE,QAAA,EAA+B,IAAK,EAAG,OAAQ,EAAG,MAAO,CAAC,CAAE,CACvE,CAiHA,SAAgB,EAAmB,EAAqB,CACtD,IAAM,EAAQ,EAAK,YAAY,MAC/B,OAAO,IAAU,aAAe,IAAU,SAC5C"}
@@ -0,0 +1,177 @@
1
+ import { InlineAgent } from "@agimon-ai/doompi-extension-contracts/subagent-tool";
2
+ //#region src/services/store/types.d.ts
3
+ type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
4
+ declare const DELETED_STATUS: TaskStatus;
5
+ type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';
6
+ type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';
7
+ /** Terminal result of a delegated subagent run, copied off the delegation response. */
8
+ interface DelegationResult {
9
+ status: string;
10
+ output?: string;
11
+ outputPath?: string;
12
+ sessionFile?: string;
13
+ error?: string;
14
+ durationMs?: number;
15
+ toolCount?: number;
16
+ }
17
+ /**
18
+ * Delegation bookkeeping attached to a task that was handed to a subagent.
19
+ *
20
+ * `pid` is the harness process that owns the run: it is the only way to tell an
21
+ * genuinely-running delegation from one orphaned by a harness crash, since the
22
+ * child dies with its parent but the file survives.
23
+ */
24
+ interface TaskDelegation {
25
+ requestId: string;
26
+ agent: string;
27
+ state: DelegationState;
28
+ sessionId?: string;
29
+ pid?: number;
30
+ runId?: string;
31
+ model?: string;
32
+ startedAt?: string;
33
+ endedAt?: string;
34
+ result?: DelegationResult;
35
+ }
36
+ interface Task {
37
+ id: number;
38
+ subject: string;
39
+ description?: string;
40
+ activeForm?: string;
41
+ status: TaskStatus;
42
+ blockedBy?: number[];
43
+ owner?: string;
44
+ metadata?: Record<string, unknown>;
45
+ createdAt?: string;
46
+ updatedAt?: string;
47
+ delegation?: TaskDelegation;
48
+ }
49
+ declare const STORE_SCHEMA_VERSION = 1;
50
+ /** The complete on-disk document. `rev` increments on every committed write. */
51
+ interface TaskDocument {
52
+ version: number;
53
+ rev: number;
54
+ nextId: number;
55
+ tasks: Task[];
56
+ }
57
+ declare function emptyDocument(): TaskDocument;
58
+ /**
59
+ * A dependency target inside an upsert item: an existing task id, or the `ref`
60
+ * of a task created earlier in the same call.
61
+ *
62
+ * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally
63
+ * unconfusable with a stringified id and the discrimination is just `typeof`.
64
+ */
65
+ type DepToken = number | string;
66
+ /**
67
+ * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.
68
+ *
69
+ * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`
70
+ * (additive merge) are update-only, matching the split the two former actions
71
+ * had. A field used against the wrong kind fails that item rather than being
72
+ * silently ignored.
73
+ */
74
+ interface TaskItemMutation {
75
+ id?: number;
76
+ ref?: string;
77
+ subject?: string;
78
+ description?: string;
79
+ activeForm?: string;
80
+ status?: TaskStatus;
81
+ blockedBy?: DepToken[];
82
+ addBlockedBy?: DepToken[];
83
+ removeBlockedBy?: DepToken[];
84
+ owner?: string;
85
+ metadata?: Record<string, unknown>;
86
+ }
87
+ /**
88
+ * What one upsert item did. `index` is its position in the request array, so a
89
+ * model reading a partial result can tell which entries still need resending.
90
+ *
91
+ * `message` is unprefixed: the `item[N] failed:` framing belongs to the
92
+ * formatter, because the Task Space overlay shows this text on its own.
93
+ */
94
+ type UpsertItemOutcome = {
95
+ index: number;
96
+ kind: 'created';
97
+ id: number;
98
+ subject: string;
99
+ status: TaskStatus;
100
+ ref?: string;
101
+ blockedBy?: number[];
102
+ } | {
103
+ index: number;
104
+ kind: 'updated';
105
+ id: number;
106
+ fromStatus: TaskStatus;
107
+ toStatus: TaskStatus;
108
+ } | {
109
+ index: number;
110
+ kind: 'unchanged';
111
+ id: number;
112
+ status: TaskStatus;
113
+ } | {
114
+ index: number;
115
+ kind: 'failed';
116
+ message: string;
117
+ id?: number;
118
+ ref?: string;
119
+ };
120
+ /** Which tasks an upsert touched, so renderResult names them instead of guessing. */
121
+ interface UpsertSummary {
122
+ /** Ids of applied entries, in request order. A failed entry contributes nothing. */
123
+ applied: number[];
124
+ failed: number;
125
+ }
126
+ /** One task-to-agent handoff inside a native assignment batch. */
127
+ interface TaskAssignment {
128
+ id: number;
129
+ agent: string;
130
+ inlineAgent?: InlineAgent;
131
+ instructions?: string;
132
+ relevantFiles?: string[];
133
+ priorFindings?: string;
134
+ model?: string;
135
+ context?: 'fresh' | 'fork';
136
+ }
137
+ /** Which assignment entries started, so renderResult can show one consolidated batch. */
138
+ interface AssignmentSummary {
139
+ /** Ids of successful entries, in request order. A failed entry contributes nothing. */
140
+ assigned: number[];
141
+ failed: number;
142
+ }
143
+ /**
144
+ * Open-shape input bag the reducer accepts. The index signature lets the
145
+ * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without
146
+ * casting each field.
147
+ *
148
+ * Per-task fields live on `tasks[]`, not here: a top-level `subject` or
149
+ * `status` would be ambiguous once one call can carry many tasks.
150
+ */
151
+ interface TaskMutationParams {
152
+ [key: string]: unknown;
153
+ tasks?: TaskItemMutation[];
154
+ /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */
155
+ assignments?: TaskAssignment[];
156
+ /** `list` filter only. To set a status, upsert the task by id. */
157
+ status?: TaskStatus;
158
+ /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */
159
+ id?: number;
160
+ includeDeleted?: boolean;
161
+ }
162
+ /** Snapshot returned under a tool result's `details` for renderResult. */
163
+ interface TaskDetails {
164
+ action: TaskAction;
165
+ params: Record<string, unknown>;
166
+ tasks: Task[];
167
+ nextId: number;
168
+ rev: number;
169
+ error?: string;
170
+ upsert?: UpsertSummary;
171
+ assignment?: AssignmentSummary;
172
+ }
173
+ /** A delegation is "live" while the owning run may still produce a response. */
174
+ declare function isDelegationActive(task: Task): boolean;
175
+ //#endregion
176
+ export { AssignmentSummary, DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskAssignment, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
177
+ //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/services/store/types.ts"],"mappings":";;KAUY;cAEC,gBAAgB;KAEjB;KAEA;;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;;;UAUe;EACf;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA,WAAW;EACX;EACA;EACA,aAAa;;cAGF;;UAGI;EACf;EACA;EACA;EACA,OAAO;;iBAGO,iBAAiB;;;;;;;;KAWrB;;;;;;;;;UAUK;EACf;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,YAAY;EACZ,eAAe;EACf,kBAAkB;EAClB;EACA,WAAW;;;;;;;;;KAUD;EAEN;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;;EAEA;EAAe;EAAiB;EAAY,YAAY;EAAY,UAAU;;EAC9E;EAAe;EAAmB;EAAY,QAAQ;;EACtD;EAAe;EAAgB;EAAiB;EAAa;;;UAGlD;;EAEf;EACA;;;UAIe;EACf;EACA;EACA,cAAc;EACd;EACA;EACA;EACA;EACA;;;UAIe;;EAEf;EACA;;;;;;;;;;UAWe;GACd;EACD,QAAQ;;EAER,cAAc;;EAEd,SAAS;;EAET;EACA;;;UAIe;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,SAAS;EACT,aAAa;;;iBAIC,mBAAmB,MAAM"}
@@ -0,0 +1,177 @@
1
+ import { InlineAgent } from "@agimon-ai/doompi-extension-contracts/subagent-tool";
2
+ //#region src/services/store/types.d.ts
3
+ type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
4
+ declare const DELETED_STATUS: TaskStatus;
5
+ type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';
6
+ type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';
7
+ /** Terminal result of a delegated subagent run, copied off the delegation response. */
8
+ interface DelegationResult {
9
+ status: string;
10
+ output?: string;
11
+ outputPath?: string;
12
+ sessionFile?: string;
13
+ error?: string;
14
+ durationMs?: number;
15
+ toolCount?: number;
16
+ }
17
+ /**
18
+ * Delegation bookkeeping attached to a task that was handed to a subagent.
19
+ *
20
+ * `pid` is the harness process that owns the run: it is the only way to tell an
21
+ * genuinely-running delegation from one orphaned by a harness crash, since the
22
+ * child dies with its parent but the file survives.
23
+ */
24
+ interface TaskDelegation {
25
+ requestId: string;
26
+ agent: string;
27
+ state: DelegationState;
28
+ sessionId?: string;
29
+ pid?: number;
30
+ runId?: string;
31
+ model?: string;
32
+ startedAt?: string;
33
+ endedAt?: string;
34
+ result?: DelegationResult;
35
+ }
36
+ interface Task {
37
+ id: number;
38
+ subject: string;
39
+ description?: string;
40
+ activeForm?: string;
41
+ status: TaskStatus;
42
+ blockedBy?: number[];
43
+ owner?: string;
44
+ metadata?: Record<string, unknown>;
45
+ createdAt?: string;
46
+ updatedAt?: string;
47
+ delegation?: TaskDelegation;
48
+ }
49
+ declare const STORE_SCHEMA_VERSION = 1;
50
+ /** The complete on-disk document. `rev` increments on every committed write. */
51
+ interface TaskDocument {
52
+ version: number;
53
+ rev: number;
54
+ nextId: number;
55
+ tasks: Task[];
56
+ }
57
+ declare function emptyDocument(): TaskDocument;
58
+ /**
59
+ * A dependency target inside an upsert item: an existing task id, or the `ref`
60
+ * of a task created earlier in the same call.
61
+ *
62
+ * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally
63
+ * unconfusable with a stringified id and the discrimination is just `typeof`.
64
+ */
65
+ type DepToken = number | string;
66
+ /**
67
+ * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.
68
+ *
69
+ * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`
70
+ * (additive merge) are update-only, matching the split the two former actions
71
+ * had. A field used against the wrong kind fails that item rather than being
72
+ * silently ignored.
73
+ */
74
+ interface TaskItemMutation {
75
+ id?: number;
76
+ ref?: string;
77
+ subject?: string;
78
+ description?: string;
79
+ activeForm?: string;
80
+ status?: TaskStatus;
81
+ blockedBy?: DepToken[];
82
+ addBlockedBy?: DepToken[];
83
+ removeBlockedBy?: DepToken[];
84
+ owner?: string;
85
+ metadata?: Record<string, unknown>;
86
+ }
87
+ /**
88
+ * What one upsert item did. `index` is its position in the request array, so a
89
+ * model reading a partial result can tell which entries still need resending.
90
+ *
91
+ * `message` is unprefixed: the `item[N] failed:` framing belongs to the
92
+ * formatter, because the Task Space overlay shows this text on its own.
93
+ */
94
+ type UpsertItemOutcome = {
95
+ index: number;
96
+ kind: 'created';
97
+ id: number;
98
+ subject: string;
99
+ status: TaskStatus;
100
+ ref?: string;
101
+ blockedBy?: number[];
102
+ } | {
103
+ index: number;
104
+ kind: 'updated';
105
+ id: number;
106
+ fromStatus: TaskStatus;
107
+ toStatus: TaskStatus;
108
+ } | {
109
+ index: number;
110
+ kind: 'unchanged';
111
+ id: number;
112
+ status: TaskStatus;
113
+ } | {
114
+ index: number;
115
+ kind: 'failed';
116
+ message: string;
117
+ id?: number;
118
+ ref?: string;
119
+ };
120
+ /** Which tasks an upsert touched, so renderResult names them instead of guessing. */
121
+ interface UpsertSummary {
122
+ /** Ids of applied entries, in request order. A failed entry contributes nothing. */
123
+ applied: number[];
124
+ failed: number;
125
+ }
126
+ /** One task-to-agent handoff inside a native assignment batch. */
127
+ interface TaskAssignment {
128
+ id: number;
129
+ agent: string;
130
+ inlineAgent?: InlineAgent;
131
+ instructions?: string;
132
+ relevantFiles?: string[];
133
+ priorFindings?: string;
134
+ model?: string;
135
+ context?: 'fresh' | 'fork';
136
+ }
137
+ /** Which assignment entries started, so renderResult can show one consolidated batch. */
138
+ interface AssignmentSummary {
139
+ /** Ids of successful entries, in request order. A failed entry contributes nothing. */
140
+ assigned: number[];
141
+ failed: number;
142
+ }
143
+ /**
144
+ * Open-shape input bag the reducer accepts. The index signature lets the
145
+ * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without
146
+ * casting each field.
147
+ *
148
+ * Per-task fields live on `tasks[]`, not here: a top-level `subject` or
149
+ * `status` would be ambiguous once one call can carry many tasks.
150
+ */
151
+ interface TaskMutationParams {
152
+ [key: string]: unknown;
153
+ tasks?: TaskItemMutation[];
154
+ /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */
155
+ assignments?: TaskAssignment[];
156
+ /** `list` filter only. To set a status, upsert the task by id. */
157
+ status?: TaskStatus;
158
+ /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */
159
+ id?: number;
160
+ includeDeleted?: boolean;
161
+ }
162
+ /** Snapshot returned under a tool result's `details` for renderResult. */
163
+ interface TaskDetails {
164
+ action: TaskAction;
165
+ params: Record<string, unknown>;
166
+ tasks: Task[];
167
+ nextId: number;
168
+ rev: number;
169
+ error?: string;
170
+ upsert?: UpsertSummary;
171
+ assignment?: AssignmentSummary;
172
+ }
173
+ /** A delegation is "live" while the owning run may still produce a response. */
174
+ declare function isDelegationActive(task: Task): boolean;
175
+ //#endregion
176
+ export { AssignmentSummary, DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskAssignment, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
177
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../../src/services/store/types.ts"],"mappings":";;KAUY;cAEC,gBAAgB;KAEjB;KAEA;;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;;;UAUe;EACf;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA,WAAW;EACX;EACA;EACA,aAAa;;cAGF;;UAGI;EACf;EACA;EACA;EACA,OAAO;;iBAGO,iBAAiB;;;;;;;;KAWrB;;;;;;;;;UAUK;EACf;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,YAAY;EACZ,eAAe;EACf,kBAAkB;EAClB;EACA,WAAW;;;;;;;;;KAUD;EAEN;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;;EAEA;EAAe;EAAiB;EAAY,YAAY;EAAY,UAAU;;EAC9E;EAAe;EAAmB;EAAY,QAAQ;;EACtD;EAAe;EAAgB;EAAiB;EAAa;;;UAGlD;;EAEf;EACA;;;UAIe;EACf;EACA;EACA,cAAc;EACd;EACA;EACA;EACA;EACA;;;UAIe;;EAEf;EACA;;;;;;;;;;UAWe;GACd;EACD,QAAQ;;EAER,cAAc;;EAEd,SAAS;;EAET;EACA;;;UAIe;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,SAAS;EACT,aAAa;;;iBAIC,mBAAmB,MAAM"}
@@ -0,0 +1,2 @@
1
+ const e=`deleted`,t=1;function n(){return{version:1,rev:0,nextId:1,tasks:[]}}function r(e){let t=e.delegation?.state;return t===`requested`||t===`running`}export{e as DELETED_STATUS,t as STORE_SCHEMA_VERSION,n as emptyDocument,r as isDelegationActive};
2
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../../src/services/store/types.ts"],"sourcesContent":["/**\n * Domain types for the file-backed task store.\n *\n * The on-disk document is the durable source of truth (unlike rpiv-todo, which\n * replayed state from the transcript). Every field here round-trips through\n * JSON, so nothing may hold non-serializable values.\n */\n\nimport type { InlineAgent } from '@agimon-ai/doompi-extension-contracts/subagent-tool';\n\nexport type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';\n\nexport const DELETED_STATUS: TaskStatus = 'deleted';\n\nexport type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';\n\nexport type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';\n\n/** Terminal result of a delegated subagent run, copied off the delegation response. */\nexport interface DelegationResult {\n status: string;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n error?: string;\n durationMs?: number;\n toolCount?: number;\n}\n\n/**\n * Delegation bookkeeping attached to a task that was handed to a subagent.\n *\n * `pid` is the harness process that owns the run: it is the only way to tell an\n * genuinely-running delegation from one orphaned by a harness crash, since the\n * child dies with its parent but the file survives.\n */\nexport interface TaskDelegation {\n requestId: string;\n agent: string;\n state: DelegationState;\n sessionId?: string;\n pid?: number;\n runId?: string;\n model?: string;\n startedAt?: string;\n endedAt?: string;\n result?: DelegationResult;\n}\n\nexport interface Task {\n id: number;\n subject: string;\n description?: string;\n activeForm?: string;\n status: TaskStatus;\n blockedBy?: number[];\n owner?: string;\n metadata?: Record<string, unknown>;\n createdAt?: string;\n updatedAt?: string;\n delegation?: TaskDelegation;\n}\n\nexport const STORE_SCHEMA_VERSION = 1;\n\n/** The complete on-disk document. `rev` increments on every committed write. */\nexport interface TaskDocument {\n version: number;\n rev: number;\n nextId: number;\n tasks: Task[];\n}\n\nexport function emptyDocument(): TaskDocument {\n return { version: STORE_SCHEMA_VERSION, rev: 0, nextId: 1, tasks: [] };\n}\n\n/**\n * A dependency target inside an upsert item: an existing task id, or the `ref`\n * of a task created earlier in the same call.\n *\n * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally\n * unconfusable with a stringified id and the discrimination is just `typeof`.\n */\nexport type DepToken = number | string;\n\n/**\n * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.\n *\n * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`\n * (additive merge) are update-only, matching the split the two former actions\n * had. A field used against the wrong kind fails that item rather than being\n * silently ignored.\n */\nexport interface TaskItemMutation {\n id?: number;\n ref?: string;\n subject?: string;\n description?: string;\n activeForm?: string;\n status?: TaskStatus;\n blockedBy?: DepToken[];\n addBlockedBy?: DepToken[];\n removeBlockedBy?: DepToken[];\n owner?: string;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * What one upsert item did. `index` is its position in the request array, so a\n * model reading a partial result can tell which entries still need resending.\n *\n * `message` is unprefixed: the `item[N] failed:` framing belongs to the\n * formatter, because the Task Space overlay shows this text on its own.\n */\nexport type UpsertItemOutcome =\n | {\n index: number;\n kind: 'created';\n id: number;\n subject: string;\n status: TaskStatus;\n ref?: string;\n blockedBy?: number[];\n }\n | { index: number; kind: 'updated'; id: number; fromStatus: TaskStatus; toStatus: TaskStatus }\n | { index: number; kind: 'unchanged'; id: number; status: TaskStatus }\n | { index: number; kind: 'failed'; message: string; id?: number; ref?: string };\n\n/** Which tasks an upsert touched, so renderResult names them instead of guessing. */\nexport interface UpsertSummary {\n /** Ids of applied entries, in request order. A failed entry contributes nothing. */\n applied: number[];\n failed: number;\n}\n\n/** One task-to-agent handoff inside a native assignment batch. */\nexport interface TaskAssignment {\n id: number;\n agent: string;\n inlineAgent?: InlineAgent;\n instructions?: string;\n relevantFiles?: string[];\n priorFindings?: string;\n model?: string;\n context?: 'fresh' | 'fork';\n}\n\n/** Which assignment entries started, so renderResult can show one consolidated batch. */\nexport interface AssignmentSummary {\n /** Ids of successful entries, in request order. A failed entry contributes nothing. */\n assigned: number[];\n failed: number;\n}\n\n/**\n * Open-shape input bag the reducer accepts. The index signature lets the\n * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without\n * casting each field.\n *\n * Per-task fields live on `tasks[]`, not here: a top-level `subject` or\n * `status` would be ambiguous once one call can carry many tasks.\n */\nexport interface TaskMutationParams {\n [key: string]: unknown;\n tasks?: TaskItemMutation[];\n /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */\n assignments?: TaskAssignment[];\n /** `list` filter only. To set a status, upsert the task by id. */\n status?: TaskStatus;\n /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */\n id?: number;\n includeDeleted?: boolean;\n}\n\n/** Snapshot returned under a tool result's `details` for renderResult. */\nexport interface TaskDetails {\n action: TaskAction;\n params: Record<string, unknown>;\n tasks: Task[];\n nextId: number;\n rev: number;\n error?: string;\n upsert?: UpsertSummary;\n assignment?: AssignmentSummary;\n}\n\n/** A delegation is \"live\" while the owning run may still produce a response. */\nexport function isDelegationActive(task: Task): boolean {\n const state = task.delegation?.state;\n return state === 'requested' || state === 'running';\n}\n"],"mappings":"AAYA,MAAa,EAA6B,UAmD7B,EAAuB,EAUpC,SAAgB,GAA8B,CAC5C,MAAO,CAAE,QAAA,EAA+B,IAAK,EAAG,OAAQ,EAAG,MAAO,CAAC,CAAE,CACvE,CAiHA,SAAgB,EAAmB,EAAqB,CACtD,IAAM,EAAQ,EAAK,YAAY,MAC/B,OAAO,IAAU,aAAe,IAAU,SAC5C"}
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e={pending:new Set([`in_progress`,`completed`,`failed`,`deleted`]),in_progress:new Set([`pending`,`completed`,`failed`,`deleted`]),failed:new Set([`pending`,`in_progress`,`completed`,`deleted`]),completed:new Set([`deleted`]),deleted:new Set};function t(t,n){return t===n||e[t].has(n)}exports.VALID_TRANSITIONS=e,exports.isTransitionValid=t;
2
- //# sourceMappingURL=invariants.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../services/store/invariants.cjs");exports.VALID_TRANSITIONS=e.VALID_TRANSITIONS,exports.canonicalizeTasks=e.canonicalizeTasks,exports.isTransitionValid=e.isTransitionValid;
@@ -1,14 +1,2 @@
1
- import { TaskStatus } from "./types.cjs";
2
- //#region src/store/invariants.d.ts
3
- /**
4
- * Allowed forward transitions per source status.
5
- *
6
- * `failed` is recoverable (a delegation can be retried) so it may return to
7
- * pending or in_progress. `completed` is one-way to `deleted`; `deleted` is a
8
- * terminal tombstone.
9
- */
10
- declare const VALID_TRANSITIONS: Record<TaskStatus, ReadonlySet<TaskStatus>>;
11
- declare function isTransitionValid(from: TaskStatus, to: TaskStatus): boolean;
12
- //#endregion
13
- export { VALID_TRANSITIONS, isTransitionValid };
14
- //# sourceMappingURL=invariants.d.cts.map
1
+ import { VALID_TRANSITIONS, canonicalizeTasks, isTransitionValid } from "../services/store/invariants.cjs";
2
+ export { VALID_TRANSITIONS, canonicalizeTasks, isTransitionValid };
@@ -1,14 +1,2 @@
1
- import { TaskStatus } from "./types.mjs";
2
- //#region src/store/invariants.d.ts
3
- /**
4
- * Allowed forward transitions per source status.
5
- *
6
- * `failed` is recoverable (a delegation can be retried) so it may return to
7
- * pending or in_progress. `completed` is one-way to `deleted`; `deleted` is a
8
- * terminal tombstone.
9
- */
10
- declare const VALID_TRANSITIONS: Record<TaskStatus, ReadonlySet<TaskStatus>>;
11
- declare function isTransitionValid(from: TaskStatus, to: TaskStatus): boolean;
12
- //#endregion
13
- export { VALID_TRANSITIONS, isTransitionValid };
14
- //# sourceMappingURL=invariants.d.mts.map
1
+ import { VALID_TRANSITIONS, canonicalizeTasks, isTransitionValid } from "../services/store/invariants.mjs";
2
+ export { VALID_TRANSITIONS, canonicalizeTasks, isTransitionValid };
@@ -1,2 +1 @@
1
- const e={pending:new Set([`in_progress`,`completed`,`failed`,`deleted`]),in_progress:new Set([`pending`,`completed`,`failed`,`deleted`]),failed:new Set([`pending`,`in_progress`,`completed`,`deleted`]),completed:new Set([`deleted`]),deleted:new Set};function t(t,n){return t===n||e[t].has(n)}export{e as VALID_TRANSITIONS,t as isTransitionValid};
2
- //# sourceMappingURL=invariants.mjs.map
1
+ import{VALID_TRANSITIONS as e,canonicalizeTasks as t,isTransitionValid as n}from"../services/store/invariants.mjs";export{e as VALID_TRANSITIONS,t as canonicalizeTasks,n as isTransitionValid};
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../_virtual/_rolldown/runtime.cjs");let t=require("node:path");t=e.__toESM(t,1);let n=require("node:os");n=e.__toESM(n,1);let r=require("node:child_process"),i=require("node:fs");i=e.__toESM(i,1);let a=require("@agimon-ai/doompi-extension-contracts/child-process");const o=`DOOM_TASK_STORE`,s=`doom-task`,c=`tasks.json`,l=`utf8`;function u(e,t){try{let n=(0,r.execFileSync)(`git`,e,{cwd:t,encoding:l,stdio:[`ignore`,`pipe`,`ignore`]}).trim();return n.length>0?n:void 0}catch{return}}function d(e){let r=e.PI_CODING_AGENT_DIR?.trim();return r===`~`?n.default.homedir():r?.startsWith(`~/`)?t.default.join(n.default.homedir(),r.slice(2)):r?t.default.resolve(r):t.default.join(n.default.homedir(),`.pi`,`agent`)}function f(e,n){let r=t.default.relative(t.default.resolve(e),t.default.resolve(n));return r===``||!r.startsWith(`..`)&&!t.default.isAbsolute(r)}function p(e,t=process.env){if(!t[a.SUBAGENT_CHILD_ENV])return e;let n=t[a.SUBAGENT_PARENT_SESSION_ENV]?.trim();if(!n)throw Error(`${a.SUBAGENT_PARENT_SESSION_ENV} is required in a subagent child`);return n}function m(e=process.cwd(),n=process.env,r=`standalone`){let i=n[o]?.trim();if(i)return t.default.resolve(i);let a=r.trim();if(!a)throw Error(`doom-task session id cannot be blank`);return t.default.join(d(n),s,a,c)}function h(e=process.env){return!!e[o]?.trim()}function g(e=process.cwd()){let n=u([`rev-parse`,`--path-format=absolute`,`--git-common-dir`],e);return n?t.default.join(n,s):void 0}function _(e,n=process.cwd()){let r={removed:[],errors:[]},a=g(n);if(!a||t.default.basename(a)!==s||f(a,e))return r;try{if(!i.default.existsSync(a))return r;i.default.rmSync(a,{recursive:!0,force:!0}),r.removed.push(a)}catch(e){r.errors.push(`Could not remove legacy task store ${a}: ${String(e)}`)}return r}function v(e,n,r=Date.now()){let a={removed:[],errors:[]},o=t.default.dirname(e),s=t.default.dirname(o),u;try{u=i.default.readdirSync(s)}catch(e){return e.code===`ENOENT`||a.errors.push(`Could not read task store directory ${s}: ${String(e)}`),a}for(let e of u){let u=t.default.join(s,e),d=t.default.join(u,c);if(!(u===o||!i.default.existsSync(d)))try{if(i.default.existsSync(y(d))||(JSON.parse(i.default.readFileSync(d,l)),r-i.default.statSync(d).mtimeMs<=n))continue;i.default.rmSync(u,{recursive:!0,force:!0}),a.removed.push(u)}catch(e){a.errors.push(`Could not sweep task store ${d}: ${String(e)}`)}}return a}function y(e){return`${e}.lock`}function b(e,t=process.pid){return`${e}.tmp.${t}`}exports.STORE_PATH_ENV=o,exports.hasStorePathOverride=h,exports.lockPathFor=y,exports.removeLegacyStoreDirectory=_,exports.resolveLegacyStoreDirectory=g,exports.resolveSessionKey=p,exports.resolveStorePath=m,exports.sweepStoreFiles=v,exports.tempPathFor=b;
2
- //# sourceMappingURL=paths.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../adapters/store/paths.cjs");exports.STORE_PATH_ENV=e.STORE_PATH_ENV,exports.hasStorePathOverride=e.hasStorePathOverride,exports.lockPathFor=e.lockPathFor,exports.removeLegacyStoreDirectory=e.removeLegacyStoreDirectory,exports.removeLegacyStoreDirectoryAsync=e.removeLegacyStoreDirectoryAsync,exports.resolveLegacyStoreDirectory=e.resolveLegacyStoreDirectory,exports.resolveLegacyStoreDirectoryAsync=e.resolveLegacyStoreDirectoryAsync,exports.resolveSessionKey=e.resolveSessionKey,exports.resolveStorePath=e.resolveStorePath,exports.sweepStoreFiles=e.sweepStoreFiles,exports.sweepStoreFilesAsync=e.sweepStoreFilesAsync,exports.tempPathFor=e.tempPathFor;
@@ -1,23 +1,2 @@
1
- //#region src/store/paths.d.ts
2
- declare const STORE_PATH_ENV = "DOOM_TASK_STORE";
3
- /** Resolve the tree root without relying on extension startup order. */
4
- declare function resolveSessionKey(rootSessionId: string, env?: NodeJS.ProcessEnv): string;
5
- /** Resolve one root session tree to a task document under the Pi agent directory. */
6
- declare function resolveStorePath(_cwd?: string, env?: NodeJS.ProcessEnv, sessionKey?: string): string;
7
- /** Whether a deliberate unscoped task-store override is active. */
8
- declare function hasStorePathOverride(env?: NodeJS.ProcessEnv): boolean;
9
- /** Exact legacy Git-directory store, if the current working tree has one. */
10
- declare function resolveLegacyStoreDirectory(cwd?: string): string | undefined;
11
- interface StoreSweepResult {
12
- removed: string[];
13
- errors: string[];
14
- }
15
- /** Remove only the validated legacy Git store unless it contains the active override. */
16
- declare function removeLegacyStoreDirectory(currentStorePath: string, cwd?: string): StoreSweepResult;
17
- /** Delete expired sibling session stores while preserving active or unreadable stores. */
18
- declare function sweepStoreFiles(currentStorePath: string, ttlMs: number, now?: number): StoreSweepResult;
19
- declare function lockPathFor(storePath: string): string;
20
- declare function tempPathFor(storePath: string, pid?: number): string;
21
- //#endregion
22
- export { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, resolveLegacyStoreDirectory, resolveSessionKey, resolveStorePath, sweepStoreFiles, tempPathFor };
23
- //# sourceMappingURL=paths.d.cts.map
1
+ import { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, sweepStoreFiles, sweepStoreFilesAsync, tempPathFor } from "../adapters/store/paths.cjs";
2
+ export { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, sweepStoreFiles, sweepStoreFilesAsync, tempPathFor };
@@ -1,23 +1,2 @@
1
- //#region src/store/paths.d.ts
2
- declare const STORE_PATH_ENV = "DOOM_TASK_STORE";
3
- /** Resolve the tree root without relying on extension startup order. */
4
- declare function resolveSessionKey(rootSessionId: string, env?: NodeJS.ProcessEnv): string;
5
- /** Resolve one root session tree to a task document under the Pi agent directory. */
6
- declare function resolveStorePath(_cwd?: string, env?: NodeJS.ProcessEnv, sessionKey?: string): string;
7
- /** Whether a deliberate unscoped task-store override is active. */
8
- declare function hasStorePathOverride(env?: NodeJS.ProcessEnv): boolean;
9
- /** Exact legacy Git-directory store, if the current working tree has one. */
10
- declare function resolveLegacyStoreDirectory(cwd?: string): string | undefined;
11
- interface StoreSweepResult {
12
- removed: string[];
13
- errors: string[];
14
- }
15
- /** Remove only the validated legacy Git store unless it contains the active override. */
16
- declare function removeLegacyStoreDirectory(currentStorePath: string, cwd?: string): StoreSweepResult;
17
- /** Delete expired sibling session stores while preserving active or unreadable stores. */
18
- declare function sweepStoreFiles(currentStorePath: string, ttlMs: number, now?: number): StoreSweepResult;
19
- declare function lockPathFor(storePath: string): string;
20
- declare function tempPathFor(storePath: string, pid?: number): string;
21
- //#endregion
22
- export { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, resolveLegacyStoreDirectory, resolveSessionKey, resolveStorePath, sweepStoreFiles, tempPathFor };
23
- //# sourceMappingURL=paths.d.mts.map
1
+ import { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, sweepStoreFiles, sweepStoreFilesAsync, tempPathFor } from "../adapters/store/paths.mjs";
2
+ export { STORE_PATH_ENV, StoreSweepResult, hasStorePathOverride, lockPathFor, removeLegacyStoreDirectory, removeLegacyStoreDirectoryAsync, resolveLegacyStoreDirectory, resolveLegacyStoreDirectoryAsync, resolveSessionKey, resolveStorePath, sweepStoreFiles, sweepStoreFilesAsync, tempPathFor };
@@ -1,2 +1 @@
1
- import e from"node:path";import t from"node:os";import{execFileSync as n}from"node:child_process";import r from"node:fs";import{SUBAGENT_CHILD_ENV as i,SUBAGENT_PARENT_SESSION_ENV as a}from"@agimon-ai/doompi-extension-contracts/child-process";const o=`DOOM_TASK_STORE`,s=`doom-task`,c=`tasks.json`,l=`utf8`;function u(e,t){try{let r=n(`git`,e,{cwd:t,encoding:l,stdio:[`ignore`,`pipe`,`ignore`]}).trim();return r.length>0?r:void 0}catch{return}}function d(n){let r=n.PI_CODING_AGENT_DIR?.trim();return r===`~`?t.homedir():r?.startsWith(`~/`)?e.join(t.homedir(),r.slice(2)):r?e.resolve(r):e.join(t.homedir(),`.pi`,`agent`)}function f(t,n){let r=e.relative(e.resolve(t),e.resolve(n));return r===``||!r.startsWith(`..`)&&!e.isAbsolute(r)}function p(e,t=process.env){if(!t[i])return e;let n=t[a]?.trim();if(!n)throw Error(`${a} is required in a subagent child`);return n}function m(t=process.cwd(),n=process.env,r=`standalone`){let i=n[o]?.trim();if(i)return e.resolve(i);let a=r.trim();if(!a)throw Error(`doom-task session id cannot be blank`);return e.join(d(n),s,a,c)}function h(e=process.env){return!!e[o]?.trim()}function g(t=process.cwd()){let n=u([`rev-parse`,`--path-format=absolute`,`--git-common-dir`],t);return n?e.join(n,s):void 0}function _(t,n=process.cwd()){let i={removed:[],errors:[]},a=g(n);if(!a||e.basename(a)!==s||f(a,t))return i;try{if(!r.existsSync(a))return i;r.rmSync(a,{recursive:!0,force:!0}),i.removed.push(a)}catch(e){i.errors.push(`Could not remove legacy task store ${a}: ${String(e)}`)}return i}function v(t,n,i=Date.now()){let a={removed:[],errors:[]},o=e.dirname(t),s=e.dirname(o),u;try{u=r.readdirSync(s)}catch(e){return e.code===`ENOENT`||a.errors.push(`Could not read task store directory ${s}: ${String(e)}`),a}for(let t of u){let u=e.join(s,t),d=e.join(u,c);if(!(u===o||!r.existsSync(d)))try{if(r.existsSync(y(d))||(JSON.parse(r.readFileSync(d,l)),i-r.statSync(d).mtimeMs<=n))continue;r.rmSync(u,{recursive:!0,force:!0}),a.removed.push(u)}catch(e){a.errors.push(`Could not sweep task store ${d}: ${String(e)}`)}}return a}function y(e){return`${e}.lock`}function b(e,t=process.pid){return`${e}.tmp.${t}`}export{o as STORE_PATH_ENV,h as hasStorePathOverride,y as lockPathFor,_ as removeLegacyStoreDirectory,g as resolveLegacyStoreDirectory,p as resolveSessionKey,m as resolveStorePath,v as sweepStoreFiles,b as tempPathFor};
2
- //# sourceMappingURL=paths.mjs.map
1
+ import{STORE_PATH_ENV as e,hasStorePathOverride as t,lockPathFor as n,removeLegacyStoreDirectory as r,removeLegacyStoreDirectoryAsync as i,resolveLegacyStoreDirectory as a,resolveLegacyStoreDirectoryAsync as o,resolveSessionKey as s,resolveStorePath as c,sweepStoreFiles as l,sweepStoreFilesAsync as u,tempPathFor as d}from"../adapters/store/paths.mjs";export{e as STORE_PATH_ENV,t as hasStorePathOverride,n as lockPathFor,r as removeLegacyStoreDirectory,i as removeLegacyStoreDirectoryAsync,a as resolveLegacyStoreDirectory,o as resolveLegacyStoreDirectoryAsync,s as resolveSessionKey,c as resolveStorePath,l as sweepStoreFiles,u as sweepStoreFilesAsync,d as tempPathFor};
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(e){try{return process.kill(e,0),!0}catch(e){return e.code===`EPERM`}}exports.isProcessAlive=e;
2
- //# sourceMappingURL=processLiveness.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../services/store/processLiveness.cjs");exports.isProcessAlive=e.isProcessAlive;