@mndrk/agx 2.0.48 → 2.0.49

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 (345) hide show
  1. package/cloud-runtime/standalone/.next/BUILD_ID +1 -1
  2. package/cloud-runtime/standalone/.next/build-manifest.json +2 -2
  3. package/cloud-runtime/standalone/.next/prerender-manifest.json +3 -3
  4. package/cloud-runtime/standalone/.next/server/app/_global-error.html +2 -2
  5. package/cloud-runtime/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/cloud-runtime/standalone/.next/server/app/_not-found.html +2 -2
  12. package/cloud-runtime/standalone/.next/server/app/_not-found.rsc +1 -1
  13. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  14. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  16. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/cloud-runtime/standalone/.next/server/app/agents.html +2 -2
  20. package/cloud-runtime/standalone/.next/server/app/agents.rsc +1 -1
  21. package/cloud-runtime/standalone/.next/server/app/agents.segments/_full.segment.rsc +1 -1
  22. package/cloud-runtime/standalone/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  23. package/cloud-runtime/standalone/.next/server/app/agents.segments/_index.segment.rsc +1 -1
  24. package/cloud-runtime/standalone/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
  25. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +1 -1
  26. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents.segment.rsc +1 -1
  27. package/cloud-runtime/standalone/.next/server/app/api/agent-specs/route.js +1 -1
  28. package/cloud-runtime/standalone/.next/server/app/api/agent-specs/route.js.nft.json +1 -1
  29. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/profile/route.js +1 -1
  30. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/profile/route.js.nft.json +1 -1
  31. package/cloud-runtime/standalone/.next/server/app/api/agents/export/route.js +1 -1
  32. package/cloud-runtime/standalone/.next/server/app/api/agents/export/route.js.nft.json +1 -1
  33. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js +13 -7
  34. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
  35. package/cloud-runtime/standalone/.next/server/app/api/file-search/route.js.nft.json +1 -1
  36. package/cloud-runtime/standalone/.next/server/app/api/health/route.js +1 -1
  37. package/cloud-runtime/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
  38. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route.js +1 -1
  39. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route.js.nft.json +1 -1
  40. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js +1 -1
  41. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js.nft.json +1 -1
  42. package/cloud-runtime/standalone/.next/server/app/api/linear/callback/route.js +1 -1
  43. package/cloud-runtime/standalone/.next/server/app/api/linear/callback/route.js.nft.json +1 -1
  44. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/context/route.js +1 -1
  45. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/context/route.js.nft.json +1 -1
  46. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/route.js +1 -1
  47. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/route.js.nft.json +1 -1
  48. package/cloud-runtime/standalone/.next/server/app/api/linear/options/route.js +1 -1
  49. package/cloud-runtime/standalone/.next/server/app/api/linear/options/route.js.nft.json +1 -1
  50. package/cloud-runtime/standalone/.next/server/app/api/linear/status/route.js.nft.json +1 -1
  51. package/cloud-runtime/standalone/.next/server/app/api/memories/route.js +1 -1
  52. package/cloud-runtime/standalone/.next/server/app/api/memories/route.js.nft.json +1 -1
  53. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js +1 -1
  54. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js.nft.json +1 -1
  55. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js +1 -1
  56. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js.nft.json +1 -1
  57. package/cloud-runtime/standalone/.next/server/app/api/participants/route.js +1 -1
  58. package/cloud-runtime/standalone/.next/server/app/api/participants/route.js.nft.json +1 -1
  59. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js +1 -1
  60. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js.nft.json +1 -1
  61. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js +1 -1
  62. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js.nft.json +1 -1
  63. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js +1 -1
  64. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js.nft.json +1 -1
  65. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js +1 -1
  66. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  67. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js +1 -1
  68. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js.nft.json +1 -1
  69. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js +1 -1
  70. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js.nft.json +1 -1
  71. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js +1 -1
  72. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js.nft.json +1 -1
  73. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js +1 -1
  74. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  75. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/agents/route.js +1 -1
  76. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/agents/route.js.nft.json +1 -1
  77. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/poll/route.js +1 -1
  78. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/poll/route.js.nft.json +1 -1
  79. package/cloud-runtime/standalone/.next/server/app/api/providers/route.js.nft.json +1 -1
  80. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js +1 -1
  81. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js.nft.json +1 -1
  82. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js +2 -2
  83. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js.nft.json +1 -1
  84. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js +14 -6
  85. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js.nft.json +1 -1
  86. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js +13 -5
  87. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js.nft.json +1 -1
  88. package/cloud-runtime/standalone/.next/server/app/api/status/route.js.nft.json +1 -1
  89. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js +1 -1
  90. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js.nft.json +1 -1
  91. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js +1 -1
  92. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js.nft.json +1 -1
  93. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js +1 -1
  94. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js.nft.json +1 -1
  95. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js +1 -1
  96. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js.nft.json +1 -1
  97. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js +1 -1
  98. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js.nft.json +1 -1
  99. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js +1 -1
  100. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js.nft.json +1 -1
  101. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js +1 -1
  102. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js.nft.json +1 -1
  103. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js +1 -1
  104. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js.nft.json +1 -1
  105. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js +1 -1
  106. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js.nft.json +1 -1
  107. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js +1 -1
  108. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js.nft.json +1 -1
  109. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js +1 -1
  110. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js.nft.json +1 -1
  111. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js +1 -1
  112. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js.nft.json +1 -1
  113. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js +3 -4
  114. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js.nft.json +1 -1
  115. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js +1 -1
  116. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js.nft.json +1 -1
  117. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js +1 -1
  118. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js.nft.json +1 -1
  119. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js +1 -1
  120. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js.nft.json +1 -1
  121. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js +1 -1
  122. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js.nft.json +1 -1
  123. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js +1 -1
  124. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js.nft.json +1 -1
  125. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js +1 -1
  126. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js.nft.json +1 -1
  127. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js +3 -4
  128. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js.nft.json +1 -1
  129. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js +3 -4
  130. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js.nft.json +1 -1
  131. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js +3 -4
  132. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js.nft.json +1 -1
  133. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js +3 -4
  134. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js.nft.json +1 -1
  135. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js +3 -4
  136. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js.nft.json +1 -1
  137. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js +4 -5
  138. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js.nft.json +1 -1
  139. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js +1 -1
  140. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
  141. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js +1 -1
  142. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js.nft.json +1 -1
  143. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js +1 -1
  144. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js.nft.json +1 -1
  145. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js +2 -2
  146. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js.nft.json +1 -1
  147. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js +1 -1
  148. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js.nft.json +1 -1
  149. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js +1 -1
  150. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js.nft.json +1 -1
  151. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js +1 -1
  152. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js.nft.json +1 -1
  153. package/cloud-runtime/standalone/.next/server/app/automations.html +2 -2
  154. package/cloud-runtime/standalone/.next/server/app/automations.rsc +1 -1
  155. package/cloud-runtime/standalone/.next/server/app/automations.segments/_full.segment.rsc +1 -1
  156. package/cloud-runtime/standalone/.next/server/app/automations.segments/_head.segment.rsc +1 -1
  157. package/cloud-runtime/standalone/.next/server/app/automations.segments/_index.segment.rsc +1 -1
  158. package/cloud-runtime/standalone/.next/server/app/automations.segments/_tree.segment.rsc +1 -1
  159. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations/__PAGE__.segment.rsc +1 -1
  160. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations.segment.rsc +1 -1
  161. package/cloud-runtime/standalone/.next/server/app/board.html +2 -2
  162. package/cloud-runtime/standalone/.next/server/app/board.rsc +1 -1
  163. package/cloud-runtime/standalone/.next/server/app/board.segments/_full.segment.rsc +1 -1
  164. package/cloud-runtime/standalone/.next/server/app/board.segments/_head.segment.rsc +1 -1
  165. package/cloud-runtime/standalone/.next/server/app/board.segments/_index.segment.rsc +1 -1
  166. package/cloud-runtime/standalone/.next/server/app/board.segments/_tree.segment.rsc +1 -1
  167. package/cloud-runtime/standalone/.next/server/app/board.segments/board/__PAGE__.segment.rsc +1 -1
  168. package/cloud-runtime/standalone/.next/server/app/board.segments/board.segment.rsc +1 -1
  169. package/cloud-runtime/standalone/.next/server/app/execution-graph.html +2 -2
  170. package/cloud-runtime/standalone/.next/server/app/execution-graph.rsc +1 -1
  171. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_full.segment.rsc +1 -1
  172. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_head.segment.rsc +1 -1
  173. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_index.segment.rsc +1 -1
  174. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_tree.segment.rsc +1 -1
  175. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph/__PAGE__.segment.rsc +1 -1
  176. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph.segment.rsc +1 -1
  177. package/cloud-runtime/standalone/.next/server/app/folders.html +2 -2
  178. package/cloud-runtime/standalone/.next/server/app/folders.rsc +1 -1
  179. package/cloud-runtime/standalone/.next/server/app/folders.segments/_full.segment.rsc +1 -1
  180. package/cloud-runtime/standalone/.next/server/app/folders.segments/_head.segment.rsc +1 -1
  181. package/cloud-runtime/standalone/.next/server/app/folders.segments/_index.segment.rsc +1 -1
  182. package/cloud-runtime/standalone/.next/server/app/folders.segments/_tree.segment.rsc +1 -1
  183. package/cloud-runtime/standalone/.next/server/app/folders.segments/folders/__PAGE__.segment.rsc +1 -1
  184. package/cloud-runtime/standalone/.next/server/app/folders.segments/folders.segment.rsc +1 -1
  185. package/cloud-runtime/standalone/.next/server/app/index.html +2 -2
  186. package/cloud-runtime/standalone/.next/server/app/index.rsc +2 -2
  187. package/cloud-runtime/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  188. package/cloud-runtime/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
  189. package/cloud-runtime/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  190. package/cloud-runtime/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
  191. package/cloud-runtime/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  192. package/cloud-runtime/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  193. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page_client-reference-manifest.js +1 -1
  194. package/cloud-runtime/standalone/.next/server/app/projects/orphans.html +2 -2
  195. package/cloud-runtime/standalone/.next/server/app/projects/orphans.rsc +1 -1
  196. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_full.segment.rsc +1 -1
  197. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_head.segment.rsc +1 -1
  198. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_index.segment.rsc +1 -1
  199. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_tree.segment.rsc +1 -1
  200. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans/__PAGE__.segment.rsc +1 -1
  201. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans.segment.rsc +1 -1
  202. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects.segment.rsc +1 -1
  203. package/cloud-runtime/standalone/.next/server/app/projects.html +2 -2
  204. package/cloud-runtime/standalone/.next/server/app/projects.rsc +1 -1
  205. package/cloud-runtime/standalone/.next/server/app/projects.segments/_full.segment.rsc +1 -1
  206. package/cloud-runtime/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
  207. package/cloud-runtime/standalone/.next/server/app/projects.segments/_index.segment.rsc +1 -1
  208. package/cloud-runtime/standalone/.next/server/app/projects.segments/_tree.segment.rsc +1 -1
  209. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +1 -1
  210. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects.segment.rsc +1 -1
  211. package/cloud-runtime/standalone/.next/server/app/settings.html +2 -2
  212. package/cloud-runtime/standalone/.next/server/app/settings.rsc +1 -1
  213. package/cloud-runtime/standalone/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  214. package/cloud-runtime/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  215. package/cloud-runtime/standalone/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  216. package/cloud-runtime/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  217. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  218. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  219. package/cloud-runtime/standalone/.next/server/app/skills.html +2 -2
  220. package/cloud-runtime/standalone/.next/server/app/skills.rsc +1 -1
  221. package/cloud-runtime/standalone/.next/server/app/skills.segments/_full.segment.rsc +1 -1
  222. package/cloud-runtime/standalone/.next/server/app/skills.segments/_head.segment.rsc +1 -1
  223. package/cloud-runtime/standalone/.next/server/app/skills.segments/_index.segment.rsc +1 -1
  224. package/cloud-runtime/standalone/.next/server/app/skills.segments/_tree.segment.rsc +1 -1
  225. package/cloud-runtime/standalone/.next/server/app/skills.segments/skills/__PAGE__.segment.rsc +1 -1
  226. package/cloud-runtime/standalone/.next/server/app/skills.segments/skills.segment.rsc +1 -1
  227. package/cloud-runtime/standalone/.next/server/app/status.html +2 -2
  228. package/cloud-runtime/standalone/.next/server/app/status.rsc +1 -1
  229. package/cloud-runtime/standalone/.next/server/app/status.segments/_full.segment.rsc +1 -1
  230. package/cloud-runtime/standalone/.next/server/app/status.segments/_head.segment.rsc +1 -1
  231. package/cloud-runtime/standalone/.next/server/app/status.segments/_index.segment.rsc +1 -1
  232. package/cloud-runtime/standalone/.next/server/app/status.segments/_tree.segment.rsc +1 -1
  233. package/cloud-runtime/standalone/.next/server/app/status.segments/status/__PAGE__.segment.rsc +1 -1
  234. package/cloud-runtime/standalone/.next/server/app/status.segments/status.segment.rsc +1 -1
  235. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page_client-reference-manifest.js +1 -1
  236. package/cloud-runtime/standalone/.next/server/app/welcome.html +2 -2
  237. package/cloud-runtime/standalone/.next/server/app/welcome.rsc +1 -1
  238. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_full.segment.rsc +1 -1
  239. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_head.segment.rsc +1 -1
  240. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_index.segment.rsc +1 -1
  241. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_tree.segment.rsc +1 -1
  242. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome/__PAGE__.segment.rsc +1 -1
  243. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome.segment.rsc +1 -1
  244. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__a300f072._.js → [root-of-the-server]__02a4a323._.js} +2 -2
  245. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__05dedbe1._.js +64 -0
  246. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__4ce74056._.js → [root-of-the-server]__05f0bfbf._.js} +2 -2
  247. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__c22dd3a6._.js → [root-of-the-server]__08c82fe8._.js} +2 -2
  248. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__3fae531a._.js → [root-of-the-server]__09e37b59._.js} +2 -2
  249. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__1a1f66b1._.js → [root-of-the-server]__0e83aabc._.js} +2 -2
  250. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__27da58f0._.js +67 -0
  251. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__9ffa67b7._.js → [root-of-the-server]__2ae8b938._.js} +2 -2
  252. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2cfd21b8._.js +108 -0
  253. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__f9f7f2df._.js → [root-of-the-server]__3c1403f2._.js} +2 -2
  254. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__143fdf69._.js → [root-of-the-server]__40e9e2e8._.js} +2 -2
  255. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__42e602eb._.js +49 -0
  256. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__a7b2350e._.js → [root-of-the-server]__456840d0._.js} +2 -2
  257. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5c2848bb._.js +64 -0
  258. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__667c658f._.js +52 -0
  259. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6a92b882._.js +49 -0
  260. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6c9baa7c._.js +64 -0
  261. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__c21747df._.js → [root-of-the-server]__719eddc2._.js} +2 -2
  262. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__36d15de5._.js → [root-of-the-server]__7ee3dfe1._.js} +2 -2
  263. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__d324f8a1._.js → [root-of-the-server]__80964fad._.js} +2 -2
  264. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__bab85495._.js → [root-of-the-server]__862cf77d._.js} +2 -2
  265. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__a280fa63._.js → [root-of-the-server]__8b5b9860._.js} +2 -2
  266. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__3170b7bf._.js → [root-of-the-server]__8d475640._.js} +2 -2
  267. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__958dded3._.js +49 -0
  268. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__ab655b9f._.js → [root-of-the-server]__96c424d5._.js} +2 -2
  269. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__5c55f67a._.js → [root-of-the-server]__976ebe46._.js} +2 -2
  270. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__179cb224._.js → [root-of-the-server]__a1cab8fe._.js} +2 -2
  271. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__20a2cb22._.js → [root-of-the-server]__a31dd756._.js} +2 -2
  272. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__a3955224._.js → [root-of-the-server]__ad53dc3f._.js} +2 -2
  273. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__ac6326b6._.js → [root-of-the-server]__b8eeb177._.js} +2 -2
  274. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__fcfa3690._.js → [root-of-the-server]__c10e827d._.js} +2 -2
  275. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__e58e9f91._.js → [root-of-the-server]__c11e0040._.js} +2 -2
  276. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c40b6f69._.js +49 -0
  277. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c7d3c7ab._.js +52 -0
  278. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__cdc52544._.js +49 -0
  279. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__8cbd8c56._.js → [root-of-the-server]__d1c698b6._.js} +12 -12
  280. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d9ea98bd._.js +52 -0
  281. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__ef27f8cd._.js → [root-of-the-server]__df886e3c._.js} +2 -2
  282. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__ca4987eb._.js → [root-of-the-server]__e0b6f424._.js} +2 -2
  283. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__c8890cd6._.js → [root-of-the-server]__f43ecbc2._.js} +2 -2
  284. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f51c7b72._.js +5 -0
  285. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f662fd1e._.js +20 -0
  286. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__538b0bdd._.js → [root-of-the-server]__f961230c._.js} +2 -2
  287. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__b627cb83._.js → [root-of-the-server]__feec5b54._.js} +2 -2
  288. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__d16caed5._.js → [root-of-the-server]__ff6ce4b1._.js} +2 -2
  289. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ff9ce15e._.js +5 -0
  290. package/cloud-runtime/standalone/.next/server/chunks/_26ffc857._.js +121 -0
  291. package/cloud-runtime/standalone/.next/server/chunks/_4d07f8db._.js +1 -1
  292. package/cloud-runtime/standalone/.next/server/chunks/_66d0cf73._.js +6 -0
  293. package/cloud-runtime/standalone/.next/server/chunks/_9b10087f._.js +3 -2
  294. package/cloud-runtime/standalone/.next/server/chunks/_a13c0bef._.js +121 -0
  295. package/cloud-runtime/standalone/.next/server/chunks/{lib_98ae187c._.js → lib_2cd3429c._.js} +2 -2
  296. package/cloud-runtime/standalone/.next/server/chunks/lib_a2a83df5._.js +55 -0
  297. package/cloud-runtime/standalone/.next/server/chunks/lib_a658c9ef._.js +34 -0
  298. package/cloud-runtime/standalone/.next/server/chunks/lib_ba38ea08._.js +55 -0
  299. package/cloud-runtime/standalone/.next/server/chunks/lib_orchestrator_chat-processor_ts_4c335719._.js +27 -29
  300. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_371d0bff.js +6 -102
  301. package/cloud-runtime/standalone/.next/server/chunks/src_graph_schedule-runner_ts_43a13c69._.js +13 -0
  302. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_chat-ui_bfeda794._.js +1 -1
  303. package/cloud-runtime/standalone/.next/server/middleware-manifest.json +5 -5
  304. package/cloud-runtime/standalone/.next/server/pages/404.html +2 -2
  305. package/cloud-runtime/standalone/.next/server/pages/500.html +2 -2
  306. package/cloud-runtime/standalone/.next/server/server-reference-manifest.js +1 -1
  307. package/cloud-runtime/standalone/.next/server/server-reference-manifest.json +1 -1
  308. package/cloud-runtime/standalone/.next/static/chunks/{442eb8ef62bef9f9.js → 5545da2ad239c0b6.js} +3 -3
  309. package/cloud-runtime/standalone/app/api/chat/route.ts +5 -163
  310. package/cloud-runtime/standalone/app/api/schedules/route.ts +11 -2
  311. package/cloud-runtime/standalone/components/chat-ui/ChatContainer.tsx +0 -13
  312. package/cloud-runtime/standalone/lib/chat/project-context.ts +169 -0
  313. package/cloud-runtime/standalone/lib/orchestrator/runtime.ts +2 -0
  314. package/cloud-runtime/standalone/lib/orchestrator/schedule-runtime.ts +76 -0
  315. package/cloud-runtime/standalone/src/graph/internal-function-dispatcher.ts +201 -16
  316. package/cloud-runtime/standalone/src/graph/work-dispatcher.ts +128 -35
  317. package/cloud-runtime/standalone/state/automations/.state/c4300b01-1203-40fe-b3a9-b9fb9ec0c5cc.json +4 -4
  318. package/cloud-runtime/standalone/tsconfig.tsbuildinfo +1 -1
  319. package/cloud-runtime/standalone/vault/agx/issues/ESO-327/design-doc.md +202 -0
  320. package/cloud-runtime/standalone/worker/index.js +34516 -1717
  321. package/cloud-runtime/standalone/worker/index.ts +3 -0
  322. package/package.json +1 -1
  323. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__067034dd._.js +0 -67
  324. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__152b2000._.js +0 -61
  325. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__33865410._.js +0 -3
  326. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6c53437e._.js +0 -110
  327. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6dbe939c._.js +0 -49
  328. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7012e83d._.js +0 -66
  329. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__da645a5e._.js +0 -15
  330. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f4b3df16._.js +0 -3
  331. package/cloud-runtime/standalone/.next/server/chunks/_2a5aeb76._.js +0 -3
  332. package/cloud-runtime/standalone/.next/server/chunks/_4689976f._.js +0 -6
  333. package/cloud-runtime/standalone/.next/server/chunks/_682c9d81._.js +0 -6
  334. package/cloud-runtime/standalone/.next/server/chunks/_6e7f0ae4._.js +0 -6
  335. package/cloud-runtime/standalone/.next/server/chunks/_a32a5cdd._.js +0 -6
  336. package/cloud-runtime/standalone/.next/server/chunks/_af7bd752._.js +0 -3
  337. package/cloud-runtime/standalone/.next/server/chunks/_fe32a267._.js +0 -3
  338. package/cloud-runtime/standalone/.next/server/chunks/lib_2492d514._.js +0 -55
  339. package/cloud-runtime/standalone/.next/server/chunks/lib_3c080873._.js +0 -34
  340. package/cloud-runtime/standalone/.next/server/chunks/lib_9f439b27._.js +0 -70
  341. package/cloud-runtime/standalone/.next/server/chunks/src_graph_12d46a92._.js +0 -3
  342. package/cloud-runtime/standalone/.next/server/chunks/src_graph_executor_ts_55c06268._.js +0 -8
  343. /package/cloud-runtime/standalone/.next/static/{gty0FO80D_lbq3o9lSpQQ → ZkFZnP5h74O7GgdHudXgH}/_buildManifest.js +0 -0
  344. /package/cloud-runtime/standalone/.next/static/{gty0FO80D_lbq3o9lSpQQ → ZkFZnP5h74O7GgdHudXgH}/_clientMiddlewareManifest.json +0 -0
  345. /package/cloud-runtime/standalone/.next/static/{gty0FO80D_lbq3o9lSpQQ → ZkFZnP5h74O7GgdHudXgH}/_ssgManifest.js +0 -0
