@agimon-ai/doompi-task 0.0.1-alpha.8 → 0.0.1-alpha.80

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 (576) hide show
  1. package/README.md +123 -15
  2. package/dist/_virtual/_rolldown/runtime.cjs +23 -1
  3. package/dist/api-contracts.cjs +7 -0
  4. package/dist/api-contracts.d.cts +2 -0
  5. package/dist/api-contracts.d.mts +2 -0
  6. package/dist/api-contracts.mjs +2 -0
  7. package/dist/commands.cjs +4 -2
  8. package/dist/commands.d.cts +2 -14
  9. package/dist/commands.d.mts +2 -14
  10. package/dist/commands.mjs +2 -2
  11. package/dist/config.cjs +19 -2
  12. package/dist/config.d.cts +2 -38
  13. package/dist/config.d.mts +2 -38
  14. package/dist/config.mjs +2 -2
  15. package/dist/delegation-manager.cjs +10 -0
  16. package/dist/delegation-manager.d.cts +3 -0
  17. package/dist/delegation-manager.d.mts +3 -0
  18. package/dist/delegation-manager.mjs +3 -0
  19. package/dist/extensions/mcp.cjs +1866 -0
  20. package/dist/extensions/mcp.cjs.map +1 -0
  21. package/dist/extensions/mcp.d.cts +5 -0
  22. package/dist/extensions/mcp.d.cts.map +1 -0
  23. package/dist/extensions/mcp.d.mts +5 -0
  24. package/dist/extensions/mcp.d.mts.map +1 -0
  25. package/dist/extensions/mcp.mjs +1836 -0
  26. package/dist/extensions/mcp.mjs.map +1 -0
  27. package/dist/extensions/pi.cjs +49 -1
  28. package/dist/extensions/pi.cjs.map +1 -1
  29. package/dist/extensions/pi.d.cts +5 -2
  30. package/dist/extensions/pi.d.cts.map +1 -0
  31. package/dist/extensions/pi.d.mts +5 -2
  32. package/dist/extensions/pi.d.mts.map +1 -0
  33. package/dist/extensions/pi.mjs +44 -1
  34. package/dist/extensions/pi.mjs.map +1 -1
  35. package/dist/extensions/server.cjs +57 -0
  36. package/dist/extensions/server.cjs.map +1 -0
  37. package/dist/extensions/server.d.cts +5 -0
  38. package/dist/extensions/server.d.cts.map +1 -0
  39. package/dist/extensions/server.d.mts +5 -0
  40. package/dist/extensions/server.d.mts.map +1 -0
  41. package/dist/extensions/server.mjs +52 -0
  42. package/dist/extensions/server.mjs.map +1 -0
  43. package/dist/extensions/web.mjs +1013 -0
  44. package/dist/extensions/web.mjs.map +1 -0
  45. package/dist/index.cjs +106 -1
  46. package/dist/index.d.cts +16 -15
  47. package/dist/index.d.mts +16 -15
  48. package/dist/index.mjs +16 -1
  49. package/dist/logSinkTelemetry.cjs +6 -2
  50. package/dist/logSinkTelemetry.d.cts +3 -51
  51. package/dist/logSinkTelemetry.d.mts +3 -51
  52. package/dist/logSinkTelemetry.mjs +3 -2
  53. package/dist/src/constants/promptGuidelines.cjs +26 -0
  54. package/dist/src/constants/promptGuidelines.cjs.map +1 -0
  55. package/dist/src/constants/promptGuidelines.d.cts +13 -0
  56. package/dist/src/constants/promptGuidelines.d.cts.map +1 -0
  57. package/dist/src/constants/promptGuidelines.d.mts +13 -0
  58. package/dist/src/constants/promptGuidelines.d.mts.map +1 -0
  59. package/dist/src/constants/promptGuidelines.mjs +26 -0
  60. package/dist/src/constants/promptGuidelines.mjs.map +1 -0
  61. package/dist/src/constants/task.cjs +6 -0
  62. package/dist/src/constants/task.cjs.map +1 -0
  63. package/dist/src/constants/task.d.cts +4 -0
  64. package/dist/src/constants/task.d.cts.map +1 -0
  65. package/dist/src/constants/task.d.mts +4 -0
  66. package/dist/src/constants/task.d.mts.map +1 -0
  67. package/dist/src/constants/task.mjs +6 -0
  68. package/dist/src/constants/task.mjs.map +1 -0
  69. package/dist/src/extensions/(backend)/channel/_lib/task-graph.cjs +90 -0
  70. package/dist/src/extensions/(backend)/channel/_lib/task-graph.cjs.map +1 -0
  71. package/dist/src/extensions/(backend)/channel/_lib/task-graph.mjs +89 -0
  72. package/dist/src/extensions/(backend)/channel/_lib/task-graph.mjs.map +1 -0
  73. package/dist/src/extensions/(backend)/channel/task-graph.server.cjs +7 -0
  74. package/dist/src/extensions/(backend)/channel/task-graph.server.cjs.map +1 -0
  75. package/dist/src/extensions/(backend)/channel/task-graph.server.mjs +8 -0
  76. package/dist/src/extensions/(backend)/channel/task-graph.server.mjs.map +1 -0
  77. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.cjs +317 -0
  78. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.cjs.map +1 -0
  79. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.d.cts +39 -0
  80. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.d.cts.map +1 -0
  81. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.d.mts +39 -0
  82. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.d.mts.map +1 -0
  83. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.mjs +317 -0
  84. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.cli.mjs.map +1 -0
  85. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.cjs +95 -0
  86. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.cjs.map +1 -0
  87. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.mjs +95 -0
  88. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/root.server.mjs.map +1 -0
  89. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.cjs +30 -0
  90. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.cjs.map +1 -0
  91. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.d.cts +20 -0
  92. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.d.cts.map +1 -0
  93. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.d.mts +20 -0
  94. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.d.mts.map +1 -0
  95. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.mjs +29 -0
  96. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.cli.mjs.map +1 -0
  97. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.server.cjs +19 -0
  98. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.server.cjs.map +1 -0
  99. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.server.mjs +19 -0
  100. package/dist/src/extensions/workspaces/sessions/(backend)/command/_lib/tasks.server.mjs.map +1 -0
  101. package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.cli.cjs +8 -0
  102. package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.cli.cjs.map +1 -0
  103. package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.cli.mjs +9 -0
  104. package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.cli.mjs.map +1 -0
  105. package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.server.cjs +7 -0
  106. package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.server.cjs.map +1 -0
  107. package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.server.mjs +8 -0
  108. package/dist/src/extensions/workspaces/sessions/(backend)/command/tasks.server.mjs.map +1 -0
  109. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-compact.cli.cjs +6 -0
  110. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-compact.cli.cjs.map +1 -0
  111. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-compact.cli.mjs +6 -0
  112. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-compact.cli.mjs.map +1 -0
  113. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.cjs +6 -0
  114. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.cjs.map +1 -0
  115. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.mjs +6 -0
  116. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-start.cli.mjs.map +1 -0
  117. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-tree.cli.cjs +6 -0
  118. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-tree.cli.cjs.map +1 -0
  119. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-tree.cli.mjs +6 -0
  120. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/session-tree.cli.mjs.map +1 -0
  121. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/tool-execution-end.cli.cjs +6 -0
  122. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/tool-execution-end.cli.cjs.map +1 -0
  123. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/tool-execution-end.cli.mjs +6 -0
  124. package/dist/src/extensions/workspaces/sessions/(backend)/hook/_lib/tool-execution-end.cli.mjs.map +1 -0
  125. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-compact.cli.cjs +7 -0
  126. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-compact.cli.cjs.map +1 -0
  127. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-compact.cli.mjs +8 -0
  128. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-compact.cli.mjs.map +1 -0
  129. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs +7 -0
  130. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs.map +1 -0
  131. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs +8 -0
  132. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs.map +1 -0
  133. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-tree.cli.cjs +7 -0
  134. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-tree.cli.cjs.map +1 -0
  135. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-tree.cli.mjs +8 -0
  136. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-tree.cli.mjs.map +1 -0
  137. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.cli.cjs +7 -0
  138. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.cli.cjs.map +1 -0
  139. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.cli.mjs +8 -0
  140. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.cli.mjs.map +1 -0
  141. package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/task-board.server.cjs +20 -0
  142. package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/task-board.server.cjs.map +1 -0
  143. package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/task-board.server.mjs +20 -0
  144. package/dist/src/extensions/workspaces/sessions/(backend)/resource/_lib/task-board.server.mjs.map +1 -0
  145. package/dist/src/extensions/workspaces/sessions/(backend)/resource/task-board.server.cjs +7 -0
  146. package/dist/src/extensions/workspaces/sessions/(backend)/resource/task-board.server.cjs.map +1 -0
  147. package/dist/src/extensions/workspaces/sessions/(backend)/resource/task-board.server.mjs +8 -0
  148. package/dist/src/extensions/workspaces/sessions/(backend)/resource/task-board.server.mjs.map +1 -0
  149. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs +11 -0
  150. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs.map +1 -0
  151. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs +12 -0
  152. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs.map +1 -0
  153. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs +7 -0
  154. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs.map +1 -0
  155. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs +8 -0
  156. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs.map +1 -0
  157. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.cjs +160 -0
  158. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.cjs.map +1 -0
  159. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.d.cts +25 -0
  160. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.d.cts.map +1 -0
  161. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.d.mts +25 -0
  162. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.d.mts.map +1 -0
  163. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.mjs +157 -0
  164. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.cli.mjs.map +1 -0
  165. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.server.cjs +7 -0
  166. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.server.cjs.map +1 -0
  167. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.server.mjs +8 -0
  168. package/dist/src/extensions/workspaces/sessions/(backend)/tool/_lib/task.server.mjs.map +1 -0
  169. package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.cli.cjs +7 -0
  170. package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.cli.cjs.map +1 -0
  171. package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.cli.mjs +8 -0
  172. package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.cli.mjs.map +1 -0
  173. package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.server.cjs +7 -0
  174. package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.server.cjs.map +1 -0
  175. package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.server.mjs +8 -0
  176. package/dist/src/extensions/workspaces/sessions/(backend)/tool/task.server.mjs.map +1 -0
  177. package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.cjs +333 -0
  178. package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.cjs.map +1 -0
  179. package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.d.cts +61 -0
  180. package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.d.cts.map +1 -0
  181. package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.d.mts +61 -0
  182. package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.d.mts.map +1 -0
  183. package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.mjs +322 -0
  184. package/dist/src/extensions/workspaces/sessions/(frontend)/_shared/format.cli.mjs.map +1 -0
  185. package/dist/src/extensions/workspaces/sessions/(frontend)/message/doom-task-notify.cli.cjs +9 -0
  186. package/dist/src/extensions/workspaces/sessions/(frontend)/message/doom-task-notify.cli.cjs.map +1 -0
  187. package/dist/src/extensions/workspaces/sessions/(frontend)/message/doom-task-notify.cli.mjs +9 -0
  188. package/dist/src/extensions/workspaces/sessions/(frontend)/message/doom-task-notify.cli.mjs.map +1 -0
  189. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.cjs +149 -0
  190. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.cjs.map +1 -0
  191. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.d.cts +59 -0
  192. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.d.cts.map +1 -0
  193. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.d.mts +59 -0
  194. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.d.mts.map +1 -0
  195. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.mjs +142 -0
  196. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/selectors.mjs.map +1 -0
  197. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.cjs +358 -0
  198. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.cjs.map +1 -0
  199. package/dist/{tui/taskSpace.d.cts → src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.d.cts} +12 -12
  200. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.d.cts.map +1 -0
  201. package/dist/{tui/taskSpace.d.mts → src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.d.mts} +12 -12
  202. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.d.mts.map +1 -0
  203. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.mjs +355 -0
  204. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/task-space.cli.mjs.map +1 -0
  205. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.cjs +165 -0
  206. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.cjs.map +1 -0
  207. package/dist/{tui → src/extensions/workspaces/sessions/(frontend)/overlay/_lib}/taskOverlay.d.cts +8 -7
  208. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.d.cts.map +1 -0
  209. package/dist/{tui → src/extensions/workspaces/sessions/(frontend)/overlay/_lib}/taskOverlay.d.mts +8 -7
  210. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.d.mts.map +1 -0
  211. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.mjs +164 -0
  212. package/dist/src/extensions/workspaces/sessions/(frontend)/overlay/_lib/taskOverlay.mjs.map +1 -0
  213. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/task.cli.cjs +13 -0
  214. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/task.cli.cjs.map +1 -0
  215. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/task.cli.mjs +13 -0
  216. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/_lib/task.cli.mjs.map +1 -0
  217. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/task.cli.cjs +7 -0
  218. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/task.cli.cjs.map +1 -0
  219. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/task.cli.mjs +8 -0
  220. package/dist/src/extensions/workspaces/sessions/(frontend)/tool/task.cli.mjs.map +1 -0
  221. package/dist/src/models/task.cjs +29 -0
  222. package/dist/src/models/task.cjs.map +1 -0
  223. package/dist/{store/types.d.cts → src/models/task.d.cts} +52 -31
  224. package/dist/src/models/task.d.cts.map +1 -0
  225. package/dist/{store/types.d.mts → src/models/task.d.mts} +52 -31
  226. package/dist/src/models/task.d.mts.map +1 -0
  227. package/dist/src/models/task.mjs +26 -0
  228. package/dist/src/models/task.mjs.map +1 -0
  229. package/dist/src/models/taskGraph.cjs +67 -0
  230. package/dist/{store → src/models}/taskGraph.cjs.map +1 -1
  231. package/dist/{store → src/models}/taskGraph.d.cts +7 -8
  232. package/dist/src/models/taskGraph.d.cts.map +1 -0
  233. package/dist/{store → src/models}/taskGraph.d.mts +7 -8
  234. package/dist/src/models/taskGraph.d.mts.map +1 -0
  235. package/dist/src/models/taskGraph.mjs +63 -0
  236. package/dist/{store → src/models}/taskGraph.mjs.map +1 -1
  237. package/dist/src/schemas/apiContracts.cjs +51 -0
  238. package/dist/src/schemas/apiContracts.cjs.map +1 -0
  239. package/dist/src/schemas/apiContracts.d.cts +53 -0
  240. package/dist/src/schemas/apiContracts.d.cts.map +1 -0
  241. package/dist/src/schemas/apiContracts.d.mts +53 -0
  242. package/dist/src/schemas/apiContracts.d.mts.map +1 -0
  243. package/dist/src/schemas/apiContracts.mjs +49 -0
  244. package/dist/src/schemas/apiContracts.mjs.map +1 -0
  245. package/dist/src/schemas/task.cjs +130 -0
  246. package/dist/src/schemas/task.cjs.map +1 -0
  247. package/dist/{tool/schema.d.cts → src/schemas/task.d.cts} +46 -29
  248. package/dist/src/schemas/task.d.cts.map +1 -0
  249. package/dist/{tool/schema.d.mts → src/schemas/task.d.mts} +46 -29
  250. package/dist/src/schemas/task.d.mts.map +1 -0
  251. package/dist/src/schemas/task.mjs +117 -0
  252. package/dist/src/schemas/task.mjs.map +1 -0
  253. package/dist/src/services/config/index.cjs +88 -0
  254. package/dist/src/services/config/index.cjs.map +1 -0
  255. package/dist/src/services/config/index.d.cts +42 -0
  256. package/dist/src/services/config/index.d.cts.map +1 -0
  257. package/dist/src/services/config/index.d.mts +42 -0
  258. package/dist/src/services/config/index.d.mts.map +1 -0
  259. package/dist/src/services/config/index.mjs +72 -0
  260. package/dist/src/services/config/index.mjs.map +1 -0
  261. package/dist/src/services/contextContribution/index.cjs +51 -0
  262. package/dist/src/services/contextContribution/index.cjs.map +1 -0
  263. package/dist/src/services/contextContribution/index.mjs +46 -0
  264. package/dist/src/services/contextContribution/index.mjs.map +1 -0
  265. package/dist/src/services/delegation/index.cjs +629 -0
  266. package/dist/src/services/delegation/index.cjs.map +1 -0
  267. package/dist/{delegation/manager.d.cts → src/services/delegation/index.d.cts} +52 -49
  268. package/dist/src/services/delegation/index.d.cts.map +1 -0
  269. package/dist/{delegation/manager.d.mts → src/services/delegation/index.d.mts} +52 -49
  270. package/dist/src/services/delegation/index.d.mts.map +1 -0
  271. package/dist/src/services/delegation/index.mjs +623 -0
  272. package/dist/src/services/delegation/index.mjs.map +1 -0
  273. package/dist/src/services/delegationPlatform/index.cjs +23 -0
  274. package/dist/src/services/delegationPlatform/index.cjs.map +1 -0
  275. package/dist/src/services/delegationPlatform/index.mjs +21 -0
  276. package/dist/src/services/delegationPlatform/index.mjs.map +1 -0
  277. package/dist/src/services/invariants/index.cjs +64 -0
  278. package/dist/src/services/invariants/index.cjs.map +1 -0
  279. package/dist/src/services/invariants/index.d.cts +23 -0
  280. package/dist/src/services/invariants/index.d.cts.map +1 -0
  281. package/dist/src/services/invariants/index.d.mts +23 -0
  282. package/dist/src/services/invariants/index.d.mts.map +1 -0
  283. package/dist/src/services/invariants/index.mjs +62 -0
  284. package/dist/src/services/invariants/index.mjs.map +1 -0
  285. package/dist/src/services/logSinkTelemetry/index.cjs +43 -0
  286. package/dist/src/services/logSinkTelemetry/index.cjs.map +1 -0
  287. package/dist/src/services/logSinkTelemetry/index.d.cts +23 -0
  288. package/dist/src/services/logSinkTelemetry/index.d.cts.map +1 -0
  289. package/dist/src/services/logSinkTelemetry/index.d.mts +23 -0
  290. package/dist/src/services/logSinkTelemetry/index.d.mts.map +1 -0
  291. package/dist/src/services/logSinkTelemetry/index.mjs +41 -0
  292. package/dist/src/services/logSinkTelemetry/index.mjs.map +1 -0
  293. package/dist/src/services/paths/index.cjs +233 -0
  294. package/dist/src/services/paths/index.cjs.map +1 -0
  295. package/dist/src/services/paths/index.d.cts +25 -0
  296. package/dist/src/services/paths/index.d.cts.map +1 -0
  297. package/dist/src/services/paths/index.d.mts +25 -0
  298. package/dist/src/services/paths/index.d.mts.map +1 -0
  299. package/dist/src/services/paths/index.mjs +218 -0
  300. package/dist/src/services/paths/index.mjs.map +1 -0
  301. package/dist/src/services/processLiveness/index.cjs +20 -0
  302. package/dist/src/services/processLiveness/index.cjs.map +1 -0
  303. package/dist/{store/processLiveness.d.cts → src/services/processLiveness/index.d.cts} +3 -4
  304. package/dist/src/services/processLiveness/index.d.cts.map +1 -0
  305. package/dist/{store/processLiveness.d.mts → src/services/processLiveness/index.d.mts} +3 -4
  306. package/dist/src/services/processLiveness/index.d.mts.map +1 -0
  307. package/dist/src/services/processLiveness/index.mjs +20 -0
  308. package/dist/src/services/processLiveness/index.mjs.map +1 -0
  309. package/dist/src/services/reconcile/index.cjs +65 -0
  310. package/dist/src/services/reconcile/index.cjs.map +1 -0
  311. package/dist/{store/reconcile.d.cts → src/services/reconcile/index.d.cts} +8 -9
  312. package/dist/src/services/reconcile/index.d.cts.map +1 -0
  313. package/dist/{store/reconcile.d.mts → src/services/reconcile/index.d.mts} +8 -9
  314. package/dist/src/services/reconcile/index.d.mts.map +1 -0
  315. package/dist/src/services/reconcile/index.mjs +63 -0
  316. package/dist/src/services/reconcile/index.mjs.map +1 -0
  317. package/dist/src/services/reducer/index.cjs +350 -0
  318. package/dist/src/services/reducer/index.cjs.map +1 -0
  319. package/dist/{store/reducer.d.cts → src/services/reducer/index.d.cts} +12 -13
  320. package/dist/src/services/reducer/index.d.cts.map +1 -0
  321. package/dist/{store/reducer.d.mts → src/services/reducer/index.d.mts} +12 -13
  322. package/dist/src/services/reducer/index.d.mts.map +1 -0
  323. package/dist/src/services/reducer/index.mjs +345 -0
  324. package/dist/src/services/reducer/index.mjs.map +1 -0
  325. package/dist/src/services/taskNarration/index.cjs +32 -0
  326. package/dist/src/services/taskNarration/index.cjs.map +1 -0
  327. package/dist/src/services/taskNarration/index.mjs +32 -0
  328. package/dist/src/services/taskNarration/index.mjs.map +1 -0
  329. package/dist/src/services/taskResult/index.cjs +174 -0
  330. package/dist/src/services/taskResult/index.cjs.map +1 -0
  331. package/dist/src/services/taskResult/index.d.cts +50 -0
  332. package/dist/src/services/taskResult/index.d.cts.map +1 -0
  333. package/dist/src/services/taskResult/index.d.mts +50 -0
  334. package/dist/src/services/taskResult/index.d.mts.map +1 -0
  335. package/dist/src/services/taskResult/index.mjs +165 -0
  336. package/dist/src/services/taskResult/index.mjs.map +1 -0
  337. package/dist/src/services/taskStore/index.cjs +216 -0
  338. package/dist/src/services/taskStore/index.cjs.map +1 -0
  339. package/dist/{store/taskStore.d.cts → src/services/taskStore/index.d.cts} +17 -25
  340. package/dist/src/services/taskStore/index.d.cts.map +1 -0
  341. package/dist/{store/taskStore.d.mts → src/services/taskStore/index.d.mts} +17 -25
  342. package/dist/src/services/taskStore/index.d.mts.map +1 -0
  343. package/dist/src/services/taskStore/index.mjs +213 -0
  344. package/dist/src/services/taskStore/index.mjs.map +1 -0
  345. package/dist/src/services/taskTool/index.cjs +106 -0
  346. package/dist/src/services/taskTool/index.cjs.map +1 -0
  347. package/dist/src/services/taskTool/index.mjs +105 -0
  348. package/dist/src/services/taskTool/index.mjs.map +1 -0
  349. package/dist/src/types/delegation.cjs +7 -0
  350. package/dist/src/types/delegation.cjs.map +1 -0
  351. package/dist/src/types/delegation.d.cts +5 -0
  352. package/dist/src/types/delegation.d.cts.map +1 -0
  353. package/dist/src/types/delegation.d.mts +5 -0
  354. package/dist/src/types/delegation.d.mts.map +1 -0
  355. package/dist/src/types/delegation.mjs +7 -0
  356. package/dist/src/types/delegation.mjs.map +1 -0
  357. package/dist/src/types/telemetry.cjs +26 -0
  358. package/dist/src/types/telemetry.cjs.map +1 -0
  359. package/dist/src/types/telemetry.d.cts +35 -0
  360. package/dist/src/types/telemetry.d.cts.map +1 -0
  361. package/dist/src/types/telemetry.d.mts +35 -0
  362. package/dist/src/types/telemetry.d.mts.map +1 -0
  363. package/dist/src/types/telemetry.mjs +26 -0
  364. package/dist/src/types/telemetry.mjs.map +1 -0
  365. package/dist/src/types/webTasks.cjs +7 -0
  366. package/dist/src/types/webTasks.cjs.map +1 -0
  367. package/dist/src/types/webTasks.mjs +7 -0
  368. package/dist/src/types/webTasks.mjs.map +1 -0
  369. package/dist/store-invariants.cjs +5 -0
  370. package/dist/store-invariants.d.cts +2 -0
  371. package/dist/store-invariants.d.mts +2 -0
  372. package/dist/store-invariants.mjs +2 -0
  373. package/dist/store-paths.cjs +14 -0
  374. package/dist/store-paths.d.cts +2 -0
  375. package/dist/store-paths.d.mts +2 -0
  376. package/dist/store-paths.mjs +2 -0
  377. package/dist/store-process-liveness.cjs +3 -0
  378. package/dist/store-process-liveness.d.cts +2 -0
  379. package/dist/store-process-liveness.d.mts +2 -0
  380. package/dist/store-process-liveness.mjs +2 -0
  381. package/dist/store-reconcile.cjs +5 -0
  382. package/dist/store-reconcile.d.cts +2 -0
  383. package/dist/store-reconcile.d.mts +2 -0
  384. package/dist/store-reconcile.mjs +2 -0
  385. package/dist/store-reducer.cjs +8 -0
  386. package/dist/store-reducer.d.cts +2 -0
  387. package/dist/store-reducer.d.mts +2 -0
  388. package/dist/store-reducer.mjs +2 -0
  389. package/dist/store-task-graph.cjs +7 -0
  390. package/dist/store-task-graph.d.cts +2 -0
  391. package/dist/store-task-graph.d.mts +2 -0
  392. package/dist/store-task-graph.mjs +2 -0
  393. package/dist/store-task-store.cjs +3 -0
  394. package/dist/store-task-store.d.cts +2 -0
  395. package/dist/store-task-store.d.mts +2 -0
  396. package/dist/store-task-store.mjs +2 -0
  397. package/dist/store-types.cjs +6 -0
  398. package/dist/store-types.d.cts +2 -0
  399. package/dist/store-types.d.mts +2 -0
  400. package/dist/store-types.mjs +2 -0
  401. package/dist/tool-prompt-guidelines.cjs +3 -0
  402. package/dist/tool-prompt-guidelines.d.cts +2 -0
  403. package/dist/tool-prompt-guidelines.d.mts +2 -0
  404. package/dist/tool-prompt-guidelines.mjs +2 -0
  405. package/dist/tool-response-envelope.cjs +12 -0
  406. package/dist/tool-response-envelope.d.cts +2 -0
  407. package/dist/tool-response-envelope.d.mts +2 -0
  408. package/dist/tool-response-envelope.mjs +2 -0
  409. package/dist/tool-schema.cjs +17 -0
  410. package/dist/tool-schema.d.cts +3 -0
  411. package/dist/tool-schema.d.mts +3 -0
  412. package/dist/tool-schema.mjs +3 -0
  413. package/dist/tool-task-tool.cjs +6 -0
  414. package/dist/tool-task-tool.d.cts +3 -0
  415. package/dist/tool-task-tool.d.mts +3 -0
  416. package/dist/tool-task-tool.mjs +3 -0
  417. package/dist/tui-format.cjs +14 -0
  418. package/dist/tui-format.d.cts +2 -0
  419. package/dist/tui-format.d.mts +2 -0
  420. package/dist/tui-format.mjs +2 -0
  421. package/dist/tui-selectors.cjs +10 -0
  422. package/dist/tui-selectors.d.cts +2 -0
  423. package/dist/tui-selectors.d.mts +2 -0
  424. package/dist/tui-selectors.mjs +2 -0
  425. package/dist/tui-task-overlay.cjs +4 -0
  426. package/dist/tui-task-overlay.d.cts +2 -0
  427. package/dist/tui-task-overlay.d.mts +2 -0
  428. package/dist/tui-task-overlay.mjs +2 -0
  429. package/dist/tui-task-space.cjs +5 -0
  430. package/dist/tui-task-space.d.cts +2 -0
  431. package/dist/tui-task-space.d.mts +2 -0
  432. package/dist/tui-task-space.mjs +2 -0
  433. package/package.json +167 -109
  434. package/src/types/webTasks.ts +24 -0
  435. package/dist/commands.cjs.map +0 -1
  436. package/dist/commands.d.cts.map +0 -1
  437. package/dist/commands.d.mts.map +0 -1
  438. package/dist/commands.mjs.map +0 -1
  439. package/dist/config.cjs.map +0 -1
  440. package/dist/config.d.cts.map +0 -1
  441. package/dist/config.d.mts.map +0 -1
  442. package/dist/config.mjs.map +0 -1
  443. package/dist/delegation/manager.cjs +0 -6
  444. package/dist/delegation/manager.cjs.map +0 -1
  445. package/dist/delegation/manager.d.cts.map +0 -1
  446. package/dist/delegation/manager.d.mts.map +0 -1
  447. package/dist/delegation/manager.mjs +0 -6
  448. package/dist/delegation/manager.mjs.map +0 -1
  449. package/dist/extension.cjs +0 -3
  450. package/dist/extension.cjs.map +0 -1
  451. package/dist/extension.d.cts +0 -12
  452. package/dist/extension.d.cts.map +0 -1
  453. package/dist/extension.d.mts +0 -12
  454. package/dist/extension.d.mts.map +0 -1
  455. package/dist/extension.mjs +0 -3
  456. package/dist/extension.mjs.map +0 -1
  457. package/dist/extensions/doom.cjs +0 -2
  458. package/dist/extensions/doom.cjs.map +0 -1
  459. package/dist/extensions/doom.d.cts +0 -6
  460. package/dist/extensions/doom.d.cts.map +0 -1
  461. package/dist/extensions/doom.d.mts +0 -7
  462. package/dist/extensions/doom.d.mts.map +0 -1
  463. package/dist/extensions/doom.mjs +0 -2
  464. package/dist/extensions/doom.mjs.map +0 -1
  465. package/dist/logSinkTelemetry.cjs.map +0 -1
  466. package/dist/logSinkTelemetry.d.cts.map +0 -1
  467. package/dist/logSinkTelemetry.d.mts.map +0 -1
  468. package/dist/logSinkTelemetry.mjs.map +0 -1
  469. package/dist/store/invariants.cjs +0 -2
  470. package/dist/store/invariants.cjs.map +0 -1
  471. package/dist/store/invariants.d.cts +0 -14
  472. package/dist/store/invariants.d.cts.map +0 -1
  473. package/dist/store/invariants.d.mts +0 -14
  474. package/dist/store/invariants.d.mts.map +0 -1
  475. package/dist/store/invariants.mjs +0 -2
  476. package/dist/store/invariants.mjs.map +0 -1
  477. package/dist/store/paths.cjs +0 -2
  478. package/dist/store/paths.cjs.map +0 -1
  479. package/dist/store/paths.d.cts +0 -23
  480. package/dist/store/paths.d.cts.map +0 -1
  481. package/dist/store/paths.d.mts +0 -23
  482. package/dist/store/paths.d.mts.map +0 -1
  483. package/dist/store/paths.mjs +0 -2
  484. package/dist/store/paths.mjs.map +0 -1
  485. package/dist/store/processLiveness.cjs +0 -2
  486. package/dist/store/processLiveness.cjs.map +0 -1
  487. package/dist/store/processLiveness.d.cts.map +0 -1
  488. package/dist/store/processLiveness.d.mts.map +0 -1
  489. package/dist/store/processLiveness.mjs +0 -2
  490. package/dist/store/processLiveness.mjs.map +0 -1
  491. package/dist/store/reconcile.cjs +0 -2
  492. package/dist/store/reconcile.cjs.map +0 -1
  493. package/dist/store/reconcile.d.cts.map +0 -1
  494. package/dist/store/reconcile.d.mts.map +0 -1
  495. package/dist/store/reconcile.mjs +0 -2
  496. package/dist/store/reconcile.mjs.map +0 -1
  497. package/dist/store/reducer.cjs +0 -3
  498. package/dist/store/reducer.cjs.map +0 -1
  499. package/dist/store/reducer.d.cts.map +0 -1
  500. package/dist/store/reducer.d.mts.map +0 -1
  501. package/dist/store/reducer.mjs +0 -3
  502. package/dist/store/reducer.mjs.map +0 -1
  503. package/dist/store/taskGraph.cjs +0 -2
  504. package/dist/store/taskGraph.d.cts.map +0 -1
  505. package/dist/store/taskGraph.d.mts.map +0 -1
  506. package/dist/store/taskGraph.mjs +0 -2
  507. package/dist/store/taskStore.cjs +0 -2
  508. package/dist/store/taskStore.cjs.map +0 -1
  509. package/dist/store/taskStore.d.cts.map +0 -1
  510. package/dist/store/taskStore.d.mts.map +0 -1
  511. package/dist/store/taskStore.mjs +0 -2
  512. package/dist/store/taskStore.mjs.map +0 -1
  513. package/dist/store/types.cjs +0 -2
  514. package/dist/store/types.cjs.map +0 -1
  515. package/dist/store/types.d.cts.map +0 -1
  516. package/dist/store/types.d.mts.map +0 -1
  517. package/dist/store/types.mjs +0 -2
  518. package/dist/store/types.mjs.map +0 -1
  519. package/dist/tool/promptGuidelines.cjs +0 -2
  520. package/dist/tool/promptGuidelines.cjs.map +0 -1
  521. package/dist/tool/promptGuidelines.d.cts +0 -5
  522. package/dist/tool/promptGuidelines.d.cts.map +0 -1
  523. package/dist/tool/promptGuidelines.d.mts +0 -5
  524. package/dist/tool/promptGuidelines.d.mts.map +0 -1
  525. package/dist/tool/promptGuidelines.mjs +0 -2
  526. package/dist/tool/promptGuidelines.mjs.map +0 -1
  527. package/dist/tool/responseEnvelope.cjs +0 -6
  528. package/dist/tool/responseEnvelope.cjs.map +0 -1
  529. package/dist/tool/responseEnvelope.d.cts +0 -39
  530. package/dist/tool/responseEnvelope.d.cts.map +0 -1
  531. package/dist/tool/responseEnvelope.d.mts +0 -39
  532. package/dist/tool/responseEnvelope.d.mts.map +0 -1
  533. package/dist/tool/responseEnvelope.mjs +0 -6
  534. package/dist/tool/responseEnvelope.mjs.map +0 -1
  535. package/dist/tool/schema.cjs +0 -2
  536. package/dist/tool/schema.cjs.map +0 -1
  537. package/dist/tool/schema.d.cts.map +0 -1
  538. package/dist/tool/schema.d.mts.map +0 -1
  539. package/dist/tool/schema.mjs +0 -2
  540. package/dist/tool/schema.mjs.map +0 -1
  541. package/dist/tool/taskTool.cjs +0 -3
  542. package/dist/tool/taskTool.cjs.map +0 -1
  543. package/dist/tool/taskTool.d.cts +0 -17
  544. package/dist/tool/taskTool.d.cts.map +0 -1
  545. package/dist/tool/taskTool.d.mts +0 -17
  546. package/dist/tool/taskTool.d.mts.map +0 -1
  547. package/dist/tool/taskTool.mjs +0 -3
  548. package/dist/tool/taskTool.mjs.map +0 -1
  549. package/dist/tui/format.cjs +0 -4
  550. package/dist/tui/format.cjs.map +0 -1
  551. package/dist/tui/format.d.cts +0 -62
  552. package/dist/tui/format.d.cts.map +0 -1
  553. package/dist/tui/format.d.mts +0 -62
  554. package/dist/tui/format.d.mts.map +0 -1
  555. package/dist/tui/format.mjs +0 -4
  556. package/dist/tui/format.mjs.map +0 -1
  557. package/dist/tui/selectors.cjs +0 -2
  558. package/dist/tui/selectors.cjs.map +0 -1
  559. package/dist/tui/selectors.d.cts +0 -53
  560. package/dist/tui/selectors.d.cts.map +0 -1
  561. package/dist/tui/selectors.d.mts +0 -53
  562. package/dist/tui/selectors.d.mts.map +0 -1
  563. package/dist/tui/selectors.mjs +0 -2
  564. package/dist/tui/selectors.mjs.map +0 -1
  565. package/dist/tui/taskOverlay.cjs +0 -2
  566. package/dist/tui/taskOverlay.cjs.map +0 -1
  567. package/dist/tui/taskOverlay.d.cts.map +0 -1
  568. package/dist/tui/taskOverlay.d.mts.map +0 -1
  569. package/dist/tui/taskOverlay.mjs +0 -2
  570. package/dist/tui/taskOverlay.mjs.map +0 -1
  571. package/dist/tui/taskSpace.cjs +0 -5
  572. package/dist/tui/taskSpace.cjs.map +0 -1
  573. package/dist/tui/taskSpace.d.cts.map +0 -1
  574. package/dist/tui/taskSpace.d.mts.map +0 -1
  575. package/dist/tui/taskSpace.mjs +0 -5
  576. package/dist/tui/taskSpace.mjs.map +0 -1
