@mndrk/agx 2.0.26 → 2.0.32

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 (831) hide show
  1. package/README.md +4 -6
  2. package/cloud-runtime/standalone/.next/BUILD_ID +1 -1
  3. package/cloud-runtime/standalone/.next/app-path-routes-manifest.json +6 -0
  4. package/cloud-runtime/standalone/.next/build-manifest.json +4 -4
  5. package/cloud-runtime/standalone/.next/prerender-manifest.json +3 -3
  6. package/cloud-runtime/standalone/.next/required-server-files.json +4 -4
  7. package/cloud-runtime/standalone/.next/routes-manifest.json +45 -0
  8. package/cloud-runtime/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
  9. package/cloud-runtime/standalone/.next/server/app/_global-error.html +2 -2
  10. package/cloud-runtime/standalone/.next/server/app/_global-error.rsc +1 -1
  11. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/cloud-runtime/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
  17. package/cloud-runtime/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/cloud-runtime/standalone/.next/server/app/_not-found.html +2 -2
  19. package/cloud-runtime/standalone/.next/server/app/_not-found.rsc +2 -2
  20. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  21. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  22. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  23. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  24. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  25. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  26. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page/build-manifest.json +2 -2
  27. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page.js.nft.json +1 -1
  28. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  29. package/cloud-runtime/standalone/.next/server/app/agents/page/build-manifest.json +2 -2
  30. package/cloud-runtime/standalone/.next/server/app/agents/page.js.nft.json +1 -1
  31. package/cloud-runtime/standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  32. package/cloud-runtime/standalone/.next/server/app/agents.html +2 -2
  33. package/cloud-runtime/standalone/.next/server/app/agents.rsc +3 -3
  34. package/cloud-runtime/standalone/.next/server/app/agents.segments/_full.segment.rsc +3 -3
  35. package/cloud-runtime/standalone/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  36. package/cloud-runtime/standalone/.next/server/app/agents.segments/_index.segment.rsc +2 -2
  37. package/cloud-runtime/standalone/.next/server/app/agents.segments/_tree.segment.rsc +2 -2
  38. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +2 -2
  39. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents.segment.rsc +1 -1
  40. package/cloud-runtime/standalone/.next/server/app/api/agent-specs/route.js +2 -2
  41. package/cloud-runtime/standalone/.next/server/app/api/agent-specs/route.js.nft.json +1 -1
  42. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/profile/route.js +2 -2
  43. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/profile/route.js.nft.json +1 -1
  44. package/cloud-runtime/standalone/.next/server/app/api/agents/export/route.js +2 -2
  45. package/cloud-runtime/standalone/.next/server/app/api/agents/export/route.js.nft.json +1 -1
  46. package/cloud-runtime/standalone/.next/server/app/api/automations/create/route.js +4 -3
  47. package/cloud-runtime/standalone/.next/server/app/api/automations/create/route.js.nft.json +1 -1
  48. package/cloud-runtime/standalone/.next/server/app/api/automations/route.js +3 -3
  49. package/cloud-runtime/standalone/.next/server/app/api/automations/route.js.nft.json +1 -1
  50. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js +7 -4
  51. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
  52. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route/app-paths-manifest.json +3 -0
  53. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route/build-manifest.json +11 -0
  54. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route/server-reference-manifest.json +4 -0
  55. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route.js +8 -0
  56. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route.js.map +5 -0
  57. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route.js.nft.json +1 -0
  58. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route_client-reference-manifest.js +2 -0
  59. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route/app-paths-manifest.json +3 -0
  60. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route/build-manifest.json +11 -0
  61. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route/server-reference-manifest.json +4 -0
  62. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route.js +7 -0
  63. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route.js.map +5 -0
  64. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route.js.nft.json +1 -0
  65. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route_client-reference-manifest.js +2 -0
  66. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route/app-paths-manifest.json +3 -0
  67. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route/build-manifest.json +11 -0
  68. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route/server-reference-manifest.json +4 -0
  69. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route.js +8 -0
  70. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route.js.map +5 -0
  71. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route.js.nft.json +1 -0
  72. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route_client-reference-manifest.js +2 -0
  73. package/cloud-runtime/standalone/.next/server/app/api/file-search/route.js.nft.json +1 -1
  74. package/cloud-runtime/standalone/.next/server/app/api/graphs/[graphId]/nodes/[nodeId]/route.js +2 -2
  75. package/cloud-runtime/standalone/.next/server/app/api/graphs/[graphId]/nodes/[nodeId]/route.js.nft.json +1 -1
  76. package/cloud-runtime/standalone/.next/server/app/api/health/route.js +5 -4
  77. package/cloud-runtime/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
  78. package/cloud-runtime/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  79. package/cloud-runtime/standalone/.next/server/app/api/history/status/route.js.nft.json +1 -1
  80. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js +5 -4
  81. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js.nft.json +1 -1
  82. package/cloud-runtime/standalone/.next/server/app/api/logs/route.js.nft.json +1 -1
  83. package/cloud-runtime/standalone/.next/server/app/api/logs/stream/route.js +2 -2
  84. package/cloud-runtime/standalone/.next/server/app/api/logs/stream/route.js.nft.json +1 -1
  85. package/cloud-runtime/standalone/.next/server/app/api/memories/route.js +2 -2
  86. package/cloud-runtime/standalone/.next/server/app/api/memories/route.js.nft.json +1 -1
  87. package/cloud-runtime/standalone/.next/server/app/api/messages/[id]/route.js.nft.json +1 -1
  88. package/cloud-runtime/standalone/.next/server/app/api/migrate/teams-to-projects/route.js +2 -2
  89. package/cloud-runtime/standalone/.next/server/app/api/migrate/teams-to-projects/route.js.nft.json +1 -1
  90. package/cloud-runtime/standalone/.next/server/app/api/migrate/workspaces-to-projects/route.js +2 -2
  91. package/cloud-runtime/standalone/.next/server/app/api/migrate/workspaces-to-projects/route.js.nft.json +1 -1
  92. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route.js +3 -3
  93. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route.js.nft.json +1 -1
  94. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route.js +3 -3
  95. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route.js.nft.json +1 -1
  96. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js +5 -4
  97. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js.nft.json +1 -1
  98. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js +4 -3
  99. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js.nft.json +1 -1
  100. package/cloud-runtime/standalone/.next/server/app/api/participants/route.js +3 -3
  101. package/cloud-runtime/standalone/.next/server/app/api/participants/route.js.nft.json +1 -1
  102. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js +3 -3
  103. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js.nft.json +1 -1
  104. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route.js +4 -4
  105. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route.js.nft.json +1 -1
  106. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js +4 -4
  107. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js.nft.json +1 -1
  108. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js +4 -4
  109. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js.nft.json +1 -1
  110. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js +4 -3
  111. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  112. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js +3 -3
  113. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js.nft.json +1 -1
  114. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js +3 -3
  115. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js.nft.json +1 -1
  116. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js +3 -3
  117. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js.nft.json +1 -1
  118. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js +4 -3
  119. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  120. package/cloud-runtime/standalone/.next/server/app/api/providers/route.js +1 -1
  121. package/cloud-runtime/standalone/.next/server/app/api/providers/route.js.nft.json +1 -1
  122. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js +3 -3
  123. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js.nft.json +1 -1
  124. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js +5 -4
  125. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js.nft.json +1 -1
  126. package/cloud-runtime/standalone/.next/server/app/api/reactions/route.js.nft.json +1 -1
  127. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route.js +3 -3
  128. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route.js.nft.json +1 -1
  129. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js +5 -4
  130. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js.nft.json +1 -1
  131. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js +4 -3
  132. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js.nft.json +1 -1
  133. package/cloud-runtime/standalone/.next/server/app/api/schedules/route.js +4 -3
  134. package/cloud-runtime/standalone/.next/server/app/api/schedules/route.js.nft.json +1 -1
  135. package/cloud-runtime/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  136. package/cloud-runtime/standalone/.next/server/app/api/status/route.js +1 -1
  137. package/cloud-runtime/standalone/.next/server/app/api/status/route.js.nft.json +1 -1
  138. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js +3 -3
  139. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js.nft.json +1 -1
  140. package/cloud-runtime/standalone/.next/server/app/api/system/db-status/route.js.nft.json +1 -1
  141. package/cloud-runtime/standalone/.next/server/app/api/task-drafts/route.js.nft.json +1 -1
  142. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js +6 -5
  143. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js.nft.json +1 -1
  144. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js +6 -5
  145. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js.nft.json +1 -1
  146. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js +5 -4
  147. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js.nft.json +1 -1
  148. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js +4 -3
  149. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js.nft.json +1 -1
  150. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js +4 -4
  151. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js.nft.json +1 -1
  152. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js +5 -5
  153. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js.nft.json +1 -1
  154. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js +5 -5
  155. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js.nft.json +1 -1
  156. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/pause/route.js +2 -2
  157. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/pause/route.js.nft.json +1 -1
  158. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js +5 -5
  159. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js.nft.json +1 -1
  160. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js +4 -3
  161. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js.nft.json +1 -1
  162. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js +4 -3
  163. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js.nft.json +1 -1
  164. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js +4 -4
  165. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js.nft.json +1 -1
  166. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js +5 -5
  167. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js.nft.json +1 -1
  168. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js +6 -5
  169. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js.nft.json +1 -1
  170. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js +4 -3
  171. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js.nft.json +1 -1
  172. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js +2 -2
  173. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js.nft.json +1 -1
  174. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/heartbeat/route.js +2 -2
  175. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/heartbeat/route.js.nft.json +1 -1
  176. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js +5 -4
  177. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js.nft.json +1 -1
  178. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js +4 -3
  179. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js.nft.json +1 -1
  180. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/stream/route.js +2 -2
  181. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/stream/route.js.nft.json +1 -1
  182. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js +3 -3
  183. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js.nft.json +1 -1
  184. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js +7 -6
  185. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js.nft.json +1 -1
  186. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js +7 -6
  187. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js.nft.json +1 -1
  188. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js +6 -5
  189. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js.nft.json +1 -1
  190. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js +6 -5
  191. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js.nft.json +1 -1
  192. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js +7 -6
  193. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js.nft.json +1 -1
  194. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js +8 -6
  195. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js.nft.json +1 -1
  196. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js +4 -3
  197. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
  198. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js +5 -4
  199. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js.nft.json +1 -1
  200. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js +3 -3
  201. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js.nft.json +1 -1
  202. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js +5 -4
  203. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js.nft.json +1 -1
  204. package/cloud-runtime/standalone/.next/server/app/api/tasks/stream/route.js +2 -2
  205. package/cloud-runtime/standalone/.next/server/app/api/tasks/stream/route.js.nft.json +1 -1
  206. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route/app-paths-manifest.json +3 -0
  207. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route/build-manifest.json +11 -0
  208. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route/server-reference-manifest.json +4 -0
  209. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js +10 -0
  210. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js.map +5 -0
  211. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js.nft.json +1 -0
  212. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route_client-reference-manifest.js +2 -0
  213. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js +5 -2
  214. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js.nft.json +1 -1
  215. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js +5 -4
  216. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js.nft.json +1 -1
  217. package/cloud-runtime/standalone/.next/server/app/automations/page/build-manifest.json +2 -2
  218. package/cloud-runtime/standalone/.next/server/app/automations/page.js.nft.json +1 -1
  219. package/cloud-runtime/standalone/.next/server/app/automations/page_client-reference-manifest.js +1 -1
  220. package/cloud-runtime/standalone/.next/server/app/automations.html +2 -2
  221. package/cloud-runtime/standalone/.next/server/app/automations.rsc +3 -3
  222. package/cloud-runtime/standalone/.next/server/app/automations.segments/_full.segment.rsc +3 -3
  223. package/cloud-runtime/standalone/.next/server/app/automations.segments/_head.segment.rsc +1 -1
  224. package/cloud-runtime/standalone/.next/server/app/automations.segments/_index.segment.rsc +2 -2
  225. package/cloud-runtime/standalone/.next/server/app/automations.segments/_tree.segment.rsc +2 -2
  226. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations/__PAGE__.segment.rsc +2 -2
  227. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations.segment.rsc +1 -1
  228. package/cloud-runtime/standalone/.next/server/app/board/page/build-manifest.json +2 -2
  229. package/cloud-runtime/standalone/.next/server/app/board/page_client-reference-manifest.js +1 -1
  230. package/cloud-runtime/standalone/.next/server/app/board.html +2 -2
  231. package/cloud-runtime/standalone/.next/server/app/board.rsc +2 -2
  232. package/cloud-runtime/standalone/.next/server/app/board.segments/_full.segment.rsc +2 -2
  233. package/cloud-runtime/standalone/.next/server/app/board.segments/_head.segment.rsc +1 -1
  234. package/cloud-runtime/standalone/.next/server/app/board.segments/_index.segment.rsc +2 -2
  235. package/cloud-runtime/standalone/.next/server/app/board.segments/_tree.segment.rsc +2 -2
  236. package/cloud-runtime/standalone/.next/server/app/board.segments/board/__PAGE__.segment.rsc +1 -1
  237. package/cloud-runtime/standalone/.next/server/app/board.segments/board.segment.rsc +1 -1
  238. package/cloud-runtime/standalone/.next/server/app/execution-graph/page/build-manifest.json +2 -2
  239. package/cloud-runtime/standalone/.next/server/app/execution-graph/page.js.nft.json +1 -1
  240. package/cloud-runtime/standalone/.next/server/app/execution-graph/page_client-reference-manifest.js +1 -1
  241. package/cloud-runtime/standalone/.next/server/app/execution-graph.html +2 -2
  242. package/cloud-runtime/standalone/.next/server/app/execution-graph.rsc +3 -3
  243. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_full.segment.rsc +3 -3
  244. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_head.segment.rsc +1 -1
  245. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_index.segment.rsc +2 -2
  246. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_tree.segment.rsc +2 -2
  247. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph/__PAGE__.segment.rsc +2 -2
  248. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph.segment.rsc +1 -1
  249. package/cloud-runtime/standalone/.next/server/app/index.html +2 -2
  250. package/cloud-runtime/standalone/.next/server/app/index.rsc +3 -3
  251. package/cloud-runtime/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  252. package/cloud-runtime/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
  253. package/cloud-runtime/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  254. package/cloud-runtime/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
  255. package/cloud-runtime/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  256. package/cloud-runtime/standalone/.next/server/app/page/build-manifest.json +2 -2
  257. package/cloud-runtime/standalone/.next/server/app/page.js.nft.json +1 -1
  258. package/cloud-runtime/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  259. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page/build-manifest.json +2 -2
  260. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page.js.nft.json +1 -1
  261. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page_client-reference-manifest.js +1 -1
  262. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page/app-paths-manifest.json +3 -0
  263. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page/build-manifest.json +18 -0
  264. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page/next-font-manifest.json +11 -0
  265. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page/react-loadable-manifest.json +1 -0
  266. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page/server-reference-manifest.json +4 -0
  267. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page.js +16 -0
  268. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page.js.map +5 -0
  269. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page.js.nft.json +1 -0
  270. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page_client-reference-manifest.js +2 -0
  271. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page/build-manifest.json +2 -2
  272. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  273. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  274. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page/app-paths-manifest.json +3 -0
  275. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page/build-manifest.json +18 -0
  276. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page/next-font-manifest.json +11 -0
  277. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page/react-loadable-manifest.json +1 -0
  278. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page/server-reference-manifest.json +4 -0
  279. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page.js +16 -0
  280. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page.js.map +5 -0
  281. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page.js.nft.json +1 -0
  282. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page_client-reference-manifest.js +2 -0
  283. package/cloud-runtime/standalone/.next/server/app/projects/orphans/page/build-manifest.json +2 -2
  284. package/cloud-runtime/standalone/.next/server/app/projects/orphans/page.js.nft.json +1 -1
  285. package/cloud-runtime/standalone/.next/server/app/projects/orphans/page_client-reference-manifest.js +1 -1
  286. package/cloud-runtime/standalone/.next/server/app/projects/orphans.html +2 -2
  287. package/cloud-runtime/standalone/.next/server/app/projects/orphans.rsc +3 -3
  288. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_full.segment.rsc +3 -3
  289. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_head.segment.rsc +1 -1
  290. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_index.segment.rsc +2 -2
  291. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_tree.segment.rsc +2 -2
  292. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans/__PAGE__.segment.rsc +2 -2
  293. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans.segment.rsc +1 -1
  294. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects.segment.rsc +1 -1
  295. package/cloud-runtime/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
  296. package/cloud-runtime/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  297. package/cloud-runtime/standalone/.next/server/app/projects.html +2 -2
  298. package/cloud-runtime/standalone/.next/server/app/projects.rsc +3 -3
  299. package/cloud-runtime/standalone/.next/server/app/projects.segments/_full.segment.rsc +3 -3
  300. package/cloud-runtime/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
  301. package/cloud-runtime/standalone/.next/server/app/projects.segments/_index.segment.rsc +2 -2
  302. package/cloud-runtime/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
  303. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +2 -2
  304. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects.segment.rsc +1 -1
  305. package/cloud-runtime/standalone/.next/server/app/settings/page/build-manifest.json +2 -2
  306. package/cloud-runtime/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  307. package/cloud-runtime/standalone/.next/server/app/settings.html +2 -2
  308. package/cloud-runtime/standalone/.next/server/app/settings.rsc +2 -2
  309. package/cloud-runtime/standalone/.next/server/app/settings.segments/_full.segment.rsc +2 -2
  310. package/cloud-runtime/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  311. package/cloud-runtime/standalone/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  312. package/cloud-runtime/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  313. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  314. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  315. package/cloud-runtime/standalone/.next/server/app/status/page/build-manifest.json +2 -2
  316. package/cloud-runtime/standalone/.next/server/app/status/page.js.nft.json +1 -1
  317. package/cloud-runtime/standalone/.next/server/app/status/page_client-reference-manifest.js +1 -1
  318. package/cloud-runtime/standalone/.next/server/app/status.html +2 -2
  319. package/cloud-runtime/standalone/.next/server/app/status.rsc +3 -3
  320. package/cloud-runtime/standalone/.next/server/app/status.segments/_full.segment.rsc +3 -3
  321. package/cloud-runtime/standalone/.next/server/app/status.segments/_head.segment.rsc +1 -1
  322. package/cloud-runtime/standalone/.next/server/app/status.segments/_index.segment.rsc +2 -2
  323. package/cloud-runtime/standalone/.next/server/app/status.segments/_tree.segment.rsc +2 -2
  324. package/cloud-runtime/standalone/.next/server/app/status.segments/status/__PAGE__.segment.rsc +2 -2
  325. package/cloud-runtime/standalone/.next/server/app/status.segments/status.segment.rsc +1 -1
  326. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page/build-manifest.json +2 -2
  327. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page.js.nft.json +1 -1
  328. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page_client-reference-manifest.js +1 -1
  329. package/cloud-runtime/standalone/.next/server/app/welcome/page/build-manifest.json +2 -2
  330. package/cloud-runtime/standalone/.next/server/app/welcome/page.js.nft.json +1 -1
  331. package/cloud-runtime/standalone/.next/server/app/welcome/page_client-reference-manifest.js +1 -1
  332. package/cloud-runtime/standalone/.next/server/app/welcome.html +2 -2
  333. package/cloud-runtime/standalone/.next/server/app/welcome.rsc +3 -3
  334. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_full.segment.rsc +3 -3
  335. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_head.segment.rsc +1 -1
  336. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_index.segment.rsc +2 -2
  337. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_tree.segment.rsc +2 -2
  338. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome/__PAGE__.segment.rsc +2 -2
  339. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome.segment.rsc +1 -1
  340. package/cloud-runtime/standalone/.next/server/app-paths-manifest.json +6 -0
  341. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__017f03c3._.js +13 -0
  342. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0925dd01._.js +46 -0
  343. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__10940c29._.js +3 -0
  344. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__12afd8a3._.js +3 -0
  345. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__12c7e188._.js +29 -0
  346. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__16dd1fd7._.js +13 -0
  347. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__17c2d68f._.js +52 -0
  348. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1dd062c1._.js +1 -1
  349. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__20b3baea._.js +55 -0
  350. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2388b2b3._.js +3 -0
  351. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__241a8bcf._.js +1 -1
  352. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__254e942f._.js +20 -0
  353. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__29ce9c60._.js +3 -0
  354. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2e596cc8._.js +4 -4
  355. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3198c5c8._.js +2 -2
  356. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__36d9edbd._.js +14 -14
  357. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__399b2ca9._.js +3 -0
  358. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4761dc17._.js +8 -0
  359. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4b1a512c._.js +52 -0
  360. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4c50f159._.js +4 -4
  361. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4c8624cc._.js +3 -0
  362. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4d318eb0._.js +146 -0
  363. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__507a4363._.js +4 -0
  364. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__50ddd3ce._.js +3 -0
  365. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__543ba6c4._.js +5 -1
  366. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__59b5d4e5._.js +1 -1
  367. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5ca87ba0._.js +3 -0
  368. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5d359afa._.js +46 -0
  369. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__666f8712._.js +3 -0
  370. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6c187704._.js +3 -0
  371. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6c26221d._.js +7 -0
  372. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6e59b27c._.js +3 -0
  373. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__74b97f0a._.js +1 -1
  374. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__75bff965._.js +46 -0
  375. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7be8f159._.js +8 -8
  376. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__80655727._.js +3 -0
  377. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__86f7d27b._.js +3 -0
  378. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__94fa1edc._.js +46 -0
  379. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__98535eb3._.js +3 -0
  380. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9dfaaf72._.js +52 -0
  381. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a189593a._.js +3 -0
  382. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ac3c2f7f._.js +52 -0
  383. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b40c7aab._.js +1 -1
  384. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b4d05543._.js +1 -1
  385. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__bfcedb7c._.js +52 -0
  386. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c08bef05._.js +3 -0
  387. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c5634f17._.js +112 -0
  388. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c5b8ceb7._.js +3 -0
  389. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ccfcbcd5._.js +42 -0
  390. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ceb02db8._.js +3 -0
  391. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__da20a0aa._.js +1 -1
  392. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__dede3dcd._.js +75 -0
  393. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e122cae2._.js +3 -0
  394. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e1e7dd1e._.js +25 -0
  395. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e446cb39._.js +3 -0
  396. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e6ad07c3._.js +1 -1
  397. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f4b70b67._.js +46 -0
  398. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f5a2358a._.js +7 -0
  399. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f5b93200._.js +3 -0
  400. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fa0ebee3._.js +13 -0
  401. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fcd3e3b8._.js +15 -0
  402. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fce2cdce._.js +3 -0
  403. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ff9c61da._.js +3 -0
  404. package/cloud-runtime/standalone/.next/server/chunks/_05fa3b89._.js +46 -0
  405. package/cloud-runtime/standalone/.next/server/chunks/_0a767dfe._.js +3 -0
  406. package/cloud-runtime/standalone/.next/server/chunks/_2f3e5ac1._.js +6 -0
  407. package/cloud-runtime/standalone/.next/server/chunks/_3e0d34cc._.js +97 -0
  408. package/cloud-runtime/standalone/.next/server/chunks/_4190f170._.js +46 -0
  409. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__a104cda8._.js → _42e9c8d5._.js} +7 -7
  410. package/cloud-runtime/standalone/.next/server/chunks/_5ca51127._.js +54 -0
  411. package/cloud-runtime/standalone/.next/server/chunks/_66e1ddec._.js +57 -0
  412. package/cloud-runtime/standalone/.next/server/chunks/_6bb93816._.js +6 -0
  413. package/cloud-runtime/standalone/.next/server/chunks/_7011db4f._.js +3 -0
  414. package/cloud-runtime/standalone/.next/server/chunks/_8b9fde82._.js +97 -0
  415. package/cloud-runtime/standalone/.next/server/chunks/_95ac98db._.js +49 -0
  416. package/cloud-runtime/standalone/.next/server/chunks/_994414cd._.js +54 -0
  417. package/cloud-runtime/standalone/.next/server/chunks/_99b78daf._.js +46 -0
  418. package/cloud-runtime/standalone/.next/server/chunks/_a877d34f._.js +6 -0
  419. package/cloud-runtime/standalone/.next/server/chunks/_affbdbb0._.js +46 -0
  420. package/cloud-runtime/standalone/.next/server/chunks/_c31ca6ab._.js +3 -0
  421. package/cloud-runtime/standalone/.next/server/chunks/_d225c04f._.js +1 -1
  422. package/cloud-runtime/standalone/.next/server/chunks/_ee99a36b._.js +6 -0
  423. package/cloud-runtime/standalone/.next/server/chunks/_efc73784._.js +46 -0
  424. package/cloud-runtime/standalone/.next/server/chunks/_fba13a4a._.js +6 -0
  425. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_chat-runs_[id]_route_actions_033ac330.js +3 -0
  426. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_chat-runs_[id]_signal_route_actions_4b56f1cd.js +3 -0
  427. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_chat-runs_route_actions_0c8cd01c.js +3 -0
  428. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_threads_knowledge_route_actions_c139bcf7.js +3 -0
  429. package/cloud-runtime/standalone/.next/server/chunks/lib_09aac4e7._.js +57 -0
  430. package/cloud-runtime/standalone/.next/server/chunks/lib_cli-runner_ts_dfcf3fda._.js +18 -0
  431. package/cloud-runtime/standalone/.next/server/chunks/lib_db_ts_e06c6085._.js +1 -1
  432. package/cloud-runtime/standalone/.next/server/chunks/lib_ea45fe73._.js +68 -23
  433. package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_2e721df2._.js +74 -30
  434. package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_74d1c060._.js +70 -31
  435. package/cloud-runtime/standalone/.next/server/chunks/lib_sqlite-query-adapter_ts_3ea4d849._.js +87 -17
  436. package/cloud-runtime/standalone/.next/server/chunks/lib_sqlite-query-adapter_ts_b0b1a9b2._.js +294 -0
  437. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0f808fa3.js +3 -0
  438. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_2bdede98.js +3 -0
  439. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_371d0bff.js +50 -43
  440. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_3d31fed0.js +3 -0
  441. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_57a073eb.js +3 -0
  442. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_69b6b2e1.js +3 -0
  443. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_7f8022ab.js +3 -0
  444. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_84e28f38.js +3 -0
  445. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_8ec90680.js +3 -0
  446. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_a590fcd6.js +3 -0
  447. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_cc6c687d.js +3 -0
  448. package/cloud-runtime/standalone/.next/server/chunks/src_graph_14067235._.js +46 -0
  449. package/cloud-runtime/standalone/.next/server/chunks/src_graph_api-route-utils_ts_b7225a0e._.js +1 -1
  450. package/cloud-runtime/standalone/.next/server/chunks/src_graph_b63e2d39._.js +46 -0
  451. package/cloud-runtime/standalone/.next/server/chunks/src_graph_executor_ts_55c06268._.js +3 -3
  452. package/cloud-runtime/standalone/.next/server/chunks/src_graph_executor_ts_a8bc8d58._.js +1 -1
  453. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__1322ced8._.js +3 -0
  454. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__47caef59._.js +1 -1
  455. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__6e83bf83._.js +3 -0
  456. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__783669c3._.js +3 -0
  457. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__8973b16a._.js +3 -0
  458. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__9166c1d6._.js +3 -0
  459. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__a0a1cb74._.js +3 -0
  460. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__a8a8afdc._.js +3 -0
  461. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__fca7df40._.js +3 -0
  462. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_27f9c020._.js → _0061ebd8._.js} +2 -2
  463. package/cloud-runtime/standalone/.next/server/chunks/ssr/_064370bc._.js +3 -0
  464. package/cloud-runtime/standalone/.next/server/chunks/ssr/_0f4e70b1._.js +3 -0
  465. package/cloud-runtime/standalone/.next/server/chunks/ssr/_16c45024._.js +3 -0
  466. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_27cb3359._.js → _5b2b8a85._.js} +2 -2
  467. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_a696e9b3._.js → _68ac991e._.js} +2 -2
  468. package/cloud-runtime/standalone/.next/server/chunks/ssr/_6de3f1de._.js +3 -0
  469. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_c838f593._.js → _6fc3736e._.js} +2 -2
  470. package/cloud-runtime/standalone/.next/server/chunks/ssr/_85ca101b._.js +8 -0
  471. package/cloud-runtime/standalone/.next/server/chunks/ssr/_a0cc0fe7._.js +3 -0
  472. package/cloud-runtime/standalone/.next/server/chunks/ssr/_a10eb951._.js +4 -0
  473. package/cloud-runtime/standalone/.next/server/chunks/ssr/_cb4d8a23._.js +4 -0
  474. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_6a367524._.js → _ccb409c5._.js} +2 -2
  475. package/cloud-runtime/standalone/.next/server/chunks/ssr/_cd5e154b._.js +1 -1
  476. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_d021529a._.js → _fb292eed._.js} +2 -2
  477. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_4b5d7c9b._.js → _ff5799d6._.js} +2 -2
  478. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_projects_[slug]_knowledge_page_actions_1037c40a.js +3 -0
  479. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_execution-graph_page_tsx_f854185a._.js +2 -2
  480. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_projects_[slug]_graph_[taskId]_page_tsx_d8b1d582._.js +1 -1
  481. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_projects_[slug]_knowledge_page_tsx_e2a55cbd._.js +3 -0
  482. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_welcome_page_tsx_6c79bc59._.js +3 -0
  483. package/cloud-runtime/standalone/.next/server/chunks/ssr/ce889_server_app_projects_[slug]_thread_[threadId]_page_actions_660a8857.js +3 -0
  484. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_chat-ui_bfeda794._.js +5 -5
  485. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_thread_WorkspaceSidebar_tsx_e660301b._.js +1 -1
  486. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_e70f9321._.js +3 -0
  487. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_678fa868._.js +3 -0
  488. package/cloud-runtime/standalone/.next/server/functions-config-manifest.json +4 -0
  489. package/cloud-runtime/standalone/.next/server/middleware-build-manifest.js +2 -2
  490. package/cloud-runtime/standalone/.next/server/middleware-manifest.json +5 -5
  491. package/cloud-runtime/standalone/.next/server/next-font-manifest.js +1 -1
  492. package/cloud-runtime/standalone/.next/server/next-font-manifest.json +8 -0
  493. package/cloud-runtime/standalone/.next/server/pages/404.html +2 -2
  494. package/cloud-runtime/standalone/.next/server/pages/500.html +2 -2
  495. package/cloud-runtime/standalone/.next/server/server-reference-manifest.js +1 -1
  496. package/cloud-runtime/standalone/.next/server/server-reference-manifest.json +1 -1
  497. package/cloud-runtime/standalone/.next/static/chunks/{b5bd2eb6e0c7f71a.js → 010aff7b601302de.js} +3 -3
  498. package/cloud-runtime/standalone/.next/static/chunks/0c467f54bc78a380.js +1 -0
  499. package/cloud-runtime/standalone/.next/static/chunks/1f415d0ce7ebbd08.js +8 -0
  500. package/cloud-runtime/standalone/.next/static/chunks/24a6ee21f430da93.js +1 -0
  501. package/cloud-runtime/standalone/.next/static/chunks/27129bea5b512ce8.js +1 -0
  502. package/cloud-runtime/standalone/.next/static/chunks/{e44264686aa5ecbf.js → 4200b512bdc226bc.js} +1 -1
  503. package/cloud-runtime/standalone/.next/static/chunks/463edf3533d27a56.js +1 -0
  504. package/cloud-runtime/standalone/.next/static/chunks/486bf7ff282b91a6.js +5 -0
  505. package/cloud-runtime/standalone/.next/static/chunks/{616d66dbec9e4b8b.js → 58025a80caa3629d.js} +1 -1
  506. package/cloud-runtime/standalone/.next/static/chunks/5cb0c885b085ea6c.js +1 -0
  507. package/cloud-runtime/standalone/.next/static/chunks/60c054bb8b2cffa6.css +1 -0
  508. package/cloud-runtime/standalone/.next/static/chunks/{45b4d0ee5c92d45b.js → 6fbe08eab578c7d3.js} +1 -1
  509. package/cloud-runtime/standalone/.next/static/chunks/7e2edf97bd6c0874.js +1 -0
  510. package/cloud-runtime/standalone/.next/static/chunks/8249f202d33d0d95.js +1 -0
  511. package/cloud-runtime/standalone/.next/static/chunks/{b4e298542d366e31.js → 87f099ea02aa419d.js} +1 -1
  512. package/cloud-runtime/standalone/.next/static/chunks/8d15ced2dc70090a.js +1 -0
  513. package/cloud-runtime/standalone/.next/static/chunks/9f8f719c4aa25e3d.js +1 -0
  514. package/cloud-runtime/standalone/.next/static/chunks/a66e1891e808a664.js +1 -0
  515. package/cloud-runtime/standalone/.next/static/chunks/{3344004561eabdf8.js → bc3cad3c821b169b.js} +1 -1
  516. package/cloud-runtime/standalone/.next/static/chunks/bc727d3d9993e9be.js +1 -0
  517. package/cloud-runtime/standalone/.next/static/chunks/cd308f61797939cd.js +6 -0
  518. package/cloud-runtime/standalone/.next/static/chunks/d5d6be8239e57c56.js +1 -0
  519. package/cloud-runtime/standalone/.next/static/chunks/{ee5f1457fbc593e1.js → dfff51033c303fc7.js} +1 -1
  520. package/cloud-runtime/standalone/.next/static/chunks/e62d5fa120fdf21f.js +1 -0
  521. package/cloud-runtime/standalone/.next/static/chunks/{turbopack-5b5918f610666d2d.js → turbopack-97e846241a3a64af.js} +1 -1
  522. package/cloud-runtime/standalone/README.md +3 -3
  523. package/cloud-runtime/standalone/app/api/chat/route.ts +38 -28
  524. package/cloud-runtime/standalone/app/api/chat-runs/[id]/route.ts +19 -0
  525. package/cloud-runtime/standalone/app/api/chat-runs/[id]/signal/route.ts +32 -0
  526. package/cloud-runtime/standalone/app/api/chat-runs/route.ts +37 -0
  527. package/cloud-runtime/standalone/app/api/history/route.ts +6 -0
  528. package/cloud-runtime/standalone/app/api/projects/[id]/memory/route.ts +17 -0
  529. package/cloud-runtime/standalone/app/api/providers/route.ts +9 -13
  530. package/cloud-runtime/standalone/app/api/schedules/debug/route.ts +23 -3
  531. package/cloud-runtime/standalone/app/api/schedules/poll/route.ts +5 -3
  532. package/cloud-runtime/standalone/app/api/schedules/route.ts +12 -17
  533. package/cloud-runtime/standalone/app/api/status/route.ts +6 -5
  534. package/cloud-runtime/standalone/app/api/threads/knowledge/route.ts +91 -0
  535. package/cloud-runtime/standalone/app/api/threads/route.ts +18 -1
  536. package/cloud-runtime/standalone/app/globals.css +1 -4
  537. package/cloud-runtime/standalone/app/projects/[slug]/graph/[taskId]/page.tsx +0 -21
  538. package/cloud-runtime/standalone/app/projects/[slug]/knowledge/page.tsx +608 -0
  539. package/cloud-runtime/standalone/app/projects/[slug]/layout.tsx +18 -2
  540. package/cloud-runtime/standalone/app/projects/[slug]/page.tsx +1 -455
  541. package/cloud-runtime/standalone/app/projects/[slug]/thread/[threadId]/page.tsx +14 -0
  542. package/cloud-runtime/standalone/app/welcome/page.tsx +329 -107
  543. package/cloud-runtime/standalone/components/ActionToolbar.tsx +3 -3
  544. package/cloud-runtime/standalone/components/ConfirmDialog.tsx +133 -0
  545. package/cloud-runtime/standalone/components/IconButton.tsx +3 -3
  546. package/cloud-runtime/standalone/components/ProjectModal.tsx +2 -2
  547. package/cloud-runtime/standalone/components/chat-ui/ChatContainer.tsx +415 -76
  548. package/cloud-runtime/standalone/components/chat-ui/Composer.tsx +149 -97
  549. package/cloud-runtime/standalone/components/chat-ui/ThreadView.tsx +73 -34
  550. package/cloud-runtime/standalone/components/thread/WorkspaceSidebar.tsx +51 -23
  551. package/cloud-runtime/standalone/hooks/useComposerHistory.ts +130 -0
  552. package/cloud-runtime/standalone/hooks/useGroupChat.ts +24 -1
  553. package/cloud-runtime/standalone/hooks/useProcessPolling.ts +69 -6
  554. package/cloud-runtime/standalone/lib/history-store.ts +532 -38
  555. package/cloud-runtime/standalone/lib/knowledge-notes.ts +251 -0
  556. package/cloud-runtime/standalone/lib/knowledge-store.ts +233 -0
  557. package/cloud-runtime/standalone/lib/memory-extractor.ts +76 -60
  558. package/cloud-runtime/standalone/lib/mesh-core/journal.ts +30 -0
  559. package/cloud-runtime/standalone/lib/mesh-core/self.ts +94 -0
  560. package/cloud-runtime/standalone/lib/orchestrator/chat-activities.ts +60 -0
  561. package/cloud-runtime/standalone/lib/orchestrator/chat-processor.ts +168 -0
  562. package/cloud-runtime/standalone/lib/orchestrator/chat-types.ts +29 -0
  563. package/cloud-runtime/standalone/lib/orchestrator/runtime.ts +20 -0
  564. package/cloud-runtime/standalone/lib/provider-clis.ts +63 -0
  565. package/cloud-runtime/standalone/lib/queue/boss.ts +2 -1
  566. package/cloud-runtime/standalone/lib/repo-knowledge.ts +19 -2
  567. package/cloud-runtime/standalone/lib/sqlite-query-adapter.ts +78 -0
  568. package/cloud-runtime/standalone/lib/stream-multiplexer.ts +101 -14
  569. package/cloud-runtime/standalone/lib/task-context.ts +7 -4
  570. package/cloud-runtime/standalone/lib/thread-knowledge-runs.ts +227 -0
  571. package/cloud-runtime/standalone/lib/thread-knowledge.ts +419 -0
  572. package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/README.md +2 -2
  573. package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/glib-2.0/include/glibconfig.h +9 -8
  574. package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib → sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3} +0 -0
  575. package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/package.json +11 -5
  576. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +46 -0
  577. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  578. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
  579. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  580. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
  581. package/cloud-runtime/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  582. package/cloud-runtime/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  583. package/cloud-runtime/standalone/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/package.json +13 -7
  584. package/cloud-runtime/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  585. package/cloud-runtime/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
  586. package/cloud-runtime/standalone/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  587. package/cloud-runtime/standalone/node_modules/better-sqlite3-90e2652d1716b047/build/Release/better_sqlite3.node +0 -0
  588. package/cloud-runtime/standalone/package-lock.json +13 -0
  589. package/cloud-runtime/standalone/package.json +1 -0
  590. package/cloud-runtime/standalone/server.js +1 -1
  591. package/cloud-runtime/standalone/src/graph/api-schemas.ts +2 -2
  592. package/cloud-runtime/standalone/src/graph/executor.ts +9 -7
  593. package/cloud-runtime/standalone/src/graph/function-executor.ts +4 -1
  594. package/cloud-runtime/standalone/src/graph/internal-function-dispatcher.ts +174 -0
  595. package/cloud-runtime/standalone/src/graph/types.ts +3 -3
  596. package/cloud-runtime/standalone/src/graph/work-dispatcher.ts +5 -1
  597. package/cloud-runtime/standalone/tsconfig.json +3 -1
  598. package/cloud-runtime/standalone/worker/index.js +2930 -137
  599. package/cloud-runtime/standalone/worker/index.ts +8 -1
  600. package/package.json +1 -1
  601. package/cloud-runtime/standalone/.next/server/chunks/[externals]_child_process_964038fc._.js +0 -3
  602. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__03a1bf91._.js +0 -6
  603. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__065c5114._.js +0 -3
  604. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__07dce481._.js +0 -3
  605. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__09f46c85._.js +0 -46
  606. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__149bcf6d._.js +0 -115
  607. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__14bad16e._.js +0 -3
  608. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__14e3bf74._.js +0 -3
  609. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1632828c._.js +0 -46
  610. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__24b8ccd3._.js +0 -52
  611. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__284e1cbe._.js +0 -3
  612. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__28d6e806._.js +0 -3
  613. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2bcb75a7._.js +0 -3
  614. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__32e5f341._.js +0 -4
  615. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3b4a126a._.js +0 -46
  616. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3c7464e8._.js +0 -46
  617. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3d82dc78._.js +0 -46
  618. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__406bdd54._.js +0 -46
  619. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__40d6458a._.js +0 -3
  620. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__47ca4946._.js +0 -3
  621. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__49fb4a12._.js +0 -3
  622. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5327e395._.js +0 -46
  623. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__55d75c3a._.js +0 -7
  624. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__592e81f9._.js +0 -13
  625. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5a6a194c._.js +0 -52
  626. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5af16b4f._.js +0 -3
  627. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__60ba5058._.js +0 -3
  628. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6716441c._.js +0 -3
  629. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__673aedc6._.js +0 -3
  630. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6a44c891._.js +0 -3
  631. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6b680112._.js +0 -55
  632. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7312fad4._.js +0 -46
  633. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7456196c._.js +0 -52
  634. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__74d26856._.js +0 -3
  635. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__772c6fae._.js +0 -3
  636. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__787ba54b._.js +0 -3
  637. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__79157eef._.js +0 -3
  638. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__82d76712._.js +0 -3
  639. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8311f060._.js +0 -6
  640. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__84e90655._.js +0 -46
  641. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__90a887dc._.js +0 -3
  642. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9345d703._.js +0 -3
  643. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__98294450._.js +0 -3
  644. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__985f0d9f._.js +0 -51
  645. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9b32295e._.js +0 -3
  646. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a64d978e._.js +0 -6
  647. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__babcd1af._.js +0 -13
  648. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c16f03fb._.js +0 -13
  649. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c2767ca5._.js +0 -3
  650. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c72c6d4a._.js +0 -25
  651. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ca851b15._.js +0 -3
  652. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d25227df._.js +0 -29
  653. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e06820c3._.js +0 -6
  654. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e429a0bc._.js +0 -3
  655. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e4397d43._.js +0 -7
  656. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ec8735f4._.js +0 -3
  657. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ef09ab99._.js +0 -13
  658. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f366a937._.js +0 -46
  659. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fdaa8a27._.js +0 -3
  660. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fddde532._.js +0 -3
  661. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ff53f445._.js +0 -3
  662. package/cloud-runtime/standalone/.next/server/chunks/_1111d342._.js +0 -101
  663. package/cloud-runtime/standalone/.next/server/chunks/_4b60ba15._.js +0 -49
  664. package/cloud-runtime/standalone/.next/server/chunks/_54252651._.js +0 -49
  665. package/cloud-runtime/standalone/.next/server/chunks/_818a89c4._.js +0 -46
  666. package/cloud-runtime/standalone/.next/server/chunks/_a4a21d4f._.js +0 -3
  667. package/cloud-runtime/standalone/.next/server/chunks/_a759d52b._.js +0 -3
  668. package/cloud-runtime/standalone/.next/server/chunks/_e6b28eae._.js +0 -46
  669. package/cloud-runtime/standalone/.next/server/chunks/_e868e7c1._.js +0 -46
  670. package/cloud-runtime/standalone/.next/server/chunks/lib_23509137._.js +0 -196
  671. package/cloud-runtime/standalone/.next/server/chunks/lib_3273d5f9._.js +0 -196
  672. package/cloud-runtime/standalone/.next/server/chunks/lib_50ba0b4c._.js +0 -63
  673. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_33963d95.js +0 -3
  674. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_56c5acb3.js +0 -3
  675. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_888b3578.js +0 -3
  676. package/cloud-runtime/standalone/.next/server/chunks/src_graph_e3bb4da8._.js +0 -46
  677. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__113d6767._.js +0 -3
  678. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__6a9d3855._.js +0 -3
  679. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__942ca438._.js +0 -3
  680. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__ce3b51aa._.js +0 -3
  681. package/cloud-runtime/standalone/.next/server/chunks/ssr/_1ec61dee._.js +0 -3
  682. package/cloud-runtime/standalone/.next/server/chunks/ssr/_27904584._.js +0 -3
  683. package/cloud-runtime/standalone/.next/server/chunks/ssr/_43472af3._.js +0 -3
  684. package/cloud-runtime/standalone/.next/server/chunks/ssr/_94effa0f._.js +0 -3
  685. package/cloud-runtime/standalone/.next/server/chunks/ssr/_d458d1eb._.js +0 -3
  686. package/cloud-runtime/standalone/.next/server/chunks/ssr/_fbced30b._.js +0 -3
  687. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_projects_[slug]_page_tsx_e0fabf6e._.js +0 -8
  688. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_a8f86889._.js +0 -3
  689. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_play_6595a532.js +0 -3
  690. package/cloud-runtime/standalone/.next/static/chunks/1184bf1bfdf97666.js +0 -1
  691. package/cloud-runtime/standalone/.next/static/chunks/4c01a5f19f9e775e.js +0 -8
  692. package/cloud-runtime/standalone/.next/static/chunks/5ace4b4f4475962a.js +0 -1
  693. package/cloud-runtime/standalone/.next/static/chunks/6509f7fecbf44493.js +0 -1
  694. package/cloud-runtime/standalone/.next/static/chunks/661090206d8bae9b.css +0 -1
  695. package/cloud-runtime/standalone/.next/static/chunks/6dbf5940e30fa9c7.js +0 -1
  696. package/cloud-runtime/standalone/.next/static/chunks/7e91f395ace1dd2c.js +0 -1
  697. package/cloud-runtime/standalone/.next/static/chunks/7f13efe9329d3f97.js +0 -1
  698. package/cloud-runtime/standalone/.next/static/chunks/80219bbddcf65109.js +0 -1
  699. package/cloud-runtime/standalone/.next/static/chunks/86ace6febb11ad71.js +0 -1
  700. package/cloud-runtime/standalone/.next/static/chunks/b079c677d9b39f98.js +0 -5
  701. package/cloud-runtime/standalone/.next/static/chunks/b88352740262931f.js +0 -6
  702. package/cloud-runtime/standalone/.next/static/chunks/c5609fd2abb65850.js +0 -1
  703. package/cloud-runtime/standalone/.next/static/chunks/d95cd010361834be.js +0 -1
  704. package/cloud-runtime/standalone/.next/static/chunks/f7bbf5cfcfed8ba9.js +0 -1
  705. package/cloud-runtime/standalone/coverage/clover.xml +0 -1208
  706. package/cloud-runtime/standalone/coverage/coverage-final.json +0 -29
  707. package/cloud-runtime/standalone/coverage/lcov-report/app/api/audit/index.html +0 -116
  708. package/cloud-runtime/standalone/coverage/lcov-report/app/api/audit/route.ts.html +0 -208
  709. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/[...nextauth]/index.html +0 -116
  710. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/[...nextauth]/route.ts.html +0 -166
  711. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/daemon-secret/index.html +0 -116
  712. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/daemon-secret/route.ts.html +0 -532
  713. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/status/index.html +0 -116
  714. package/cloud-runtime/standalone/coverage/lcov-report/app/api/auth/status/route.ts.html +0 -178
  715. package/cloud-runtime/standalone/coverage/lcov-report/app/api/learnings/index.html +0 -116
  716. package/cloud-runtime/standalone/coverage/lcov-report/app/api/learnings/route.ts.html +0 -262
  717. package/cloud-runtime/standalone/coverage/lcov-report/app/api/logs/stream/index.html +0 -116
  718. package/cloud-runtime/standalone/coverage/lcov-report/app/api/logs/stream/route.ts.html +0 -448
  719. package/cloud-runtime/standalone/coverage/lcov-report/app/api/queue/complete/index.html +0 -116
  720. package/cloud-runtime/standalone/coverage/lcov-report/app/api/queue/complete/route.ts.html +0 -331
  721. package/cloud-runtime/standalone/coverage/lcov-report/app/api/queue/index.html +0 -116
  722. package/cloud-runtime/standalone/coverage/lcov-report/app/api/queue/route.ts.html +0 -505
  723. package/cloud-runtime/standalone/coverage/lcov-report/app/api/stage-prompts/index.html +0 -116
  724. package/cloud-runtime/standalone/coverage/lcov-report/app/api/stage-prompts/route.ts.html +0 -412
  725. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/advance/index.html +0 -116
  726. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/advance/route.ts.html +0 -304
  727. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/index.html +0 -116
  728. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/logs/index.html +0 -116
  729. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/logs/route.ts.html +0 -202
  730. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/[id]/route.ts.html +0 -373
  731. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/index.html +0 -116
  732. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/route.ts.html +0 -499
  733. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/stream/index.html +0 -116
  734. package/cloud-runtime/standalone/coverage/lcov-report/app/api/tasks/stream/route.ts.html +0 -349
  735. package/cloud-runtime/standalone/coverage/lcov-report/base.css +0 -224
  736. package/cloud-runtime/standalone/coverage/lcov-report/block-navigation.js +0 -87
  737. package/cloud-runtime/standalone/coverage/lcov-report/components/AuthProvider.tsx.html +0 -259
  738. package/cloud-runtime/standalone/coverage/lcov-report/components/ChatInterface.tsx.html +0 -1228
  739. package/cloud-runtime/standalone/coverage/lcov-report/components/KanbanBoard.tsx.html +0 -1024
  740. package/cloud-runtime/standalone/coverage/lcov-report/components/Layout.tsx.html +0 -211
  741. package/cloud-runtime/standalone/coverage/lcov-report/components/LearningsPanel.tsx.html +0 -535
  742. package/cloud-runtime/standalone/coverage/lcov-report/components/LogTimeline.tsx.html +0 -415
  743. package/cloud-runtime/standalone/coverage/lcov-report/components/SortableTaskCard.tsx.html +0 -358
  744. package/cloud-runtime/standalone/coverage/lcov-report/components/StagePills.tsx.html +0 -439
  745. package/cloud-runtime/standalone/coverage/lcov-report/components/TaskCard.tsx.html +0 -514
  746. package/cloud-runtime/standalone/coverage/lcov-report/components/TaskCardOverlay.tsx.html +0 -256
  747. package/cloud-runtime/standalone/coverage/lcov-report/components/TaskDetail.tsx.html +0 -622
  748. package/cloud-runtime/standalone/coverage/lcov-report/components/TaskList.tsx.html +0 -253
  749. package/cloud-runtime/standalone/coverage/lcov-report/components/index.html +0 -281
  750. package/cloud-runtime/standalone/coverage/lcov-report/favicon.png +0 -0
  751. package/cloud-runtime/standalone/coverage/lcov-report/hooks/index.html +0 -116
  752. package/cloud-runtime/standalone/coverage/lcov-report/hooks/useTasks.ts.html +0 -1042
  753. package/cloud-runtime/standalone/coverage/lcov-report/index.html +0 -341
  754. package/cloud-runtime/standalone/coverage/lcov-report/lib/auth-client.ts.html +0 -202
  755. package/cloud-runtime/standalone/coverage/lcov-report/lib/auth-server.ts.html +0 -172
  756. package/cloud-runtime/standalone/coverage/lcov-report/lib/auth.ts.html +0 -265
  757. package/cloud-runtime/standalone/coverage/lcov-report/lib/db.ts.html +0 -1252
  758. package/cloud-runtime/standalone/coverage/lcov-report/lib/index.html +0 -131
  759. package/cloud-runtime/standalone/coverage/lcov-report/lib/orchestrator.ts.html +0 -409
  760. package/cloud-runtime/standalone/coverage/lcov-report/lib/security.ts.html +0 -1165
  761. package/cloud-runtime/standalone/coverage/lcov-report/lib/supabase-server.ts.html +0 -175
  762. package/cloud-runtime/standalone/coverage/lcov-report/lib/supabase.ts.html +0 -157
  763. package/cloud-runtime/standalone/coverage/lcov-report/prettify.css +0 -1
  764. package/cloud-runtime/standalone/coverage/lcov-report/prettify.js +0 -2
  765. package/cloud-runtime/standalone/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  766. package/cloud-runtime/standalone/coverage/lcov-report/sorter.js +0 -210
  767. package/cloud-runtime/standalone/coverage/lcov.info +0 -2386
  768. package/cloud-runtime/standalone/docs/LIMITS.md +0 -63
  769. package/cloud-runtime/standalone/docs/architecture/ADR-001-hybrid-to-full-sqlite.md +0 -345
  770. package/cloud-runtime/standalone/docs/baseline/baseline-report.json +0 -1009
  771. package/cloud-runtime/standalone/docs/baseline/critical-queries.md +0 -105
  772. package/cloud-runtime/standalone/docs/baseline/lock-metrics.json +0 -21
  773. package/cloud-runtime/standalone/docs/baseline/read-latency.json +0 -146
  774. package/cloud-runtime/standalone/docs/baseline/restore-time.json +0 -10
  775. package/cloud-runtime/standalone/docs/baseline/write-metrics.json +0 -803
  776. package/cloud-runtime/standalone/docs/decisions/sqlite-migration-adr.md +0 -327
  777. package/cloud-runtime/standalone/docs/error-code-mapping.md +0 -74
  778. package/cloud-runtime/standalone/docs/migration-plan.md +0 -120
  779. package/cloud-runtime/standalone/docs/migration-spec.md +0 -345
  780. package/cloud-runtime/standalone/docs/pg-sqlite-compatibility-matrix.md +0 -554
  781. package/cloud-runtime/standalone/docs/project-agent-migration-status.md +0 -229
  782. package/cloud-runtime/standalone/docs/runbook-shadow-read.md +0 -66
  783. package/cloud-runtime/standalone/docs/runbook.md +0 -155
  784. package/cloud-runtime/standalone/docs/specs/cli-postgres-removal.md +0 -69
  785. package/cloud-runtime/standalone/docs/specs/thread-mentions.md +0 -53
  786. package/cloud-runtime/standalone/docs/ux/GlobalChatFlow.storyboard +0 -23
  787. package/cloud-runtime/standalone/docs/ux/assistant-chat-cli.md +0 -32
  788. package/cloud-runtime/standalone/mcp/dist/constants.js +0 -66
  789. package/cloud-runtime/standalone/mcp/dist/db.js +0 -220
  790. package/cloud-runtime/standalone/mcp/dist/index.js +0 -7
  791. package/cloud-runtime/standalone/mcp/dist/security.js +0 -18
  792. package/cloud-runtime/standalone/mcp/dist/server.js +0 -240
  793. package/cloud-runtime/standalone/mcp/dist/task-context.js +0 -287
  794. package/cloud-runtime/standalone/mcp/dist/test-client.js +0 -82
  795. package/cloud-runtime/standalone/mcp/dist/tools/audit.js +0 -69
  796. package/cloud-runtime/standalone/mcp/dist/tools/learnings.js +0 -88
  797. package/cloud-runtime/standalone/mcp/dist/tools/queue.js +0 -312
  798. package/cloud-runtime/standalone/mcp/dist/tools/tasks.js +0 -244
  799. package/cloud-runtime/standalone/mcp/dist/types.js +0 -74
  800. package/cloud-runtime/standalone/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  801. package/cloud-runtime/standalone/notes/comments-context-demo.md +0 -141
  802. package/cloud-runtime/standalone/notes/comments-context-plan.md +0 -119
  803. package/cloud-runtime/standalone/notes/context-audit.md +0 -21
  804. package/cloud-runtime/standalone/notes/project-layer-plan.md +0 -30
  805. package/cloud-runtime/standalone/notes/project-layer.md +0 -123
  806. package/cloud-runtime/standalone/notes/temporal-migration-design.md +0 -199
  807. package/cloud-runtime/standalone/playwright-report/data/00d55996f37c1506b90144c85493dd85032c13e5.png +0 -0
  808. package/cloud-runtime/standalone/playwright-report/data/0b9d409e57237ae111d7ba258d3dfe64dc368456.png +0 -0
  809. package/cloud-runtime/standalone/playwright-report/data/b33d5e80a15bd1deda4415b9d318ef73f581c950.png +0 -0
  810. package/cloud-runtime/standalone/playwright-report/data/b55684161aa440d0614595e13c91338f0420abbb.md +0 -131
  811. package/cloud-runtime/standalone/playwright-report/data/b9913957ae07e7565c38ddd71215be79b1ceb017.png +0 -0
  812. package/cloud-runtime/standalone/playwright-report/data/c3538be8ebbebc9fe4a7df8f12f04483af4a0d91.png +0 -0
  813. package/cloud-runtime/standalone/playwright-report/data/fe638f64ff5e36f1c30325564565662d3f57da87.md +0 -180
  814. package/cloud-runtime/standalone/playwright-report/index.html +0 -85
  815. package/cloud-runtime/standalone/test-results/auth-Authentication-Flow-S-aff25-sion-across-page-navigation-chromium/test-failed-1.png +0 -0
  816. package/cloud-runtime/standalone/test-results/comments-Task-comments-add-4dc59-nd-persists-it-for-the-task-chromium/error-context.md +0 -131
  817. package/cloud-runtime/standalone/test-results/comments-Task-comments-add-4dc59-nd-persists-it-for-the-task-chromium/test-failed-1.png +0 -0
  818. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Stage--4082a-er-planning-after-ideation--chromium/error-context.md +0 -180
  819. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Stage--4082a-er-planning-after-ideation--chromium/test-failed-1.png +0 -0
  820. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Stage-Columns-displays-all-9-SDLC-stages-chromium/error-context.md +0 -180
  821. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Stage-Columns-displays-all-9-SDLC-stages-chromium/test-failed-1.png +0 -0
  822. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Task-D-b6d98-ys-tasks-in-correct-columns-chromium/error-context.md +0 -180
  823. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Task-D-b6d98-ys-tasks-in-correct-columns-chromium/test-failed-1.png +0 -0
  824. package/cloud-runtime/standalone/test-results/kanban-Kanban-Board-Task-Display-shows-task-count-per-column-chromium/test-failed-1.png +0 -0
  825. package/cloud-runtime/standalone/test-results/kanban-Task-Lifecycle-can-advance-task-through-all-stages-chromium/test-failed-1.png +0 -0
  826. package/cloud-runtime/standalone/tsconfig.tsbuildinfo +0 -1
  827. /package/cloud-runtime/standalone/.next/static/{AB08MY3MKLsqeJYL8OZ2g → i_9nSHyb52FGkCbRgv7EJ}/_buildManifest.js +0 -0
  828. /package/cloud-runtime/standalone/.next/static/{AB08MY3MKLsqeJYL8OZ2g → i_9nSHyb52FGkCbRgv7EJ}/_clientMiddlewareManifest.json +0 -0
  829. /package/cloud-runtime/standalone/.next/static/{AB08MY3MKLsqeJYL8OZ2g → i_9nSHyb52FGkCbRgv7EJ}/_ssgManifest.js +0 -0
  830. /package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/index.js +0 -0
  831. /package/cloud-runtime/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/versions.json +0 -0