@@ -1,18 +1,18 @@
1
1
  import { NextRequest } from "next/server";
2
- import { type StreamProjectContext, type StreamProjectDetail } from "@/lib/stream-multiplexer";
3
2
  import {
4
3
  mergeComposerRouting,
5
4
  normalizeComposerRouting,
6
5
  orderParticipantIds,
7
6
  } from "@/lib/chat/composer-routing";
7
+ import {
8
+ findProjectMentionSlugs,
9
+ normalizeProjectSlug,
10
+ resolveProjectContext,
11
+ } from "@/lib/chat/project-context";
8
12
  import { loadDbParticipants } from "@/lib/agent-participants";
9
13
  import { createChatRun, loadHistory, saveMessages, sweepStaleWorkingReactions } from "@/lib/history-store";
10
14
  import { finalizeAttachments } from "@/lib/attachment-store";
11
15
  import { getSQLiteDb } from "@/lib/sqlite-query-adapter";
12
- import { db } from "@/lib/db-instance";
13
- import { buildExecutionProvenance, getProjectSkills, getProjectVariables, getProjectMemory } from "@/lib/db";
14
- import { listResolvedRepoKnowledge } from "@/lib/repo-knowledge";
15
- import { getKnowledgeNote } from "@/lib/knowledge-notes";
16
16
  import { LOCAL_USER } from "@/lib/auth-mode";
