@mndrk/agx 2.0.36 → 2.0.39

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 (765) hide show
  1. package/cloud-runtime/standalone/.next/BUILD_ID +1 -1
  2. package/cloud-runtime/standalone/.next/build-manifest.json +4 -4
  3. package/cloud-runtime/standalone/.next/prerender-manifest.json +3 -3
  4. package/cloud-runtime/standalone/.next/required-server-files.json +4 -7
  5. package/cloud-runtime/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
  6. package/cloud-runtime/standalone/.next/server/app/_global-error.html +2 -2
  7. package/cloud-runtime/standalone/.next/server/app/_global-error.rsc +1 -1
  8. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/cloud-runtime/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
  14. package/cloud-runtime/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/cloud-runtime/standalone/.next/server/app/_not-found.html +2 -2
  16. package/cloud-runtime/standalone/.next/server/app/_not-found.rsc +4 -4
  17. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  18. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  20. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page/build-manifest.json +2 -2
  24. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  25. package/cloud-runtime/standalone/.next/server/app/agents/page/build-manifest.json +2 -2
  26. package/cloud-runtime/standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  27. package/cloud-runtime/standalone/.next/server/app/agents.html +2 -2
  28. package/cloud-runtime/standalone/.next/server/app/agents.rsc +5 -5
  29. package/cloud-runtime/standalone/.next/server/app/agents.segments/_full.segment.rsc +5 -5
  30. package/cloud-runtime/standalone/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  31. package/cloud-runtime/standalone/.next/server/app/agents.segments/_index.segment.rsc +4 -4
  32. package/cloud-runtime/standalone/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
  33. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +2 -2
  34. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents.segment.rsc +1 -1
  35. package/cloud-runtime/standalone/.next/server/app/api/agent-specs/route.js +3 -3
  36. package/cloud-runtime/standalone/.next/server/app/api/agent-specs/route.js.nft.json +1 -1
  37. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/messages/route.js +1 -1
  38. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/messages/route.js.nft.json +1 -1
  39. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/profile/route.js +3 -3
  40. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/profile/route.js.nft.json +1 -1
  41. package/cloud-runtime/standalone/.next/server/app/api/agents/export/route.js +3 -3
  42. package/cloud-runtime/standalone/.next/server/app/api/agents/export/route.js.nft.json +1 -1
  43. package/cloud-runtime/standalone/.next/server/app/api/attachments/[id]/route.js +1 -1
  44. package/cloud-runtime/standalone/.next/server/app/api/attachments/[id]/route.js.nft.json +1 -1
  45. package/cloud-runtime/standalone/.next/server/app/api/automations/create/route.js +3 -3
  46. package/cloud-runtime/standalone/.next/server/app/api/automations/create/route.js.nft.json +1 -1
  47. package/cloud-runtime/standalone/.next/server/app/api/automations/route.js +1 -1
  48. package/cloud-runtime/standalone/.next/server/app/api/automations/route.js.nft.json +1 -1
  49. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js +4 -4
  50. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
  51. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route.js +1 -1
  52. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route.js.nft.json +1 -1
  53. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route.js +1 -1
  54. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route.js.nft.json +1 -1
  55. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route.js +1 -1
  56. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route.js.nft.json +1 -1
  57. package/cloud-runtime/standalone/.next/server/app/api/daemon/route.js +1 -1
  58. package/cloud-runtime/standalone/.next/server/app/api/daemon/route.js.nft.json +1 -1
  59. package/cloud-runtime/standalone/.next/server/app/api/file-search/route.js.nft.json +1 -1
  60. package/cloud-runtime/standalone/.next/server/app/api/graphs/[graphId]/nodes/[nodeId]/route.js +1 -1
  61. package/cloud-runtime/standalone/.next/server/app/api/graphs/[graphId]/nodes/[nodeId]/route.js.nft.json +1 -1
  62. package/cloud-runtime/standalone/.next/server/app/api/health/route.js +3 -3
  63. package/cloud-runtime/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
  64. package/cloud-runtime/standalone/.next/server/app/api/history/route.js +1 -1
  65. package/cloud-runtime/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  66. package/cloud-runtime/standalone/.next/server/app/api/history/status/route.js +1 -1
  67. package/cloud-runtime/standalone/.next/server/app/api/history/status/route.js.nft.json +1 -1
  68. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route.js +2 -2
  69. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route.js.nft.json +1 -1
  70. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js +3 -3
  71. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js.nft.json +1 -1
  72. package/cloud-runtime/standalone/.next/server/app/api/logs/route.js +1 -1
  73. package/cloud-runtime/standalone/.next/server/app/api/logs/route.js.nft.json +1 -1
  74. package/cloud-runtime/standalone/.next/server/app/api/logs/stream/route.js +1 -1
  75. package/cloud-runtime/standalone/.next/server/app/api/logs/stream/route.js.nft.json +1 -1
  76. package/cloud-runtime/standalone/.next/server/app/api/memories/route.js +2 -2
  77. package/cloud-runtime/standalone/.next/server/app/api/memories/route.js.nft.json +1 -1
  78. package/cloud-runtime/standalone/.next/server/app/api/messages/[id]/route.js +1 -1
  79. package/cloud-runtime/standalone/.next/server/app/api/messages/[id]/route.js.nft.json +1 -1
  80. package/cloud-runtime/standalone/.next/server/app/api/migrate/teams-to-projects/route.js +1 -1
  81. package/cloud-runtime/standalone/.next/server/app/api/migrate/teams-to-projects/route.js.nft.json +1 -1
  82. package/cloud-runtime/standalone/.next/server/app/api/migrate/workspaces-to-projects/route.js +1 -1
  83. package/cloud-runtime/standalone/.next/server/app/api/migrate/workspaces-to-projects/route.js.nft.json +1 -1
  84. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route.js +2 -2
  85. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route.js.nft.json +1 -1
  86. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route.js +2 -2
  87. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route.js.nft.json +1 -1
  88. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js +4 -4
  89. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js.nft.json +1 -1
  90. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js +3 -3
  91. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js.nft.json +1 -1
  92. package/cloud-runtime/standalone/.next/server/app/api/participants/route.js +1 -1
  93. package/cloud-runtime/standalone/.next/server/app/api/participants/route.js.nft.json +1 -1
  94. package/cloud-runtime/standalone/.next/server/app/api/processes/route.js +1 -1
  95. package/cloud-runtime/standalone/.next/server/app/api/processes/route.js.nft.json +1 -1
  96. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js +4 -4
  97. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js.nft.json +1 -1
  98. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route.js +4 -4
  99. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route.js.nft.json +1 -1
  100. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js +2 -2
  101. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js.nft.json +1 -1
  102. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js +2 -2
  103. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js.nft.json +1 -1
  104. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js +3 -3
  105. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  106. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js +4 -4
  107. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js.nft.json +1 -1
  108. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js +4 -4
  109. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js.nft.json +1 -1
  110. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js +4 -4
  111. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js.nft.json +1 -1
  112. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js +3 -3
  113. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  114. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/cancel/route.js +4 -4
  115. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/cancel/route.js.nft.json +1 -1
  116. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/route.js +4 -4
  117. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/route.js.nft.json +1 -1
  118. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/runs/route.js +4 -4
  119. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/runs/route.js.nft.json +1 -1
  120. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/agents/route.js +4 -4
  121. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/agents/route.js.nft.json +1 -1
  122. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/poll/route.js +4 -4
  123. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/poll/route.js.nft.json +1 -1
  124. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/route.js +4 -4
  125. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/route.js.nft.json +1 -1
  126. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js +3 -3
  127. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js.nft.json +1 -1
  128. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js +3 -3
  129. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js.nft.json +1 -1
  130. package/cloud-runtime/standalone/.next/server/app/api/reactions/route.js +1 -1
  131. package/cloud-runtime/standalone/.next/server/app/api/reactions/route.js.nft.json +1 -1
  132. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route.js +1 -1
  133. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route.js.nft.json +1 -1
  134. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js +2 -2
  135. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js.nft.json +1 -1
  136. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js +1 -1
  137. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js.nft.json +1 -1
  138. package/cloud-runtime/standalone/.next/server/app/api/schedules/route.js +2 -2
  139. package/cloud-runtime/standalone/.next/server/app/api/schedules/route.js.nft.json +1 -1
  140. package/cloud-runtime/standalone/.next/server/app/api/search/route.js +1 -1
  141. package/cloud-runtime/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  142. package/cloud-runtime/standalone/.next/server/app/api/skills/assign/route.js +1 -1
  143. package/cloud-runtime/standalone/.next/server/app/api/skills/assign/route.js.nft.json +1 -1
  144. package/cloud-runtime/standalone/.next/server/app/api/skills/available/route.js +2 -2
  145. package/cloud-runtime/standalone/.next/server/app/api/skills/available/route.js.nft.json +1 -1
  146. package/cloud-runtime/standalone/.next/server/app/api/skills/detail/route.js +2 -2
  147. package/cloud-runtime/standalone/.next/server/app/api/skills/detail/route.js.nft.json +1 -1
  148. package/cloud-runtime/standalone/.next/server/app/api/skills/history/route.js +2 -2
  149. package/cloud-runtime/standalone/.next/server/app/api/skills/history/route.js.nft.json +1 -1
  150. package/cloud-runtime/standalone/.next/server/app/api/skills/learn/route.js +2 -2
  151. package/cloud-runtime/standalone/.next/server/app/api/skills/learn/route.js.nft.json +1 -1
  152. package/cloud-runtime/standalone/.next/server/app/api/skills/route.js +2 -2
  153. package/cloud-runtime/standalone/.next/server/app/api/skills/route.js.nft.json +1 -1
  154. package/cloud-runtime/standalone/.next/server/app/api/skills/unlearn/route.js +2 -2
  155. package/cloud-runtime/standalone/.next/server/app/api/skills/unlearn/route.js.nft.json +1 -1
  156. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js +3 -3
  157. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js.nft.json +1 -1
  158. package/cloud-runtime/standalone/.next/server/app/api/system/db-status/route.js +1 -1
  159. package/cloud-runtime/standalone/.next/server/app/api/system/db-status/route.js.nft.json +1 -1
  160. package/cloud-runtime/standalone/.next/server/app/api/task-drafts/route.js +1 -1
  161. package/cloud-runtime/standalone/.next/server/app/api/task-drafts/route.js.nft.json +1 -1
  162. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js +4 -4
  163. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js.nft.json +1 -1
  164. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js +2 -2
  165. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js.nft.json +1 -1
  166. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js +3 -3
  167. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js.nft.json +1 -1
  168. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js +1 -1
  169. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js.nft.json +1 -1
  170. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js +3 -3
  171. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js.nft.json +1 -1
  172. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js +2 -2
  173. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js.nft.json +1 -1
  174. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js +2 -2
  175. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js.nft.json +1 -1
  176. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/pause/route.js +1 -1
  177. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/pause/route.js.nft.json +1 -1
  178. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js +4 -4
  179. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js.nft.json +1 -1
  180. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js +3 -3
  181. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js.nft.json +1 -1
  182. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js +3 -3
  183. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js.nft.json +1 -1
  184. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js +4 -4
  185. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js.nft.json +1 -1
  186. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js +4 -4
  187. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js.nft.json +1 -1
  188. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js +4 -4
  189. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js.nft.json +1 -1
  190. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js +3 -3
  191. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js.nft.json +1 -1
  192. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js +1 -1
  193. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js.nft.json +1 -1
  194. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/heartbeat/route.js +1 -1
  195. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/heartbeat/route.js.nft.json +1 -1
  196. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js +3 -3
  197. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js.nft.json +1 -1
  198. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js +4 -4
  199. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js.nft.json +1 -1
  200. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/stream/route.js +1 -1
  201. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/stream/route.js.nft.json +1 -1
  202. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js +2 -2
  203. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js.nft.json +1 -1
  204. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js +5 -5
  205. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js.nft.json +1 -1
  206. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js +5 -5
  207. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js.nft.json +1 -1
  208. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js +5 -5
  209. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js.nft.json +1 -1
  210. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js +5 -5
  211. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js.nft.json +1 -1
  212. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js +5 -5
  213. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js.nft.json +1 -1
  214. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js +6 -6
  215. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js.nft.json +1 -1
  216. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js +4 -4
  217. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
  218. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js +3 -3
  219. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js.nft.json +1 -1
  220. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js +3 -3
  221. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js.nft.json +1 -1
  222. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js +4 -4
  223. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js.nft.json +1 -1
  224. package/cloud-runtime/standalone/.next/server/app/api/tasks/stream/route.js +1 -1
  225. package/cloud-runtime/standalone/.next/server/app/api/tasks/stream/route.js.nft.json +1 -1
  226. package/cloud-runtime/standalone/.next/server/app/api/thread-repos/route.js +1 -1
  227. package/cloud-runtime/standalone/.next/server/app/api/thread-repos/route.js.nft.json +1 -1
  228. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js +3 -3
  229. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js.nft.json +1 -1
  230. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js +3 -3
  231. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js.nft.json +1 -1
  232. package/cloud-runtime/standalone/.next/server/app/api/upload/[id]/route.js +1 -1
  233. package/cloud-runtime/standalone/.next/server/app/api/upload/[id]/route.js.nft.json +1 -1
  234. package/cloud-runtime/standalone/.next/server/app/api/upload/route.js +1 -1
  235. package/cloud-runtime/standalone/.next/server/app/api/upload/route.js.nft.json +1 -1
  236. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js +3 -3
  237. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js.nft.json +1 -1
  238. package/cloud-runtime/standalone/.next/server/app/automations/page/build-manifest.json +2 -2
  239. package/cloud-runtime/standalone/.next/server/app/automations/page_client-reference-manifest.js +1 -1
  240. package/cloud-runtime/standalone/.next/server/app/automations.html +2 -2
  241. package/cloud-runtime/standalone/.next/server/app/automations.rsc +5 -5
  242. package/cloud-runtime/standalone/.next/server/app/automations.segments/_full.segment.rsc +5 -5
  243. package/cloud-runtime/standalone/.next/server/app/automations.segments/_head.segment.rsc +1 -1
  244. package/cloud-runtime/standalone/.next/server/app/automations.segments/_index.segment.rsc +4 -4
  245. package/cloud-runtime/standalone/.next/server/app/automations.segments/_tree.segment.rsc +1 -1
  246. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations/__PAGE__.segment.rsc +2 -2
  247. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations.segment.rsc +1 -1
  248. package/cloud-runtime/standalone/.next/server/app/board/page/build-manifest.json +2 -2
  249. package/cloud-runtime/standalone/.next/server/app/board/page_client-reference-manifest.js +1 -1
  250. package/cloud-runtime/standalone/.next/server/app/board.html +2 -2
  251. package/cloud-runtime/standalone/.next/server/app/board.rsc +4 -4
  252. package/cloud-runtime/standalone/.next/server/app/board.segments/_full.segment.rsc +4 -4
  253. package/cloud-runtime/standalone/.next/server/app/board.segments/_head.segment.rsc +1 -1
  254. package/cloud-runtime/standalone/.next/server/app/board.segments/_index.segment.rsc +4 -4
  255. package/cloud-runtime/standalone/.next/server/app/board.segments/_tree.segment.rsc +1 -1
  256. package/cloud-runtime/standalone/.next/server/app/board.segments/board/__PAGE__.segment.rsc +1 -1
  257. package/cloud-runtime/standalone/.next/server/app/board.segments/board.segment.rsc +1 -1
  258. package/cloud-runtime/standalone/.next/server/app/execution-graph/page/build-manifest.json +2 -2
  259. package/cloud-runtime/standalone/.next/server/app/execution-graph/page_client-reference-manifest.js +1 -1
  260. package/cloud-runtime/standalone/.next/server/app/execution-graph.html +2 -2
  261. package/cloud-runtime/standalone/.next/server/app/execution-graph.rsc +5 -5
  262. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_full.segment.rsc +5 -5
  263. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_head.segment.rsc +1 -1
  264. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_index.segment.rsc +4 -4
  265. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_tree.segment.rsc +1 -1
  266. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph/__PAGE__.segment.rsc +2 -2
  267. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph.segment.rsc +1 -1
  268. package/cloud-runtime/standalone/.next/server/app/index.html +2 -2
  269. package/cloud-runtime/standalone/.next/server/app/index.rsc +5 -5
  270. package/cloud-runtime/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  271. package/cloud-runtime/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
  272. package/cloud-runtime/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  273. package/cloud-runtime/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -4
  274. package/cloud-runtime/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  275. package/cloud-runtime/standalone/.next/server/app/page/build-manifest.json +2 -2
  276. package/cloud-runtime/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  277. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/automations/page/build-manifest.json +2 -2
  278. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/automations/page_client-reference-manifest.js +1 -1
  279. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page/build-manifest.json +2 -2
  280. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page_client-reference-manifest.js +1 -1
  281. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page/build-manifest.json +2 -2
  282. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page_client-reference-manifest.js +1 -1
  283. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page/build-manifest.json +2 -2
  284. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  285. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page/build-manifest.json +2 -2
  286. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page_client-reference-manifest.js +1 -1
  287. package/cloud-runtime/standalone/.next/server/app/projects/orphans/page/build-manifest.json +2 -2
  288. package/cloud-runtime/standalone/.next/server/app/projects/orphans/page_client-reference-manifest.js +1 -1
  289. package/cloud-runtime/standalone/.next/server/app/projects/orphans.html +2 -2
  290. package/cloud-runtime/standalone/.next/server/app/projects/orphans.rsc +5 -5
  291. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_full.segment.rsc +5 -5
  292. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_head.segment.rsc +1 -1
  293. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_index.segment.rsc +4 -4
  294. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_tree.segment.rsc +1 -1
  295. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans/__PAGE__.segment.rsc +2 -2
  296. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans.segment.rsc +1 -1
  297. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects.segment.rsc +1 -1
  298. package/cloud-runtime/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
  299. package/cloud-runtime/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  300. package/cloud-runtime/standalone/.next/server/app/projects.html +2 -2
  301. package/cloud-runtime/standalone/.next/server/app/projects.rsc +5 -5
  302. package/cloud-runtime/standalone/.next/server/app/projects.segments/_full.segment.rsc +5 -5
  303. package/cloud-runtime/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
  304. package/cloud-runtime/standalone/.next/server/app/projects.segments/_index.segment.rsc +4 -4
  305. package/cloud-runtime/standalone/.next/server/app/projects.segments/_tree.segment.rsc +1 -1
  306. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +2 -2
  307. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects.segment.rsc +1 -1
  308. package/cloud-runtime/standalone/.next/server/app/settings/page/build-manifest.json +2 -2
  309. package/cloud-runtime/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  310. package/cloud-runtime/standalone/.next/server/app/settings.html +2 -2
  311. package/cloud-runtime/standalone/.next/server/app/settings.rsc +5 -5
  312. package/cloud-runtime/standalone/.next/server/app/settings.segments/_full.segment.rsc +5 -5
  313. package/cloud-runtime/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  314. package/cloud-runtime/standalone/.next/server/app/settings.segments/_index.segment.rsc +4 -4
  315. package/cloud-runtime/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  316. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  317. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  318. package/cloud-runtime/standalone/.next/server/app/skills/page/build-manifest.json +2 -2
  319. package/cloud-runtime/standalone/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  320. package/cloud-runtime/standalone/.next/server/app/skills.html +2 -2
  321. package/cloud-runtime/standalone/.next/server/app/skills.rsc +5 -5
  322. package/cloud-runtime/standalone/.next/server/app/skills.segments/_full.segment.rsc +5 -5
  323. package/cloud-runtime/standalone/.next/server/app/skills.segments/_head.segment.rsc +1 -1
  324. package/cloud-runtime/standalone/.next/server/app/skills.segments/_index.segment.rsc +4 -4
  325. package/cloud-runtime/standalone/.next/server/app/skills.segments/_tree.segment.rsc +1 -1
  326. package/cloud-runtime/standalone/.next/server/app/skills.segments/skills/__PAGE__.segment.rsc +2 -2
  327. package/cloud-runtime/standalone/.next/server/app/skills.segments/skills.segment.rsc +1 -1
  328. package/cloud-runtime/standalone/.next/server/app/status/page/build-manifest.json +2 -2
  329. package/cloud-runtime/standalone/.next/server/app/status/page_client-reference-manifest.js +1 -1
  330. package/cloud-runtime/standalone/.next/server/app/status.html +2 -2
  331. package/cloud-runtime/standalone/.next/server/app/status.rsc +5 -5
  332. package/cloud-runtime/standalone/.next/server/app/status.segments/_full.segment.rsc +5 -5
  333. package/cloud-runtime/standalone/.next/server/app/status.segments/_head.segment.rsc +1 -1
  334. package/cloud-runtime/standalone/.next/server/app/status.segments/_index.segment.rsc +4 -4
  335. package/cloud-runtime/standalone/.next/server/app/status.segments/_tree.segment.rsc +1 -1
  336. package/cloud-runtime/standalone/.next/server/app/status.segments/status/__PAGE__.segment.rsc +2 -2
  337. package/cloud-runtime/standalone/.next/server/app/status.segments/status.segment.rsc +1 -1
  338. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page/build-manifest.json +2 -2
  339. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page_client-reference-manifest.js +1 -1
  340. package/cloud-runtime/standalone/.next/server/app/welcome/page/build-manifest.json +2 -2
  341. package/cloud-runtime/standalone/.next/server/app/welcome/page_client-reference-manifest.js +1 -1
  342. package/cloud-runtime/standalone/.next/server/app/welcome.html +2 -2
  343. package/cloud-runtime/standalone/.next/server/app/welcome.rsc +5 -5
  344. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_full.segment.rsc +5 -5
  345. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_head.segment.rsc +1 -1
  346. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_index.segment.rsc +4 -4
  347. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_tree.segment.rsc +1 -1
  348. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome/__PAGE__.segment.rsc +2 -2
  349. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome.segment.rsc +1 -1
  350. package/cloud-runtime/standalone/.next/server/chunks/{[externals]__cf9f18a6._.js → [externals]__986fcdb7._.js} +1 -1
  351. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__01cd082e._.js +13 -0
  352. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0936925d._.js +3 -0
  353. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0c3dd73b._.js +13 -0
  354. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0cc3f3b7._.js +18 -0
  355. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__d4126e05._.js → [root-of-the-server]__1b0bb735._.js} +3 -3
  356. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__4d865017._.js → [root-of-the-server]__1c86bf6e._.js} +6 -6
  357. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1dce6c15._.js +3 -0
  358. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__0bb52353._.js → [root-of-the-server]__20c58b41._.js} +18 -18
  359. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2126c763._.js +42 -0
  360. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__255b11f2._.js +3 -0
  361. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__26817611._.js +3 -0
  362. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__277ed37d._.js +3 -0
  363. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__294fceef._.js +3 -0
  364. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2f06f568._.js +46 -0
  365. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__30bd0c87._.js +13 -0
  366. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__314d5c41._.js +3 -0
  367. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__352dad6d._.js +3 -0
  368. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__374cd94c._.js +42 -0
  369. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3785024c._.js +80 -0
  370. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__379604d4._.js +13 -0
  371. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3c8f1de6._.js +15 -0
  372. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3d0df5a8._.js +8 -0
  373. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__0b3b6a47._.js → [root-of-the-server]__4014ed70._.js} +20 -20
  374. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__42fcb81c._.js +52 -0
  375. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4a3cd6ac._.js +13 -0
  376. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4a4265e0._.js +22 -0
  377. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4bce7db7._.js +101 -0
  378. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4c5c536d._.js +18 -0
  379. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4e522535._.js +6 -0
  380. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__50c24784._.js +3 -0
  381. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__50ddd3ce._.js +1 -1
  382. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__529a6e1c._.js +80 -0
  383. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__59d1cdd8._.js +3 -0
  384. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5a1fd688._.js +3 -0
  385. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5d359afa._.js +18 -18
  386. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__628d686b._.js +3 -0
  387. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__005b3c82._.js → [root-of-the-server]__644e6285._.js} +8 -8
  388. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__65755104._.js +7 -0
  389. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__068b4f08._.js → [root-of-the-server]__73c20995._.js} +3 -3
  390. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__762ab29c._.js +51 -0
  391. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__981d92dd._.js → [root-of-the-server]__8125bbc3._.js} +19 -19
  392. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__85275b88._.js +3 -0
  393. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__89666394._.js +8 -0
  394. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8c0fb154._.js +13 -0
  395. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8f5cac13._.js +46 -0
  396. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__91b22098._.js +8 -0
  397. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__92924218._.js +13 -0
  398. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__94bd7f65._.js +3 -0
  399. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__96ae701e._.js +1 -1
  400. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9746d1f5._.js +18 -0
  401. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__98ce983b._.js +3 -0
  402. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__ee6511a0._.js → [root-of-the-server]__9a9fd39f._.js} +10 -10
  403. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9ad4e385._.js +3 -0
  404. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9b69f93e._.js +18 -0
  405. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a01ddd0b._.js +46 -0
  406. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__8ac0286e._.js → [root-of-the-server]__a099c992._.js} +20 -20
  407. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a9b949c3._.js +7 -0
  408. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ab7343c8._.js +3 -0
  409. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__af7a73fd._.js +3 -0
  410. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__bd43017b._.js +3 -0
  411. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__bf6fb108._.js +80 -0
  412. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c0a18648._.js +10 -10
  413. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__7ee9b7b6._.js → [root-of-the-server]__c122c54a._.js} +3 -3
  414. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c4ea4921._.js +3 -0
  415. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__8b0ab82f._.js → [root-of-the-server]__c4ed5d83._.js} +7 -7
  416. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c695a5f2._.js +18 -0
  417. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c8b49077._.js +10 -10
  418. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d57e800e._.js +13 -0
  419. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d8b615bf._.js +34 -0
  420. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d9bd6334._.js +3 -0
  421. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__543ba6c4._.js → [root-of-the-server]__da3a1ce7._.js} +2 -2
  422. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__db469f1b._.js +3 -0
  423. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__de2a1e43._.js +3 -0
  424. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__5031f8d4._.js → [root-of-the-server]__dec3e1b7._.js} +11 -11
  425. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f1147a4a._.js +15 -0
  426. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f5597fea._.js +13 -0
  427. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f8c94cb3._.js +8 -0
  428. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__ceb02db8._.js → [root-of-the-server]__f9cff4b0._.js} +2 -2
  429. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f9f7f2df._.js +4 -0
  430. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fa79d53f._.js +46 -0
  431. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fb14cd4a._.js +3 -0
  432. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__a55c16a5._.js → [root-of-the-server]__fc27a898._.js} +31 -31
  433. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fcf0b40a._.js +3 -0
  434. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ffb21023._.js +80 -0
  435. package/cloud-runtime/standalone/.next/server/chunks/_05fa3b89._.js +18 -18
  436. package/cloud-runtime/standalone/.next/server/chunks/_17e53c87._.js +3 -0
  437. package/cloud-runtime/standalone/.next/server/chunks/_4190f170._.js +18 -18
  438. package/cloud-runtime/standalone/.next/server/chunks/_42e9c8d5._.js +18 -18
  439. package/cloud-runtime/standalone/.next/server/chunks/_5ca51127._.js +3 -3
  440. package/cloud-runtime/standalone/.next/server/chunks/_5fd6af5d._.js +3 -3
  441. package/cloud-runtime/standalone/.next/server/chunks/_8b9fde82._.js +20 -20
  442. package/cloud-runtime/standalone/.next/server/chunks/_994414cd._.js +3 -3
  443. package/cloud-runtime/standalone/.next/server/chunks/_99b78daf._.js +18 -18
  444. package/cloud-runtime/standalone/.next/server/chunks/_affbdbb0._.js +18 -18
  445. package/cloud-runtime/standalone/.next/server/chunks/_d22934ab._.js +20 -20
  446. package/cloud-runtime/standalone/.next/server/chunks/_efc73784._.js +18 -18
  447. package/cloud-runtime/standalone/.next/server/chunks/lib_a5adca60._.js +15 -15
  448. package/cloud-runtime/standalone/.next/server/chunks/lib_check-node-version_ts_ef89bf83._.js +3 -0
  449. package/cloud-runtime/standalone/.next/server/chunks/lib_ea45fe73._.js +18 -18
  450. package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_2e721df2._.js +39 -39
  451. package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_74d1c060._.js +39 -39
  452. package/cloud-runtime/standalone/.next/server/chunks/lib_sqlite-query-adapter_ts_3ea4d849._.js +18 -18
  453. package/cloud-runtime/standalone/.next/server/chunks/lib_sqlite-query-adapter_ts_b0b1a9b2._.js +19 -19
  454. package/cloud-runtime/standalone/.next/server/chunks/src_graph_14067235._.js +18 -18
  455. package/cloud-runtime/standalone/.next/server/chunks/src_graph_b63e2d39._.js +18 -18
  456. package/cloud-runtime/standalone/.next/server/chunks/ssr/_0c5c111f._.js +1 -1
  457. package/cloud-runtime/standalone/.next/server/chunks/ssr/_314f4c49._.js +1 -1
  458. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_thread_WorkspaceSidebar_tsx_e660301b._.js +1 -1
  459. package/cloud-runtime/standalone/.next/server/instrumentation.js +1 -1
  460. package/cloud-runtime/standalone/.next/server/middleware-build-manifest.js +2 -2
  461. package/cloud-runtime/standalone/.next/server/middleware-manifest.json +5 -5
  462. package/cloud-runtime/standalone/.next/server/pages/404.html +2 -2
  463. package/cloud-runtime/standalone/.next/server/pages/500.html +2 -2
  464. package/cloud-runtime/standalone/.next/server/server-reference-manifest.js +1 -1
  465. package/cloud-runtime/standalone/.next/server/server-reference-manifest.json +1 -1
  466. package/cloud-runtime/standalone/.next/static/chunks/{47f22a56011af8d3.js → 5c0819dcc4bfec85.js} +1 -1
  467. package/cloud-runtime/standalone/.next/static/chunks/{25c9ac515cfe5635.js → 9bde80696400d2ff.js} +2 -2
  468. package/cloud-runtime/standalone/.next/static/chunks/ac9a7d8cf17b5d75.js +1 -0
  469. package/cloud-runtime/standalone/.next/static/chunks/{dfff51033c303fc7.js → ee5f1457fbc593e1.js} +1 -1
  470. package/cloud-runtime/standalone/.next/static/chunks/{turbopack-22475f0dd0c18f92.js → turbopack-e1d640f2fbe4fa5e.js} +1 -1
  471. package/cloud-runtime/standalone/app/api/agents/[id]/messages/route.ts +4 -3
  472. package/cloud-runtime/standalone/app/api/agents/[id]/profile/route.ts +1 -1
  473. package/cloud-runtime/standalone/app/api/automations/route.ts +1 -1
  474. package/cloud-runtime/standalone/app/api/chat/route.ts +2 -2
  475. package/cloud-runtime/standalone/app/api/memories/route.ts +2 -2
  476. package/cloud-runtime/standalone/app/api/prompt-jobs/[id]/route.ts +9 -1
  477. package/cloud-runtime/standalone/app/api/system/db-status/route.ts +12 -11
  478. package/cloud-runtime/standalone/components/PromptJobBoard.tsx +12 -1
  479. package/cloud-runtime/standalone/components/errors/StartupGuard.tsx +1 -1
  480. package/cloud-runtime/standalone/components/errors/StartupGuardWrapper.tsx +1 -1
  481. package/cloud-runtime/standalone/components/thread/WorkspaceSidebar.tsx +1 -1
  482. package/cloud-runtime/standalone/coverage/clover.xml +1208 -0
  483. package/cloud-runtime/standalone/coverage/coverage-final.json +29 -0
  484. package/cloud-runtime/standalone/coverage/lcov-report/app/api/audit/index.html +116 -0
  485. package/cloud-runtime/standalone/coverage/lcov-report/app/api/audit/route.ts.html +208 -0
  486. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/[...nextauth]/index.html +116 -0
  487. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/[...nextauth]/route.ts.html +166 -0
  488. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/daemon-secret/index.html +116 -0
  489. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/daemon-secret/route.ts.html +532 -0
  490. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/status/index.html +116 -0
  491. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/status/route.ts.html +178 -0
  492. package/cloud-runtime/standalone/coverage/lcov-report/app/api/learnings/index.html +116 -0
  493. package/cloud-runtime/standalone/coverage/lcov-report/app/api/learnings/route.ts.html +262 -0
  494. package/cloud-runtime/standalone/coverage/lcov-report/app/api/logs/stream/index.html +116 -0
  495. package/cloud-runtime/standalone/coverage/lcov-report/app/api/logs/stream/route.ts.html +448 -0
  496. package/cloud-runtime/standalone/coverage/lcov-report/app/api/queue/complete/index.html +116 -0
  497. package/cloud-runtime/standalone/coverage/lcov-report/app/api/queue/complete/route.ts.html +331 -0
  498. package/cloud-runtime/standalone/coverage/lcov-report/app/api/queue/index.html +116 -0
  499. package/cloud-runtime/standalone/coverage/lcov-report/app/api/queue/route.ts.html +505 -0
  500. package/cloud-runtime/standalone/coverage/lcov-report/app/api/stage-prompts/index.html +116 -0
  501. package/cloud-runtime/standalone/coverage/lcov-report/app/api/stage-prompts/route.ts.html +412 -0
  502. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/advance/index.html +116 -0
  503. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/advance/route.ts.html +304 -0
  504. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/index.html +116 -0
  505. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/logs/index.html +116 -0
  506. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/logs/route.ts.html +202 -0
  507. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/route.ts.html +373 -0
  508. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/index.html +116 -0
  509. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/route.ts.html +499 -0
  510. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/stream/index.html +116 -0
  511. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/stream/route.ts.html +349 -0
  512. package/cloud-runtime/standalone/coverage/lcov-report/base.css +224 -0
  513. package/cloud-runtime/standalone/coverage/lcov-report/block-navigation.js +87 -0
  514. package/cloud-runtime/standalone/coverage/lcov-report/components/AuthProvider.tsx.html +259 -0
  515. package/cloud-runtime/standalone/coverage/lcov-report/components/ChatInterface.tsx.html +1228 -0
  516. package/cloud-runtime/standalone/coverage/lcov-report/components/KanbanBoard.tsx.html +1024 -0
  517. package/cloud-runtime/standalone/coverage/lcov-report/components/Layout.tsx.html +211 -0
  518. package/cloud-runtime/standalone/coverage/lcov-report/components/LearningsPanel.tsx.html +535 -0
  519. package/cloud-runtime/standalone/coverage/lcov-report/components/LogTimeline.tsx.html +415 -0
  520. package/cloud-runtime/standalone/coverage/lcov-report/components/SortableTaskCard.tsx.html +358 -0
  521. package/cloud-runtime/standalone/coverage/lcov-report/components/StagePills.tsx.html +439 -0
  522. package/cloud-runtime/standalone/coverage/lcov-report/components/TaskCard.tsx.html +514 -0
  523. package/cloud-runtime/standalone/coverage/lcov-report/components/TaskCardOverlay.tsx.html +256 -0
  524. package/cloud-runtime/standalone/coverage/lcov-report/components/TaskDetail.tsx.html +622 -0
  525. package/cloud-runtime/standalone/coverage/lcov-report/components/TaskList.tsx.html +253 -0
  526. package/cloud-runtime/standalone/coverage/lcov-report/components/index.html +281 -0
  527. package/cloud-runtime/standalone/coverage/lcov-report/favicon.png +0 -0
  528. package/cloud-runtime/standalone/coverage/lcov-report/hooks/index.html +116 -0
  529. package/cloud-runtime/standalone/coverage/lcov-report/hooks/useTasks.ts.html +1042 -0
  530. package/cloud-runtime/standalone/coverage/lcov-report/index.html +341 -0
  531. package/cloud-runtime/standalone/coverage/lcov-report/lib/auth-client.ts.html +202 -0
  532. package/cloud-runtime/standalone/coverage/lcov-report/lib/auth-server.ts.html +172 -0
  533. package/cloud-runtime/standalone/coverage/lcov-report/lib/auth.ts.html +265 -0
  534. package/cloud-runtime/standalone/coverage/lcov-report/lib/db.ts.html +1252 -0
  535. package/cloud-runtime/standalone/coverage/lcov-report/lib/index.html +131 -0
  536. package/cloud-runtime/standalone/coverage/lcov-report/lib/orchestrator.ts.html +409 -0
  537. package/cloud-runtime/standalone/coverage/lcov-report/lib/security.ts.html +1165 -0
  538. package/cloud-runtime/standalone/coverage/lcov-report/lib/supabase-server.ts.html +175 -0
  539. package/cloud-runtime/standalone/coverage/lcov-report/lib/supabase.ts.html +157 -0
  540. package/cloud-runtime/standalone/coverage/lcov-report/prettify.css +1 -0
  541. package/cloud-runtime/standalone/coverage/lcov-report/prettify.js +2 -0
  542. package/cloud-runtime/standalone/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  543. package/cloud-runtime/standalone/coverage/lcov-report/sorter.js +210 -0
  544. package/cloud-runtime/standalone/coverage/lcov.info +2386 -0
  545. package/cloud-runtime/standalone/docs/LIMITS.md +63 -0
  546. package/cloud-runtime/standalone/docs/architecture/ADR-001-hybrid-to-full-sqlite.md +345 -0
  547. package/cloud-runtime/standalone/docs/baseline/baseline-report.json +1009 -0
  548. package/cloud-runtime/standalone/docs/baseline/critical-queries.md +105 -0
  549. package/cloud-runtime/standalone/docs/baseline/lock-metrics.json +21 -0
  550. package/cloud-runtime/standalone/docs/baseline/read-latency.json +146 -0
  551. package/cloud-runtime/standalone/docs/baseline/restore-time.json +10 -0
  552. package/cloud-runtime/standalone/docs/baseline/write-metrics.json +803 -0
  553. package/cloud-runtime/standalone/docs/decisions/sqlite-migration-adr.md +327 -0
  554. package/cloud-runtime/standalone/docs/error-code-mapping.md +74 -0
  555. package/cloud-runtime/standalone/docs/migration-plan.md +120 -0
  556. package/cloud-runtime/standalone/docs/migration-spec.md +345 -0
  557. package/cloud-runtime/standalone/docs/pg-sqlite-compatibility-matrix.md +554 -0
  558. package/cloud-runtime/standalone/docs/project-agent-migration-status.md +229 -0
  559. package/cloud-runtime/standalone/docs/runbook-shadow-read.md +66 -0
  560. package/cloud-runtime/standalone/docs/runbook.md +155 -0
  561. package/cloud-runtime/standalone/docs/specs/cli-postgres-removal.md +69 -0
  562. package/cloud-runtime/standalone/docs/specs/thread-mentions.md +53 -0
  563. package/cloud-runtime/standalone/docs/superpowers/plans/2026-04-01-prompt-scheduler.md +1907 -0
  564. package/cloud-runtime/standalone/docs/superpowers/plans/2026-04-02-sqlite-migration.md +1047 -0
  565. package/cloud-runtime/standalone/docs/transcript.txt +282 -0
  566. package/cloud-runtime/standalone/docs/ux/GlobalChatFlow.storyboard +23 -0
  567. package/cloud-runtime/standalone/docs/ux/assistant-chat-cli.md +32 -0
  568. package/cloud-runtime/standalone/hooks/usePromptJobs.ts +9 -18
  569. package/cloud-runtime/standalone/instrumentation.ts +33 -0
  570. package/cloud-runtime/standalone/lib/agent-process-registry.ts +10 -9
  571. package/cloud-runtime/standalone/lib/attachment-store.ts +6 -5
  572. package/cloud-runtime/standalone/lib/check-node-version.ts +12 -0
  573. package/cloud-runtime/standalone/lib/db-adapter.interface.ts +1 -1
  574. package/cloud-runtime/standalone/lib/history-store.ts +46 -46
  575. package/cloud-runtime/standalone/lib/knowledge-store.ts +2 -1
  576. package/cloud-runtime/standalone/lib/participants-store.ts +9 -8
  577. package/cloud-runtime/standalone/lib/queue/sqlite-adapter.ts +12 -11
  578. package/cloud-runtime/standalone/lib/repo-knowledge.ts +6 -5
  579. package/cloud-runtime/standalone/lib/sqlite-compat.ts +75 -0
  580. package/cloud-runtime/standalone/lib/sqlite-query-adapter.ts +15 -14
  581. package/cloud-runtime/standalone/lib/sqlite_writer.ts +10 -9
  582. package/cloud-runtime/standalone/lib/startup.ts +18 -19
  583. package/cloud-runtime/standalone/lib/thread-knowledge-runs.ts +2 -1
  584. package/cloud-runtime/standalone/lib/workspaces-to-projects-migration.ts +19 -18
  585. package/cloud-runtime/standalone/mcp/dist/constants.js +66 -0
  586. package/cloud-runtime/standalone/mcp/dist/db.js +220 -0
  587. package/cloud-runtime/standalone/mcp/dist/index.js +7 -0
  588. package/cloud-runtime/standalone/mcp/dist/security.js +18 -0
  589. package/cloud-runtime/standalone/mcp/dist/server.js +240 -0
  590. package/cloud-runtime/standalone/mcp/dist/task-context.js +287 -0
  591. package/cloud-runtime/standalone/mcp/dist/test-client.js +82 -0
  592. package/cloud-runtime/standalone/mcp/dist/tools/audit.js +69 -0
  593. package/cloud-runtime/standalone/mcp/dist/tools/learnings.js +88 -0
  594. package/cloud-runtime/standalone/mcp/dist/tools/queue.js +312 -0
  595. package/cloud-runtime/standalone/mcp/dist/tools/tasks.js +244 -0
  596. package/cloud-runtime/standalone/mcp/dist/types.js +74 -0
  597. package/cloud-runtime/standalone/mcp/package-lock.json +3 -147
  598. package/cloud-runtime/standalone/mcp/package.json +1 -1
  599. package/cloud-runtime/standalone/mcp/src/check-node-version.ts +8 -0
  600. package/cloud-runtime/standalone/mcp/src/db.ts +4 -5
  601. package/cloud-runtime/standalone/mcp/src/index.ts +1 -0
  602. package/cloud-runtime/standalone/next.config.ts +0 -1
  603. package/cloud-runtime/standalone/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  604. package/cloud-runtime/standalone/node_modules/@img/{sharp-linux-x64 → sharp-darwin-arm64}/package.json +7 -13
  605. package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/README.md +2 -2
  606. package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-linuxmusl-x64 → sharp-libvips-darwin-arm64}/lib/glib-2.0/include/glibconfig.h +8 -9
  607. package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 → sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib} +0 -0
  608. package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/package.json +5 -11
  609. package/cloud-runtime/standalone/notes/comments-context-demo.md +141 -0
  610. package/cloud-runtime/standalone/notes/comments-context-plan.md +119 -0
  611. package/cloud-runtime/standalone/notes/context-audit.md +21 -0
  612. package/cloud-runtime/standalone/notes/project-layer-plan.md +30 -0
  613. package/cloud-runtime/standalone/notes/project-layer.md +123 -0
  614. package/cloud-runtime/standalone/notes/temporal-migration-design.md +199 -0
  615. package/cloud-runtime/standalone/package-lock.json +9 -413
  616. package/cloud-runtime/standalone/package.json +3 -2
  617. package/cloud-runtime/standalone/playwright-report/data/00d55996f37c1506b90144c85493dd85032c13e5.png +0 -0
  618. package/cloud-runtime/standalone/playwright-report/data/0b9d409e57237ae111d7ba258d3dfe64dc368456.png +0 -0
  619. package/cloud-runtime/standalone/playwright-report/data/b33d5e80a15bd1deda4415b9d318ef73f581c950.png +0 -0
  620. package/cloud-runtime/standalone/playwright-report/data/b55684161aa440d0614595e13c91338f0420abbb.md +131 -0
  621. package/cloud-runtime/standalone/playwright-report/data/b9913957ae07e7565c38ddd71215be79b1ceb017.png +0 -0
  622. package/cloud-runtime/standalone/playwright-report/data/c3538be8ebbebc9fe4a7df8f12f04483af4a0d91.png +0 -0
  623. package/cloud-runtime/standalone/playwright-report/data/fe638f64ff5e36f1c30325564565662d3f57da87.md +180 -0
  624. package/cloud-runtime/standalone/playwright-report/index.html +85 -0
  625. package/cloud-runtime/standalone/scripts/bench-queue.ts +5 -4
  626. package/cloud-runtime/standalone/server.js +1 -1
  627. package/cloud-runtime/standalone/src/db/backup.ts +12 -11
  628. package/cloud-runtime/standalone/src/db/checks.ts +3 -3
  629. package/cloud-runtime/standalone/src/db/init.ts +13 -12
  630. package/cloud-runtime/standalone/src/graph/schedule-runner.ts +1 -1
  631. package/cloud-runtime/standalone/src/graph/store.ts +14 -13
  632. package/cloud-runtime/standalone/src/prompt-scheduler/get-store.ts +19 -3
  633. package/cloud-runtime/standalone/src/prompt-scheduler/store.ts +9 -9
  634. package/cloud-runtime/standalone/test/adapters/sqlite.ts +7 -6
  635. package/cloud-runtime/standalone/test-results/auth-Authentication-Flow-S-aff25-sion-across-page-navigation-chromium/test-failed-1.png +0 -0
  636. package/cloud-runtime/standalone/test-results/comments-Task-comments-add-4dc59-nd-persists-it-for-the-task-chromium/error-context.md +131 -0
  637. package/cloud-runtime/standalone/test-results/comments-Task-comments-add-4dc59-nd-persists-it-for-the-task-chromium/test-failed-1.png +0 -0
  638. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Stage--4082a-er-planning-after-ideation--chromium/error-context.md +180 -0
  639. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Stage--4082a-er-planning-after-ideation--chromium/test-failed-1.png +0 -0
  640. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Stage-Columns-displays-all-9-SDLC-stages-chromium/error-context.md +180 -0
  641. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Stage-Columns-displays-all-9-SDLC-stages-chromium/test-failed-1.png +0 -0
  642. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Task-D-b6d98-ys-tasks-in-correct-columns-chromium/error-context.md +180 -0
  643. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Task-D-b6d98-ys-tasks-in-correct-columns-chromium/test-failed-1.png +0 -0
  644. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Task-Display-shows-task-count-per-column-chromium/test-failed-1.png +0 -0
  645. package/cloud-runtime/standalone/test-results/kanban-Task-Lifecycle-can-advance-task-through-all-stages-chromium/test-failed-1.png +0 -0
  646. package/cloud-runtime/standalone/tsconfig.json +1 -2
  647. package/cloud-runtime/standalone/tsconfig.tsbuildinfo +1 -0
  648. package/cloud-runtime/standalone/worker/index.js +110 -823
  649. package/cloud-runtime/standalone/worker/index.ts +1 -0
  650. package/package.json +1 -1
  651. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__017f03c3._.js +0 -13
  652. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__056d94e4._.js +0 -3
  653. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__06634853._.js +0 -80
  654. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0f580808._.js +0 -13
  655. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__164a80ba._.js +0 -18
  656. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__16dd1fd7._.js +0 -13
  657. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1a8e0957._.js +0 -7
  658. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1cc2fe7f._.js +0 -3
  659. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__23ad03bf._.js +0 -3
  660. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__241a8bcf._.js +0 -3
  661. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__29419d66._.js +0 -42
  662. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2948f712._.js +0 -3
  663. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__32ef6623._.js +0 -3
  664. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__34cb1b98._.js +0 -3
  665. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3c1567b6._.js +0 -3
  666. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3c37453e._.js +0 -3
  667. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3faa64cd._.js +0 -4
  668. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4041bb93._.js +0 -18
  669. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__42497c7b._.js +0 -80
  670. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__49c03d66._.js +0 -3
  671. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4a8d14c1._.js +0 -3
  672. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4c50f159._.js +0 -18
  673. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4c861686._.js +0 -46
  674. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__588b6ab0._.js +0 -46
  675. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__596d0e81._.js +0 -42
  676. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__59b5d4e5._.js +0 -3
  677. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__61c99680._.js +0 -52
  678. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__64712846._.js +0 -3
  679. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__707c32af._.js +0 -15
  680. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7370bb86._.js +0 -8
  681. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__749af50f._.js +0 -8
  682. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__74b97f0a._.js +0 -3
  683. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__75cedecf._.js +0 -6
  684. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7e79d86a._.js +0 -3
  685. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8b461158._.js +0 -3
  686. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__918f0106._.js +0 -80
  687. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__922eb7cd._.js +0 -80
  688. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__927cfc20._.js +0 -3
  689. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__952af4b3._.js +0 -22
  690. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__98b352f7._.js +0 -13
  691. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a44db634._.js +0 -8
  692. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a67cd108._.js +0 -51
  693. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ab2bf82d._.js +0 -13
  694. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__abb032c1._.js +0 -34
  695. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b4931ee1._.js +0 -3
  696. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b4d05543._.js +0 -3
  697. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b500f1bf._.js +0 -3
  698. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b707e701._.js +0 -3
  699. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b9e41767._.js +0 -3
  700. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__be4ad4b5._.js +0 -46
  701. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__bf5803eb._.js +0 -13
  702. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c99509c2._.js +0 -101
  703. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ccd4846e._.js +0 -13
  704. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d7e839a8._.js +0 -18
  705. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d908c9ea._.js +0 -8
  706. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__da20a0aa._.js +0 -18
  707. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__dcdeee3d._.js +0 -3
  708. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e069c0a3._.js +0 -3
  709. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e1e51c02._.js +0 -7
  710. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e3a4fd97._.js +0 -13
  711. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e4a87984._.js +0 -15
  712. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ef82dda1._.js +0 -3
  713. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fa0ebee3._.js +0 -13
  714. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fee58db1._.js +0 -46
  715. package/cloud-runtime/standalone/.next/server/chunks/_d225c04f._.js +0 -3
  716. package/cloud-runtime/standalone/.next/static/chunks/d73f1cc3ebc9993b.js +0 -1
  717. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +0 -221
  718. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +0 -46
  719. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +0 -1
  720. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  721. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +0 -42
  722. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +0 -30
  723. package/cloud-runtime/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  724. package/cloud-runtime/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  725. package/cloud-runtime/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +0 -46
  726. package/cloud-runtime/standalone/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  727. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/database.js +0 -90
  728. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/index.js +0 -3
  729. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
  730. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
  731. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/methods/function.js +0 -31
  732. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
  733. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
  734. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
  735. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/methods/table.js +0 -189
  736. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
  737. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
  738. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
  739. package/cloud-runtime/standalone/node_modules/better-sqlite3/lib/util.js +0 -12
  740. package/cloud-runtime/standalone/node_modules/better-sqlite3/package.json +0 -59
  741. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/build/Release/better_sqlite3.node +0 -0
  742. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/database.js +0 -90
  743. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/index.js +0 -3
  744. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/methods/aggregate.js +0 -43
  745. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/methods/backup.js +0 -67
  746. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/methods/function.js +0 -31
  747. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/methods/inspect.js +0 -7
  748. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/methods/pragma.js +0 -12
  749. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/methods/serialize.js +0 -16
  750. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/methods/table.js +0 -189
  751. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/methods/transaction.js +0 -78
  752. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/methods/wrappers.js +0 -54
  753. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/sqlite-error.js +0 -20
  754. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/lib/util.js +0 -12
  755. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/package.json +0 -59
  756. package/cloud-runtime/standalone/node_modules/bindings/bindings.js +0 -221
  757. package/cloud-runtime/standalone/node_modules/bindings/package.json +0 -28
  758. package/cloud-runtime/standalone/node_modules/file-uri-to-path/index.js +0 -66
  759. package/cloud-runtime/standalone/node_modules/file-uri-to-path/package.json +0 -32
  760. package/cloud-runtime/standalone/scripts/fix-turbopack-externals.mjs +0 -87
  761. /package/cloud-runtime/standalone/.next/static/{15nzSRnot8KsYYP8yMBe- → 9PXl40CrFxI8nirdJ1A-T}/_buildManifest.js +0 -0
  762. /package/cloud-runtime/standalone/.next/static/{15nzSRnot8KsYYP8yMBe- → 9PXl40CrFxI8nirdJ1A-T}/_clientMiddlewareManifest.json +0 -0
  763. /package/cloud-runtime/standalone/.next/static/{15nzSRnot8KsYYP8yMBe- → 9PXl40CrFxI8nirdJ1A-T}/_ssgManifest.js +0 -0
  764. /package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/lib/index.js +0 -0
  765. /package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-linux-x64 → sharp-libvips-darwin-arm64}/versions.json +0 -0
