@agimon-ai/doompi-task 0.0.1-alpha.7 → 0.0.1-alpha.70

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 (439) hide show
  1. package/README.md +114 -15
  2. package/dist/api-contracts.cjs +1 -0
  3. package/dist/api-contracts.d.cts +2 -0
  4. package/dist/api-contracts.d.mts +2 -0
  5. package/dist/api-contracts.mjs +1 -0
  6. package/dist/commands.cjs +1 -2
  7. package/dist/commands.d.cts +2 -14
  8. package/dist/commands.d.mts +2 -14
  9. package/dist/commands.mjs +1 -2
  10. package/dist/config.cjs +1 -2
  11. package/dist/config.d.cts +2 -38
  12. package/dist/config.d.mts +2 -38
  13. package/dist/config.mjs +1 -2
  14. package/dist/constants/promptGuidelines.cjs +2 -0
  15. package/dist/constants/promptGuidelines.cjs.map +1 -0
  16. package/dist/constants/promptGuidelines.d.cts +13 -0
  17. package/dist/constants/promptGuidelines.d.cts.map +1 -0
  18. package/dist/constants/promptGuidelines.d.mts +13 -0
  19. package/dist/constants/promptGuidelines.d.mts.map +1 -0
  20. package/dist/constants/promptGuidelines.mjs +2 -0
  21. package/dist/constants/promptGuidelines.mjs.map +1 -0
  22. package/dist/constants/task.cjs +2 -0
  23. package/dist/constants/task.cjs.map +1 -0
  24. package/dist/constants/task.d.cts +4 -0
  25. package/dist/constants/task.d.cts.map +1 -0
  26. package/dist/constants/task.d.mts +4 -0
  27. package/dist/constants/task.d.mts.map +1 -0
  28. package/dist/constants/task.mjs +2 -0
  29. package/dist/constants/task.mjs.map +1 -0
  30. package/dist/controllers/tasksCommand.cjs +2 -0
  31. package/dist/controllers/tasksCommand.cjs.map +1 -0
  32. package/dist/controllers/tasksCommand.d.cts +15 -0
  33. package/dist/controllers/tasksCommand.d.cts.map +1 -0
  34. package/dist/controllers/tasksCommand.d.mts +15 -0
  35. package/dist/controllers/tasksCommand.d.mts.map +1 -0
  36. package/dist/controllers/tasksCommand.mjs +2 -0
  37. package/dist/controllers/tasksCommand.mjs.map +1 -0
  38. package/dist/controllers/webTasksChannel.cjs +2 -0
  39. package/dist/controllers/webTasksChannel.cjs.map +1 -0
  40. package/dist/controllers/webTasksChannel.mjs +2 -0
  41. package/dist/controllers/webTasksChannel.mjs.map +1 -0
  42. package/dist/delegation-manager.cjs +1 -0
  43. package/dist/delegation-manager.d.cts +3 -0
  44. package/dist/delegation-manager.d.mts +3 -0
  45. package/dist/delegation-manager.mjs +1 -0
  46. package/dist/extensions/pi.cjs +2 -1
  47. package/dist/extensions/pi.cjs.map +1 -1
  48. package/dist/extensions/pi.d.cts +6 -2
  49. package/dist/extensions/pi.d.cts.map +1 -0
  50. package/dist/extensions/pi.d.mts +6 -2
  51. package/dist/extensions/pi.d.mts.map +1 -0
  52. package/dist/extensions/pi.mjs +2 -1
  53. package/dist/extensions/pi.mjs.map +1 -1
  54. package/dist/extensions/server.cjs +2 -0
  55. package/dist/extensions/server.cjs.map +1 -0
  56. package/dist/extensions/server.d.cts +5 -0
  57. package/dist/extensions/server.d.cts.map +1 -0
  58. package/dist/extensions/server.d.mts +5 -0
  59. package/dist/extensions/server.d.mts.map +1 -0
  60. package/dist/extensions/server.mjs +2 -0
  61. package/dist/extensions/server.mjs.map +1 -0
  62. package/dist/index.cjs +1 -1
  63. package/dist/index.d.cts +15 -14
  64. package/dist/index.d.mts +15 -14
  65. package/dist/index.mjs +1 -1
  66. package/dist/logSinkTelemetry.cjs +1 -2
  67. package/dist/logSinkTelemetry.d.cts +3 -51
  68. package/dist/logSinkTelemetry.d.mts +3 -51
  69. package/dist/logSinkTelemetry.mjs +1 -2
  70. package/dist/models/task.cjs +2 -0
  71. package/dist/models/task.cjs.map +1 -0
  72. package/dist/{store/types.d.cts → models/task.d.cts} +41 -30
  73. package/dist/models/task.d.cts.map +1 -0
  74. package/dist/{store/types.d.mts → models/task.d.mts} +41 -30
  75. package/dist/models/task.d.mts.map +1 -0
  76. package/dist/{store/types.mjs → models/task.mjs} +1 -1
  77. package/dist/models/task.mjs.map +1 -0
  78. package/dist/models/taskGraph.cjs +2 -0
  79. package/dist/models/taskGraph.cjs.map +1 -0
  80. package/dist/{store → models}/taskGraph.d.cts +7 -8
  81. package/dist/models/taskGraph.d.cts.map +1 -0
  82. package/dist/{store → models}/taskGraph.d.mts +7 -8
  83. package/dist/models/taskGraph.d.mts.map +1 -0
  84. package/dist/models/taskGraph.mjs.map +1 -0
  85. package/dist/schemas/apiContracts.cjs +2 -0
  86. package/dist/schemas/apiContracts.cjs.map +1 -0
  87. package/dist/schemas/apiContracts.d.cts +53 -0
  88. package/dist/schemas/apiContracts.d.cts.map +1 -0
  89. package/dist/schemas/apiContracts.d.mts +53 -0
  90. package/dist/schemas/apiContracts.d.mts.map +1 -0
  91. package/dist/schemas/apiContracts.mjs +2 -0
  92. package/dist/schemas/apiContracts.mjs.map +1 -0
  93. package/dist/schemas/task.cjs +2 -0
  94. package/dist/schemas/task.cjs.map +1 -0
  95. package/dist/{tool/schema.d.cts → schemas/task.d.cts} +46 -29
  96. package/dist/schemas/task.d.cts.map +1 -0
  97. package/dist/{tool/schema.d.mts → schemas/task.d.mts} +46 -29
  98. package/dist/schemas/task.d.mts.map +1 -0
  99. package/dist/schemas/task.mjs +2 -0
  100. package/dist/schemas/task.mjs.map +1 -0
  101. package/dist/services/config/index.cjs +2 -0
  102. package/dist/services/config/index.cjs.map +1 -0
  103. package/dist/services/config/index.d.cts +42 -0
  104. package/dist/services/config/index.d.cts.map +1 -0
  105. package/dist/services/config/index.d.mts +42 -0
  106. package/dist/services/config/index.d.mts.map +1 -0
  107. package/dist/services/config/index.mjs +2 -0
  108. package/dist/services/config/index.mjs.map +1 -0
  109. package/dist/services/contextContribution/index.cjs +3 -0
  110. package/dist/services/contextContribution/index.cjs.map +1 -0
  111. package/dist/services/contextContribution/index.mjs +3 -0
  112. package/dist/services/contextContribution/index.mjs.map +1 -0
  113. package/dist/services/delegation/index.cjs +6 -0
  114. package/dist/services/delegation/index.cjs.map +1 -0
  115. package/dist/{delegation/manager.d.cts → services/delegation/index.d.cts} +52 -49
  116. package/dist/services/delegation/index.d.cts.map +1 -0
  117. package/dist/{delegation/manager.d.mts → services/delegation/index.d.mts} +52 -49
  118. package/dist/services/delegation/index.d.mts.map +1 -0
  119. package/dist/services/delegation/index.mjs +6 -0
  120. package/dist/services/delegation/index.mjs.map +1 -0
  121. package/dist/services/delegationPlatform/index.cjs +2 -0
  122. package/dist/services/delegationPlatform/index.cjs.map +1 -0
  123. package/dist/services/delegationPlatform/index.mjs +2 -0
  124. package/dist/services/delegationPlatform/index.mjs.map +1 -0
  125. package/dist/services/invariants/index.cjs +2 -0
  126. package/dist/services/invariants/index.cjs.map +1 -0
  127. package/dist/services/invariants/index.d.cts +23 -0
  128. package/dist/services/invariants/index.d.cts.map +1 -0
  129. package/dist/services/invariants/index.d.mts +23 -0
  130. package/dist/services/invariants/index.d.mts.map +1 -0
  131. package/dist/services/invariants/index.mjs +2 -0
  132. package/dist/services/invariants/index.mjs.map +1 -0
  133. package/dist/services/logSinkTelemetry/index.cjs +2 -0
  134. package/dist/services/logSinkTelemetry/index.cjs.map +1 -0
  135. package/dist/services/logSinkTelemetry/index.d.cts +23 -0
  136. package/dist/services/logSinkTelemetry/index.d.cts.map +1 -0
  137. package/dist/services/logSinkTelemetry/index.d.mts +23 -0
  138. package/dist/services/logSinkTelemetry/index.d.mts.map +1 -0
  139. package/dist/services/logSinkTelemetry/index.mjs +2 -0
  140. package/dist/services/logSinkTelemetry/index.mjs.map +1 -0
  141. package/dist/services/paths/index.cjs +2 -0
  142. package/dist/services/paths/index.cjs.map +1 -0
  143. package/dist/services/paths/index.d.cts +25 -0
  144. package/dist/services/paths/index.d.cts.map +1 -0
  145. package/dist/services/paths/index.d.mts +25 -0
  146. package/dist/services/paths/index.d.mts.map +1 -0
  147. package/dist/services/paths/index.mjs +2 -0
  148. package/dist/services/paths/index.mjs.map +1 -0
  149. package/dist/services/processLiveness/index.cjs +2 -0
  150. package/dist/services/processLiveness/index.cjs.map +1 -0
  151. package/dist/{store/processLiveness.d.cts → services/processLiveness/index.d.cts} +3 -4
  152. package/dist/services/processLiveness/index.d.cts.map +1 -0
  153. package/dist/{store/processLiveness.d.mts → services/processLiveness/index.d.mts} +3 -4
  154. package/dist/services/processLiveness/index.d.mts.map +1 -0
  155. package/dist/{store/processLiveness.mjs → services/processLiveness/index.mjs} +1 -1
  156. package/dist/services/processLiveness/index.mjs.map +1 -0
  157. package/dist/services/reconcile/index.cjs +2 -0
  158. package/dist/services/reconcile/index.cjs.map +1 -0
  159. package/dist/{store/reconcile.d.cts → services/reconcile/index.d.cts} +8 -9
  160. package/dist/services/reconcile/index.d.cts.map +1 -0
  161. package/dist/{store/reconcile.d.mts → services/reconcile/index.d.mts} +8 -9
  162. package/dist/services/reconcile/index.d.mts.map +1 -0
  163. package/dist/services/reconcile/index.mjs +2 -0
  164. package/dist/services/reconcile/index.mjs.map +1 -0
  165. package/dist/services/reducer/index.cjs +3 -0
  166. package/dist/services/reducer/index.cjs.map +1 -0
  167. package/dist/{store/reducer.d.cts → services/reducer/index.d.cts} +12 -13
  168. package/dist/services/reducer/index.d.cts.map +1 -0
  169. package/dist/{store/reducer.d.mts → services/reducer/index.d.mts} +12 -13
  170. package/dist/services/reducer/index.d.mts.map +1 -0
  171. package/dist/services/reducer/index.mjs +3 -0
  172. package/dist/services/reducer/index.mjs.map +1 -0
  173. package/dist/services/taskNarration/index.cjs +2 -0
  174. package/dist/services/taskNarration/index.cjs.map +1 -0
  175. package/dist/services/taskNarration/index.mjs +2 -0
  176. package/dist/services/taskNarration/index.mjs.map +1 -0
  177. package/dist/services/taskResult/index.cjs +7 -0
  178. package/dist/services/taskResult/index.cjs.map +1 -0
  179. package/dist/services/taskResult/index.d.cts +50 -0
  180. package/dist/services/taskResult/index.d.cts.map +1 -0
  181. package/dist/services/taskResult/index.d.mts +50 -0
  182. package/dist/services/taskResult/index.d.mts.map +1 -0
  183. package/dist/services/taskResult/index.mjs +7 -0
  184. package/dist/services/taskResult/index.mjs.map +1 -0
  185. package/dist/services/taskStore/index.cjs +2 -0
  186. package/dist/services/taskStore/index.cjs.map +1 -0
  187. package/dist/{store/taskStore.d.cts → services/taskStore/index.d.cts} +17 -25
  188. package/dist/services/taskStore/index.d.cts.map +1 -0
  189. package/dist/{store/taskStore.d.mts → services/taskStore/index.d.mts} +17 -25
  190. package/dist/services/taskStore/index.d.mts.map +1 -0
  191. package/dist/services/taskStore/index.mjs +2 -0
  192. package/dist/services/taskStore/index.mjs.map +1 -0
  193. package/dist/store-invariants.cjs +1 -0
  194. package/dist/store-invariants.d.cts +2 -0
  195. package/dist/store-invariants.d.mts +2 -0
  196. package/dist/store-invariants.mjs +1 -0
  197. package/dist/store-paths.cjs +1 -0
  198. package/dist/store-paths.d.cts +2 -0
  199. package/dist/store-paths.d.mts +2 -0
  200. package/dist/store-paths.mjs +1 -0
  201. package/dist/store-process-liveness.cjs +1 -0
  202. package/dist/store-process-liveness.d.cts +2 -0
  203. package/dist/store-process-liveness.d.mts +2 -0
  204. package/dist/store-process-liveness.mjs +1 -0
  205. package/dist/store-reconcile.cjs +1 -0
  206. package/dist/store-reconcile.d.cts +2 -0
  207. package/dist/store-reconcile.d.mts +2 -0
  208. package/dist/store-reconcile.mjs +1 -0
  209. package/dist/store-reducer.cjs +1 -0
  210. package/dist/store-reducer.d.cts +2 -0
  211. package/dist/store-reducer.d.mts +2 -0
  212. package/dist/store-reducer.mjs +1 -0
  213. package/dist/store-task-graph.cjs +1 -0
  214. package/dist/store-task-graph.d.cts +2 -0
  215. package/dist/store-task-graph.d.mts +2 -0
  216. package/dist/store-task-graph.mjs +1 -0
  217. package/dist/store-task-store.cjs +1 -0
  218. package/dist/store-task-store.d.cts +2 -0
  219. package/dist/store-task-store.d.mts +2 -0
  220. package/dist/store-task-store.mjs +1 -0
  221. package/dist/store-types.cjs +1 -0
  222. package/dist/store-types.d.cts +2 -0
  223. package/dist/store-types.d.mts +2 -0
  224. package/dist/store-types.mjs +1 -0
  225. package/dist/tool-prompt-guidelines.cjs +1 -0
  226. package/dist/tool-prompt-guidelines.d.cts +2 -0
  227. package/dist/tool-prompt-guidelines.d.mts +2 -0
  228. package/dist/tool-prompt-guidelines.mjs +1 -0
  229. package/dist/tool-response-envelope.cjs +1 -0
  230. package/dist/tool-response-envelope.d.cts +2 -0
  231. package/dist/tool-response-envelope.d.mts +2 -0
  232. package/dist/tool-response-envelope.mjs +1 -0
  233. package/dist/tool-schema.cjs +1 -0
  234. package/dist/tool-schema.d.cts +3 -0
  235. package/dist/tool-schema.d.mts +3 -0
  236. package/dist/tool-schema.mjs +1 -0
  237. package/dist/tool-task-tool.cjs +1 -0
  238. package/dist/tool-task-tool.d.cts +3 -0
  239. package/dist/tool-task-tool.d.mts +3 -0
  240. package/dist/tool-task-tool.mjs +1 -0
  241. package/dist/tools/task.cjs +3 -0
  242. package/dist/tools/task.cjs.map +1 -0
  243. package/dist/tools/task.d.cts +22 -0
  244. package/dist/tools/task.d.cts.map +1 -0
  245. package/dist/tools/task.d.mts +22 -0
  246. package/dist/tools/task.d.mts.map +1 -0
  247. package/dist/tools/task.mjs +3 -0
  248. package/dist/tools/task.mjs.map +1 -0
  249. package/dist/tui/format.cjs +3 -3
  250. package/dist/tui/format.cjs.map +1 -1
  251. package/dist/tui/format.d.cts +19 -20
  252. package/dist/tui/format.d.cts.map +1 -1
  253. package/dist/tui/format.d.mts +19 -20
  254. package/dist/tui/format.d.mts.map +1 -1
  255. package/dist/tui/format.mjs +3 -3
  256. package/dist/tui/format.mjs.map +1 -1
  257. package/dist/tui/selectors.cjs +1 -1
  258. package/dist/tui/selectors.cjs.map +1 -1
  259. package/dist/tui/selectors.d.cts +20 -14
  260. package/dist/tui/selectors.d.cts.map +1 -1
  261. package/dist/tui/selectors.d.mts +20 -14
  262. package/dist/tui/selectors.d.mts.map +1 -1
  263. package/dist/tui/selectors.mjs +1 -1
  264. package/dist/tui/selectors.mjs.map +1 -1
  265. package/dist/tui/taskOverlay.cjs +1 -1
  266. package/dist/tui/taskOverlay.cjs.map +1 -1
  267. package/dist/tui/taskOverlay.d.cts +4 -5
  268. package/dist/tui/taskOverlay.d.cts.map +1 -1
  269. package/dist/tui/taskOverlay.d.mts +4 -5
  270. package/dist/tui/taskOverlay.d.mts.map +1 -1
  271. package/dist/tui/taskOverlay.mjs +1 -1
  272. package/dist/tui/taskOverlay.mjs.map +1 -1
  273. package/dist/tui/taskSpace.cjs +3 -3
  274. package/dist/tui/taskSpace.cjs.map +1 -1
  275. package/dist/tui/taskSpace.d.cts +9 -10
  276. package/dist/tui/taskSpace.d.cts.map +1 -1
  277. package/dist/tui/taskSpace.d.mts +9 -10
  278. package/dist/tui/taskSpace.d.mts.map +1 -1
  279. package/dist/tui/taskSpace.mjs +3 -3
  280. package/dist/tui/taskSpace.mjs.map +1 -1
  281. package/dist/tui-format.cjs +1 -0
  282. package/dist/tui-format.d.cts +2 -0
  283. package/dist/tui-format.d.mts +2 -0
  284. package/dist/tui-format.mjs +1 -0
  285. package/dist/tui-selectors.cjs +1 -0
  286. package/dist/tui-selectors.d.cts +2 -0
  287. package/dist/tui-selectors.d.mts +2 -0
  288. package/dist/tui-selectors.mjs +1 -0
  289. package/dist/tui-task-overlay.cjs +1 -0
  290. package/dist/tui-task-overlay.d.cts +2 -0
  291. package/dist/tui-task-overlay.d.mts +2 -0
  292. package/dist/tui-task-overlay.mjs +1 -0
  293. package/dist/tui-task-space.cjs +1 -0
  294. package/dist/tui-task-space.d.cts +2 -0
  295. package/dist/tui-task-space.d.mts +2 -0
  296. package/dist/tui-task-space.mjs +1 -0
  297. package/dist/types/delegation.cjs +2 -0
  298. package/dist/types/delegation.cjs.map +1 -0
  299. package/dist/types/delegation.d.cts +5 -0
  300. package/dist/types/delegation.d.cts.map +1 -0
  301. package/dist/types/delegation.d.mts +5 -0
  302. package/dist/types/delegation.d.mts.map +1 -0
  303. package/dist/types/delegation.mjs +2 -0
  304. package/dist/types/delegation.mjs.map +1 -0
  305. package/dist/types/telemetry.cjs +2 -0
  306. package/dist/types/telemetry.cjs.map +1 -0
  307. package/dist/types/telemetry.d.cts +35 -0
  308. package/dist/types/telemetry.d.cts.map +1 -0
  309. package/dist/types/telemetry.d.mts +35 -0
  310. package/dist/types/telemetry.d.mts.map +1 -0
  311. package/dist/types/telemetry.mjs +2 -0
  312. package/dist/types/telemetry.mjs.map +1 -0
  313. package/dist/types/webTasks.cjs +2 -0
  314. package/dist/types/webTasks.cjs.map +1 -0
  315. package/dist/types/webTasks.mjs +2 -0
  316. package/dist/types/webTasks.mjs.map +1 -0
  317. package/package.json +158 -109
  318. package/src/extensions/web.ts +18 -0
  319. package/src/types/webTasks.ts +24 -0
  320. package/src/web/components/TaskDetailDialog.tsx +251 -0
  321. package/src/web/components/TaskToolMessage.tsx +120 -0
  322. package/src/web/components/TasksActivitySection.tsx +200 -0
  323. package/src/web/lib/taskToolFormat.ts +330 -0
  324. package/src/web/stores/tasksStore.ts +114 -0
  325. package/src/web/tsconfig.json +23 -0
  326. package/dist/commands.cjs.map +0 -1
  327. package/dist/commands.d.cts.map +0 -1
  328. package/dist/commands.d.mts.map +0 -1
  329. package/dist/commands.mjs.map +0 -1
  330. package/dist/config.cjs.map +0 -1
  331. package/dist/config.d.cts.map +0 -1
  332. package/dist/config.d.mts.map +0 -1
  333. package/dist/config.mjs.map +0 -1
  334. package/dist/delegation/manager.cjs +0 -6
  335. package/dist/delegation/manager.cjs.map +0 -1
  336. package/dist/delegation/manager.d.cts.map +0 -1
  337. package/dist/delegation/manager.d.mts.map +0 -1
  338. package/dist/delegation/manager.mjs +0 -6
  339. package/dist/delegation/manager.mjs.map +0 -1
  340. package/dist/extension.cjs +0 -3
  341. package/dist/extension.cjs.map +0 -1
  342. package/dist/extension.d.cts +0 -12
  343. package/dist/extension.d.cts.map +0 -1
  344. package/dist/extension.d.mts +0 -12
  345. package/dist/extension.d.mts.map +0 -1
  346. package/dist/extension.mjs +0 -3
  347. package/dist/extension.mjs.map +0 -1
  348. package/dist/extensions/doom.cjs +0 -2
  349. package/dist/extensions/doom.cjs.map +0 -1
  350. package/dist/extensions/doom.d.cts +0 -6
  351. package/dist/extensions/doom.d.cts.map +0 -1
  352. package/dist/extensions/doom.d.mts +0 -7
  353. package/dist/extensions/doom.d.mts.map +0 -1
  354. package/dist/extensions/doom.mjs +0 -2
  355. package/dist/extensions/doom.mjs.map +0 -1
  356. package/dist/logSinkTelemetry.cjs.map +0 -1
  357. package/dist/logSinkTelemetry.d.cts.map +0 -1
  358. package/dist/logSinkTelemetry.d.mts.map +0 -1
  359. package/dist/logSinkTelemetry.mjs.map +0 -1
  360. package/dist/store/invariants.cjs +0 -2
  361. package/dist/store/invariants.cjs.map +0 -1
  362. package/dist/store/invariants.d.cts +0 -14
  363. package/dist/store/invariants.d.cts.map +0 -1
  364. package/dist/store/invariants.d.mts +0 -14
  365. package/dist/store/invariants.d.mts.map +0 -1
  366. package/dist/store/invariants.mjs +0 -2
  367. package/dist/store/invariants.mjs.map +0 -1
  368. package/dist/store/paths.cjs +0 -2
  369. package/dist/store/paths.cjs.map +0 -1
  370. package/dist/store/paths.d.cts +0 -23
  371. package/dist/store/paths.d.cts.map +0 -1
  372. package/dist/store/paths.d.mts +0 -23
  373. package/dist/store/paths.d.mts.map +0 -1
  374. package/dist/store/paths.mjs +0 -2
  375. package/dist/store/paths.mjs.map +0 -1
  376. package/dist/store/processLiveness.cjs +0 -2
  377. package/dist/store/processLiveness.cjs.map +0 -1
  378. package/dist/store/processLiveness.d.cts.map +0 -1
  379. package/dist/store/processLiveness.d.mts.map +0 -1
  380. package/dist/store/processLiveness.mjs.map +0 -1
  381. package/dist/store/reconcile.cjs +0 -2
  382. package/dist/store/reconcile.cjs.map +0 -1
  383. package/dist/store/reconcile.d.cts.map +0 -1
  384. package/dist/store/reconcile.d.mts.map +0 -1
  385. package/dist/store/reconcile.mjs +0 -2
  386. package/dist/store/reconcile.mjs.map +0 -1
  387. package/dist/store/reducer.cjs +0 -3
  388. package/dist/store/reducer.cjs.map +0 -1
  389. package/dist/store/reducer.d.cts.map +0 -1
  390. package/dist/store/reducer.d.mts.map +0 -1
  391. package/dist/store/reducer.mjs +0 -3
  392. package/dist/store/reducer.mjs.map +0 -1
  393. package/dist/store/taskGraph.cjs +0 -2
  394. package/dist/store/taskGraph.cjs.map +0 -1
  395. package/dist/store/taskGraph.d.cts.map +0 -1
  396. package/dist/store/taskGraph.d.mts.map +0 -1
  397. package/dist/store/taskGraph.mjs.map +0 -1
  398. package/dist/store/taskStore.cjs +0 -2
  399. package/dist/store/taskStore.cjs.map +0 -1
  400. package/dist/store/taskStore.d.cts.map +0 -1
  401. package/dist/store/taskStore.d.mts.map +0 -1
  402. package/dist/store/taskStore.mjs +0 -2
  403. package/dist/store/taskStore.mjs.map +0 -1
  404. package/dist/store/types.cjs +0 -2
  405. package/dist/store/types.cjs.map +0 -1
  406. package/dist/store/types.d.cts.map +0 -1
  407. package/dist/store/types.d.mts.map +0 -1
  408. package/dist/store/types.mjs.map +0 -1
  409. package/dist/tool/promptGuidelines.cjs +0 -2
  410. package/dist/tool/promptGuidelines.cjs.map +0 -1
  411. package/dist/tool/promptGuidelines.d.cts +0 -5
  412. package/dist/tool/promptGuidelines.d.cts.map +0 -1
  413. package/dist/tool/promptGuidelines.d.mts +0 -5
  414. package/dist/tool/promptGuidelines.d.mts.map +0 -1
  415. package/dist/tool/promptGuidelines.mjs +0 -2
  416. package/dist/tool/promptGuidelines.mjs.map +0 -1
  417. package/dist/tool/responseEnvelope.cjs +0 -6
  418. package/dist/tool/responseEnvelope.cjs.map +0 -1
  419. package/dist/tool/responseEnvelope.d.cts +0 -39
  420. package/dist/tool/responseEnvelope.d.cts.map +0 -1
  421. package/dist/tool/responseEnvelope.d.mts +0 -39
  422. package/dist/tool/responseEnvelope.d.mts.map +0 -1
  423. package/dist/tool/responseEnvelope.mjs +0 -6
  424. package/dist/tool/responseEnvelope.mjs.map +0 -1
  425. package/dist/tool/schema.cjs +0 -2
  426. package/dist/tool/schema.cjs.map +0 -1
  427. package/dist/tool/schema.d.cts.map +0 -1
  428. package/dist/tool/schema.d.mts.map +0 -1
  429. package/dist/tool/schema.mjs +0 -2
  430. package/dist/tool/schema.mjs.map +0 -1
  431. package/dist/tool/taskTool.cjs +0 -3
  432. package/dist/tool/taskTool.cjs.map +0 -1
  433. package/dist/tool/taskTool.d.cts +0 -17
  434. package/dist/tool/taskTool.d.cts.map +0 -1
  435. package/dist/tool/taskTool.d.mts +0 -17
  436. package/dist/tool/taskTool.d.mts.map +0 -1
  437. package/dist/tool/taskTool.mjs +0 -3
  438. package/dist/tool/taskTool.mjs.map +0 -1
  439. /package/dist/{store → models}/taskGraph.mjs +0 -0