17
17
  import { deactivateSchedulesByRootMessageId } from "@/src/graph/store";
18
18
  import type { GroupMessage, Participant } from "@/lib/types";
@@ -42,7 +42,6 @@ interface ChatRequestBody {
42
42
  const MAX_HISTORY_CHARS = 200_000;
43
43
  const SUMMARY_MARKER = "<!-- thread-summary -->";
44
44
  const CHAT_MENTION_PATTERN = /@([A-Za-z0-9_-]+)/g;
45
- const PROJECT_MENTION_PATTERN = /@~project:([a-z0-9][a-z0-9-]*)/gi;
46
45
 
47
46
  type ParticipantNameMap = Record<string, { name: string }>;
48
47
 
@@ -278,163 +277,6 @@ function toActiveParticipantIds(input: unknown): string[] {
278
277
  return ids;
279
278
  }
280
279
 
281
- function normalizeProjectSlug(input: unknown): string {
282
- if (typeof input !== "string") return "";
283
- return input.trim().toLowerCase();
284
- }
285
-
286
- function findProjectMentionSlugs(prompt: string): string[] {
287
- const slugs = new Set<string>();
288
- for (const match of prompt.matchAll(PROJECT_MENTION_PATTERN)) {
289
- const slug = normalizeProjectSlug(match[1]);
290
- if (slug) slugs.add(slug);
291
- }
292
- return Array.from(slugs);
293
- }
294
-
295
- function toStreamProjectDetail(project: {
296
- id: string;
297
- slug: string;
298
- name: string;
299
- description?: string | null;
300
- ci_cd_info?: string | null;
301
- workflow_id?: string | null;
302
- repos?: Array<{ name: string; path?: string | null; notes?: string | null }>;
303
- }): StreamProjectDetail {
304
- return {
305
- id: project.id,
306
- slug: project.slug,
307
- name: project.name,
308
- description: project.description ?? null,
309
- ciCdInfo: project.ci_cd_info ?? null,
310
- workflowId: project.workflow_id ?? null,
311
- repos: (project.repos ?? []).map((repo) => ({
312
- name: repo.name,
313
- path: repo.path ?? null,
314
- notes: repo.notes ?? null,
315
- })),
316
- };
317
- }
318
-
319
- async function resolveProjectContext(
320
- scopedProjectSlug: string,
321
- mentionedProjectSlugs: string[],
322
- participants: Participant[] = []
323
- ): Promise<StreamProjectContext | undefined> {
324
- const slugsToFetch = new Set<string>();
325
- if (scopedProjectSlug) slugsToFetch.add(scopedProjectSlug);
326
- for (const slug of mentionedProjectSlugs) {
327
- if (slug) slugsToFetch.add(slug);
328
- }
329
- if (slugsToFetch.size === 0) return undefined;
330
-
331
- const rows = await Promise.all(
332
- Array.from(slugsToFetch).map(async (slug) => {
333
- try {
334
- const project = await db.getProjectWithRepos(slug, LOCAL_USER.id);
335
- return [slug, project] as const;
336
- } catch (error) {
337
- console.warn("Failed to load project context", { slug, error });
338
- return [slug, null] as const;
339
- }
340
- })
341
- );
342
-
343
- const bySlug = new Map<string, NonNullable<(typeof rows)[number][1]>>();
344
- for (const [slug, row] of rows) {
345
- if (row) bySlug.set(slug, row);
346
- }
347
-
348
- const activeProject = scopedProjectSlug ? bySlug.get(scopedProjectSlug) : undefined;
349
- const mentionedProjects = mentionedProjectSlugs
350
- .map((slug) => bySlug.get(slug))
351
- .filter((project): project is NonNullable<typeof project> => Boolean(project))
352
- .map((project) => toStreamProjectDetail(project));
353
-
354
- if (!activeProject && mentionedProjects.length === 0) {
355
- return undefined;
356
- }
357
-
358
- // Load project-level resources for the active project (skills, variables, memory)
359
- let skills: Array<{ file: string; condition?: string }> | undefined;
360
- let variables: Array<{ key: string; value: string }> | undefined;
361
- let memory: Array<{ content: string; source?: string }> | undefined;
362
- let repoKnowledge: StreamProjectContext["repoKnowledge"];
363
- let provenanceByAgentId: StreamProjectContext["provenanceByAgentId"];
364
-
365
- if (activeProject) {
366
- try {
367
- const [projectSkills, projectVars, projectMem] = await Promise.all([
368
- getProjectSkills(activeProject.id),
369
- getProjectVariables(activeProject.id),
370
- getProjectMemory(activeProject.id, "human"),
371
- ]);
372
- const projectSystemNote = getKnowledgeNote("project", activeProject.id);
373
- if (projectSkills.length > 0) {
374
- skills = projectSkills.map((s) => ({ file: s.file, ...(s.condition ? { condition: s.condition } : {}) }));
375
- }
376
- if (projectVars.length > 0) {
377
- variables = projectVars.map((v) => ({ key: v.key, value: v.value }));
378
- }
379
- if (projectMem.length > 0) {
380
- memory = projectMem.map((m) => ({ content: m.content, ...(m.source ? { source: m.source } : {}) }));
381
- }
382
- if (projectSystemNote?.content) {
383
- memory = [
384
- ...(memory ?? []),
385
- { content: projectSystemNote.content, source: "system-note" },
386
- ];
387
- }
388
- const resolvedRepoKnowledge = listResolvedRepoKnowledge(activeProject.repos ?? []).map((entry) => ({
389
- repoName: entry.repoName,
390
- path: entry.path ?? null,
391
- content:
392
- entry.producer === "system"
393
- ? `[System-generated] ${entry.content}`
394
- : entry.content,
395
- }));
396
- if (resolvedRepoKnowledge.length > 0) {
397
- repoKnowledge = resolvedRepoKnowledge;
398
- }
399
- if (participants.length > 0) {
400
- const sqlite = getSQLiteDb();
401
- provenanceByAgentId = {};
402
- for (const participant of participants) {
403
- const agentMemoryEntries = sqlite
404
- .prepare(
405
- "SELECT id, content FROM agent_memory WHERE agent_id = ? ORDER BY created_at DESC LIMIT 20"
406
- )
407
- .all(participant.id) as Array<{ id: string; content: string }>;
408
- provenanceByAgentId[participant.id] = await buildExecutionProvenance(
409
- participant.id,
410
- activeProject.id,
411
- participant.skills ?? [],
412
- agentMemoryEntries
413
- );
414
- }
415
- }
416
- } catch (e) {
417
- console.warn("Failed to load project resources", { projectId: activeProject.id, error: e });
418
- }
419
- }
420
-
421
- return {
422
- activeProject: activeProject
423
- ? {
424
- id: activeProject.id,
425
- slug: activeProject.slug,
426
- name: activeProject.name,
427
- }
428
- : undefined,
429
- mentionedProjects: mentionedProjects.length > 0 ? mentionedProjects : undefined,
430
- skills,
431
- variables,
432
- memory,
433
- repoKnowledge,
434
- provenanceByAgentId,
435
- };
436
- }
437
-
438
280
  export async function POST(request: NextRequest) {
439
281
  const body = (await request.json().catch(() => ({}))) as ChatRequestBody;
440
282
  const prompt =
@@ -15,6 +15,7 @@ export const runtime = "nodejs";
15
15
  export const dynamic = "force-dynamic";
16
16
 
17
17
  const DEFAULT_INTERVAL_MS = 15_000;
18
+ const DEFAULT_MAX_CONSECUTIVE_FAILURES = 3;
18
19
 
19
20
  const ActivateSchema = z.object({
20
21
  action: z.literal("activate"),
@@ -35,12 +36,13 @@ const RequestSchema = z.discriminatedUnion("action", [ActivateSchema, StopSchema
35
36
  * The work node (verify-and-route) is downstream of the conditional in the real
36
37
  * graph but for v1 the cron just checks if agents are idle — the MC handles nudging.
37
38
  */
38
- const STEER_PROMPT = `Review the conversation so far and produce exactly one message that does both of these things together:
39
+ const STEER_PROMPT = `Review the conversation so far and determine whether the thread is actually ready to move into review.
40
+ If it is not ready, produce exactly one message that does both of these things together:
39
41
  1. Briefly assess what has been accomplished and what remains.
40
42
  2. Give the team the concrete next steps needed to move toward shipping.
41
43
 
42
44
  Do not split status and instructions into separate responses. Keep it to one concise message.
43
- If everything is done, say exactly "[done]" so the system knows to stop.`;
45
+ Only mark the work complete when it is truly ready to stop ship mode and move into review.`;
44
46
 
45
47
  function buildThreadMonitorGraph(
46
48
  rootMessageId: string,
@@ -131,6 +133,9 @@ function buildThreadMonitorGraph(
131
133
  },
132
134
  schedule: {
133
135
  ...createThreadMonitorSchedule(resetNodeIds, intervalMs),
136
+ name: "Ship mode",
137
+ description: "Automatically steers an idle thread toward completion.",
138
+ maxConsecutiveFailures: DEFAULT_MAX_CONSECUTIVE_FAILURES,
134
139
  rootMessageId,
135
140
  },
136
141
  versionHistory: [],
@@ -181,6 +186,10 @@ export async function POST(request: NextRequest) {
181
186
  const reactivated = activateGraphSchedule(existingGraph, {
182
187
  intervalMs,
183
188
  resetNodeIds: existingGraph.schedule?.resetNodeIds ?? ["pull-status", "idle-check"],
189
+ name: existingGraph.schedule?.name ?? "Ship mode",
190
+ description: existingGraph.schedule?.description ?? "Automatically steers an idle thread toward completion.",
191
+ maxConsecutiveFailures:
192
+ existingGraph.schedule?.maxConsecutiveFailures ?? DEFAULT_MAX_CONSECUTIVE_FAILURES,
184
193
  rootMessageId: body.rootMessageId,
185
194
  nowIso: new Date().toISOString(),
186
195
  });
@@ -423,8 +423,6 @@ export function ChatContainer({
423
423
  if (cancelled || !data.activeRootMessageIds) return;
424
424
  setAutoModeThreads((prev) => {
425
425
  const next = new Set(data.activeRootMessageIds as string[]);
426
- // Preserve any locally-toggled entries not yet on server
427
- for (const id of prev) next.add(id);
428
426
  if (next.size === prev.size && [...next].every((id) => prev.has(id))) return prev;
429
427
  return next;
430
428
  });
@@ -1214,16 +1212,6 @@ export function ChatContainer({
1214
1212
  return;
1215
1213
  }
1216
1214
 
1217
- // User message turns off autonomous mode
1218
- if (autoMode && openThreadId) {
1219
- setAutoModeThreads((prev) => { const next = new Set(prev); next.delete(openThreadId); return next; });
1220
- fetch("/api/schedules", {
1221
- method: "POST",
1222
- headers: { "Content-Type": "application/json" },
1223
- body: JSON.stringify({ action: "stop", rootMessageId: openThreadId }),
1224
- }).catch((err) => console.error("Failed to deactivate schedule:", err));
1225
- }
1226
-
1227
1215
  let threadId = activeThreadId;
1228
1216
  if (!threadId) {
1229
1217
  const created = await createThread();
@@ -1281,7 +1269,6 @@ export function ChatContainer({
1281
1269
  },
1282
1270
  [
1283
1271
  activeThreadId,
1284
- autoMode,
1285
1272
  pendingAutoMode,
1286
1273
  createThread,
1287
1274
  handleSearchCommand,
@@ -0,0 +1,169 @@
1
+ import { type StreamProjectContext, type StreamProjectDetail } from "@/lib/stream-multiplexer";
2
+ import { getSQLiteDb } from "@/lib/sqlite-query-adapter";
3
+ import { db } from "@/lib/db-instance";
4
+ import { buildExecutionProvenance, getProjectSkills, getProjectVariables, getProjectMemory } from "@/lib/db";
5
+ import { listResolvedRepoKnowledge } from "@/lib/repo-knowledge";
6
+ import { getKnowledgeNote } from "@/lib/knowledge-notes";
7
+ import { LOCAL_USER } from "@/lib/auth-mode";
8
+ import type { Participant } from "@/lib/types";
9
+
10
+ const PROJECT_MENTION_PATTERN = /@~project:([a-z0-9][a-z0-9-]*)/gi;
11
+
12
+ export function normalizeProjectSlug(input: unknown): string {
13
+ if (typeof input !== "string") return "";
14
+ return input.trim().toLowerCase();
15
+ }
16
+
17
+ export function findProjectMentionSlugs(prompt: string): string[] {
18
+ const slugs = new Set<string>();
19
+ for (const match of prompt.matchAll(PROJECT_MENTION_PATTERN)) {
20
+ const slug = normalizeProjectSlug(match[1]);
21
+ if (slug) slugs.add(slug);
22
+ }
23
+ return Array.from(slugs);
24
+ }
25
+
26
+ function toStreamProjectDetail(project: {
27
+ id: string;
28
+ slug: string;
29
+ name: string;
30
+ description?: string | null;
31
+ ci_cd_info?: string | null;
32
+ workflow_id?: string | null;
33
+ repos?: Array<{ name: string; path?: string | null; notes?: string | null }>;
34
+ }): StreamProjectDetail {
35
+ return {
36
+ id: project.id,
37
+ slug: project.slug,
38
+ name: project.name,
39
+ description: project.description ?? null,
40
+ ciCdInfo: project.ci_cd_info ?? null,
41
+ workflowId: project.workflow_id ?? null,
42
+ repos: (project.repos ?? []).map((repo) => ({
43
+ name: repo.name,
44
+ path: repo.path ?? null,
45
+ notes: repo.notes ?? null,
46
+ })),
47
+ };
48
+ }
49
+
50
+ export async function resolveProjectContext(
51
+ scopedProjectSlug: string,
52
+ mentionedProjectSlugs: string[],
53
+ participants: Participant[] = []
54
+ ): Promise<StreamProjectContext | undefined> {
55
+ const slugsToFetch = new Set<string>();
56
+ if (scopedProjectSlug) slugsToFetch.add(scopedProjectSlug);
57
+ for (const slug of mentionedProjectSlugs) {
58
+ if (slug) slugsToFetch.add(slug);
59
+ }
60
+ if (slugsToFetch.size === 0) return undefined;
61
+
62
+ const rows = await Promise.all(
63
+ Array.from(slugsToFetch).map(async (slug) => {
64
+ try {
65
+ const project = await db.getProjectWithRepos(slug, LOCAL_USER.id);
66
+ return [slug, project] as const;
67
+ } catch (error) {
68
+ console.warn("Failed to load project context", { slug, error });
69
+ return [slug, null] as const;
70
+ }
71
+ })
72
+ );
73
+
74
+ const bySlug = new Map<string, NonNullable<(typeof rows)[number][1]>>();
75
+ for (const [slug, row] of rows) {
76
+ if (row) bySlug.set(slug, row);
77
+ }
78
+
79
+ const activeProject = scopedProjectSlug ? bySlug.get(scopedProjectSlug) : undefined;
80
+ const mentionedProjects = mentionedProjectSlugs
81
+ .map((slug) => bySlug.get(slug))
82
+ .filter((project): project is NonNullable<typeof project> => Boolean(project))
83
+ .map((project) => toStreamProjectDetail(project));
84
+
85
+ if (!activeProject && mentionedProjects.length === 0) {
86
+ return undefined;
87
+ }
88
+
89
+ let skills: Array<{ file: string; condition?: string }> | undefined;
90
+ let variables: Array<{ key: string; value: string }> | undefined;
91
+ let memory: Array<{ content: string; source?: string }> | undefined;
92
+ let repoKnowledge: StreamProjectContext["repoKnowledge"];
93
+ let provenanceByAgentId: StreamProjectContext["provenanceByAgentId"];
94
+
95
+ if (activeProject) {
96
+ try {
97
+ const [projectSkills, projectVars, projectMem] = await Promise.all([
98
+ getProjectSkills(activeProject.id),
99
+ getProjectVariables(activeProject.id),
100
+ getProjectMemory(activeProject.id, "human"),
101
+ ]);
102
+ const projectSystemNote = getKnowledgeNote("project", activeProject.id);
103
+ if (projectSkills.length > 0) {
104
+ skills = projectSkills.map((skill) => ({
105
+ file: skill.file,
106
+ ...(skill.condition ? { condition: skill.condition } : {}),
107
+ }));
108
+ }
109
+ if (projectVars.length > 0) {
110
+ variables = projectVars.map((variable) => ({ key: variable.key, value: variable.value }));
111
+ }
112
+ if (projectMem.length > 0) {
113
+ memory = projectMem.map((entry) => ({
114
+ content: entry.content,
115
+ ...(entry.source ? { source: entry.source } : {}),
116
+ }));
117
+ }
118
+ if (projectSystemNote?.content) {
119
+ memory = [
120
+ ...(memory ?? []),
121
+ { content: projectSystemNote.content, source: "system-note" },
122
+ ];
123
+ }
124
+ const resolvedRepoKnowledge = listResolvedRepoKnowledge(activeProject.repos ?? []).map((entry) => ({
125
+ repoName: entry.repoName,
126
+ path: entry.path ?? null,
127
+ content: entry.producer === "system" ? `[System-generated] ${entry.content}` : entry.content,
128
+ }));
129
+ if (resolvedRepoKnowledge.length > 0) {
130
+ repoKnowledge = resolvedRepoKnowledge;
131
+ }
132
+ if (participants.length > 0) {
133
+ const sqlite = getSQLiteDb();
134
+ provenanceByAgentId = {};
135
+ for (const participant of participants) {
136
+ const agentMemoryEntries = sqlite
137
+ .prepare(
138
+ "SELECT id, content FROM agent_memory WHERE agent_id = ? ORDER BY created_at DESC LIMIT 20"
139
+ )
140
+ .all(participant.id) as Array<{ id: string; content: string }>;
141
+ provenanceByAgentId[participant.id] = await buildExecutionProvenance(
142
+ participant.id,
143
+ activeProject.id,
144
+ participant.skills ?? [],
145
+ agentMemoryEntries
146
+ );
147
+ }
148
+ }
149
+ } catch (error) {
150
+ console.warn("Failed to load project resources", { projectId: activeProject.id, error });
151
+ }
152
+ }
153
+
154
+ return {
155
+ activeProject: activeProject
156
+ ? {
157
+ id: activeProject.id,
158
+ slug: activeProject.slug,
159
+ name: activeProject.name,
160
+ }
161
+ : undefined,
162
+ mentionedProjects: mentionedProjects.length > 0 ? mentionedProjects : undefined,
163
+ skills,
164
+ variables,
165
+ memory,
166
+ repoKnowledge,
167
+ provenanceByAgentId,
168
+ };
169
+ }
@@ -1,6 +1,7 @@
1
1
  import { getQueue, QUEUE_NAMES } from "@/lib/queue/boss";
2
2
  import { taskProcessor } from "@/lib/orchestrator/processor";
3
3
  import { chatProcessor } from "@/lib/orchestrator/chat-processor";
4
+ import { ensureScheduleRuntime } from "@/lib/orchestrator/schedule-runtime";
4
5
  import { writeDebugLog } from "@/lib/debug-log";
5
6
 
6
7
  let bootstrapPromise: Promise<void> | null = null;
@@ -13,6 +14,7 @@ export async function ensureOrchestratorRuntime(): Promise<void> {
13
14
  const queue = await getQueue();
14
15
  await queue.work(QUEUE_NAMES.TASK_PROCESS, taskProcessor, { batchSize: 5 });
15
16
  await queue.work(QUEUE_NAMES.CHAT_RUN_PROCESS, chatProcessor, { batchSize: 2 });
17
+ await ensureScheduleRuntime();
16
18
  writeDebugLog("orchestrator.bootstrap.ready", {
17
19
  queues: [QUEUE_NAMES.TASK_PROCESS, QUEUE_NAMES.CHAT_RUN_PROCESS],
18
20
  });
@@ -0,0 +1,76 @@
1
+ import { writeDebugLog } from "@/lib/debug-log";
2
+ import { createDispatchFunction } from "@/src/graph/function-executor";
3
+ import { pollSchedules } from "@/src/graph/schedule-runner";
4
+ import { createDispatchWork } from "@/src/graph/work-dispatcher";
5
+
6
+ const DEFAULT_SCHEDULE_POLL_INTERVAL_MS = 5_000;
7
+
8
+ let pollIntervalHandle: NodeJS.Timeout | null = null;
9
+ let pollInFlight: Promise<void> | null = null;
10
+
11
+ function isSchedulePollingEnabled(): boolean {
12
+ return process.env.AGX_DISABLE_SCHEDULE_POLLING !== "1";
13
+ }
14
+
15
+ function getSchedulePollIntervalMs(): number {
16
+ const raw = Number(process.env.AGX_SCHEDULE_POLL_INTERVAL_MS);
17
+ if (!Number.isFinite(raw)) return DEFAULT_SCHEDULE_POLL_INTERVAL_MS;
18
+ return Math.max(1_000, raw);
19
+ }
20
+
21
+ async function pollSchedulesOnce(): Promise<void> {
22
+ if (pollInFlight) {
23
+ return pollInFlight;
24
+ }
25
+
26
+ pollInFlight = (async () => {
27
+ const result = await pollSchedules({
28
+ dispatchFunction: createDispatchFunction(),
29
+ dispatchWork: createDispatchWork(),
30
+ });
31
+
32
+ if (result.errors.length > 0) {
33
+ writeDebugLog("schedule_runtime.poll.error", {
34
+ errorCount: result.errors.length,
35
+ graphIds: result.errors.map((entry) => entry.graphId),
36
+ });
37
+ }
38
+ })()
39
+ .catch((error) => {
40
+ writeDebugLog("schedule_runtime.poll.exception", { error });
41
+ console.error("[schedule-runtime] Poll failed:", error);
42
+ })
43
+ .finally(() => {
44
+ pollInFlight = null;
45
+ });
46
+
47
+ return pollInFlight;
48
+ }
49
+
50
+ export async function ensureScheduleRuntime(): Promise<void> {
51
+ if (!isSchedulePollingEnabled() || pollIntervalHandle) {
52
+ return;
53
+ }
54
+
55
+ const intervalMs = getSchedulePollIntervalMs();
56
+ writeDebugLog("schedule_runtime.start", { intervalMs });
57
+
58
+ pollIntervalHandle = setInterval(() => {
59
+ void pollSchedulesOnce();
60
+ }, intervalMs);
61
+ if (typeof pollIntervalHandle.unref === "function") {
62
+ pollIntervalHandle.unref();
63
+ }
64
+
65
+ await pollSchedulesOnce();
66
+ }
67
+
68
+ export async function stopScheduleRuntime(): Promise<void> {
69
+ if (pollIntervalHandle) {
70
+ clearInterval(pollIntervalHandle);
71
+ pollIntervalHandle = null;
72
+ }
73
+ if (pollInFlight) {
74
+ await pollInFlight;
75
+ }
76
+ }