@@ -1,4 +1,4 @@
1
- module.exports=[97812,e=>{"use strict";var t=e.i(60447);let r=new Set(["replan","rollback"]);class a extends Error{expectedVersion;actualVersion;constructor(e,t){super(`Execution graph version conflict: expected ${e}, found ${t}.`),this.name="GraphVersionConflictError",this.expectedVersion=e,this.actualVersion=t}}class o extends Error{constructor(e){super(`Execution graph not found: ${e}`),this.name="GraphNotFoundError"}}class n extends Error{nodeIds;constructor(e,t){super(`Execution graph ${e} is missing node(s): ${t.join(", ")}`),this.name="GraphNodeNotFoundError",this.nodeIds=t}}class s extends Error{taskId;existingGraphId;constructor(e,t){super(`Task ${e} is already bound to execution graph ${t}.`),this.name="GraphTaskAlreadyBoundError",this.taskId=e,this.existingGraphId=t}}function i(e){return null==e?null:JSON.stringify(e)}function d(e){if(null==e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function u(e){let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString()}function l(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function p(e){let{type:t,status:r,metrics:a,output:o,...n}=e;return{type:t,status:r,config:n,output:o??null,metrics:a??null}}function c(e){let t={...l(d(e.payload))};return"eventType"in t||(t.eventType=e.event_type),"timestamp"in t||(t.timestamp=u(e.timestamp)),t}function g(e){return{query(t,r){let a=e.prepare(t);return/^\s*(INSERT|UPDATE|DELETE)/i.test(t)&&!/RETURNING/i.test(t)?(a.run(...r??[]),{rows:[]}):{rows:a.all(...r??[])}}}}class m{getDb(){return(0,t.getSQLiteDb)()}createGraph(e,t){let r=this.getDb(),a=g(r);t?.skipTaskBinding&&r.pragma("foreign_keys = OFF");try{return r.transaction(()=>{let r=a.query("SELECT id FROM execution_graphs WHERE task_id = ? LIMIT 1",[e.taskId]).rows[0];if(r&&r.id!==e.id)throw new s(e.taskId,r.id);for(let[t,r]of(a.query(`INSERT INTO execution_graphs
1
+ module.exports=[97812,e=>{"use strict";var t=e.i(60447),r=e.i(59833);let a=new Set(["replan","rollback"]);class o extends Error{expectedVersion;actualVersion;constructor(e,t){super(`Execution graph version conflict: expected ${e}, found ${t}.`),this.name="GraphVersionConflictError",this.expectedVersion=e,this.actualVersion=t}}class n extends Error{constructor(e){super(`Execution graph not found: ${e}`),this.name="GraphNotFoundError"}}class s extends Error{nodeIds;constructor(e,t){super(`Execution graph ${e} is missing node(s): ${t.join(", ")}`),this.name="GraphNodeNotFoundError",this.nodeIds=t}}class i extends Error{taskId;existingGraphId;constructor(e,t){super(`Task ${e} is already bound to execution graph ${t}.`),this.name="GraphTaskAlreadyBoundError",this.taskId=e,this.existingGraphId=t}}function d(e){return null==e?null:JSON.stringify(e)}function u(e){if(null==e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function l(e){let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString()}function p(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function c(e){let{type:t,status:r,metrics:a,output:o,...n}=e;return{type:t,status:r,config:n,output:o??null,metrics:a??null}}function g(e){let t={...p(u(e.payload))};return"eventType"in t||(t.eventType=e.event_type),"timestamp"in t||(t.timestamp=l(e.timestamp)),t}function m(e){return{query(t,r){let a=e.prepare(t);return/^\s*(INSERT|UPDATE|DELETE)/i.test(t)&&!/RETURNING/i.test(t)?(a.run(...(r??[]).map(e=>e)),{rows:[]}):{rows:a.all(...(r??[]).map(e=>e))}}}}class h{getDb(){return(0,t.getSQLiteDb)()}createGraph(e,t){let a=this.getDb(),o=m(a);t?.skipTaskBinding&&(0,r.pragmaSet)(a,"foreign_keys = OFF");try{return(0,r.transaction)(a,()=>{let r=o.query("SELECT id FROM execution_graphs WHERE task_id = ? LIMIT 1",[e.taskId]).rows[0];if(r&&r.id!==e.id)throw new i(e.taskId,r.id);for(let[t,r]of(o.query(`INSERT INTO execution_graphs
2
2
  (id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at)
3
3
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
4
4
  ON CONFLICT (id) DO UPDATE SET
@@ -9,47 +9,47 @@ module.exports=[97812,e=>{"use strict";var t=e.i(60447);let r=new Set(["replan",
9
9
  done_criteria = excluded.done_criteria,
10
10
  schedule = excluded.schedule,
11
11
  created_at = excluded.created_at,
12
- updated_at = excluded.updated_at`,[e.id,e.taskId,e.graphVersion,e.mode,i(e.policy),i(e.doneCriteria),i(e.schedule??null),e.createdAt,e.updatedAt]),a.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e.id]),a.query("DELETE FROM graph_edges WHERE graph_id = ?",[e.id]),Object.entries(e.nodes))){let o=p(r);a.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
13
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,o.type,o.status,i(o.config),i(o.output),i(o.metrics)])}for(let t of e.edges)a.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
14
- VALUES (?, ?, ?, ?, ?, ?)`,[e.id,t.from,t.to,t.type,t.condition??null,i(t.dataMapping??null)]);for(let t of e.versionHistory)this.appendEventInternal(a,e.id,t);for(let t of e.runtimeEvents??[])this.appendEventInternal(a,e.id,t);t?.skipTaskBinding||a.query("UPDATE tasks SET graph_id = ? WHERE id = ?",[e.id,e.taskId]);let n=this.getGraphForTask(a,e.taskId);if(!n)throw new o(e.id);return n})()}finally{t?.skipTaskBinding&&r.pragma("foreign_keys = ON")}}getGraph(e){let t=this.getDb();return this.getGraphForTask(g(t),e)}updateNodeRuntime(e,t,r){let a=this.getDb(),s=g(a);return a.transaction(()=>{if(!s.query("SELECT id, graph_version FROM execution_graphs WHERE id = ?",[e]).rows[0])throw new o(e);let r=Object.keys(t);if(0===r.length){let t=s.query("SELECT graph_version, updated_at FROM execution_graphs WHERE id = ?",[e]);return{graphVersion:t.rows[0].graph_version,updatedAt:u(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),p=s.query(`SELECT node_id, type, status, config, output, metrics
15
- FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),c=new Map;for(let e of p.rows)c.set(e.node_id,e);let g=r.filter(e=>!c.has(e));if(g.length>0)throw new n(e,g);for(let a of r){let r=t[a],o=c.get(a);if(!o||!r)continue;let n={...l(d(o.config)),...l(r.configPatch)};void 0!==r.startedAt&&(n.startedAt=r.startedAt),void 0!==r.completedAt&&(n.completedAt=r.completedAt),void 0!==r.actualMinutes&&(n.actualMinutes=r.actualMinutes),s.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
16
- WHERE graph_id = ? AND node_id = ?`,[r.status??o.status,i(r.metrics??d(o.metrics)),i(r.output??d(o.output)),i(n),e,a])}let m=s.query("UPDATE execution_graphs SET updated_at = datetime('now') WHERE id = ? RETURNING graph_version, updated_at",[e]);return{graphVersion:m.rows[0].graph_version,updatedAt:u(m.rows[0].updated_at)}})()}updateGraphStructure(e,t,r){let a=this.getDb(),n=g(a);return a.transaction(()=>{let r=n.query("SELECT id, graph_version, mode, policy, done_criteria, schedule FROM execution_graphs WHERE id = ?",[e]).rows[0];if(!r)throw new o(e);if(t.nodes)for(let[r,a]of(n.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e]),Object.entries(t.nodes))){let t=p(a);n.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
17
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,i(t.config),i(t.output),i(t.metrics)])}if(t.edges)for(let r of(n.query("DELETE FROM graph_edges WHERE graph_id = ?",[e]),t.edges))n.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
18
- VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,i(r.dataMapping??null)]);let a=n.query(`UPDATE execution_graphs
12
+ updated_at = excluded.updated_at`,[e.id,e.taskId,e.graphVersion,e.mode,d(e.policy),d(e.doneCriteria),d(e.schedule??null),e.createdAt,e.updatedAt]),o.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e.id]),o.query("DELETE FROM graph_edges WHERE graph_id = ?",[e.id]),Object.entries(e.nodes))){let a=c(r);o.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
13
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,a.type,a.status,d(a.config),d(a.output),d(a.metrics)])}for(let t of e.edges)o.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
14
+ VALUES (?, ?, ?, ?, ?, ?)`,[e.id,t.from,t.to,t.type,t.condition??null,d(t.dataMapping??null)]);for(let t of e.versionHistory)this.appendEventInternal(o,e.id,t);for(let t of e.runtimeEvents??[])this.appendEventInternal(o,e.id,t);t?.skipTaskBinding||o.query("UPDATE tasks SET graph_id = ? WHERE id = ?",[e.id,e.taskId]);let a=this.getGraphForTask(o,e.taskId);if(!a)throw new n(e.id);return a})}finally{t?.skipTaskBinding&&(0,r.pragmaSet)(a,"foreign_keys = ON")}}getGraph(e){let t=this.getDb();return this.getGraphForTask(m(t),e)}updateNodeRuntime(e,t,a){let o=this.getDb(),i=m(o);return(0,r.transaction)(o,()=>{if(!i.query("SELECT id, graph_version FROM execution_graphs WHERE id = ?",[e]).rows[0])throw new n(e);let r=Object.keys(t);if(0===r.length){let t=i.query("SELECT graph_version, updated_at FROM execution_graphs WHERE id = ?",[e]);return{graphVersion:t.rows[0].graph_version,updatedAt:l(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),o=i.query(`SELECT node_id, type, status, config, output, metrics
15
+ FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),c=new Map;for(let e of o.rows)c.set(e.node_id,e);let g=r.filter(e=>!c.has(e));if(g.length>0)throw new s(e,g);for(let a of r){let r=t[a],o=c.get(a);if(!o||!r)continue;let n={...p(u(o.config)),...p(r.configPatch)};void 0!==r.startedAt&&(n.startedAt=r.startedAt),void 0!==r.completedAt&&(n.completedAt=r.completedAt),void 0!==r.actualMinutes&&(n.actualMinutes=r.actualMinutes),i.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
16
+ WHERE graph_id = ? AND node_id = ?`,[r.status??o.status,d(r.metrics??u(o.metrics)),d(r.output??u(o.output)),d(n),e,a])}let m=i.query("UPDATE execution_graphs SET updated_at = datetime('now') WHERE id = ? RETURNING graph_version, updated_at",[e]);return{graphVersion:m.rows[0].graph_version,updatedAt:l(m.rows[0].updated_at)}})}updateGraphStructure(e,t,a){let o=this.getDb(),s=m(o);return(0,r.transaction)(o,()=>{let r=s.query("SELECT id, graph_version, mode, policy, done_criteria, schedule FROM execution_graphs WHERE id = ?",[e]).rows[0];if(!r)throw new n(e);if(t.nodes)for(let[r,a]of(s.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e]),Object.entries(t.nodes))){let t=c(a);s.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
17
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,d(t.config),d(t.output),d(t.metrics)])}if(t.edges)for(let r of(s.query("DELETE FROM graph_edges WHERE graph_id = ?",[e]),t.edges))s.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
18
+ VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,d(r.dataMapping??null)]);let a=s.query(`UPDATE execution_graphs
19
19
  SET mode = ?, policy = ?, done_criteria = ?, schedule = ?, updated_at = datetime('now')
20
20
  WHERE id = ?
21
- RETURNING graph_version, updated_at`,[t.mode??r.mode,i(t.policy??d(r.policy)??{}),i(t.doneCriteria??d(r.done_criteria)??{}),i(t.schedule??d(r.schedule)??null),e]);return{graphVersion:a.rows[0].graph_version,updatedAt:u(a.rows[0].updated_at)}})()}appendEvent(e,t){let r=this.getDb();this.appendEventInternal(g(r),e,t)}getGraphForTask(e,t){let a=e.query(`SELECT id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at
22
- FROM execution_graphs WHERE task_id = ? ORDER BY updated_at DESC LIMIT 1`,[t]).rows[0];if(!a)return null;let o=e.query(`SELECT node_id, type, status, config, output, metrics
23
- FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[a.id]),n=e.query(`SELECT from_id, to_id, type, condition, data_mapping
24
- FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[a.id]),s=e.query(`SELECT event_type, payload, timestamp
25
- FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[a.id]),i={};for(let e of o.rows)i[e.node_id]=function(e){let t={...l(d(e.config)),type:e.type,status:e.status},r=d(e.metrics);null!==r&&(t.metrics=r);let a=d(e.output);return null!==a&&(t.output=a),t}(e);let p=n.rows.map(e=>({from:e.from_id,to:e.to_id,type:e.type,...e.condition?{condition:d(e.condition)}:{},...e.data_mapping?{dataMapping:d(e.data_mapping)}:{}})),g=[],m=[];for(let e of s.rows){let t=c(e);r.has(t.eventType)?g.push(t):m.push(t)}return{id:a.id,taskId:a.task_id,graphVersion:a.graph_version,mode:a.mode,nodes:i,edges:p,policy:d(a.policy)??{},doneCriteria:d(a.done_criteria)??{},schedule:d(a.schedule)??void 0,versionHistory:g,runtimeEvents:m,createdAt:u(a.created_at),updatedAt:u(a.updated_at)}}appendEventInternal(e,t,r){e.query(`INSERT INTO graph_events (graph_id, event_type, payload, timestamp)
26
- VALUES (?, ?, ?, ?)`,[t,r.eventType,i(r),r.timestamp])}}function h(){return new m}let _=new m;function f(e,t){return _.createGraph(e,t)}function y(e){return _.getGraph(e)}function E(e,t,r){return _.updateNodeRuntime(e,t,r)}function w(e,t,r){return _.updateGraphStructure(e,t,r)}function S(e,t){return _.appendEvent(e,t)}function v(e,r={}){let a=["graph_id = ?"],o=[e];r.eventType&&(a.push("event_type = ?"),o.push(r.eventType)),r.since&&(a.push("timestamp >= ?"),o.push(r.since));let n=r.limit??1e3,s=`SELECT event_type, payload, timestamp
21
+ RETURNING graph_version, updated_at`,[t.mode??r.mode,d(t.policy??u(r.policy)??{}),d(t.doneCriteria??u(r.done_criteria)??{}),d(t.schedule??u(r.schedule)??null),e]);return{graphVersion:a.rows[0].graph_version,updatedAt:l(a.rows[0].updated_at)}})}appendEvent(e,t){let r=this.getDb();this.appendEventInternal(m(r),e,t)}getGraphForTask(e,t){let r=e.query(`SELECT id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at
22
+ FROM execution_graphs WHERE task_id = ? ORDER BY updated_at DESC LIMIT 1`,[t]).rows[0];if(!r)return null;let o=e.query(`SELECT node_id, type, status, config, output, metrics
23
+ FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[r.id]),n=e.query(`SELECT from_id, to_id, type, condition, data_mapping
24
+ FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[r.id]),s=e.query(`SELECT event_type, payload, timestamp
25
+ FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[r.id]),i={};for(let e of o.rows)i[e.node_id]=function(e){let t={...p(u(e.config)),type:e.type,status:e.status},r=u(e.metrics);null!==r&&(t.metrics=r);let a=u(e.output);return null!==a&&(t.output=a),t}(e);let d=n.rows.map(e=>({from:e.from_id,to:e.to_id,type:e.type,...e.condition?{condition:u(e.condition)}:{},...e.data_mapping?{dataMapping:u(e.data_mapping)}:{}})),c=[],m=[];for(let e of s.rows){let t=g(e);a.has(t.eventType)?c.push(t):m.push(t)}return{id:r.id,taskId:r.task_id,graphVersion:r.graph_version,mode:r.mode,nodes:i,edges:d,policy:u(r.policy)??{},doneCriteria:u(r.done_criteria)??{},schedule:u(r.schedule)??void 0,versionHistory:c,runtimeEvents:m,createdAt:l(r.created_at),updatedAt:l(r.updated_at)}}appendEventInternal(e,t,r){e.query(`INSERT INTO graph_events (graph_id, event_type, payload, timestamp)
26
+ VALUES (?, ?, ?, ?)`,[t,r.eventType,d(r),r.timestamp])}}function _(){return new h}let f=new h;function y(e,t){return f.createGraph(e,t)}function E(e){return f.getGraph(e)}function w(e,t,r){return f.updateNodeRuntime(e,t,r)}function S(e,t,r){return f.updateGraphStructure(e,t,r)}function v(e,t){return f.appendEvent(e,t)}function R(e,r={}){let a=["graph_id = ?"],o=[e];r.eventType&&(a.push("event_type = ?"),o.push(r.eventType)),r.since&&(a.push("timestamp >= ?"),o.push(r.since));let n=r.limit??1e3,s=`SELECT event_type, payload, timestamp
27
27
  FROM graph_events
28
28
  WHERE ${a.join(" AND ")}
29
29
  ORDER BY timestamp ASC, event_type ASC
30
- LIMIT ?`;return o.push(n),g((0,t.getSQLiteDb)()).query(s,o).rows.map(e=>c(e))}function R(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
30
+ LIMIT ?`;return o.push(n),m((0,t.getSQLiteDb)()).query(s,o).rows.map(e=>g(e))}function k(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
31
31
  FROM execution_graphs
32
32
  WHERE schedule IS NOT NULL
33
33
  AND json_extract(schedule, '$.rootMessageId') = ?
34
34
  AND json_extract(schedule, '$.state') = 'active'
35
35
  ORDER BY updated_at DESC
36
- LIMIT 1`).get(r)??null:null}function k(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
36
+ LIMIT 1`).get(r)??null:null}function T(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
37
37
  FROM execution_graphs
38
38
  WHERE schedule IS NOT NULL
39
- AND json_extract(schedule, '$.state') = 'active'`).all().map(e=>e.rootMessageId).filter(Boolean)}function T(e){let r=e.trim();return r?Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
39
+ AND json_extract(schedule, '$.state') = 'active'`).all().map(e=>e.rootMessageId).filter(Boolean)}function I(e){let r=e.trim();return r?Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
40
40
  SET schedule = json_set(schedule, '$.state', 'stopped', '$.tickInProgress', json('false')),
41
41
  updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
42
42
  WHERE schedule IS NOT NULL
43
43
  AND json_extract(schedule, '$.rootMessageId') = ?
44
- AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>n,"GraphNotFoundError",()=>o,"GraphStore",()=>m,"GraphTaskAlreadyBoundError",()=>s,"GraphVersionConflictError",()=>a,"appendEvent",()=>S,"createGraph",()=>f,"createGraphStore",()=>h,"deactivateSchedulesByRootMessageId",()=>T,"getActiveScheduleForRootMessageId",()=>R,"getActiveScheduleRootMessageIds",()=>k,"getGraph",()=>y,"getGraphEvents",()=>v,"updateGraphStructure",()=>w,"updateNodeRuntime",()=>E])},33938,e=>{"use strict";var t=e.i(60447),r=e.i(77581);function a(e,a){let o=(0,t.getSQLiteDb)(),n=a?.producer;if("system"===n){let t=(0,r.getKnowledgeNote)("repo",e);return t?[{id:t.id,repo_id:e,content:t.content,producer:"system",created_at:t.updatedAt}]:[]}let s=n?o.prepare(`SELECT id, repo_id, content, producer, created_at
44
+ AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>s,"GraphNotFoundError",()=>n,"GraphStore",()=>h,"GraphTaskAlreadyBoundError",()=>i,"GraphVersionConflictError",()=>o,"appendEvent",()=>v,"createGraph",()=>y,"createGraphStore",()=>_,"deactivateSchedulesByRootMessageId",()=>I,"getActiveScheduleForRootMessageId",()=>k,"getActiveScheduleRootMessageIds",()=>T,"getGraph",()=>E,"getGraphEvents",()=>R,"updateGraphStructure",()=>S,"updateNodeRuntime",()=>w])},33938,e=>{"use strict";var t=e.i(60447),r=e.i(59833),a=e.i(77581);function o(e,r){let o=(0,t.getSQLiteDb)(),n=r?.producer;if("system"===n){let t=(0,a.getKnowledgeNote)("repo",e);return t?[{id:t.id,repo_id:e,content:t.content,producer:"system",created_at:t.updatedAt}]:[]}let s=n?o.prepare(`SELECT id, repo_id, content, producer, created_at
45
45
  FROM repo_knowledge
46
46
  WHERE repo_id = ? AND producer = ?
47
47
  ORDER BY created_at DESC`).all(e,n):o.prepare(`SELECT id, repo_id, content, producer, created_at
48
48
  FROM repo_knowledge
49
49
  WHERE repo_id = ?
50
- ORDER BY created_at DESC`).all(e);if(a?.includeLegacyHumanFallback===!1)return s;let i=(0,t.getSQLiteDb)().prepare(`SELECT id, name, path, notes, created_at, updated_at
50
+ ORDER BY created_at DESC`).all(e);if(r?.includeLegacyHumanFallback===!1)return s;let i=(0,t.getSQLiteDb)().prepare(`SELECT id, name, path, notes, created_at, updated_at
51
51
  FROM project_repos
52
- WHERE id = ?`).get(e)??null,d=i?.notes?.trim();return!d||s.some(e=>"human"===e.producer)||s.some(e=>"human"===e.producer&&e.content.trim()===d)?s:[{id:`legacy-notes:${e}`,repo_id:e,content:d,producer:"human",created_at:i?.updated_at??i?.created_at??new Date(0).toISOString()},...s]}function o(e,r,o){let n=(0,t.getSQLiteDb)(),s=o.trim();return n.transaction(()=>{n.prepare("DELETE FROM repo_knowledge WHERE repo_id = ? AND producer = ?").run(e,r),s&&n.prepare("INSERT INTO repo_knowledge (repo_id, content, producer) VALUES (?, ?, ?)").run(e,s,r)})(),a(e,{producer:r,includeLegacyHumanFallback:!1})}function n(e){let t=[];for(let r of e){if(!r.id){let e=r.notes?.trim();e&&t.push({repoId:"",repoName:r.name,path:r.path??null,content:e,producer:"human"});continue}for(let e of[...a(r.id,{producer:"human"}),...a(r.id,{producer:"system",includeLegacyHumanFallback:!1})]){let a=e.content.trim();a&&t.push({repoId:r.id,repoName:r.name,path:r.path??null,content:a,producer:e.producer})}}return t}e.s(["listRepoKnowledge",()=>a,"listResolvedRepoKnowledge",()=>n,"replaceRepoKnowledge",()=>o])},42304,e=>{"use strict";var t=e.i(54799),r=e.i(14350),a=e.i(60447),o=e.i(40813),n=e.i(77581);let s=new Set(["outcome","decision","pattern","gotcha"]),i=`You are a memory extractor for a task execution system.
52
+ WHERE id = ?`).get(e)??null,d=i?.notes?.trim();return!d||s.some(e=>"human"===e.producer)||s.some(e=>"human"===e.producer&&e.content.trim()===d)?s:[{id:`legacy-notes:${e}`,repo_id:e,content:d,producer:"human",created_at:i?.updated_at??i?.created_at??new Date(0).toISOString()},...s]}function n(e,a,n){let s=(0,t.getSQLiteDb)(),i=n.trim();return(0,r.transaction)(s,()=>{s.prepare("DELETE FROM repo_knowledge WHERE repo_id = ? AND producer = ?").run(e,a),i&&s.prepare("INSERT INTO repo_knowledge (repo_id, content, producer) VALUES (?, ?, ?)").run(e,i,a)}),o(e,{producer:a,includeLegacyHumanFallback:!1})}function s(e){let t=[];for(let r of e){if(!r.id){let e=r.notes?.trim();e&&t.push({repoId:"",repoName:r.name,path:r.path??null,content:e,producer:"human"});continue}for(let e of[...o(r.id,{producer:"human"}),...o(r.id,{producer:"system",includeLegacyHumanFallback:!1})]){let a=e.content.trim();a&&t.push({repoId:r.id,repoName:r.name,path:r.path??null,content:a,producer:e.producer})}}return t}e.s(["listRepoKnowledge",()=>o,"listResolvedRepoKnowledge",()=>s,"replaceRepoKnowledge",()=>n])},42304,e=>{"use strict";var t=e.i(54799),r=e.i(14350),a=e.i(60447),o=e.i(40813),n=e.i(77581);let s=new Set(["outcome","decision","pattern","gotcha"]),i=`You are a memory extractor for a task execution system.
53
53
  Given a completed task, extract 0-3 memories worth remembering for future tasks.
54
54
 
55
55
  Each memory must be:
@@ -1,12 +1,12 @@
1
- module.exports=[33938,e=>{"use strict";var t=e.i(60447),r=e.i(77581);function n(e,n){let o=(0,t.getSQLiteDb)(),a=n?.producer;if("system"===a){let t=(0,r.getKnowledgeNote)("repo",e);return t?[{id:t.id,repo_id:e,content:t.content,producer:"system",created_at:t.updatedAt}]:[]}let i=a?o.prepare(`SELECT id, repo_id, content, producer, created_at
1
+ module.exports=[33938,e=>{"use strict";var t=e.i(60447),r=e.i(59833),n=e.i(77581);function o(e,r){let o=(0,t.getSQLiteDb)(),a=r?.producer;if("system"===a){let t=(0,n.getKnowledgeNote)("repo",e);return t?[{id:t.id,repo_id:e,content:t.content,producer:"system",created_at:t.updatedAt}]:[]}let i=a?o.prepare(`SELECT id, repo_id, content, producer, created_at
2
2
  FROM repo_knowledge
3
3
  WHERE repo_id = ? AND producer = ?
4
4
  ORDER BY created_at DESC`).all(e,a):o.prepare(`SELECT id, repo_id, content, producer, created_at
5
5
  FROM repo_knowledge
6
6
  WHERE repo_id = ?
7
- ORDER BY created_at DESC`).all(e);if(n?.includeLegacyHumanFallback===!1)return i;let s=(0,t.getSQLiteDb)().prepare(`SELECT id, name, path, notes, created_at, updated_at
7
+ ORDER BY created_at DESC`).all(e);if(r?.includeLegacyHumanFallback===!1)return i;let s=(0,t.getSQLiteDb)().prepare(`SELECT id, name, path, notes, created_at, updated_at
8
8
  FROM project_repos
9
- WHERE id = ?`).get(e)??null,l=s?.notes?.trim();return!l||i.some(e=>"human"===e.producer)||i.some(e=>"human"===e.producer&&e.content.trim()===l)?i:[{id:`legacy-notes:${e}`,repo_id:e,content:l,producer:"human",created_at:s?.updated_at??s?.created_at??new Date(0).toISOString()},...i]}function o(e,r,o){let a=(0,t.getSQLiteDb)(),i=o.trim();return a.transaction(()=>{a.prepare("DELETE FROM repo_knowledge WHERE repo_id = ? AND producer = ?").run(e,r),i&&a.prepare("INSERT INTO repo_knowledge (repo_id, content, producer) VALUES (?, ?, ?)").run(e,i,r)})(),n(e,{producer:r,includeLegacyHumanFallback:!1})}function a(e){let t=[];for(let r of e){if(!r.id){let e=r.notes?.trim();e&&t.push({repoId:"",repoName:r.name,path:r.path??null,content:e,producer:"human"});continue}for(let e of[...n(r.id,{producer:"human"}),...n(r.id,{producer:"system",includeLegacyHumanFallback:!1})]){let n=e.content.trim();n&&t.push({repoId:r.id,repoName:r.name,path:r.path??null,content:n,producer:e.producer})}}return t}e.s(["listRepoKnowledge",()=>n,"listResolvedRepoKnowledge",()=>a,"replaceRepoKnowledge",()=>o])},42304,e=>{"use strict";var t=e.i(54799),r=e.i(14350),n=e.i(60447),o=e.i(40813),a=e.i(77581);let i=new Set(["outcome","decision","pattern","gotcha"]),s=`You are a memory extractor for a task execution system.
9
+ WHERE id = ?`).get(e)??null,l=s?.notes?.trim();return!l||i.some(e=>"human"===e.producer)||i.some(e=>"human"===e.producer&&e.content.trim()===l)?i:[{id:`legacy-notes:${e}`,repo_id:e,content:l,producer:"human",created_at:s?.updated_at??s?.created_at??new Date(0).toISOString()},...i]}function a(e,n,a){let i=(0,t.getSQLiteDb)(),s=a.trim();return(0,r.transaction)(i,()=>{i.prepare("DELETE FROM repo_knowledge WHERE repo_id = ? AND producer = ?").run(e,n),s&&i.prepare("INSERT INTO repo_knowledge (repo_id, content, producer) VALUES (?, ?, ?)").run(e,s,n)}),o(e,{producer:n,includeLegacyHumanFallback:!1})}function i(e){let t=[];for(let r of e){if(!r.id){let e=r.notes?.trim();e&&t.push({repoId:"",repoName:r.name,path:r.path??null,content:e,producer:"human"});continue}for(let e of[...o(r.id,{producer:"human"}),...o(r.id,{producer:"system",includeLegacyHumanFallback:!1})]){let n=e.content.trim();n&&t.push({repoId:r.id,repoName:r.name,path:r.path??null,content:n,producer:e.producer})}}return t}e.s(["listRepoKnowledge",()=>o,"listResolvedRepoKnowledge",()=>i,"replaceRepoKnowledge",()=>a])},42304,e=>{"use strict";var t=e.i(54799),r=e.i(14350),n=e.i(60447),o=e.i(40813),a=e.i(77581);let i=new Set(["outcome","decision","pattern","gotcha"]),s=`You are a memory extractor for a task execution system.
10
10
  Given a completed task, extract 0-3 memories worth remembering for future tasks.
11
11
 
12
12
  Each memory must be:
@@ -1,4 +1,4 @@
1
- module.exports=[97812,e=>{"use strict";var t=e.i(60447);let r=new Set(["replan","rollback"]);class a extends Error{expectedVersion;actualVersion;constructor(e,t){super(`Execution graph version conflict: expected ${e}, found ${t}.`),this.name="GraphVersionConflictError",this.expectedVersion=e,this.actualVersion=t}}class n extends Error{constructor(e){super(`Execution graph not found: ${e}`),this.name="GraphNotFoundError"}}class i extends Error{nodeIds;constructor(e,t){super(`Execution graph ${e} is missing node(s): ${t.join(", ")}`),this.name="GraphNodeNotFoundError",this.nodeIds=t}}class o extends Error{taskId;existingGraphId;constructor(e,t){super(`Task ${e} is already bound to execution graph ${t}.`),this.name="GraphTaskAlreadyBoundError",this.taskId=e,this.existingGraphId=t}}function s(e){return null==e?null:JSON.stringify(e)}function d(e){if(null==e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function u(e){let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString()}function l(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function p(e){let{type:t,status:r,metrics:a,output:n,...i}=e;return{type:t,status:r,config:i,output:n??null,metrics:a??null}}function c(e){let t={...l(d(e.payload))};return"eventType"in t||(t.eventType=e.event_type),"timestamp"in t||(t.timestamp=u(e.timestamp)),t}function h(e){return{query(t,r){let a=e.prepare(t);return/^\s*(INSERT|UPDATE|DELETE)/i.test(t)&&!/RETURNING/i.test(t)?(a.run(...r??[]),{rows:[]}):{rows:a.all(...r??[])}}}}class g{getDb(){return(0,t.getSQLiteDb)()}createGraph(e,t){let r=this.getDb(),a=h(r);t?.skipTaskBinding&&r.pragma("foreign_keys = OFF");try{return r.transaction(()=>{let r=a.query("SELECT id FROM execution_graphs WHERE task_id = ? LIMIT 1",[e.taskId]).rows[0];if(r&&r.id!==e.id)throw new o(e.taskId,r.id);for(let[t,r]of(a.query(`INSERT INTO execution_graphs
1
+ module.exports=[97812,e=>{"use strict";var t=e.i(60447),r=e.i(59833);let a=new Set(["replan","rollback"]);class n extends Error{expectedVersion;actualVersion;constructor(e,t){super(`Execution graph version conflict: expected ${e}, found ${t}.`),this.name="GraphVersionConflictError",this.expectedVersion=e,this.actualVersion=t}}class i extends Error{constructor(e){super(`Execution graph not found: ${e}`),this.name="GraphNotFoundError"}}class o extends Error{nodeIds;constructor(e,t){super(`Execution graph ${e} is missing node(s): ${t.join(", ")}`),this.name="GraphNodeNotFoundError",this.nodeIds=t}}class s extends Error{taskId;existingGraphId;constructor(e,t){super(`Task ${e} is already bound to execution graph ${t}.`),this.name="GraphTaskAlreadyBoundError",this.taskId=e,this.existingGraphId=t}}function d(e){return null==e?null:JSON.stringify(e)}function u(e){if(null==e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function l(e){let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString()}function p(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function c(e){let{type:t,status:r,metrics:a,output:n,...i}=e;return{type:t,status:r,config:i,output:n??null,metrics:a??null}}function h(e){let t={...p(u(e.payload))};return"eventType"in t||(t.eventType=e.event_type),"timestamp"in t||(t.timestamp=l(e.timestamp)),t}function g(e){return{query(t,r){let a=e.prepare(t);return/^\s*(INSERT|UPDATE|DELETE)/i.test(t)&&!/RETURNING/i.test(t)?(a.run(...(r??[]).map(e=>e)),{rows:[]}):{rows:a.all(...(r??[]).map(e=>e))}}}}class E{getDb(){return(0,t.getSQLiteDb)()}createGraph(e,t){let a=this.getDb(),n=g(a);t?.skipTaskBinding&&(0,r.pragmaSet)(a,"foreign_keys = OFF");try{return(0,r.transaction)(a,()=>{let r=n.query("SELECT id FROM execution_graphs WHERE task_id = ? LIMIT 1",[e.taskId]).rows[0];if(r&&r.id!==e.id)throw new s(e.taskId,r.id);for(let[t,r]of(n.query(`INSERT INTO execution_graphs
2
2
  (id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at)
3
3
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
4
4
  ON CONFLICT (id) DO UPDATE SET
@@ -9,38 +9,38 @@ module.exports=[97812,e=>{"use strict";var t=e.i(60447);let r=new Set(["replan",
9
9
  done_criteria = excluded.done_criteria,
10
10
  schedule = excluded.schedule,
11
11
  created_at = excluded.created_at,
12
- updated_at = excluded.updated_at`,[e.id,e.taskId,e.graphVersion,e.mode,s(e.policy),s(e.doneCriteria),s(e.schedule??null),e.createdAt,e.updatedAt]),a.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e.id]),a.query("DELETE FROM graph_edges WHERE graph_id = ?",[e.id]),Object.entries(e.nodes))){let n=p(r);a.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
13
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,n.type,n.status,s(n.config),s(n.output),s(n.metrics)])}for(let t of e.edges)a.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
14
- VALUES (?, ?, ?, ?, ?, ?)`,[e.id,t.from,t.to,t.type,t.condition??null,s(t.dataMapping??null)]);for(let t of e.versionHistory)this.appendEventInternal(a,e.id,t);for(let t of e.runtimeEvents??[])this.appendEventInternal(a,e.id,t);t?.skipTaskBinding||a.query("UPDATE tasks SET graph_id = ? WHERE id = ?",[e.id,e.taskId]);let i=this.getGraphForTask(a,e.taskId);if(!i)throw new n(e.id);return i})()}finally{t?.skipTaskBinding&&r.pragma("foreign_keys = ON")}}getGraph(e){let t=this.getDb();return this.getGraphForTask(h(t),e)}updateNodeRuntime(e,t,r){let a=this.getDb(),o=h(a);return a.transaction(()=>{if(!o.query("SELECT id, graph_version FROM execution_graphs WHERE id = ?",[e]).rows[0])throw new n(e);let r=Object.keys(t);if(0===r.length){let t=o.query("SELECT graph_version, updated_at FROM execution_graphs WHERE id = ?",[e]);return{graphVersion:t.rows[0].graph_version,updatedAt:u(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),p=o.query(`SELECT node_id, type, status, config, output, metrics
15
- FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),c=new Map;for(let e of p.rows)c.set(e.node_id,e);let h=r.filter(e=>!c.has(e));if(h.length>0)throw new i(e,h);for(let a of r){let r=t[a],n=c.get(a);if(!n||!r)continue;let i={...l(d(n.config)),...l(r.configPatch)};void 0!==r.startedAt&&(i.startedAt=r.startedAt),void 0!==r.completedAt&&(i.completedAt=r.completedAt),void 0!==r.actualMinutes&&(i.actualMinutes=r.actualMinutes),o.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
16
- WHERE graph_id = ? AND node_id = ?`,[r.status??n.status,s(r.metrics??d(n.metrics)),s(r.output??d(n.output)),s(i),e,a])}let g=o.query("UPDATE execution_graphs SET updated_at = datetime('now') WHERE id = ? RETURNING graph_version, updated_at",[e]);return{graphVersion:g.rows[0].graph_version,updatedAt:u(g.rows[0].updated_at)}})()}updateGraphStructure(e,t,r){let a=this.getDb(),i=h(a);return a.transaction(()=>{let r=i.query("SELECT id, graph_version, mode, policy, done_criteria, schedule FROM execution_graphs WHERE id = ?",[e]).rows[0];if(!r)throw new n(e);if(t.nodes)for(let[r,a]of(i.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e]),Object.entries(t.nodes))){let t=p(a);i.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
17
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,s(t.config),s(t.output),s(t.metrics)])}if(t.edges)for(let r of(i.query("DELETE FROM graph_edges WHERE graph_id = ?",[e]),t.edges))i.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
18
- VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,s(r.dataMapping??null)]);let a=i.query(`UPDATE execution_graphs
12
+ updated_at = excluded.updated_at`,[e.id,e.taskId,e.graphVersion,e.mode,d(e.policy),d(e.doneCriteria),d(e.schedule??null),e.createdAt,e.updatedAt]),n.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e.id]),n.query("DELETE FROM graph_edges WHERE graph_id = ?",[e.id]),Object.entries(e.nodes))){let a=c(r);n.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
13
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,a.type,a.status,d(a.config),d(a.output),d(a.metrics)])}for(let t of e.edges)n.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
14
+ VALUES (?, ?, ?, ?, ?, ?)`,[e.id,t.from,t.to,t.type,t.condition??null,d(t.dataMapping??null)]);for(let t of e.versionHistory)this.appendEventInternal(n,e.id,t);for(let t of e.runtimeEvents??[])this.appendEventInternal(n,e.id,t);t?.skipTaskBinding||n.query("UPDATE tasks SET graph_id = ? WHERE id = ?",[e.id,e.taskId]);let a=this.getGraphForTask(n,e.taskId);if(!a)throw new i(e.id);return a})}finally{t?.skipTaskBinding&&(0,r.pragmaSet)(a,"foreign_keys = ON")}}getGraph(e){let t=this.getDb();return this.getGraphForTask(g(t),e)}updateNodeRuntime(e,t,a){let n=this.getDb(),s=g(n);return(0,r.transaction)(n,()=>{if(!s.query("SELECT id, graph_version FROM execution_graphs WHERE id = ?",[e]).rows[0])throw new i(e);let r=Object.keys(t);if(0===r.length){let t=s.query("SELECT graph_version, updated_at FROM execution_graphs WHERE id = ?",[e]);return{graphVersion:t.rows[0].graph_version,updatedAt:l(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),n=s.query(`SELECT node_id, type, status, config, output, metrics
15
+ FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),c=new Map;for(let e of n.rows)c.set(e.node_id,e);let h=r.filter(e=>!c.has(e));if(h.length>0)throw new o(e,h);for(let a of r){let r=t[a],n=c.get(a);if(!n||!r)continue;let i={...p(u(n.config)),...p(r.configPatch)};void 0!==r.startedAt&&(i.startedAt=r.startedAt),void 0!==r.completedAt&&(i.completedAt=r.completedAt),void 0!==r.actualMinutes&&(i.actualMinutes=r.actualMinutes),s.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
16
+ WHERE graph_id = ? AND node_id = ?`,[r.status??n.status,d(r.metrics??u(n.metrics)),d(r.output??u(n.output)),d(i),e,a])}let g=s.query("UPDATE execution_graphs SET updated_at = datetime('now') WHERE id = ? RETURNING graph_version, updated_at",[e]);return{graphVersion:g.rows[0].graph_version,updatedAt:l(g.rows[0].updated_at)}})}updateGraphStructure(e,t,a){let n=this.getDb(),o=g(n);return(0,r.transaction)(n,()=>{let r=o.query("SELECT id, graph_version, mode, policy, done_criteria, schedule FROM execution_graphs WHERE id = ?",[e]).rows[0];if(!r)throw new i(e);if(t.nodes)for(let[r,a]of(o.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e]),Object.entries(t.nodes))){let t=c(a);o.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
17
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,d(t.config),d(t.output),d(t.metrics)])}if(t.edges)for(let r of(o.query("DELETE FROM graph_edges WHERE graph_id = ?",[e]),t.edges))o.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
18
+ VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,d(r.dataMapping??null)]);let a=o.query(`UPDATE execution_graphs
19
19
  SET mode = ?, policy = ?, done_criteria = ?, schedule = ?, updated_at = datetime('now')
20
20
  WHERE id = ?
21
- RETURNING graph_version, updated_at`,[t.mode??r.mode,s(t.policy??d(r.policy)??{}),s(t.doneCriteria??d(r.done_criteria)??{}),s(t.schedule??d(r.schedule)??null),e]);return{graphVersion:a.rows[0].graph_version,updatedAt:u(a.rows[0].updated_at)}})()}appendEvent(e,t){let r=this.getDb();this.appendEventInternal(h(r),e,t)}getGraphForTask(e,t){let a=e.query(`SELECT id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at
22
- FROM execution_graphs WHERE task_id = ? ORDER BY updated_at DESC LIMIT 1`,[t]).rows[0];if(!a)return null;let n=e.query(`SELECT node_id, type, status, config, output, metrics
23
- FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[a.id]),i=e.query(`SELECT from_id, to_id, type, condition, data_mapping
24
- FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[a.id]),o=e.query(`SELECT event_type, payload, timestamp
25
- FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[a.id]),s={};for(let e of n.rows)s[e.node_id]=function(e){let t={...l(d(e.config)),type:e.type,status:e.status},r=d(e.metrics);null!==r&&(t.metrics=r);let a=d(e.output);return null!==a&&(t.output=a),t}(e);let p=i.rows.map(e=>({from:e.from_id,to:e.to_id,type:e.type,...e.condition?{condition:d(e.condition)}:{},...e.data_mapping?{dataMapping:d(e.data_mapping)}:{}})),h=[],g=[];for(let e of o.rows){let t=c(e);r.has(t.eventType)?h.push(t):g.push(t)}return{id:a.id,taskId:a.task_id,graphVersion:a.graph_version,mode:a.mode,nodes:s,edges:p,policy:d(a.policy)??{},doneCriteria:d(a.done_criteria)??{},schedule:d(a.schedule)??void 0,versionHistory:h,runtimeEvents:g,createdAt:u(a.created_at),updatedAt:u(a.updated_at)}}appendEventInternal(e,t,r){e.query(`INSERT INTO graph_events (graph_id, event_type, payload, timestamp)
26
- VALUES (?, ?, ?, ?)`,[t,r.eventType,s(r),r.timestamp])}}function E(){return new g}let _=new g;function f(e,t){return _.createGraph(e,t)}function m(e){return _.getGraph(e)}function R(e,t,r){return _.updateNodeRuntime(e,t,r)}function y(e,t,r){return _.updateGraphStructure(e,t,r)}function T(e,t){return _.appendEvent(e,t)}function v(e,r={}){let a=["graph_id = ?"],n=[e];r.eventType&&(a.push("event_type = ?"),n.push(r.eventType)),r.since&&(a.push("timestamp >= ?"),n.push(r.since));let i=r.limit??1e3,o=`SELECT event_type, payload, timestamp
21
+ RETURNING graph_version, updated_at`,[t.mode??r.mode,d(t.policy??u(r.policy)??{}),d(t.doneCriteria??u(r.done_criteria)??{}),d(t.schedule??u(r.schedule)??null),e]);return{graphVersion:a.rows[0].graph_version,updatedAt:l(a.rows[0].updated_at)}})}appendEvent(e,t){let r=this.getDb();this.appendEventInternal(g(r),e,t)}getGraphForTask(e,t){let r=e.query(`SELECT id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at
22
+ FROM execution_graphs WHERE task_id = ? ORDER BY updated_at DESC LIMIT 1`,[t]).rows[0];if(!r)return null;let n=e.query(`SELECT node_id, type, status, config, output, metrics
23
+ FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[r.id]),i=e.query(`SELECT from_id, to_id, type, condition, data_mapping
24
+ FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[r.id]),o=e.query(`SELECT event_type, payload, timestamp
25
+ FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[r.id]),s={};for(let e of n.rows)s[e.node_id]=function(e){let t={...p(u(e.config)),type:e.type,status:e.status},r=u(e.metrics);null!==r&&(t.metrics=r);let a=u(e.output);return null!==a&&(t.output=a),t}(e);let d=i.rows.map(e=>({from:e.from_id,to:e.to_id,type:e.type,...e.condition?{condition:u(e.condition)}:{},...e.data_mapping?{dataMapping:u(e.data_mapping)}:{}})),c=[],g=[];for(let e of o.rows){let t=h(e);a.has(t.eventType)?c.push(t):g.push(t)}return{id:r.id,taskId:r.task_id,graphVersion:r.graph_version,mode:r.mode,nodes:s,edges:d,policy:u(r.policy)??{},doneCriteria:u(r.done_criteria)??{},schedule:u(r.schedule)??void 0,versionHistory:c,runtimeEvents:g,createdAt:l(r.created_at),updatedAt:l(r.updated_at)}}appendEventInternal(e,t,r){e.query(`INSERT INTO graph_events (graph_id, event_type, payload, timestamp)
26
+ VALUES (?, ?, ?, ?)`,[t,r.eventType,d(r),r.timestamp])}}function _(){return new E}let f=new E;function m(e,t){return f.createGraph(e,t)}function R(e){return f.getGraph(e)}function y(e,t,r){return f.updateNodeRuntime(e,t,r)}function T(e,t,r){return f.updateGraphStructure(e,t,r)}function v(e,t){return f.appendEvent(e,t)}function N(e,r={}){let a=["graph_id = ?"],n=[e];r.eventType&&(a.push("event_type = ?"),n.push(r.eventType)),r.since&&(a.push("timestamp >= ?"),n.push(r.since));let i=r.limit??1e3,o=`SELECT event_type, payload, timestamp
27
27
  FROM graph_events
28
28
  WHERE ${a.join(" AND ")}
29
29
  ORDER BY timestamp ASC, event_type ASC
30
- LIMIT ?`;return n.push(i),h((0,t.getSQLiteDb)()).query(o,n).rows.map(e=>c(e))}function N(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
30
+ LIMIT ?`;return n.push(i),g((0,t.getSQLiteDb)()).query(o,n).rows.map(e=>h(e))}function S(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
31
31
  FROM execution_graphs
32
32
  WHERE schedule IS NOT NULL
33
33
  AND json_extract(schedule, '$.rootMessageId') = ?
34
34
  AND json_extract(schedule, '$.state') = 'active'
35
35
  ORDER BY updated_at DESC
36
- LIMIT 1`).get(r)??null:null}function S(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
36
+ LIMIT 1`).get(r)??null:null}function A(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
37
37
  FROM execution_graphs
38
38
  WHERE schedule IS NOT NULL
39
- AND json_extract(schedule, '$.state') = 'active'`).all().map(e=>e.rootMessageId).filter(Boolean)}function A(e){let r=e.trim();return r?Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
39
+ AND json_extract(schedule, '$.state') = 'active'`).all().map(e=>e.rootMessageId).filter(Boolean)}function w(e){let r=e.trim();return r?Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
40
40
  SET schedule = json_set(schedule, '$.state', 'stopped', '$.tickInProgress', json('false')),
41
41
  updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
42
42
  WHERE schedule IS NOT NULL
43
43
  AND json_extract(schedule, '$.rootMessageId') = ?
44
- AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>i,"GraphNotFoundError",()=>n,"GraphStore",()=>g,"GraphTaskAlreadyBoundError",()=>o,"GraphVersionConflictError",()=>a,"appendEvent",()=>T,"createGraph",()=>f,"createGraphStore",()=>E,"deactivateSchedulesByRootMessageId",()=>A,"getActiveScheduleForRootMessageId",()=>N,"getActiveScheduleRootMessageIds",()=>S,"getGraph",()=>m,"getGraphEvents",()=>v,"updateGraphStructure",()=>y,"updateNodeRuntime",()=>R])},71500,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),o=e.i(74677),s=e.i(69741),d=e.i(16795),u=e.i(87718),l=e.i(95169),p=e.i(47587),c=e.i(66012),h=e.i(70101),g=e.i(74838),E=e.i(10372),_=e.i(93695);e.i(52474);var f=e.i(220),m=e.i(94028),R=e.i(90081),y=e.i(57431),T=e.i(49041),v=e.i(97812);function N(e){if(e instanceof Date){let t=e.getTime();return Number.isNaN(t)?null:t}if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"!=typeof e||""===e.trim())return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}async function S(e,{params:t}){try{let r=T.LOCAL_USER.id,{id:a}=await t,n=a;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(a)){let e=(0,y.createAdminDbClient)(),{data:t}=await e.from("tasks").select("id").eq("slug",a).limit(1).maybeSingle();t?.id&&(n=t.id)}let i=await R.db.getTask(n,r);if(!i)return m.NextResponse.json({error:"Task not found"},{status:404});let o=i.id,{searchParams:s}=new URL(e.url),d=s.get("tail"),u=s.get("limit"),l=s.get("after"),p=s.get("nodeId"),c=await R.db.getTaskLogs(o,{tail:null===d?500:Number(d),limit:null===u?void 0:Number(u),after:null===l?void 0:l,nodeId:null===p?void 0:p});if(p&&!l&&0===c.length)try{let e=await (0,v.getGraph)(o),t=e?.nodes?.[p],r=N(t?.startedAt);if(null!==r){let e=N(t?.completedAt)??Date.now(),a=Number(d??u??500),n=Math.max(Number.isFinite(a)&&a>0?a:500,2e3);c=(await R.db.getTaskLogs(o,{tail:n})).filter(t=>{let a=N(t.created_at);return null!==a&&a>=r-12e4&&a<=e+12e4})}}catch{}return m.NextResponse.json({logs:c})}catch(e){return console.error("Error fetching logs:",e),m.NextResponse.json({error:"Failed to fetch logs"},{status:500})}}async function A(e,{params:t}){try{let r,a=T.LOCAL_USER.id,{id:n}=await t,i=await e.text();if(!i||""===i.trim())return m.NextResponse.json({error:"JSON body is required"},{status:400});try{r=JSON.parse(i)}catch{return m.NextResponse.json({error:"Invalid JSON body"},{status:400})}let o=r?.content,s=r?.log_type,d=r?.node_id;if("string"!=typeof o||""===o.trim())return m.NextResponse.json({error:"Content is required"},{status:400});if(!await R.db.getTask(n,a))return m.NextResponse.json({error:"Task not found"},{status:404});let u="string"!=typeof s||""===s.trim()?"output":s,l="string"==typeof d&&""!==d.trim()?d.trim():void 0,p=await R.db.addTaskLog(n,o,u,l);return m.NextResponse.json({log:p},{status:201})}catch(e){return console.error("Error adding log:",e),m.NextResponse.json({error:"Failed to add log"},{status:500})}}e.s(["GET",()=>S,"POST",()=>A],32985);var w=e.i(32985);let x=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/logs/route",pathname:"/api/tasks/[id]/logs",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/logs/route.ts",nextConfigOutput:"standalone",userland:w}),{workAsyncStorage:I,workUnitAsyncStorage:O,serverHooks:C}=x;function k(){return(0,a.patchFetch)({workAsyncStorage:I,workUnitAsyncStorage:O})}async function D(e,t,a){x.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/tasks/[id]/logs/route";m=m.replace(/\/index$/,"")||"/";let R=await x.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:T,nextConfig:v,parsedUrl:N,isDraftMode:S,prerenderManifest:A,routerServerContext:w,isOnDemandRevalidate:I,revalidateOnlyGenerated:O,resolvedPathname:C,clientReferenceManifest:k,serverActionsManifest:D}=R,b=(0,s.normalizeAppPath)(m),L=!!(A.dynamicRoutes[b]||A.routes[C]),M=async()=>((null==w?void 0:w.render404)?await w.render404(e,t,N,!1):t.end("This page could not be found"),null);if(L&&!S){let e=!!A.routes[C],t=A.dynamicRoutes[b];if(t&&!1===t.fallback&&!e){if(v.experimental.adapterPath)return await M();throw new _.NoFallbackError}}let q=null;!L||x.isDev||S||(q="/index"===(q=C)?"/":q);let H=!0===x.isDev||!L,F=L&&!H;D&&k&&(0,o.setManifestsSingleton)({page:m,clientReferenceManifest:k,serverActionsManifest:D});let U=e.method||"GET",G=(0,i.getTracer)(),P=G.getActiveScopeSpan(),j={params:T,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!v.experimental.authInterrupts},cacheComponents:!!v.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:v.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>x.onRequestError(e,t,a,n,w)},sharedContext:{buildId:y}},$=new d.NodeNextRequest(e),W=new d.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest($,(0,u.signalFromNodeResponse)(t));try{let o=async e=>x.handle(V,j).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=G.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==l.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${U} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${U} ${m}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var i,d;let u=async({previousCacheEntry:r})=>{try{if(!s&&I&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(n);e.fetchMetrics=j.renderOpts.fetchMetrics;let d=j.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let u=j.renderOpts.collectedTags;if(!L)return await (0,c.sendResponse)($,W,i,j.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);u&&(t[E.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==j.renderOpts.collectedRevalidate&&!(j.renderOpts.collectedRevalidate>=E.INFINITE_CACHE)&&j.renderOpts.collectedRevalidate,a=void 0===j.renderOpts.collectedExpire||j.renderOpts.collectedExpire>=E.INFINITE_CACHE?void 0:j.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await x.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:I})},!1,w),t}},l=await x.handleResponse({req:e,nextConfig:v,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:s});if(!L)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(d=l.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",I?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let _=(0,h.fromNodeOutgoingHttpHeaders)(l.value.headers);return s&&L||_.delete(E.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||t.getHeader("Cache-Control")||_.get("Cache-Control")||_.set("Cache-Control",(0,g.getCacheControlHeader)(l.cacheControl)),await (0,c.sendResponse)($,W,new Response(l.value.body,{headers:_,status:l.value.status||200})),null};P?await d(P):await G.withPropagatedContext(e.headers,()=>G.trace(l.BaseServerSpan.handleRequest,{spanName:`${U} ${m}`,kind:i.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},d))}catch(t){if(t instanceof _.NoFallbackError||await x.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:I})},!1,w),L)throw t;return await (0,c.sendResponse)($,W,new Response(null,{status:500})),null}}e.s(["handler",()=>D,"patchFetch",()=>k,"routeModule",()=>x,"serverHooks",()=>C,"workAsyncStorage",()=>I,"workUnitAsyncStorage",()=>O],71500)}];
44
+ AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>o,"GraphNotFoundError",()=>i,"GraphStore",()=>E,"GraphTaskAlreadyBoundError",()=>s,"GraphVersionConflictError",()=>n,"appendEvent",()=>v,"createGraph",()=>m,"createGraphStore",()=>_,"deactivateSchedulesByRootMessageId",()=>w,"getActiveScheduleForRootMessageId",()=>S,"getActiveScheduleRootMessageIds",()=>A,"getGraph",()=>R,"getGraphEvents",()=>N,"updateGraphStructure",()=>T,"updateNodeRuntime",()=>y])},71500,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),o=e.i(74677),s=e.i(69741),d=e.i(16795),u=e.i(87718),l=e.i(95169),p=e.i(47587),c=e.i(66012),h=e.i(70101),g=e.i(74838),E=e.i(10372),_=e.i(93695);e.i(52474);var f=e.i(220),m=e.i(94028),R=e.i(90081),y=e.i(57431),T=e.i(49041),v=e.i(97812);function N(e){if(e instanceof Date){let t=e.getTime();return Number.isNaN(t)?null:t}if("number"==typeof e)return Number.isFinite(e)?e:null;if("string"!=typeof e||""===e.trim())return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}async function S(e,{params:t}){try{let r=T.LOCAL_USER.id,{id:a}=await t,n=a;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(a)){let e=(0,y.createAdminDbClient)(),{data:t}=await e.from("tasks").select("id").eq("slug",a).limit(1).maybeSingle();t?.id&&(n=t.id)}let i=await R.db.getTask(n,r);if(!i)return m.NextResponse.json({error:"Task not found"},{status:404});let o=i.id,{searchParams:s}=new URL(e.url),d=s.get("tail"),u=s.get("limit"),l=s.get("after"),p=s.get("nodeId"),c=await R.db.getTaskLogs(o,{tail:null===d?500:Number(d),limit:null===u?void 0:Number(u),after:null===l?void 0:l,nodeId:null===p?void 0:p});if(p&&!l&&0===c.length)try{let e=await (0,v.getGraph)(o),t=e?.nodes?.[p],r=N(t?.startedAt);if(null!==r){let e=N(t?.completedAt)??Date.now(),a=Number(d??u??500),n=Math.max(Number.isFinite(a)&&a>0?a:500,2e3);c=(await R.db.getTaskLogs(o,{tail:n})).filter(t=>{let a=N(t.created_at);return null!==a&&a>=r-12e4&&a<=e+12e4})}}catch{}return m.NextResponse.json({logs:c})}catch(e){return console.error("Error fetching logs:",e),m.NextResponse.json({error:"Failed to fetch logs"},{status:500})}}async function A(e,{params:t}){try{let r,a=T.LOCAL_USER.id,{id:n}=await t,i=await e.text();if(!i||""===i.trim())return m.NextResponse.json({error:"JSON body is required"},{status:400});try{r=JSON.parse(i)}catch{return m.NextResponse.json({error:"Invalid JSON body"},{status:400})}let o=r?.content,s=r?.log_type,d=r?.node_id;if("string"!=typeof o||""===o.trim())return m.NextResponse.json({error:"Content is required"},{status:400});if(!await R.db.getTask(n,a))return m.NextResponse.json({error:"Task not found"},{status:404});let u="string"!=typeof s||""===s.trim()?"output":s,l="string"==typeof d&&""!==d.trim()?d.trim():void 0,p=await R.db.addTaskLog(n,o,u,l);return m.NextResponse.json({log:p},{status:201})}catch(e){return console.error("Error adding log:",e),m.NextResponse.json({error:"Failed to add log"},{status:500})}}e.s(["GET",()=>S,"POST",()=>A],32985);var w=e.i(32985);let x=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/logs/route",pathname:"/api/tasks/[id]/logs",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/logs/route.ts",nextConfigOutput:"standalone",userland:w}),{workAsyncStorage:I,workUnitAsyncStorage:O,serverHooks:C}=x;function k(){return(0,a.patchFetch)({workAsyncStorage:I,workUnitAsyncStorage:O})}async function D(e,t,a){x.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/tasks/[id]/logs/route";m=m.replace(/\/index$/,"")||"/";let R=await x.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:y,params:T,nextConfig:v,parsedUrl:N,isDraftMode:S,prerenderManifest:A,routerServerContext:w,isOnDemandRevalidate:I,revalidateOnlyGenerated:O,resolvedPathname:C,clientReferenceManifest:k,serverActionsManifest:D}=R,b=(0,s.normalizeAppPath)(m),L=!!(A.dynamicRoutes[b]||A.routes[C]),M=async()=>((null==w?void 0:w.render404)?await w.render404(e,t,N,!1):t.end("This page could not be found"),null);if(L&&!S){let e=!!A.routes[C],t=A.dynamicRoutes[b];if(t&&!1===t.fallback&&!e){if(v.experimental.adapterPath)return await M();throw new _.NoFallbackError}}let q=null;!L||x.isDev||S||(q="/index"===(q=C)?"/":q);let H=!0===x.isDev||!L,F=L&&!H;D&&k&&(0,o.setManifestsSingleton)({page:m,clientReferenceManifest:k,serverActionsManifest:D});let U=e.method||"GET",G=(0,i.getTracer)(),P=G.getActiveScopeSpan(),j={params:T,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!v.experimental.authInterrupts},cacheComponents:!!v.cacheComponents,supportsDynamicResponse:H,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:v.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>x.onRequestError(e,t,a,n,w)},sharedContext:{buildId:y}},$=new d.NodeNextRequest(e),W=new d.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest($,(0,u.signalFromNodeResponse)(t));try{let o=async e=>x.handle(V,j).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=G.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==l.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${U} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${U} ${m}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var i,d;let u=async({previousCacheEntry:r})=>{try{if(!s&&I&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(n);e.fetchMetrics=j.renderOpts.fetchMetrics;let d=j.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let u=j.renderOpts.collectedTags;if(!L)return await (0,c.sendResponse)($,W,i,j.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);u&&(t[E.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==j.renderOpts.collectedRevalidate&&!(j.renderOpts.collectedRevalidate>=E.INFINITE_CACHE)&&j.renderOpts.collectedRevalidate,a=void 0===j.renderOpts.collectedExpire||j.renderOpts.collectedExpire>=E.INFINITE_CACHE?void 0:j.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await x.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:I})},!1,w),t}},l=await x.handleResponse({req:e,nextConfig:v,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:s});if(!L)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(d=l.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",I?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let _=(0,h.fromNodeOutgoingHttpHeaders)(l.value.headers);return s&&L||_.delete(E.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||t.getHeader("Cache-Control")||_.get("Cache-Control")||_.set("Cache-Control",(0,g.getCacheControlHeader)(l.cacheControl)),await (0,c.sendResponse)($,W,new Response(l.value.body,{headers:_,status:l.value.status||200})),null};P?await d(P):await G.withPropagatedContext(e.headers,()=>G.trace(l.BaseServerSpan.handleRequest,{spanName:`${U} ${m}`,kind:i.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},d))}catch(t){if(t instanceof _.NoFallbackError||await x.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:I})},!1,w),L)throw t;return await (0,c.sendResponse)($,W,new Response(null,{status:500})),null}}e.s(["handler",()=>D,"patchFetch",()=>k,"routeModule",()=>x,"serverHooks",()=>C,"workAsyncStorage",()=>I,"workUnitAsyncStorage",()=>O],71500)}];
45
45
 