@@ -1,101 +0,0 @@
1
- module.exports=[12616,e=>{"use strict";function t(e,t){return`---
2
- ${Object.entries(e).map(([e,t])=>`${e}: ${null==t?"":String(t)}`).join("\n")}
3
- ---
4
- ${t}`}e.s(["buildMarkdownWithFrontmatter",()=>t])},14350,e=>{"use strict";var t=e.i(33405);let r=e=>"string"==typeof e&&e.trim().length>0,a=e=>({push:e,flush:()=>{}}),n=e=>{let t="",a=0,n=!1,o=t=>{let o=t.trim();if(o)try{let t=JSON.parse(o);n=!0;let i=(e=>{if(!e||"object"!=typeof e)return"";if("assistant"===e.type)return(Array.isArray(e?.message?.content)?e.message.content:[]).flatMap(e=>e?.type==="text"&&r(e.text)?[e.text]:[]).join("");let t=e?.event;return"stream_event"===e.type&&t?.type==="content_block_delta"&&t?.delta?.type==="text_delta"&&r(t?.delta?.text)?t.delta.text:""})(t);if(!i||t?.type==="assistant"&&a>0)return;a+=i.length,e(i)}catch{n||e(`${t}
5
- `)}};return{push:e=>{for(t+=e;;){let e=t.indexOf("\n");if(-1===e)break;o(t.slice(0,e)),t=t.slice(e+1)}},flush:()=>{t.trim()&&o(t),t=""}}},o=e=>{let t="",a=!1,n="",o=t=>{let o=t.trim();if(o)try{let t=JSON.parse(o);a=!0,t?.type==="message"&&t?.role==="assistant"&&r(t?.content)&&((t,r)=>{if(t){if(r){if(n&&t.startsWith(n)){let r=t.slice(n.length);r&&e(r),n=t;return}e(t),n+=t;return}if(n&&t.startsWith(n)){let r=t.slice(n.length);r&&e(r),n=t;return}n||(e(t),n=t)}})(t.content,t?.delta===!0)}catch{a||e(`${t}
6
- `)}};return{push:e=>{for(t+=e;;){let e=t.indexOf("\n");if(-1===e)break;o(t.slice(0,e)),t=t.slice(e+1)}},flush:()=>{t.trim()&&o(t),t=""}}},i=e=>{let t="",a=!1,n=new Set,o=t=>{let o=t.trim();if(o)try{let t=JSON.parse(o);if(a=!0,t?.type==="item.completed"&&r(t?.item?.id)){if(n.has(t.item.id))return;n.add(t.item.id)}let i=t&&"object"==typeof t?"item.completed"===t.type&&t.item?.type==="agent_message"&&r(t.item?.text)?t.item.text:"item.delta"===t.type&&t.item?.type==="agent_message"&&r(t.delta?.text)?t.delta.text:"":"";i&&e(i)}catch{a||e(`${t}
7
- `)}};return{push:e=>{for(t+=e;;){let e=t.indexOf("\n");if(-1===e)break;o(t.slice(0,e)),t=t.slice(e+1)}},flush:()=>{t.trim()&&o(t),t=""}}},s=e=>{let t="",r=!1,a=[/^Thinking\.\.\./,/^<think>/i],n=[/\.\.\.done thinking\.?\s*/,/<\/think>/i];return{push:o=>{t+=o,(()=>{for(;t.length>0;){if(r){let e=-1,a=0;for(let r of n){let n=t.match(r);n&&void 0!==n.index&&(n.index,n[0].length,(-1===e||n.index<e)&&(e=n.index,a=n[0].length))}if(-1!==e){t=t.slice(e+a),r=!1,t=t.replace(/^\s*\n*/,"");continue}return}for(let n of a){let a=t.match(n);if(a&&void 0!==a.index){let n=t.slice(0,a.index);n&&e.push(n),t=t.slice(a.index+a[0].length),r=!0;break}}if(r)continue;let o=Math.max(0,t.length-30);o>0&&(e.push(t.slice(0,o)),t=t.slice(o));return}})()},flush:()=>{!r&&t&&e.push(t),t="",e.flush()}}};async function d({command:e,args:r,timeoutMs:a,signal:n,onDelta:o,onLog:i,onSpawn:s,env:d}){await new Promise((u,l)=>{i&&i("stderr",`$ ${e} ${r.map(e=>e.length>80?e.slice(0,80)+"…":e).join(" ")}
8
- `);let c=(0,t.spawn)(e,r,{stdio:["ignore","pipe","pipe"],env:{...process.env,CLAUDECODE:void 0,...d}}),p=!1,h="",g=!1,f=e=>{p||(p=!0,clearTimeout(E),n&&n.removeEventListener("abort",m),e?l(e):u())},m=()=>{c.kill("SIGTERM"),f(Error("Chat request aborted."))};n&&n.addEventListener("abort",m,{once:!0}),s&&c.pid&&s(c.pid);let E=setTimeout(()=>{g=!0,c.kill("SIGKILL"),f(Error(`CLI request timed out after ${a}ms.`))},a);c.stdout.on("data",e=>{let t=e.toString();h+=t,o(t),i&&i("stdout",t)}),c.stderr.on("data",e=>{let t=e.toString();h+=t,i&&i("stderr",t)}),c.on("error",e=>f(e)),c.on("close",(e,t)=>{if(!p&&!g){if(0===e)return void f();f(Error(`CLI command failed (exit=${e??"unknown"} signal=${t??"none"}).${h.trim()?` ${h.trim()}`:""}`))}})})}async function u({provider:e,model:r,prompt:u,identity:l,self:c,skills:p,systemContext:h,signal:g,onDelta:f,onLog:m,onSpawn:E}){let y,S,_,w,I=(y=!1,S=!1,_="",w=/^(?:```|~~~|#{1,6}\s|>\s|[-*+]\s|\d+\.\s)/,e=>{let t=e.replace(/\u001B\[[0-9;]*[A-Za-z]/g,"").replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/[ \t]+\n/g,"\n").replace(/\n{3,}/g,"\n\n");if(!t.trim())return t.includes("\n")&&!y?(y=!0,"\n"):"";let r=y?t.replace(/^\n+/,"\n"):t,a=r.trimStart(),n=w.test(a),o=S&&n&&!y,i=S&&!y&&!o&&!/^\s/.test(r)&&/[.!?)]/.test(_)&&/^[A-Z0-9`(]/.test(r),s=o?`
9
-
10
- ${r}`:i?`
11
- ${r}`:r;y=s.endsWith("\n"),S=S||s.trim().length>0;let d=s.replace(/\s+$/g,"");return d.length>0&&(_=d[d.length-1]??_),s}),v=e=>{let t=I(e);t&&f(t)},R=[],k=[];h&&k.push(h),l&&k.push(`<identity>
12
- ${l}
13
- </identity>`),c&&k.push(`<self>
14
- ${c}
15
- </self>`),p&&k.push(`<skills>
16
- ${p}
17
- </skills>`);let T=k.length>0?k.join("\n\n"):void 0;if((e=>{try{return 0===(0,t.spawnSync)("bash",["-lc","command -v agx >/dev/null 2>&1"],{encoding:"utf8"}).status}catch{return!1}})(0)){let t=T?`${T}
18
-
19
- ${u}`:u;R.push(function({provider:e,model:t,prompt:r}){let a=[e,"-y","--print","--prompt",r];return t&&a.push("--model",t),{command:"agx",args:a,parser:"raw"}}({provider:e,model:r,prompt:t}))}if(0===R.length)throw Error(`No CLI runner available for provider "${e}". Install agx or provider CLI.`);let x=null;for(let e of R){let t="claude-stream-json"===e.parser?n(v):"codex-json"===e.parser?i(v):"gemini-stream-json"===e.parser?o(v):a(v),r=e.filterThoughts?s(t):t;try{await d({command:e.command,args:e.args,timeoutMs:6e5,signal:g,onDelta:r.push,onLog:m,onSpawn:E,env:e.env}),r.flush();return}catch(e){x=e instanceof Error?e:Error(String(e))}}throw x||Error("CLI execution failed.")}e.s(["runCliResponse",()=>u],14350)},42304,e=>{"use strict";var t=e.i(54799),r=e.i(14350),a=e.i(60447);let n=new Set(["outcome","decision","pattern","gotcha"]),o=`You are a memory extractor for a task execution system.
20
- Given a completed task, extract 0-3 memories worth remembering for future tasks.
21
-
22
- Each memory must be:
23
- { "memory_type": "outcome" | "decision" | "pattern" | "gotcha", "content": "one concise sentence" }
24
-
25
- - outcome: what happened (success/failure result)
26
- - decision: a choice that was made and why
27
- - pattern: a reusable approach or technique discovered
28
- - gotcha: a surprising pitfall or edge case encountered
29
-
30
- Return ONLY a JSON array. Return [] if nothing worth remembering.
31
- Do not wrap in markdown code blocks. Just raw JSON.`,i=`You are a project knowledge extractor for a task execution system.
32
- Given a completed or failed task, extract 0-2 concise project-scoped knowledge entries worth keeping.
33
-
34
- Each entry must be:
35
- { "content": "one concise sentence" }
36
-
37
- Only include information that is likely useful across future work in the same project:
38
- - workflows, conventions, recurring constraints
39
- - stable gotchas or environment realities
40
- - reusable project-specific practices
41
-
42
- Do not include:
43
- - repo-specific durable truths that belong in repo knowledge
44
- - one-off task status updates
45
- - vague summaries
46
-
47
- Return ONLY a JSON array. Return [] if nothing project-scoped is worth keeping.
48
- Do not wrap in markdown code blocks. Just raw JSON.`;async function s(e){let t=[`Goal: ${e.goal}`,`Status: ${e.status}`,e.nodeOutputs?`Node outputs: ${JSON.stringify(e.nodeOutputs).slice(0,2e3)}`:null].filter(Boolean).join("\n"),a=`${o}
49
-
50
- Task:
51
- ${t}`,i="";try{await (0,r.runCliResponse)({provider:"claude",model:"claude-haiku-4-5-20251001",prompt:a,onDelta:e=>{i+=e}})}catch(e){return console.warn("[memory-extractor] LLM call failed:",e),[]}var s=i;let d=s.trim().replace(/^```(?:json)?\s*/i,"").replace(/\s*```\s*$/,"").trim();try{let e=JSON.parse(d);if(!Array.isArray(e))return[];return e.filter(e=>"object"==typeof e&&null!==e&&n.has(e.memory_type)&&"string"==typeof e.content&&e.content.trim().length>0).slice(0,3)}catch{return console.warn("[memory-extractor] Failed to parse LLM response:",d.slice(0,200)),[]}}let d=new Set(["outcome","decision","pattern","gotcha"]),u=["agent_id","agentId","agent","participant_id","participantId","assigned_agent","assignedAgent"];function l(e){return"string"!=typeof e?null:e.trim()||null}function c(e){let t=l(e.explicitAgentId);if(t)return t;let r=e.frontmatter||{};for(let e of u){let t=l(r[e]);if(t)return t}return l(e.defaultUserId)||"system"}async function p(e,r,n){let o=(0,a.getSQLiteDb)().prepare(`INSERT OR IGNORE INTO agent_memory (id, agent_id, task_id, memory_type, content, content_hash, created_at)
52
- VALUES (?, ?, ?, ?, ?, ?, ?)`),i=0,s=Date.now();for(let a of n){if(!d.has(a.memory_type)||!a.content?.trim())continue;let n=(0,t.createHash)("sha256").update(a.content.trim()).digest("hex");o.run((0,t.randomUUID)(),r,e,a.memory_type,a.content.trim(),n,s).changes>0&&i++}return i}async function h(e,t,r){let a=await s(r);if(0===a.length)return;let n=await p(e,t,a);n>0&&console.log(`[memory-extractor] Stored ${n} memories for task ${e}`)}async function g(e){let t=l(e);if(!t)return null;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))return t;let r=(0,a.getSQLiteDb)().prepare("SELECT id FROM projects WHERE slug = ? LIMIT 1").get(t);return r?.id??null}async function f(e){let t=[`Goal: ${e.goal}`,`Status: ${e.status}`,e.nodeOutputs?`Node outputs: ${JSON.stringify(e.nodeOutputs).slice(0,2e3)}`:null].filter(Boolean).join("\n"),a=`${i}
53
-
54
- Task:
55
- ${t}`,n="";try{await (0,r.runCliResponse)({provider:"claude",model:"claude-haiku-4-5-20251001",prompt:a,onDelta:e=>{n+=e}})}catch(e){return console.warn("[project-knowledge] LLM call failed:",e),[]}return function(e){let t=e.trim().replace(/^```(?:json)?\s*/i,"").replace(/\s*```\s*$/,"").trim();try{let e=JSON.parse(t);if(!Array.isArray(e))return[];let r=new Set,a=[];for(let t of e){let e="object"==typeof t&&null!==t&&"string"==typeof t.content?t.content.trim():"";if(e&&!r.has(e)&&(r.add(e),a.push({content:e}),a.length>=2))break}return a}catch{return console.warn("[project-knowledge] Failed to parse LLM response:",t.slice(0,200)),[]}}(n)}async function m(e,r,n){if(0===n.length)return 0;let o=(0,a.getSQLiteDb)(),i=new Set(o.prepare("SELECT content FROM project_memory WHERE project_id = ? AND producer = 'system'").all(e).map(e=>e.content.trim())),s=o.prepare(`INSERT INTO project_memory (id, project_id, content, source, producer, created_at)
56
- VALUES (?, ?, ?, ?, 'system', ?)`),d=0,u=new Date().toISOString();for(let a of n){let n=a.content.trim();!(!n||i.has(n))&&(s.run((0,t.randomUUID)(),e,n,`task:${r}`,u),i.add(n),d++)}return d}async function E(e,t,r){let a=await g(t);if(!a)return;let n=await f(r);if(0===n.length)return;let o=await m(a,e,n);o>0&&console.log(`[project-knowledge] Stored ${o} project knowledge entries for task ${e}`)}e.s(["extractAndStoreMemories",()=>h,"extractAndStoreProjectKnowledge",()=>E,"resolveMemoryAgentId",()=>c])},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 o 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 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 c(e){let{type:t,status:r,metrics:a,output:n,...o}=e;return{type:t,status:r,config:o,output:n??null,metrics:a??null}}function p(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 i(e.taskId,r.id);for(let[t,r]of(a.query(`INSERT INTO execution_graphs
57
- (id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at)
58
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
59
- ON CONFLICT (id) DO UPDATE SET
60
- task_id = excluded.task_id,
61
- graph_version = excluded.graph_version,
62
- mode = excluded.mode,
63
- policy = excluded.policy,
64
- done_criteria = excluded.done_criteria,
65
- schedule = excluded.schedule,
66
- created_at = excluded.created_at,
67
- 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=c(r);a.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
68
- 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)
69
- 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 o=this.getGraphForTask(a,e.taskId);if(!o)throw new n(e.id);return o})()}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(),i=h(a);return a.transaction(()=>{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:u(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),c=i.query(`SELECT node_id, type, status, config, output, metrics
70
- FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),p=new Map;for(let e of c.rows)p.set(e.node_id,e);let h=r.filter(e=>!p.has(e));if(h.length>0)throw new o(e,h);for(let a of r){let r=t[a],n=p.get(a);if(!n||!r)continue;let o={...l(d(n.config)),...l(r.configPatch)};void 0!==r.startedAt&&(o.startedAt=r.startedAt),void 0!==r.completedAt&&(o.completedAt=r.completedAt),void 0!==r.actualMinutes&&(o.actualMinutes=r.actualMinutes),i.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
71
- WHERE graph_id = ? AND node_id = ?`,[r.status??n.status,s(r.metrics??d(n.metrics)),s(r.output??d(n.output)),s(o),e,a])}let g=i.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(),o=h(a);return a.transaction(()=>{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 n(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)
72
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,s(t.config),s(t.output),s(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)
73
- VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,s(r.dataMapping??null)]);let a=o.query(`UPDATE execution_graphs
74
- SET mode = ?, policy = ?, done_criteria = ?, schedule = ?, updated_at = datetime('now')
75
- WHERE id = ?
76
- 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
77
- 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
78
- FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[a.id]),o=e.query(`SELECT from_id, to_id, type, condition, data_mapping
79
- FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[a.id]),i=e.query(`SELECT event_type, payload, timestamp
80
- 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 c=o.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 i.rows){let t=p(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:c,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)
81
- VALUES (?, ?, ?, ?)`,[t,r.eventType,s(r),r.timestamp])}}function f(){return new g}let m=new g;function E(e,t){return m.createGraph(e,t)}function y(e){return m.getGraph(e)}function S(e,t,r){return m.updateNodeRuntime(e,t,r)}function _(e,t,r){return m.updateGraphStructure(e,t,r)}function w(e,t){return m.appendEvent(e,t)}function I(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 o=r.limit??1e3,i=`SELECT event_type, payload, timestamp
82
- FROM graph_events
83
- WHERE ${a.join(" AND ")}
84
- ORDER BY timestamp ASC, event_type ASC
85
- LIMIT ?`;return n.push(o),h((0,t.getSQLiteDb)()).query(i,n).rows.map(e=>p(e))}function v(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
86
- FROM execution_graphs
87
- WHERE schedule IS NOT NULL
88
- AND json_extract(schedule, '$.rootMessageId') = ?
89
- AND json_extract(schedule, '$.state') = 'active'
90
- ORDER BY updated_at DESC
91
- LIMIT 1`).get(r)??null:null}function R(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
92
- FROM execution_graphs
93
- WHERE schedule IS NOT NULL
94
- AND json_extract(schedule, '$.state') = 'active'`).all().map(e=>e.rootMessageId).filter(Boolean)}function k(e){let r=e.trim();return r?Number((0,t.getSQLiteDb)().prepare(`UPDATE execution_graphs
95
- SET schedule = json_set(schedule, '$.state', 'stopped', '$.tickInProgress', json('false')),
96
- updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
97
- WHERE schedule IS NOT NULL
98
- AND json_extract(schedule, '$.rootMessageId') = ?
99
- AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>o,"GraphNotFoundError",()=>n,"GraphStore",()=>g,"GraphTaskAlreadyBoundError",()=>i,"GraphVersionConflictError",()=>a,"appendEvent",()=>w,"createGraph",()=>E,"createGraphStore",()=>f,"deactivateSchedulesByRootMessageId",()=>k,"getActiveScheduleForRootMessageId",()=>v,"getActiveScheduleRootMessageIds",()=>R,"getGraph",()=>y,"getGraphEvents",()=>I,"updateGraphStructure",()=>_,"updateNodeRuntime",()=>S])},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"]])},39760,e=>{"use strict";var t=e.i(69719),r=e.i(73122),a=e.i(63279),n=e.i(86582),o=e.i(6838),i=e.i(77036),s=e.i(97812),d=e.i(97681);let u=t.z.object({error:t.z.string().min(1),nodeIds:t.z.array(t.z.string())});async function l(e){try{await (0,s.appendEvent)(e.graphId,(0,r.buildNodeStatusEvent)({actor:e.actor,nodeId:e.nodeId,fromStatus:e.fromStatus,toStatus:e.toStatus,reason:e.reason,projectId:e.projectId}))}catch(e){console.error("Failed to append rejected node transition event",e)}}async function c(e){let t=await (0,o.authorizeGraphMutation)({request:e.request,taskId:e.taskId,action:e.action,requestedProjectId:e.requestedProjectId});if(!t.ok)return t.response;let c=await (0,s.getGraph)(e.taskId);if(!c)return(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Graph not found"},{status:404});let p=c.nodes[e.nodeId];if(!p)return(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Node not found"},{status:404});if(e.allowedFromStatuses&&!e.allowedFromStatuses.includes(p.status))return await l({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:p.status,toStatus:e.targetStatus,reason:`Rejected: node must be in one of [${e.allowedFromStatuses.join(", ")}] to ${e.action}`}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Cannot ${e.action} node ${e.nodeId}: current status is ${p.status}`},{status:400});try{(0,d.assertValidNodeStatusTransition)(p.type,p.status,e.targetStatus)}catch{return await l({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:p.status,toStatus:e.targetStatus,reason:"Rejected invalid transition"}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Invalid node transition for ${e.nodeId}: ${p.status} -> ${e.targetStatus}`},{status:400})}if("gate"===p.type&&"pending"===p.status&&"passed"===e.targetStatus&&!function(e){if("gate"!==e.type)return!1;let t=e.verificationStrategy.checks??[];return"progress"===e.gateType&&0===t.length&&"auto"===e.verificationStrategy.type}(p))return await l({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:p.status,toStatus:e.targetStatus,reason:"Rejected required gate bypass"}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Required gate transition blocked for node ${e.nodeId}`},{status:400});try{let o={...e.patch??{},status:e.targetStatus};e.resetWorkAttempts&&"work"===p.type&&(o.configPatch={...o.configPatch??{},attempts:0});let d={[e.nodeId]:{...o}},u=await (0,s.updateNodeRuntime)(c.id,d,e.ifMatchGraphVersion??c.graphVersion),l=new Date().toISOString();if(await (0,s.appendEvent)(c.id,(0,r.buildNodeStatusEvent)({actor:t.actor,nodeId:e.nodeId,fromStatus:p.status,toStatus:e.targetStatus,reason:e.reason,timestamp:l,projectId:t.projectId})),("gate"===p.type||"node_verify"===e.action)&&("passed"===e.targetStatus||"failed"===e.targetStatus)){let a="passed"===e.targetStatus;(0,i.recordGateVerificationResult)(a),await (0,s.appendEvent)(c.id,(0,r.buildGateVerificationEvent)({actor:t.actor,nodeId:e.nodeId,timestamp:l,result:{passed:a,checks:e.gateChecks??[],verifiedAt:l,verifiedBy:"user"===t.actor.actorType?"human":"agent"},projectId:t.projectId}))}if(e.consumeVerifyBudget||"node_verify"===e.action){let a=Math.max(0,c.policy.verifyBudgetRemaining-1);await (0,s.appendEvent)(c.id,(0,r.buildBudgetConsumedEvent)({actor:t.actor,budgetType:"verify",remaining:a,triggerNodeId:e.nodeId,timestamp:l,projectId:t.projectId}))}return(0,n.jsonWithSchema)(a.NodeMutationResponseSchema,{graphId:c.id,nodeId:e.nodeId,graphVersion:u.graphVersion,updatedAt:u.updatedAt})}catch(e){if(e instanceof s.GraphVersionConflictError)return(0,n.graphConflictResponse)(e);if(e instanceof s.GraphNodeNotFoundError)return(0,n.jsonWithSchema)(u,{error:e.message,nodeIds:e.nodeIds},{status:404});return console.error("Error mutating node status:",e),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Failed to mutate node status"},{status:500})}}e.s(["applyNodeStatusMutation",()=>c])},25823,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),d=e.i(16795),u=e.i(87718),l=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),g=e.i(74838),f=e.i(10372),m=e.i(93695);e.i(52474);var E=e.i(220),y=e.i(57431),S=e.i(90081),_=e.i(62294),w=e.i(42304),I=e.i(12616),v=e.i(63279),R=e.i(86582),k=e.i(39760),T=e.i(97812);let x=new Set(["pending","running","awaiting_human","blocked"]);function A(e,t){if(!e||"object"!=typeof e)return!1;let r="code"in e?String(e.code||""):"",a="message"in e?String(e.message||"").toLowerCase():"";return("42703"===r||"PGRST204"===r)&&a.includes(t.toLowerCase())}async function N(e,t,r){let a={...r};for(;;){let{error:r}=await e.from("tasks").update(a).eq("id",t);if(!r)return;if("blocked_reason"in a&&A(r,"blocked_reason")){let{blocked_reason:e,...t}=a;a=t;continue}throw r}}async function O(e,t,r,a){let{error:n}=await e.from("execution_graphs").update({execution_state:r,updated_at:a}).eq("id",t);if(n&&!A(n,"execution_state"))throw n}async function b(e){var t;let r,a=await (0,T.getGraph)(e);if(!a)return;let n=await S.db.getTask(e);if(!n)return;let o=(0,_.parseFrontmatter)(String(n.content||"")),i={...o.frontmatter},s=(0,w.resolveMemoryAgentId)({defaultUserId:n.user_id||"system",frontmatter:o.frontmatter}),d=o.body,u=new Date().toISOString(),l=(0,y.createAdminDbClient)(),c=Object.values(a.nodes||{}).some(e=>!!e&&x.has(e.status)),p=!c;if(p&&(t=a,0===(r=Array.isArray(t?.doneCriteria?.completionSinkNodeIds)?t.doneCriteria.completionSinkNodeIds:[]).length?!Object.values(t.nodes||{}).some(e=>e?.status==="failed"):r.every(e=>{let r=t.nodes?.[e]?.status;return"done"===r||"passed"===r}))){i.stage="DONE",i.status="completed","error"in i&&delete i.error;let t=(0,I.buildMarkdownWithFrontmatter)(i,d);await N(l,e,{content:t,stage:"DONE",status:"completed",blocked_reason:null,completed_at:u,updated_at:u}),await O(l,a.id,"done",u);let r={};for(let[e,t]of Object.entries(a.nodes))t?.type==="work"&&t.output&&(r[e]=t.output);(0,w.extractAndStoreMemories)(e,s,{goal:String(n.content||n.title||""),status:"completed",nodeOutputs:r}).catch(e=>console.warn("[verify] Memory extraction failed:",e)),(0,w.extractAndStoreProjectKnowledge)(e,n.project_id||n.project,{goal:String(n.content||n.title||""),status:"completed",nodeOutputs:r}).catch(e=>console.warn("[verify] Project knowledge extraction failed:",e));return}if(p){i.status="failed";let t=(0,I.buildMarkdownWithFrontmatter)(i,d);await N(l,e,{content:t,status:"failed",blocked_reason:null,completed_at:u,updated_at:u}),await O(l,a.id,"done",u);let r={};for(let[e,t]of Object.entries(a.nodes))t?.type==="work"&&t.output&&(r[e]=t.output);(0,w.extractAndStoreMemories)(e,s,{goal:String(n.content||n.title||""),status:"failed",nodeOutputs:r}).catch(e=>console.warn("[verify] Memory extraction failed:",e)),(0,w.extractAndStoreProjectKnowledge)(e,n.project_id||n.project,{goal:String(n.content||n.title||""),status:"failed",nodeOutputs:r}).catch(e=>console.warn("[verify] Project knowledge extraction failed:",e));return}if(c&&!Object.values(a.nodes||{}).some(e=>e?.status==="awaiting_human")){i.status="queued",i.stage="PROGRESS","error"in i&&delete i.error;let t=(0,I.buildMarkdownWithFrontmatter)(i,d);await N(l,e,{content:t,status:"queued",stage:"PROGRESS",blocked_reason:null,completed_at:null,updated_at:u}),await O(l,a.id,"running",u)}}async function j(e,{params:t}){let{id:r,nodeId:a}=await t,n=(0,R.normalizeTaskId)(r),o=(0,R.normalizeNodeId)(a);if(!n||!o)return(0,R.jsonWithSchema)(v.ErrorResponseSchema,{error:"Invalid taskId or nodeId"},{status:400});let i=await (0,R.parseJsonBody)(e,v.VerifyGateRequestSchema);if(!i.ok)return i.response;let s=i.data,d=await (0,k.applyNodeStatusMutation)({request:e,taskId:n,nodeId:o,action:"node_verify",requestedProjectId:s.projectId??s.project_id,ifMatchGraphVersion:s.ifMatchGraphVersion,targetStatus:s.approved?"passed":"failed",reason:s.feedback?.trim()||"gate verification submitted",gateChecks:s.checks??[],consumeVerifyBudget:!0,patch:{completedAt:s.completedAt??new Date().toISOString()}});if(!d.ok||!s.approved)return d;try{await b(n)}catch(e){console.error("Failed to reconcile task after gate approval:",e)}return d}e.s(["POST",()=>j],43859);var C=e.i(43859);let D=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/nodes/[nodeId]/verify/route",pathname:"/api/tasks/[id]/nodes/[nodeId]/verify",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/nodes/[nodeId]/verify/route.ts",nextConfigOutput:"standalone",userland:C}),{workAsyncStorage:M,workUnitAsyncStorage:L,serverHooks:$}=D;function F(){return(0,a.patchFetch)({workAsyncStorage:M,workUnitAsyncStorage:L})}async function q(e,t,a){D.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let y="/api/tasks/[id]/nodes/[nodeId]/verify/route";y=y.replace(/\/index$/,"")||"/";let S=await D.prepare(e,t,{srcPage:y,multiZoneDraftMode:!1});if(!S)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:_,params:w,nextConfig:I,parsedUrl:v,isDraftMode:R,prerenderManifest:k,routerServerContext:T,isOnDemandRevalidate:x,revalidateOnlyGenerated:A,resolvedPathname:N,clientReferenceManifest:O,serverActionsManifest:b}=S,j=(0,s.normalizeAppPath)(y),C=!!(k.dynamicRoutes[j]||k.routes[N]),M=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,v,!1):t.end("This page could not be found"),null);if(C&&!R){let e=!!k.routes[N],t=k.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(I.experimental.adapterPath)return await M();throw new m.NoFallbackError}}let L=null;!C||D.isDev||R||(L="/index"===(L=N)?"/":L);let $=!0===D.isDev||!C,F=C&&!$;b&&O&&(0,i.setManifestsSingleton)({page:y,clientReferenceManifest:O,serverActionsManifest:b});let q=e.method||"GET",G=(0,o.getTracer)(),U=G.getActiveScopeSpan(),P={params:w,prerenderManifest:k,renderOpts:{experimental:{authInterrupts:!!I.experimental.authInterrupts},cacheComponents:!!I.cacheComponents,supportsDynamicResponse:$,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:I.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>D.onRequestError(e,t,a,n,T)},sharedContext:{buildId:_}},H=new d.NodeNextRequest(e),W=new d.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(H,(0,u.signalFromNodeResponse)(t));try{let i=async e=>D.handle(V,P).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=`${q} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${q} ${y}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var o,d;let u=async({previousCacheEntry:r})=>{try{if(!s&&x&&A&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await i(n);e.fetchMetrics=P.renderOpts.fetchMetrics;let d=P.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let u=P.renderOpts.collectedTags;if(!C)return await (0,p.sendResponse)(H,W,o,P.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);u&&(t[f.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==P.renderOpts.collectedRevalidate&&!(P.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&P.renderOpts.collectedRevalidate,a=void 0===P.renderOpts.collectedExpire||P.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:P.renderOpts.collectedExpire;return{value:{kind:E.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await D.onRequestError(e,t,{routerKind:"App Router",routePath:y,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:x})},!1,T),t}},l=await D.handleResponse({req:e,nextConfig:I,cacheKey:L,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:x,revalidateOnlyGenerated:A,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:s});if(!C)return null;if((null==l||null==(o=l.value)?void 0:o.kind)!==E.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",x?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),R&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,h.fromNodeOutgoingHttpHeaders)(l.value.headers);return s&&C||m.delete(f.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||t.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,g.getCacheControlHeader)(l.cacheControl)),await (0,p.sendResponse)(H,W,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};U?await d(U):await G.withPropagatedContext(e.headers,()=>G.trace(l.BaseServerSpan.handleRequest,{spanName:`${q} ${y}`,kind:o.SpanKind.SERVER,attributes:{"http.method":q,"http.target":e.url}},d))}catch(t){if(t instanceof m.NoFallbackError||await D.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:x})},!1,T),C)throw t;return await (0,p.sendResponse)(H,W,new Response(null,{status:500})),null}}e.s(["handler",()=>q,"patchFetch",()=>F,"routeModule",()=>D,"serverHooks",()=>$,"workAsyncStorage",()=>M,"workUnitAsyncStorage",()=>L],25823)}];
100
-
101
- //# sourceMappingURL=_1111d342._.js.map
@@ -1,49 +0,0 @@
1
- module.exports=[12616,e=>{"use strict";function t(e,t){return`---
2
- ${Object.entries(e).map(([e,t])=>`${e}: ${null==t?"":String(t)}`).join("\n")}
3
- ---
4
- ${t}`}e.s(["buildMarkdownWithFrontmatter",()=>t])},33872,e=>{"use strict";var t=e.i(57431),r=e.i(62294),a=e.i(90081),n=e.i(12616);async function o(e){let o=e.nowIso??new Date().toISOString(),s=(0,t.createAdminDbClient)(),i=await a.db.getTask(e.taskId,e.userId),d={status:e.status,stage:"PROGRESS",updated_at:o};if(Object.prototype.hasOwnProperty.call(e,"startedAt")&&(d.started_at=e.startedAt??null),Object.prototype.hasOwnProperty.call(e,"completedAt")&&(d.completed_at=e.completedAt??null),i){let{frontmatter:t,body:a}=(0,r.parseFrontmatter)(String(i.content||""));t.status=e.status,t.stage="PROGRESS",e.clearError&&delete t.error,d.content=(0,n.buildMarkdownWithFrontmatter)(t,a)}let u=s.from("tasks").update(d).eq("id",e.taskId);e.userId&&(u=u.eq("user_id",e.userId));let{error:p}=await u;if(p)throw p}e.s(["syncTaskProgressForGraphExecution",()=>o])},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 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 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 p(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function c(e){let{type:t,status:r,metrics:a,output:n,...o}=e;return{type:t,status:r,config:o,output:n??null,metrics:a??null}}function l(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 s(e.taskId,r.id);for(let[t,r]of(a.query(`INSERT INTO execution_graphs
5
- (id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at)
6
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
7
- ON CONFLICT (id) DO UPDATE SET
8
- task_id = excluded.task_id,
9
- graph_version = excluded.graph_version,
10
- mode = excluded.mode,
11
- policy = excluded.policy,
12
- done_criteria = excluded.done_criteria,
13
- schedule = excluded.schedule,
14
- created_at = excluded.created_at,
15
- 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 n=c(r);a.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
16
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,n.type,n.status,i(n.config),i(n.output),i(n.metrics)])}for(let t of e.edges)a.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
17
- 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 o=this.getGraphForTask(a,e.taskId);if(!o)throw new n(e.id);return o})()}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(),s=h(a);return a.transaction(()=>{if(!s.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=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(", "),c=s.query(`SELECT node_id, type, status, config, output, metrics
18
- FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),l=new Map;for(let e of c.rows)l.set(e.node_id,e);let h=r.filter(e=>!l.has(e));if(h.length>0)throw new o(e,h);for(let a of r){let r=t[a],n=l.get(a);if(!n||!r)continue;let o={...p(d(n.config)),...p(r.configPatch)};void 0!==r.startedAt&&(o.startedAt=r.startedAt),void 0!==r.completedAt&&(o.completedAt=r.completedAt),void 0!==r.actualMinutes&&(o.actualMinutes=r.actualMinutes),s.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
19
- WHERE graph_id = ? AND node_id = ?`,[r.status??n.status,i(r.metrics??d(n.metrics)),i(r.output??d(n.output)),i(o),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:u(g.rows[0].updated_at)}})()}updateGraphStructure(e,t,r){let a=this.getDb(),o=h(a);return a.transaction(()=>{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 n(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)
20
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,i(t.config),i(t.output),i(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)
21
- VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,i(r.dataMapping??null)]);let a=o.query(`UPDATE execution_graphs
22
- SET mode = ?, policy = ?, done_criteria = ?, schedule = ?, updated_at = datetime('now')
23
- WHERE id = ?
24
- 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(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
25
- 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
26
- FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[a.id]),o=e.query(`SELECT from_id, to_id, type, condition, data_mapping
27
- FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[a.id]),s=e.query(`SELECT event_type, payload, timestamp
28
- FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[a.id]),i={};for(let e of n.rows)i[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 c=o.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 s.rows){let t=l(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:i,edges:c,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)
29
- VALUES (?, ?, ?, ?)`,[t,r.eventType,i(r),r.timestamp])}}function E(){return new g}let m=new g;function f(e,t){return m.createGraph(e,t)}function _(e){return m.getGraph(e)}function S(e,t,r){return m.updateNodeRuntime(e,t,r)}function I(e,t,r){return m.updateGraphStructure(e,t,r)}function R(e,t){return m.appendEvent(e,t)}function y(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 o=r.limit??1e3,s=`SELECT event_type, payload, timestamp
30
- FROM graph_events
31
- WHERE ${a.join(" AND ")}
32
- ORDER BY timestamp ASC, event_type ASC
33
- LIMIT ?`;return n.push(o),h((0,t.getSQLiteDb)()).query(s,n).rows.map(e=>l(e))}function T(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
34
- FROM execution_graphs
35
- WHERE schedule IS NOT NULL
36
- AND json_extract(schedule, '$.rootMessageId') = ?
37
- AND json_extract(schedule, '$.state') = 'active'
38
- ORDER BY updated_at DESC
39
- LIMIT 1`).get(r)??null:null}function v(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
40
- FROM execution_graphs
41
- WHERE schedule IS NOT NULL
42
- 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
43
- SET schedule = json_set(schedule, '$.state', 'stopped', '$.tickInProgress', json('false')),
44
- updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
45
- WHERE schedule IS NOT NULL
46
- AND json_extract(schedule, '$.rootMessageId') = ?
47
- AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>o,"GraphNotFoundError",()=>n,"GraphStore",()=>g,"GraphTaskAlreadyBoundError",()=>s,"GraphVersionConflictError",()=>a,"appendEvent",()=>R,"createGraph",()=>f,"createGraphStore",()=>E,"deactivateSchedulesByRootMessageId",()=>w,"getActiveScheduleForRootMessageId",()=>T,"getActiveScheduleRootMessageIds",()=>v,"getGraph",()=>_,"getGraphEvents",()=>y,"updateGraphStructure",()=>I,"updateNodeRuntime",()=>S])},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"]])},39760,e=>{"use strict";var t=e.i(69719),r=e.i(73122),a=e.i(63279),n=e.i(86582),o=e.i(6838),s=e.i(77036),i=e.i(97812),d=e.i(97681);let u=t.z.object({error:t.z.string().min(1),nodeIds:t.z.array(t.z.string())});async function p(e){try{await (0,i.appendEvent)(e.graphId,(0,r.buildNodeStatusEvent)({actor:e.actor,nodeId:e.nodeId,fromStatus:e.fromStatus,toStatus:e.toStatus,reason:e.reason,projectId:e.projectId}))}catch(e){console.error("Failed to append rejected node transition event",e)}}async function c(e){let t=await (0,o.authorizeGraphMutation)({request:e.request,taskId:e.taskId,action:e.action,requestedProjectId:e.requestedProjectId});if(!t.ok)return t.response;let c=await (0,i.getGraph)(e.taskId);if(!c)return(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Graph not found"},{status:404});let l=c.nodes[e.nodeId];if(!l)return(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Node not found"},{status:404});if(e.allowedFromStatuses&&!e.allowedFromStatuses.includes(l.status))return await p({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:`Rejected: node must be in one of [${e.allowedFromStatuses.join(", ")}] to ${e.action}`}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Cannot ${e.action} node ${e.nodeId}: current status is ${l.status}`},{status:400});try{(0,d.assertValidNodeStatusTransition)(l.type,l.status,e.targetStatus)}catch{return await p({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:"Rejected invalid transition"}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Invalid node transition for ${e.nodeId}: ${l.status} -> ${e.targetStatus}`},{status:400})}if("gate"===l.type&&"pending"===l.status&&"passed"===e.targetStatus&&!function(e){if("gate"!==e.type)return!1;let t=e.verificationStrategy.checks??[];return"progress"===e.gateType&&0===t.length&&"auto"===e.verificationStrategy.type}(l))return await p({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:"Rejected required gate bypass"}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Required gate transition blocked for node ${e.nodeId}`},{status:400});try{let o={...e.patch??{},status:e.targetStatus};e.resetWorkAttempts&&"work"===l.type&&(o.configPatch={...o.configPatch??{},attempts:0});let d={[e.nodeId]:{...o}},u=await (0,i.updateNodeRuntime)(c.id,d,e.ifMatchGraphVersion??c.graphVersion),p=new Date().toISOString();if(await (0,i.appendEvent)(c.id,(0,r.buildNodeStatusEvent)({actor:t.actor,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:e.reason,timestamp:p,projectId:t.projectId})),("gate"===l.type||"node_verify"===e.action)&&("passed"===e.targetStatus||"failed"===e.targetStatus)){let a="passed"===e.targetStatus;(0,s.recordGateVerificationResult)(a),await (0,i.appendEvent)(c.id,(0,r.buildGateVerificationEvent)({actor:t.actor,nodeId:e.nodeId,timestamp:p,result:{passed:a,checks:e.gateChecks??[],verifiedAt:p,verifiedBy:"user"===t.actor.actorType?"human":"agent"},projectId:t.projectId}))}if(e.consumeVerifyBudget||"node_verify"===e.action){let a=Math.max(0,c.policy.verifyBudgetRemaining-1);await (0,i.appendEvent)(c.id,(0,r.buildBudgetConsumedEvent)({actor:t.actor,budgetType:"verify",remaining:a,triggerNodeId:e.nodeId,timestamp:p,projectId:t.projectId}))}return(0,n.jsonWithSchema)(a.NodeMutationResponseSchema,{graphId:c.id,nodeId:e.nodeId,graphVersion:u.graphVersion,updatedAt:u.updatedAt})}catch(e){if(e instanceof i.GraphVersionConflictError)return(0,n.graphConflictResponse)(e);if(e instanceof i.GraphNodeNotFoundError)return(0,n.jsonWithSchema)(u,{error:e.message,nodeIds:e.nodeIds},{status:404});return console.error("Error mutating node status:",e),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Failed to mutate node status"},{status:500})}}e.s(["applyNodeStatusMutation",()=>c])},59344,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),s=e.i(74677),i=e.i(69741),d=e.i(16795),u=e.i(87718),p=e.i(95169),c=e.i(47587),l=e.i(66012),h=e.i(70101),g=e.i(74838),E=e.i(10372),m=e.i(93695);e.i(52474);var f=e.i(220),_=e.i(57431),S=e.i(63279),I=e.i(86582),R=e.i(39760),y=e.i(33872);async function T(e,{params:t}){let{id:r,nodeId:a}=await t,n=(0,I.normalizeTaskId)(r),o=(0,I.normalizeNodeId)(a);if(!n||!o)return(0,I.jsonWithSchema)(S.ErrorResponseSchema,{error:"Invalid taskId or nodeId"},{status:400});let s=await (0,I.parseJsonBody)(e,S.StartNodeRequestSchema);if(!s.ok)return s.response;let i=s.data,d=await (0,R.applyNodeStatusMutation)({request:e,taskId:n,nodeId:o,action:"node_resume",requestedProjectId:i.projectId??i.project_id,ifMatchGraphVersion:i.ifMatchGraphVersion,targetStatus:"running",reason:"manual node resume",resetWorkAttempts:!0,allowedFromStatuses:["paused","stopped"],patch:{}});if(d.status>=200&&d.status<300)try{let e=(0,_.createAdminDbClient)(),t=new Date().toISOString();await (0,y.syncTaskProgressForGraphExecution)({taskId:n,status:"queued",nowIso:t,completedAt:null,clearError:!0}),await e.from("execution_graphs").update({execution_state:"running",updated_at:t}).eq("task_id",n)}catch(e){console.error("Failed to requeue task after node resume:",e)}return d}e.s(["POST",()=>T],92551);var v=e.i(92551);let w=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/nodes/[nodeId]/resume/route",pathname:"/api/tasks/[id]/nodes/[nodeId]/resume",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/nodes/[nodeId]/resume/route.ts",nextConfigOutput:"standalone",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:N,serverHooks:k}=w;function O(){return(0,a.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:N})}async function C(e,t,a){w.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let _="/api/tasks/[id]/nodes/[nodeId]/resume/route";_=_.replace(/\/index$/,"")||"/";let S=await w.prepare(e,t,{srcPage:_,multiZoneDraftMode:!1});if(!S)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:I,params:R,nextConfig:y,parsedUrl:T,isDraftMode:v,prerenderManifest:A,routerServerContext:N,isOnDemandRevalidate:k,revalidateOnlyGenerated:O,resolvedPathname:C,clientReferenceManifest:x,serverActionsManifest:D}=S,M=(0,i.normalizeAppPath)(_),b=!!(A.dynamicRoutes[M]||A.routes[C]),j=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,T,!1):t.end("This page could not be found"),null);if(b&&!v){let e=!!A.routes[C],t=A.dynamicRoutes[M];if(t&&!1===t.fallback&&!e){if(y.experimental.adapterPath)return await j();throw new m.NoFallbackError}}let q=null;!b||w.isDev||v||(q="/index"===(q=C)?"/":q);let F=!0===w.isDev||!b,L=b&&!F;D&&x&&(0,s.setManifestsSingleton)({page:_,clientReferenceManifest:x,serverActionsManifest:D});let P=e.method||"GET",G=(0,o.getTracer)(),U=G.getActiveScopeSpan(),H={params:R,prerenderManifest:A,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:F,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:y.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>w.onRequestError(e,t,a,n,N)},sharedContext:{buildId:I}},$=new d.NodeNextRequest(e),W=new d.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest($,(0,u.signalFromNodeResponse)(t));try{let s=async e=>w.handle(V,H).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")!==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=`${P} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${P} ${_}`)}),i=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var o,d;let u=async({previousCacheEntry:r})=>{try{if(!i&&k&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await s(n);e.fetchMetrics=H.renderOpts.fetchMetrics;let d=H.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let u=H.renderOpts.collectedTags;if(!b)return await (0,l.sendResponse)($,W,o,H.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);u&&(t[E.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==H.renderOpts.collectedRevalidate&&!(H.renderOpts.collectedRevalidate>=E.INFINITE_CACHE)&&H.renderOpts.collectedRevalidate,a=void 0===H.renderOpts.collectedExpire||H.renderOpts.collectedExpire>=E.INFINITE_CACHE?void 0:H.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await w.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:L,isOnDemandRevalidate:k})},!1,N),t}},p=await w.handleResponse({req:e,nextConfig:y,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:k,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:i});if(!b)return null;if((null==p||null==(o=p.value)?void 0:o.kind)!==f.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});i||t.setHeader("x-nextjs-cache",k?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),v&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,h.fromNodeOutgoingHttpHeaders)(p.value.headers);return i&&b||m.delete(E.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,g.getCacheControlHeader)(p.cacheControl)),await (0,l.sendResponse)($,W,new Response(p.value.body,{headers:m,status:p.value.status||200})),null};U?await d(U):await G.withPropagatedContext(e.headers,()=>G.trace(p.BaseServerSpan.handleRequest,{spanName:`${P} ${_}`,kind:o.SpanKind.SERVER,attributes:{"http.method":P,"http.target":e.url}},d))}catch(t){if(t instanceof m.NoFallbackError||await w.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:L,isOnDemandRevalidate:k})},!1,N),b)throw t;return await (0,l.sendResponse)($,W,new Response(null,{status:500})),null}}e.s(["handler",()=>C,"patchFetch",()=>O,"routeModule",()=>w,"serverHooks",()=>k,"workAsyncStorage",()=>A,"workUnitAsyncStorage",()=>N],59344)}];
48
-
49
- //# sourceMappingURL=_4b60ba15._.js.map
@@ -1,49 +0,0 @@
1
- module.exports=[12616,e=>{"use strict";function t(e,t){return`---
2
- ${Object.entries(e).map(([e,t])=>`${e}: ${null==t?"":String(t)}`).join("\n")}
3
- ---
4
- ${t}`}e.s(["buildMarkdownWithFrontmatter",()=>t])},33872,e=>{"use strict";var t=e.i(57431),r=e.i(62294),a=e.i(90081),n=e.i(12616);async function o(e){let o=e.nowIso??new Date().toISOString(),s=(0,t.createAdminDbClient)(),i=await a.db.getTask(e.taskId,e.userId),d={status:e.status,stage:"PROGRESS",updated_at:o};if(Object.prototype.hasOwnProperty.call(e,"startedAt")&&(d.started_at=e.startedAt??null),Object.prototype.hasOwnProperty.call(e,"completedAt")&&(d.completed_at=e.completedAt??null),i){let{frontmatter:t,body:a}=(0,r.parseFrontmatter)(String(i.content||""));t.status=e.status,t.stage="PROGRESS",e.clearError&&delete t.error,d.content=(0,n.buildMarkdownWithFrontmatter)(t,a)}let u=s.from("tasks").update(d).eq("id",e.taskId);e.userId&&(u=u.eq("user_id",e.userId));let{error:p}=await u;if(p)throw p}e.s(["syncTaskProgressForGraphExecution",()=>o])},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 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 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 p(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:e}function c(e){let{type:t,status:r,metrics:a,output:n,...o}=e;return{type:t,status:r,config:o,output:n??null,metrics:a??null}}function l(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 s(e.taskId,r.id);for(let[t,r]of(a.query(`INSERT INTO execution_graphs
5
- (id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at)
6
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
7
- ON CONFLICT (id) DO UPDATE SET
8
- task_id = excluded.task_id,
9
- graph_version = excluded.graph_version,
10
- mode = excluded.mode,
11
- policy = excluded.policy,
12
- done_criteria = excluded.done_criteria,
13
- schedule = excluded.schedule,
14
- created_at = excluded.created_at,
15
- 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 n=c(r);a.query(`INSERT INTO graph_nodes (graph_id, node_id, type, status, config, output, metrics)
16
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e.id,t,n.type,n.status,i(n.config),i(n.output),i(n.metrics)])}for(let t of e.edges)a.query(`INSERT INTO graph_edges (graph_id, from_id, to_id, type, condition, data_mapping)
17
- 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 o=this.getGraphForTask(a,e.taskId);if(!o)throw new n(e.id);return o})()}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(),s=h(a);return a.transaction(()=>{if(!s.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=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(", "),c=s.query(`SELECT node_id, type, status, config, output, metrics
18
- FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),l=new Map;for(let e of c.rows)l.set(e.node_id,e);let h=r.filter(e=>!l.has(e));if(h.length>0)throw new o(e,h);for(let a of r){let r=t[a],n=l.get(a);if(!n||!r)continue;let o={...p(d(n.config)),...p(r.configPatch)};void 0!==r.startedAt&&(o.startedAt=r.startedAt),void 0!==r.completedAt&&(o.completedAt=r.completedAt),void 0!==r.actualMinutes&&(o.actualMinutes=r.actualMinutes),s.query(`UPDATE graph_nodes SET status = ?, metrics = ?, output = ?, config = ?
19
- WHERE graph_id = ? AND node_id = ?`,[r.status??n.status,i(r.metrics??d(n.metrics)),i(r.output??d(n.output)),i(o),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:u(g.rows[0].updated_at)}})()}updateGraphStructure(e,t,r){let a=this.getDb(),o=h(a);return a.transaction(()=>{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 n(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)
20
- VALUES (?, ?, ?, ?, ?, ?, ?)`,[e,r,t.type,t.status,i(t.config),i(t.output),i(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)
21
- VALUES (?, ?, ?, ?, ?, ?)`,[e,r.from,r.to,r.type,r.condition??null,i(r.dataMapping??null)]);let a=o.query(`UPDATE execution_graphs
22
- SET mode = ?, policy = ?, done_criteria = ?, schedule = ?, updated_at = datetime('now')
23
- WHERE id = ?
24
- 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(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
25
- 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
26
- FROM graph_nodes WHERE graph_id = ? ORDER BY node_id ASC`,[a.id]),o=e.query(`SELECT from_id, to_id, type, condition, data_mapping
27
- FROM graph_edges WHERE graph_id = ? ORDER BY from_id ASC, to_id ASC`,[a.id]),s=e.query(`SELECT event_type, payload, timestamp
28
- FROM graph_events WHERE graph_id = ? ORDER BY timestamp ASC, event_type ASC`,[a.id]),i={};for(let e of n.rows)i[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 c=o.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 s.rows){let t=l(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:i,edges:c,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)
29
- VALUES (?, ?, ?, ?)`,[t,r.eventType,i(r),r.timestamp])}}function E(){return new g}let f=new g;function m(e,t){return f.createGraph(e,t)}function _(e){return f.getGraph(e)}function S(e,t,r){return f.updateNodeRuntime(e,t,r)}function I(e,t,r){return f.updateGraphStructure(e,t,r)}function R(e,t){return f.appendEvent(e,t)}function y(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 o=r.limit??1e3,s=`SELECT event_type, payload, timestamp
30
- FROM graph_events
31
- WHERE ${a.join(" AND ")}
32
- ORDER BY timestamp ASC, event_type ASC
33
- LIMIT ?`;return n.push(o),h((0,t.getSQLiteDb)()).query(s,n).rows.map(e=>l(e))}function v(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
34
- FROM execution_graphs
35
- WHERE schedule IS NOT NULL
36
- AND json_extract(schedule, '$.rootMessageId') = ?
37
- AND json_extract(schedule, '$.state') = 'active'
38
- ORDER BY updated_at DESC
39
- LIMIT 1`).get(r)??null:null}function T(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
40
- FROM execution_graphs
41
- WHERE schedule IS NOT NULL
42
- 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
43
- SET schedule = json_set(schedule, '$.state', 'stopped', '$.tickInProgress', json('false')),
44
- updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
45
- WHERE schedule IS NOT NULL
46
- AND json_extract(schedule, '$.rootMessageId') = ?
47
- AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>o,"GraphNotFoundError",()=>n,"GraphStore",()=>g,"GraphTaskAlreadyBoundError",()=>s,"GraphVersionConflictError",()=>a,"appendEvent",()=>R,"createGraph",()=>m,"createGraphStore",()=>E,"deactivateSchedulesByRootMessageId",()=>w,"getActiveScheduleForRootMessageId",()=>v,"getActiveScheduleRootMessageIds",()=>T,"getGraph",()=>_,"getGraphEvents",()=>y,"updateGraphStructure",()=>I,"updateNodeRuntime",()=>S])},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"]])},39760,e=>{"use strict";var t=e.i(69719),r=e.i(73122),a=e.i(63279),n=e.i(86582),o=e.i(6838),s=e.i(77036),i=e.i(97812),d=e.i(97681);let u=t.z.object({error:t.z.string().min(1),nodeIds:t.z.array(t.z.string())});async function p(e){try{await (0,i.appendEvent)(e.graphId,(0,r.buildNodeStatusEvent)({actor:e.actor,nodeId:e.nodeId,fromStatus:e.fromStatus,toStatus:e.toStatus,reason:e.reason,projectId:e.projectId}))}catch(e){console.error("Failed to append rejected node transition event",e)}}async function c(e){let t=await (0,o.authorizeGraphMutation)({request:e.request,taskId:e.taskId,action:e.action,requestedProjectId:e.requestedProjectId});if(!t.ok)return t.response;let c=await (0,i.getGraph)(e.taskId);if(!c)return(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Graph not found"},{status:404});let l=c.nodes[e.nodeId];if(!l)return(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Node not found"},{status:404});if(e.allowedFromStatuses&&!e.allowedFromStatuses.includes(l.status))return await p({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:`Rejected: node must be in one of [${e.allowedFromStatuses.join(", ")}] to ${e.action}`}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Cannot ${e.action} node ${e.nodeId}: current status is ${l.status}`},{status:400});try{(0,d.assertValidNodeStatusTransition)(l.type,l.status,e.targetStatus)}catch{return await p({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:"Rejected invalid transition"}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Invalid node transition for ${e.nodeId}: ${l.status} -> ${e.targetStatus}`},{status:400})}if("gate"===l.type&&"pending"===l.status&&"passed"===e.targetStatus&&!function(e){if("gate"!==e.type)return!1;let t=e.verificationStrategy.checks??[];return"progress"===e.gateType&&0===t.length&&"auto"===e.verificationStrategy.type}(l))return await p({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:"Rejected required gate bypass"}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Required gate transition blocked for node ${e.nodeId}`},{status:400});try{let o={...e.patch??{},status:e.targetStatus};e.resetWorkAttempts&&"work"===l.type&&(o.configPatch={...o.configPatch??{},attempts:0});let d={[e.nodeId]:{...o}},u=await (0,i.updateNodeRuntime)(c.id,d,e.ifMatchGraphVersion??c.graphVersion),p=new Date().toISOString();if(await (0,i.appendEvent)(c.id,(0,r.buildNodeStatusEvent)({actor:t.actor,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:e.reason,timestamp:p,projectId:t.projectId})),("gate"===l.type||"node_verify"===e.action)&&("passed"===e.targetStatus||"failed"===e.targetStatus)){let a="passed"===e.targetStatus;(0,s.recordGateVerificationResult)(a),await (0,i.appendEvent)(c.id,(0,r.buildGateVerificationEvent)({actor:t.actor,nodeId:e.nodeId,timestamp:p,result:{passed:a,checks:e.gateChecks??[],verifiedAt:p,verifiedBy:"user"===t.actor.actorType?"human":"agent"},projectId:t.projectId}))}if(e.consumeVerifyBudget||"node_verify"===e.action){let a=Math.max(0,c.policy.verifyBudgetRemaining-1);await (0,i.appendEvent)(c.id,(0,r.buildBudgetConsumedEvent)({actor:t.actor,budgetType:"verify",remaining:a,triggerNodeId:e.nodeId,timestamp:p,projectId:t.projectId}))}return(0,n.jsonWithSchema)(a.NodeMutationResponseSchema,{graphId:c.id,nodeId:e.nodeId,graphVersion:u.graphVersion,updatedAt:u.updatedAt})}catch(e){if(e instanceof i.GraphVersionConflictError)return(0,n.graphConflictResponse)(e);if(e instanceof i.GraphNodeNotFoundError)return(0,n.jsonWithSchema)(u,{error:e.message,nodeIds:e.nodeIds},{status:404});return console.error("Error mutating node status:",e),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Failed to mutate node status"},{status:500})}}e.s(["applyNodeStatusMutation",()=>c])},69253,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),s=e.i(74677),i=e.i(69741),d=e.i(16795),u=e.i(87718),p=e.i(95169),c=e.i(47587),l=e.i(66012),h=e.i(70101),g=e.i(74838),E=e.i(10372),f=e.i(93695);e.i(52474);var m=e.i(220),_=e.i(57431),S=e.i(63279),I=e.i(86582),R=e.i(39760),y=e.i(97812),v=e.i(33872);async function T(e,{params:t}){var r;let{id:a,nodeId:n}=await t,o=(0,I.normalizeTaskId)(a),s=(0,I.normalizeNodeId)(n);if(!o||!s)return(0,I.jsonWithSchema)(S.ErrorResponseSchema,{error:"Invalid taskId or nodeId"},{status:400});let i=await (0,I.parseJsonBody)(e,S.StartNodeRequestSchema);if(!i.ok)return i.response;let d=i.data,u=await (0,y.getGraph)(o),p=u?.nodes[s],c=u?.nodes[s]?.status,l="done"===c&&p?.type==="work"&&(r=String(p.title||""),"plan"===s||/generate.*execution.*plan/i.test(r)),h="blocked"===c||l?"pending":"running",g=await (0,R.applyNodeStatusMutation)({request:e,taskId:o,nodeId:s,action:"node_start",requestedProjectId:d.projectId??d.project_id,ifMatchGraphVersion:d.ifMatchGraphVersion,targetStatus:h,reason:"blocked"===c?"manual unblock and requeue":l?"manual plan rerun and requeue":"manual node start",resetWorkAttempts:!0,patch:"running"===h?{startedAt:d.startedAt??new Date().toISOString()}:{}});if(g.status>=200&&g.status<300)try{let e=(0,_.createAdminDbClient)(),t=new Date().toISOString();await (0,v.syncTaskProgressForGraphExecution)({taskId:o,status:"queued",nowIso:t,completedAt:null,clearError:!0}),await e.from("execution_graphs").update({execution_state:"running",updated_at:t}).eq("task_id",o)}catch(e){console.error("Failed to requeue task after node start:",e)}return g}e.s(["POST",()=>T],28818);var w=e.i(28818);let A=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/nodes/[nodeId]/start/route",pathname:"/api/tasks/[id]/nodes/[nodeId]/start",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/nodes/[nodeId]/start/route.ts",nextConfigOutput:"standalone",userland:w}),{workAsyncStorage:N,workUnitAsyncStorage:k,serverHooks:O}=A;function C(){return(0,a.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:k})}async function x(e,t,a){A.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let _="/api/tasks/[id]/nodes/[nodeId]/start/route";_=_.replace(/\/index$/,"")||"/";let S=await A.prepare(e,t,{srcPage:_,multiZoneDraftMode:!1});if(!S)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:I,params:R,nextConfig:y,parsedUrl:v,isDraftMode:T,prerenderManifest:w,routerServerContext:N,isOnDemandRevalidate:k,revalidateOnlyGenerated:O,resolvedPathname:C,clientReferenceManifest:x,serverActionsManifest:D}=S,b=(0,i.normalizeAppPath)(_),M=!!(w.dynamicRoutes[b]||w.routes[C]),j=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,v,!1):t.end("This page could not be found"),null);if(M&&!T){let e=!!w.routes[C],t=w.dynamicRoutes[b];if(t&&!1===t.fallback&&!e){if(y.experimental.adapterPath)return await j();throw new f.NoFallbackError}}let q=null;!M||A.isDev||T||(q="/index"===(q=C)?"/":q);let F=!0===A.isDev||!M,L=M&&!F;D&&x&&(0,s.setManifestsSingleton)({page:_,clientReferenceManifest:x,serverActionsManifest:D});let G=e.method||"GET",P=(0,o.getTracer)(),U=P.getActiveScopeSpan(),H={params:R,prerenderManifest:w,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:F,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:y.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>A.onRequestError(e,t,a,n,N)},sharedContext:{buildId:I}},$=new d.NodeNextRequest(e),W=new d.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest($,(0,u.signalFromNodeResponse)(t));try{let s=async e=>A.handle(V,H).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=P.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=`${G} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${G} ${_}`)}),i=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var o,d;let u=async({previousCacheEntry:r})=>{try{if(!i&&k&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await s(n);e.fetchMetrics=H.renderOpts.fetchMetrics;let d=H.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let u=H.renderOpts.collectedTags;if(!M)return await (0,l.sendResponse)($,W,o,H.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);u&&(t[E.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==H.renderOpts.collectedRevalidate&&!(H.renderOpts.collectedRevalidate>=E.INFINITE_CACHE)&&H.renderOpts.collectedRevalidate,a=void 0===H.renderOpts.collectedExpire||H.renderOpts.collectedExpire>=E.INFINITE_CACHE?void 0:H.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:L,isOnDemandRevalidate:k})},!1,N),t}},p=await A.handleResponse({req:e,nextConfig:y,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:w,isRoutePPREnabled:!1,isOnDemandRevalidate:k,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:i});if(!M)return null;if((null==p||null==(o=p.value)?void 0:o.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});i||t.setHeader("x-nextjs-cache",k?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,h.fromNodeOutgoingHttpHeaders)(p.value.headers);return i&&M||f.delete(E.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,g.getCacheControlHeader)(p.cacheControl)),await (0,l.sendResponse)($,W,new Response(p.value.body,{headers:f,status:p.value.status||200})),null};U?await d(U):await P.withPropagatedContext(e.headers,()=>P.trace(p.BaseServerSpan.handleRequest,{spanName:`${G} ${_}`,kind:o.SpanKind.SERVER,attributes:{"http.method":G,"http.target":e.url}},d))}catch(t){if(t instanceof f.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:L,isOnDemandRevalidate:k})},!1,N),M)throw t;return await (0,l.sendResponse)($,W,new Response(null,{status:500})),null}}e.s(["handler",()=>x,"patchFetch",()=>C,"routeModule",()=>A,"serverHooks",()=>O,"workAsyncStorage",()=>N,"workUnitAsyncStorage",()=>k],69253)}];
48
-
49
- //# sourceMappingURL=_54252651._.js.map
@@ -1,46 +0,0 @@
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 o 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 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 c(e){let{type:t,status:r,metrics:a,output:n,...o}=e;return{type:t,status:r,config:o,output:n??null,metrics:a??null}}function l(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 i(e.taskId,r.id);for(let[t,r]of(a.query(`INSERT INTO execution_graphs
2
- (id, task_id, graph_version, mode, policy, done_criteria, schedule, created_at, updated_at)
3
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
4
- ON CONFLICT (id) DO UPDATE SET
5
- task_id = excluded.task_id,
6
- graph_version = excluded.graph_version,
7
- mode = excluded.mode,
8
- policy = excluded.policy,
9
- done_criteria = excluded.done_criteria,
10
- schedule = excluded.schedule,
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=c(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 o=this.getGraphForTask(a,e.taskId);if(!o)throw new n(e.id);return o})()}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(),i=h(a);return a.transaction(()=>{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:u(t.rows[0].updated_at)}}let a=r.map(()=>"?").join(", "),c=i.query(`SELECT node_id, type, status, config, output, metrics
15
- FROM graph_nodes WHERE graph_id = ? AND node_id IN (${a})`,[e,...r]),l=new Map;for(let e of c.rows)l.set(e.node_id,e);let h=r.filter(e=>!l.has(e));if(h.length>0)throw new o(e,h);for(let a of r){let r=t[a],n=l.get(a);if(!n||!r)continue;let o={...p(d(n.config)),...p(r.configPatch)};void 0!==r.startedAt&&(o.startedAt=r.startedAt),void 0!==r.completedAt&&(o.completedAt=r.completedAt),void 0!==r.actualMinutes&&(o.actualMinutes=r.actualMinutes),i.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(o),e,a])}let g=i.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(),o=h(a);return a.transaction(()=>{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 n(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,s(t.config),s(t.output),s(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,s(r.dataMapping??null)]);let a=o.query(`UPDATE execution_graphs
19
- SET mode = ?, policy = ?, done_criteria = ?, schedule = ?, updated_at = datetime('now')
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]),o=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]),i=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 c=o.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 i.rows){let t=l(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:c,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 f=new g;function m(e,t){return f.createGraph(e,t)}function _(e){return f.getGraph(e)}function S(e,t,r){return f.updateNodeRuntime(e,t,r)}function R(e,t,r){return f.updateGraphStructure(e,t,r)}function I(e,t){return f.appendEvent(e,t)}function y(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 o=r.limit??1e3,i=`SELECT event_type, payload, timestamp
27
- FROM graph_events
28
- WHERE ${a.join(" AND ")}
29
- ORDER BY timestamp ASC, event_type ASC
30
- LIMIT ?`;return n.push(o),h((0,t.getSQLiteDb)()).query(i,n).rows.map(e=>l(e))}function v(e){let r=e.trim();return r?(0,t.getSQLiteDb)().prepare(`SELECT id AS graphId, task_id AS taskId
31
- FROM execution_graphs
32
- WHERE schedule IS NOT NULL
33
- AND json_extract(schedule, '$.rootMessageId') = ?
34
- AND json_extract(schedule, '$.state') = 'active'
35
- ORDER BY updated_at DESC
36
- LIMIT 1`).get(r)??null:null}function T(){return(0,t.getSQLiteDb)().prepare(`SELECT json_extract(schedule, '$.rootMessageId') AS rootMessageId
37
- FROM execution_graphs
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
40
- SET schedule = json_set(schedule, '$.state', 'stopped', '$.tickInProgress', json('false')),
41
- updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
42
- WHERE schedule IS NOT NULL
43
- AND json_extract(schedule, '$.rootMessageId') = ?
44
- AND json_extract(schedule, '$.state') = 'active'`).run(r).changes??0):0}e.s(["GraphNodeNotFoundError",()=>o,"GraphNotFoundError",()=>n,"GraphStore",()=>g,"GraphTaskAlreadyBoundError",()=>i,"GraphVersionConflictError",()=>a,"appendEvent",()=>I,"createGraph",()=>m,"createGraphStore",()=>E,"deactivateSchedulesByRootMessageId",()=>A,"getActiveScheduleForRootMessageId",()=>v,"getActiveScheduleRootMessageIds",()=>T,"getGraph",()=>_,"getGraphEvents",()=>y,"updateGraphStructure",()=>R,"updateNodeRuntime",()=>S])},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"]])},39760,e=>{"use strict";var t=e.i(69719),r=e.i(73122),a=e.i(63279),n=e.i(86582),o=e.i(6838),i=e.i(77036),s=e.i(97812),d=e.i(97681);let u=t.z.object({error:t.z.string().min(1),nodeIds:t.z.array(t.z.string())});async function p(e){try{await (0,s.appendEvent)(e.graphId,(0,r.buildNodeStatusEvent)({actor:e.actor,nodeId:e.nodeId,fromStatus:e.fromStatus,toStatus:e.toStatus,reason:e.reason,projectId:e.projectId}))}catch(e){console.error("Failed to append rejected node transition event",e)}}async function c(e){let t=await (0,o.authorizeGraphMutation)({request:e.request,taskId:e.taskId,action:e.action,requestedProjectId:e.requestedProjectId});if(!t.ok)return t.response;let c=await (0,s.getGraph)(e.taskId);if(!c)return(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Graph not found"},{status:404});let l=c.nodes[e.nodeId];if(!l)return(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Node not found"},{status:404});if(e.allowedFromStatuses&&!e.allowedFromStatuses.includes(l.status))return await p({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:`Rejected: node must be in one of [${e.allowedFromStatuses.join(", ")}] to ${e.action}`}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Cannot ${e.action} node ${e.nodeId}: current status is ${l.status}`},{status:400});try{(0,d.assertValidNodeStatusTransition)(l.type,l.status,e.targetStatus)}catch{return await p({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:"Rejected invalid transition"}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Invalid node transition for ${e.nodeId}: ${l.status} -> ${e.targetStatus}`},{status:400})}if("gate"===l.type&&"pending"===l.status&&"passed"===e.targetStatus&&!function(e){if("gate"!==e.type)return!1;let t=e.verificationStrategy.checks??[];return"progress"===e.gateType&&0===t.length&&"auto"===e.verificationStrategy.type}(l))return await p({graphId:c.id,actor:t.actor,projectId:t.projectId,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:"Rejected required gate bypass"}),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:`Required gate transition blocked for node ${e.nodeId}`},{status:400});try{let o={...e.patch??{},status:e.targetStatus};e.resetWorkAttempts&&"work"===l.type&&(o.configPatch={...o.configPatch??{},attempts:0});let d={[e.nodeId]:{...o}},u=await (0,s.updateNodeRuntime)(c.id,d,e.ifMatchGraphVersion??c.graphVersion),p=new Date().toISOString();if(await (0,s.appendEvent)(c.id,(0,r.buildNodeStatusEvent)({actor:t.actor,nodeId:e.nodeId,fromStatus:l.status,toStatus:e.targetStatus,reason:e.reason,timestamp:p,projectId:t.projectId})),("gate"===l.type||"node_verify"===e.action)&&("passed"===e.targetStatus||"failed"===e.targetStatus)){let a="passed"===e.targetStatus;(0,i.recordGateVerificationResult)(a),await (0,s.appendEvent)(c.id,(0,r.buildGateVerificationEvent)({actor:t.actor,nodeId:e.nodeId,timestamp:p,result:{passed:a,checks:e.gateChecks??[],verifiedAt:p,verifiedBy:"user"===t.actor.actorType?"human":"agent"},projectId:t.projectId}))}if(e.consumeVerifyBudget||"node_verify"===e.action){let a=Math.max(0,c.policy.verifyBudgetRemaining-1);await (0,s.appendEvent)(c.id,(0,r.buildBudgetConsumedEvent)({actor:t.actor,budgetType:"verify",remaining:a,triggerNodeId:e.nodeId,timestamp:p,projectId:t.projectId}))}return(0,n.jsonWithSchema)(a.NodeMutationResponseSchema,{graphId:c.id,nodeId:e.nodeId,graphVersion:u.graphVersion,updatedAt:u.updatedAt})}catch(e){if(e instanceof s.GraphVersionConflictError)return(0,n.graphConflictResponse)(e);if(e instanceof s.GraphNodeNotFoundError)return(0,n.jsonWithSchema)(u,{error:e.message,nodeIds:e.nodeIds},{status:404});return console.error("Error mutating node status:",e),(0,n.jsonWithSchema)(a.ErrorResponseSchema,{error:"Failed to mutate node status"},{status:500})}}e.s(["applyNodeStatusMutation",()=>c])},33225,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),d=e.i(16795),u=e.i(87718),p=e.i(95169),c=e.i(47587),l=e.i(66012),h=e.i(70101),g=e.i(74838),E=e.i(10372),f=e.i(93695);e.i(52474);var m=e.i(220),_=e.i(63279),S=e.i(86582),R=e.i(39760);async function I(e,{params:t}){let{id:r,nodeId:a}=await t,n=(0,S.normalizeTaskId)(r),o=(0,S.normalizeNodeId)(a);if(!n||!o)return(0,S.jsonWithSchema)(_.ErrorResponseSchema,{error:"Invalid taskId or nodeId"},{status:400});let i=await (0,S.parseJsonBody)(e,_.CompleteNodeRequestSchema);if(!i.ok)return i.response;let s=i.data;return(0,R.applyNodeStatusMutation)({request:e,taskId:n,nodeId:o,action:"node_complete",requestedProjectId:s.projectId??s.project_id,ifMatchGraphVersion:s.ifMatchGraphVersion,targetStatus:"done",reason:"node completed",patch:{output:s.output,metrics:s.metrics,completedAt:s.completedAt??new Date().toISOString(),...void 0!==s.actualMinutes?{actualMinutes:s.actualMinutes}:{}}})}e.s(["POST",()=>I],55764);var y=e.i(55764);let v=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/nodes/[nodeId]/complete/route",pathname:"/api/tasks/[id]/nodes/[nodeId]/complete",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/nodes/[nodeId]/complete/route.ts",nextConfigOutput:"standalone",userland:y}),{workAsyncStorage:T,workUnitAsyncStorage:A,serverHooks:N}=v;function w(){return(0,a.patchFetch)({workAsyncStorage:T,workUnitAsyncStorage:A})}async function C(e,t,a){v.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let _="/api/tasks/[id]/nodes/[nodeId]/complete/route";_=_.replace(/\/index$/,"")||"/";let S=await v.prepare(e,t,{srcPage:_,multiZoneDraftMode:!1});if(!S)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:R,params:I,nextConfig:y,parsedUrl:T,isDraftMode:A,prerenderManifest:N,routerServerContext:w,isOnDemandRevalidate:C,revalidateOnlyGenerated:O,resolvedPathname:x,clientReferenceManifest:k,serverActionsManifest:D}=S,M=(0,s.normalizeAppPath)(_),j=!!(N.dynamicRoutes[M]||N.routes[x]),b=async()=>((null==w?void 0:w.render404)?await w.render404(e,t,T,!1):t.end("This page could not be found"),null);if(j&&!A){let e=!!N.routes[x],t=N.dynamicRoutes[M];if(t&&!1===t.fallback&&!e){if(y.experimental.adapterPath)return await b();throw new f.NoFallbackError}}let L=null;!j||v.isDev||A||(L="/index"===(L=x)?"/":L);let q=!0===v.isDev||!j,F=j&&!q;D&&k&&(0,i.setManifestsSingleton)({page:_,clientReferenceManifest:k,serverActionsManifest:D});let U=e.method||"GET",G=(0,o.getTracer)(),P=G.getActiveScopeSpan(),H={params:I,prerenderManifest:N,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:q,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:y.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>v.onRequestError(e,t,a,n,w)},sharedContext:{buildId:R}},$=new d.NodeNextRequest(e),W=new d.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest($,(0,u.signalFromNodeResponse)(t));try{let i=async e=>v.handle(V,H).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")!==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} ${_}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var o,d;let u=async({previousCacheEntry:r})=>{try{if(!s&&C&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await i(n);e.fetchMetrics=H.renderOpts.fetchMetrics;let d=H.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let u=H.renderOpts.collectedTags;if(!j)return await (0,l.sendResponse)($,W,o,H.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);u&&(t[E.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==H.renderOpts.collectedRevalidate&&!(H.renderOpts.collectedRevalidate>=E.INFINITE_CACHE)&&H.renderOpts.collectedRevalidate,a=void 0===H.renderOpts.collectedExpire||H.renderOpts.collectedExpire>=E.INFINITE_CACHE?void 0:H.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await v.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:C})},!1,w),t}},p=await v.handleResponse({req:e,nextConfig:y,cacheKey:L,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:O,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:s});if(!j)return null;if((null==p||null==(o=p.value)?void 0:o.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",C?"REVALIDATED":p.isMiss?"MISS":p.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,h.fromNodeOutgoingHttpHeaders)(p.value.headers);return s&&j||f.delete(E.NEXT_CACHE_TAGS_HEADER),!p.cacheControl||t.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,g.getCacheControlHeader)(p.cacheControl)),await (0,l.sendResponse)($,W,new Response(p.value.body,{headers:f,status:p.value.status||200})),null};P?await d(P):await G.withPropagatedContext(e.headers,()=>G.trace(p.BaseServerSpan.handleRequest,{spanName:`${U} ${_}`,kind:o.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},d))}catch(t){if(t instanceof f.NoFallbackError||await v.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:C})},!1,w),j)throw t;return await (0,l.sendResponse)($,W,new Response(null,{status:500})),null}}e.s(["handler",()=>C,"patchFetch",()=>w,"routeModule",()=>v,"serverHooks",()=>N,"workAsyncStorage",()=>T,"workUnitAsyncStorage",()=>A],33225)}];
45
-
46
- //# sourceMappingURL=_818a89c4._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[73122,77036,e=>{"use strict";function t(){return new Date().toISOString()}function r(e,t,r){return{actorId:e.actorId,actorType:e.actorType,action:t,...r?{projectId:r}:{}}}function a(e){return{eventType:"graph_created",timestamp:e.timestamp??t(),mode:e.mode,nodeCount:e.nodeCount,edgeCount:e.edgeCount,audit:r(e.actor,"graph_create",e.projectId)}}function n(e){return{eventType:"node_status",nodeId:e.nodeId,fromStatus:e.fromStatus,toStatus:e.toStatus,timestamp:e.timestamp??t(),...e.reason?{reason:e.reason}:{},audit:r(e.actor,"node_status_transition",e.projectId)}}function o(e){return{eventType:"gate_verification",nodeId:e.nodeId,timestamp:e.timestamp??t(),result:e.result,audit:r(e.actor,"gate_verification",e.projectId)}}function i(e){return{eventType:"budget_consumed",budgetType:e.budgetType,remaining:e.remaining,triggerNodeId:e.triggerNodeId,timestamp:e.timestamp??t(),audit:r(e.actor,"budget_consumption",e.projectId)}}function s(e){return{eventType:"replan",fromVersion:e.fromVersion,toVersion:e.toVersion,timestamp:e.timestamp??t(),reason:e.reason,triggeredBy:e.triggeredBy??("user"===e.actor.actorType?"human":"agent"),triggeredAtNodeId:e.triggeredAtNodeId,changes:e.changes,audit:r(e.actor,"graph_replan",e.projectId)}}function d(e){return{eventType:"rollback",toCheckpoint:e.toCheckpoint,timestamp:e.timestamp??t(),reason:e.reason,triggeredBy:e.triggeredBy??("user"===e.actor.actorType?"human":"agent"),audit:r(e.actor,"graph_rollback",e.projectId)}}e.s(["buildBudgetConsumedEvent",()=>i,"buildGateVerificationEvent",()=>o,"buildGraphCreatedEvent",()=>a,"buildNodeStatusEvent",()=>n,"buildReplanEvent",()=>s,"buildRollbackEvent",()=>d],73122);let p={graphCreateCount:0,replanCount:0,rollbackCount:0,migrationFailureCount:0,gatePassCount:0,gateFailCount:0};function u(){p.graphCreateCount+=1}function l(){p.replanCount+=1}function c(){p.rollbackCount+=1}function g(){p.migrationFailureCount+=1}function h(e){if(e){p.gatePassCount+=1;return}p.gateFailCount+=1}e.s(["recordGateVerificationResult",()=>h,"recordGraphCreate",()=>u,"recordMigrationFailure",()=>g,"recordReplan",()=>l,"recordRollback",()=>c],77036)},49684,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),d=e.i(16795),p=e.i(87718),u=e.i(95169),l=e.i(47587),c=e.i(66012),g=e.i(70101),h=e.i(74838),m=e.i(10372),f=e.i(93695);e.i(52474);var y=e.i(220),R=e.i(69719),v=e.i(73122),C=e.i(63279),E=e.i(86582),b=e.i(6838),A=e.i(77036),w=e.i(97812),S=e.i(61860);let I=R.z.object({graphId:R.z.string().min(1),graphVersion:R.z.number(),updatedAt:R.z.string().min(1),replanBudgetRemaining:R.z.number()});async function T(e,{params:t}){let r,{id:a}=await t,n=(0,E.normalizeTaskId)(a);if(!n)return(0,E.jsonWithSchema)(C.ErrorResponseSchema,{error:"Invalid task id"},{status:400});let o=await (0,E.parseJsonBody)(e,C.ReplanRequestSchema);if(!o.ok)return o.response;let i=o.data,s=await (0,b.authorizeGraphMutation)({request:e,taskId:n,action:"replan",requestedProjectId:i.projectId??i.project_id});if(!s.ok)return s.response;let d=await (0,w.getGraph)(n);if(!d)return(0,E.jsonWithSchema)(C.ErrorResponseSchema,{error:"Graph not found"},{status:404});if(!d.nodes[i.triggeredAtNodeId])return(0,E.jsonWithSchema)(C.ErrorResponseSchema,{error:"triggeredAtNodeId does not exist in graph"},{status:400});if(d.policy.replanBudgetRemaining<=0)return(0,E.jsonWithSchema)(C.ErrorResponseSchema,{error:"Replan budget exhausted"},{status:409});let p=i.proposedChanges??{},u={...d.nodes},l=Object.entries(p.addNodes??{});for(let[e,t]of l)u[e]=function(e,t){let r="gate"===t.type||"fork"===t.type||"join"===t.type||"conditional"===t.type||"function"===t.type?t.type:"work",a=Array.isArray(t.deps)?t.deps.filter(e=>"string"==typeof e):[],n="string"==typeof t.status?t.status:"pending";return"work"===r?{type:"work",status:n,deps:a,title:"string"==typeof t.title&&t.title.trim().length>0?t.title:e,attempts:"number"==typeof t.attempts?t.attempts:0,maxAttempts:"number"==typeof t.maxAttempts?t.maxAttempts:1,retryPolicy:{backoffMs:"number"==typeof t.retryPolicy?.backoffMs?t.retryPolicy.backoffMs:1e3,onExhaust:t.retryPolicy?.onExhaust??"escalate"}}:"gate"===r?{type:"gate",status:n,deps:a,gateType:"progress"===t.gateType||"quality_gate"===t.gateType||"design_gate"===t.gateType||"handoff_gate"===t.gateType||"approval_gate"===t.gateType?t.gateType:"progress",required:!!t.required,verificationStrategy:{type:t.verificationStrategy?.type??"auto",checks:t.verificationStrategy?.checks??[]}}:"fork"===r?{type:"fork",status:n,deps:a}:"join"===r?{type:"join",status:n,deps:a,joinStrategy:"all"===t.joinStrategy||"any"===t.joinStrategy||"n_of_m"===t.joinStrategy?t.joinStrategy:"all"}:"function"===r?{type:"function",status:n,deps:a,kind:"mcp"===t.kind?"mcp":"bash",title:"string"==typeof t.title&&t.title.trim().length>0?t.title:e,description:"string"==typeof t.description&&t.description.trim().length>0?t.description:void 0,command:"string"==typeof t.command&&t.command.trim().length>0?t.command:e,...t.args&&"object"==typeof t.args&&!Array.isArray(t.args)?{args:t.args}:{},..."number"==typeof t.timeoutMs?{timeoutMs:t.timeoutMs}:{},...t.output&&"object"==typeof t.output&&!Array.isArray(t.output)?{output:t.output}:{}}:{type:"conditional",status:n,deps:a,condition:{expression:"string"==typeof t.condition?.expression&&t.condition.expression||"true",inputFrom:"string"==typeof t.condition?.inputFrom?t.condition.inputFrom||a[0]||e:a[0]||e},thenBranch:Array.isArray(t.thenBranch)?t.thenBranch.filter(e=>"string"==typeof e):[],elseBranch:Array.isArray(t.elseBranch)?t.elseBranch.filter(e=>"string"==typeof e):[]}}(e,t);let c=(p.removeNodes??[]).filter(e=>"string"==typeof e);for(let e of c)delete u[e];for(let e of(r=Array.isArray(p.rewireEdges)?p.rewireEdges:d.edges.filter(e=>!c.includes(e.from)&&!c.includes(e.to)),Object.values(u)))e.deps=e.deps.filter(e=>e in u);let g=p.estimateDeltas??{};for(let[e,t]of Object.entries(g)){let r=u[e];if(!r||"work"!==r.type)continue;let a=(r.estimateMinutes??0)+t;r.estimateMinutes=a<0?0:a}if(!(0,S.validateGraph)({...d,nodes:u,edges:r}).valid)return(0,E.jsonWithSchema)(C.ErrorResponseSchema,{error:"Invalid replan graph"},{status:400});try{let e={...d.policy,replanBudgetRemaining:Math.max(0,d.policy.replanBudgetRemaining-1)},t=await (0,w.updateGraphStructure)(d.id,{mode:d.mode,nodes:u,edges:r,policy:e,doneCriteria:d.doneCriteria},i.ifMatchGraphVersion);return await (0,w.appendEvent)(d.id,(0,v.buildReplanEvent)({actor:s.actor,fromVersion:d.graphVersion,toVersion:t.graphVersion,reason:i.reason,triggeredAtNodeId:i.triggeredAtNodeId,changes:{addedNodes:l.map(([e])=>e),removedNodes:c,rewiredDeps:(p.rewireEdges??[]).map(e=>`${e.from}->${e.to}`),estimateDeltas:g},projectId:s.projectId})),await (0,w.appendEvent)(d.id,(0,v.buildBudgetConsumedEvent)({actor:s.actor,budgetType:"replan",remaining:e.replanBudgetRemaining,triggerNodeId:i.triggeredAtNodeId,projectId:s.projectId})),(0,A.recordReplan)(),(0,E.jsonWithSchema)(I,{graphId:d.id,graphVersion:t.graphVersion,updatedAt:t.updatedAt,replanBudgetRemaining:e.replanBudgetRemaining})}catch(e){if(e instanceof w.GraphVersionConflictError)return(0,E.graphConflictResponse)(e);return console.error("Error handling graph replan:",e),(0,E.jsonWithSchema)(C.ErrorResponseSchema,{error:"Failed to replan graph"},{status:500})}}e.s(["POST",()=>T],77498);var k=e.i(77498);let x=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/graph/replan/route",pathname:"/api/tasks/[id]/graph/replan",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/graph/replan/route.ts",nextConfigOutput:"standalone",userland:k}),{workAsyncStorage:j,workUnitAsyncStorage:_,serverHooks:N}=x;function P(){return(0,a.patchFetch)({workAsyncStorage:j,workUnitAsyncStorage:_})}async function O(e,t,a){x.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let R="/api/tasks/[id]/graph/replan/route";R=R.replace(/\/index$/,"")||"/";let v=await x.prepare(e,t,{srcPage:R,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:C,params:E,nextConfig:b,parsedUrl:A,isDraftMode:w,prerenderManifest:S,routerServerContext:I,isOnDemandRevalidate:T,revalidateOnlyGenerated:k,resolvedPathname:j,clientReferenceManifest:_,serverActionsManifest:N}=v,P=(0,s.normalizeAppPath)(R),O=!!(S.dynamicRoutes[P]||S.routes[j]),B=async()=>((null==I?void 0:I.render404)?await I.render404(e,t,A,!1):t.end("This page could not be found"),null);if(O&&!w){let e=!!S.routes[j],t=S.dynamicRoutes[P];if(t&&!1===t.fallback&&!e){if(b.experimental.adapterPath)return await B();throw new f.NoFallbackError}}let M=null;!O||x.isDev||w||(M="/index"===(M=j)?"/":M);let q=!0===x.isDev||!O,V=O&&!q;N&&_&&(0,i.setManifestsSingleton)({page:R,clientReferenceManifest:_,serverActionsManifest:N});let F=e.method||"GET",H=(0,o.getTracer)(),D=H.getActiveScopeSpan(),U={params:E,prerenderManifest:S,renderOpts:{experimental:{authInterrupts:!!b.experimental.authInterrupts},cacheComponents:!!b.cacheComponents,supportsDynamicResponse:q,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:b.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>x.onRequestError(e,t,a,n,I)},sharedContext:{buildId:C}},G=new d.NodeNextRequest(e),$=new d.NodeNextResponse(t),W=p.NextRequestAdapter.fromNodeNextRequest(G,(0,p.signalFromNodeResponse)(t));try{let i=async e=>x.handle(W,U).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=H.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.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=`${F} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${F} ${R}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var o,d;let p=async({previousCacheEntry:r})=>{try{if(!s&&T&&k&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await i(n);e.fetchMetrics=U.renderOpts.fetchMetrics;let d=U.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let p=U.renderOpts.collectedTags;if(!O)return await (0,c.sendResponse)(G,$,o,U.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,g.toNodeOutgoingHttpHeaders)(o.headers);p&&(t[m.NEXT_CACHE_TAGS_HEADER]=p),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,a=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:o.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:R,routeType:"route",revalidateReason:(0,l.getRevalidateReason)({isStaticGeneration:V,isOnDemandRevalidate:T})},!1,I),t}},u=await x.handleResponse({req:e,nextConfig:b,cacheKey:M,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:k,responseGenerator:p,waitUntil:a.waitUntil,isMinimalMode:s});if(!O)return null;if((null==u||null==(o=u.value)?void 0:o.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(d=u.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});s||t.setHeader("x-nextjs-cache",T?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),w&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,g.fromNodeOutgoingHttpHeaders)(u.value.headers);return s&&O||f.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,h.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(G,$,new Response(u.value.body,{headers:f,status:u.value.status||200})),null};D?await d(D):await H.withPropagatedContext(e.headers,()=>H.trace(u.BaseServerSpan.handleRequest,{spanName:`${F} ${R}`,kind:o.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},d))}catch(t){if(t instanceof f.NoFallbackError||await x.onRequestError(e,t,{routerKind:"App Router",routePath:P,routeType:"route",revalidateReason:(0,l.getRevalidateReason)({isStaticGeneration:V,isOnDemandRevalidate:T})},!1,I),O)throw t;return await (0,c.sendResponse)(G,$,new Response(null,{status:500})),null}}e.s(["handler",()=>O,"patchFetch",()=>P,"routeModule",()=>x,"serverHooks",()=>N,"workAsyncStorage",()=>j,"workUnitAsyncStorage",()=>_],49684)}];
2
-
3
- //# sourceMappingURL=_a4a21d4f._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[73122,77036,e=>{"use strict";function t(){return new Date().toISOString()}function r(e,t,r){return{actorId:e.actorId,actorType:e.actorType,action:t,...r?{projectId:r}:{}}}function a(e){return{eventType:"graph_created",timestamp:e.timestamp??t(),mode:e.mode,nodeCount:e.nodeCount,edgeCount:e.edgeCount,audit:r(e.actor,"graph_create",e.projectId)}}function n(e){return{eventType:"node_status",nodeId:e.nodeId,fromStatus:e.fromStatus,toStatus:e.toStatus,timestamp:e.timestamp??t(),...e.reason?{reason:e.reason}:{},audit:r(e.actor,"node_status_transition",e.projectId)}}function o(e){return{eventType:"gate_verification",nodeId:e.nodeId,timestamp:e.timestamp??t(),result:e.result,audit:r(e.actor,"gate_verification",e.projectId)}}function i(e){return{eventType:"budget_consumed",budgetType:e.budgetType,remaining:e.remaining,triggerNodeId:e.triggerNodeId,timestamp:e.timestamp??t(),audit:r(e.actor,"budget_consumption",e.projectId)}}function s(e){return{eventType:"replan",fromVersion:e.fromVersion,toVersion:e.toVersion,timestamp:e.timestamp??t(),reason:e.reason,triggeredBy:e.triggeredBy??("user"===e.actor.actorType?"human":"agent"),triggeredAtNodeId:e.triggeredAtNodeId,changes:e.changes,audit:r(e.actor,"graph_replan",e.projectId)}}function d(e){return{eventType:"rollback",toCheckpoint:e.toCheckpoint,timestamp:e.timestamp??t(),reason:e.reason,triggeredBy:e.triggeredBy??("user"===e.actor.actorType?"human":"agent"),audit:r(e.actor,"graph_rollback",e.projectId)}}e.s(["buildBudgetConsumedEvent",()=>i,"buildGateVerificationEvent",()=>o,"buildGraphCreatedEvent",()=>a,"buildNodeStatusEvent",()=>n,"buildReplanEvent",()=>s,"buildRollbackEvent",()=>d],73122);let u={graphCreateCount:0,replanCount:0,rollbackCount:0,migrationFailureCount:0,gatePassCount:0,gateFailCount:0};function l(){u.graphCreateCount+=1}function c(){u.replanCount+=1}function p(){u.rollbackCount+=1}function h(){u.migrationFailureCount+=1}function g(e){if(e){u.gatePassCount+=1;return}u.gateFailCount+=1}e.s(["recordGateVerificationResult",()=>g,"recordGraphCreate",()=>l,"recordMigrationFailure",()=>h,"recordReplan",()=>c,"recordRollback",()=>p],77036)},40931,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),d=e.i(16795),u=e.i(87718),l=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),g=e.i(74838),m=e.i(10372),f=e.i(93695);e.i(52474);var R=e.i(220),C=e.i(69719),v=e.i(73122),E=e.i(63279),b=e.i(86582),k=e.i(6838),y=e.i(77036),w=e.i(97812);let I=C.z.object({graphId:C.z.string().min(1),graphVersion:C.z.number(),updatedAt:C.z.string().min(1),checkpoint:C.z.string().min(1)});async function S(e,{params:t}){let{id:r}=await t,a=(0,b.normalizeTaskId)(r);if(!a)return(0,b.jsonWithSchema)(E.ErrorResponseSchema,{error:"Invalid task id"},{status:400});let n=await (0,b.parseJsonBody)(e,E.RollbackRequestSchema);if(!n.ok)return n.response;let o=n.data,i=await (0,k.authorizeGraphMutation)({request:e,taskId:a,action:"rollback",requestedProjectId:o.projectId??o.project_id});if(!i.ok)return i.response;let s=await (0,w.getGraph)(a);if(!s)return(0,b.jsonWithSchema)(E.ErrorResponseSchema,{error:"Graph not found"},{status:404});if(!s.nodes[o.toCheckpoint])return(0,b.jsonWithSchema)(E.ErrorResponseSchema,{error:"toCheckpoint does not exist in graph"},{status:400});try{let e=await (0,w.updateGraphStructure)(s.id,{mode:s.mode,policy:s.policy,doneCriteria:s.doneCriteria},o.ifMatchGraphVersion);return await (0,w.appendEvent)(s.id,(0,v.buildRollbackEvent)({actor:i.actor,toCheckpoint:o.toCheckpoint,reason:o.reason?.trim()||"rollback requested",projectId:i.projectId})),(0,y.recordRollback)(),(0,b.jsonWithSchema)(I,{graphId:s.id,graphVersion:e.graphVersion,updatedAt:e.updatedAt,checkpoint:o.toCheckpoint})}catch(e){if(e instanceof w.GraphVersionConflictError)return(0,b.graphConflictResponse)(e);return console.error("Error handling graph rollback:",e),(0,b.jsonWithSchema)(E.ErrorResponseSchema,{error:"Failed to rollback graph"},{status:500})}}e.s(["POST",()=>S],7846);var T=e.i(7846);let A=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/tasks/[id]/graph/rollback/route",pathname:"/api/tasks/[id]/graph/rollback",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/tasks/[id]/graph/rollback/route.ts",nextConfigOutput:"standalone",userland:T}),{workAsyncStorage:x,workUnitAsyncStorage:_,serverHooks:N}=A;function P(){return(0,a.patchFetch)({workAsyncStorage:x,workUnitAsyncStorage:_})}async function j(e,t,a){A.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let C="/api/tasks/[id]/graph/rollback/route";C=C.replace(/\/index$/,"")||"/";let v=await A.prepare(e,t,{srcPage:C,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:E,params:b,nextConfig:k,parsedUrl:y,isDraftMode:w,prerenderManifest:I,routerServerContext:S,isOnDemandRevalidate:T,revalidateOnlyGenerated:x,resolvedPathname:_,clientReferenceManifest:N,serverActionsManifest:P}=v,j=(0,s.normalizeAppPath)(C),O=!!(I.dynamicRoutes[j]||I.routes[_]),q=async()=>((null==S?void 0:S.render404)?await S.render404(e,t,y,!1):t.end("This page could not be found"),null);if(O&&!w){let e=!!I.routes[_],t=I.dynamicRoutes[j];if(t&&!1===t.fallback&&!e){if(k.experimental.adapterPath)return await q();throw new f.NoFallbackError}}let H=null;!O||A.isDev||w||(H="/index"===(H=_)?"/":H);let U=!0===A.isDev||!O,M=O&&!U;P&&N&&(0,i.setManifestsSingleton)({page:C,clientReferenceManifest:N,serverActionsManifest:P});let D=e.method||"GET",F=(0,o.getTracer)(),V=F.getActiveScopeSpan(),G={params:b,prerenderManifest:I,renderOpts:{experimental:{authInterrupts:!!k.experimental.authInterrupts},cacheComponents:!!k.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:k.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>A.onRequestError(e,t,a,n,S)},sharedContext:{buildId:E}},B=new d.NodeNextRequest(e),$=new d.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(B,(0,u.signalFromNodeResponse)(t));try{let i=async e=>A.handle(z,G).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")!==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=`${D} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t)}else e.updateName(`${D} ${C}`)}),s=!!(0,n.getRequestMeta)(e,"minimalMode"),d=async n=>{var o,d;let u=async({previousCacheEntry:r})=>{try{if(!s&&T&&x&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await i(n);e.fetchMetrics=G.renderOpts.fetchMetrics;let d=G.renderOpts.pendingWaitUntil;d&&a.waitUntil&&(a.waitUntil(d),d=void 0);let u=G.renderOpts.collectedTags;if(!O)return await (0,p.sendResponse)(B,$,o,G.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(o.headers);u&&(t[m.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==G.renderOpts.collectedRevalidate&&!(G.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&G.renderOpts.collectedRevalidate,a=void 0===G.renderOpts.collectedExpire||G.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:G.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await A.onRequestError(e,t,{routerKind:"App Router",routePath:C,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,S),t}},l=await A.handleResponse({req:e,nextConfig:k,cacheKey:H,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:I,isRoutePPREnabled:!1,isOnDemandRevalidate:T,revalidateOnlyGenerated:x,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:s});if(!O)return null;if((null==l||null==(o=l.value)?void 0:o.kind)!==R.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",T?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),w&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let f=(0,h.fromNodeOutgoingHttpHeaders)(l.value.headers);return s&&O||f.delete(m.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||t.getHeader("Cache-Control")||f.get("Cache-Control")||f.set("Cache-Control",(0,g.getCacheControlHeader)(l.cacheControl)),await (0,p.sendResponse)(B,$,new Response(l.value.body,{headers:f,status:l.value.status||200})),null};V?await d(V):await F.withPropagatedContext(e.headers,()=>F.trace(l.BaseServerSpan.handleRequest,{spanName:`${D} ${C}`,kind:o.SpanKind.SERVER,attributes:{"http.method":D,"http.target":e.url}},d))}catch(t){if(t instanceof f.NoFallbackError||await A.onRequestError(e,t,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:T})},!1,S),O)throw t;return await (0,p.sendResponse)(B,$,new Response(null,{status:500})),null}}e.s(["handler",()=>j,"patchFetch",()=>P,"routeModule",()=>A,"serverHooks",()=>N,"workAsyncStorage",()=>x,"workUnitAsyncStorage",()=>_],40931)}];
2
-
3
- //# sourceMappingURL=_a759d52b._.js.map