package/README.md CHANGED
@@ -1,35 +1,134 @@
1
1
  # @agimon-ai/doompi-task
2
2
 
3
- Pi task tracking extension with file-backed tasks and subagent delegation.
3
+ Track persistent, dependency-aware tasks in Pi and optionally delegate them through DoomPi Team.
4
4
 
5
- A file-backed task graph with dependencies and delegation, not a scratch list. Tasks survive
6
- compaction because the store is on disk rather than in the transcript.
5
+ Part of the [DoomPi distribution](https://www.npmjs.com/package/@agimon-ai/doompi).
7
6
 
8
- Part of [Doompi](https://www.npmjs.com/package/@agimon-ai/doompi), a coding agent that loads
9
- only the skills and tools you name. This package is composed by Doompi and is not usually
10
- installed on its own.
7
+ Task owns task records and `tasks.json`. Team owns agents and runs. When both are loaded, Task delegates pending work through Team without merging their stored state.
8
+
9
+ > **Alpha:** task and delegation contracts may change between releases.
10
+
11
+ ## Requirements
12
+
13
+ - Node.js 22.19.0 or newer
14
+ - Pi 0.85.0 and Pi TUI 0.85.0
11
15
 
12
16
  ## Install
13
17
 
18
+ Define a layer and select it in `.doom/modes.yaml`:
19
+
20
+ ```yaml
21
+ layers:
22
+ task:
23
+ packages: ['@agimon-ai/doompi-task']
24
+
25
+ majorMode:
26
+ minimal:
27
+ description: Lean mode with persistent tasks.
28
+ layers: [task]
29
+ ```
30
+
31
+ For standalone Pi:
32
+
14
33
  ```bash
15
- npm install @agimon-ai/doompi-task
34
+ pi install npm:@agimon-ai/doompi-task
16
35
  ```
17
36
 
18
- ## How it loads
37
+ Task works without Team for local graph management. Add `@agimon-ai/doompi-team` to the same
38
+ selected mode when `assign` and `cancel` should launch or control subagents.
19
39
 
20
- Doompi loads this unconditionally. It is core, not a layer, so it does not appear in
21
- `.doom/modes.yaml`: making it optional would only create broken configurations.
40
+ ## Use the `task` tool
22
41
 
23
- Extension entry: `@agimon-ai/doompi-task/extensions/pi`
42
+ Supported actions are:
24
43
 
25
- ## Leader
44
+ | Action | Purpose |
45
+ | ------------- | ------------------------------------------------------------------ |
46
+ | `upsert` | Create tasks or update status, metadata, dependencies, and details |
47
+ | `list`, `get` | Read the graph or one task |
48
+ | `delete` | Tombstone a task |
49
+ | `clear` | Close and reset the graph after active delegations stop |
50
+ | `assign` | Delegate a pending, unblocked task through Team |
51
+ | `cancel` | Stop a delegated run and return its task to pending |
26
52
 
27
- `SPC t t` opens tasks, once the extension is loaded.
53
+ ```json
54
+ {
55
+ "action": "upsert",
56
+ "tasks": [
57
+ { "ref": "design", "subject": "Design the API" },
58
+ {
59
+ "subject": "Implement the API",
60
+ "blockedBy": ["design"]
61
+ }
62
+ ]
63
+ }
64
+ ```
65
+
66
+ The reducer enforces lifecycle transitions and rejects dependency cycles. A graph allows 15
67
+ non-deleted tasks by default; updates still apply when full, but new tasks are rejected until space
68
+ is freed.
69
+
70
+ ## TUI
71
+
72
+ Use `/tasks` or `SPC t l` to open the interactive task view. These surfaces require a TUI. The
73
+ `task` tool remains available in headless sessions.
74
+
75
+ ## Storage and cleanup
76
+
77
+ The default session-tree store is:
78
+
79
+ ```text
80
+ ~/.pi/agent/doom-task/<session>/tasks.json
81
+ ```
28
82
 
29
- ## Entry points
83
+ Task is authoritative across transcript compaction because the graph is file-backed. This does not
84
+ mean Task persists Team membership, intercom, or child-process state.
30
85
 
31
- 24 subpaths are declared in the `exports` field of `package.json`.
86
+ Defaults and overrides:
87
+
88
+ | Setting | Default | Purpose |
89
+ | --------------------------------- | -------------- | ------------------------------------------ |
90
+ | `DOOM_TASK_MAX_TASKS` | `15` | Maximum non-deleted tasks |
91
+ | `DOOM_TASK_STORE_TTL_MS` | 30 days | Retention for inactive session-tree stores |
92
+ | `DOOM_TASK_DELEGATION_TIMEOUT_MS` | 20 minutes | Delegated-run result timeout |
93
+ | `DOOM_TASK_STORE` | Unset | Override the complete store file path |
94
+ | `DOOM_TASK_COLLAPSE_KEY` | `ctrl+shift+t` | Override the task-view collapse key |
95
+
96
+ Startup reconciliation removes expired stores and repairs delegation records whose owning process
97
+ is no longer live.
98
+
99
+ ## Task and Team together
100
+
101
+ Task uses Team's delegation service and records its lifecycle events on the task. It also contributes
102
+ pending assignments through `doom/background-work`. Team discovers the selected agent, applies
103
+ model and tool policy, owns the run, and returns completion or failure. If Team unloads or is
104
+ replaced, both connections are removed and rebound without leaving a process-global registration.
105
+ Intercom and Team membership remain Team state; `tasks.json` remains Task state.
106
+
107
+ ## Public API
108
+
109
+ ```ts
110
+ import { detectCycle, isBlocked, TaskStore, taskExtension } from '@agimon-ai/doompi-task';
111
+ import type { Task, TaskStatus } from '@agimon-ai/doompi-task';
112
+ ```
113
+
114
+ Focused subpaths include `/tool/schema`, `/store/reducer`, `/store/taskStore`,
115
+ `/delegation/manager`, and `/tui/selectors`. Pi loads `/extensions/pi` through package metadata.
116
+
117
+ ## Development
118
+
119
+ Run from this package directory in the workspace:
120
+
121
+ ```bash
122
+ pnpm build
123
+ pnpm typecheck
124
+ pnpm test
125
+ pnpm lint
126
+ ```
127
+
128
+ Maintained by [Agimon](https://agimon.ai/about).
32
129
 
33
130
  ## License
34
131
 
35
132
  MIT
133
+
134
+ Named Pi and server factories live in `src/extensions`. Controllers declare commands, tools consume services, and `models` contains the durable task document types and graph. Services own persistence, delegation, and configuration. Public entries are flat files in `src/exports`, with flat package subpaths. Pi shutdown aborts the factory signal to fence pending session initialization immediately; idempotent `onStop` and `onDispose` cleanup awaits pending work before disposing the store and telemetry.
@@ -0,0 +1 @@
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./schemas/apiContracts.cjs");exports.apiContracts=e.apiContracts,exports.default=e.apiContracts;
@@ -0,0 +1,2 @@
1
+ import { apiContracts } from "./schemas/apiContracts.cjs";
2
+ export { apiContracts, apiContracts as default };
@@ -0,0 +1,2 @@
1
+ import { apiContracts } from "./schemas/apiContracts.mjs";
2
+ export { apiContracts, apiContracts as default };
@@ -0,0 +1 @@
1
+ import{apiContracts as e}from"./schemas/apiContracts.mjs";export{e as apiContracts,e as default};
package/dist/commands.cjs CHANGED
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./tool/schema.cjs"),t=require("./tui/taskSpace.cjs");function n(n,r){n.registerCommand(e.COMMAND_NAME,{description:`Open Task Space for this session tree`,handler:async(n,i)=>{if(!i.hasUI){i.ui.notify(e.ERR_REQUIRES_INTERACTIVE,`error`);return}r.read(),await t.openTaskSpace(i,{store:r})}})}exports.registerTasksCommand=n;
2
- //# sourceMappingURL=commands.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./controllers/tasksCommand.cjs");exports.createTasksCommand=e.createTasksCommand;
@@ -1,14 +1,2 @@
1
- import { TaskStore } from "./store/taskStore.cjs";
2
- import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
3
- //#region src/commands.d.ts
4
- /**
5
- * `/tasks`, reachable from the leader palette as `SPC t t`.
6
- *
7
- * The command opens the Task Space overlay rather than printing a listing: the
8
- * overlay is the readable surface and it can edit, while a transcript dump could
9
- * only be read.
10
- */
11
- declare function registerTasksCommand(pi: ExtensionAPI, store: TaskStore): void;
12
- //#endregion
13
- export { registerTasksCommand };
14
- //# sourceMappingURL=commands.d.cts.map
1
+ import { createTasksCommand } from "./controllers/tasksCommand.cjs";
2
+ export { createTasksCommand };
@@ -1,14 +1,2 @@
1
- import { TaskStore } from "./store/taskStore.mjs";
2
- import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
3
- //#region src/commands.d.ts
4
- /**
5
- * `/tasks`, reachable from the leader palette as `SPC t t`.
6
- *
7
- * The command opens the Task Space overlay rather than printing a listing: the
8
- * overlay is the readable surface and it can edit, while a transcript dump could
9
- * only be read.
10
- */
11
- declare function registerTasksCommand(pi: ExtensionAPI, store: TaskStore): void;
12
- //#endregion
13
- export { registerTasksCommand };
14
- //# sourceMappingURL=commands.d.mts.map
1
+ import { createTasksCommand } from "./controllers/tasksCommand.mjs";
2
+ export { createTasksCommand };
package/dist/commands.mjs CHANGED
@@ -1,2 +1 @@
1
- import{COMMAND_NAME as e,ERR_REQUIRES_INTERACTIVE as t}from"./tool/schema.mjs";import{openTaskSpace as n}from"./tui/taskSpace.mjs";function r(r,i){r.registerCommand(e,{description:`Open Task Space for this session tree`,handler:async(e,r)=>{if(!r.hasUI){r.ui.notify(t,`error`);return}i.read(),await n(r,{store:i})}})}export{r as registerTasksCommand};
2
- //# sourceMappingURL=commands.mjs.map
1
+ import{createTasksCommand as e}from"./controllers/tasksCommand.mjs";export{e as createTasksCommand};
package/dist/config.cjs CHANGED
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=`DOOM_TASK_COLLAPSE_KEY`,t=`DOOM_TASK_STORE_TTL_MS`,n=`DOOM_TASK_DELEGATION_TIMEOUT_MS`,r=`ctrl+shift+t`,i=2592e6,a=12e5;function o(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function s(e){let t=o(e),n=typeof t.maxWidgetLines==`number`&&Number.isFinite(t.maxWidgetLines)?Math.min(Math.max(t.maxWidgetLines,3),60):12,s=typeof t.storeTtlMs==`number`&&Number.isFinite(t.storeTtlMs)&&t.storeTtlMs>0?t.storeTtlMs:i,c=typeof t.delegationTimeoutMs==`number`&&Number.isFinite(t.delegationTimeoutMs)&&t.delegationTimeoutMs>0?t.delegationTimeoutMs:a;return{maxWidgetLines:n,storeTtlMs:s,collapseKey:typeof t.collapseKey==`string`&&t.collapseKey.trim()?t.collapseKey.trim().toLowerCase()===`off`?`off`:t.collapseKey.trim():r,delegationTimeoutMs:c}}function c(e=process.env){let t=Number.parseInt(e.DOOM_TASK_MAX_WIDGET_LINES??``,10);return Number.isFinite(t)?Math.min(Math.max(t,3),60):12}function l(e=process.env){let n=Number(e[t]);return Number.isFinite(n)&&n>0?n:i}function u(e=process.env){let t=Number(e[n]);return Number.isFinite(t)&&t>0?t:a}function d(t=process.env){let n=t[e]?.trim();return n?n.toLowerCase()===`off`?`off`:n:r}exports.COLLAPSE_KEY_ENV=e,exports.COLLAPSE_KEY_OFF=`off`,exports.DEFAULT_COLLAPSE_KEY=r,exports.DEFAULT_DELEGATION_TIMEOUT_MS=a,exports.DEFAULT_MAX_WIDGET_LINES=12,exports.DEFAULT_STORE_TTL_MS=i,exports.DELEGATION_TIMEOUT_MS_ENV=n,exports.MAX_WIDGET_LINES_ENV=`DOOM_TASK_MAX_WIDGET_LINES`,exports.STORE_TTL_MS_ENV=t,exports.getDelegationTimeoutMs=u,exports.getMaxWidgetLines=c,exports.getStoreTtlMs=l,exports.parsePiTaskConfig=s,exports.resolveCollapseKey=d;
2
- //# sourceMappingURL=config.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./services/config/index.cjs");exports.COLLAPSE_KEY_ENV=e.COLLAPSE_KEY_ENV,exports.COLLAPSE_KEY_OFF=e.COLLAPSE_KEY_OFF,exports.DEFAULT_COLLAPSE_KEY=e.DEFAULT_COLLAPSE_KEY,exports.DEFAULT_DELEGATION_TIMEOUT_MS=e.DEFAULT_DELEGATION_TIMEOUT_MS,exports.DEFAULT_MAX_TASKS=e.DEFAULT_MAX_TASKS,exports.DEFAULT_MAX_WIDGET_LINES=e.DEFAULT_MAX_WIDGET_LINES,exports.DEFAULT_STORE_TTL_MS=e.DEFAULT_STORE_TTL_MS,exports.DELEGATION_TIMEOUT_MS_ENV=e.DELEGATION_TIMEOUT_MS_ENV,exports.MAX_TASKS_ENV=e.MAX_TASKS_ENV,exports.MAX_WIDGET_LINES_ENV=e.MAX_WIDGET_LINES_ENV,exports.STORE_TTL_MS_ENV=e.STORE_TTL_MS_ENV,exports.getDelegationTimeoutMs=e.getDelegationTimeoutMs,exports.getMaxTasks=e.getMaxTasks,exports.getMaxWidgetLines=e.getMaxWidgetLines,exports.getStoreTtlMs=e.getStoreTtlMs,exports.parsePiTaskConfig=e.parsePiTaskConfig,exports.resolveCollapseKey=e.resolveCollapseKey;
package/dist/config.d.cts CHANGED
@@ -1,38 +1,2 @@
1
- //#region src/config.d.ts
2
- /**
3
- * Extension configuration, read from the environment.
4
- *
5
- * Env rather than a config file: doom-pi already carries per-launch state to Pi
6
- * through env vars, so this keeps doom-task consistent with how the harness
7
- * configures the rest of the extension set.
8
- */
9
- declare const MAX_WIDGET_LINES_ENV = "DOOM_TASK_MAX_WIDGET_LINES";
10
- declare const COLLAPSE_KEY_ENV = "DOOM_TASK_COLLAPSE_KEY";
11
- declare const STORE_TTL_MS_ENV = "DOOM_TASK_STORE_TTL_MS";
12
- declare const DELEGATION_TIMEOUT_MS_ENV = "DOOM_TASK_DELEGATION_TIMEOUT_MS";
13
- declare const DEFAULT_MAX_WIDGET_LINES = 12;
14
- declare const DEFAULT_COLLAPSE_KEY = "ctrl+shift+t";
15
- declare const DEFAULT_STORE_TTL_MS: number;
16
- /** Deliberately under the subagents auto-drain ceiling (30 min) so a headless
17
- * session still gets the failure and a model turn before draining gives up. */
18
- declare const DEFAULT_DELEGATION_TIMEOUT_MS: number;
19
- declare const COLLAPSE_KEY_OFF = "off";
20
- interface PiTaskConfig {
21
- maxWidgetLines: number;
22
- storeTtlMs: number;
23
- collapseKey: string;
24
- delegationTimeoutMs: number;
25
- }
26
- /** Parse configuration only after the Pi host has applied its project-trust policy. */
27
- declare function parsePiTaskConfig(value: unknown): PiTaskConfig;
28
- /** Rows the overlay may use for content, clamped to a sane range. */
29
- declare function getMaxWidgetLines(env?: NodeJS.ProcessEnv): number;
30
- /** Retention window for inactive session-tree stores. */
31
- declare function getStoreTtlMs(env?: NodeJS.ProcessEnv): number;
32
- /** How long a delegated run may go without reporting a result. */
33
- declare function getDelegationTimeoutMs(env?: NodeJS.ProcessEnv): number;
34
- /** Collapse shortcut, or the `off` sentinel when the user disabled it. */
35
- declare function resolveCollapseKey(env?: NodeJS.ProcessEnv): string;
36
- //#endregion
37
- 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 };
38
- //# sourceMappingURL=config.d.cts.map
1
+ import { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_TASKS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey } from "./services/config/index.cjs";
2
+ export { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_TASKS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey };
package/dist/config.d.mts CHANGED
@@ -1,38 +1,2 @@
1
- //#region src/config.d.ts
2
- /**
3
- * Extension configuration, read from the environment.
4
- *
5
- * Env rather than a config file: doom-pi already carries per-launch state to Pi
6
- * through env vars, so this keeps doom-task consistent with how the harness
7
- * configures the rest of the extension set.
8
- */
9
- declare const MAX_WIDGET_LINES_ENV = "DOOM_TASK_MAX_WIDGET_LINES";
10
- declare const COLLAPSE_KEY_ENV = "DOOM_TASK_COLLAPSE_KEY";
11
- declare const STORE_TTL_MS_ENV = "DOOM_TASK_STORE_TTL_MS";
12
- declare const DELEGATION_TIMEOUT_MS_ENV = "DOOM_TASK_DELEGATION_TIMEOUT_MS";
13
- declare const DEFAULT_MAX_WIDGET_LINES = 12;
14
- declare const DEFAULT_COLLAPSE_KEY = "ctrl+shift+t";
15
- declare const DEFAULT_STORE_TTL_MS: number;
16
- /** Deliberately under the subagents auto-drain ceiling (30 min) so a headless
17
- * session still gets the failure and a model turn before draining gives up. */
18
- declare const DEFAULT_DELEGATION_TIMEOUT_MS: number;
19
- declare const COLLAPSE_KEY_OFF = "off";
20
- interface PiTaskConfig {
21
- maxWidgetLines: number;
22
- storeTtlMs: number;
23
- collapseKey: string;
24
- delegationTimeoutMs: number;
25
- }
26
- /** Parse configuration only after the Pi host has applied its project-trust policy. */
27
- declare function parsePiTaskConfig(value: unknown): PiTaskConfig;
28
- /** Rows the overlay may use for content, clamped to a sane range. */
29
- declare function getMaxWidgetLines(env?: NodeJS.ProcessEnv): number;
30
- /** Retention window for inactive session-tree stores. */
31
- declare function getStoreTtlMs(env?: NodeJS.ProcessEnv): number;
32
- /** How long a delegated run may go without reporting a result. */
33
- declare function getDelegationTimeoutMs(env?: NodeJS.ProcessEnv): number;
34
- /** Collapse shortcut, or the `off` sentinel when the user disabled it. */
35
- declare function resolveCollapseKey(env?: NodeJS.ProcessEnv): string;
36
- //#endregion
37
- 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 };
38
- //# sourceMappingURL=config.d.mts.map
1
+ import { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_TASKS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey } from "./services/config/index.mjs";
2
+ export { COLLAPSE_KEY_ENV, COLLAPSE_KEY_OFF, DEFAULT_COLLAPSE_KEY, DEFAULT_DELEGATION_TIMEOUT_MS, DEFAULT_MAX_TASKS, DEFAULT_MAX_WIDGET_LINES, DEFAULT_STORE_TTL_MS, DELEGATION_TIMEOUT_MS_ENV, MAX_TASKS_ENV, MAX_WIDGET_LINES_ENV, PiTaskConfig, STORE_TTL_MS_ENV, getDelegationTimeoutMs, getMaxTasks, getMaxWidgetLines, getStoreTtlMs, parsePiTaskConfig, resolveCollapseKey };
package/dist/config.mjs CHANGED
@@ -1,2 +1 @@
1
- const e=`DOOM_TASK_MAX_WIDGET_LINES`,t=`DOOM_TASK_COLLAPSE_KEY`,n=`DOOM_TASK_STORE_TTL_MS`,r=`DOOM_TASK_DELEGATION_TIMEOUT_MS`,i=12,a=`ctrl+shift+t`,o=2592e6,s=12e5,c=`off`;function l(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function u(e){let t=l(e),n=typeof t.maxWidgetLines==`number`&&Number.isFinite(t.maxWidgetLines)?Math.min(Math.max(t.maxWidgetLines,3),60):12,r=typeof t.storeTtlMs==`number`&&Number.isFinite(t.storeTtlMs)&&t.storeTtlMs>0?t.storeTtlMs:o,i=typeof t.delegationTimeoutMs==`number`&&Number.isFinite(t.delegationTimeoutMs)&&t.delegationTimeoutMs>0?t.delegationTimeoutMs:s;return{maxWidgetLines:n,storeTtlMs:r,collapseKey:typeof t.collapseKey==`string`&&t.collapseKey.trim()?t.collapseKey.trim().toLowerCase()===`off`?`off`:t.collapseKey.trim():a,delegationTimeoutMs:i}}function d(e=process.env){let t=Number.parseInt(e.DOOM_TASK_MAX_WIDGET_LINES??``,10);return Number.isFinite(t)?Math.min(Math.max(t,3),60):12}function f(e=process.env){let t=Number(e[n]);return Number.isFinite(t)&&t>0?t:o}function p(e=process.env){let t=Number(e[r]);return Number.isFinite(t)&&t>0?t:s}function m(e=process.env){let n=e[t]?.trim();return n?n.toLowerCase()===`off`?`off`:n:a}export{t as COLLAPSE_KEY_ENV,c as COLLAPSE_KEY_OFF,a as DEFAULT_COLLAPSE_KEY,s as DEFAULT_DELEGATION_TIMEOUT_MS,i as DEFAULT_MAX_WIDGET_LINES,o as DEFAULT_STORE_TTL_MS,r as DELEGATION_TIMEOUT_MS_ENV,e as MAX_WIDGET_LINES_ENV,n as STORE_TTL_MS_ENV,p as getDelegationTimeoutMs,d as getMaxWidgetLines,f as getStoreTtlMs,u as parsePiTaskConfig,m as resolveCollapseKey};
2
- //# sourceMappingURL=config.mjs.map
1
+ import{COLLAPSE_KEY_ENV as e,COLLAPSE_KEY_OFF as t,DEFAULT_COLLAPSE_KEY as n,DEFAULT_DELEGATION_TIMEOUT_MS as r,DEFAULT_MAX_TASKS as i,DEFAULT_MAX_WIDGET_LINES as a,DEFAULT_STORE_TTL_MS as o,DELEGATION_TIMEOUT_MS_ENV as s,MAX_TASKS_ENV as c,MAX_WIDGET_LINES_ENV as l,STORE_TTL_MS_ENV as u,getDelegationTimeoutMs as d,getMaxTasks as f,getMaxWidgetLines as p,getStoreTtlMs as m,parsePiTaskConfig as h,resolveCollapseKey as g}from"./services/config/index.mjs";export{e as COLLAPSE_KEY_ENV,t as COLLAPSE_KEY_OFF,n as DEFAULT_COLLAPSE_KEY,r as DEFAULT_DELEGATION_TIMEOUT_MS,i as DEFAULT_MAX_TASKS,a as DEFAULT_MAX_WIDGET_LINES,o as DEFAULT_STORE_TTL_MS,s as DELEGATION_TIMEOUT_MS_ENV,c as MAX_TASKS_ENV,l as MAX_WIDGET_LINES_ENV,u as STORE_TTL_MS_ENV,d as getDelegationTimeoutMs,f as getMaxTasks,p as getMaxWidgetLines,m as getStoreTtlMs,h as parsePiTaskConfig,g as resolveCollapseKey};
@@ -0,0 +1,2 @@
1
+ const e=[`Batch the whole plan in one upsert: {"action":"upsert","tasks":[{"subject":"Research the store"},{"subject":"Write the reducer"}]}. Report progress one call at a time: mark a task in_progress before you start it and completed the moment it lands, never batched at the end of a turn. Keep one task in_progress for your own work; delegated tasks run in parallel and do not count.`,`Never mark a task completed while tests fail or the work is partial. Use failed, or keep it in_progress and add a task for the blocker in the same upsert.`,`When every non-deleted task is completed, review the list once and call {"action":"clear"}.`,`Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.`,`upsert applies each entry independently: passing entries commit and failures are reported by array index. Resend only the corrected failures, because resending an applied entry with no id creates a duplicate task.`,`Apply the session delegation criteria before choosing what to delegate, then call subagent {"action":"agents"} and use an exact discovered name. Prefer a general-purpose write-capable agent such as delegate or worker when no specialist fits, and use a focused inlineAgent only for read-only work.`,`Assign through assignments[] even for a single task: {"action":"assign","assignments":[{"id":1,"agent":"researcher"}]}. Put independent ready tasks in one batch rather than repeated calls or multi_tool, and do not start a direct subagent run for work already on the task list. Successful entries keep running when another entry fails, so retry only the failures.`,`Fill relevantFiles only with files you actually read or located, and priorFindings only with verified facts in a few lines, not directives. A guessed path costs more than an omitted one.`,`Subject stays short and imperative. description is the durable brief handed to the subagent, extended at assign time by instructions, relevantFiles and priorFindings, so do not repeat one in the other.`,`When a delegated task completes and unblocks another, reconsider it promptly. If a child asks for a decision or an assignment fails to start, respond, rescope or retry instead of leaving it pending. Doom Task records delegated lifecycle and results on the task itself.`];exports.DEFAULT_PROMPT_GUIDELINES=e;
2
+ //# sourceMappingURL=promptGuidelines.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptGuidelines.cjs","names":[],"sources":["../../src/constants/promptGuidelines.ts"],"sourcesContent":["/**\n * Cross-call behaviour the schema cannot express.\n *\n * Every rule lives in exactly one surface. Argument-site mechanics belong to\n * the parameter descriptions in `schemas/task.ts`, the use/do-not-use policy\n * and session scoping belong to the tool description, and general delegation\n * judgement belongs to the Team orchestrator prompt. What is left here is what\n * none of those three can carry: how calls should be sequenced across a turn.\n */\nexport const DEFAULT_PROMPT_GUIDELINES: string[] = [\n 'Batch the whole plan in one upsert: {\"action\":\"upsert\",\"tasks\":[{\"subject\":\"Research the store\"},{\"subject\":\"Write the reducer\"}]}. Report progress one call at a time: mark a task in_progress before you start it and completed the moment it lands, never batched at the end of a turn. Keep one task in_progress for your own work; delegated tasks run in parallel and do not count.',\n 'Never mark a task completed while tests fail or the work is partial. Use failed, or keep it in_progress and add a task for the blocker in the same upsert.',\n 'When every non-deleted task is completed, review the list once and call {\"action\":\"clear\"}.',\n \"Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.\",\n 'upsert applies each entry independently: passing entries commit and failures are reported by array index. Resend only the corrected failures, because resending an applied entry with no id creates a duplicate task.',\n 'Apply the session delegation criteria before choosing what to delegate, then call subagent {\"action\":\"agents\"} and use an exact discovered name. Prefer a general-purpose write-capable agent such as delegate or worker when no specialist fits, and use a focused inlineAgent only for read-only work.',\n 'Assign through assignments[] even for a single task: {\"action\":\"assign\",\"assignments\":[{\"id\":1,\"agent\":\"researcher\"}]}. Put independent ready tasks in one batch rather than repeated calls or multi_tool, and do not start a direct subagent run for work already on the task list. Successful entries keep running when another entry fails, so retry only the failures.',\n 'Fill relevantFiles only with files you actually read or located, and priorFindings only with verified facts in a few lines, not directives. A guessed path costs more than an omitted one.',\n 'Subject stays short and imperative. description is the durable brief handed to the subagent, extended at assign time by instructions, relevantFiles and priorFindings, so do not repeat one in the other.',\n 'When a delegated task completes and unblocks another, reconsider it promptly. If a child asks for a decision or an assignment fails to start, respond, rescope or retry instead of leaving it pending. Doom Task records delegated lifecycle and results on the task itself.',\n];\n"],"mappings":"AASA,MAAa,EAAsC,CACjD,4XACA,6JACA,8FACA,gKACA,wNACA,2SACA,6WACA,6LACA,4MACA,8QACF"}
@@ -0,0 +1,13 @@
1
+ //#region src/constants/promptGuidelines.d.ts
2
+ /**
3
+ * Cross-call behaviour the schema cannot express.
4
+ *
5
+ * Every rule lives in exactly one surface. Argument-site mechanics belong to
6
+ * the parameter descriptions in `schemas/task.ts`, the use/do-not-use policy
7
+ * and session scoping belong to the tool description, and general delegation
8
+ * judgement belongs to the Team orchestrator prompt. What is left here is what
9
+ * none of those three can carry: how calls should be sequenced across a turn.
10
+ */
11
+ export declare const DEFAULT_PROMPT_GUIDELINES: string[];
12
+ //#endregion
13
+ //# sourceMappingURL=promptGuidelines.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptGuidelines.d.cts","names":[],"sources":["../../src/constants/promptGuidelines.ts"],"mappings":";;;;;;;;;;qBASa"}
@@ -0,0 +1,13 @@
1
+ //#region src/constants/promptGuidelines.d.ts
2
+ /**
3
+ * Cross-call behaviour the schema cannot express.
4
+ *
5
+ * Every rule lives in exactly one surface. Argument-site mechanics belong to
6
+ * the parameter descriptions in `schemas/task.ts`, the use/do-not-use policy
7
+ * and session scoping belong to the tool description, and general delegation
8
+ * judgement belongs to the Team orchestrator prompt. What is left here is what
9
+ * none of those three can carry: how calls should be sequenced across a turn.
10
+ */
11
+ export declare const DEFAULT_PROMPT_GUIDELINES: string[];
12
+ //#endregion
13
+ //# sourceMappingURL=promptGuidelines.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptGuidelines.d.mts","names":[],"sources":["../../src/constants/promptGuidelines.ts"],"mappings":";;;;;;;;;;qBASa"}
@@ -0,0 +1,2 @@
1
+ const e=[`Batch the whole plan in one upsert: {"action":"upsert","tasks":[{"subject":"Research the store"},{"subject":"Write the reducer"}]}. Report progress one call at a time: mark a task in_progress before you start it and completed the moment it lands, never batched at the end of a turn. Keep one task in_progress for your own work; delegated tasks run in parallel and do not count.`,`Never mark a task completed while tests fail or the work is partial. Use failed, or keep it in_progress and add a task for the blocker in the same upsert.`,`When every non-deleted task is completed, review the list once and call {"action":"clear"}.`,`Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.`,`upsert applies each entry independently: passing entries commit and failures are reported by array index. Resend only the corrected failures, because resending an applied entry with no id creates a duplicate task.`,`Apply the session delegation criteria before choosing what to delegate, then call subagent {"action":"agents"} and use an exact discovered name. Prefer a general-purpose write-capable agent such as delegate or worker when no specialist fits, and use a focused inlineAgent only for read-only work.`,`Assign through assignments[] even for a single task: {"action":"assign","assignments":[{"id":1,"agent":"researcher"}]}. Put independent ready tasks in one batch rather than repeated calls or multi_tool, and do not start a direct subagent run for work already on the task list. Successful entries keep running when another entry fails, so retry only the failures.`,`Fill relevantFiles only with files you actually read or located, and priorFindings only with verified facts in a few lines, not directives. A guessed path costs more than an omitted one.`,`Subject stays short and imperative. description is the durable brief handed to the subagent, extended at assign time by instructions, relevantFiles and priorFindings, so do not repeat one in the other.`,`When a delegated task completes and unblocks another, reconsider it promptly. If a child asks for a decision or an assignment fails to start, respond, rescope or retry instead of leaving it pending. Doom Task records delegated lifecycle and results on the task itself.`];export{e as DEFAULT_PROMPT_GUIDELINES};
2
+ //# sourceMappingURL=promptGuidelines.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptGuidelines.mjs","names":[],"sources":["../../src/constants/promptGuidelines.ts"],"sourcesContent":["/**\n * Cross-call behaviour the schema cannot express.\n *\n * Every rule lives in exactly one surface. Argument-site mechanics belong to\n * the parameter descriptions in `schemas/task.ts`, the use/do-not-use policy\n * and session scoping belong to the tool description, and general delegation\n * judgement belongs to the Team orchestrator prompt. What is left here is what\n * none of those three can carry: how calls should be sequenced across a turn.\n */\nexport const DEFAULT_PROMPT_GUIDELINES: string[] = [\n 'Batch the whole plan in one upsert: {\"action\":\"upsert\",\"tasks\":[{\"subject\":\"Research the store\"},{\"subject\":\"Write the reducer\"}]}. Report progress one call at a time: mark a task in_progress before you start it and completed the moment it lands, never batched at the end of a turn. Keep one task in_progress for your own work; delegated tasks run in parallel and do not count.',\n 'Never mark a task completed while tests fail or the work is partial. Use failed, or keep it in_progress and add a task for the blocker in the same upsert.',\n 'When every non-deleted task is completed, review the list once and call {\"action\":\"clear\"}.',\n \"Status flow: pending, in_progress, completed. failed is recoverable, deleted is a tombstone. Pass activeForm (e.g. 'writing tests') when marking in_progress.\",\n 'upsert applies each entry independently: passing entries commit and failures are reported by array index. Resend only the corrected failures, because resending an applied entry with no id creates a duplicate task.',\n 'Apply the session delegation criteria before choosing what to delegate, then call subagent {\"action\":\"agents\"} and use an exact discovered name. Prefer a general-purpose write-capable agent such as delegate or worker when no specialist fits, and use a focused inlineAgent only for read-only work.',\n 'Assign through assignments[] even for a single task: {\"action\":\"assign\",\"assignments\":[{\"id\":1,\"agent\":\"researcher\"}]}. Put independent ready tasks in one batch rather than repeated calls or multi_tool, and do not start a direct subagent run for work already on the task list. Successful entries keep running when another entry fails, so retry only the failures.',\n 'Fill relevantFiles only with files you actually read or located, and priorFindings only with verified facts in a few lines, not directives. A guessed path costs more than an omitted one.',\n 'Subject stays short and imperative. description is the durable brief handed to the subagent, extended at assign time by instructions, relevantFiles and priorFindings, so do not repeat one in the other.',\n 'When a delegated task completes and unblocks another, reconsider it promptly. If a child asks for a decision or an assignment fails to start, respond, rescope or retry instead of leaving it pending. Doom Task records delegated lifecycle and results on the task itself.',\n];\n"],"mappings":"AASA,MAAa,EAAsC,CACjD,4XACA,6JACA,8FACA,gKACA,wNACA,2SACA,6WACA,6LACA,4MACA,8QACF"}
@@ -0,0 +1,2 @@
1
+ exports.COMMAND_NAME=`tasks`;
2
+ //# sourceMappingURL=task.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.cjs","names":[],"sources":["../../src/constants/task.ts"],"sourcesContent":["export const COMMAND_NAME = 'tasks';\n"],"mappings":""}
@@ -0,0 +1,4 @@
1
+ //#region src/constants/task.d.ts
2
+ export declare const COMMAND_NAME = "tasks";
3
+ //#endregion
4
+ //# sourceMappingURL=task.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.d.cts","names":[],"sources":["../../src/constants/task.ts"],"mappings":";qBAAa"}
@@ -0,0 +1,4 @@
1
+ //#region src/constants/task.d.ts
2
+ export declare const COMMAND_NAME = "tasks";
3
+ //#endregion
4
+ //# sourceMappingURL=task.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.d.mts","names":[],"sources":["../../src/constants/task.ts"],"mappings":";qBAAa"}
@@ -0,0 +1,2 @@
1
+ const e=`tasks`;export{e as COMMAND_NAME};
2
+ //# sourceMappingURL=task.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.mjs","names":[],"sources":["../../src/constants/task.ts"],"sourcesContent":["export const COMMAND_NAME = 'tasks';\n"],"mappings":"AAAA,MAAa,EAAe"}
@@ -0,0 +1,2 @@
1
+ const e=require("../constants/task.cjs"),t=require("../schemas/task.cjs");function n(n,r,i){return[e.COMMAND_NAME,{description:`Open Task Space for this session tree`,handler:async(e,a)=>{if(!a.hasUI){a.ui.notify(t.ERR_REQUIRES_INTERACTIVE,`error`);return}await i?.(a),n.read(),await r(a,{store:n})}}]}exports.createTasksCommand=n;
2
+ //# sourceMappingURL=tasksCommand.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasksCommand.cjs","names":["COMMAND_NAME","ERR_REQUIRES_INTERACTIVE"],"sources":["../../src/controllers/tasksCommand.ts"],"sourcesContent":["import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\n\nimport { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE } from '../schemas/task';\nimport type { TaskStore } from '../services/taskStore';\n\n/**\n * `/tasks`, reachable from the leader palette as `SPC t l`.\n *\n * The command opens the Task Space overlay rather than printing a listing: the\n * overlay is the readable surface and it can edit, while a transcript dump could\n * only be read.\n */\nexport function createTasksCommand(\n store: TaskStore,\n openTaskSpace: (context: ExtensionContext, options: { store: TaskStore }) => Promise<void>,\n waitUntilReady?: (context: ExtensionContext) => Promise<void>,\n): readonly [string, Parameters<ExtensionAPI['registerCommand']>[1]] {\n return [\n COMMAND_NAME,\n {\n description: 'Open Task Space for this session tree',\n handler: async (_args, ctx) => {\n if (!ctx.hasUI) {\n ctx.ui.notify(ERR_REQUIRES_INTERACTIVE, 'error');\n return;\n }\n\n await waitUntilReady?.(ctx);\n store.read();\n await openTaskSpace(ctx, { store });\n },\n },\n ];\n}\n"],"mappings":"0EAYA,SAAgB,EACd,EACA,EACA,EACmE,CACnE,MAAO,CACLA,EAAAA,aACA,CACE,YAAa,wCACb,QAAS,MAAO,EAAO,IAAQ,CAC7B,GAAI,CAAC,EAAI,MAAO,CACd,EAAI,GAAG,OAAOC,EAAAA,yBAA0B,OAAO,EAC/C,MACF,CAEA,MAAM,IAAiB,CAAG,EAC1B,EAAM,KAAK,EACX,MAAM,EAAc,EAAK,CAAE,OAAM,CAAC,CACpC,CACF,CACF,CACF"}
@@ -0,0 +1,15 @@
1
+ import { TaskStore } from "../services/taskStore/index.cjs";
2
+ import { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
3
+ //#region src/controllers/tasksCommand.d.ts
4
+ /**
5
+ * `/tasks`, reachable from the leader palette as `SPC t l`.
6
+ *
7
+ * The command opens the Task Space overlay rather than printing a listing: the
8
+ * overlay is the readable surface and it can edit, while a transcript dump could
9
+ * only be read.
10
+ */
11
+ export declare function createTasksCommand(store: TaskStore, openTaskSpace: (context: ExtensionContext, options: {
12
+ store: TaskStore;
13
+ }) => Promise<void>, waitUntilReady?: (context: ExtensionContext) => Promise<void>): readonly [string, Parameters<ExtensionAPI['registerCommand']>[1]];
14
+ //#endregion
15
+ //# sourceMappingURL=tasksCommand.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasksCommand.d.cts","names":[],"sources":["../../src/controllers/tasksCommand.ts"],"mappings":";;;;;;;;;;wBAYgB,mBACd,OAAO,WACP,gBAAgB,SAAS,kBAAkB;EAAW,OAAO;MAAgB,eAC7E,kBAAkB,SAAS,qBAAqB,kCAC7B,WAAW"}
@@ -0,0 +1,15 @@
1
+ import { TaskStore } from "../services/taskStore/index.mjs";
2
+ import { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
3
+ //#region src/controllers/tasksCommand.d.ts
4
+ /**
5
+ * `/tasks`, reachable from the leader palette as `SPC t l`.
6
+ *
7
+ * The command opens the Task Space overlay rather than printing a listing: the
8
+ * overlay is the readable surface and it can edit, while a transcript dump could
9
+ * only be read.
10
+ */
11
+ export declare function createTasksCommand(store: TaskStore, openTaskSpace: (context: ExtensionContext, options: {
12
+ store: TaskStore;
13
+ }) => Promise<void>, waitUntilReady?: (context: ExtensionContext) => Promise<void>): readonly [string, Parameters<ExtensionAPI['registerCommand']>[1]];
14
+ //#endregion
15
+ //# sourceMappingURL=tasksCommand.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasksCommand.d.mts","names":[],"sources":["../../src/controllers/tasksCommand.ts"],"mappings":";;;;;;;;;;wBAYgB,mBACd,OAAO,WACP,gBAAgB,SAAS,kBAAkB;EAAW,OAAO;MAAgB,eAC7E,kBAAkB,SAAS,qBAAqB,kCAC7B,WAAW"}
@@ -0,0 +1,2 @@
1
+ import{COMMAND_NAME as e}from"../constants/task.mjs";import{ERR_REQUIRES_INTERACTIVE as t}from"../schemas/task.mjs";function n(n,r,i){return[e,{description:`Open Task Space for this session tree`,handler:async(e,a)=>{if(!a.hasUI){a.ui.notify(t,`error`);return}await i?.(a),n.read(),await r(a,{store:n})}}]}export{n as createTasksCommand};
2
+ //# sourceMappingURL=tasksCommand.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasksCommand.mjs","names":[],"sources":["../../src/controllers/tasksCommand.ts"],"sourcesContent":["import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';\n\nimport { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE } from '../schemas/task';\nimport type { TaskStore } from '../services/taskStore';\n\n/**\n * `/tasks`, reachable from the leader palette as `SPC t l`.\n *\n * The command opens the Task Space overlay rather than printing a listing: the\n * overlay is the readable surface and it can edit, while a transcript dump could\n * only be read.\n */\nexport function createTasksCommand(\n store: TaskStore,\n openTaskSpace: (context: ExtensionContext, options: { store: TaskStore }) => Promise<void>,\n waitUntilReady?: (context: ExtensionContext) => Promise<void>,\n): readonly [string, Parameters<ExtensionAPI['registerCommand']>[1]] {\n return [\n COMMAND_NAME,\n {\n description: 'Open Task Space for this session tree',\n handler: async (_args, ctx) => {\n if (!ctx.hasUI) {\n ctx.ui.notify(ERR_REQUIRES_INTERACTIVE, 'error');\n return;\n }\n\n await waitUntilReady?.(ctx);\n store.read();\n await openTaskSpace(ctx, { store });\n },\n },\n ];\n}\n"],"mappings":"oHAYA,SAAgB,EACd,EACA,EACA,EACmE,CACnE,MAAO,CACL,EACA,CACE,YAAa,wCACb,QAAS,MAAO,EAAO,IAAQ,CAC7B,GAAI,CAAC,EAAI,MAAO,CACd,EAAI,GAAG,OAAO,EAA0B,OAAO,EAC/C,MACF,CAEA,MAAM,IAAiB,CAAG,EAC1B,EAAM,KAAK,EACX,MAAM,EAAc,EAAK,CAAE,OAAM,CAAC,CACpC,CACF,CACF,CACF"}
@@ -0,0 +1,2 @@
1
+ const e=require("../services/paths/index.cjs"),t=require("../services/taskStore/index.cjs"),n=require("../types/webTasks.cjs");function r(e){return typeof e==`object`&&!!e&&typeof e.rev==`number`&&Array.isArray(e.tasks)}function i(e){return{tasks:e.tasks.flatMap(e=>{if(e.status===`deleted`)return[];let t={id:e.id,subject:e.subject,status:e.status,blockedBy:e.blockedBy??[]};return e.description&&(t.description=e.description),e.activeForm&&(t.activeForm=e.activeForm),e.owner&&(t.owner=e.owner),e.updatedAt&&(t.updatedAt=e.updatedAt),e.delegation&&(t.delegation={...e.delegation.agent===void 0?{}:{agent:e.delegation.agent},...e.delegation.state===void 0?{}:{state:e.delegation.state}}),[t]}),rev:e.rev}}function a(a={}){return{frameType:n.TASKS_CHANNEL_TYPE,start(o){let s=new Map,c=c=>{if(s.has(c.sessionId))return;let l=a.storeFor?.(c);if(l===void 0){if(c.environment===void 0)throw Error(`Task channel requires an admitted environment for session '${c.sessionId}'.`);l=new t.TaskStore({cwd:c.cwd,env:c.environment,storePath:e.resolveStorePath(c.cwd,c.environment,c.sessionId)})}l.read();let u={store:l,unsubscribe:()=>void 0};s.set(c.sessionId,u),u.unsubscribe=o.directEvents.subscribe(n.TASKS_CHANNEL_TYPE,c.sessionId,e=>{if(!r(e))return;let t=s.get(c.sessionId);t!==void 0&&(t.latest=e,o.publish(c.sessionId,i(e)))},{replayLatest:!0})},l=e=>{let t=s.get(e);t&&(t.unsubscribe(),t.store.dispose(),s.delete(e))};for(let e of o.sessions())c(e);return{payloadFor(e){c(e);let t=s.get(e.sessionId),n=t?.latest??t?.store.snapshot;return n===void 0?void 0:i(n)},sessionAdded:c,sessionRemoved:l,close(){for(let e of s.keys())l(e)}}}}}exports.createTasksChannel=a;
2
+ //# sourceMappingURL=webTasksChannel.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webTasksChannel.cjs","names":["TASKS_CHANNEL_TYPE","TaskStore","resolveStorePath"],"sources":["../../src/controllers/webTasksChannel.ts"],"sourcesContent":["import type { DoomHubChannelSource, DoomHubSessionScope, DoomHubChannel } from '@agimon-ai/doompi-core/hub-channel';\n\nimport type { TaskDocument } from '../models/task';\nimport { resolveStorePath } from '../services/paths';\nimport { TaskStore } from '../services/taskStore';\nimport { TASKS_CHANNEL_TYPE, type WebTask, type WebTasksPayload } from '../types/webTasks';\n\ninterface TaskStoreSource {\n readonly snapshot: TaskDocument;\n read(): TaskDocument;\n dispose(): void;\n}\n\nfunction isTaskDocument(value: unknown): value is TaskDocument {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as TaskDocument).rev === 'number' &&\n Array.isArray((value as TaskDocument).tasks)\n );\n}\n\nexport interface TasksChannelOptions {\n /** Injectable for tests. The default opens the session tree's durable task store. */\n storeFor?: (scope: DoomHubSessionScope) => TaskStoreSource;\n}\n\nfunction present(document: TaskDocument): WebTasksPayload {\n const tasks: WebTask[] = document.tasks.flatMap((task) => {\n if (task.status === 'deleted') return [];\n const view: WebTask = {\n id: task.id,\n subject: task.subject,\n status: task.status,\n blockedBy: task.blockedBy ?? [],\n };\n if (task.description) view.description = task.description;\n if (task.activeForm) view.activeForm = task.activeForm;\n if (task.owner) view.owner = task.owner;\n if (task.updatedAt) view.updatedAt = task.updatedAt;\n if (task.delegation) {\n view.delegation = {\n ...(task.delegation.agent === undefined ? {} : { agent: task.delegation.agent }),\n ...(task.delegation.state === undefined ? {} : { state: task.delegation.state }),\n };\n }\n return [view];\n });\n return { tasks, rev: document.rev };\n}\n\n/** Publishes each managed session's durable task graph and follows direct session commits. */\nexport function createTasksChannel(options: TasksChannelOptions = {}): DoomHubChannel {\n return {\n frameType: TASKS_CHANNEL_TYPE,\n start(host) {\n const stores = new Map<string, { store: TaskStoreSource; unsubscribe: () => void; latest?: TaskDocument }>();\n const open = (scope: DoomHubSessionScope): void => {\n if (stores.has(scope.sessionId)) return;\n let store = options.storeFor?.(scope);\n if (store === undefined) {\n if (scope.environment === undefined)\n throw new Error(`Task channel requires an admitted environment for session '${scope.sessionId}'.`);\n store = new TaskStore({\n cwd: scope.cwd,\n env: scope.environment,\n storePath: resolveStorePath(scope.cwd, scope.environment, scope.sessionId),\n });\n }\n store.read();\n const source = { store, unsubscribe: () => undefined as void };\n stores.set(scope.sessionId, source);\n source.unsubscribe = host.directEvents.subscribe(\n TASKS_CHANNEL_TYPE,\n scope.sessionId,\n (payload) => {\n if (!isTaskDocument(payload)) return;\n const current = stores.get(scope.sessionId);\n if (current === undefined) return;\n current.latest = payload;\n host.publish(scope.sessionId, present(payload));\n },\n { replayLatest: true },\n );\n };\n const close = (sessionId: string): void => {\n const source = stores.get(sessionId);\n if (!source) return;\n source.unsubscribe();\n source.store.dispose();\n stores.delete(sessionId);\n };\n for (const scope of host.sessions()) open(scope);\n\n const source: DoomHubChannelSource = {\n payloadFor(scope) {\n open(scope);\n const source = stores.get(scope.sessionId);\n const document = source?.latest ?? source?.store.snapshot;\n return document === undefined ? undefined : present(document);\n },\n sessionAdded: open,\n sessionRemoved: close,\n close() {\n for (const sessionId of stores.keys()) close(sessionId);\n },\n };\n return source;\n },\n };\n}\n"],"mappings":"+HAaA,SAAS,EAAe,EAAuC,CAC7D,OACE,OAAO,GAAU,YACjB,GACA,OAAQ,EAAuB,KAAQ,UACvC,MAAM,QAAS,EAAuB,KAAK,CAE/C,CAOA,SAAS,EAAQ,EAAyC,CAqBxD,MAAO,CAAE,MApBgB,EAAS,MAAM,QAAS,GAAS,CACxD,GAAI,EAAK,SAAW,UAAW,MAAO,CAAC,EACvC,IAAM,EAAgB,CACpB,GAAI,EAAK,GACT,QAAS,EAAK,QACd,OAAQ,EAAK,OACb,UAAW,EAAK,WAAa,CAAC,CAChC,EAWA,OAVI,EAAK,cAAa,EAAK,YAAc,EAAK,aAC1C,EAAK,aAAY,EAAK,WAAa,EAAK,YACxC,EAAK,QAAO,EAAK,MAAQ,EAAK,OAC9B,EAAK,YAAW,EAAK,UAAY,EAAK,WACtC,EAAK,aACP,EAAK,WAAa,CAChB,GAAI,EAAK,WAAW,QAAU,IAAA,GAAY,CAAC,EAAI,CAAE,MAAO,EAAK,WAAW,KAAM,EAC9E,GAAI,EAAK,WAAW,QAAU,IAAA,GAAY,CAAC,EAAI,CAAE,MAAO,EAAK,WAAW,KAAM,CAChF,GAEK,CAAC,CAAI,CACd,CACa,EAAG,IAAK,EAAS,GAAI,CACpC,CAGA,SAAgB,EAAmB,EAA+B,CAAC,EAAmB,CACpF,MAAO,CACL,UAAWA,EAAAA,mBACX,MAAM,EAAM,CACV,IAAM,EAAS,IAAI,IACb,EAAQ,GAAqC,CACjD,GAAI,EAAO,IAAI,EAAM,SAAS,EAAG,OACjC,IAAI,EAAQ,EAAQ,WAAW,CAAK,EACpC,GAAI,IAAU,IAAA,GAAW,CACvB,GAAI,EAAM,cAAgB,IAAA,GACxB,MAAU,MAAM,8DAA8D,EAAM,UAAU,GAAG,EACnG,EAAQ,IAAIC,EAAAA,UAAU,CACpB,IAAK,EAAM,IACX,IAAK,EAAM,YACX,UAAWC,EAAAA,iBAAiB,EAAM,IAAK,EAAM,YAAa,EAAM,SAAS,CAC3E,CAAC,CACH,CACA,EAAM,KAAK,EACX,IAAM,EAAS,CAAE,QAAO,gBAAmB,IAAA,EAAkB,EAC7D,EAAO,IAAI,EAAM,UAAW,CAAM,EAClC,EAAO,YAAc,EAAK,aAAa,UACrCF,EAAAA,mBACA,EAAM,UACL,GAAY,CACX,GAAI,CAAC,EAAe,CAAO,EAAG,OAC9B,IAAM,EAAU,EAAO,IAAI,EAAM,SAAS,EACtC,IAAY,IAAA,KAChB,EAAQ,OAAS,EACjB,EAAK,QAAQ,EAAM,UAAW,EAAQ,CAAO,CAAC,EAChD,EACA,CAAE,aAAc,EAAK,CACvB,CACF,EACM,EAAS,GAA4B,CACzC,IAAM,EAAS,EAAO,IAAI,CAAS,EAC9B,IACL,EAAO,YAAY,EACnB,EAAO,MAAM,QAAQ,EACrB,EAAO,OAAO,CAAS,EACzB,EACA,IAAK,IAAM,KAAS,EAAK,SAAS,EAAG,EAAK,CAAK,EAe/C,MAAO,CAZL,WAAW,EAAO,CAChB,EAAK,CAAK,EACV,IAAM,EAAS,EAAO,IAAI,EAAM,SAAS,EACnC,EAAW,GAAQ,QAAU,GAAQ,MAAM,SACjD,OAAO,IAAa,IAAA,GAAY,IAAA,GAAY,EAAQ,CAAQ,CAC9D,EACA,aAAc,EACd,eAAgB,EAChB,OAAQ,CACN,IAAK,IAAM,KAAa,EAAO,KAAK,EAAG,EAAM,CAAS,CACxD,CAEU,CACd,CACF,CACF"}
@@ -0,0 +1,2 @@
1
+ import{resolveStorePath as e}from"../services/paths/index.mjs";import{TaskStore as t}from"../services/taskStore/index.mjs";import{TASKS_CHANNEL_TYPE as n}from"../types/webTasks.mjs";function r(e){return typeof e==`object`&&!!e&&typeof e.rev==`number`&&Array.isArray(e.tasks)}function i(e){return{tasks:e.tasks.flatMap(e=>{if(e.status===`deleted`)return[];let t={id:e.id,subject:e.subject,status:e.status,blockedBy:e.blockedBy??[]};return e.description&&(t.description=e.description),e.activeForm&&(t.activeForm=e.activeForm),e.owner&&(t.owner=e.owner),e.updatedAt&&(t.updatedAt=e.updatedAt),e.delegation&&(t.delegation={...e.delegation.agent===void 0?{}:{agent:e.delegation.agent},...e.delegation.state===void 0?{}:{state:e.delegation.state}}),[t]}),rev:e.rev}}function a(a={}){return{frameType:n,start(o){let s=new Map,c=c=>{if(s.has(c.sessionId))return;let l=a.storeFor?.(c);if(l===void 0){if(c.environment===void 0)throw Error(`Task channel requires an admitted environment for session '${c.sessionId}'.`);l=new t({cwd:c.cwd,env:c.environment,storePath:e(c.cwd,c.environment,c.sessionId)})}l.read();let u={store:l,unsubscribe:()=>void 0};s.set(c.sessionId,u),u.unsubscribe=o.directEvents.subscribe(n,c.sessionId,e=>{if(!r(e))return;let t=s.get(c.sessionId);t!==void 0&&(t.latest=e,o.publish(c.sessionId,i(e)))},{replayLatest:!0})},l=e=>{let t=s.get(e);t&&(t.unsubscribe(),t.store.dispose(),s.delete(e))};for(let e of o.sessions())c(e);return{payloadFor(e){c(e);let t=s.get(e.sessionId),n=t?.latest??t?.store.snapshot;return n===void 0?void 0:i(n)},sessionAdded:c,sessionRemoved:l,close(){for(let e of s.keys())l(e)}}}}}export{a as createTasksChannel};
2
+ //# sourceMappingURL=webTasksChannel.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webTasksChannel.mjs","names":[],"sources":["../../src/controllers/webTasksChannel.ts"],"sourcesContent":["import type { DoomHubChannelSource, DoomHubSessionScope, DoomHubChannel } from '@agimon-ai/doompi-core/hub-channel';\n\nimport type { TaskDocument } from '../models/task';\nimport { resolveStorePath } from '../services/paths';\nimport { TaskStore } from '../services/taskStore';\nimport { TASKS_CHANNEL_TYPE, type WebTask, type WebTasksPayload } from '../types/webTasks';\n\ninterface TaskStoreSource {\n readonly snapshot: TaskDocument;\n read(): TaskDocument;\n dispose(): void;\n}\n\nfunction isTaskDocument(value: unknown): value is TaskDocument {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as TaskDocument).rev === 'number' &&\n Array.isArray((value as TaskDocument).tasks)\n );\n}\n\nexport interface TasksChannelOptions {\n /** Injectable for tests. The default opens the session tree's durable task store. */\n storeFor?: (scope: DoomHubSessionScope) => TaskStoreSource;\n}\n\nfunction present(document: TaskDocument): WebTasksPayload {\n const tasks: WebTask[] = document.tasks.flatMap((task) => {\n if (task.status === 'deleted') return [];\n const view: WebTask = {\n id: task.id,\n subject: task.subject,\n status: task.status,\n blockedBy: task.blockedBy ?? [],\n };\n if (task.description) view.description = task.description;\n if (task.activeForm) view.activeForm = task.activeForm;\n if (task.owner) view.owner = task.owner;\n if (task.updatedAt) view.updatedAt = task.updatedAt;\n if (task.delegation) {\n view.delegation = {\n ...(task.delegation.agent === undefined ? {} : { agent: task.delegation.agent }),\n ...(task.delegation.state === undefined ? {} : { state: task.delegation.state }),\n };\n }\n return [view];\n });\n return { tasks, rev: document.rev };\n}\n\n/** Publishes each managed session's durable task graph and follows direct session commits. */\nexport function createTasksChannel(options: TasksChannelOptions = {}): DoomHubChannel {\n return {\n frameType: TASKS_CHANNEL_TYPE,\n start(host) {\n const stores = new Map<string, { store: TaskStoreSource; unsubscribe: () => void; latest?: TaskDocument }>();\n const open = (scope: DoomHubSessionScope): void => {\n if (stores.has(scope.sessionId)) return;\n let store = options.storeFor?.(scope);\n if (store === undefined) {\n if (scope.environment === undefined)\n throw new Error(`Task channel requires an admitted environment for session '${scope.sessionId}'.`);\n store = new TaskStore({\n cwd: scope.cwd,\n env: scope.environment,\n storePath: resolveStorePath(scope.cwd, scope.environment, scope.sessionId),\n });\n }\n store.read();\n const source = { store, unsubscribe: () => undefined as void };\n stores.set(scope.sessionId, source);\n source.unsubscribe = host.directEvents.subscribe(\n TASKS_CHANNEL_TYPE,\n scope.sessionId,\n (payload) => {\n if (!isTaskDocument(payload)) return;\n const current = stores.get(scope.sessionId);\n if (current === undefined) return;\n current.latest = payload;\n host.publish(scope.sessionId, present(payload));\n },\n { replayLatest: true },\n );\n };\n const close = (sessionId: string): void => {\n const source = stores.get(sessionId);\n if (!source) return;\n source.unsubscribe();\n source.store.dispose();\n stores.delete(sessionId);\n };\n for (const scope of host.sessions()) open(scope);\n\n const source: DoomHubChannelSource = {\n payloadFor(scope) {\n open(scope);\n const source = stores.get(scope.sessionId);\n const document = source?.latest ?? source?.store.snapshot;\n return document === undefined ? undefined : present(document);\n },\n sessionAdded: open,\n sessionRemoved: close,\n close() {\n for (const sessionId of stores.keys()) close(sessionId);\n },\n };\n return source;\n },\n };\n}\n"],"mappings":"sLAaA,SAAS,EAAe,EAAuC,CAC7D,OACE,OAAO,GAAU,YACjB,GACA,OAAQ,EAAuB,KAAQ,UACvC,MAAM,QAAS,EAAuB,KAAK,CAE/C,CAOA,SAAS,EAAQ,EAAyC,CAqBxD,MAAO,CAAE,MApBgB,EAAS,MAAM,QAAS,GAAS,CACxD,GAAI,EAAK,SAAW,UAAW,MAAO,CAAC,EACvC,IAAM,EAAgB,CACpB,GAAI,EAAK,GACT,QAAS,EAAK,QACd,OAAQ,EAAK,OACb,UAAW,EAAK,WAAa,CAAC,CAChC,EAWA,OAVI,EAAK,cAAa,EAAK,YAAc,EAAK,aAC1C,EAAK,aAAY,EAAK,WAAa,EAAK,YACxC,EAAK,QAAO,EAAK,MAAQ,EAAK,OAC9B,EAAK,YAAW,EAAK,UAAY,EAAK,WACtC,EAAK,aACP,EAAK,WAAa,CAChB,GAAI,EAAK,WAAW,QAAU,IAAA,GAAY,CAAC,EAAI,CAAE,MAAO,EAAK,WAAW,KAAM,EAC9E,GAAI,EAAK,WAAW,QAAU,IAAA,GAAY,CAAC,EAAI,CAAE,MAAO,EAAK,WAAW,KAAM,CAChF,GAEK,CAAC,CAAI,CACd,CACa,EAAG,IAAK,EAAS,GAAI,CACpC,CAGA,SAAgB,EAAmB,EAA+B,CAAC,EAAmB,CACpF,MAAO,CACL,UAAW,EACX,MAAM,EAAM,CACV,IAAM,EAAS,IAAI,IACb,EAAQ,GAAqC,CACjD,GAAI,EAAO,IAAI,EAAM,SAAS,EAAG,OACjC,IAAI,EAAQ,EAAQ,WAAW,CAAK,EACpC,GAAI,IAAU,IAAA,GAAW,CACvB,GAAI,EAAM,cAAgB,IAAA,GACxB,MAAU,MAAM,8DAA8D,EAAM,UAAU,GAAG,EACnG,EAAQ,IAAI,EAAU,CACpB,IAAK,EAAM,IACX,IAAK,EAAM,YACX,UAAW,EAAiB,EAAM,IAAK,EAAM,YAAa,EAAM,SAAS,CAC3E,CAAC,CACH,CACA,EAAM,KAAK,EACX,IAAM,EAAS,CAAE,QAAO,gBAAmB,IAAA,EAAkB,EAC7D,EAAO,IAAI,EAAM,UAAW,CAAM,EAClC,EAAO,YAAc,EAAK,aAAa,UACrC,EACA,EAAM,UACL,GAAY,CACX,GAAI,CAAC,EAAe,CAAO,EAAG,OAC9B,IAAM,EAAU,EAAO,IAAI,EAAM,SAAS,EACtC,IAAY,IAAA,KAChB,EAAQ,OAAS,EACjB,EAAK,QAAQ,EAAM,UAAW,EAAQ,CAAO,CAAC,EAChD,EACA,CAAE,aAAc,EAAK,CACvB,CACF,EACM,EAAS,GAA4B,CACzC,IAAM,EAAS,EAAO,IAAI,CAAS,EAC9B,IACL,EAAO,YAAY,EACnB,EAAO,MAAM,QAAQ,EACrB,EAAO,OAAO,CAAS,EACzB,EACA,IAAK,IAAM,KAAS,EAAK,SAAS,EAAG,EAAK,CAAK,EAe/C,MAAO,CAZL,WAAW,EAAO,CAChB,EAAK,CAAK,EACV,IAAM,EAAS,EAAO,IAAI,EAAM,SAAS,EACnC,EAAW,GAAQ,QAAU,GAAQ,MAAM,SACjD,OAAO,IAAa,IAAA,GAAY,IAAA,GAAY,EAAQ,CAAQ,CAC9D,EACA,aAAc,EACd,eAAgB,EAChB,OAAQ,CACN,IAAK,IAAM,KAAa,EAAO,KAAK,EAAG,EAAM,CAAS,CACxD,CAEU,CACd,CACF,CACF"}
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./types/delegation.cjs"),t=require("./services/delegation/index.cjs");exports.BACKGROUND_WORK_PROVIDER=t.BACKGROUND_WORK_PROVIDER,exports.DelegationManager=t.DelegationManager,exports.ERR_CANCEL_UNACKNOWLEDGED=t.ERR_CANCEL_UNACKNOWLEDGED,exports.ERR_CHILD_SESSION=t.ERR_CHILD_SESSION,exports.ERR_NO_RUNTIME=t.ERR_NO_RUNTIME,exports.MAX_BRIEF_FILES=e.MAX_BRIEF_FILES,exports.NOTIFY_CUSTOM_TYPE=t.NOTIFY_CUSTOM_TYPE;
@@ -0,0 +1,3 @@
1
+ import { MAX_BRIEF_FILES } from "./types/delegation.cjs";
2
+ import { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationPlatform, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, NOTIFY_CUSTOM_TYPE } from "./services/delegation/index.cjs";
3
+ export { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationPlatform, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, MAX_BRIEF_FILES, NOTIFY_CUSTOM_TYPE };
@@ -0,0 +1,3 @@
1
+ import { MAX_BRIEF_FILES } from "./types/delegation.mjs";
2
+ import { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationPlatform, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, NOTIFY_CUSTOM_TYPE } from "./services/delegation/index.mjs";
3
+ export { AssignOptions, BACKGROUND_WORK_PROVIDER, DelegationManager, DelegationManagerOptions, DelegationNotifier, DelegationOutcome, DelegationPlatform, DelegationProgress, ERR_CANCEL_UNACKNOWLEDGED, ERR_CHILD_SESSION, ERR_NO_RUNTIME, MAX_BRIEF_FILES, NOTIFY_CUSTOM_TYPE };
@@ -0,0 +1 @@
1
+ import{MAX_BRIEF_FILES as e}from"./types/delegation.mjs";import{BACKGROUND_WORK_PROVIDER as t,DelegationManager as n,ERR_CANCEL_UNACKNOWLEDGED as r,ERR_CHILD_SESSION as i,ERR_NO_RUNTIME as a,NOTIFY_CUSTOM_TYPE as o}from"./services/delegation/index.mjs";export{t as BACKGROUND_WORK_PROVIDER,n as DelegationManager,r as ERR_CANCEL_UNACKNOWLEDGED,i as ERR_CHILD_SESSION,a as ERR_NO_RUNTIME,e as MAX_BRIEF_FILES,o as NOTIFY_CUSTOM_TYPE};
@@ -1,2 +1,3 @@
1
- var e=require("../extension.cjs").default;module.exports=e;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../types/telemetry.cjs"),t=require("../services/delegation/index.cjs"),n=require("../services/logSinkTelemetry/index.cjs"),r=require("../constants/task.cjs");require("../schemas/task.cjs");const i=require("../controllers/tasksCommand.cjs"),a=require("../services/config/index.cjs"),o=require("../tui/format.cjs"),s=require("../tui/taskOverlay.cjs"),c=require("../services/paths/index.cjs"),l=require("../services/taskStore/index.cjs"),u=require("../tui/taskSpace.cjs"),d=require("../tools/task.cjs"),f=require("../services/contextContribution/index.cjs"),p=require("../services/delegationPlatform/index.cjs"),m=require("../services/taskNarration/index.cjs");let h=require("@agimon-ai/doompi-core/delegation"),g=require("@earendil-works/pi-tui"),_=require("@agimon-ai/doompi-core/background-work"),v=require("@agimon-ai/doompi-core/context-contributions"),y=require("@agimon-ai/doompi-core/narration"),b=require("@agimon-ai/doompi-core/pi-extension"),x=require("@agimon-ai/doompi-core/readiness"),S=require("@agimon-ai/doompi-core/ui-hub");const C=f.TASK_CONTEXT_CONTRIBUTION_SOURCE,w=`error.type`,T=`task.stage`,E={sessionId:`session_id`,storeCleanup:`store_cleanup`,storeSweep:`store_sweep`,storeRead:`store_read`,reconcile:`reconcile`,refresh:`refresh`};function D(e){return e instanceof Error?e.name||`Error`:typeof e==`string`?`StringError`:e&&typeof e==`object`?`ObjectError`:`UnknownError`}const O=(0,b.definePiExtension)(C,({context:O,pi:k,signal:A})=>{let j=n.createTaskErrorReporter(),M=n.toFailureReporter(j),N=!0,P=0,F,I,L,R,z,B,V,H,U,W=e=>{j.recordWarning(`doom_task.narration_failed`,e).catch(e=>{process.emitWarning(`Doom-task could not record a narration failure: ${String(e)}`)})},G={narrate(e){let t=F,n=(0,y.createNarrationRequest)(e);if(t&&n)try{Promise.resolve(t.request(n)).catch(W)}catch(e){W(e)}}},K=async(e,t)=>{t?.throwIfAborted();let n=U;if(!n)throw Error(`doom-task session initialization has not started`);if(n.sessionManager!==e.sessionManager)throw Error(`doom-task readiness belongs to a stale Pi session`);if(await n.operation,t?.throwIfAborted(),!N||A.aborted||n!==U||!H)throw Error(`doom-task readiness belongs to a stale extension generation`)},q=()=>{z?.(),z=void 0,L?.reset(),R?.dispose(),H=void 0},J=new l.TaskStore({report:M,onCommitted:(e,t)=>m.narrateTaskCommit(G,e,t)});I=J;let Y=()=>{N&&!A.aborted&&(R?.update(),B?.update())},X=new t.DelegationManager({store:J,cwd:process.cwd(),platform:p.createNodeDelegationPlatform(),notify:(e,t)=>k.sendMessage(e,t),getSessionId:()=>H,onChange:Y,runTimeoutMs:a.getDelegationTimeoutMs(),report:M,onNotifyError:(e,t)=>{j.recordNotificationError(e,t)}});L=X;let Z=new s.TaskOverlay({getTasks:()=>J.snapshot.tasks,delegation:X});R=Z;let ee={store:J,delegation:X,maxTasks:a.getMaxTasks(),onChange:Y,report:M,waitUntilReady:K},te=async(t,n)=>{if(!N||A.aborted)return;let r=++P;H!==void 0&&q();let i=n,o=async t=>{let n=()=>!t?.aborted&&N&&!A.aborted&&r===P,o=E.sessionId,s=async(t,n)=>{o=t;try{await n()}catch(n){M.warn(e.TASK_EVENT.sessionStartDegraded,n,{[T]:t,[w]:D(n)})}};try{let t=i.sessionManager?.getSessionId();if(!t)throw Error(`doom-task requires a session id`);H=t,J.configureSession(c.resolveSessionKey(t)),o=E.storeCleanup;let r=await c.removeLegacyStoreDirectoryAsync(J.storePath);if(!n())return;o=E.storeSweep;let l=c.hasStorePathOverride()?{removed:[],errors:[]}:await c.sweepStoreFilesAsync(J.storePath,a.getStoreTtlMs());if(!n())return;let u=[...r.errors,...l.errors];for(let t of u)M.warn(e.TASK_EVENT.storeSweepFailed,Error(t));if(u.length>0&&i.hasUI&&i.ui.notify(u.join(`
2
+ `),`warning`),i.hasUI&&Z.setUICtx(i.ui),await s(E.storeRead,async()=>{await J.readAsync(n)}),!n()||(z=J.onExternalChange(Y),await s(E.reconcile,async()=>{await X.reconcile(n)}),!n()))return;o=E.refresh,Y()}catch(t){if(!n())return;throw q(),M.error(e.TASK_EVENT.sessionStartFailed,t,{[T]:o,[w]:D(t)}),t}},s=(0,x.readDoomReadinessCoordinator)(O);if(!s){let e=o();return U={sessionManager:n.sessionManager,operation:e},e}let l=U?.operation,u=(async()=>{l&&await Promise.allSettled([l]),N&&!A.aborted&&r===P&&await s.start(C,`${n.sessionManager.getSessionId()}:${r}`,async e=>(await o(e),{value:void 0})).wait()})();U={sessionManager:n.sessionManager,operation:u},Promise.allSettled([u])},ne=e=>{N&&!A.aborted&&e.toolName===`task`&&Y()},re={description:`Collapse or expand the task overlay`,handler:async e=>{N&&!A.aborted&&e.hasUI&&(await K(e),N&&!A.aborted&&Z.isRegistered()&&Z.toggleCollapse())}},Q=async()=>{if(!N)return;N=!1,P+=1;let e=U?.operation;U=void 0;try{e&&await Promise.allSettled([e]),q(),L?.dispose(),V?.(),V=void 0,I?.dispose()}finally{await j.shutdown()}},$=a.resolveCollapseKey();return{services:[e=>{e.inject([y.DOOM_NARRATION_SERVICE],e=>{let t=(0,y.requireDoomNarrationService)(e);return F=t,()=>{F===t&&(F=void 0)}}),e.inject([v.DOOM_CONTEXT_CONTRIBUTIONS_SERVICE],e=>{let t=(0,v.requireDoomContextContributions)(e).register(f.createTaskContextContribution(()=>J.snapshot.tasks));return()=>t.dispose()}),e.inject([h.DOOM_DELEGATION_SERVICE],e=>{let t=(0,h.readDoomDelegationService)(e);if(t)return X.bind(e,t)}),e.inject([_.DOOM_BACKGROUND_WORK_SERVICE],e=>{let n=(0,_.readDoomBackgroundWorkService)(e);if(!n)return;let r=n.register({provider:t.BACKGROUND_WORK_PROVIDER,listActiveWork:()=>X.listActiveWork()});return B=r,()=>{r.dispose(),B===r&&(B=void 0)}}),e.inject([S.DOOM_UI_HUB_SERVICE],e=>{let t=(0,S.requireDoomUiHub)(e).registerLeader({source:C,bindings:[{id:`tasks.open`,path:[{key:`t`,label:`tasks`,detail:`session task list`,order:65},{key:`l`,label:`list`,detail:`tasks in this session`}],command:{name:r.COMMAND_NAME}}]}),n=()=>t.dispose();return V=n,()=>{n(),V===n&&(V=void 0)}})}],onStop:Q,onDispose:Q,tools:[(0,b.definePiTool)(d.createTaskTool(ee,{renderCall:(e,t)=>o.renderTaskCall(e,t,J.snapshot.tasks),renderResult:o.renderTaskResult}))],commands:[i.createTasksCommand(J,u.openTaskSpace,K)],messageRenderers:[[t.NOTIFY_CUSTOM_TYPE,(e,t,n)=>new g.Text(n.fg(`muted`,typeof e.content==`string`?e.content:``),0,0)]],shortcuts:$===`off`?[]:[[$,re]],events:{session_start:te,session_compact:Y,session_tree:Y,tool_execution_end:ne}}});exports.default=O,exports.taskExtension=O;
2
3
  //# sourceMappingURL=pi.cjs.map