46
46
  //# sourceMappingURL=_99b78daf._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[97812,e=>{"use strict";var t=e.i(60447);let r=new Set(["replan","rollback"]);class a extends Error{expectedVersion;actualVersion;constructor(e,t){super(`Execution graph version conflict: expected ${e}, found ${t}.`),this.name="GraphVersionConflictError",this.expectedVersion=e,this.actualVersion=t}}class n extends Error{constructor(e){super(`Execution graph not found: ${e}`),this.name="GraphNotFoundError"}}class i extends Error{nodeIds;constructor(e,t){super(`Execution graph ${e} is missing node(s): ${t.join(", ")}`),this.name="GraphNodeNotFoundError",this.nodeIds=t}}class o extends Error{taskId;existingGraphId;constructor(e,t){super(`Task ${e} is already bound to execution graph ${t}.`),this.name="GraphTaskAlreadyBoundError",this.taskId=e,this.existingGraphId=t}}function s(e){return null==e?null:JSON.stringify(e)}function d(e){if(null==e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function u(e){let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString()}function p(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function l(e){let{type:t,status:r,metrics:a,output:n,...i}=e;return{type:t,status:r,config:i,output:n??null,metrics:a??null}}function c(e){let t={...p(d(e.payload))};return"eventType"in t||(t.eventType=e.event_type),"timestamp"in t||(t.timestamp=u(e.timestamp)),t}function h(e){return{query(t,r){let a=e.prepare(t);return/^\s*(INSERT|UPDATE|DELETE)/i.test(t)&&!/RETURNING/i.test(t)?(a.run(...r??[]),{rows:[]}):{rows:a.all(...r??[])}}}}class g{getDb(){return(0,t.getSQLiteDb)()}createGraph(e,t){let r=this.getDb(),a=h(r);t?.skipTaskBinding&&r.pragma("foreign_keys = OFF");try{return r.transaction(()=>{let r=a.query("SELECT id FROM execution_graphs WHERE task_id = ? LIMIT 1",[e.taskId]).rows[0];if(r&&r.id!==e.id)throw new o(e.taskId,r.id);for(let[t,r]of(a.query(`INSERT INTO execution_graphs