@@ -0,0 +1,1013 @@
1
+ import { defineActivityGroup, defineChannelFile, defineFill, defineSessionStore, defineToolRenderer, defineWebPlugin } from "@agimon-ai/doompi-core/web";
2
+ import { Button, ChevronDownIcon, ChevronRightIcon, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Dot, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, EditIcon, Input, KebabIcon, MessageIcon, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Textarea, TrashIcon, toolTone } from "@agimon-ai/doompi-web-components";
3
+ import { useStore } from "@tanstack/react-store";
4
+ import { useState } from "react";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/types/webTasks.ts
7
+ /** Browser-safe task view published by the cockpit hub channel. */
8
+ const TASKS_CHANNEL_TYPE = "task_graph";
9
+ //#endregion
10
+ //#region src/extensions/workspaces/sessions/(frontend)/channel/_lib/tasksStore.ts
11
+ const tasks = defineSessionStore({
12
+ tasks: [],
13
+ rev: 0
14
+ });
15
+ function isRecord$1(value) {
16
+ return typeof value === "object" && value !== null && !Array.isArray(value);
17
+ }
18
+ function parseTask(value) {
19
+ if (!isRecord$1(value) || typeof value.id !== "number" || typeof value.subject !== "string") return null;
20
+ if (![
21
+ "pending",
22
+ "in_progress",
23
+ "completed",
24
+ "failed"
25
+ ].includes(String(value.status))) return null;
26
+ const task = {
27
+ id: value.id,
28
+ subject: value.subject,
29
+ status: value.status,
30
+ blockedBy: Array.isArray(value.blockedBy) ? value.blockedBy.filter((id) => typeof id === "number") : []
31
+ };
32
+ if (typeof value.description === "string") task.description = value.description;
33
+ if (typeof value.activeForm === "string") task.activeForm = value.activeForm;
34
+ if (typeof value.owner === "string") task.owner = value.owner;
35
+ if (typeof value.updatedAt === "string") task.updatedAt = value.updatedAt;
36
+ if (isRecord$1(value.delegation)) {
37
+ task.delegation = {};
38
+ if (typeof value.delegation.agent === "string") task.delegation.agent = value.delegation.agent;
39
+ if (typeof value.delegation.state === "string") task.delegation.state = value.delegation.state;
40
+ }
41
+ return task;
42
+ }
43
+ const tasksChannel = tasks.channel({
44
+ channel: TASKS_CHANNEL_TYPE,
45
+ parse(input) {
46
+ if (!isRecord$1(input) || !Array.isArray(input.tasks) || typeof input.rev !== "number") return null;
47
+ return {
48
+ tasks: input.tasks.map(parseTask).filter((task) => task !== null),
49
+ rev: input.rev
50
+ };
51
+ },
52
+ reduce: (_current, payload) => payload
53
+ });
54
+ function taskEditDraft(task) {
55
+ return {
56
+ subject: task.subject,
57
+ description: task.description ?? "",
58
+ status: task.status
59
+ };
60
+ }
61
+ function changedFields(task, draft) {
62
+ const changes = [];
63
+ const subject = draft.subject.trim();
64
+ const description = draft.description.trim();
65
+ if (subject && subject !== task.subject) changes.push(`set subject to "${subject}"`);
66
+ if (description !== (task.description ?? "").trim()) changes.push(description ? `set description to "${description}"` : "clear the description");
67
+ if (draft.status !== task.status) changes.push(`set status to ${draft.status}`);
68
+ return changes;
69
+ }
70
+ /**
71
+ * The agent stays the only writer of task state, so an edit leaves the cockpit
72
+ * as one prompt naming exactly the fields the human changed. Nothing changed
73
+ * means nothing to send.
74
+ */
75
+ function taskEditInstruction(task, draft) {
76
+ const changes = changedFields(task, draft);
77
+ if (changes.length === 0) return null;
78
+ return `Update task #${task.id}: ${changes.join("; ")}. Change nothing else and keep the dependency graph valid.`;
79
+ }
80
+ function requestTaskEdit(send, sessionId, task, draft) {
81
+ const message = taskEditInstruction(task, draft);
82
+ if (message === null) return false;
83
+ send(sessionId, {
84
+ type: "prompt",
85
+ message
86
+ });
87
+ return true;
88
+ }
89
+ /** Steering for the subagent that owns a delegated task. */
90
+ function taskMessageInstruction(taskId, agent, message) {
91
+ return `Steer the ${agent} run working on task #${taskId} with this message, then update the task if its plan changed: ${message.trim()}`;
92
+ }
93
+ function requestTaskMessage(send, sessionId, taskId, agent, message) {
94
+ send(sessionId, {
95
+ type: "prompt",
96
+ message: taskMessageInstruction(taskId, agent, message)
97
+ });
98
+ }
99
+ function requestTaskRemoval(send, sessionId, taskId) {
100
+ send(sessionId, {
101
+ type: "prompt",
102
+ message: `Remove task #${taskId}. Also remove or repair every dependency that references it so the remaining task graph is valid.`
103
+ });
104
+ }
105
+ //#endregion
106
+ //#region src/extensions/workspaces/sessions/(frontend)/activity-group/tasks.web.ts
107
+ /**
108
+ * The live task board in the session Activity dock.
109
+ *
110
+ * Active means a delegated run is still out, not that the list has entries. A
111
+ * pending task waits for this agent's next turn and reports to nobody, so
112
+ * counting it as running would leave the dock badge, the top bar and the
113
+ * timeline's background-work notice claiming work that nothing will finish.
114
+ */
115
+ var tasks_web_default = defineActivityGroup({
116
+ keys: "t l",
117
+ statusKey: "@agimon-ai/doompi-task",
118
+ marksBackgroundWork: false,
119
+ activeSource: {
120
+ subscribe(listener) {
121
+ const subscription = tasks.store.subscribe(listener);
122
+ return () => subscription.unsubscribe();
123
+ },
124
+ isActive(sessionId) {
125
+ return tasks.select(tasks.store.state, sessionId).tasks.some((task) => task.delegation?.state === "requested" || task.delegation?.state === "running");
126
+ }
127
+ },
128
+ order: 65
129
+ });
130
+ //#endregion
131
+ //#region src/extensions/workspaces/sessions/(frontend)/channel/task-graph.web.ts
132
+ var task_graph_web_default = defineChannelFile(tasksChannel);
133
+ //#endregion
134
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/TaskDetailDialog.tsx
135
+ const STATUS_CHOICES = [
136
+ "pending",
137
+ "in_progress",
138
+ "completed",
139
+ "failed"
140
+ ];
141
+ const DESCRIPTION_ROWS = 5;
142
+ const MESSAGE_ROWS = 4;
143
+ function FieldLabel({ children }) {
144
+ return /* @__PURE__ */ jsx("span", {
145
+ className: "text-2xs font-bold tracking-widest text-doom-faint",
146
+ children
147
+ });
148
+ }
149
+ function Field({ label, children }) {
150
+ return /* @__PURE__ */ jsxs("div", {
151
+ className: "flex flex-col gap-1.5",
152
+ children: [/* @__PURE__ */ jsx(FieldLabel, { children: label }), children]
153
+ });
154
+ }
155
+ function ReadOnlyValue({ value, testId }) {
156
+ return /* @__PURE__ */ jsx("span", {
157
+ "data-testid": testId,
158
+ className: "whitespace-pre-wrap break-words text-sm leading-relaxed text-doom-dim",
159
+ children: value
160
+ });
161
+ }
162
+ function TaskFacts({ task }) {
163
+ return /* @__PURE__ */ jsxs("div", {
164
+ className: "flex flex-wrap gap-5",
165
+ children: [
166
+ /* @__PURE__ */ jsx(Field, {
167
+ label: "STATUS",
168
+ children: /* @__PURE__ */ jsx(ReadOnlyValue, {
169
+ testId: "task-detail-status",
170
+ value: task.status.replace("_", " ")
171
+ })
172
+ }),
173
+ task.activeForm ? /* @__PURE__ */ jsx(Field, {
174
+ label: "ACTIVE FORM",
175
+ children: /* @__PURE__ */ jsx(ReadOnlyValue, {
176
+ testId: "task-detail-active-form",
177
+ value: task.activeForm
178
+ })
179
+ }) : null,
180
+ task.owner ? /* @__PURE__ */ jsx(Field, {
181
+ label: "OWNER",
182
+ children: /* @__PURE__ */ jsx(ReadOnlyValue, {
183
+ testId: "task-detail-owner",
184
+ value: task.owner
185
+ })
186
+ }) : null,
187
+ task.delegation?.agent ? /* @__PURE__ */ jsx(Field, {
188
+ label: "DELEGATED TO",
189
+ children: /* @__PURE__ */ jsx(ReadOnlyValue, {
190
+ testId: "task-detail-agent",
191
+ value: task.delegation.state ? `${task.delegation.agent} · ${task.delegation.state}` : task.delegation.agent
192
+ })
193
+ }) : null,
194
+ task.blockedBy.length > 0 ? /* @__PURE__ */ jsx(Field, {
195
+ label: "BLOCKED BY",
196
+ children: /* @__PURE__ */ jsx(ReadOnlyValue, {
197
+ testId: "task-detail-blocked-by",
198
+ value: task.blockedBy.map((id) => `#${id}`).join(", ")
199
+ })
200
+ }) : null,
201
+ task.updatedAt ? /* @__PURE__ */ jsx(Field, {
202
+ label: "UPDATED",
203
+ children: /* @__PURE__ */ jsx(ReadOnlyValue, {
204
+ testId: "task-detail-updated",
205
+ value: task.updatedAt
206
+ })
207
+ }) : null
208
+ ]
209
+ });
210
+ }
211
+ /**
212
+ * One task, read first and changed second. Every change leaves as a prompt the
213
+ * session can see, so the agent remains the only writer of task state.
214
+ */
215
+ function TaskDetailDialog({ task, sessionId, mode: initialMode, send, onClose }) {
216
+ const [mode, setMode] = useState(initialMode);
217
+ const [draft, setDraft] = useState(() => taskEditDraft(task));
218
+ const [message, setMessage] = useState("");
219
+ const agent = task.delegation?.agent;
220
+ const submitEdit = () => {
221
+ if (requestTaskEdit(send, sessionId, task, draft)) onClose();
222
+ };
223
+ const submitMessage = () => {
224
+ if (!message.trim() || !agent) return;
225
+ requestTaskMessage(send, sessionId, task.id, agent, message);
226
+ onClose();
227
+ };
228
+ return /* @__PURE__ */ jsx(Dialog, {
229
+ open: true,
230
+ onOpenChange: (open) => {
231
+ if (!open) onClose();
232
+ },
233
+ children: /* @__PURE__ */ jsxs(DialogContent, {
234
+ width: "lg",
235
+ "data-testid": "task-detail-dialog",
236
+ "data-mode": mode,
237
+ "aria-describedby": void 0,
238
+ children: [/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs("div", {
239
+ className: "flex min-w-0 flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2.5",
240
+ children: [/* @__PURE__ */ jsxs("span", {
241
+ className: "text-2xs text-doom-faint",
242
+ children: ["task #", task.id]
243
+ }), /* @__PURE__ */ jsx(DialogTitle, {
244
+ "data-testid": "task-detail-title",
245
+ className: "max-w-full break-words",
246
+ children: task.subject
247
+ })]
248
+ }) }), /* @__PURE__ */ jsxs(DialogBody, { children: [
249
+ mode === "view" ? /* @__PURE__ */ jsxs(Fragment, { children: [
250
+ /* @__PURE__ */ jsx(Field, {
251
+ label: "DESCRIPTION",
252
+ children: /* @__PURE__ */ jsx(ReadOnlyValue, {
253
+ testId: "task-detail-description",
254
+ value: task.description ?? "no description on this task"
255
+ })
256
+ }),
257
+ /* @__PURE__ */ jsx(TaskFacts, { task }),
258
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
259
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
260
+ agent ? /* @__PURE__ */ jsx(Button, {
261
+ variant: "outline",
262
+ size: "xs",
263
+ "data-testid": "task-detail-open-message",
264
+ onClick: () => setMode("message"),
265
+ children: "message agent"
266
+ }) : null,
267
+ /* @__PURE__ */ jsx(Button, {
268
+ variant: "primary",
269
+ size: "xs",
270
+ "data-testid": "task-detail-open-edit",
271
+ onClick: () => setMode("edit"),
272
+ children: "edit"
273
+ })
274
+ ] })
275
+ ] }) : null,
276
+ mode === "edit" ? /* @__PURE__ */ jsxs(Fragment, { children: [
277
+ /* @__PURE__ */ jsx(Field, {
278
+ label: "SUBJECT",
279
+ children: /* @__PURE__ */ jsx(Input, {
280
+ "data-testid": "task-detail-subject-input",
281
+ autoFocus: true,
282
+ value: draft.subject,
283
+ onChange: (event) => setDraft({
284
+ ...draft,
285
+ subject: event.target.value
286
+ })
287
+ })
288
+ }),
289
+ /* @__PURE__ */ jsx(Field, {
290
+ label: "DESCRIPTION",
291
+ children: /* @__PURE__ */ jsx(Textarea, {
292
+ "data-testid": "task-detail-description-input",
293
+ rows: DESCRIPTION_ROWS,
294
+ value: draft.description,
295
+ placeholder: "what this task covers",
296
+ onChange: (event) => setDraft({
297
+ ...draft,
298
+ description: event.target.value
299
+ })
300
+ })
301
+ }),
302
+ /* @__PURE__ */ jsx(Field, {
303
+ label: "STATUS",
304
+ children: /* @__PURE__ */ jsxs(Select, {
305
+ value: draft.status,
306
+ onValueChange: (value) => setDraft({
307
+ ...draft,
308
+ status: value
309
+ }),
310
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
311
+ "data-testid": "task-detail-status-input",
312
+ className: "h-7 w-full min-w-0 text-xs sm:min-w-[200px]",
313
+ children: /* @__PURE__ */ jsx(SelectValue, {})
314
+ }), /* @__PURE__ */ jsx(SelectContent, { children: STATUS_CHOICES.map((status) => /* @__PURE__ */ jsx(SelectItem, {
315
+ value: status,
316
+ children: status.replace("_", " ")
317
+ }, status)) })]
318
+ })
319
+ }),
320
+ /* @__PURE__ */ jsxs(DialogFooter, {
321
+ className: "flex-wrap sm:flex-nowrap",
322
+ children: [
323
+ /* @__PURE__ */ jsx("span", {
324
+ className: "w-full text-2xs text-doom-faint sm:w-auto",
325
+ children: "saved as one prompt naming only the fields you changed"
326
+ }),
327
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
328
+ /* @__PURE__ */ jsx(Button, {
329
+ variant: "outline",
330
+ size: "xs",
331
+ "data-testid": "task-detail-cancel",
332
+ onClick: onClose,
333
+ children: "cancel"
334
+ }),
335
+ /* @__PURE__ */ jsx(Button, {
336
+ variant: "primary",
337
+ size: "xs",
338
+ "data-testid": "task-detail-save",
339
+ onClick: submitEdit,
340
+ children: "save"
341
+ })
342
+ ]
343
+ })
344
+ ] }) : null,
345
+ mode === "message" && agent ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Field, {
346
+ label: `MESSAGE TO ${agent.toUpperCase()}`,
347
+ children: /* @__PURE__ */ jsx(Textarea, {
348
+ "data-testid": "task-detail-message-input",
349
+ autoFocus: true,
350
+ rows: MESSAGE_ROWS,
351
+ value: message,
352
+ placeholder: "guidance for the run working on this task",
353
+ onChange: (event) => setMessage(event.target.value)
354
+ })
355
+ }), /* @__PURE__ */ jsxs(DialogFooter, {
356
+ className: "flex-wrap sm:flex-nowrap",
357
+ children: [
358
+ /* @__PURE__ */ jsx("span", {
359
+ className: "w-full text-2xs text-doom-faint sm:w-auto",
360
+ children: "steers the run, it does not edit the task"
361
+ }),
362
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1" }),
363
+ /* @__PURE__ */ jsx(Button, {
364
+ variant: "outline",
365
+ size: "xs",
366
+ "data-testid": "task-detail-cancel",
367
+ onClick: onClose,
368
+ children: "cancel"
369
+ }),
370
+ /* @__PURE__ */ jsx(Button, {
371
+ variant: "primary",
372
+ size: "xs",
373
+ "data-testid": "task-detail-send",
374
+ onClick: submitMessage,
375
+ children: "send"
376
+ })
377
+ ]
378
+ })] }) : null
379
+ ] })]
380
+ })
381
+ });
382
+ }
383
+ //#endregion
384
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/_lib/TasksActivitySection.tsx
385
+ const STATUS_TONE$1 = {
386
+ pending: "muted",
387
+ in_progress: "yellow",
388
+ completed: "green",
389
+ failed: "red",
390
+ deleted: "muted"
391
+ };
392
+ function TaskRow({ task, sessionId, sendSessionFrame, openDialog }) {
393
+ const detail = task.status === "in_progress" ? task.activeForm : task.description;
394
+ const agent = task.delegation?.agent;
395
+ return /* @__PURE__ */ jsxs("div", {
396
+ "data-testid": `activity-task-${task.id}`,
397
+ "data-task-status": task.status,
398
+ className: "flex flex-col gap-1 rounded-md px-1 py-1",
399
+ children: [/* @__PURE__ */ jsxs("div", {
400
+ className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-x-1.5",
401
+ children: [
402
+ /* @__PURE__ */ jsx(Dot, {
403
+ tone: STATUS_TONE$1[task.status],
404
+ pulse: task.status === "in_progress"
405
+ }),
406
+ /* @__PURE__ */ jsxs("button", {
407
+ type: "button",
408
+ "data-testid": `activity-task-title-${task.id}`,
409
+ title: task.subject,
410
+ onClick: () => openDialog("view"),
411
+ className: `min-w-0 truncate text-left text-xs font-bold hover:underline ${task.status === "failed" ? "text-doom-red" : task.status === "completed" ? "text-doom-dim" : "text-doom-hi"}`,
412
+ children: [
413
+ /* @__PURE__ */ jsxs("span", {
414
+ className: "text-doom-faint",
415
+ children: ["#", task.id]
416
+ }),
417
+ " ",
418
+ task.subject
419
+ ]
420
+ }),
421
+ /* @__PURE__ */ jsx("span", {
422
+ className: "shrink-0 text-2xs text-doom-faint",
423
+ children: task.status.replace("_", " ")
424
+ }),
425
+ task.status !== "completed" && task.status !== "deleted" ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
426
+ asChild: true,
427
+ children: /* @__PURE__ */ jsx(Button, {
428
+ variant: "ghost",
429
+ size: "icon",
430
+ "data-testid": `activity-task-menu-${task.id}`,
431
+ "aria-label": `task #${task.id} actions`,
432
+ title: `task #${task.id} actions`,
433
+ className: "self-center shrink-0 text-doom-faint hover:bg-doom-deep hover:text-doom-hi data-[state=open]:bg-doom-deep data-[state=open]:text-doom-hi",
434
+ children: /* @__PURE__ */ jsx(KebabIcon, { className: "h-3 w-3" })
435
+ })
436
+ }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
437
+ "data-testid": `activity-task-menu-list-${task.id}`,
438
+ children: [
439
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
440
+ "data-testid": `activity-task-edit-${task.id}`,
441
+ onSelect: () => openDialog("edit"),
442
+ children: [/* @__PURE__ */ jsx(EditIcon, { className: "h-3 w-3" }), "Edit"]
443
+ }),
444
+ agent ? /* @__PURE__ */ jsxs(DropdownMenuItem, {
445
+ "data-testid": `activity-task-message-${task.id}`,
446
+ onSelect: () => openDialog("message"),
447
+ children: [/* @__PURE__ */ jsx(MessageIcon, { className: "h-3 w-3" }), "Message agent"]
448
+ }) : null,
449
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
450
+ variant: "destructive",
451
+ "data-testid": `activity-task-remove-${task.id}`,
452
+ onSelect: () => requestTaskRemoval(sendSessionFrame, sessionId, task.id),
453
+ children: [/* @__PURE__ */ jsx(TrashIcon, { className: "h-3 w-3" }), "Remove"]
454
+ })
455
+ ]
456
+ })] }) : null
457
+ ]
458
+ }), detail || agent || task.blockedBy.length > 0 ? /* @__PURE__ */ jsxs("span", {
459
+ className: "truncate pl-3 text-2xs text-doom-faint",
460
+ children: [
461
+ agent ? `[${agent}] ` : "",
462
+ detail ?? "",
463
+ task.blockedBy.length > 0 ? ` · blocked by ${task.blockedBy.map((id) => `#${id}`).join(", ")}` : ""
464
+ ]
465
+ }) : null]
466
+ });
467
+ }
468
+ /**
469
+ * Session task graph in the activity dock. Empty graphs have no cockpit presence.
470
+ *
471
+ * This fills the `tasks` activity group, so the dock has already drawn the
472
+ * heading, the key chip and the section frame. Rendering rows only keeps the
473
+ * group titled once.
474
+ */
475
+ function TasksActivitySection({ sessionId, sendSessionFrame }) {
476
+ const sessionTasks = useStore(tasks.store, (state) => tasks.select(state, sessionId).tasks);
477
+ const [historyOpen, setHistoryOpen] = useState(false);
478
+ const [dialog, setDialog] = useState();
479
+ if (sessionId === null || sessionTasks.length === 0) return null;
480
+ const active = sessionTasks.filter((task) => task.status === "pending" || task.status === "in_progress");
481
+ const history = sessionTasks.filter((task) => task.status === "completed" || task.status === "failed");
482
+ const dialogTask = dialog ? sessionTasks.find((task) => task.id === dialog.taskId) : void 0;
483
+ return /* @__PURE__ */ jsxs("div", {
484
+ className: "flex flex-col gap-2",
485
+ children: [
486
+ active.length > 0 ? /* @__PURE__ */ jsx("div", {
487
+ className: "flex flex-col gap-0.5",
488
+ children: active.map((task) => /* @__PURE__ */ jsx(TaskRow, {
489
+ task,
490
+ sessionId,
491
+ sendSessionFrame,
492
+ openDialog: (mode) => setDialog({
493
+ taskId: task.id,
494
+ mode
495
+ })
496
+ }, task.id))
497
+ }) : null,
498
+ history.length > 0 ? /* @__PURE__ */ jsxs("div", {
499
+ className: "flex flex-col gap-0.5",
500
+ children: [/* @__PURE__ */ jsxs(Button, {
501
+ variant: "ghost",
502
+ size: "xs",
503
+ "aria-expanded": historyOpen,
504
+ onClick: () => setHistoryOpen((open) => !open),
505
+ className: "justify-start gap-1.5 rounded-md px-1 py-0.5 hover:bg-doom-panel",
506
+ children: [
507
+ historyOpen ? /* @__PURE__ */ jsx(ChevronDownIcon, { className: "h-2.5 w-2.5 text-doom-faint" }) : /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-2.5 w-2.5 text-doom-faint" }),
508
+ /* @__PURE__ */ jsx("span", {
509
+ className: "text-xs font-bold text-doom-dim",
510
+ children: "session"
511
+ }),
512
+ /* @__PURE__ */ jsx("span", {
513
+ className: "text-2xs text-doom-faint",
514
+ children: history.length
515
+ })
516
+ ]
517
+ }), historyOpen ? /* @__PURE__ */ jsx("div", {
518
+ className: "flex flex-col gap-0.5 pl-2",
519
+ children: history.map((task) => /* @__PURE__ */ jsx(TaskRow, {
520
+ task,
521
+ sessionId,
522
+ sendSessionFrame,
523
+ openDialog: (mode) => setDialog({
524
+ taskId: task.id,
525
+ mode
526
+ })
527
+ }, task.id))
528
+ }) : null]
529
+ }) : null,
530
+ dialog && dialogTask ? /* @__PURE__ */ jsx(TaskDetailDialog, {
531
+ task: dialogTask,
532
+ sessionId,
533
+ mode: dialog.mode,
534
+ send: sendSessionFrame,
535
+ onClose: () => setDialog(void 0)
536
+ }, `${dialogTask.id}-${dialog.mode}`) : null
537
+ ]
538
+ });
539
+ }
540
+ //#endregion
541
+ //#region src/extensions/workspaces/sessions/(frontend)/fill/Tasks.activity.tasks.web.tsx
542
+ var Tasks_activity_tasks_web_default = defineFill({ component: TasksActivitySection });
543
+ //#endregion
544
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/taskToolFormat.ts
545
+ const STATUS_GLYPH = {
546
+ pending: "○",
547
+ in_progress: "◐",
548
+ completed: "●",
549
+ failed: "✗",
550
+ deleted: "⊘"
551
+ };
552
+ const STATUS_LABEL = {
553
+ pending: "pending",
554
+ in_progress: "in progress",
555
+ completed: "completed",
556
+ failed: "failed",
557
+ deleted: "deleted"
558
+ };
559
+ const ACTION_GLYPH = {
560
+ upsert: "✎",
561
+ delete: "×",
562
+ get: "›",
563
+ list: "☰",
564
+ clear: "∅",
565
+ assign: "⇒",
566
+ cancel: "⊗"
567
+ };
568
+ /**
569
+ * `upsert` is two operations behind one name, so a homogeneous batch narrows to
570
+ * the glyph the operator already reads: `+` means new work appeared, `→` means
571
+ * work moved. A mixed batch keeps the neutral write glyph.
572
+ */
573
+ const UPSERT_CREATE_GLYPH = "+";
574
+ const UPSERT_UPDATE_GLYPH = "→";
575
+ /** Task rows kept in a collapsed result, before the card is expanded. */
576
+ const TRANSCRIPT_TASK_ROWS = 8;
577
+ const TASK_STATUSES = [
578
+ "pending",
579
+ "in_progress",
580
+ "completed",
581
+ "failed",
582
+ "deleted"
583
+ ];
584
+ const TASK_ACTIONS = [
585
+ "upsert",
586
+ "list",
587
+ "get",
588
+ "delete",
589
+ "clear",
590
+ "assign",
591
+ "cancel"
592
+ ];
593
+ const INLINE_WHITESPACE = /\s+/gu;
594
+ function isRecord(value) {
595
+ return typeof value === "object" && value !== null && !Array.isArray(value);
596
+ }
597
+ function isStatus(value) {
598
+ return typeof value === "string" && TASK_STATUSES.includes(value);
599
+ }
600
+ function isAction(value) {
601
+ return typeof value === "string" && TASK_ACTIONS.includes(value);
602
+ }
603
+ function taskView(value) {
604
+ if (!isRecord(value) || typeof value.id !== "number" || typeof value.subject !== "string") return null;
605
+ if (!isStatus(value.status)) return null;
606
+ const task = {
607
+ id: value.id,
608
+ subject: value.subject,
609
+ status: value.status
610
+ };
611
+ if (typeof value.activeForm === "string") task.activeForm = value.activeForm;
612
+ if (Array.isArray(value.blockedBy)) task.blockedBy = value.blockedBy.filter((id) => typeof id === "number");
613
+ if (isRecord(value.delegation)) {
614
+ task.delegation = {};
615
+ if (typeof value.delegation.agent === "string") task.delegation.agent = value.delegation.agent;
616
+ if (typeof value.delegation.state === "string") task.delegation.state = value.delegation.state;
617
+ }
618
+ return task;
619
+ }
620
+ function idList(value) {
621
+ return Array.isArray(value) ? value.filter((id) => typeof id === "number") : [];
622
+ }
623
+ /** Narrows the wire details; null when they are not a task result at all. */
624
+ function taskDetailsView(details) {
625
+ if (!isRecord(details) || !isAction(details.action) || !Array.isArray(details.tasks)) return null;
626
+ const view = {
627
+ action: details.action,
628
+ params: isRecord(details.params) ? details.params : {},
629
+ tasks: details.tasks.map(taskView).filter((task) => task !== null)
630
+ };
631
+ if (typeof details.error === "string") view.error = details.error;
632
+ if (isRecord(details.upsert)) view.upsert = {
633
+ applied: idList(details.upsert.applied),
634
+ failed: typeof details.upsert.failed === "number" ? details.upsert.failed : 0
635
+ };
636
+ if (isRecord(details.assignment)) view.assignment = {
637
+ assigned: idList(details.assignment.assigned),
638
+ failed: typeof details.assignment.failed === "number" ? details.assignment.failed : 0
639
+ };
640
+ return view;
641
+ }
642
+ /** `#id` for the wire's id, which the TUI would resolve to a subject through the store. */
643
+ function idLabel(value) {
644
+ return typeof value === "number" || typeof value === "string" ? `#${value}` : "#?";
645
+ }
646
+ /** Keep dynamic content on one line. */
647
+ function inlineText(text) {
648
+ return text.replace(INLINE_WHITESPACE, " ").trim();
649
+ }
650
+ function upsertGlyph(items) {
651
+ if (items.length === 0) return ACTION_GLYPH.upsert;
652
+ if (items.every((item) => item.id === void 0)) return UPSERT_CREATE_GLYPH;
653
+ if (items.every((item) => item.id !== void 0)) return UPSERT_UPDATE_GLYPH;
654
+ return ACTION_GLYPH.upsert;
655
+ }
656
+ /**
657
+ * The TUI resolves an id to its subject through the task store; the card has
658
+ * no store and shows `#id` until the result names the task.
659
+ */
660
+ function taskCallView(args) {
661
+ const action = typeof args.action === "string" ? args.action : "task";
662
+ if (!isAction(action)) return {
663
+ glyph: "?",
664
+ action,
665
+ subjectTone: "dim"
666
+ };
667
+ const items = action === "upsert" && Array.isArray(args.tasks) ? args.tasks.filter(isRecord) : [];
668
+ const view = {
669
+ glyph: action === "upsert" ? upsertGlyph(items) : ACTION_GLYPH[action],
670
+ action,
671
+ subjectTone: "dim"
672
+ };
673
+ if (action === "upsert") {
674
+ if (items.length === 1) {
675
+ const only = items[0] ?? {};
676
+ if (only.id === void 0) {
677
+ if (typeof only.subject === "string") view.subject = inlineText(only.subject);
678
+ } else {
679
+ view.subject = typeof only.subject === "string" ? inlineText(only.subject) : idLabel(only.id);
680
+ view.subjectTone = "accent";
681
+ }
682
+ } else if (items.length > 1) view.subject = `${items.length} tasks`;
683
+ } else if (action === "assign") {
684
+ const assignments = Array.isArray(args.assignments) ? args.assignments.filter(isRecord) : [];
685
+ if (assignments.length === 1) {
686
+ const only = assignments[0] ?? {};
687
+ view.subject = idLabel(only.id);
688
+ view.subjectTone = "accent";
689
+ if (typeof only.agent === "string") view.detail = `→ ${only.agent}`;
690
+ } else if (assignments.length > 1) view.subject = `${assignments.length} tasks`;
691
+ } else if ((action === "get" || action === "delete" || action === "cancel") && args.id !== void 0) {
692
+ view.subject = idLabel(args.id);
693
+ view.subjectTone = "accent";
694
+ } else if (action === "list" && isStatus(args.status)) view.detail = STATUS_LABEL[args.status];
695
+ return view;
696
+ }
697
+ function taskRow(task) {
698
+ const row = {
699
+ id: task.id,
700
+ glyph: STATUS_GLYPH[task.status],
701
+ subject: inlineText(task.subject),
702
+ status: task.status,
703
+ closed: task.status === "completed" || task.status === "deleted",
704
+ blockedBy: task.blockedBy ?? []
705
+ };
706
+ if (task.delegation?.agent) row.agent = inlineText(task.delegation.agent);
707
+ if (task.status === "in_progress" && task.activeForm) row.activeForm = inlineText(task.activeForm);
708
+ return row;
709
+ }
710
+ function nonEmptyLines(text) {
711
+ return text.split("\n").filter((line) => line.trim().length > 0);
712
+ }
713
+ /**
714
+ * The rows `list` reported to the model: `details.tasks` is the whole
715
+ * document, so the call's filters apply again here or the card would disagree
716
+ * with the text the model was given.
717
+ */
718
+ function listedTasks(details) {
719
+ let view = details.tasks;
720
+ if (details.params.includeDeleted !== true) view = view.filter((task) => task.status !== "deleted");
721
+ if (isStatus(details.params.status)) view = view.filter((task) => task.status === details.params.status);
722
+ return view;
723
+ }
724
+ function byIds(details, ids) {
725
+ return ids.flatMap((id) => details.tasks.find((task) => task.id === id) ?? []);
726
+ }
727
+ function batch(tasks, failed, verb, expanded) {
728
+ if (tasks.length === 1 && failed === 0) return {
729
+ rows: [taskRow(tasks[0])],
730
+ status: null
731
+ };
732
+ const shown = expanded ? tasks : tasks.slice(0, TRANSCRIPT_TASK_ROWS);
733
+ let summary = `${tasks.length} ${verb}`;
734
+ if (failed > 0) summary += ` · ${failed} failed`;
735
+ if (tasks.length > shown.length) summary += ` · ${tasks.length - shown.length} more`;
736
+ return {
737
+ rows: shown.map(taskRow),
738
+ status: {
739
+ glyph: failed > 0 ? "!" : "✓",
740
+ tone: failed > 0 ? "warning" : "ok",
741
+ text: summary
742
+ }
743
+ };
744
+ }
745
+ function taskResultView(input) {
746
+ const details = taskDetailsView(input.details);
747
+ if (input.isPartial) return {
748
+ rows: [],
749
+ errorLines: [],
750
+ status: {
751
+ glyph: "◐",
752
+ tone: "running",
753
+ text: nonEmptyLines(input.output).at(-1) ?? "working"
754
+ }
755
+ };
756
+ if (input.isError || details?.error !== void 0) {
757
+ const all = nonEmptyLines(details?.error ?? input.output);
758
+ if (all.length <= 1) return {
759
+ rows: [],
760
+ errorLines: [],
761
+ status: {
762
+ glyph: "✗",
763
+ tone: "error",
764
+ text: all[0] ?? ""
765
+ }
766
+ };
767
+ return {
768
+ rows: [],
769
+ errorLines: input.expanded ? all : all.slice(0, TRANSCRIPT_TASK_ROWS),
770
+ status: {
771
+ glyph: "✗",
772
+ tone: "error",
773
+ text: ""
774
+ }
775
+ };
776
+ }
777
+ if (details === null) return {
778
+ rows: [],
779
+ errorLines: [],
780
+ status: {
781
+ glyph: "✓",
782
+ tone: "ok",
783
+ text: ""
784
+ }
785
+ };
786
+ if (details.action === "list") {
787
+ const tasks = listedTasks(details);
788
+ const shown = input.expanded ? tasks : tasks.slice(0, TRANSCRIPT_TASK_ROWS);
789
+ let summary = tasks.length === 0 ? "no tasks" : `${tasks.length} task${tasks.length === 1 ? "" : "s"}`;
790
+ if (tasks.length > shown.length) summary += ` · ${tasks.length - shown.length} more`;
791
+ return {
792
+ rows: shown.map(taskRow),
793
+ errorLines: [],
794
+ status: {
795
+ glyph: "✓",
796
+ tone: "ok",
797
+ text: summary
798
+ }
799
+ };
800
+ }
801
+ if (details.action === "clear") return {
802
+ rows: [],
803
+ errorLines: [],
804
+ status: {
805
+ glyph: "✓",
806
+ tone: "ok",
807
+ text: "cleared"
808
+ }
809
+ };
810
+ if (details.action === "assign" && details.assignment) return {
811
+ errorLines: [],
812
+ ...batch(byIds(details, details.assignment.assigned), details.assignment.failed, "assigned", input.expanded)
813
+ };
814
+ if (details.action === "upsert") return {
815
+ errorLines: [],
816
+ ...batch(byIds(details, details.upsert?.applied ?? []), details.upsert?.failed ?? 0, "applied", input.expanded)
817
+ };
818
+ const id = details.params.id;
819
+ const task = typeof id === "number" ? details.tasks.find((candidate) => candidate.id === id) : void 0;
820
+ if (!task) return {
821
+ rows: [],
822
+ errorLines: [],
823
+ status: {
824
+ glyph: "✓",
825
+ tone: "ok",
826
+ text: ""
827
+ }
828
+ };
829
+ return {
830
+ rows: [taskRow(task)],
831
+ errorLines: [],
832
+ status: null
833
+ };
834
+ }
835
+ //#endregion
836
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/_lib/TaskToolMessage.tsx
837
+ const STATUS_TONE = {
838
+ pending: "text-doom-dim",
839
+ in_progress: "text-doom-yellow",
840
+ completed: "text-doom-green",
841
+ failed: "text-doom-red",
842
+ deleted: "text-doom-faint"
843
+ };
844
+ const RESULT_TONE = {
845
+ running: "running",
846
+ ok: "ok",
847
+ error: "error",
848
+ warning: "running"
849
+ };
850
+ /** One task row: status glyph, id, subject and chips on the left, the status label flushed right. */
851
+ function TaskRowLine({ row }) {
852
+ return /* @__PURE__ */ jsxs("li", {
853
+ "data-testid": "tool-result-task-row",
854
+ "data-task-id": row.id,
855
+ className: "flex items-baseline gap-2",
856
+ children: [
857
+ /* @__PURE__ */ jsx("span", {
858
+ className: `shrink-0 ${STATUS_TONE[row.status]}`,
859
+ children: row.glyph
860
+ }),
861
+ /* @__PURE__ */ jsxs("span", {
862
+ className: "shrink-0 text-doom-faint",
863
+ children: ["#", row.id]
864
+ }),
865
+ /* @__PURE__ */ jsxs("span", {
866
+ className: `min-w-0 flex-1 truncate ${row.closed ? "text-doom-faint line-through" : row.status === "in_progress" ? "text-doom-blue" : "text-doom-text"}`,
867
+ children: [
868
+ row.subject,
869
+ row.agent ? /* @__PURE__ */ jsxs("span", {
870
+ className: "text-doom-faint",
871
+ children: [
872
+ " [",
873
+ row.agent,
874
+ "]"
875
+ ]
876
+ }) : null,
877
+ row.activeForm ? /* @__PURE__ */ jsxs("span", {
878
+ className: "text-doom-faint",
879
+ children: [
880
+ " (",
881
+ row.activeForm,
882
+ ")"
883
+ ]
884
+ }) : null,
885
+ row.blockedBy.length > 0 ? /* @__PURE__ */ jsxs("span", {
886
+ className: "text-doom-faint",
887
+ children: [" ⛓ ", row.blockedBy.map((id) => `#${id}`).join(",")]
888
+ }) : null
889
+ ]
890
+ }),
891
+ /* @__PURE__ */ jsx("span", {
892
+ className: `shrink-0 ${STATUS_TONE[row.status]}`,
893
+ children: STATUS_LABEL[row.status]
894
+ })
895
+ ]
896
+ });
897
+ }
898
+ /**
899
+ * The task tool's timeline item: `glyph action subject` with the assignee or
900
+ * list filter in the header, as renderTaskCall shows it; the rows the action
901
+ * touched, then the batch or list summary, in the body, as renderTaskResult
902
+ * lays it out.
903
+ */
904
+ function TaskToolMessage({ args, result, output, running, isError }) {
905
+ const call = taskCallView(args);
906
+ const collapsed = taskResultView({
907
+ details: result?.details,
908
+ output,
909
+ expanded: false,
910
+ isPartial: running,
911
+ isError
912
+ });
913
+ const full = taskResultView({
914
+ details: result?.details,
915
+ output,
916
+ expanded: true,
917
+ isPartial: running,
918
+ isError
919
+ });
920
+ const hidden = full.rows.length - collapsed.rows.length + (full.errorLines.length - collapsed.errorLines.length);
921
+ return /* @__PURE__ */ jsx(MessageItem, {
922
+ tone: toolTone({
923
+ running,
924
+ isError
925
+ }),
926
+ expandable: hidden > 0,
927
+ children: ({ expanded }) => {
928
+ const view = expanded ? full : collapsed;
929
+ const empty = view.rows.length === 0 && view.errorLines.length === 0 && view.status === null;
930
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageItemHeader, {
931
+ title: "task",
932
+ children: /* @__PURE__ */ jsxs("span", {
933
+ "data-testid": "tool-call-task",
934
+ className: "flex min-w-0 flex-1 items-center gap-1.5",
935
+ children: [
936
+ /* @__PURE__ */ jsxs("span", {
937
+ className: "shrink-0 text-doom-text",
938
+ children: [
939
+ call.glyph,
940
+ " ",
941
+ call.action
942
+ ]
943
+ }),
944
+ call.subject ? /* @__PURE__ */ jsx("span", {
945
+ className: `min-w-0 truncate ${call.subjectTone === "accent" ? "text-doom-blue" : "text-doom-dim"}`,
946
+ children: call.subject
947
+ }) : null,
948
+ call.detail ? /* @__PURE__ */ jsx("span", {
949
+ className: "shrink-0 text-doom-faint",
950
+ children: call.detail
951
+ }) : null
952
+ ]
953
+ })
954
+ }), empty ? null : /* @__PURE__ */ jsxs(MessageItemBody, {
955
+ "data-testid": "tool-result-task",
956
+ className: "flex flex-col gap-1",
957
+ children: [
958
+ view.rows.length > 0 ? /* @__PURE__ */ jsx("ul", {
959
+ className: "flex flex-col gap-0.5",
960
+ children: view.rows.map((row) => /* @__PURE__ */ jsx(TaskRowLine, { row }, row.id))
961
+ }) : null,
962
+ view.errorLines.length > 0 ? /* @__PURE__ */ jsx("pre", {
963
+ className: "whitespace-pre-wrap break-words font-mono text-doom-dim",
964
+ children: view.errorLines.join("\n")
965
+ }) : null,
966
+ !expanded && hidden > 0 ? /* @__PURE__ */ jsxs(MessageItemStatus, {
967
+ expands: true,
968
+ children: [hidden, " more"]
969
+ }) : null,
970
+ view.status ? /* @__PURE__ */ jsx(MessageItemStatus, {
971
+ "data-testid": "tool-result-task-status",
972
+ tone: RESULT_TONE[view.status.tone],
973
+ glyph: view.status.glyph,
974
+ children: view.status.text
975
+ }) : null
976
+ ]
977
+ })] });
978
+ }
979
+ });
980
+ }
981
+ //#endregion
982
+ //#region src/extensions/workspaces/sessions/(frontend)/tool/task.web.tsx
983
+ var task_web_default = defineToolRenderer({ message: TaskToolMessage });
984
+ //#endregion
985
+ //#region generated/web.ts
986
+ const via = (identity, value) => ({
987
+ ...identity,
988
+ ...value
989
+ });
990
+ const webPlugin = defineWebPlugin({
991
+ id: "task",
992
+ session: {
993
+ get activityGroups() {
994
+ return [via({ name: "tasks" }, tasks_web_default)];
995
+ },
996
+ get channels() {
997
+ return [via({ channel: "task_graph" }, task_graph_web_default)];
998
+ },
999
+ get fills() {
1000
+ return [via({
1001
+ slot: "activity.tasks",
1002
+ id: "tasks"
1003
+ }, Tasks_activity_tasks_web_default)];
1004
+ },
1005
+ get toolRenderers() {
1006
+ return [via({ tools: ["task"] }, task_web_default)];
1007
+ }
1008
+ }
1009
+ });
1010
+ //#endregion
1011
+ export { webPlugin };
1012
+
1013
+ //# sourceMappingURL=web.mjs.map