@agimon-ai/doompi-task 0.0.1-alpha.0 → 0.0.1-alpha.10

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 (329) hide show
  1. package/dist/adapters/pi/extension.cjs +3 -0
  2. package/dist/adapters/pi/extension.cjs.map +1 -0
  3. package/dist/adapters/pi/extension.d.cts +12 -0
  4. package/dist/adapters/pi/extension.d.cts.map +1 -0
  5. package/dist/adapters/pi/extension.d.mts +12 -0
  6. package/dist/adapters/pi/extension.d.mts.map +1 -0
  7. package/dist/adapters/pi/extension.mjs +3 -0
  8. package/dist/adapters/pi/extension.mjs.map +1 -0
  9. package/dist/adapters/store/paths.cjs +2 -0
  10. package/dist/adapters/store/paths.cjs.map +1 -0
  11. package/dist/adapters/store/paths.d.cts +26 -0
  12. package/dist/adapters/store/paths.d.cts.map +1 -0
  13. package/dist/adapters/store/paths.d.mts +26 -0
  14. package/dist/adapters/store/paths.d.mts.map +1 -0
  15. package/dist/adapters/store/paths.mjs +2 -0
  16. package/dist/adapters/store/paths.mjs.map +1 -0
  17. package/dist/adapters/store/taskStore.cjs +2 -0
  18. package/dist/adapters/store/taskStore.cjs.map +1 -0
  19. package/dist/adapters/store/taskStore.d.cts +87 -0
  20. package/dist/adapters/store/taskStore.d.cts.map +1 -0
  21. package/dist/adapters/store/taskStore.d.mts +87 -0
  22. package/dist/adapters/store/taskStore.d.mts.map +1 -0
  23. package/dist/adapters/store/taskStore.mjs +2 -0
  24. package/dist/adapters/store/taskStore.mjs.map +1 -0
  25. package/dist/adapters/telemetry/logSinkTelemetry.cjs +2 -0
  26. package/dist/adapters/telemetry/logSinkTelemetry.cjs.map +1 -0
  27. package/dist/adapters/telemetry/logSinkTelemetry.d.cts +52 -0
  28. package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -0
  29. package/dist/adapters/telemetry/logSinkTelemetry.d.mts +52 -0
  30. package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -0
  31. package/dist/adapters/telemetry/logSinkTelemetry.mjs +2 -0
  32. package/dist/adapters/telemetry/logSinkTelemetry.mjs.map +1 -0
  33. package/dist/commands/index.cjs +2 -0
  34. package/dist/commands/index.cjs.map +1 -0
  35. package/dist/commands/index.d.cts +15 -0
  36. package/dist/commands/index.d.cts.map +1 -0
  37. package/dist/commands/index.d.mts +15 -0
  38. package/dist/commands/index.d.mts.map +1 -0
  39. package/dist/commands/index.mjs +2 -0
  40. package/dist/commands/index.mjs.map +1 -0
  41. package/dist/commands/task/promptGuidelines.cjs +2 -0
  42. package/dist/commands/task/promptGuidelines.cjs.map +1 -0
  43. package/dist/commands/task/promptGuidelines.d.cts +5 -0
  44. package/dist/commands/task/promptGuidelines.d.cts.map +1 -0
  45. package/dist/commands/task/promptGuidelines.d.mts +5 -0
  46. package/dist/commands/task/promptGuidelines.d.mts.map +1 -0
  47. package/dist/commands/task/promptGuidelines.mjs +2 -0
  48. package/dist/commands/task/promptGuidelines.mjs.map +1 -0
  49. package/dist/commands/task/responseEnvelope.cjs +6 -0
  50. package/dist/commands/task/responseEnvelope.cjs.map +1 -0
  51. package/dist/commands/task/responseEnvelope.d.cts +39 -0
  52. package/dist/commands/task/responseEnvelope.d.cts.map +1 -0
  53. package/dist/commands/task/responseEnvelope.d.mts +39 -0
  54. package/dist/commands/task/responseEnvelope.d.mts.map +1 -0
  55. package/dist/commands/task/responseEnvelope.mjs +6 -0
  56. package/dist/commands/task/responseEnvelope.mjs.map +1 -0
  57. package/dist/commands/task/taskTool.cjs +3 -0
  58. package/dist/commands/task/taskTool.cjs.map +1 -0
  59. package/dist/commands/task/taskTool.d.cts +18 -0
  60. package/dist/commands/task/taskTool.d.cts.map +1 -0
  61. package/dist/commands/task/taskTool.d.mts +18 -0
  62. package/dist/commands/task/taskTool.d.mts.map +1 -0
  63. package/dist/commands/task/taskTool.mjs +3 -0
  64. package/dist/commands/task/taskTool.mjs.map +1 -0
  65. package/dist/commands.cjs +1 -2
  66. package/dist/commands.d.cts +2 -14
  67. package/dist/commands.d.mts +2 -14
  68. package/dist/commands.mjs +1 -2
  69. package/dist/config.cjs +1 -2
  70. package/dist/config.d.cts +2 -38
  71. package/dist/config.d.mts +2 -38
  72. package/dist/config.mjs +1 -2
  73. package/dist/delegation/manager.cjs +1 -5
  74. package/dist/delegation/manager.d.cts +2 -189
  75. package/dist/delegation/manager.d.mts +2 -189
  76. package/dist/delegation/manager.mjs +1 -5
  77. package/dist/extension.cjs +1 -3
  78. package/dist/extension.d.cts +2 -12
  79. package/dist/extension.d.mts +2 -12
  80. package/dist/extension.mjs +1 -3
  81. package/dist/extensions/doom.cjs +1 -1
  82. package/dist/extensions/doom.cjs.map +1 -1
  83. package/dist/extensions/doom.mjs +1 -1
  84. package/dist/extensions/doom.mjs.map +1 -1
  85. package/dist/extensions/pi.cjs +1 -1
  86. package/dist/extensions/pi.cjs.map +1 -1
  87. package/dist/extensions/pi.d.cts +1 -1
  88. package/dist/extensions/pi.d.mts +1 -1
  89. package/dist/extensions/pi.mjs +1 -1
  90. package/dist/extensions/pi.mjs.map +1 -1
  91. package/dist/index.cjs +1 -1
  92. package/dist/index.d.cts +16 -15
  93. package/dist/index.d.mts +16 -15
  94. package/dist/index.mjs +1 -1
  95. package/dist/logSinkTelemetry.cjs +1 -2
  96. package/dist/logSinkTelemetry.d.cts +2 -51
  97. package/dist/logSinkTelemetry.d.mts +2 -51
  98. package/dist/logSinkTelemetry.mjs +1 -2
  99. package/dist/schemas/task.cjs +2 -0
  100. package/dist/schemas/task.cjs.map +1 -0
  101. package/dist/schemas/task.d.cts +86 -0
  102. package/dist/schemas/task.d.cts.map +1 -0
  103. package/dist/schemas/task.d.mts +86 -0
  104. package/dist/schemas/task.d.mts.map +1 -0
  105. package/dist/schemas/task.mjs +2 -0
  106. package/dist/schemas/task.mjs.map +1 -0
  107. package/dist/services/delegation/manager.cjs +6 -0
  108. package/dist/services/delegation/manager.cjs.map +1 -0
  109. package/dist/services/delegation/manager.d.cts +188 -0
  110. package/dist/services/delegation/manager.d.cts.map +1 -0
  111. package/dist/services/delegation/manager.d.mts +188 -0
  112. package/dist/services/delegation/manager.d.mts.map +1 -0
  113. package/dist/services/delegation/manager.mjs +6 -0
  114. package/dist/services/delegation/manager.mjs.map +1 -0
  115. package/dist/services/narration/taskNarration.cjs +2 -0
  116. package/dist/services/narration/taskNarration.cjs.map +1 -0
  117. package/dist/services/narration/taskNarration.mjs +2 -0
  118. package/dist/services/narration/taskNarration.mjs.map +1 -0
  119. package/dist/services/store/invariants.cjs +2 -0
  120. package/dist/services/store/invariants.cjs.map +1 -0
  121. package/dist/services/store/invariants.d.cts +14 -0
  122. package/dist/services/store/invariants.d.cts.map +1 -0
  123. package/dist/services/store/invariants.d.mts +14 -0
  124. package/dist/services/store/invariants.d.mts.map +1 -0
  125. package/dist/services/store/invariants.mjs +2 -0
  126. package/dist/services/store/invariants.mjs.map +1 -0
  127. package/dist/services/store/paths.cjs +1 -0
  128. package/dist/services/store/paths.mjs +1 -0
  129. package/dist/services/store/processLiveness.cjs +2 -0
  130. package/dist/services/store/processLiveness.cjs.map +1 -0
  131. package/dist/services/store/processLiveness.d.cts +12 -0
  132. package/dist/services/store/processLiveness.d.cts.map +1 -0
  133. package/dist/services/store/processLiveness.d.mts +12 -0
  134. package/dist/services/store/processLiveness.d.mts.map +1 -0
  135. package/dist/services/store/processLiveness.mjs +2 -0
  136. package/dist/services/store/processLiveness.mjs.map +1 -0
  137. package/dist/services/store/reconcile.cjs +2 -0
  138. package/dist/services/store/reconcile.cjs.map +1 -0
  139. package/dist/services/store/reconcile.d.cts +34 -0
  140. package/dist/services/store/reconcile.d.cts.map +1 -0
  141. package/dist/services/store/reconcile.d.mts +34 -0
  142. package/dist/services/store/reconcile.d.mts.map +1 -0
  143. package/dist/services/store/reconcile.mjs +2 -0
  144. package/dist/services/store/reconcile.mjs.map +1 -0
  145. package/dist/services/store/reducer.cjs +3 -0
  146. package/dist/services/store/reducer.cjs.map +1 -0
  147. package/dist/services/store/reducer.d.cts +72 -0
  148. package/dist/services/store/reducer.d.cts.map +1 -0
  149. package/dist/services/store/reducer.d.mts +72 -0
  150. package/dist/services/store/reducer.d.mts.map +1 -0
  151. package/dist/services/store/reducer.mjs +3 -0
  152. package/dist/services/store/reducer.mjs.map +1 -0
  153. package/dist/services/store/taskGraph.cjs +2 -0
  154. package/dist/services/store/taskGraph.cjs.map +1 -0
  155. package/dist/services/store/taskGraph.d.cts +25 -0
  156. package/dist/services/store/taskGraph.d.cts.map +1 -0
  157. package/dist/services/store/taskGraph.d.mts +25 -0
  158. package/dist/services/store/taskGraph.d.mts.map +1 -0
  159. package/dist/services/store/taskGraph.mjs +2 -0
  160. package/dist/services/store/taskGraph.mjs.map +1 -0
  161. package/dist/services/store/taskStore.cjs +1 -0
  162. package/dist/services/store/taskStore.d.cts +2 -0
  163. package/dist/services/store/taskStore.d.mts +2 -0
  164. package/dist/services/store/taskStore.mjs +1 -0
  165. package/dist/services/store/types.cjs +2 -0
  166. package/dist/services/store/types.cjs.map +1 -0
  167. package/dist/services/store/types.d.cts +165 -0
  168. package/dist/services/store/types.d.cts.map +1 -0
  169. package/dist/services/store/types.d.mts +165 -0
  170. package/dist/services/store/types.d.mts.map +1 -0
  171. package/dist/services/store/types.mjs +2 -0
  172. package/dist/services/store/types.mjs.map +1 -0
  173. package/dist/store/invariants.cjs +1 -2
  174. package/dist/store/invariants.d.cts +2 -14
  175. package/dist/store/invariants.d.mts +2 -14
  176. package/dist/store/invariants.mjs +1 -2
  177. package/dist/store/paths.cjs +1 -2
  178. package/dist/store/paths.d.cts +2 -23
  179. package/dist/store/paths.d.mts +2 -23
  180. package/dist/store/paths.mjs +1 -2
  181. package/dist/store/processLiveness.cjs +1 -2
  182. package/dist/store/processLiveness.d.cts +2 -12
  183. package/dist/store/processLiveness.d.mts +2 -12
  184. package/dist/store/processLiveness.mjs +1 -2
  185. package/dist/store/reconcile.cjs +1 -2
  186. package/dist/store/reconcile.d.cts +2 -34
  187. package/dist/store/reconcile.d.mts +2 -34
  188. package/dist/store/reconcile.mjs +1 -2
  189. package/dist/store/reducer.cjs +1 -3
  190. package/dist/store/reducer.d.cts +2 -72
  191. package/dist/store/reducer.d.mts +2 -72
  192. package/dist/store/reducer.mjs +1 -3
  193. package/dist/store/taskGraph.cjs +1 -2
  194. package/dist/store/taskGraph.d.cts +2 -25
  195. package/dist/store/taskGraph.d.mts +2 -25
  196. package/dist/store/taskGraph.mjs +1 -2
  197. package/dist/store/taskStore.cjs +1 -2
  198. package/dist/store/taskStore.d.cts +3 -77
  199. package/dist/store/taskStore.d.mts +3 -77
  200. package/dist/store/taskStore.mjs +1 -2
  201. package/dist/store/types.cjs +1 -2
  202. package/dist/store/types.d.cts +2 -165
  203. package/dist/store/types.d.mts +2 -165
  204. package/dist/store/types.mjs +1 -2
  205. package/dist/tool/promptGuidelines.cjs +1 -2
  206. package/dist/tool/promptGuidelines.d.cts +2 -5
  207. package/dist/tool/promptGuidelines.d.mts +2 -5
  208. package/dist/tool/promptGuidelines.mjs +1 -2
  209. package/dist/tool/responseEnvelope.cjs +1 -6
  210. package/dist/tool/responseEnvelope.d.cts +2 -39
  211. package/dist/tool/responseEnvelope.d.mts +2 -39
  212. package/dist/tool/responseEnvelope.mjs +1 -6
  213. package/dist/tool/schema.cjs +1 -2
  214. package/dist/tool/schema.d.cts +2 -86
  215. package/dist/tool/schema.d.mts +2 -86
  216. package/dist/tool/schema.mjs +1 -2
  217. package/dist/tool/taskTool.cjs +1 -3
  218. package/dist/tool/taskTool.d.cts +3 -17
  219. package/dist/tool/taskTool.d.mts +3 -17
  220. package/dist/tool/taskTool.mjs +1 -3
  221. package/dist/tui/format.cjs +3 -3
  222. package/dist/tui/format.cjs.map +1 -1
  223. package/dist/tui/format.d.cts +3 -3
  224. package/dist/tui/format.d.cts.map +1 -1
  225. package/dist/tui/format.d.mts +3 -3
  226. package/dist/tui/format.d.mts.map +1 -1
  227. package/dist/tui/format.mjs +3 -3
  228. package/dist/tui/format.mjs.map +1 -1
  229. package/dist/tui/selectors.cjs +1 -1
  230. package/dist/tui/selectors.cjs.map +1 -1
  231. package/dist/tui/selectors.d.cts +17 -9
  232. package/dist/tui/selectors.d.cts.map +1 -1
  233. package/dist/tui/selectors.d.mts +17 -9
  234. package/dist/tui/selectors.d.mts.map +1 -1
  235. package/dist/tui/selectors.mjs +1 -1
  236. package/dist/tui/selectors.mjs.map +1 -1
  237. package/dist/tui/taskOverlay.cjs +1 -1
  238. package/dist/tui/taskOverlay.cjs.map +1 -1
  239. package/dist/tui/taskOverlay.d.cts +2 -2
  240. package/dist/tui/taskOverlay.d.cts.map +1 -1
  241. package/dist/tui/taskOverlay.d.mts +2 -2
  242. package/dist/tui/taskOverlay.d.mts.map +1 -1
  243. package/dist/tui/taskOverlay.mjs +1 -1
  244. package/dist/tui/taskOverlay.mjs.map +1 -1
  245. package/dist/tui/taskSpace.cjs +1 -1
  246. package/dist/tui/taskSpace.cjs.map +1 -1
  247. package/dist/tui/taskSpace.d.cts +2 -1
  248. package/dist/tui/taskSpace.d.cts.map +1 -1
  249. package/dist/tui/taskSpace.d.mts +2 -1
  250. package/dist/tui/taskSpace.d.mts.map +1 -1
  251. package/dist/tui/taskSpace.mjs +1 -1
  252. package/dist/tui/taskSpace.mjs.map +1 -1
  253. package/dist/types/config.cjs +2 -0
  254. package/dist/types/config.cjs.map +1 -0
  255. package/dist/types/config.d.cts +38 -0
  256. package/dist/types/config.d.cts.map +1 -0
  257. package/dist/types/config.d.mts +38 -0
  258. package/dist/types/config.d.mts.map +1 -0
  259. package/dist/types/config.mjs +2 -0
  260. package/dist/types/config.mjs.map +1 -0
  261. package/package.json +4 -4
  262. package/dist/commands.cjs.map +0 -1
  263. package/dist/commands.d.cts.map +0 -1
  264. package/dist/commands.d.mts.map +0 -1
  265. package/dist/commands.mjs.map +0 -1
  266. package/dist/config.cjs.map +0 -1
  267. package/dist/config.d.cts.map +0 -1
  268. package/dist/config.d.mts.map +0 -1
  269. package/dist/config.mjs.map +0 -1
  270. package/dist/delegation/manager.cjs.map +0 -1
  271. package/dist/delegation/manager.d.cts.map +0 -1
  272. package/dist/delegation/manager.d.mts.map +0 -1
  273. package/dist/delegation/manager.mjs.map +0 -1
  274. package/dist/extension.cjs.map +0 -1
  275. package/dist/extension.d.cts.map +0 -1
  276. package/dist/extension.d.mts.map +0 -1
  277. package/dist/extension.mjs.map +0 -1
  278. package/dist/logSinkTelemetry.cjs.map +0 -1
  279. package/dist/logSinkTelemetry.d.cts.map +0 -1
  280. package/dist/logSinkTelemetry.d.mts.map +0 -1
  281. package/dist/logSinkTelemetry.mjs.map +0 -1
  282. package/dist/store/invariants.cjs.map +0 -1
  283. package/dist/store/invariants.d.cts.map +0 -1
  284. package/dist/store/invariants.d.mts.map +0 -1
  285. package/dist/store/invariants.mjs.map +0 -1
  286. package/dist/store/paths.cjs.map +0 -1
  287. package/dist/store/paths.d.cts.map +0 -1
  288. package/dist/store/paths.d.mts.map +0 -1
  289. package/dist/store/paths.mjs.map +0 -1
  290. package/dist/store/processLiveness.cjs.map +0 -1
  291. package/dist/store/processLiveness.d.cts.map +0 -1
  292. package/dist/store/processLiveness.d.mts.map +0 -1
  293. package/dist/store/processLiveness.mjs.map +0 -1
  294. package/dist/store/reconcile.cjs.map +0 -1
  295. package/dist/store/reconcile.d.cts.map +0 -1
  296. package/dist/store/reconcile.d.mts.map +0 -1
  297. package/dist/store/reconcile.mjs.map +0 -1
  298. package/dist/store/reducer.cjs.map +0 -1
  299. package/dist/store/reducer.d.cts.map +0 -1
  300. package/dist/store/reducer.d.mts.map +0 -1
  301. package/dist/store/reducer.mjs.map +0 -1
  302. package/dist/store/taskGraph.cjs.map +0 -1
  303. package/dist/store/taskGraph.d.cts.map +0 -1
  304. package/dist/store/taskGraph.d.mts.map +0 -1
  305. package/dist/store/taskGraph.mjs.map +0 -1
  306. package/dist/store/taskStore.cjs.map +0 -1
  307. package/dist/store/taskStore.d.cts.map +0 -1
  308. package/dist/store/taskStore.d.mts.map +0 -1
  309. package/dist/store/taskStore.mjs.map +0 -1
  310. package/dist/store/types.cjs.map +0 -1
  311. package/dist/store/types.d.cts.map +0 -1
  312. package/dist/store/types.d.mts.map +0 -1
  313. package/dist/store/types.mjs.map +0 -1
  314. package/dist/tool/promptGuidelines.cjs.map +0 -1
  315. package/dist/tool/promptGuidelines.d.cts.map +0 -1
  316. package/dist/tool/promptGuidelines.d.mts.map +0 -1
  317. package/dist/tool/promptGuidelines.mjs.map +0 -1
  318. package/dist/tool/responseEnvelope.cjs.map +0 -1
  319. package/dist/tool/responseEnvelope.d.cts.map +0 -1
  320. package/dist/tool/responseEnvelope.d.mts.map +0 -1
  321. package/dist/tool/responseEnvelope.mjs.map +0 -1
  322. package/dist/tool/schema.cjs.map +0 -1
  323. package/dist/tool/schema.d.cts.map +0 -1
  324. package/dist/tool/schema.d.mts.map +0 -1
  325. package/dist/tool/schema.mjs.map +0 -1
  326. package/dist/tool/taskTool.cjs.map +0 -1
  327. package/dist/tool/taskTool.d.cts.map +0 -1
  328. package/dist/tool/taskTool.d.mts.map +0 -1
  329. package/dist/tool/taskTool.mjs.map +0 -1
@@ -1,3 +1 @@
1
- import{DELETED_STATUS as e,isDelegationActive as t}from"./types.mjs";import{detectCycle as n}from"./taskGraph.mjs";import{isTransitionValid as r}from"./invariants.mjs";const i=100,a=/^[A-Za-z][A-Za-z0-9_-]{0,31}$/;function o(e){switch(e.kind){case`error`:case`list`:case`get`:return!1;case`upsert`:return e.applied>0;case`delete`:case`clear`:return!0}}function s(e){return e.items.filter(e=>e.kind===`failed`).map(e=>`item[${e.index}]: ${e.message}`).join(`
2
- `)}function c(e){return e.kind===`upsert`?e.items[0]:void 0}function l(e,t){return{document:e,op:{kind:`error`,message:t}}}function u(e,t){let n=e??[],r=t??[];return n.length===r.length&&n.every((e,t)=>e===r[t])}function d(e,t){return JSON.stringify(e??null)===JSON.stringify(t??null)}function f(e,t){return e.subject!==t.subject||e.status!==t.status||e.description!==t.description||e.activeForm!==t.activeForm||e.owner!==t.owner||!u(e.blockedBy,t.blockedBy)||!d(e.metadata,t.metadata)}function p(e,t,n=e.nextId){return{...e,tasks:t,nextId:n}}function m(e,t){let n={...e};for(let[e,r]of Object.entries(t))r===null?delete n[e]:n[e]=r;return Object.keys(n).length?n:void 0}function h(e,t){if(t.subject!==void 0&&(e.subject=t.subject),t.description!==void 0&&(e.description=t.description),t.activeForm!==void 0&&(e.activeForm=t.activeForm),t.owner!==void 0&&(e.owner=t.owner),t.metadata!==void 0){let n=m(e.metadata,t.metadata);n===void 0?delete e.metadata:e.metadata=n}}function g(e,t,n){if(typeof n==`number`)return{ok:!0,id:n};if(!a.test(n))return{ok:!1,message:`${t}: "${n}" is not a valid ref; pass an existing task id as a number`};let r=e.refIds.get(n);if(r!==void 0)return{ok:!0,id:r};let i=e.failedRefs.get(n);return i===void 0?{ok:!1,message:`${t}: unknown ref "${n}" — a ref must be declared by an earlier entry in the same call`}:{ok:!1,message:`${t}: ref "${n}" refers to item[${i}], which failed`}}function _(e){return{ok:!1,message:e}}function v(e,t){if(t.ref!==void 0){if(t.id!==void 0)return`ref is only valid when creating a task; drop the id, or drop the ref`;if(!a.test(t.ref))return`ref "${t.ref}" is invalid: a ref must start with a letter and contain only letters, digits, - or _`;if(e.refIds.get(t.ref)!==void 0||e.failedRefs.has(t.ref))return`duplicate ref "${t.ref}": it was already declared by an earlier entry`}}function y(e,t,n,r){if(t.subject===void 0)return _(`subject is required when the entry has no id`);if(!t.subject.trim())return _(`subject must not be blank`);if(t.addBlockedBy!==void 0||t.removeBlockedBy!==void 0)return _(`addBlockedBy / removeBlockedBy are only for an entry with an id; a new task uses blockedBy`);if(t.status===`deleted`)return _(`cannot create a task with status deleted; create it, then use action delete`);let i=[];for(let n of t.blockedBy??[]){let t=g(e,`blockedBy`,n);if(!t.ok)return _(t.message);let r=e.tasks.find(e=>e.id===t.id);if(!r)return _(`blockedBy: #${t.id} not found`);if(r.status===`deleted`)return _(`blockedBy: #${t.id} is deleted`);i.includes(t.id)||i.push(t.id)}let a={id:e.nextId,subject:t.subject,status:t.status??`pending`,createdAt:r,updatedAt:r};return h(a,t),i.length&&(a.blockedBy=i),e.nextId+=1,e.tasks.push(a),t.ref&&e.refIds.set(t.ref,a.id),{ok:!0,outcome:{index:n,kind:`created`,id:a.id,subject:a.subject,status:a.status,...t.ref?{ref:t.ref}:{},...i.length?{blockedBy:i}:{}}}}function b(e,t,i,a){let o=t.id,s=e.tasks.findIndex(e=>e.id===o);if(s===-1)return _(`#${o} not found`);if(t.blockedBy!==void 0)return _(`blockedBy is only for a new entry; use addBlockedBy / removeBlockedBy on an entry that has an id`);if(!(t.subject!==void 0||t.description!==void 0||t.activeForm!==void 0||t.status!==void 0||t.owner!==void 0||t.metadata!==void 0||t.addBlockedBy?.length||t.removeBlockedBy?.length))return _(`nothing to change: provide at least one of subject, description, activeForm, status, owner, metadata, addBlockedBy, or removeBlockedBy`);let c=e.tasks[s];if(t.subject!==void 0&&!t.subject.trim())return _(`subject must not be blank`);let l=c.status;if(t.status!==void 0){if(!r(c.status,t.status))return _(`illegal transition ${c.status} -> ${t.status}`);l=t.status}let u=c.blockedBy?[...c.blockedBy]:[];for(let n of t.removeBlockedBy??[]){let t=g(e,`removeBlockedBy`,n);if(!t.ok)return _(t.message);u=u.filter(e=>e!==t.id)}for(let n of t.addBlockedBy??[]){let t=g(e,`addBlockedBy`,n);if(!t.ok)return _(t.message);if(t.id===o)return _(`cannot block #${o} on itself`);let r=e.tasks.find(e=>e.id===t.id);if(!r)return _(`addBlockedBy: #${t.id} not found`);if(r.status===`deleted`)return _(`addBlockedBy: #${t.id} is deleted`);u.includes(t.id)||u.push(t.id)}let d={...c,status:l};h(d,t),u.length?d.blockedBy=u:delete d.blockedBy;let p=[...e.tasks];if(p[s]=d,t.addBlockedBy?.length&&n(p,o,u))return _(`addBlockedBy would create a cycle in the blockedBy graph`);let m=f(c,d);return m&&(d.updatedAt=a),e.tasks=p,{ok:!0,outcome:m?{index:i,kind:`updated`,id:o,fromStatus:c.status,toStatus:l}:{index:i,kind:`unchanged`,id:o,status:l}}}function x(e,t,n){let r={tasks:[...e.tasks],nextId:e.nextId,refIds:new Map,failedRefs:new Map},i=[],o=0;for(let[e,s]of t.entries()){let t=v(r,s),c=t?_(t):s.id===void 0?y(r,s,e,n):b(r,s,e,n);if(c.ok){i.push(c.outcome),o+=1;continue}s.ref&&a.test(s.ref)&&!r.refIds.has(s.ref)&&r.failedRefs.set(s.ref,e),i.push({index:e,kind:`failed`,message:c.message,...s.id===void 0?{}:{id:s.id},...s.ref?{ref:s.ref}:{}})}return{document:o>0?p(e,r.tasks,r.nextId):e,op:{kind:`upsert`,items:i,applied:o,failed:i.length-o}}}function S(n,r,i,a=new Date().toISOString()){switch(r){case`upsert`:{let e=i.tasks;return!Array.isArray(e)||e.length===0?l(n,`upsert requires a non-empty tasks array, e.g. {"action":"upsert","tasks":[{"subject":"Write tests"}]}`):e.length>100?l(n,`upsert accepts at most 100 entries per call (received ${e.length})`):x(n,e,a)}case`list`:return{document:n,op:{kind:`list`,includeDeleted:i.includeDeleted===!0,...i.status===void 0?{}:{statusFilter:i.status}}};case`get`:{if(i.id===void 0)return l(n,`id required for get`);let e=n.tasks.find(e=>e.id===i.id);return e?{document:n,op:{kind:`get`,task:e}}:l(n,`#${i.id} not found`)}case`delete`:{if(i.id===void 0)return l(n,`id required for delete`);let r=n.tasks.findIndex(e=>e.id===i.id);if(r===-1)return l(n,`#${i.id} not found`);let o=n.tasks[r];if(o.status===`deleted`)return l(n,`#${o.id} is already deleted`);if(t(o))return l(n,`#${o.id} has a running delegation — cancel it before deleting`);let s=[...n.tasks];return s[r]={...o,status:e,updatedAt:a},{document:p(n,s),op:{kind:`delete`,id:o.id,subject:o.subject}}}case`clear`:{let e=n.tasks.filter(t);if(e.length>0)return l(n,`cannot clear while delegations are running (${e.map(e=>`#${e.id}`).join(`, `)}) — cancel them first`);let r=n.tasks.length;return{document:p(n,[],1),op:{kind:`clear`,count:r}}}}}export{i as MAX_UPSERT_ITEMS,a as REF_PATTERN,S as applyTaskMutation,s as formatUpsertFailure,o as isCommittingOp,c as singleItemOutcome};
3
- //# sourceMappingURL=reducer.mjs.map
1
+ import{MAX_UPSERT_ITEMS as e,REF_PATTERN as t,applyTaskMutation as n,formatUpsertFailure as r,isCommittingOp as i,singleItemOutcome as a}from"../services/store/reducer.mjs";export{e as MAX_UPSERT_ITEMS,t as REF_PATTERN,n as applyTaskMutation,r as formatUpsertFailure,i as isCommittingOp,a as singleItemOutcome};
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=`completed`,t=`deleted`;function n(n){let r=n.filter(e=>e.status!==t);return r.length>0&&r.every(t=>t.status===e)}function r(e,t,n){let r=new Map;for(let i of e)i.id===t?r.set(i.id,[...new Set([...i.blockedBy??[],...n])]):r.set(i.id,i.blockedBy?[...i.blockedBy]:[]);let i=new Set,a=new Set,o=e=>{if(i.has(e))return!0;if(a.has(e))return!1;i.add(e);for(let t of r.get(e)??[])if(o(t))return!0;return i.delete(e),a.add(e),!1};for(let e of r.keys())if(o(e))return!0;return!1}function i(e){let t=new Map;for(let n of e)for(let e of n.blockedBy??[]){let r=t.get(e)??[];r.push(n.id),t.set(e,r)}return t}function a(n,r){return(r.blockedBy??[]).filter(r=>{let i=n.find(e=>e.id===r);return i?i.status!==e&&i.status!==t:!1})}function o(e,t){return a(e,t).length>0}exports.deriveBlocks=i,exports.detectCycle=r,exports.isBlocked=o,exports.isTaskListComplete=n,exports.unresolvedBlockers=a;
2
- //# sourceMappingURL=taskGraph.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../services/store/taskGraph.cjs");exports.deriveBlocks=e.deriveBlocks,exports.detectCycle=e.detectCycle,exports.isBlocked=e.isBlocked,exports.isTaskListComplete=e.isTaskListComplete,exports.unresolvedBlockers=e.unresolvedBlockers;
@@ -1,25 +1,2 @@
1
- import { Task } from "./types.cjs";
2
- //#region src/store/taskGraph.d.ts
3
- /** True when a non-empty list has no visible work left to finish. */
4
- declare function isTaskListComplete(taskList: readonly Task[]): boolean;
5
- /**
6
- * Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?
7
- *
8
- * Takes the proposed additions explicitly so the reducer can ask the question
9
- * before mutating anything.
10
- */
11
- declare function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean;
12
- /** Inverse adjacency: for each task, which tasks list it in their blockedBy. */
13
- declare function deriveBlocks(taskList: readonly Task[]): Map<number, number[]>;
14
- /**
15
- * Blocking dependencies of a task that are not yet resolved.
16
- *
17
- * `completed` clears a dependency; `failed` deliberately does not, so a failed
18
- * delegation keeps its dependents blocked instead of silently releasing work
19
- * that was never actually finished.
20
- */
21
- declare function unresolvedBlockers(taskList: readonly Task[], task: Task): number[];
22
- declare function isBlocked(taskList: readonly Task[], task: Task): boolean;
23
- //#endregion
24
- export { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers };
25
- //# sourceMappingURL=taskGraph.d.cts.map
1
+ import { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers } from "../services/store/taskGraph.cjs";
2
+ export { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers };
@@ -1,25 +1,2 @@
1
- import { Task } from "./types.mjs";
2
- //#region src/store/taskGraph.d.ts
3
- /** True when a non-empty list has no visible work left to finish. */
4
- declare function isTaskListComplete(taskList: readonly Task[]): boolean;
5
- /**
6
- * Would merging `newBlockedBy` into `taskId`'s dependencies introduce a cycle?
7
- *
8
- * Takes the proposed additions explicitly so the reducer can ask the question
9
- * before mutating anything.
10
- */
11
- declare function detectCycle(taskList: readonly Task[], taskId: number, newBlockedBy: readonly number[]): boolean;
12
- /** Inverse adjacency: for each task, which tasks list it in their blockedBy. */
13
- declare function deriveBlocks(taskList: readonly Task[]): Map<number, number[]>;
14
- /**
15
- * Blocking dependencies of a task that are not yet resolved.
16
- *
17
- * `completed` clears a dependency; `failed` deliberately does not, so a failed
18
- * delegation keeps its dependents blocked instead of silently releasing work
19
- * that was never actually finished.
20
- */
21
- declare function unresolvedBlockers(taskList: readonly Task[], task: Task): number[];
22
- declare function isBlocked(taskList: readonly Task[], task: Task): boolean;
23
- //#endregion
24
- export { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers };
25
- //# sourceMappingURL=taskGraph.d.mts.map
1
+ import { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers } from "../services/store/taskGraph.mjs";
2
+ export { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers };
@@ -1,2 +1 @@
1
- const e=`completed`,t=`deleted`;function n(n){let r=n.filter(e=>e.status!==t);return r.length>0&&r.every(t=>t.status===e)}function r(e,t,n){let r=new Map;for(let i of e)i.id===t?r.set(i.id,[...new Set([...i.blockedBy??[],...n])]):r.set(i.id,i.blockedBy?[...i.blockedBy]:[]);let i=new Set,a=new Set,o=e=>{if(i.has(e))return!0;if(a.has(e))return!1;i.add(e);for(let t of r.get(e)??[])if(o(t))return!0;return i.delete(e),a.add(e),!1};for(let e of r.keys())if(o(e))return!0;return!1}function i(e){let t=new Map;for(let n of e)for(let e of n.blockedBy??[]){let r=t.get(e)??[];r.push(n.id),t.set(e,r)}return t}function a(n,r){return(r.blockedBy??[]).filter(r=>{let i=n.find(e=>e.id===r);return i?i.status!==e&&i.status!==t:!1})}function o(e,t){return a(e,t).length>0}export{i as deriveBlocks,r as detectCycle,o as isBlocked,n as isTaskListComplete,a as unresolvedBlockers};
2
- //# sourceMappingURL=taskGraph.mjs.map
1
+ import{deriveBlocks as e,detectCycle as t,isBlocked as n,isTaskListComplete as r,unresolvedBlockers as i}from"../services/store/taskGraph.mjs";export{e as deriveBlocks,t as detectCycle,n as isBlocked,r as isTaskListComplete,i as unresolvedBlockers};
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../_virtual/_rolldown/runtime.cjs"),t=require("../logSinkTelemetry.cjs"),n=require("./processLiveness.cjs"),r=require("./types.cjs"),i=require("./paths.cjs");let a=require("node:path");a=e.__toESM(a,1);let o=require("node:fs");o=e.__toESM(o,1);const s=`utf8`,c=`ENOENT`,l=`store.path`;function u(e){return new Promise(t=>setTimeout(t,e))}function d(e){if(!e||typeof e!=`object`)return r.emptyDocument();let t=e;if(!Array.isArray(t.tasks))return r.emptyDocument();let n=t.tasks.filter(e=>!!e&&typeof e==`object`&&typeof e.id==`number`),i=n.reduce((e,t)=>Math.max(e,t.id),0);return{version:typeof t.version==`number`?t.version:1,rev:typeof t.rev==`number`?t.rev:0,nextId:typeof t.nextId==`number`&&t.nextId>i?t.nextId:i+1,tasks:n}}var f=class{storePath;cwd;env;cached=r.emptyDocument();lastKnownRev=-1;watcher;pollTimer;debounceTimer;listeners=new Set;pollIntervalMs;lockTimeoutMs;report;constructor(e={}){this.cwd=e.cwd??process.cwd(),this.env=e.env??process.env,this.storePath=e.storePath??i.resolveStorePath(this.cwd,this.env),this.pollIntervalMs=e.pollIntervalMs??2e3,this.lockTimeoutMs=e.lockTimeoutMs??2e3,this.report=e.report}configureSession(e){this.env.DOOM_TASK_STORE?.trim()||(this.stopWatching(),this.storePath=i.resolveStorePath(this.cwd,this.env,e),this.cached=r.emptyDocument(),this.lastKnownRev=-1)}get snapshot(){return this.cached}read(){try{let e=o.default.readFileSync(this.storePath,s);this.cached=d(JSON.parse(e))}catch(e){e.code!==c&&this.report?.error(t.TASK_EVENT.storeReadFailed,e,{[l]:this.storePath}),this.cached=r.emptyDocument()}return this.lastKnownRev=this.cached.rev,this.cached}async mutate(e){let t=await this.acquireLock();try{let t=this.read(),n=e(t);return n.document?{document:this.write(n.document),value:n.value}:{document:t,value:n.value}}finally{t()}}write(e){let t={...e,version:1,rev:e.rev+1};o.default.mkdirSync(a.default.dirname(this.storePath),{recursive:!0});let n=i.tempPathFor(this.storePath);return o.default.writeFileSync(n,`${JSON.stringify(t,void 0,2)}\n`,s),o.default.renameSync(n,this.storePath),this.cached=t,this.lastKnownRev=t.rev,t}async acquireLock(){let e=i.lockPathFor(this.storePath);o.default.mkdirSync(a.default.dirname(this.storePath),{recursive:!0});let n=Date.now()+this.lockTimeoutMs;for(;;)try{let t=o.default.openSync(e,`wx`);return o.default.writeSync(t,JSON.stringify({pid:process.pid,time:Date.now()})),o.default.closeSync(t),()=>o.default.rmSync(e,{force:!0})}catch(r){if(r.code!==`EEXIST`)throw r;if(Date.now()>=n)return this.report?.warn(t.TASK_EVENT.storeLockTimeout,Error(`Task store lock still held after ${this.lockTimeoutMs}ms; proceeding without it`),{[l]:this.storePath}),()=>{};this.breakStaleLock(e),await u(10+Math.random()*60)}}breakStaleLock(e){try{let t=JSON.parse(o.default.readFileSync(e,s)),r=typeof t.time==`number`&&Date.now()-t.time>1e4,i=typeof t.pid==`number`&&!n.isProcessAlive(t.pid);return!r&&!i?!1:(o.default.unlinkSync(e),!0)}catch(n){return n.code!==c&&this.report?.warn(t.TASK_EVENT.storeLockBreakFailed,n,{[l]:e}),!1}}onExternalChange(e){return this.listeners.add(e),this.startWatching(),()=>{this.listeners.delete(e),this.listeners.size===0&&this.stopWatching()}}startWatching(){if(this.watcher||this.pollTimer)return;let e=a.default.dirname(this.storePath),n=a.default.basename(this.storePath);try{o.default.mkdirSync(e,{recursive:!0}),this.watcher=o.default.watch(e,(e,t)=>{t&&t!==n||this.scheduleCheck()})}catch(e){this.report?.warn(t.TASK_EVENT.storeWatchFailed,e,{[l]:this.storePath})}this.pollTimer=setInterval(()=>this.checkForChange(),this.pollIntervalMs),this.pollTimer.unref?.()}scheduleCheck(){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.checkForChange(),150),this.debounceTimer.unref?.()}checkForChange(){let e=this.lastKnownRev,n=this.read();if(n.rev!==e)for(let e of this.listeners)try{e(n)}catch(e){this.report?.error(t.TASK_EVENT.storeListenerFailed,e,{[l]:this.storePath})}}stopWatching(){this.watcher?.close(),this.watcher=void 0,this.pollTimer&&clearInterval(this.pollTimer),this.pollTimer=void 0,clearTimeout(this.debounceTimer),this.debounceTimer=void 0}dispose(){this.listeners.clear(),this.stopWatching()}};exports.TaskStore=f;
2
- //# sourceMappingURL=taskStore.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../adapters/store/taskStore.cjs");require("../services/store/taskStore.cjs"),exports.TaskStore=e.TaskStore;
@@ -1,77 +1,3 @@
1
- import { TaskFailureReporter } from "../logSinkTelemetry.cjs";
2
- import { TaskDocument } from "./types.cjs";
3
- //#region src/store/taskStore.d.ts
4
- interface TaskStoreOptions {
5
- cwd?: string;
6
- env?: NodeJS.ProcessEnv;
7
- storePath?: string;
8
- /** Backstop poll cadence for change detection. Lowered in tests so they do
9
- * not depend on `fs.watch`, whose delivery timing is platform-dependent. */
10
- pollIntervalMs?: number;
11
- /** How long to wait for the advisory lock before proceeding lock-free. */
12
- lockTimeoutMs?: number;
13
- /** Where swallowed failures go, so silent degradation stays visible. */
14
- report?: TaskFailureReporter;
15
- }
16
- /**
17
- * File-backed task store shared by one root session and its delegated children.
18
- *
19
- * Durability model: the JSON file is the source of truth. Mutations are
20
- * read-modify-write under an advisory lock so concurrent delegated processes
21
- * cannot clobber each other, and writes land via temp-file rename so a
22
- * crash mid-write can never leave a partial document behind.
23
- */
24
- declare class TaskStore {
25
- storePath: string;
26
- private readonly cwd;
27
- private readonly env;
28
- private cached;
29
- private lastKnownRev;
30
- private watcher?;
31
- private pollTimer?;
32
- private debounceTimer?;
33
- private readonly listeners;
34
- private readonly pollIntervalMs;
35
- private readonly lockTimeoutMs;
36
- private readonly report?;
37
- constructor(options?: TaskStoreOptions);
38
- /** Bind a default store to the current session tree before reading or watching it. */
39
- configureSession(sessionKey: string): void;
40
- /** Last document read from disk, without hitting the filesystem. */
41
- get snapshot(): TaskDocument;
42
- read(): TaskDocument;
43
- /**
44
- * Apply a mutation under the store lock.
45
- *
46
- * `mutate` receives the freshest on-disk document and returns either the next
47
- * document to commit or `undefined` for a read-only action (list/get), which
48
- * skips the write entirely so queries never bump `rev`.
49
- */
50
- mutate<T>(mutate: (document: TaskDocument) => {
51
- document?: TaskDocument;
52
- value: T;
53
- }): Promise<{
54
- document: TaskDocument;
55
- value: T;
56
- }>;
57
- private write;
58
- private acquireLock;
59
- /** Remove a lock left behind by a dead process or one held implausibly long. */
60
- private breakStaleLock;
61
- /**
62
- * Notify when another process changes the store.
63
- *
64
- * `fs.watch` alone is unreliable across the rename-based write (and on some
65
- * network filesystems), so a slow poll backs it up. Writes made by this
66
- * process are filtered out by revision so the UI does not redraw twice.
67
- */
68
- onExternalChange(listener: (document: TaskDocument) => void): () => void;
69
- private startWatching;
70
- private scheduleCheck;
71
- private checkForChange;
72
- private stopWatching;
73
- dispose(): void;
74
- }
75
- //#endregion
76
- export { TaskStore, TaskStoreOptions };
77
- //# sourceMappingURL=taskStore.d.cts.map
1
+ import { TaskStore, TaskStoreCommitListener, TaskStoreOptions } from "../adapters/store/taskStore.cjs";
2
+ import "../services/store/taskStore.cjs";
3
+ export { TaskStore, type TaskStoreCommitListener, type TaskStoreOptions };
@@ -1,77 +1,3 @@
1
- import { TaskFailureReporter } from "../logSinkTelemetry.mjs";
2
- import { TaskDocument } from "./types.mjs";
3
- //#region src/store/taskStore.d.ts
4
- interface TaskStoreOptions {
5
- cwd?: string;
6
- env?: NodeJS.ProcessEnv;
7
- storePath?: string;
8
- /** Backstop poll cadence for change detection. Lowered in tests so they do
9
- * not depend on `fs.watch`, whose delivery timing is platform-dependent. */
10
- pollIntervalMs?: number;
11
- /** How long to wait for the advisory lock before proceeding lock-free. */
12
- lockTimeoutMs?: number;
13
- /** Where swallowed failures go, so silent degradation stays visible. */
14
- report?: TaskFailureReporter;
15
- }
16
- /**
17
- * File-backed task store shared by one root session and its delegated children.
18
- *
19
- * Durability model: the JSON file is the source of truth. Mutations are
20
- * read-modify-write under an advisory lock so concurrent delegated processes
21
- * cannot clobber each other, and writes land via temp-file rename so a
22
- * crash mid-write can never leave a partial document behind.
23
- */
24
- declare class TaskStore {
25
- storePath: string;
26
- private readonly cwd;
27
- private readonly env;
28
- private cached;
29
- private lastKnownRev;
30
- private watcher?;
31
- private pollTimer?;
32
- private debounceTimer?;
33
- private readonly listeners;
34
- private readonly pollIntervalMs;
35
- private readonly lockTimeoutMs;
36
- private readonly report?;
37
- constructor(options?: TaskStoreOptions);
38
- /** Bind a default store to the current session tree before reading or watching it. */
39
- configureSession(sessionKey: string): void;
40
- /** Last document read from disk, without hitting the filesystem. */
41
- get snapshot(): TaskDocument;
42
- read(): TaskDocument;
43
- /**
44
- * Apply a mutation under the store lock.
45
- *
46
- * `mutate` receives the freshest on-disk document and returns either the next
47
- * document to commit or `undefined` for a read-only action (list/get), which
48
- * skips the write entirely so queries never bump `rev`.
49
- */
50
- mutate<T>(mutate: (document: TaskDocument) => {
51
- document?: TaskDocument;
52
- value: T;
53
- }): Promise<{
54
- document: TaskDocument;
55
- value: T;
56
- }>;
57
- private write;
58
- private acquireLock;
59
- /** Remove a lock left behind by a dead process or one held implausibly long. */
60
- private breakStaleLock;
61
- /**
62
- * Notify when another process changes the store.
63
- *
64
- * `fs.watch` alone is unreliable across the rename-based write (and on some
65
- * network filesystems), so a slow poll backs it up. Writes made by this
66
- * process are filtered out by revision so the UI does not redraw twice.
67
- */
68
- onExternalChange(listener: (document: TaskDocument) => void): () => void;
69
- private startWatching;
70
- private scheduleCheck;
71
- private checkForChange;
72
- private stopWatching;
73
- dispose(): void;
74
- }
75
- //#endregion
76
- export { TaskStore, TaskStoreOptions };
77
- //# sourceMappingURL=taskStore.d.mts.map
1
+ import { TaskStore, TaskStoreCommitListener, TaskStoreOptions } from "../adapters/store/taskStore.mjs";
2
+ import "../services/store/taskStore.mjs";
3
+ export { TaskStore, type TaskStoreCommitListener, type TaskStoreOptions };
@@ -1,2 +1 @@
1
- import{TASK_EVENT as e}from"../logSinkTelemetry.mjs";import{isProcessAlive as t}from"./processLiveness.mjs";import{emptyDocument as n}from"./types.mjs";import{lockPathFor as r,resolveStorePath as i,tempPathFor as a}from"./paths.mjs";import o from"node:path";import s from"node:fs";const c=`utf8`,l=`ENOENT`,u=`store.path`;function d(e){return new Promise(t=>setTimeout(t,e))}function f(e){if(!e||typeof e!=`object`)return n();let t=e;if(!Array.isArray(t.tasks))return n();let r=t.tasks.filter(e=>!!e&&typeof e==`object`&&typeof e.id==`number`),i=r.reduce((e,t)=>Math.max(e,t.id),0);return{version:typeof t.version==`number`?t.version:1,rev:typeof t.rev==`number`?t.rev:0,nextId:typeof t.nextId==`number`&&t.nextId>i?t.nextId:i+1,tasks:r}}var p=class{storePath;cwd;env;cached=n();lastKnownRev=-1;watcher;pollTimer;debounceTimer;listeners=new Set;pollIntervalMs;lockTimeoutMs;report;constructor(e={}){this.cwd=e.cwd??process.cwd(),this.env=e.env??process.env,this.storePath=e.storePath??i(this.cwd,this.env),this.pollIntervalMs=e.pollIntervalMs??2e3,this.lockTimeoutMs=e.lockTimeoutMs??2e3,this.report=e.report}configureSession(e){this.env.DOOM_TASK_STORE?.trim()||(this.stopWatching(),this.storePath=i(this.cwd,this.env,e),this.cached=n(),this.lastKnownRev=-1)}get snapshot(){return this.cached}read(){try{let e=s.readFileSync(this.storePath,c);this.cached=f(JSON.parse(e))}catch(t){t.code!==l&&this.report?.error(e.storeReadFailed,t,{[u]:this.storePath}),this.cached=n()}return this.lastKnownRev=this.cached.rev,this.cached}async mutate(e){let t=await this.acquireLock();try{let t=this.read(),n=e(t);return n.document?{document:this.write(n.document),value:n.value}:{document:t,value:n.value}}finally{t()}}write(e){let t={...e,version:1,rev:e.rev+1};s.mkdirSync(o.dirname(this.storePath),{recursive:!0});let n=a(this.storePath);return s.writeFileSync(n,`${JSON.stringify(t,void 0,2)}\n`,c),s.renameSync(n,this.storePath),this.cached=t,this.lastKnownRev=t.rev,t}async acquireLock(){let t=r(this.storePath);s.mkdirSync(o.dirname(this.storePath),{recursive:!0});let n=Date.now()+this.lockTimeoutMs;for(;;)try{let e=s.openSync(t,`wx`);return s.writeSync(e,JSON.stringify({pid:process.pid,time:Date.now()})),s.closeSync(e),()=>s.rmSync(t,{force:!0})}catch(r){if(r.code!==`EEXIST`)throw r;if(Date.now()>=n)return this.report?.warn(e.storeLockTimeout,Error(`Task store lock still held after ${this.lockTimeoutMs}ms; proceeding without it`),{[u]:this.storePath}),()=>{};this.breakStaleLock(t),await d(10+Math.random()*60)}}breakStaleLock(n){try{let e=JSON.parse(s.readFileSync(n,c)),r=typeof e.time==`number`&&Date.now()-e.time>1e4,i=typeof e.pid==`number`&&!t(e.pid);return!r&&!i?!1:(s.unlinkSync(n),!0)}catch(t){return t.code!==l&&this.report?.warn(e.storeLockBreakFailed,t,{[u]:n}),!1}}onExternalChange(e){return this.listeners.add(e),this.startWatching(),()=>{this.listeners.delete(e),this.listeners.size===0&&this.stopWatching()}}startWatching(){if(this.watcher||this.pollTimer)return;let t=o.dirname(this.storePath),n=o.basename(this.storePath);try{s.mkdirSync(t,{recursive:!0}),this.watcher=s.watch(t,(e,t)=>{t&&t!==n||this.scheduleCheck()})}catch(t){this.report?.warn(e.storeWatchFailed,t,{[u]:this.storePath})}this.pollTimer=setInterval(()=>this.checkForChange(),this.pollIntervalMs),this.pollTimer.unref?.()}scheduleCheck(){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.checkForChange(),150),this.debounceTimer.unref?.()}checkForChange(){let t=this.lastKnownRev,n=this.read();if(n.rev!==t)for(let t of this.listeners)try{t(n)}catch(t){this.report?.error(e.storeListenerFailed,t,{[u]:this.storePath})}}stopWatching(){this.watcher?.close(),this.watcher=void 0,this.pollTimer&&clearInterval(this.pollTimer),this.pollTimer=void 0,clearTimeout(this.debounceTimer),this.debounceTimer=void 0}dispose(){this.listeners.clear(),this.stopWatching()}};export{p as TaskStore};
2
- //# sourceMappingURL=taskStore.mjs.map
1
+ import{TaskStore as e}from"../adapters/store/taskStore.mjs";import"../services/store/taskStore.mjs";export{e as TaskStore};
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});function e(){return{version:1,rev:0,nextId:1,tasks:[]}}function t(e){let t=e.delegation?.state;return t===`requested`||t===`running`}exports.DELETED_STATUS=`deleted`,exports.STORE_SCHEMA_VERSION=1,exports.emptyDocument=e,exports.isDelegationActive=t;
2
- //# sourceMappingURL=types.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../services/store/types.cjs");exports.DELETED_STATUS=e.DELETED_STATUS,exports.STORE_SCHEMA_VERSION=e.STORE_SCHEMA_VERSION,exports.emptyDocument=e.emptyDocument,exports.isDelegationActive=e.isDelegationActive;
@@ -1,165 +1,2 @@
1
- import { InlineAgent } from "@agimon-ai/doompi-extension-contracts/subagent-tool";
2
- //#region src/store/types.d.ts
3
- type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
4
- declare const DELETED_STATUS: TaskStatus;
5
- type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';
6
- type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';
7
- /** Terminal result of a delegated subagent run, copied off the delegation response. */
8
- interface DelegationResult {
9
- status: string;
10
- output?: string;
11
- outputPath?: string;
12
- sessionFile?: string;
13
- error?: string;
14
- durationMs?: number;
15
- toolCount?: number;
16
- }
17
- /**
18
- * Delegation bookkeeping attached to a task that was handed to a subagent.
19
- *
20
- * `pid` is the harness process that owns the run: it is the only way to tell an
21
- * genuinely-running delegation from one orphaned by a harness crash, since the
22
- * child dies with its parent but the file survives.
23
- */
24
- interface TaskDelegation {
25
- requestId: string;
26
- agent: string;
27
- state: DelegationState;
28
- sessionId?: string;
29
- pid?: number;
30
- runId?: string;
31
- model?: string;
32
- startedAt?: string;
33
- endedAt?: string;
34
- result?: DelegationResult;
35
- }
36
- interface Task {
37
- id: number;
38
- subject: string;
39
- description?: string;
40
- activeForm?: string;
41
- status: TaskStatus;
42
- blockedBy?: number[];
43
- owner?: string;
44
- metadata?: Record<string, unknown>;
45
- createdAt?: string;
46
- updatedAt?: string;
47
- delegation?: TaskDelegation;
48
- }
49
- declare const STORE_SCHEMA_VERSION = 1;
50
- /** The complete on-disk document. `rev` increments on every committed write. */
51
- interface TaskDocument {
52
- version: number;
53
- rev: number;
54
- nextId: number;
55
- tasks: Task[];
56
- }
57
- declare function emptyDocument(): TaskDocument;
58
- /**
59
- * A dependency target inside an upsert item: an existing task id, or the `ref`
60
- * of a task created earlier in the same call.
61
- *
62
- * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally
63
- * unconfusable with a stringified id and the discrimination is just `typeof`.
64
- */
65
- type DepToken = number | string;
66
- /**
67
- * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.
68
- *
69
- * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`
70
- * (additive merge) are update-only, matching the split the two former actions
71
- * had. A field used against the wrong kind fails that item rather than being
72
- * silently ignored.
73
- */
74
- interface TaskItemMutation {
75
- id?: number;
76
- ref?: string;
77
- subject?: string;
78
- description?: string;
79
- activeForm?: string;
80
- status?: TaskStatus;
81
- blockedBy?: DepToken[];
82
- addBlockedBy?: DepToken[];
83
- removeBlockedBy?: DepToken[];
84
- owner?: string;
85
- metadata?: Record<string, unknown>;
86
- }
87
- /**
88
- * What one upsert item did. `index` is its position in the request array, so a
89
- * model reading a partial result can tell which entries still need resending.
90
- *
91
- * `message` is unprefixed: the `item[N] failed:` framing belongs to the
92
- * formatter, because the Task Space overlay shows this text on its own.
93
- */
94
- type UpsertItemOutcome = {
95
- index: number;
96
- kind: 'created';
97
- id: number;
98
- subject: string;
99
- status: TaskStatus;
100
- ref?: string;
101
- blockedBy?: number[];
102
- } | {
103
- index: number;
104
- kind: 'updated';
105
- id: number;
106
- fromStatus: TaskStatus;
107
- toStatus: TaskStatus;
108
- } | {
109
- index: number;
110
- kind: 'unchanged';
111
- id: number;
112
- status: TaskStatus;
113
- } | {
114
- index: number;
115
- kind: 'failed';
116
- message: string;
117
- id?: number;
118
- ref?: string;
119
- };
120
- /** Which tasks an upsert touched, so renderResult names them instead of guessing. */
121
- interface UpsertSummary {
122
- /** Ids of applied entries, in request order. A failed entry contributes nothing. */
123
- applied: number[];
124
- failed: number;
125
- }
126
- /**
127
- * Open-shape input bag the reducer accepts. The index signature lets the
128
- * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without
129
- * casting each field.
130
- *
131
- * Per-task fields live on `tasks[]`, not here: a top-level `subject` or
132
- * `status` would be ambiguous once one call can carry many tasks.
133
- */
134
- interface TaskMutationParams {
135
- [key: string]: unknown;
136
- tasks?: TaskItemMutation[];
137
- /** `list` filter only. To set a status, upsert the task by id. */
138
- status?: TaskStatus;
139
- /** `get`, `delete`, `assign` and `cancel` only. */
140
- id?: number;
141
- includeDeleted?: boolean;
142
- agent?: string;
143
- inlineAgent?: InlineAgent;
144
- instructions?: string;
145
- /** `assign` only: the context pack the parent hands to the child. */
146
- relevantFiles?: string[];
147
- priorFindings?: string;
148
- model?: string;
149
- context?: 'fresh' | 'fork';
150
- }
151
- /** Snapshot returned under a tool result's `details` for renderResult. */
152
- interface TaskDetails {
153
- action: TaskAction;
154
- params: Record<string, unknown>;
155
- tasks: Task[];
156
- nextId: number;
157
- rev: number;
158
- error?: string;
159
- upsert?: UpsertSummary;
160
- }
161
- /** A delegation is "live" while the owning run may still produce a response. */
162
- declare function isDelegationActive(task: Task): boolean;
163
- //#endregion
164
- export { DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
165
- //# sourceMappingURL=types.d.cts.map
1
+ import { DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive } from "../services/store/types.cjs";
2
+ export { DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
@@ -1,165 +1,2 @@
1
- import { InlineAgent } from "@agimon-ai/doompi-extension-contracts/subagent-tool";
2
- //#region src/store/types.d.ts
3
- type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';
4
- declare const DELETED_STATUS: TaskStatus;
5
- type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';
6
- type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';
7
- /** Terminal result of a delegated subagent run, copied off the delegation response. */
8
- interface DelegationResult {
9
- status: string;
10
- output?: string;
11
- outputPath?: string;
12
- sessionFile?: string;
13
- error?: string;
14
- durationMs?: number;
15
- toolCount?: number;
16
- }
17
- /**
18
- * Delegation bookkeeping attached to a task that was handed to a subagent.
19
- *
20
- * `pid` is the harness process that owns the run: it is the only way to tell an
21
- * genuinely-running delegation from one orphaned by a harness crash, since the
22
- * child dies with its parent but the file survives.
23
- */
24
- interface TaskDelegation {
25
- requestId: string;
26
- agent: string;
27
- state: DelegationState;
28
- sessionId?: string;
29
- pid?: number;
30
- runId?: string;
31
- model?: string;
32
- startedAt?: string;
33
- endedAt?: string;
34
- result?: DelegationResult;
35
- }
36
- interface Task {
37
- id: number;
38
- subject: string;
39
- description?: string;
40
- activeForm?: string;
41
- status: TaskStatus;
42
- blockedBy?: number[];
43
- owner?: string;
44
- metadata?: Record<string, unknown>;
45
- createdAt?: string;
46
- updatedAt?: string;
47
- delegation?: TaskDelegation;
48
- }
49
- declare const STORE_SCHEMA_VERSION = 1;
50
- /** The complete on-disk document. `rev` increments on every committed write. */
51
- interface TaskDocument {
52
- version: number;
53
- rev: number;
54
- nextId: number;
55
- tasks: Task[];
56
- }
57
- declare function emptyDocument(): TaskDocument;
58
- /**
59
- * A dependency target inside an upsert item: an existing task id, or the `ref`
60
- * of a task created earlier in the same call.
61
- *
62
- * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally
63
- * unconfusable with a stringified id and the discrimination is just `typeof`.
64
- */
65
- type DepToken = number | string;
66
- /**
67
- * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.
68
- *
69
- * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`
70
- * (additive merge) are update-only, matching the split the two former actions
71
- * had. A field used against the wrong kind fails that item rather than being
72
- * silently ignored.
73
- */
74
- interface TaskItemMutation {
75
- id?: number;
76
- ref?: string;
77
- subject?: string;
78
- description?: string;
79
- activeForm?: string;
80
- status?: TaskStatus;
81
- blockedBy?: DepToken[];
82
- addBlockedBy?: DepToken[];
83
- removeBlockedBy?: DepToken[];
84
- owner?: string;
85
- metadata?: Record<string, unknown>;
86
- }
87
- /**
88
- * What one upsert item did. `index` is its position in the request array, so a
89
- * model reading a partial result can tell which entries still need resending.
90
- *
91
- * `message` is unprefixed: the `item[N] failed:` framing belongs to the
92
- * formatter, because the Task Space overlay shows this text on its own.
93
- */
94
- type UpsertItemOutcome = {
95
- index: number;
96
- kind: 'created';
97
- id: number;
98
- subject: string;
99
- status: TaskStatus;
100
- ref?: string;
101
- blockedBy?: number[];
102
- } | {
103
- index: number;
104
- kind: 'updated';
105
- id: number;
106
- fromStatus: TaskStatus;
107
- toStatus: TaskStatus;
108
- } | {
109
- index: number;
110
- kind: 'unchanged';
111
- id: number;
112
- status: TaskStatus;
113
- } | {
114
- index: number;
115
- kind: 'failed';
116
- message: string;
117
- id?: number;
118
- ref?: string;
119
- };
120
- /** Which tasks an upsert touched, so renderResult names them instead of guessing. */
121
- interface UpsertSummary {
122
- /** Ids of applied entries, in request order. A failed entry contributes nothing. */
123
- applied: number[];
124
- failed: number;
125
- }
126
- /**
127
- * Open-shape input bag the reducer accepts. The index signature lets the
128
- * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without
129
- * casting each field.
130
- *
131
- * Per-task fields live on `tasks[]`, not here: a top-level `subject` or
132
- * `status` would be ambiguous once one call can carry many tasks.
133
- */
134
- interface TaskMutationParams {
135
- [key: string]: unknown;
136
- tasks?: TaskItemMutation[];
137
- /** `list` filter only. To set a status, upsert the task by id. */
138
- status?: TaskStatus;
139
- /** `get`, `delete`, `assign` and `cancel` only. */
140
- id?: number;
141
- includeDeleted?: boolean;
142
- agent?: string;
143
- inlineAgent?: InlineAgent;
144
- instructions?: string;
145
- /** `assign` only: the context pack the parent hands to the child. */
146
- relevantFiles?: string[];
147
- priorFindings?: string;
148
- model?: string;
149
- context?: 'fresh' | 'fork';
150
- }
151
- /** Snapshot returned under a tool result's `details` for renderResult. */
152
- interface TaskDetails {
153
- action: TaskAction;
154
- params: Record<string, unknown>;
155
- tasks: Task[];
156
- nextId: number;
157
- rev: number;
158
- error?: string;
159
- upsert?: UpsertSummary;
160
- }
161
- /** A delegation is "live" while the owning run may still produce a response. */
162
- declare function isDelegationActive(task: Task): boolean;
163
- //#endregion
164
- export { DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
165
- //# sourceMappingURL=types.d.mts.map
1
+ import { DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive } from "../services/store/types.mjs";
2
+ export { DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
@@ -1,2 +1 @@
1
- const e=`deleted`,t=1;function n(){return{version:1,rev:0,nextId:1,tasks:[]}}function r(e){let t=e.delegation?.state;return t===`requested`||t===`running`}export{e as DELETED_STATUS,t as STORE_SCHEMA_VERSION,n as emptyDocument,r as isDelegationActive};
2
- //# sourceMappingURL=types.mjs.map
1
+ import{DELETED_STATUS as e,STORE_SCHEMA_VERSION as t,emptyDocument as n,isDelegationActive as r}from"../services/store/types.mjs";export{e as DELETED_STATUS,t as STORE_SCHEMA_VERSION,n as emptyDocument,r as isDelegationActive};
@@ -1,2 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=["Use `task` for work with 3+ steps, when the user gives you a list of tasks, or immediately after receiving new instructions to capture requirements. Skip it for single trivial tasks and purely conversational requests.",`Capture a whole plan in one call: {"action":"upsert","tasks":[{"subject":"Research existing tool"},{"subject":"Write the reducer"},{"subject":"Add tests"}]}. Batch whenever you are writing the plan down — the initial list, a revised plan, or wiring dependencies across several tasks — because one call keeps ids and blockers consistent and shows the user the whole plan at once.`,`Do not batch progress. Mark a task in_progress with its own call BEFORE beginning work, and completed with its own call IMMEDIATELY when it is done. upsert accepts many tasks, but a batch of completions sent at the end of a turn is still wrong: batching is for writing a plan down, single calls are for reporting progress, and the user watches the task list to see where you are. Exactly one task should be in_progress for your own work; delegated tasks run in parallel and do not count against that.`,`Never mark a task completed if tests are failing, the implementation is partial, or you hit unresolved errors, use status "failed" or keep it in_progress and add a new task for the blocker in the same upsert.`,`When every non-deleted task is completed, review the full task list once more and call task {"action":"clear"} to close it. Do not leave an all-completed list open.`,`Status is a state machine: pending → in_progress → completed, plus failed (recoverable, can go back to pending or in_progress) and deleted as a tombstone. Pass activeForm (present-continuous, e.g. 'writing tests') when marking in_progress.`,`One call does both: an entry with an id changes that task, an entry without an id creates one. To change status, upsert the task by id, e.g. {"action":"upsert","tasks":[{"id":3,"status":"completed"}]}. Never omit the id when you meant to change an existing task — an entry with no id creates a new one instead. An entry that carries an id and no other field is rejected.`,`Use blockedBy for dependencies (A is blocked by B). On an entry with no id pass blockedBy as the initial set; on an entry with an id use addBlockedBy / removeBlockedBy (additive merge, do not resend the full array). To depend on a task created earlier in the SAME call, give that earlier entry a "ref" and list the ref string in place of an id: [{"ref":"api","subject":"Design the API"},{"subject":"Implement the API","blockedBy":["api"]}]. A ref must be declared before it is used. Cycles are rejected.`,`upsert applies each entry independently: the entries that pass are committed and the failures are reported with their array index. A failed entry changed nothing, so resend only the corrected failures — never resend the whole call, because an already-applied entry with no id would create a duplicate task.`,`Before assigning work, call subagent with {"action":"agents"} and match each task to an exact discovered agent name. Prefer a discovered general-purpose write-capable agent such as delegate or worker when no specialist fits. Use a focused inlineAgent only for read-only work.`,`Assign every unblocked pending task with task {"action":"assign","id":3,"agent":"reviewer"}, including implementation tasks. Do not use a direct subagent run for work already represented in the shared task list. Use task assign so ownership and terminal results stay visible.`,`Hand over what you already know when you assign. Pass relevantFiles with the paths you have actually read or located for that task, and priorFindings with the facts you established: symbol names, call sites, the approach you picked, what you ruled out. The child starts with none of your context and will otherwise spend most of its run re-reading the repo. Send at most a dozen files and only ones you really opened — a guessed path costs the child more than an omitted one — and keep priorFindings to a few lines of facts, not directives.`,`After assigning work, continue non-overlapping parent work or end the turn and wait. Do not poll or duplicate delegated scope.`,`When a delegated task completes and unblocks another task, repeat agent discovery if needed and assign that newly eligible task promptly. Do not poll in a loop. Completion notifications wake the parent session.`,`If a child asks for a decision through intercom, or an assignment fails to start for another concrete issue, respond, rescope, or retry explicitly. Do not silently leave the task pending.`,`assign refuses tasks that are blocked, already delegated, or completed. Resolve blockers first. Use {"action":"cancel","id":3} to stop a running delegation; the task returns to pending.`,`Doom Task records delegated lifecycle and results on the shared task. The child does not update task status directly. Read the completion or failure result before deciding what to do next.`,`The task list is scoped to this session tree: delegated subagents share it, while unrelated sessions start empty. It persists for later inspection until retention cleanup.`,`Subject must be short and imperative (e.g. 'Research existing tool'); description is long-form detail written when you plan the task, and the delegated brief is that description plus the assign-time instructions, relevantFiles and priorFindings. Put durable scope in description and what you learned while exploring in the assign-time pack — do not repeat one in the other.`];exports.DEFAULT_PROMPT_GUIDELINES=e;
2
- //# sourceMappingURL=promptGuidelines.cjs.map
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../commands/task/promptGuidelines.cjs");exports.DEFAULT_PROMPT_GUIDELINES=e.DEFAULT_PROMPT_GUIDELINES;
@@ -1,5 +1,2 @@
1
- //#region src/tool/promptGuidelines.d.ts
2
- declare const DEFAULT_PROMPT_GUIDELINES: string[];
3
- //#endregion
4
- export { DEFAULT_PROMPT_GUIDELINES };
5
- //# sourceMappingURL=promptGuidelines.d.cts.map
1
+ import { DEFAULT_PROMPT_GUIDELINES } from "../commands/task/promptGuidelines.cjs";
2
+ export { DEFAULT_PROMPT_GUIDELINES };