1
+ module.exports=[97812,e=>{"use strict";var t=e.i(60447),r=e.i(59833);let a=new Set(["replan","rollback"]);class n extends Error{expectedVersion;actualVersion;constructor(e,t){super(`Execution graph version conflict: expected ${e}, found ${t}.`),this.name="GraphVersionConflictError",this.expectedVersion=e,this.actualVersion=t}}class i extends Error{constructor(e){super(`Execution graph not found: ${e}`),this.name="GraphNotFoundError"}}class o extends Error{nodeIds;constructor(e,t){super(`Execution graph ${e} is missing node(s): ${t.join(", ")}`),this.name="GraphNodeNotFoundError",this.nodeIds=t}}class s extends Error{taskId;existingGraphId;constructor(e,t){super(`Task ${e} is already bound to execution graph ${t}.`),this.name="GraphTaskAlreadyBoundError",this.taskId=e,this.existingGraphId=t}}function d(e){return null==e?null:JSON.stringify(e)}function u(e){if(null==e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function p(e){let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString()}function l(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function c(e){let{type:t,status:r,metrics:a,output:n,...i}=e;return{type:t,status:r,config:i,output:n??null,metrics:a??null}}function h(e){let t={...l(u(e.payload))};return"eventType"in t||(t.eventType=e.event_type),"timestamp"in t||(t.timestamp=p(e.timestamp)),t}function g(e){return{query(t,r){let a=e.prepare(t);return/^\s*(INSERT|UPDATE|DELETE)/i.test(t)&&!/RETURNING/i.test(t)?(a.run(...(r??[]).map(e=>e)),{rows:[]}):{rows:a.all(...(r??[]).map(e=>e))}}}}class E{getDb(){return(0,t.getSQLiteDb)()}createGraph(e,t){let a=this.getDb(),n=g(a);t?.skipTaskBinding&&(0,r.pragmaSet)(a,"foreign_keys = OFF");try{return(0,r.transaction)(a,()=>{let r=n.query("SELECT id FROM execution_graphs WHERE task_id = ? LIMIT 1",[e.taskId]).rows[0];if(r&&r.id!==e.id)throw new s(e.taskId,r.id);for(let[t,r]of(n.query(`INSERT INTO execution_graphs
2
2
  (id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at)
3
3
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
4
4
  ON CONFLICT (id) DO UPDATE SET
@@ -9,38 +9,38 @@ module.exports=[97812,e=>{"use strict";var t=e.i(60447);let r=new Set(["replan",
9
9
  done_criteria = excluded.done_criteria,
10
10
  schedule = excluded.schedule,
11
11
  created_at = excluded.created_at,
12
- updated_at = excluded.updated_at`,[e.id,e.taskId,e.graphVersion,e.mode,s(e.policy),s(e.doneCriteria),s(e.schedule??null),e.createdAt,e.updatedAt]),a.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e.id]),a.query("DELETE FROM graph_edges WHERE graph_id = ?",[e.id]),Object.entries(e.nodes))){let n=l(r);a.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
13
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,n.type,n.status,s(n.config),s(n.output),s(n.metrics)])}for(let t of e.edges)a.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
14
- VALUES (?, ?, ?, ?, ?, ?)`,[e.id,t.from,t.to,t.type,t.condition??null,s(t.dataMapping??null)]);for(let t of e.versionHistory)this.appendEventInternal(a,e.id,t);for(let t of e.runtimeEvents??[])this.appendEventInternal(a,e.id,t);t?.skipTaskBinding||a.query("UPDATE tasks SET graph_id = ? WHERE id = ?",[e.id,e.taskId]);let i=this.getGraphForTask(a,e.taskId);if(!i)throw new n(e.id);return i})()}finally{t?.skipTaskBinding&&r.pragma("foreign_keys = ON")}}getGraph(e){let t=this.getDb();return this.getGraphForTask(h(t),e)}updateNodeRuntime(e,t,r){let a=this.getDb(),o=h(a);return a.transaction(()=>{if(!o.query("SELECT id, graph_version FROM execution_graphs WHERE id = ?",[e]).rows[0])throw new n(e);let r=Object.keys(t);if(0===r.length){let t=o.query("SELECT graph_version, updated_at FROM execution_graphs WHERE id = ?",[e]);return{graphVersion:t.rows[0].graph_version,updatedAt:u(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),l=o.query(`SELECT node_id, type, status, config, output, metrics
15
- FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),c=new Map;for(let e of l.rows)c.set(e.node_id,e);let h=r.filter(e=>!c.has(e));if(h.length>0)throw new i(e,h);for(let a of r){let r=t[a],n=c.get(a);if(!n||!r)continue;let i={...p(d(n.config)),...p(r.configPatch)};void 0!==r.startedAt&&(i.startedAt=r.startedAt),void 0!==r.completedAt&&(i.completedAt=r.completedAt),void 0!==r.actualMinutes&&(i.actualMinutes=r.actualMinutes),o.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
16
- WHERE graph_id = ? AND node_id = ?`,[r.status??n.status,s(r.metrics??d(n.metrics)),s(r.output??d(n.output)),s(i),e,a])}let g=o.query("UPDATE execution_graphs SET updated_at = datetime('now') WHERE id = ? RETURNING graph_version, updated_at",[e]);return{graphVersion:g.rows[0].graph_version,updatedAt:u(g.rows[0].updated_at)}})()}updateGraphStructure(e,t,r){let a=this.getDb(),i=h(a);return a.transaction(()=>{let r=i.query("SELECT id, graph_version, mode, policy, done_criteria, schedule FROM execution_graphs WHERE id = ?",[e]).rows[0];if(!r)throw new n(e);if(t.nodes)for(let[r,a]of(i.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e]),Object.entries(t.nodes))){let t=l(a);i.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
17
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,s(t.config),s(t.output),s(t.metrics)])}if(t.edges)for(let r of(i.query("DELETE FROM graph_edges WHERE graph_id = ?",[e]),t.edges))i.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
18
- VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,s(r.dataMapping??null)]);let a=i.query(`UPDATE execution_graphs
12
+ updated_at = excluded.updated_at`,[e.id,e.taskId,e.graphVersion,e.mode,d(e.policy),d(e.doneCriteria),d(e.schedule??null),e.createdAt,e.updatedAt]),n.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e.id]),n.query("DELETE FROM graph_edges WHERE graph_id = ?",[e.id]),Object.entries(e.nodes))){let a=c(r);n.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
13
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,a.type,a.status,d(a.config),d(a.output),d(a.metrics)])}for(let t of e.edges)n.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
14
+ VALUES (?, ?, ?, ?, ?, ?)`,[e.id,t.from,t.to,t.type,t.condition??null,d(t.dataMapping??null)]);for(let t of e.versionHistory)this.appendEventInternal(n,e.id,t);for(let t of e.runtimeEvents??[])this.appendEventInternal(n,e.id,t);t?.skipTaskBinding||n.query("UPDATE tasks SET graph_id = ? WHERE id = ?",[e.id,e.taskId]);let a=this.getGraphForTask(n,e.taskId);if(!a)throw new i(e.id);return a})}finally{t?.skipTaskBinding&&(0,r.pragmaSet)(a,"foreign_keys = ON")}}getGraph(e){let t=this.getDb();return this.getGraphForTask(g(t),e)}updateNodeRuntime(e,t,a){let n=this.getDb(),s=g(n);return(0,r.transaction)(n,()=>{if(!s.query("SELECT id, graph_version FROM execution_graphs WHERE id = ?",[e]).rows[0])throw new i(e);let r=Object.keys(t);if(0===r.length){let t=s.query("SELECT graph_version, updated_at FROM execution_graphs WHERE id = ?",[e]);return{graphVersion:t.rows[0].graph_version,updatedAt:p(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),n=s.query(`SELECT node_id, type, status, config, output, metrics
15
+ FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),c=new Map;for(let e of n.rows)c.set(e.node_id,e);let h=r.filter(e=>!c.has(e));if(h.length>0)throw new o(e,h);for(let a of r){let r=t[a],n=c.get(a);if(!n||!r)continue;let i={...l(u(n.config)),...l(r.configPatch)};void 0!==r.startedAt&&(i.startedAt=r.startedAt),void 0!==r.completedAt&&(i.completedAt=r.completedAt),void 0!==r.actualMinutes&&(i.actualMinutes=r.actualMinutes),s.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
16
+ WHERE graph_id = ? AND node_id = ?`,[r.status??n.status,d(r.metrics??u(n.metrics)),d(r.output??u(n.output)),d(i),e,a])}let g=s.query("UPDATE execution_graphs SET updated_at = datetime('now') WHERE id = ? RETURNING graph_version, updated_at",[e]);return{graphVersion:g.rows[0].graph_version,updatedAt:p(g.rows[0].updated_at)}})}updateGraphStructure(e,t,a){let n=this.getDb(),o=g(n);return(0,r.transaction)(n,()=>{let r=o.query("SELECT id, graph_version, mode, policy, done_criteria, schedule FROM execution_graphs WHERE id = ?",[e]).rows[0];if(!r)throw new i(e);if(t.nodes)for(let[r,a]of(o.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e]),Object.entries(t.nodes))){let t=c(a);o.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
17
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,d(t.config),d(t.output),d(t.metrics)])}if(t.edges)for(let r of(o.query("DELETE FROM graph_edges WHERE graph_id = ?",[e]),t.edges))o.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
18
+ VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,d(r.dataMapping??null)]);let a=o.query(`UPDATE execution_graphs
19
19
  SET mode = ?, policy = ?, done_criteria = ?, schedule = ?, updated_at = datetime('now')
20
20
  WHERE id = ?
21
- RETURNING graph_version, updated_at`,[t.mode??r.mode,s(t.policy??d(r.policy)??{}),s(t.doneCriteria??d(r.done_criteria)??{}),s(t.schedule??d(r.schedule)??null),e]);return{graphVersion:a.rows[0].graph_version,updatedAt:u(a.rows[0].updated_at)}})()}appendEvent(e,t){let r=this.getDb();this.appendEventInternal(h(r),e,t)}getGraphForTask(e,t){let a=e.query(`SELECT id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at
22
- FROM execution_graphs WHERE task_id = ? ORDER BY updated_at DESC LIMIT 1`,[t]).rows[0];if(!a)return null;let n=e.query(`SELECT node_id, type, status, config, output, metrics
23
- FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[a.id]),i=e.query(`SELECT from_id, to_id, type, condition, data_mapping
24
- FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[a.id]),o=e.query(`SELECT event_type, payload, timestamp
25
- FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[a.id]),s={};for(let e of n.rows)s[e.node_id]=function(e){let t={...p(d(e.config)),type:e.type,status:e.status},r=d(e.metrics);null!==r&&(t.metrics=r);let a=d(e.output);return null!==a&&(t.output=a),t}(e);let l=i.rows.map(e=>({from:e.from_id,to:e.to_id,type:e.type,...e.condition?{condition:d(e.condition)}:{},...e.data_mapping?{dataMapping:d(e.data_mapping)}:{}})),h=[],g=[];for(let e of o.rows){let t=c(e);r.has(t.eventType)?h.push(t):g.push(t)}return{id:a.id,taskId:a.task_id,graphVersion:a.graph_version,mode:a.mode,nodes:s,edges:l,policy:d(a.policy)??{},doneCriteria:d(a.done_criteria)??{},schedule:d(a.schedule)??void 0,versionHistory:h,runtimeEvents:g,createdAt:u(a.created_at),updatedAt:u(a.updated_at)}}appendEventInternal(e,t,r){e.query(`INSERT INTO graph_events (graph_id, event_type, payload, timestamp)
26
- VALUES (?, ?, ?, ?)`,[t,r.eventType,s(r),r.timestamp])}}function E(){return new g}let _=new g;function m(e,t){return _.createGraph(e,t)}function f(e){return _.getGraph(e)}function y(e,t,r){return _.updateNodeRuntime(e,t,r)}function R(e,t,r){return _.updateGraphStructure(e,t,r)}function v(e,t){return _.appendEvent(e,t)}function T(e,r={}){let a=["graph_id = ?"],n=[e];r.eventType&&(a.push("event_type = ?"),n.push(r.eventType)),r.since&&(a.push("timestamp >= ?"),n.push(r.since));let i=r.limit??1e3,o=`SELECT event_type, payload, timestamp
21
+ RETURNING graph_version, updated_at`,[t.mode??r.mode,d(t.policy??u(r.policy)??{}),d(t.doneCriteria??u(r.done_criteria)??{}),d(t.schedule??u(r.schedule)??null),e]);return{graphVersion:a.rows[0].graph_version,updatedAt:p(a.rows[0].updated_at)}})}appendEvent(e,t){let r=this.getDb();this.appendEventInternal(g(r),e,t)}getGraphForTask(e,t){let r=e.query(`SELECT id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at
22
+ FROM execution_graphs WHERE task_id = ? ORDER BY updated_at DESC LIMIT 1`,[t]).rows[0];if(!r)return null;let n=e.query(`SELECT node_id, type, status, config, output, metrics
23
+ FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[r.id]),i=e.query(`SELECT from_id, to_id, type, condition, data_mapping
24
+ FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[r.id]),o=e.query(`SELECT event_type, payload, timestamp
25
+ FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[r.id]),s={};for(let e of n.rows)s[e.node_id]=function(e){let t={...l(u(e.config)),type:e.type,status:e.status},r=u(e.metrics);null!==r&&(t.metrics=r);let a=u(e.output);return null!==a&&(t.output=a),t}(e);let d=i.rows.map(e=>({from:e.from_id,to:e.to_id,type:e.type,...e.condition?{condition:u(e.condition)}:{},...e.data_mapping?{dataMapping:u(e.data_mapping)}:{}})),c=[],g=[];for(let e of o.rows){let t=h(e);a.has(t.eventType)?c.push(t):g.push(t)}return{id:r.id,taskId:r.task_id,graphVersion:r.graph_version,mode:r.mode,nodes:s,edges:d,policy:u(r.policy)??{},doneCriteria:u(r.done_criteria)??{},schedule:u(r.schedule)??void 0,versionHistory:c,runtimeEvents:g,createdAt:p(r.created_at),updatedAt:p(r.updated_at)}}appendEventInternal(e,t,r){e.query(`INSERT INTO graph_events (graph_id, event_type, payload, timestamp)
26
+ VALUES (?, ?, ?, ?)`,[t,r.eventType,d(r),r.timestamp])}}function _(){return new E}let m=new E;function f(e,t){return m.createGraph(e,t)}function y(e){return m.getGraph(e)}function R(e,t,r){return m.updateNodeRuntime(e,t,r)}function v(e,t,r){return m.updateGraphStructure(e,t,r)}function T(e,t){return m.appendEvent(e,t)}function S(e,r={}){let a=["graph_id = ?"],n=[e];r.eventType&&(a.push("event_type = ?"),n.push(r.eventType)),r.since&&(a.push("timestamp >= ?"),n.push(r.since));let i=r.limit??1e3,o=`SELECT event_type, payload, timestamp
27
27
  FROM graph_events
28
28
  WHERE ${a.join(" AND ")}
29
29
  ORDER BY timestamp ASC, event_type ASC
30
- LIMIT ?`;return n.push(i),h((0,t.getSQLiteDb)()).query(o,n).rows.map(e=>c(e))}function S(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
30
+ LIMIT ?`;return n.push(i),g((0,t.getSQLiteDb)()).query(o,n).rows.map(e=>h(e))}function N(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
31
31
  FROM execution_graphs
32
32
  WHERE schedule IS NOT NULL
33
33
  AND json_extract(schedule, '$.rootMessageId') = ?
34
34
  AND json_extract(schedule, '$.state') = 'active'
35
35
  ORDER BY updated_at DESC
36
- LIMIT 1`).get(r)??null:null}function N(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
36
+ LIMIT 1`).get(r)??null:null}function I(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
37
37
  FROM execution_graphs
38
38
  WHERE schedule IS NOT NULL
39
- AND json_extract(schedule, '$.state') = 'active'`).all().map(e=>e.rootMessageId).filter(Boolean)}function I(e){let r=e.trim();return r?Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
39
+ AND json_extract(schedule, '$.state') = 'active'`).all().map(e=>e.rootMessageId).filter(Boolean)}function A(e){let r=e.trim();return r?Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
40
40
  SET schedule = json_set(schedule, '$.state', 'stopped', '$.tickInProgress', json('false')),
41
41
  updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
42
42
  WHERE schedule IS NOT NULL
43
43
  AND json_extract(schedule, '$.rootMessageId') = ?
44
- AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>i,"GraphNotFoundError",()=>n,"GraphStore",()=>g,"GraphTaskAlreadyBoundError",()=>o,"GraphVersionConflictError",()=>a,"appendEvent",()=>v,"createGraph",()=>m,"createGraphStore",()=>E,"deactivateSchedulesByRootMessageId",()=>I,"getActiveScheduleForRootMessageId",()=>S,"getActiveScheduleRootMessageIds",()=>N,"getGraph",()=>f,"getGraphEvents",()=>T,"updateGraphStructure",()=>R,"updateNodeRuntime",()=>y])},6838,e=>{"use strict";var t=e.i(94028),r=e.i(49041),a=e.i(90081);async function n(e){let n=r.LOCAL_USER.id,i=await a.db.getTask(e.taskId,n);return i?{ok:!0,actor:{actorId:n,actorType:"service"},task:i,projectId:e.requestedProjectId??i.project_id??null}:{ok:!1,response:t.NextResponse.json({error:"Task not found"},{status:404})}}e.s(["authorizeGraphMutation",()=>n])},49186,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),o=e.i(74677),s=e.i(69741),d=e.i(16795),u=e.i(87718),p=e.i(95169),l=e.i(47587),c=e.i(66012),h=e.i(70101),g=e.i(74838),E=e.i(10372),_=e.i(93695);e.i(52474);var m=e.i(220),f=e.i(63279),y=e.i(86582),R=e.i(6838),v=e.i(97812);async function T(e,{params:t}){let{id:r}=await t,a=(0,y.normalizeTaskId)(r);if(!a)return(0,y.jsonWithSchema)(f.ErrorResponseSchema,{error:"Invalid task id"},{status:400});let n=await (0,R.authorizeGraphMutation)({request:e,taskId:a,action:"create"});if(!n.ok)return n.response;let i=await (0,v.getGraph)(a);if(!i)return(0,y.jsonWithSchema)(f.ErrorResponseSchema,{error:"Graph not found"},{status:404});let o=i.versionHistory.map((e,t)=>{let r="replan"===e.eventType?e.toVersion:Math.max(2,i.graphVersion-(i.versionHistory.length-t-1));return"replan"===e.eventType?{version:r,eventType:e.eventType,timestamp:e.timestamp,reason:e.reason,triggeredBy:e.triggeredBy,diff:{addedNodes:e.changes.addedNodes,removedNodes:e.changes.removedNodes,rewiredDeps:e.changes.rewiredDeps,estimateDeltas:e.changes.estimateDeltas},checkpointNodeId:e.triggeredAtNodeId}:{version:r,eventType:e.eventType,timestamp:e.timestamp,reason:e.reason,triggeredBy:e.triggeredBy,diff:{addedNodes:[],removedNodes:[],rewiredDeps:[],estimateDeltas:{}},checkpointNodeId:e.toCheckpoint}});return(0,y.jsonWithSchema)(f.GraphHistoryResponseSchema,{graphId:i.id,taskId:i.taskId,currentGraphVersion:i.graphVersion,history:o})}e.s(["GET",()=>T],69031);var S=e.i(69031);let N=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/graph/history/route",pathname:"/api/tasks/[id]/graph/history",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/graph/history/route.ts",nextConfigOutput:"standalone",userland:S}),{workAsyncStorage:I,workUnitAsyncStorage:A,serverHooks:w}=N;function x(){return(0,a.patchFetch)({workAsyncStorage:I,workUnitAsyncStorage:A})}async function k(e,t,a){N.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/tasks/[id]/graph/history/route";f=f.replace(/\/index$/,"")||"/";let y=await N.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:R,params:v,nextConfig:T,parsedUrl:S,isDraftMode:I,prerenderManifest:A,routerServerContext:w,isOnDemandRevalidate:x,revalidateOnlyGenerated:k,resolvedPathname:C,clientReferenceManifest:O,serverActionsManifest:D}=y,M=(0,s.normalizeAppPath)(f),L=!!(A.dynamicRoutes[M]||A.routes[C]),H=async()=>((null==w?void 0:w.render404)?await w.render404(e,t,S,!1):t.end("This page could not be found"),null);if(L&&!I){let e=!!A.routes[C],t=A.dynamicRoutes[M];if(t&&!1===t.fallback&&!e){if(T.experimental.adapterPath)return await H();throw new _.NoFallbackError}}let b=null;!L||N.isDev||I||(b="/index"===(b=C)?"/":b);let q=!0===N.isDev||!L,G=L&&!q;D&&O&&(0,o.setManifestsSingleton)({page:f,clientReferenceManifest:O,serverActionsManifest:D});let U=e.method||"GET",F=(0,i.getTracer)(),P=F.getActiveScopeSpan(),j={params:v,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!T.experimental.authInterrupts},cacheComponents:!!T.cacheComponents,supportsDynamicResponse:q,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:T.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>N.onRequestError(e,t,a,n,w)},sharedContext:{buildId:R}},W=new d.NodeNextRequest(e),$=new d.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(W,(0,u.signalFromNodeResponse)(t));try{let o=async e=>N.handle(V,j).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${U} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${U} ${f}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var i,d;let u=async({previousCacheEntry:r})=>{try{if(!s&&x&&k&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(n);e.fetchMetrics=j.renderOpts.fetchMetrics;let d=j.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let u=j.renderOpts.collectedTags;if(!L)return await (0,c.sendResponse)(W,$,i,j.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);u&&(t[E.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==j.renderOpts.collectedRevalidate&&!(j.renderOpts.collectedRevalidate>=E.INFINITE_CACHE)&&j.renderOpts.collectedRevalidate,a=void 0===j.renderOpts.collectedExpire||j.renderOpts.collectedExpire>=E.INFINITE_CACHE?void 0:j.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,l.getRevalidateReason)({isStaticGeneration:G,isOnDemandRevalidate:x})},!1,w),t}},p=await N.handleResponse({req:e,nextConfig:T,cacheKey:b,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:x,revalidateOnlyGenerated:k,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:s});if(!L)return null;if((null==p||null==(i=p.value)?void 0:i.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(d=p.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",x?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),I&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let _=(0,h.fromNodeOutgoingHttpHeaders)(p.value.headers);return s&&L||_.delete(E.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||_.get("Cache-Control")||_.set("Cache-Control",(0,g.getCacheControlHeader)(p.cacheControl)),await (0,c.sendResponse)(W,$,new Response(p.value.body,{headers:_,status:p.value.status||200})),null};P?await d(P):await F.withPropagatedContext(e.headers,()=>F.trace(p.BaseServerSpan.handleRequest,{spanName:`${U} ${f}`,kind:i.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},d))}catch(t){if(t instanceof _.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,l.getRevalidateReason)({isStaticGeneration:G,isOnDemandRevalidate:x})},!1,w),L)throw t;return await (0,c.sendResponse)(W,$,new Response(null,{status:500})),null}}e.s(["handler",()=>k,"patchFetch",()=>x,"routeModule",()=>N,"serverHooks",()=>w,"workAsyncStorage",()=>I,"workUnitAsyncStorage",()=>A],49186)}];
44
+ AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>o,"GraphNotFoundError",()=>i,"GraphStore",()=>E,"GraphTaskAlreadyBoundError",()=>s,"GraphVersionConflictError",()=>n,"appendEvent",()=>T,"createGraph",()=>f,"createGraphStore",()=>_,"deactivateSchedulesByRootMessageId",()=>A,"getActiveScheduleForRootMessageId",()=>N,"getActiveScheduleRootMessageIds",()=>I,"getGraph",()=>y,"getGraphEvents",()=>S,"updateGraphStructure",()=>v,"updateNodeRuntime",()=>R])},6838,e=>{"use strict";var t=e.i(94028),r=e.i(49041),a=e.i(90081);async function n(e){let n=r.LOCAL_USER.id,i=await a.db.getTask(e.taskId,n);return i?{ok:!0,actor:{actorId:n,actorType:"service"},task:i,projectId:e.requestedProjectId??i.project_id??null}:{ok:!1,response:t.NextResponse.json({error:"Task not found"},{status:404})}}e.s(["authorizeGraphMutation",()=>n])},49186,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),o=e.i(74677),s=e.i(69741),d=e.i(16795),u=e.i(87718),p=e.i(95169),l=e.i(47587),c=e.i(66012),h=e.i(70101),g=e.i(74838),E=e.i(10372),_=e.i(93695);e.i(52474);var m=e.i(220),f=e.i(63279),y=e.i(86582),R=e.i(6838),v=e.i(97812);async function T(e,{params:t}){let{id:r}=await t,a=(0,y.normalizeTaskId)(r);if(!a)return(0,y.jsonWithSchema)(f.ErrorResponseSchema,{error:"Invalid task id"},{status:400});let n=await (0,R.authorizeGraphMutation)({request:e,taskId:a,action:"create"});if(!n.ok)return n.response;let i=await (0,v.getGraph)(a);if(!i)return(0,y.jsonWithSchema)(f.ErrorResponseSchema,{error:"Graph not found"},{status:404});let o=i.versionHistory.map((e,t)=>{let r="replan"===e.eventType?e.toVersion:Math.max(2,i.graphVersion-(i.versionHistory.length-t-1));return"replan"===e.eventType?{version:r,eventType:e.eventType,timestamp:e.timestamp,reason:e.reason,triggeredBy:e.triggeredBy,diff:{addedNodes:e.changes.addedNodes,removedNodes:e.changes.removedNodes,rewiredDeps:e.changes.rewiredDeps,estimateDeltas:e.changes.estimateDeltas},checkpointNodeId:e.triggeredAtNodeId}:{version:r,eventType:e.eventType,timestamp:e.timestamp,reason:e.reason,triggeredBy:e.triggeredBy,diff:{addedNodes:[],removedNodes:[],rewiredDeps:[],estimateDeltas:{}},checkpointNodeId:e.toCheckpoint}});return(0,y.jsonWithSchema)(f.GraphHistoryResponseSchema,{graphId:i.id,taskId:i.taskId,currentGraphVersion:i.graphVersion,history:o})}e.s(["GET",()=>T],69031);var S=e.i(69031);let N=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/graph/history/route",pathname:"/api/tasks/[id]/graph/history",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/graph/history/route.ts",nextConfigOutput:"standalone",userland:S}),{workAsyncStorage:I,workUnitAsyncStorage:A,serverHooks:w}=N;function x(){return(0,a.patchFetch)({workAsyncStorage:I,workUnitAsyncStorage:A})}async function k(e,t,a){N.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/tasks/[id]/graph/history/route";f=f.replace(/\/index$/,"")||"/";let y=await N.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!y)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:R,params:v,nextConfig:T,parsedUrl:S,isDraftMode:I,prerenderManifest:A,routerServerContext:w,isOnDemandRevalidate:x,revalidateOnlyGenerated:k,resolvedPathname:C,clientReferenceManifest:O,serverActionsManifest:D}=y,M=(0,s.normalizeAppPath)(f),L=!!(A.dynamicRoutes[M]||A.routes[C]),H=async()=>((null==w?void 0:w.render404)?await w.render404(e,t,S,!1):t.end("This page could not be found"),null);if(L&&!I){let e=!!A.routes[C],t=A.dynamicRoutes[M];if(t&&!1===t.fallback&&!e){if(T.experimental.adapterPath)return await H();throw new _.NoFallbackError}}let b=null;!L||N.isDev||I||(b="/index"===(b=C)?"/":b);let q=!0===N.isDev||!L,G=L&&!q;D&&O&&(0,o.setManifestsSingleton)({page:f,clientReferenceManifest:O,serverActionsManifest:D});let U=e.method||"GET",F=(0,i.getTracer)(),P=F.getActiveScopeSpan(),j={params:v,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!T.experimental.authInterrupts},cacheComponents:!!T.cacheComponents,supportsDynamicResponse:q,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:T.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>N.onRequestError(e,t,a,n,w)},sharedContext:{buildId:R}},W=new d.NodeNextRequest(e),$=new d.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(W,(0,u.signalFromNodeResponse)(t));try{let o=async e=>N.handle(V,j).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${U} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${U} ${f}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var i,d;let u=async({previousCacheEntry:r})=>{try{if(!s&&x&&k&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await o(n);e.fetchMetrics=j.renderOpts.fetchMetrics;let d=j.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let u=j.renderOpts.collectedTags;if(!L)return await (0,c.sendResponse)(W,$,i,j.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);u&&(t[E.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==j.renderOpts.collectedRevalidate&&!(j.renderOpts.collectedRevalidate>=E.INFINITE_CACHE)&&j.renderOpts.collectedRevalidate,a=void 0===j.renderOpts.collectedExpire||j.renderOpts.collectedExpire>=E.INFINITE_CACHE?void 0:j.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,l.getRevalidateReason)({isStaticGeneration:G,isOnDemandRevalidate:x})},!1,w),t}},p=await N.handleResponse({req:e,nextConfig:T,cacheKey:b,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:x,revalidateOnlyGenerated:k,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:s});if(!L)return null;if((null==p||null==(i=p.value)?void 0:i.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==p||null==(d=p.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",x?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),I&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let _=(0,h.fromNodeOutgoingHttpHeaders)(p.value.headers);return s&&L||_.delete(E.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||_.get("Cache-Control")||_.set("Cache-Control",(0,g.getCacheControlHeader)(p.cacheControl)),await (0,c.sendResponse)(W,$,new Response(p.value.body,{headers:_,status:p.value.status||200})),null};P?await d(P):await F.withPropagatedContext(e.headers,()=>F.trace(p.BaseServerSpan.handleRequest,{spanName:`${U} ${f}`,kind:i.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},d))}catch(t){if(t instanceof _.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,l.getRevalidateReason)({isStaticGeneration:G,isOnDemandRevalidate:x})},!1,w),L)throw t;return await (0,c.sendResponse)(W,$,new Response(null,{status:500})),null}}e.s(["handler",()=>k,"patchFetch",()=>x,"routeModule",()=>N,"serverHooks",()=>w,"workAsyncStorage",()=>I,"workUnitAsyncStorage",()=>A],49186)}];
45
45
 
46
46
  //# sourceMappingURL=_affbdbb0._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[97812,e=>{"use strict";var t=e.i(60447);let r=new Set(["replan","rollback"]);class a extends Error{expectedVersion;actualVersion;constructor(e,t){super(`Execution graph version conflict: expected ${e}, found ${t}.`),this.name="GraphVersionConflictError",this.expectedVersion=e,this.actualVersion=t}}class n extends Error{constructor(e){super(`Execution graph not found: ${e}`),this.name="GraphNotFoundError"}}class i extends Error{nodeIds;constructor(e,t){super(`Execution graph ${e} is missing node(s): ${t.join(", ")}`),this.name="GraphNodeNotFoundError",this.nodeIds=t}}class o extends Error{taskId;existingGraphId;constructor(e,t){super(`Task ${e} is already bound to execution graph ${t}.`),this.name="GraphTaskAlreadyBoundError",this.taskId=e,this.existingGraphId=t}}function s(e){return null==e?null:JSON.stringify(e)}function d(e){if(null==e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function l(e){let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString()}function u(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function p(e){let{type:t,status:r,metrics:a,output:n,...i}=e;return{type:t,status:r,config:i,output:n??null,metrics:a??null}}function c(e){let t={...u(d(e.payload))};return"eventType"in t||(t.eventType=e.event_type),"timestamp"in t||(t.timestamp=l(e.timestamp)),t}function g(e){return{query(t,r){let a=e.prepare(t);return/^\s*(INSERT|UPDATE|DELETE)/i.test(t)&&!/RETURNING/i.test(t)?(a.run(...r??[]),{rows:[]}):{rows:a.all(...r??[])}}}}class m{getDb(){return(0,t.getSQLiteDb)()}createGraph(e,t){let r=this.getDb(),a=g(r);t?.skipTaskBinding&&r.pragma("foreign_keys = OFF");try{return r.transaction(()=>{let r=a.query("SELECT id FROM execution_graphs WHERE task_id = ? LIMIT 1",[e.taskId]).rows[0];if(r&&r.id!==e.id)throw new o(e.taskId,r.id);for(let[t,r]of(a.query(`INSERT INTO execution_graphs
1
+ module.exports=[97812,e=>{"use strict";var t=e.i(60447),r=e.i(59833);let a=new Set(["replan","rollback"]);class n extends Error{expectedVersion;actualVersion;constructor(e,t){super(`Execution graph version conflict: expected ${e}, found ${t}.`),this.name="GraphVersionConflictError",this.expectedVersion=e,this.actualVersion=t}}class i extends Error{constructor(e){super(`Execution graph not found: ${e}`),this.name="GraphNotFoundError"}}class o extends Error{nodeIds;constructor(e,t){super(`Execution graph ${e} is missing node(s): ${t.join(", ")}`),this.name="GraphNodeNotFoundError",this.nodeIds=t}}class s extends Error{taskId;existingGraphId;constructor(e,t){super(`Task ${e} is already bound to execution graph ${t}.`),this.name="GraphTaskAlreadyBoundError",this.taskId=e,this.existingGraphId=t}}function d(e){return null==e?null:JSON.stringify(e)}function l(e){if(null==e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}function u(e){let t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toISOString()}function p(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function c(e){let{type:t,status:r,metrics:a,output:n,...i}=e;return{type:t,status:r,config:i,output:n??null,metrics:a??null}}function g(e){let t={...p(l(e.payload))};return"eventType"in t||(t.eventType=e.event_type),"timestamp"in t||(t.timestamp=u(e.timestamp)),t}function m(e){return{query(t,r){let a=e.prepare(t);return/^\s*(INSERT|UPDATE|DELETE)/i.test(t)&&!/RETURNING/i.test(t)?(a.run(...(r??[]).map(e=>e)),{rows:[]}):{rows:a.all(...(r??[]).map(e=>e))}}}}class f{getDb(){return(0,t.getSQLiteDb)()}createGraph(e,t){let a=this.getDb(),n=m(a);t?.skipTaskBinding&&(0,r.pragmaSet)(a,"foreign_keys = OFF");try{return(0,r.transaction)(a,()=>{let r=n.query("SELECT id FROM execution_graphs WHERE task_id = ? LIMIT 1",[e.taskId]).rows[0];if(r&&r.id!==e.id)throw new s(e.taskId,r.id);for(let[t,r]of(n.query(`INSERT INTO execution_graphs
2
2
  (id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at)
3
3
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
4
4
  ON CONFLICT (id) DO UPDATE SET
@@ -9,47 +9,47 @@ module.exports=[97812,e=>{"use strict";var t=e.i(60447);let r=new Set(["replan",
9
9
  done_criteria = excluded.done_criteria,
10
10
  schedule = excluded.schedule,
11
11
  created_at = excluded.created_at,
12
- updated_at = excluded.updated_at`,[e.id,e.taskId,e.graphVersion,e.mode,s(e.policy),s(e.doneCriteria),s(e.schedule??null),e.createdAt,e.updatedAt]),a.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e.id]),a.query("DELETE FROM graph_edges WHERE graph_id = ?",[e.id]),Object.entries(e.nodes))){let n=p(r);a.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
13
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,n.type,n.status,s(n.config),s(n.output),s(n.metrics)])}for(let t of e.edges)a.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
14
- VALUES (?, ?, ?, ?, ?, ?)`,[e.id,t.from,t.to,t.type,t.condition??null,s(t.dataMapping??null)]);for(let t of e.versionHistory)this.appendEventInternal(a,e.id,t);for(let t of e.runtimeEvents??[])this.appendEventInternal(a,e.id,t);t?.skipTaskBinding||a.query("UPDATE tasks SET graph_id = ? WHERE id = ?",[e.id,e.taskId]);let i=this.getGraphForTask(a,e.taskId);if(!i)throw new n(e.id);return i})()}finally{t?.skipTaskBinding&&r.pragma("foreign_keys = ON")}}getGraph(e){let t=this.getDb();return this.getGraphForTask(g(t),e)}updateNodeRuntime(e,t,r){let a=this.getDb(),o=g(a);return a.transaction(()=>{if(!o.query("SELECT id, graph_version FROM execution_graphs WHERE id = ?",[e]).rows[0])throw new n(e);let r=Object.keys(t);if(0===r.length){let t=o.query("SELECT graph_version, updated_at FROM execution_graphs WHERE id = ?",[e]);return{graphVersion:t.rows[0].graph_version,updatedAt:l(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),p=o.query(`SELECT node_id, type, status, config, output, metrics
15
- FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),c=new Map;for(let e of p.rows)c.set(e.node_id,e);let g=r.filter(e=>!c.has(e));if(g.length>0)throw new i(e,g);for(let a of r){let r=t[a],n=c.get(a);if(!n||!r)continue;let i={...u(d(n.config)),...u(r.configPatch)};void 0!==r.startedAt&&(i.startedAt=r.startedAt),void 0!==r.completedAt&&(i.completedAt=r.completedAt),void 0!==r.actualMinutes&&(i.actualMinutes=r.actualMinutes),o.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
16
- WHERE graph_id = ? AND node_id = ?`,[r.status??n.status,s(r.metrics??d(n.metrics)),s(r.output??d(n.output)),s(i),e,a])}let m=o.query("UPDATE execution_graphs SET updated_at = datetime('now') WHERE id = ? RETURNING graph_version, updated_at",[e]);return{graphVersion:m.rows[0].graph_version,updatedAt:l(m.rows[0].updated_at)}})()}updateGraphStructure(e,t,r){let a=this.getDb(),i=g(a);return a.transaction(()=>{let r=i.query("SELECT id, graph_version, mode, policy, done_criteria, schedule FROM execution_graphs WHERE id = ?",[e]).rows[0];if(!r)throw new n(e);if(t.nodes)for(let[r,a]of(i.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e]),Object.entries(t.nodes))){let t=p(a);i.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
17
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,s(t.config),s(t.output),s(t.metrics)])}if(t.edges)for(let r of(i.query("DELETE FROM graph_edges WHERE graph_id = ?",[e]),t.edges))i.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
18
- VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,s(r.dataMapping??null)]);let a=i.query(`UPDATE execution_graphs
12
+ updated_at = excluded.updated_at`,[e.id,e.taskId,e.graphVersion,e.mode,d(e.policy),d(e.doneCriteria),d(e.schedule??null),e.createdAt,e.updatedAt]),n.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e.id]),n.query("DELETE FROM graph_edges WHERE graph_id = ?",[e.id]),Object.entries(e.nodes))){let a=c(r);n.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
13
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,a.type,a.status,d(a.config),d(a.output),d(a.metrics)])}for(let t of e.edges)n.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
14
+ VALUES (?, ?, ?, ?, ?, ?)`,[e.id,t.from,t.to,t.type,t.condition??null,d(t.dataMapping??null)]);for(let t of e.versionHistory)this.appendEventInternal(n,e.id,t);for(let t of e.runtimeEvents??[])this.appendEventInternal(n,e.id,t);t?.skipTaskBinding||n.query("UPDATE tasks SET graph_id = ? WHERE id = ?",[e.id,e.taskId]);let a=this.getGraphForTask(n,e.taskId);if(!a)throw new i(e.id);return a})}finally{t?.skipTaskBinding&&(0,r.pragmaSet)(a,"foreign_keys = ON")}}getGraph(e){let t=this.getDb();return this.getGraphForTask(m(t),e)}updateNodeRuntime(e,t,a){let n=this.getDb(),s=m(n);return(0,r.transaction)(n,()=>{if(!s.query("SELECT id, graph_version FROM execution_graphs WHERE id = ?",[e]).rows[0])throw new i(e);let r=Object.keys(t);if(0===r.length){let t=s.query("SELECT graph_version, updated_at FROM execution_graphs WHERE id = ?",[e]);return{graphVersion:t.rows[0].graph_version,updatedAt:u(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),n=s.query(`SELECT node_id, type, status, config, output, metrics
15
+ FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),c=new Map;for(let e of n.rows)c.set(e.node_id,e);let g=r.filter(e=>!c.has(e));if(g.length>0)throw new o(e,g);for(let a of r){let r=t[a],n=c.get(a);if(!n||!r)continue;let i={...p(l(n.config)),...p(r.configPatch)};void 0!==r.startedAt&&(i.startedAt=r.startedAt),void 0!==r.completedAt&&(i.completedAt=r.completedAt),void 0!==r.actualMinutes&&(i.actualMinutes=r.actualMinutes),s.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
16
+ WHERE graph_id = ? AND node_id = ?`,[r.status??n.status,d(r.metrics??l(n.metrics)),d(r.output??l(n.output)),d(i),e,a])}let m=s.query("UPDATE execution_graphs SET updated_at = datetime('now') WHERE id = ? RETURNING graph_version, updated_at",[e]);return{graphVersion:m.rows[0].graph_version,updatedAt:u(m.rows[0].updated_at)}})}updateGraphStructure(e,t,a){let n=this.getDb(),o=m(n);return(0,r.transaction)(n,()=>{let r=o.query("SELECT id, graph_version, mode, policy, done_criteria, schedule FROM execution_graphs WHERE id = ?",[e]).rows[0];if(!r)throw new i(e);if(t.nodes)for(let[r,a]of(o.query("DELETE FROM graph_nodes WHERE graph_id = ?",[e]),Object.entries(t.nodes))){let t=c(a);o.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
17
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,d(t.config),d(t.output),d(t.metrics)])}if(t.edges)for(let r of(o.query("DELETE FROM graph_edges WHERE graph_id = ?",[e]),t.edges))o.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
18
+ VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,d(r.dataMapping??null)]);let a=o.query(`UPDATE execution_graphs
19
19
  SET mode = ?, policy = ?, done_criteria = ?, schedule = ?, updated_at = datetime('now')
20
20
  WHERE id = ?
21
- RETURNING graph_version, updated_at`,[t.mode??r.mode,s(t.policy??d(r.policy)??{}),s(t.doneCriteria??d(r.done_criteria)??{}),s(t.schedule??d(r.schedule)??null),e]);return{graphVersion:a.rows[0].graph_version,updatedAt:l(a.rows[0].updated_at)}})()}appendEvent(e,t){let r=this.getDb();this.appendEventInternal(g(r),e,t)}getGraphForTask(e,t){let a=e.query(`SELECT id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at
22
- FROM execution_graphs WHERE task_id = ? ORDER BY updated_at DESC LIMIT 1`,[t]).rows[0];if(!a)return null;let n=e.query(`SELECT node_id, type, status, config, output, metrics
23
- FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[a.id]),i=e.query(`SELECT from_id, to_id, type, condition, data_mapping
24
- FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[a.id]),o=e.query(`SELECT event_type, payload, timestamp
25
- FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[a.id]),s={};for(let e of n.rows)s[e.node_id]=function(e){let t={...u(d(e.config)),type:e.type,status:e.status},r=d(e.metrics);null!==r&&(t.metrics=r);let a=d(e.output);return null!==a&&(t.output=a),t}(e);let p=i.rows.map(e=>({from:e.from_id,to:e.to_id,type:e.type,...e.condition?{condition:d(e.condition)}:{},...e.data_mapping?{dataMapping:d(e.data_mapping)}:{}})),g=[],m=[];for(let e of o.rows){let t=c(e);r.has(t.eventType)?g.push(t):m.push(t)}return{id:a.id,taskId:a.task_id,graphVersion:a.graph_version,mode:a.mode,nodes:s,edges:p,policy:d(a.policy)??{},doneCriteria:d(a.done_criteria)??{},schedule:d(a.schedule)??void 0,versionHistory:g,runtimeEvents:m,createdAt:l(a.created_at),updatedAt:l(a.updated_at)}}appendEventInternal(e,t,r){e.query(`INSERT INTO graph_events (graph_id, event_type, payload, timestamp)
26
- VALUES (?, ?, ?, ?)`,[t,r.eventType,s(r),r.timestamp])}}function f(){return new m}let h=new m;function _(e,t){return h.createGraph(e,t)}function y(e){return h.getGraph(e)}function E(e,t,r){return h.updateNodeRuntime(e,t,r)}function w(e,t,r){return h.updateGraphStructure(e,t,r)}function v(e,t){return h.appendEvent(e,t)}function k(e,r={}){let a=["graph_id = ?"],n=[e];r.eventType&&(a.push("event_type = ?"),n.push(r.eventType)),r.since&&(a.push("timestamp >= ?"),n.push(r.since));let i=r.limit??1e3,o=`SELECT event_type, payload, timestamp
21
+ RETURNING graph_version, updated_at`,[t.mode??r.mode,d(t.policy??l(r.policy)??{}),d(t.doneCriteria??l(r.done_criteria)??{}),d(t.schedule??l(r.schedule)??null),e]);return{graphVersion:a.rows[0].graph_version,updatedAt:u(a.rows[0].updated_at)}})}appendEvent(e,t){let r=this.getDb();this.appendEventInternal(m(r),e,t)}getGraphForTask(e,t){let r=e.query(`SELECT id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at
22
+ FROM execution_graphs WHERE task_id = ? ORDER BY updated_at DESC LIMIT 1`,[t]).rows[0];if(!r)return null;let n=e.query(`SELECT node_id, type, status, config, output, metrics
23
+ FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[r.id]),i=e.query(`SELECT from_id, to_id, type, condition, data_mapping
24
+ FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[r.id]),o=e.query(`SELECT event_type, payload, timestamp
25
+ FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[r.id]),s={};for(let e of n.rows)s[e.node_id]=function(e){let t={...p(l(e.config)),type:e.type,status:e.status},r=l(e.metrics);null!==r&&(t.metrics=r);let a=l(e.output);return null!==a&&(t.output=a),t}(e);let d=i.rows.map(e=>({from:e.from_id,to:e.to_id,type:e.type,...e.condition?{condition:l(e.condition)}:{},...e.data_mapping?{dataMapping:l(e.data_mapping)}:{}})),c=[],m=[];for(let e of o.rows){let t=g(e);a.has(t.eventType)?c.push(t):m.push(t)}return{id:r.id,taskId:r.task_id,graphVersion:r.graph_version,mode:r.mode,nodes:s,edges:d,policy:l(r.policy)??{},doneCriteria:l(r.done_criteria)??{},schedule:l(r.schedule)??void 0,versionHistory:c,runtimeEvents:m,createdAt:u(r.created_at),updatedAt:u(r.updated_at)}}appendEventInternal(e,t,r){e.query(`INSERT INTO graph_events (graph_id, event_type, payload, timestamp)
26
+ VALUES (?, ?, ?, ?)`,[t,r.eventType,d(r),r.timestamp])}}function h(){return new f}let _=new f;function y(e,t){return _.createGraph(e,t)}function E(e){return _.getGraph(e)}function w(e,t,r){return _.updateNodeRuntime(e,t,r)}function v(e,t,r){return _.updateGraphStructure(e,t,r)}function k(e,t){return _.appendEvent(e,t)}function R(e,r={}){let a=["graph_id = ?"],n=[e];r.eventType&&(a.push("event_type = ?"),n.push(r.eventType)),r.since&&(a.push("timestamp >= ?"),n.push(r.since));let i=r.limit??1e3,o=`SELECT event_type, payload, timestamp
27
27
  FROM graph_events
28
28
  WHERE ${a.join(" AND ")}
29
29
  ORDER BY timestamp ASC, event_type ASC
30
- LIMIT ?`;return n.push(i),g((0,t.getSQLiteDb)()).query(o,n).rows.map(e=>c(e))}function R(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
30
+ LIMIT ?`;return n.push(i),m((0,t.getSQLiteDb)()).query(o,n).rows.map(e=>g(e))}function S(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
31
31
  FROM execution_graphs
32
32
  WHERE schedule IS NOT NULL
33
33
  AND json_extract(schedule, '$.rootMessageId') = ?
34
34
  AND json_extract(schedule, '$.state') = 'active'
35
35
  ORDER BY updated_at DESC
36
- LIMIT 1`).get(r)??null:null}function S(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
36
+ LIMIT 1`).get(r)??null:null}function A(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
37
37
  FROM execution_graphs
38
38
  WHERE schedule IS NOT NULL
39
- AND json_extract(schedule, '$.state') = 'active'`).all().map(e=>e.rootMessageId).filter(Boolean)}function A(e){let r=e.trim();return r?Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
39
+ AND json_extract(schedule, '$.state') = 'active'`).all().map(e=>e.rootMessageId).filter(Boolean)}function T(e){let r=e.trim();return r?Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
40
40
  SET schedule = json_set(schedule, '$.state', 'stopped', '$.tickInProgress', json('false')),
41
41
  updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
42
42
  WHERE schedule IS NOT NULL
43
43
  AND json_extract(schedule, '$.rootMessageId') = ?
44
- AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>i,"GraphNotFoundError",()=>n,"GraphStore",()=>m,"GraphTaskAlreadyBoundError",()=>o,"GraphVersionConflictError",()=>a,"appendEvent",()=>v,"createGraph",()=>_,"createGraphStore",()=>f,"deactivateSchedulesByRootMessageId",()=>A,"getActiveScheduleForRootMessageId",()=>R,"getActiveScheduleRootMessageIds",()=>S,"getGraph",()=>y,"getGraphEvents",()=>k,"updateGraphStructure",()=>w,"updateNodeRuntime",()=>E])},79042,e=>{"use strict";e.s(["DEFAULT_EXECUTION_POLICY",0,{replanBudgetRemaining:3,replanBudgetInitial:3,verifyBudgetRemaining:5,verifyBudgetInitial:5,maxConcurrentAutoChecks:1,immutableRequiredGates:!0,maxConcurrent:3,priorityMode:"fifo",nodeTimeoutMs:18e5,graphTimeoutMs:864e5},"FAILURE_NODE_STATUSES",0,["failed"],"INCOMPLETE_FOR_DONE_STATUSES",0,["pending","running","awaiting_human","blocked"],"SOFT_DEP_SATISFIED_STATUSES",0,["done","passed","failed","skipped","blocked"],"SUCCESS_NODE_STATUSES",0,["done","passed"],"TERMINAL_NODE_STATUSES",0,["done","passed","failed","skipped"]])},33938,e=>{"use strict";var t=e.i(60447),r=e.i(77581);function a(e,a){let n=(0,t.getSQLiteDb)(),i=a?.producer;if("system"===i){let t=(0,r.getKnowledgeNote)("repo",e);return t?[{id:t.id,repo_id:e,content:t.content,producer:"system",created_at:t.updatedAt}]:[]}let o=i?n.prepare(`SELECT id, repo_id, content, producer, created_at
44
+ AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>o,"GraphNotFoundError",()=>i,"GraphStore",()=>f,"GraphTaskAlreadyBoundError",()=>s,"GraphVersionConflictError",()=>n,"appendEvent",()=>k,"createGraph",()=>y,"createGraphStore",()=>h,"deactivateSchedulesByRootMessageId",()=>T,"getActiveScheduleForRootMessageId",()=>S,"getActiveScheduleRootMessageIds",()=>A,"getGraph",()=>E,"getGraphEvents",()=>R,"updateGraphStructure",()=>v,"updateNodeRuntime",()=>w])},79042,e=>{"use strict";e.s(["DEFAULT_EXECUTION_POLICY",0,{replanBudgetRemaining:3,replanBudgetInitial:3,verifyBudgetRemaining:5,verifyBudgetInitial:5,maxConcurrentAutoChecks:1,immutableRequiredGates:!0,maxConcurrent:3,priorityMode:"fifo",nodeTimeoutMs:18e5,graphTimeoutMs:864e5},"FAILURE_NODE_STATUSES",0,["failed"],"INCOMPLETE_FOR_DONE_STATUSES",0,["pending","running","awaiting_human","blocked"],"SOFT_DEP_SATISFIED_STATUSES",0,["done","passed","failed","skipped","blocked"],"SUCCESS_NODE_STATUSES",0,["done","passed"],"TERMINAL_NODE_STATUSES",0,["done","passed","failed","skipped"]])},33938,e=>{"use strict";var t=e.i(60447),r=e.i(59833),a=e.i(77581);function n(e,r){let n=(0,t.getSQLiteDb)(),i=r?.producer;if("system"===i){let t=(0,a.getKnowledgeNote)("repo",e);return t?[{id:t.id,repo_id:e,content:t.content,producer:"system",created_at:t.updatedAt}]:[]}let o=i?n.prepare(`SELECT id, repo_id, content, producer, created_at
45
45
  FROM repo_knowledge
46
46
  WHERE repo_id = ? AND producer = ?
47
47
  ORDER BY created_at DESC`).all(e,i):n.prepare(`SELECT id, repo_id, content, producer, created_at
48
48
  FROM repo_knowledge
49
49
  WHERE repo_id = ?
50
- ORDER BY created_at DESC`).all(e);if(a?.includeLegacyHumanFallback===!1)return o;let s=(0,t.getSQLiteDb)().prepare(`SELECT id, name, path, notes, created_at, updated_at
50
+ ORDER BY created_at DESC`).all(e);if(r?.includeLegacyHumanFallback===!1)return o;let s=(0,t.getSQLiteDb)().prepare(`SELECT id, name, path, notes, created_at, updated_at
51
51
  FROM project_repos
52
- WHERE id = ?`).get(e)??null,d=s?.notes?.trim();return!d||o.some(e=>"human"===e.producer)||o.some(e=>"human"===e.producer&&e.content.trim()===d)?o:[{id:`legacy-notes:${e}`,repo_id:e,content:d,producer:"human",created_at:s?.updated_at??s?.created_at??new Date(0).toISOString()},...o]}function n(e,r,n){let i=(0,t.getSQLiteDb)(),o=n.trim();return i.transaction(()=>{i.prepare("DELETE FROM repo_knowledge WHERE repo_id = ? AND producer = ?").run(e,r),o&&i.prepare("INSERT INTO repo_knowledge (repo_id, content, producer) VALUES (?, ?, ?)").run(e,o,r)})(),a(e,{producer:r,includeLegacyHumanFallback:!1})}function i(e){let t=[];for(let r of e){if(!r.id){let e=r.notes?.trim();e&&t.push({repoId:"",repoName:r.name,path:r.path??null,content:e,producer:"human"});continue}for(let e of[...a(r.id,{producer:"human"}),...a(r.id,{producer:"system",includeLegacyHumanFallback:!1})]){let a=e.content.trim();a&&t.push({repoId:r.id,repoName:r.name,path:r.path??null,content:a,producer:e.producer})}}return t}e.s(["listRepoKnowledge",()=>a,"listResolvedRepoKnowledge",()=>i,"replaceRepoKnowledge",()=>n])},42304,e=>{"use strict";var t=e.i(54799),r=e.i(14350),a=e.i(60447),n=e.i(40813),i=e.i(77581);let o=new Set(["outcome","decision","pattern","gotcha"]),s=`You are a memory extractor for a task execution system.
52
+ WHERE id = ?`).get(e)??null,d=s?.notes?.trim();return!d||o.some(e=>"human"===e.producer)||o.some(e=>"human"===e.producer&&e.content.trim()===d)?o:[{id:`legacy-notes:${e}`,repo_id:e,content:d,producer:"human",created_at:s?.updated_at??s?.created_at??new Date(0).toISOString()},...o]}function i(e,a,i){let o=(0,t.getSQLiteDb)(),s=i.trim();return(0,r.transaction)(o,()=>{o.prepare("DELETE FROM repo_knowledge WHERE repo_id = ? AND producer = ?").run(e,a),s&&o.prepare("INSERT INTO repo_knowledge (repo_id, content, producer) VALUES (?, ?, ?)").run(e,s,a)}),n(e,{producer:a,includeLegacyHumanFallback:!1})}function o(e){let t=[];for(let r of e){if(!r.id){let e=r.notes?.trim();e&&t.push({repoId:"",repoName:r.name,path:r.path??null,content:e,producer:"human"});continue}for(let e of[...n(r.id,{producer:"human"}),...n(r.id,{producer:"system",includeLegacyHumanFallback:!1})]){let a=e.content.trim();a&&t.push({repoId:r.id,repoName:r.name,path:r.path??null,content:a,producer:e.producer})}}return t}e.s(["listRepoKnowledge",()=>n,"listResolvedRepoKnowledge",()=>o,"replaceRepoKnowledge",()=>i])},42304,e=>{"use strict";var t=e.i(54799),r=e.i(14350),a=e.i(60447),n=e.i(40813),i=e.i(77581);let o=new Set(["outcome","decision","pattern","gotcha"]),s=`You are a memory extractor for a task execution system.
53
53
  Given a completed task, extract 0-3 memories worth remembering for future tasks.
54
54
 
55
55
  Each memory must be: