@mndrk/agx 2.0.32 → 2.0.33

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 (434) hide show
  1. package/cloud-runtime/standalone/.next/BUILD_ID +1 -1
  2. package/cloud-runtime/standalone/.next/app-path-routes-manifest.json +1 -0
  3. package/cloud-runtime/standalone/.next/build-manifest.json +2 -2
  4. package/cloud-runtime/standalone/.next/prerender-manifest.json +3 -3
  5. package/cloud-runtime/standalone/.next/routes-manifest.json +6 -0
  6. package/cloud-runtime/standalone/.next/server/app/_global-error.html +2 -2
  7. package/cloud-runtime/standalone/.next/server/app/_global-error.rsc +1 -1
  8. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/cloud-runtime/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/cloud-runtime/standalone/.next/server/app/_not-found.html +2 -2
  15. package/cloud-runtime/standalone/.next/server/app/_not-found.rsc +2 -2
  16. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  17. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  18. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  19. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  21. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page.js.nft.json +1 -1
  23. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  24. package/cloud-runtime/standalone/.next/server/app/agents/page.js.nft.json +1 -1
  25. package/cloud-runtime/standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  26. package/cloud-runtime/standalone/.next/server/app/agents.html +2 -2
  27. package/cloud-runtime/standalone/.next/server/app/agents.rsc +3 -3
  28. package/cloud-runtime/standalone/.next/server/app/agents.segments/_full.segment.rsc +3 -3
  29. package/cloud-runtime/standalone/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  30. package/cloud-runtime/standalone/.next/server/app/agents.segments/_index.segment.rsc +2 -2
  31. package/cloud-runtime/standalone/.next/server/app/agents.segments/_tree.segment.rsc +2 -2
  32. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +2 -2
  33. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents.segment.rsc +1 -1
  34. package/cloud-runtime/standalone/.next/server/app/api/automations/create/route.js +3 -4
  35. package/cloud-runtime/standalone/.next/server/app/api/automations/create/route.js.nft.json +1 -1
  36. package/cloud-runtime/standalone/.next/server/app/api/automations/route.js +1 -1
  37. package/cloud-runtime/standalone/.next/server/app/api/automations/route.js.nft.json +1 -1
  38. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js +3 -3
  39. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
  40. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route.js +1 -1
  41. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route.js.nft.json +1 -1
  42. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route.js +1 -1
  43. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route.js.nft.json +1 -1
  44. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route.js +1 -1
  45. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route.js.nft.json +1 -1
  46. package/cloud-runtime/standalone/.next/server/app/api/daemon/route.js +1 -1
  47. package/cloud-runtime/standalone/.next/server/app/api/daemon/route.js.nft.json +1 -1
  48. package/cloud-runtime/standalone/.next/server/app/api/file-search/route.js.nft.json +1 -1
  49. package/cloud-runtime/standalone/.next/server/app/api/graphs/[graphId]/nodes/[nodeId]/route.js +1 -1
  50. package/cloud-runtime/standalone/.next/server/app/api/graphs/[graphId]/nodes/[nodeId]/route.js.nft.json +1 -1
  51. package/cloud-runtime/standalone/.next/server/app/api/health/route.js +1 -1
  52. package/cloud-runtime/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
  53. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route/app-paths-manifest.json +3 -0
  54. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route/build-manifest.json +11 -0
  55. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route/server-reference-manifest.json +4 -0
  56. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route.js +8 -0
  57. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route.js.map +5 -0
  58. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route.js.nft.json +1 -0
  59. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route_client-reference-manifest.js +2 -0
  60. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js +1 -1
  61. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js.nft.json +1 -1
  62. package/cloud-runtime/standalone/.next/server/app/api/memories/route.js +1 -1
  63. package/cloud-runtime/standalone/.next/server/app/api/memories/route.js.nft.json +1 -1
  64. package/cloud-runtime/standalone/.next/server/app/api/messages/[id]/route.js +1 -1
  65. package/cloud-runtime/standalone/.next/server/app/api/messages/[id]/route.js.nft.json +1 -1
  66. package/cloud-runtime/standalone/.next/server/app/api/migrate/teams-to-projects/route.js +1 -1
  67. package/cloud-runtime/standalone/.next/server/app/api/migrate/teams-to-projects/route.js.nft.json +1 -1
  68. package/cloud-runtime/standalone/.next/server/app/api/migrate/workspaces-to-projects/route.js +1 -1
  69. package/cloud-runtime/standalone/.next/server/app/api/migrate/workspaces-to-projects/route.js.nft.json +1 -1
  70. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route.js +2 -2
  71. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route.js.nft.json +1 -1
  72. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route.js +1 -1
  73. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route.js.nft.json +1 -1
  74. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js +3 -2
  75. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js.nft.json +1 -1
  76. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js +1 -1
  77. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js.nft.json +1 -1
  78. package/cloud-runtime/standalone/.next/server/app/api/processes/route.js +1 -1
  79. package/cloud-runtime/standalone/.next/server/app/api/processes/route.js.nft.json +1 -1
  80. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js +1 -1
  81. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js.nft.json +1 -1
  82. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route.js +1 -1
  83. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route.js.nft.json +1 -1
  84. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js +1 -1
  85. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js.nft.json +1 -1
  86. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js +1 -1
  87. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js.nft.json +1 -1
  88. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js +1 -1
  89. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  90. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js +1 -1
  91. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js.nft.json +1 -1
  92. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js +1 -1
  93. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js.nft.json +1 -1
  94. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js +1 -1
  95. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js.nft.json +1 -1
  96. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js +1 -1
  97. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  98. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js +4 -3
  99. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js.nft.json +1 -1
  100. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js +6 -6
  101. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js.nft.json +1 -1
  102. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route.js +1 -1
  103. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route.js.nft.json +1 -1
  104. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js +2 -3
  105. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js.nft.json +1 -1
  106. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js +2 -3
  107. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js.nft.json +1 -1
  108. package/cloud-runtime/standalone/.next/server/app/api/schedules/route.js +3 -4
  109. package/cloud-runtime/standalone/.next/server/app/api/schedules/route.js.nft.json +1 -1
  110. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js +3 -3
  111. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js.nft.json +1 -1
  112. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js +4 -4
  113. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js.nft.json +1 -1
  114. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js +2 -2
  115. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js.nft.json +1 -1
  116. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js +1 -1
  117. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js.nft.json +1 -1
  118. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js +5 -5
  119. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js.nft.json +1 -1
  120. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js +1 -1
  121. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js.nft.json +1 -1
  122. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js +1 -1
  123. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js.nft.json +1 -1
  124. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js +1 -1
  125. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js.nft.json +1 -1
  126. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/pause/route.js +1 -1
  127. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/pause/route.js.nft.json +1 -1
  128. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js +1 -1
  129. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js.nft.json +1 -1
  130. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js +1 -1
  131. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js.nft.json +1 -1
  132. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js +1 -1
  133. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js.nft.json +1 -1
  134. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js +1 -1
  135. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js.nft.json +1 -1
  136. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js +1 -1
  137. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js.nft.json +1 -1
  138. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js +1 -1
  139. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js.nft.json +1 -1
  140. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js +1 -1
  141. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js.nft.json +1 -1
  142. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js +1 -1
  143. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js.nft.json +1 -1
  144. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/heartbeat/route.js +1 -1
  145. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/heartbeat/route.js.nft.json +1 -1
  146. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js +1 -1
  147. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js.nft.json +1 -1
  148. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js +1 -1
  149. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js.nft.json +1 -1
  150. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js +1 -1
  151. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js.nft.json +1 -1
  152. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js +1 -1
  153. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js.nft.json +1 -1
  154. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js +1 -1
  155. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js.nft.json +1 -1
  156. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js +1 -1
  157. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js.nft.json +1 -1
  158. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js +1 -1
  159. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js.nft.json +1 -1
  160. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js +1 -1
  161. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js.nft.json +1 -1
  162. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js +6 -6
  163. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js.nft.json +1 -1
  164. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js +4 -4
  165. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
  166. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js +1 -1
  167. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js.nft.json +1 -1
  168. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js +3 -3
  169. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js.nft.json +1 -1
  170. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js +6 -6
  171. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js.nft.json +1 -1
  172. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js +3 -3
  173. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js.nft.json +1 -1
  174. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js +3 -3
  175. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js.nft.json +1 -1
  176. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js +1 -1
  177. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js.nft.json +1 -1
  178. package/cloud-runtime/standalone/.next/server/app/automations/page.js.nft.json +1 -1
  179. package/cloud-runtime/standalone/.next/server/app/automations/page_client-reference-manifest.js +1 -1
  180. package/cloud-runtime/standalone/.next/server/app/automations.html +2 -2
  181. package/cloud-runtime/standalone/.next/server/app/automations.rsc +3 -3
  182. package/cloud-runtime/standalone/.next/server/app/automations.segments/_full.segment.rsc +3 -3
  183. package/cloud-runtime/standalone/.next/server/app/automations.segments/_head.segment.rsc +1 -1
  184. package/cloud-runtime/standalone/.next/server/app/automations.segments/_index.segment.rsc +2 -2
  185. package/cloud-runtime/standalone/.next/server/app/automations.segments/_tree.segment.rsc +2 -2
  186. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations/__PAGE__.segment.rsc +2 -2
  187. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations.segment.rsc +1 -1
  188. package/cloud-runtime/standalone/.next/server/app/board/page_client-reference-manifest.js +1 -1
  189. package/cloud-runtime/standalone/.next/server/app/board.html +2 -2
  190. package/cloud-runtime/standalone/.next/server/app/board.rsc +2 -2
  191. package/cloud-runtime/standalone/.next/server/app/board.segments/_full.segment.rsc +2 -2
  192. package/cloud-runtime/standalone/.next/server/app/board.segments/_head.segment.rsc +1 -1
  193. package/cloud-runtime/standalone/.next/server/app/board.segments/_index.segment.rsc +2 -2
  194. package/cloud-runtime/standalone/.next/server/app/board.segments/_tree.segment.rsc +2 -2
  195. package/cloud-runtime/standalone/.next/server/app/board.segments/board/__PAGE__.segment.rsc +1 -1
  196. package/cloud-runtime/standalone/.next/server/app/board.segments/board.segment.rsc +1 -1
  197. package/cloud-runtime/standalone/.next/server/app/execution-graph/page_client-reference-manifest.js +1 -1
  198. package/cloud-runtime/standalone/.next/server/app/execution-graph.html +2 -2
  199. package/cloud-runtime/standalone/.next/server/app/execution-graph.rsc +2 -2
  200. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_full.segment.rsc +2 -2
  201. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_head.segment.rsc +1 -1
  202. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_index.segment.rsc +2 -2
  203. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_tree.segment.rsc +2 -2
  204. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph/__PAGE__.segment.rsc +1 -1
  205. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph.segment.rsc +1 -1
  206. package/cloud-runtime/standalone/.next/server/app/index.html +2 -2
  207. package/cloud-runtime/standalone/.next/server/app/index.rsc +3 -3
  208. package/cloud-runtime/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  209. package/cloud-runtime/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
  210. package/cloud-runtime/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  211. package/cloud-runtime/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
  212. package/cloud-runtime/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  213. package/cloud-runtime/standalone/.next/server/app/page.js.nft.json +1 -1
  214. package/cloud-runtime/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  215. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page.js.nft.json +1 -1
  216. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page_client-reference-manifest.js +1 -1
  217. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page.js.nft.json +1 -1
  218. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page_client-reference-manifest.js +1 -1
  219. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  220. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  221. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page.js.nft.json +1 -1
  222. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page_client-reference-manifest.js +1 -1
  223. package/cloud-runtime/standalone/.next/server/app/projects/orphans/page_client-reference-manifest.js +1 -1
  224. package/cloud-runtime/standalone/.next/server/app/projects/orphans.html +2 -2
  225. package/cloud-runtime/standalone/.next/server/app/projects/orphans.rsc +2 -2
  226. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_full.segment.rsc +2 -2
  227. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_head.segment.rsc +1 -1
  228. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_index.segment.rsc +2 -2
  229. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_tree.segment.rsc +2 -2
  230. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans/__PAGE__.segment.rsc +1 -1
  231. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans.segment.rsc +1 -1
  232. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects.segment.rsc +1 -1
  233. package/cloud-runtime/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  234. package/cloud-runtime/standalone/.next/server/app/projects.html +2 -2
  235. package/cloud-runtime/standalone/.next/server/app/projects.rsc +2 -2
  236. package/cloud-runtime/standalone/.next/server/app/projects.segments/_full.segment.rsc +2 -2
  237. package/cloud-runtime/standalone/.next/server/app/projects.segments/_head.segment.rsc +1 -1
  238. package/cloud-runtime/standalone/.next/server/app/projects.segments/_index.segment.rsc +2 -2
  239. package/cloud-runtime/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
  240. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +1 -1
  241. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects.segment.rsc +1 -1
  242. package/cloud-runtime/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  243. package/cloud-runtime/standalone/.next/server/app/settings.html +2 -2
  244. package/cloud-runtime/standalone/.next/server/app/settings.rsc +2 -2
  245. package/cloud-runtime/standalone/.next/server/app/settings.segments/_full.segment.rsc +2 -2
  246. package/cloud-runtime/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  247. package/cloud-runtime/standalone/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  248. package/cloud-runtime/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  249. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  250. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  251. package/cloud-runtime/standalone/.next/server/app/status/page_client-reference-manifest.js +1 -1
  252. package/cloud-runtime/standalone/.next/server/app/status.html +2 -2
  253. package/cloud-runtime/standalone/.next/server/app/status.rsc +2 -2
  254. package/cloud-runtime/standalone/.next/server/app/status.segments/_full.segment.rsc +2 -2
  255. package/cloud-runtime/standalone/.next/server/app/status.segments/_head.segment.rsc +1 -1
  256. package/cloud-runtime/standalone/.next/server/app/status.segments/_index.segment.rsc +2 -2
  257. package/cloud-runtime/standalone/.next/server/app/status.segments/_tree.segment.rsc +2 -2
  258. package/cloud-runtime/standalone/.next/server/app/status.segments/status/__PAGE__.segment.rsc +1 -1
  259. package/cloud-runtime/standalone/.next/server/app/status.segments/status.segment.rsc +1 -1
  260. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page.js.nft.json +1 -1
  261. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page_client-reference-manifest.js +1 -1
  262. package/cloud-runtime/standalone/.next/server/app/welcome/page.js.nft.json +1 -1
  263. package/cloud-runtime/standalone/.next/server/app/welcome/page_client-reference-manifest.js +1 -1
  264. package/cloud-runtime/standalone/.next/server/app/welcome.html +2 -2
  265. package/cloud-runtime/standalone/.next/server/app/welcome.rsc +3 -3
  266. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_full.segment.rsc +3 -3
  267. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_head.segment.rsc +1 -1
  268. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_index.segment.rsc +2 -2
  269. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_tree.segment.rsc +2 -2
  270. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome/__PAGE__.segment.rsc +2 -2
  271. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome.segment.rsc +1 -1
  272. package/cloud-runtime/standalone/.next/server/app-paths-manifest.json +1 -0
  273. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__06634853._.js +80 -0
  274. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0b3b6a47._.js +51 -0
  275. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__86f7d27b._.js → [root-of-the-server]__18423486._.js} +2 -2
  276. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__dede3dcd._.js → [root-of-the-server]__19520d85._.js} +1 -1
  277. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__399b2ca9._.js → [root-of-the-server]__1c18c0d1._.js} +2 -2
  278. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1cc2fe7f._.js +3 -0
  279. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__29419d66._.js +42 -0
  280. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__6e59b27c._.js → [root-of-the-server]__32b13ba9._.js} +2 -2
  281. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__1dd062c1._.js → [root-of-the-server]__3c1567b6._.js} +2 -2
  282. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__29ce9c60._.js → [root-of-the-server]__3c37453e._.js} +2 -2
  283. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__507a4363._.js → [root-of-the-server]__3faa64cd._.js} +2 -2
  284. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__42497c7b._.js +80 -0
  285. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__e446cb39._.js → [root-of-the-server]__4837d72a._.js} +2 -2
  286. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__10940c29._.js → [root-of-the-server]__49c03d66._.js} +2 -2
  287. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__b40c7aab._.js → [root-of-the-server]__4a8d14c1._.js} +2 -2
  288. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__75bff965._.js → [root-of-the-server]__4c861686._.js} +2 -2
  289. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4d8c6e3d._.js +58 -0
  290. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__543ba6c4._.js +1 -1
  291. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__94fa1edc._.js → [root-of-the-server]__588b6ab0._.js} +2 -2
  292. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__ccfcbcd5._.js → [root-of-the-server]__5a348fba._.js} +2 -2
  293. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__9dfaaf72._.js → [root-of-the-server]__61c99680._.js} +2 -2
  294. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__c08bef05._.js → [root-of-the-server]__6acb940d._.js} +2 -2
  295. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__98535eb3._.js → [root-of-the-server]__7e79d86a._.js} +2 -2
  296. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__6c187704._.js → [root-of-the-server]__7ffcc20c._.js} +2 -2
  297. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__c5634f17._.js → [root-of-the-server]__875279cb._.js} +1 -1
  298. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__13677d96._.js → [root-of-the-server]__8b0ab82f._.js} +2 -2
  299. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__f5b93200._.js → [root-of-the-server]__8b461158._.js} +2 -2
  300. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__918f0106._.js +80 -0
  301. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__922eb7cd._.js +80 -0
  302. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__e6ad07c3._.js → [root-of-the-server]__a67cd108._.js} +2 -2
  303. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__d8cedc8a._.js → [root-of-the-server]__abb032c1._.js} +2 -2
  304. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b3ed0a00._.js +46 -0
  305. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b63cb741._.js +63 -0
  306. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__2388b2b3._.js → [root-of-the-server]__b9b3fde6._.js} +2 -2
  307. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__f4b70b67._.js → [root-of-the-server]__be4ad4b5._.js} +2 -2
  308. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c0a18648._.js +80 -0
  309. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__5ca87ba0._.js → [root-of-the-server]__c480c9c2._.js} +2 -2
  310. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c8b49077._.js +79 -0
  311. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c99509c2._.js +101 -0
  312. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ceb02db8._.js +1 -1
  313. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d6e1ee6e._.js +32 -0
  314. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__80655727._.js → [root-of-the-server]__e069c0a3._.js} +2 -2
  315. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__f5a2358a._.js → [root-of-the-server]__e1e51c02._.js} +2 -2
  316. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__12afd8a3._.js → [root-of-the-server]__ef82dda1._.js} +2 -2
  317. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f168c6dc._.js +25 -0
  318. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f1b7932f._.js +36 -0
  319. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__4d318eb0._.js → [root-of-the-server]__f701b208._.js} +24 -24
  320. package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__2e596cc8._.js → [root-of-the-server]__fee58db1._.js} +2 -2
  321. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ffffceac._.js +6 -0
  322. package/cloud-runtime/standalone/.next/server/chunks/_5462a047._.js +3 -0
  323. package/cloud-runtime/standalone/.next/server/chunks/_5fd6af5d._.js +57 -0
  324. package/cloud-runtime/standalone/.next/server/chunks/_c965f7b3._.js +3 -0
  325. package/cloud-runtime/standalone/.next/server/chunks/_d225c04f._.js +1 -1
  326. package/cloud-runtime/standalone/.next/server/chunks/{_3e0d34cc._.js → _d22934ab._.js} +24 -24
  327. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_knowledge-notes_route_actions_0ddf6109.js +3 -0
  328. package/cloud-runtime/standalone/.next/server/chunks/lib_7cad5c77._.js +64 -0
  329. package/cloud-runtime/standalone/.next/server/chunks/lib_87c06aeb._.js +25 -0
  330. package/cloud-runtime/standalone/.next/server/chunks/lib_db_ts_e06c6085._.js +1 -1
  331. package/cloud-runtime/standalone/.next/server/chunks/lib_ea45fe73._.js +1 -1
  332. package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_2e721df2._.js +45 -37
  333. package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_74d1c060._.js +45 -37
  334. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_371d0bff.js +12 -12
  335. package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__a8a8afdc._.js → [root-of-the-server]__04d1aa70._.js} +2 -2
  336. package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__9166c1d6._.js → [root-of-the-server]__2d80540b._.js} +2 -2
  337. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__5ffa2883._.js +1 -1
  338. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__8973b16a._.js +1 -1
  339. package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1322ced8._.js → [root-of-the-server]__a416df95._.js} +2 -2
  340. package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__783669c3._.js → [root-of-the-server]__c108f06c._.js} +2 -2
  341. package/cloud-runtime/standalone/.next/server/chunks/ssr/_064370bc._.js +1 -1
  342. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_0f4e70b1._.js → _41f60c52._.js} +2 -2
  343. package/cloud-runtime/standalone/.next/server/chunks/ssr/_6b14826d._.js +3 -0
  344. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_6fc3736e._.js → _84879a01._.js} +2 -2
  345. package/cloud-runtime/standalone/.next/server/chunks/ssr/_85ca101b._.js +1 -1
  346. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_ff5799d6._.js → _9eeb2fa0._.js} +2 -2
  347. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_68ac991e._.js → _a1d30b20._.js} +2 -2
  348. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_5b2b8a85._.js → _c87c359c._.js} +2 -2
  349. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_fb292eed._.js → _dd31b6e0._.js} +2 -2
  350. package/cloud-runtime/standalone/.next/server/chunks/ssr/{_6de3f1de._.js → _f0ce6183._.js} +2 -2
  351. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_projects_[slug]_knowledge_page_tsx_e2a55cbd._.js +1 -1
  352. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_chat-ui_bfeda794._.js +1 -1
  353. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_thread_WorkspaceSidebar_tsx_e660301b._.js +1 -1
  354. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_bf855424._.js +3 -0
  355. package/cloud-runtime/standalone/.next/server/functions-config-manifest.json +1 -0
  356. package/cloud-runtime/standalone/.next/server/middleware-manifest.json +5 -5
  357. package/cloud-runtime/standalone/.next/server/pages/404.html +2 -2
  358. package/cloud-runtime/standalone/.next/server/pages/500.html +2 -2
  359. package/cloud-runtime/standalone/.next/server/server-reference-manifest.js +1 -1
  360. package/cloud-runtime/standalone/.next/server/server-reference-manifest.json +1 -1
  361. package/cloud-runtime/standalone/.next/static/chunks/{a66e1891e808a664.js → 012e3e9699415997.js} +1 -1
  362. package/cloud-runtime/standalone/.next/static/chunks/031d99fbe758545a.js +1 -0
  363. package/cloud-runtime/standalone/.next/static/chunks/{87f099ea02aa419d.js → 116985039c24f1f8.js} +9 -9
  364. package/cloud-runtime/standalone/.next/static/chunks/2ee8d24314eec47c.js +1 -0
  365. package/cloud-runtime/standalone/.next/static/chunks/3a55441b018d52e4.js +1 -0
  366. package/cloud-runtime/standalone/.next/static/chunks/{cd308f61797939cd.js → 43f6157bc3db9c52.js} +2 -2
  367. package/cloud-runtime/standalone/.next/static/chunks/{58025a80caa3629d.js → 56a01238098d495d.js} +9 -9
  368. package/cloud-runtime/standalone/.next/static/chunks/{6fbe08eab578c7d3.js → 601996727991149e.js} +9 -9
  369. package/cloud-runtime/standalone/.next/static/chunks/851b1d97179bd39b.css +1 -0
  370. package/cloud-runtime/standalone/.next/static/chunks/90b581e9631d8cea.js +1 -0
  371. package/cloud-runtime/standalone/.next/static/chunks/b22947e6df238fd5.js +1 -0
  372. package/cloud-runtime/standalone/.next/static/chunks/{4200b512bdc226bc.js → b2dcd19ebe3af3f6.js} +9 -9
  373. package/cloud-runtime/standalone/.next/static/chunks/{e62d5fa120fdf21f.js → bc06988336ffd261.js} +1 -1
  374. package/cloud-runtime/standalone/.next/static/chunks/{1f415d0ce7ebbd08.js → c93b9643c81c134e.js} +1 -1
  375. package/cloud-runtime/standalone/.next/static/chunks/{88e24940a5d5d386.js → d78cc7d749043fef.js} +1 -1
  376. package/cloud-runtime/standalone/.next/static/chunks/ebaf4e8f04bae7b6.js +1 -0
  377. package/cloud-runtime/standalone/.next/static/chunks/f4909e7ae8229b1c.js +1 -0
  378. package/cloud-runtime/standalone/.next/static/chunks/fd221a50082e5128.js +1 -0
  379. package/cloud-runtime/standalone/app/api/chat/route.ts +36 -0
  380. package/cloud-runtime/standalone/app/api/knowledge-notes/route.ts +53 -0
  381. package/cloud-runtime/standalone/app/projects/[slug]/knowledge/page.tsx +210 -26
  382. package/cloud-runtime/standalone/components/chat-ui/ChatContainer.tsx +62 -41
  383. package/cloud-runtime/standalone/components/chat-ui/Markdown.tsx +19 -9
  384. package/cloud-runtime/standalone/components/thread/WorkspaceSidebar.tsx +33 -28
  385. package/cloud-runtime/standalone/hooks/useGroupChat.ts +4 -0
  386. package/cloud-runtime/standalone/hooks/useProcessPolling.ts +4 -3
  387. package/cloud-runtime/standalone/hooks/useThreadState.ts +10 -2
  388. package/cloud-runtime/standalone/lib/cli-runner.ts +212 -14
  389. package/cloud-runtime/standalone/lib/db.ts +1 -1
  390. package/cloud-runtime/standalone/lib/debug-log.ts +48 -0
  391. package/cloud-runtime/standalone/lib/history-store.ts +78 -2
  392. package/cloud-runtime/standalone/lib/orchestrator/chat-processor.ts +51 -0
  393. package/cloud-runtime/standalone/lib/orchestrator/runtime.ts +6 -0
  394. package/cloud-runtime/standalone/lib/queue/sqlite-adapter.ts +117 -2
  395. package/cloud-runtime/standalone/transcri +0 -0
  396. package/cloud-runtime/standalone/worker/index.js +604 -165
  397. package/lib/cli/runCli.js +0 -97
  398. package/lib/commands/update.js +159 -17
  399. package/package.json +1 -1
  400. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0925dd01._.js +0 -46
  401. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__12c7e188._.js +0 -29
  402. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__17c2d68f._.js +0 -52
  403. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__20b3baea._.js +0 -55
  404. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__254e942f._.js +0 -20
  405. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3198c5c8._.js +0 -52
  406. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__36d9edbd._.js +0 -67
  407. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4761dc17._.js +0 -8
  408. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4b1a512c._.js +0 -52
  409. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4dc25d71._.js +0 -18
  410. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7be8f159._.js +0 -52
  411. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ac3c2f7f._.js +0 -52
  412. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__bfcedb7c._.js +0 -52
  413. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e1e7dd1e._.js +0 -25
  414. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e45a2a1d._.js +0 -3
  415. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fcd3e3b8._.js +0 -15
  416. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ff9c61da._.js +0 -3
  417. package/cloud-runtime/standalone/.next/server/chunks/_66e1ddec._.js +0 -57
  418. package/cloud-runtime/standalone/.next/server/chunks/lib_09aac4e7._.js +0 -57
  419. package/cloud-runtime/standalone/.next/server/chunks/lib_cli-runner_ts_dfcf3fda._.js +0 -18
  420. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_69b6b2e1.js +0 -3
  421. package/cloud-runtime/standalone/.next/server/chunks/ssr/_16c45024._.js +0 -3
  422. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_678fa868._.js +0 -3
  423. package/cloud-runtime/standalone/.next/static/chunks/24a6ee21f430da93.js +0 -1
  424. package/cloud-runtime/standalone/.next/static/chunks/27129bea5b512ce8.js +0 -1
  425. package/cloud-runtime/standalone/.next/static/chunks/463edf3533d27a56.js +0 -1
  426. package/cloud-runtime/standalone/.next/static/chunks/5cb0c885b085ea6c.js +0 -1
  427. package/cloud-runtime/standalone/.next/static/chunks/60c054bb8b2cffa6.css +0 -1
  428. package/cloud-runtime/standalone/.next/static/chunks/7e2edf97bd6c0874.js +0 -1
  429. package/cloud-runtime/standalone/.next/static/chunks/8249f202d33d0d95.js +0 -1
  430. package/cloud-runtime/standalone/.next/static/chunks/9f8f719c4aa25e3d.js +0 -1
  431. package/cloud-runtime/standalone/.next/static/chunks/bc727d3d9993e9be.js +0 -1
  432. /package/cloud-runtime/standalone/.next/static/{i_9nSHyb52FGkCbRgv7EJ → 68nLQxEpwR_feFvB8T4tR}/_buildManifest.js +0 -0
  433. /package/cloud-runtime/standalone/.next/static/{i_9nSHyb52FGkCbRgv7EJ → 68nLQxEpwR_feFvB8T4tR}/_clientMiddlewareManifest.json +0 -0
  434. /package/cloud-runtime/standalone/.next/static/{i_9nSHyb52FGkCbRgv7EJ → 68nLQxEpwR_feFvB8T4tR}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747),r=e.i(46786);let i=process.env.AGX_GROUP_CHAT_DIR?.trim()||a.default.join(r.default.homedir(),".agx","group-chat"),n=a.default.join(i,"history.sqlite"),d="global",o=new Set(["ack","working","done","clarify","blocked"]),p={ack:new Set(["ack","working"]),working:new Set(["ack","working","done","clarify","blocked"]),done:new Set(["done","ack","working"]),clarify:new Set(["ack","clarify","working"]),blocked:new Set(["ack","blocked","working"])};class _ extends Error{status;constructor(e,t){super(e),this.name="ReactionStoreError",this.status=t}}function E(e,t){return e.prepare(`PRAGMA table_info(${t})`).all().some(e=>"thread_id"===e.name)}function m(e){if(!e)return null;try{let t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:null}catch{return null}}function l(e){return{id:e.id,threadId:e.thread_id,rootMessageId:e.root_message_id,userId:e.user_id,projectSlug:e.project_slug,status:e.status,currentStep:e.current_step,maxSteps:e.max_steps,stepsUsed:e.steps_used,lastError:e.last_error,activeParticipantIds:function(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}(e.active_participant_ids),payload:m(e.payload_json),result:m(e.result_json),createdAt:e.created_at,updatedAt:e.updated_at,completedAt:e.completed_at}}function T(e){return{id:e.id,chatRunId:e.chat_run_id,stepIndex:e.step_index,kind:e.kind,status:e.status,participantId:e.participant_id,inputPayload:m(e.input_payload_json),outputPayload:m(e.output_payload_json),startedAt:e.started_at,completedAt:e.completed_at}}let c=async e=>{await s.promises.mkdir(i,{recursive:!0});let a=new t.default(n);a.pragma("journal_mode = WAL");try{let t,s;return a.exec(`
1
+ module.exports=[42639,e=>{"use strict";var t=e.i(85148),a=e.i(22734),s=e.i(14747),r=e.i(46786);let i=process.env.AGX_GROUP_CHAT_DIR?.trim()||s.default.join(r.default.homedir(),".agx","group-chat"),n=s.default.join(i,"history.sqlite"),d="global",o=new Set(["ack","working","done","clarify","blocked"]),p={ack:new Set(["ack","working"]),working:new Set(["ack","working","done","clarify","blocked"]),done:new Set(["done","ack","working"]),clarify:new Set(["ack","clarify","working"]),blocked:new Set(["ack","blocked","working"])};class _ extends Error{status;constructor(e,t){super(e),this.name="ReactionStoreError",this.status=t}}function E(e,t){return e.prepare(`PRAGMA table_info(${t})`).all().some(e=>"thread_id"===e.name)}function l(e){if(!e)return null;try{let t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)?t:null}catch{return null}}function m(e){return{id:e.id,threadId:e.thread_id,rootMessageId:e.root_message_id,userId:e.user_id,projectSlug:e.project_slug,status:e.status,currentStep:e.current_step,maxSteps:e.max_steps,stepsUsed:e.steps_used,lastError:e.last_error,activeParticipantIds:function(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}(e.active_participant_ids),payload:l(e.payload_json),result:l(e.result_json),createdAt:e.created_at,updatedAt:e.updated_at,completedAt:e.completed_at}}function c(e){return{id:e.id,chatRunId:e.chat_run_id,stepIndex:e.step_index,kind:e.kind,status:e.status,participantId:e.participant_id,inputPayload:l(e.input_payload_json),outputPayload:l(e.output_payload_json),startedAt:e.started_at,completedAt:e.completed_at}}let u=async e=>{await a.promises.mkdir(i,{recursive:!0});let s=new t.default(n);s.pragma("journal_mode = WAL");try{let t,a;return s.exec(`
2
2
  CREATE TABLE IF NOT EXISTS messages (
3
3
  thread_id TEXT NOT NULL,
4
4
  id TEXT NOT NULL,
@@ -77,7 +77,7 @@ module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747
77
77
  started_at INTEGER NOT NULL,
78
78
  completed_at INTEGER
79
79
  );
80
- `),E(a,"messages")||a.exec(`
80
+ `),E(s,"messages")||s.exec(`
81
81
  ALTER TABLE messages RENAME TO messages_legacy;
82
82
  CREATE TABLE messages (
83
83
  thread_id TEXT NOT NULL,
@@ -92,7 +92,7 @@ module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747
92
92
  SELECT '${d}', id, role, participant_id, content, timestamp
93
93
  FROM messages_legacy;
94
94
  DROP TABLE messages_legacy;
95
- `),E(a,"message_reactions")||a.exec(`
95
+ `),E(s,"message_reactions")||s.exec(`
96
96
  ALTER TABLE message_reactions RENAME TO message_reactions_legacy;
97
97
  CREATE TABLE message_reactions (
98
98
  thread_id TEXT NOT NULL,
@@ -110,7 +110,7 @@ module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747
110
110
  SELECT '${d}', message_id, participant_id, type, reason, blocker_code, NULL, updated_at
111
111
  FROM message_reactions_legacy;
112
112
  DROP TABLE message_reactions_legacy;
113
- `),new Set(a.prepare("PRAGMA table_info(logs)").all().map(e=>e.name)).has("agent_process_id")||a.exec(`
113
+ `),new Set(s.prepare("PRAGMA table_info(logs)").all().map(e=>e.name)).has("agent_process_id")||s.exec(`
114
114
  DROP TABLE IF EXISTS logs;
115
115
  CREATE TABLE logs (
116
116
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -119,15 +119,15 @@ module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747
119
119
  line TEXT NOT NULL,
120
120
  timestamp INTEGER NOT NULL
121
121
  );
122
- `),new Set(a.prepare("PRAGMA table_info(messages)").all().map(e=>e.name)).has("root_message_id")||a.exec(`
122
+ `),new Set(s.prepare("PRAGMA table_info(messages)").all().map(e=>e.name)).has("root_message_id")||s.exec(`
123
123
  ALTER TABLE messages ADD COLUMN root_message_id TEXT;
124
124
  ALTER TABLE messages ADD COLUMN parent_message_id TEXT;
125
125
  ALTER TABLE messages ADD COLUMN depth INTEGER NOT NULL DEFAULT 0;
126
126
  CREATE INDEX IF NOT EXISTS idx_messages_root ON messages(thread_id, root_message_id);
127
- `),new Set(a.prepare("PRAGMA table_info(messages)").all().map(e=>e.name)).has("thread_status")||a.exec(`
127
+ `),new Set(s.prepare("PRAGMA table_info(messages)").all().map(e=>e.name)).has("thread_status")||s.exec(`
128
128
  ALTER TABLE messages ADD COLUMN thread_status TEXT;
129
129
  ALTER TABLE messages ADD COLUMN outcome_note TEXT;
130
- `),(t=new Set(a.prepare("PRAGMA table_info(message_reactions)").all().map(e=>e.name))).has("host_pid")||a.exec("ALTER TABLE message_reactions ADD COLUMN host_pid INTEGER"),t.has("response_message_id")||a.exec("ALTER TABLE message_reactions ADD COLUMN response_message_id TEXT"),a.exec("UPDATE messages SET thread_status = 'in-review' WHERE thread_status = 'parked'"),a.exec("UPDATE messages SET thread_status = 'active' WHERE thread_status = 'thinking'"),a.exec("UPDATE messages SET thread_status = 'done' WHERE thread_status = 'resolved'"),a.exec("UPDATE messages SET thread_status = 'active' WHERE thread_status = 'converged'"),s=a.prepare("PRAGMA table_info(agent_processes)").all(),0===s.length||new Set(s.map(e=>e.name)).has("id")||a.exec(`
130
+ `),(t=new Set(s.prepare("PRAGMA table_info(message_reactions)").all().map(e=>e.name))).has("host_pid")||s.exec("ALTER TABLE message_reactions ADD COLUMN host_pid INTEGER"),t.has("response_message_id")||s.exec("ALTER TABLE message_reactions ADD COLUMN response_message_id TEXT"),s.exec("UPDATE messages SET thread_status = 'in-review' WHERE thread_status = 'parked'"),s.exec("UPDATE messages SET thread_status = 'active' WHERE thread_status = 'thinking'"),s.exec("UPDATE messages SET thread_status = 'done' WHERE thread_status = 'resolved'"),s.exec("UPDATE messages SET thread_status = 'active' WHERE thread_status = 'converged'"),a=s.prepare("PRAGMA table_info(agent_processes)").all(),0===a.length||new Set(a.map(e=>e.name)).has("id")||s.exec(`
131
131
  DROP TABLE IF EXISTS agent_processes;
132
132
  CREATE TABLE agent_processes (
133
133
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -163,42 +163,42 @@ module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747
163
163
  INSERT INTO messages_fts(messages_fts, rowid, content) VALUES('delete', old.rowid, old.content);
164
164
  INSERT INTO messages_fts(rowid, content) VALUES (new.rowid, new.content);
165
165
  END;
166
- `),0===e.prepare("SELECT COUNT(*) as count FROM messages").get().count)return;let s=e.prepare("SELECT COUNT(*) as count FROM messages_fts").get().count;t&&0!==s||e.exec("INSERT INTO messages_fts(rowid, content) SELECT rowid, content FROM messages;")}(a),a.exec(`
166
+ `),0===e.prepare("SELECT COUNT(*) as count FROM messages").get().count)return;let a=e.prepare("SELECT COUNT(*) as count FROM messages_fts").get().count;t&&0!==a||e.exec("INSERT INTO messages_fts(rowid, content) SELECT rowid, content FROM messages;")}(s),s.exec(`
167
167
  CREATE INDEX IF NOT EXISTS idx_messages_thread_ts ON messages(thread_id, timestamp ASC);
168
168
  CREATE INDEX IF NOT EXISTS idx_reactions_thread_message ON message_reactions(thread_id, message_id, updated_at ASC);
169
169
  CREATE INDEX IF NOT EXISTS idx_logs_process_ts ON logs(agent_process_id, timestamp ASC);
170
170
  CREATE INDEX IF NOT EXISTS idx_chat_runs_thread_updated ON chat_runs(thread_id, updated_at DESC);
171
171
  CREATE INDEX IF NOT EXISTS idx_chat_runs_status_updated ON chat_runs(status, updated_at DESC);
172
172
  CREATE INDEX IF NOT EXISTS idx_chat_run_steps_run_step ON chat_run_steps(chat_run_id, step_index ASC);
173
- `),e(a)}finally{a.close()}};function u(e){let t=new Map;for(let s of e){let e=t.get(s.message_id);e||(e=new Map,t.set(s.message_id,e));let a=e.get(s.type);a||(a={type:s.type,count:0,participantIds:[]},e.set(s.type,a)),a.count+=1,a.participantIds.push(s.participant_id)}let s=new Map;for(let[e,a]of t.entries()){let t=Array.from(a.values()).sort((e,t)=>t.count!==e.count?t.count-e.count:e.type.localeCompare(t.type));s.set(e,t)}return s}function g(e,t,s){if(s&&0===s.length)return new Map;if(s){let a=s.map(()=>"?").join(", ");return u(e.prepare(`SELECT message_id, participant_id, type
173
+ `),e(s)}finally{s.close()}};function T(e){let t=new Map;for(let a of e){let e=t.get(a.message_id);e||(e=new Map,t.set(a.message_id,e));let s=e.get(a.type);s||(s={type:a.type,count:0,participantIds:[]},e.set(a.type,s)),s.count+=1,s.participantIds.push(a.participant_id)}let a=new Map;for(let[e,s]of t.entries()){let t=Array.from(s.values()).sort((e,t)=>t.count!==e.count?t.count-e.count:e.type.localeCompare(t.type));a.set(e,t)}return a}function g(e,t,a){if(a&&0===a.length)return new Map;if(a){let s=a.map(()=>"?").join(", ");return T(e.prepare(`SELECT message_id, participant_id, type
174
174
  FROM message_reactions
175
- WHERE thread_id = ? AND message_id IN (${a})
176
- ORDER BY updated_at ASC`).all(t,...s))}return u(e.prepare(`SELECT message_id, participant_id, type
175
+ WHERE thread_id = ? AND message_id IN (${s})
176
+ ORDER BY updated_at ASC`).all(t,...a))}return T(e.prepare(`SELECT message_id, participant_id, type
177
177
  FROM message_reactions
178
178
  WHERE thread_id = ?
179
- ORDER BY updated_at ASC`).all(t))}function N(e){if("string"!=typeof e)return null;let t=e.trim();return t.length>0?t:null}function L(e){return"number"!=typeof e||!Number.isInteger(e)||e<=0?null:e}function h(e,t,s=100){return Math.min(Math.max(Math.trunc(Number.isFinite(e)?Number(e):t),1),s)}function R(e){return e.replace(/[\\%_]/g,"\\$&")}function I(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function O(e,t){return{id:e.id,role:e.role,participantId:e.participant_id,content:e.content,timestamp:e.timestamp,reactions:t.get(e.id),rootMessageId:e.root_message_id,parentMessageId:e.parent_message_id,depth:e.depth,...e.thread_status?{threadStatus:e.thread_status}:{},...e.outcome_note?{outcomeNote:e.outcome_note}:{}}}function A(e){return e.replace(/\[agx:spawn\]\s*/g,"").replace(/\s*\[agx:exit:\d+\]\s*/g,"").replace(/^\[SKIP\]\s*$/gm,"").trim()}function S(e){return"working"===e?"running":"done"===e?"done":"blocked"===e||"clarify"===e?"failed":null}async function f(e){let{status:t,limit:s=20,offset:a=0}=e??{};return c(e=>{let r=["m.root_message_id IS NULL","m.depth = 0"],i=[];t&&(r.push("COALESCE(m.thread_status, 'active') = ?"),i.push(t));let n=r.join(" AND "),d=e.prepare(`SELECT COUNT(*) as cnt FROM messages m WHERE ${n}`).get(...(i.length?[i]:[]).flat());return{rows:e.prepare(`SELECT m.thread_id, m.id, m.content, m.timestamp,
179
+ ORDER BY updated_at ASC`).all(t))}function N(e){if("string"!=typeof e)return null;let t=e.trim();return t.length>0?t:null}function h(e){return"number"!=typeof e||!Number.isInteger(e)||e<=0?null:e}function L(e,t,a=100){return Math.min(Math.max(Math.trunc(Number.isFinite(e)?Number(e):t),1),a)}function R(e){return e.replace(/[\\%_]/g,"\\$&")}function I(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function O(e,t){return{id:e.id,role:e.role,participantId:e.participant_id,content:e.content,timestamp:e.timestamp,reactions:t.get(e.id),rootMessageId:e.root_message_id,parentMessageId:e.parent_message_id,depth:e.depth,...e.thread_status?{threadStatus:e.thread_status}:{},...e.outcome_note?{outcomeNote:e.outcome_note}:{}}}function A(e){return e.replace(/\[agx:spawn\]\s*/g,"").replace(/\s*\[agx:exit:\d+\]\s*/g,"").replace(/^\[SKIP\]\s*$/gm,"").trim()}function S(e){return"working"===e?"running":"done"===e?"done":"blocked"===e||"clarify"===e?"failed":null}async function f(e){let{status:t,limit:a=20,offset:s=0}=e??{};return u(e=>{let r=["m.root_message_id IS NULL","m.depth = 0"],i=[];t&&(r.push("COALESCE(m.thread_status, 'active') = ?"),i.push(t));let n=r.join(" AND "),d=e.prepare(`SELECT COUNT(*) as cnt FROM messages m WHERE ${n}`).get(...(i.length?[i]:[]).flat());return{rows:e.prepare(`SELECT m.thread_id, m.id, m.content, m.timestamp,
180
180
  m.thread_status, m.outcome_note,
181
181
  (SELECT COUNT(*) FROM messages r WHERE r.root_message_id = m.id AND r.thread_id = m.thread_id) as reply_count,
182
182
  COALESCE((SELECT MAX(r.timestamp) FROM messages r WHERE r.root_message_id = m.id AND r.thread_id = m.thread_id), m.timestamp) as last_activity
183
183
  FROM messages m
184
184
  WHERE ${n}
185
185
  ORDER BY last_activity DESC
186
- LIMIT ? OFFSET ?`).all(...i,s,a),total:d.cnt}})}async function y(t){if(0===t.length)return{};let{getSQLiteDb:s}=await e.A(18801),a=s(),r=t.map(()=>"?").join(", "),i=a.prepare(`SELECT pt.thread_id, p.name FROM project_threads pt
186
+ LIMIT ? OFFSET ?`).all(...i,a,s),total:d.cnt}})}async function y(t){if(0===t.length)return{};let{getSQLiteDb:a}=await e.A(18801),s=a(),r=t.map(()=>"?").join(", "),i=s.prepare(`SELECT pt.thread_id, p.name FROM project_threads pt
187
187
  JOIN projects p ON p.id = pt.project_id
188
- WHERE pt.thread_id IN (${r})`).all(...t),n={};for(let e of i)n[e.thread_id]||(n[e.thread_id]=e.name);return n}async function M(t){let{getSQLiteDb:s}=await e.A(18801);return s().prepare("SELECT thread_id FROM project_threads WHERE project_id = ?").all(t).map(e=>e.thread_id)}async function D(e,t){let s=e.trim()||d;return c(e=>{let a=null!=t?`SELECT id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note
188
+ WHERE pt.thread_id IN (${r})`).all(...t),n={};for(let e of i)n[e.thread_id]||(n[e.thread_id]=e.name);return n}async function D(t){let{getSQLiteDb:a}=await e.A(18801);return a().prepare("SELECT thread_id FROM project_threads WHERE project_id = ? ORDER BY created_at ASC").all(t).map(e=>e.thread_id)}async function C(e,t){let a=e.trim()||d;return u(e=>{let s=null!=t?`SELECT id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note
189
189
  FROM messages
190
190
  WHERE thread_id = ? AND timestamp > ?
191
191
  ORDER BY timestamp ASC`:`SELECT id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note
192
192
  FROM messages
193
193
  WHERE thread_id = ?
194
- ORDER BY timestamp ASC`,r=null!=t?e.prepare(a).all(s,t):e.prepare(a).all(s),i=g(e,s,r.map(e=>e.id));return r.map(e=>O(e,i))})}async function C(e){let t=N(e.rootMessageId),s=e.threadId?.trim()||null,a=null!=e.processLimit?h(e.processLimit,10):null;return c(e=>{if(!t&&!s)return{rootMessage:null,processes:[],messages:[],lastUpdatedAt:null};let r=s&&t?e.prepare(`SELECT thread_id, id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note
194
+ ORDER BY timestamp ASC`,r=null!=t?e.prepare(s).all(a,t):e.prepare(s).all(a),i=g(e,a,r.map(e=>e.id));return r.map(e=>O(e,i))})}async function M(e){let t=N(e.rootMessageId),a=e.threadId?.trim()||null,s=null!=e.processLimit?L(e.processLimit,10):null;return u(e=>{if(!t&&!a)return{rootMessage:null,processes:[],messages:[],lastUpdatedAt:null};let r=a&&t?e.prepare(`SELECT thread_id, id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note
195
195
  FROM messages
196
196
  WHERE thread_id = ? AND id = ?
197
- LIMIT 1`).get(s,t):s?e.prepare(`SELECT thread_id, id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note
197
+ LIMIT 1`).get(a,t):a?e.prepare(`SELECT thread_id, id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note
198
198
  FROM messages
199
199
  WHERE thread_id = ?
200
200
  ORDER BY CASE WHEN root_message_id IS NULL THEN 0 ELSE 1 END, timestamp ASC, id ASC
201
- LIMIT 1`).get(s):e.prepare(`SELECT thread_id, id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note
201
+ LIMIT 1`).get(a):e.prepare(`SELECT thread_id, id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note
202
202
  FROM messages
203
203
  WHERE id = ?
204
204
  ORDER BY timestamp ASC, thread_id ASC
@@ -225,7 +225,7 @@ module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747
225
225
  AND r.type IN ('working', 'done', 'clarify', 'blocked')
226
226
  AND (m.root_message_id = ? OR m.id = ?)
227
227
  ORDER BY r.updated_at DESC
228
- ${null!=a?"LIMIT ?":""}`).all(i,n,n,...null!=a?[a]:[]),_=O(d,o),E=p.map(e=>{let t=S(e.type);return t?{processId:L(e.host_pid),datetime:e.datetime,agent:e.participant_id,responseTo:e.response_to??"",responseToMessageId:e.response_to_message_id??"",responseToSenderName:N(e.response_to_participant_id)??e.response_to_role??"",responseToSenderRole:e.response_to_role??"user",responseMessageId:N(e.response_message_id),responseContent:e.response_content,status:t}:null}).filter(e=>null!==e),m=e.prepare(`SELECT ap.agent_id, ap.pid, ap.state, ap.since_message_id, ap.started_at, ap.last_activity,
228
+ ${null!=s?"LIMIT ?":""}`).all(i,n,n,...null!=s?[s]:[]),_=O(d,o),E=p.map(e=>{let t=S(e.type);return t?{processId:h(e.host_pid),datetime:e.datetime,agent:e.participant_id,responseTo:e.response_to??"",responseToMessageId:e.response_to_message_id??"",responseToSenderName:N(e.response_to_participant_id)??e.response_to_role??"",responseToSenderRole:e.response_to_role??"user",responseMessageId:N(e.response_message_id),responseContent:e.response_content,status:t}:null}).filter(e=>null!==e),l=e.prepare(`SELECT ap.id, ap.agent_id, ap.pid, ap.state, ap.since_message_id, ap.started_at, ap.last_activity,
229
229
  m.content as response_to,
230
230
  m.role as response_to_role,
231
231
  m.participant_id as response_to_participant_id
@@ -233,7 +233,10 @@ module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747
233
233
  LEFT JOIN messages m
234
234
  ON m.id = ap.since_message_id AND m.thread_id = ap.workspace_id
235
235
  WHERE ap.thread_id = ?
236
- AND ap.state IN ('running', 'spawning')`).all(n),l=new Set(E.filter(e=>null!=e.processId).map(e=>e.processId)),T=new Set(E.filter(e=>"running"===e.status).map(e=>e.agent));for(let e of m)l.has(e.pid)||T.has(e.agent_id)||E.push({processId:e.pid||null,datetime:e.started_at,agent:e.agent_id,responseTo:e.response_to??"",responseToMessageId:e.since_message_id??"",responseToSenderName:N(e.response_to_participant_id)??e.response_to_role??"user",responseToSenderRole:e.response_to_role??"user",responseMessageId:null,responseContent:null,status:"running"});let c=e.prepare(`SELECT m.id, m.role, m.participant_id, m.content, m.timestamp,
236
+ AND ap.state IN ('running', 'spawning')`).all(n),m=Date.now(),c=l.filter(e=>!(Math.max(e.last_activity||0,e.started_at||0)>m-6e5)&&!function(e){if(!Number.isFinite(e)||!e||e<=0)return!1;try{return process.kill(e,0),!0}catch{return!1}}(e.pid)).map(e=>e.id),u=new Set(c);if(c.length>0){let t=e.prepare(`UPDATE agent_processes
237
+ SET state = 'error',
238
+ last_activity = ?
239
+ WHERE id = ?`);e.transaction(e=>{for(let a of e)t.run(m,a)})(c)}let T=new Set(E.filter(e=>null!=e.processId).map(e=>e.processId)),L=new Set(E.filter(e=>"running"===e.status).map(e=>e.agent));for(let e of l)!u.has(e.id)&&(T.has(e.pid)||L.has(e.agent_id)||E.push({processId:e.pid||null,datetime:e.started_at,agent:e.agent_id,responseTo:e.response_to??"",responseToMessageId:e.since_message_id??"",responseToSenderName:N(e.response_to_participant_id)??e.response_to_role??"user",responseToSenderRole:e.response_to_role??"user",responseMessageId:null,responseContent:null,status:"running"}));let R=e.prepare(`SELECT m.id, m.role, m.participant_id, m.content, m.timestamp,
237
240
  m.parent_message_id,
238
241
  r.host_pid, r.type as reaction_type
239
242
  FROM messages m
@@ -244,35 +247,40 @@ module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747
244
247
  AND r.type IN ('working', 'done', 'clarify', 'blocked')
245
248
  WHERE m.thread_id = ?
246
249
  AND (m.root_message_id = ? OR m.id = ?)
247
- ORDER BY m.timestamp ASC`).all(i,n,n).filter(e=>A(e.content).trim().length>0).map(e=>{let t=null;return"assistant"===e.role&&(t=e.reaction_type?S(e.reaction_type):"done"),{id:e.id,role:e.role,participantId:e.participant_id,content:A(e.content),timestamp:e.timestamp,parentMessageId:e.parent_message_id,processId:"assistant"===e.role?L(e.host_pid):null,status:t}}),u=[];for(let e of(u.push(_.timestamp),E))u.push(e.datetime);for(let e of c)u.push(e.timestamp);return{rootMessage:_,processes:E,messages:c,lastUpdatedAt:u.length>0?Math.max(...u):null}})}async function U(e,t){if(0===t.length)return;let s=e.trim()||d;await c(e=>{let a=e.prepare(`INSERT OR REPLACE INTO messages (thread_id, id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note)
248
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);e.transaction(e=>{for(let t of e)a.run(s,t.id,t.role,t.participantId,t.content,t.timestamp,t.rootMessageId??null,t.parentMessageId??null,t.depth??0,t.threadStatus??null,t.outcomeNote??null)})(t)})}async function F(e){let t=Date.now();return c(s=>{s.prepare(`INSERT INTO chat_runs (
250
+ ORDER BY m.timestamp ASC`).all(i,n,n).filter(e=>A(e.content).trim().length>0).map(e=>{let t=null;return"assistant"===e.role&&(t=e.reaction_type?S(e.reaction_type):"done"),{id:e.id,role:e.role,participantId:e.participant_id,content:A(e.content),timestamp:e.timestamp,parentMessageId:e.parent_message_id,processId:"assistant"===e.role?h(e.host_pid):null,status:t}}),I=[];for(let e of(I.push(_.timestamp),E))I.push(e.datetime);for(let e of R)I.push(e.timestamp);return{rootMessage:_,processes:E,messages:R,lastUpdatedAt:I.length>0?Math.max(...I):null}})}async function U(e,t){if(0===t.length)return;let a=e.trim()||d;await u(e=>{let s=e.prepare(`INSERT OR REPLACE INTO messages (thread_id, id, role, participant_id, content, timestamp, root_message_id, parent_message_id, depth, thread_status, outcome_note)
251
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);e.transaction(e=>{for(let t of e)s.run(a,t.id,t.role,t.participantId,t.content,t.timestamp,t.rootMessageId??null,t.parentMessageId??null,t.depth??0,t.threadStatus??null,t.outcomeNote??null)})(t)})}async function F(e){let t=Date.now();return u(a=>{a.prepare(`INSERT INTO chat_runs (
249
252
  id, thread_id, root_message_id, user_id, project_slug, status,
250
253
  current_step, max_steps, steps_used, last_error, active_participant_ids,
251
254
  payload_json, result_json, created_at, updated_at, completed_at
252
- ) VALUES (?, ?, ?, ?, ?, 'queued', 0, ?, 0, NULL, ?, ?, NULL, ?, ?, NULL)`).run(e.id,e.threadId.trim()||d,N(e.rootMessageId),e.userId,N(e.projectSlug),h(e.maxSteps,10,50),JSON.stringify(e.activeParticipantIds),e.payload?JSON.stringify(e.payload):null,t,t);let a=s.prepare("SELECT * FROM chat_runs WHERE id = ? LIMIT 1").get(e.id);if(!a)throw Error(`Failed to create chat run ${e.id}`);return l(a)})}async function X(e){return c(t=>{let s=t.prepare("SELECT * FROM chat_runs WHERE id = ? LIMIT 1").get(e);return s?l(s):null})}async function w(e){let t=N(e.threadId??null),s=h(e.limit,20,100);return c(a=>{let r=[],i=[];t&&(r.push("thread_id = ?"),i.push(t)),"active"===e.status?r.push("status IN ('queued', 'running')"):e.status&&(r.push("status = ?"),i.push(e.status));let n=r.length>0?`WHERE ${r.join(" AND ")}`:"";return a.prepare(`SELECT * FROM chat_runs ${n} ORDER BY updated_at DESC LIMIT ?`).all(...i,s).map(l)})}async function k(e){return c(t=>{let s=["updated_at = ?"],a=[Date.now()];e.status&&(s.push("status = ?"),a.push(e.status)),"number"==typeof e.currentStep&&(s.push("current_step = ?"),a.push(e.currentStep)),"number"==typeof e.stepsUsed&&(s.push("steps_used = ?"),a.push(e.stepsUsed)),void 0!==e.lastError&&(s.push("last_error = ?"),a.push(N(e.lastError))),void 0!==e.payload&&(s.push("payload_json = ?"),a.push(e.payload?JSON.stringify(e.payload):null)),void 0!==e.result&&(s.push("result_json = ?"),a.push(e.result?JSON.stringify(e.result):null)),void 0!==e.completedAt&&(s.push("completed_at = ?"),a.push(e.completedAt)),a.push(e.id),t.prepare(`UPDATE chat_runs SET ${s.join(", ")} WHERE id = ?`).run(...a);let r=t.prepare("SELECT * FROM chat_runs WHERE id = ? LIMIT 1").get(e.id);return r?l(r):null})}async function x(e){let t=Date.now();return c(s=>{s.prepare(`INSERT INTO chat_run_steps (
255
+ ) VALUES (?, ?, ?, ?, ?, 'queued', 0, ?, 0, NULL, ?, ?, NULL, ?, ?, NULL)`).run(e.id,e.threadId.trim()||d,N(e.rootMessageId),e.userId,N(e.projectSlug),L(e.maxSteps,10,50),JSON.stringify(e.activeParticipantIds),e.payload?JSON.stringify(e.payload):null,t,t);let s=a.prepare("SELECT * FROM chat_runs WHERE id = ? LIMIT 1").get(e.id);if(!s)throw Error(`Failed to create chat run ${e.id}`);return m(s)})}async function w(e){let t=N(e?.threadId??null),a=Number.isFinite(e?.olderThanMs)?Math.max(e.olderThanMs,1):6e5,s=Date.now(),r=s-a;return u(e=>{let a=["status = 'running'","updated_at <= ?"],i=[r];return t&&(a.push("thread_id = ?"),i.push(t)),e.prepare(`UPDATE chat_runs
256
+ SET status = 'failed',
257
+ last_error = COALESCE(NULLIF(last_error, ''), 'Worker process died mid-execution'),
258
+ updated_at = ?,
259
+ completed_at = COALESCE(completed_at, ?)
260
+ WHERE ${a.join(" AND ")}`).run(s,s,...i).changes})}async function X(e){return await w(),u(t=>{let a=t.prepare("SELECT * FROM chat_runs WHERE id = ? LIMIT 1").get(e);return a?m(a):null})}async function k(e){await w({threadId:e.threadId});let t=N(e.threadId??null),a=L(e.limit,20,100);return u(s=>{let r=[],i=[];t&&(r.push("thread_id = ?"),i.push(t)),"active"===e.status?r.push("status IN ('queued', 'running')"):e.status&&(r.push("status = ?"),i.push(e.status));let n=r.length>0?`WHERE ${r.join(" AND ")}`:"";return s.prepare(`SELECT * FROM chat_runs ${n} ORDER BY updated_at DESC LIMIT ?`).all(...i,a).map(m)})}async function x(e){return u(t=>{let a=["updated_at = ?"],s=[Date.now()];e.status&&(a.push("status = ?"),s.push(e.status)),"number"==typeof e.currentStep&&(a.push("current_step = ?"),s.push(e.currentStep)),"number"==typeof e.stepsUsed&&(a.push("steps_used = ?"),s.push(e.stepsUsed)),void 0!==e.lastError&&(a.push("last_error = ?"),s.push(N(e.lastError))),void 0!==e.payload&&(a.push("payload_json = ?"),s.push(e.payload?JSON.stringify(e.payload):null)),void 0!==e.result&&(a.push("result_json = ?"),s.push(e.result?JSON.stringify(e.result):null)),void 0!==e.completedAt&&(a.push("completed_at = ?"),s.push(e.completedAt)),s.push(e.id),t.prepare(`UPDATE chat_runs SET ${a.join(", ")} WHERE id = ?`).run(...s);let r=t.prepare("SELECT * FROM chat_runs WHERE id = ? LIMIT 1").get(e.id);return r?m(r):null})}async function W(e){let t=Date.now();return u(a=>{a.prepare(`INSERT INTO chat_run_steps (
253
261
  id, chat_run_id, step_index, kind, status, participant_id,
254
262
  input_payload_json, output_payload_json, started_at, completed_at
255
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(e.id,e.chatRunId,e.stepIndex,e.kind,e.status,N(e.participantId),e.inputPayload?JSON.stringify(e.inputPayload):null,e.outputPayload?JSON.stringify(e.outputPayload):null,t,"completed"===e.status||"failed"===e.status?t:null);let a=s.prepare("SELECT * FROM chat_run_steps WHERE id = ? LIMIT 1").get(e.id);if(!a)throw Error(`Failed to append chat run step ${e.id}`);return T(a)})}async function H(e){return c(t=>{let s=[],a=[];if(e.status&&(s.push("status = ?"),a.push(e.status)),void 0!==e.outputPayload&&(s.push("output_payload_json = ?"),a.push(e.outputPayload?JSON.stringify(e.outputPayload):null)),void 0!==e.completedAt&&(s.push("completed_at = ?"),a.push(e.completedAt)),0===s.length){let s=t.prepare("SELECT * FROM chat_run_steps WHERE id = ? LIMIT 1").get(e.id);return s?T(s):null}a.push(e.id),t.prepare(`UPDATE chat_run_steps SET ${s.join(", ")} WHERE id = ?`).run(...a);let r=t.prepare("SELECT * FROM chat_run_steps WHERE id = ? LIMIT 1").get(e.id);return r?T(r):null})}async function W(e){return c(t=>t.prepare("SELECT * FROM chat_run_steps WHERE chat_run_id = ? ORDER BY step_index ASC, started_at ASC").all(e).map(T))}async function P(e,t,s,a){let r=e.trim()||d;await c(e=>{e.prepare("UPDATE messages SET thread_status = ?, outcome_note = ? WHERE thread_id = ? AND id = ?").run(s,a,r,t)})}async function B(e){return c(t=>{let s=t.prepare("SELECT thread_id FROM messages WHERE id = ?").get(e.trim());return s?{threadId:s.thread_id}:null})}async function G(e){let t=e.trim()||d;await c(e=>{e.transaction(t=>{e.prepare("DELETE FROM message_reactions WHERE thread_id = ?").run(t),e.prepare("DELETE FROM messages WHERE thread_id = ?").run(t)})(t)})}async function j(e,t){let s=e.trim()||d,a=t.trim();a&&await c(e=>{e.transaction((t,s)=>{e.prepare("DELETE FROM message_reactions WHERE thread_id = ? AND message_id = ?").run(t,s),e.prepare("DELETE FROM messages WHERE thread_id = ? AND id = ?").run(t,s)})(s,a)})}async function b(e,t){let s=e.trim()||d,a=t.trim();a&&await c(e=>{e.transaction((t,s)=>{e.prepare(`DELETE FROM message_reactions
263
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(e.id,e.chatRunId,e.stepIndex,e.kind,e.status,N(e.participantId),e.inputPayload?JSON.stringify(e.inputPayload):null,e.outputPayload?JSON.stringify(e.outputPayload):null,t,"completed"===e.status||"failed"===e.status?t:null);let s=a.prepare("SELECT * FROM chat_run_steps WHERE id = ? LIMIT 1").get(e.id);if(!s)throw Error(`Failed to append chat run step ${e.id}`);return c(s)})}async function H(e){return u(t=>{let a=[],s=[];if(e.status&&(a.push("status = ?"),s.push(e.status)),void 0!==e.outputPayload&&(a.push("output_payload_json = ?"),s.push(e.outputPayload?JSON.stringify(e.outputPayload):null)),void 0!==e.completedAt&&(a.push("completed_at = ?"),s.push(e.completedAt)),0===a.length){let a=t.prepare("SELECT * FROM chat_run_steps WHERE id = ? LIMIT 1").get(e.id);return a?c(a):null}s.push(e.id),t.prepare(`UPDATE chat_run_steps SET ${a.join(", ")} WHERE id = ?`).run(...s);let r=t.prepare("SELECT * FROM chat_run_steps WHERE id = ? LIMIT 1").get(e.id);return r?c(r):null})}async function P(e){return u(t=>t.prepare("SELECT * FROM chat_run_steps WHERE chat_run_id = ? ORDER BY step_index ASC, started_at ASC").all(e).map(c))}async function B(e,t,a,s){let r=e.trim()||d;await u(e=>{e.prepare("UPDATE messages SET thread_status = ?, outcome_note = ? WHERE thread_id = ? AND id = ?").run(a,s,r,t)})}async function G(e){return u(t=>{let a=t.prepare("SELECT thread_id FROM messages WHERE id = ?").get(e.trim());return a?{threadId:a.thread_id}:null})}async function b(e){let t=e.trim()||d;await u(e=>{e.transaction(t=>{e.prepare("DELETE FROM message_reactions WHERE thread_id = ?").run(t),e.prepare("DELETE FROM messages WHERE thread_id = ?").run(t)})(t)})}async function j(e,t){let a=e.trim()||d,s=t.trim();s&&await u(e=>{e.transaction((t,a)=>{e.prepare("DELETE FROM message_reactions WHERE thread_id = ? AND message_id = ?").run(t,a),e.prepare("DELETE FROM messages WHERE thread_id = ? AND id = ?").run(t,a)})(a,s)})}async function v(e,t){let a=e.trim()||d,s=t.trim();s&&await u(e=>{e.transaction((t,a)=>{e.prepare(`DELETE FROM message_reactions
256
264
  WHERE thread_id = ?
257
265
  AND message_id IN (
258
266
  SELECT id
259
267
  FROM messages
260
268
  WHERE thread_id = ?
261
269
  AND (id = ? OR root_message_id = ?)
262
- )`).run(t,t,s,s),e.prepare(`DELETE FROM messages
270
+ )`).run(t,t,a,a),e.prepare(`DELETE FROM messages
263
271
  WHERE thread_id = ?
264
- AND (id = ? OR root_message_id = ?)`).run(t,s,s)})(s,a)})}async function Y(e){let t=e.query.trim();if(!t)return{results:[],total:0};let s="string"==typeof e.threadId&&e.threadId.trim()||null,a=Number.isFinite(e.limit)?Number(e.limit):20,r=Number.isFinite(e.offset)?Number(e.offset):0,i=Math.min(Math.max(Math.trunc(a),1),100),n=Math.max(Math.trunc(r),0),d=function(e){let t=e.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[],s=new Set,a=[];for(let e of t)s.has(e)||(s.add(e),a.push(e));return a}(t),o=d.length>0?d.map(e=>`${e}*`).join(" "):null;return c(e=>{let a=new Map;if(o){let t=["messages_fts MATCH ?"],r=[o];for(let i of(s&&(t.push("m.thread_id = ?"),r.push(s)),e.prepare(`SELECT m.thread_id, m.id, m.role, m.participant_id, m.timestamp, m.root_message_id,
272
+ AND (id = ? OR root_message_id = ?)`).run(t,a,a)})(a,s)})}async function Y(e){let t=e.query.trim();if(!t)return{results:[],total:0};let a="string"==typeof e.threadId&&e.threadId.trim()||null,s=Number.isFinite(e.limit)?Number(e.limit):20,r=Number.isFinite(e.offset)?Number(e.offset):0,i=Math.min(Math.max(Math.trunc(s),1),100),n=Math.max(Math.trunc(r),0),d=function(e){let t=e.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[],a=new Set,s=[];for(let e of t)a.has(e)||(a.add(e),s.push(e));return s}(t),o=d.length>0?d.map(e=>`${e}*`).join(" "):null;return u(e=>{let s=new Map;if(o){let t=["messages_fts MATCH ?"],r=[o];for(let i of(a&&(t.push("m.thread_id = ?"),r.push(a)),e.prepare(`SELECT m.thread_id, m.id, m.role, m.participant_id, m.timestamp, m.root_message_id,
265
273
  snippet(messages_fts, 0, '<mark>', '</mark>', '...', 32) AS snippet,
266
274
  bm25(messages_fts) as rank
267
275
  FROM messages_fts
268
276
  JOIN messages m ON messages_fts.rowid = m.rowid
269
277
  WHERE ${t.join(" AND ")}
270
- ORDER BY rank ASC, m.timestamp DESC`).all(...r))){let e=`${i.thread_id}:${i.id}`;a.set(e,{threadId:i.thread_id,messageId:i.id,role:i.role,participantId:i.participant_id,snippet:i.snippet,timestamp:i.timestamp,rootMessageId:i.root_message_id,sortRank:i.rank,matchedByFts:!0})}}let r=[],p=[];if(s&&(r.push("m.thread_id = ?"),p.push(s)),d.length>0)for(let e of d)r.push("LOWER(m.content) LIKE ? ESCAPE '\\'"),p.push(`%${R(e)}%`);else r.push("LOWER(m.content) LIKE ? ESCAPE '\\'"),p.push(`%${R(t.toLowerCase())}%`);for(let t of e.prepare(`SELECT m.thread_id, m.id, m.role, m.participant_id, m.content, m.timestamp, m.root_message_id
278
+ ORDER BY rank ASC, m.timestamp DESC`).all(...r))){let e=`${i.thread_id}:${i.id}`;s.set(e,{threadId:i.thread_id,messageId:i.id,role:i.role,participantId:i.participant_id,snippet:i.snippet,timestamp:i.timestamp,rootMessageId:i.root_message_id,sortRank:i.rank,matchedByFts:!0})}}let r=[],p=[];if(a&&(r.push("m.thread_id = ?"),p.push(a)),d.length>0)for(let e of d)r.push("LOWER(m.content) LIKE ? ESCAPE '\\'"),p.push(`%${R(e)}%`);else r.push("LOWER(m.content) LIKE ? ESCAPE '\\'"),p.push(`%${R(t.toLowerCase())}%`);for(let t of e.prepare(`SELECT m.thread_id, m.id, m.role, m.participant_id, m.content, m.timestamp, m.root_message_id
271
279
  FROM messages m
272
280
  WHERE ${r.join(" AND ")}
273
- ORDER BY m.timestamp DESC`).all(...p)){let e=`${t.thread_id}:${t.id}`;a.has(e)||a.set(e,{threadId:t.thread_id,messageId:t.id,role:t.role,participantId:t.participant_id,snippet:function(e,t){let s=A(e).replace(/\s+/g," ").trim();if(!s)return"";let a=t.filter(Boolean),r=s.toLowerCase(),i=a.reduce((e,t)=>{let s=r.indexOf(t);return -1===s?e:-1===e||s<e?s:e},-1),n=i>=0?Math.max(0,i-48):0,d=i>=0?Math.min(s.length,i+112):Math.min(s.length,160),o=n>0?"...":"",p=d<s.length?"...":"",_=`${o}${s.slice(n,d)}${p}`;if(0===a.length)return _;let E=RegExp(`(${a.map(I).join("|")})`,"giu");return _.replace(E,"<mark>$1</mark>")}(t.content,d),timestamp:t.timestamp,rootMessageId:t.root_message_id,sortRank:1/0,matchedByFts:!1})}return{results:Array.from(a.values()).sort((e,t)=>e.matchedByFts!==t.matchedByFts?e.matchedByFts?-1:1:e.sortRank!==t.sortRank?e.sortRank-t.sortRank:t.timestamp-e.timestamp).slice(n,n+i).map(e=>({threadId:e.threadId,messageId:e.messageId,role:e.role,participantId:e.participantId,snippet:e.snippet,timestamp:e.timestamp,rootMessageId:e.rootMessageId})),total:a.size}})}async function v(e){let t=e.threadId?.trim()||d,s=e.messageId?.trim(),a=e.participantId?.trim(),r=e.type;if(!s)throw new _("messageId is required",400);if(!a)throw new _("participantId is required",400);if(!o.has(r))throw new _(`Invalid reaction type: ${String(r)}`,400);let i=N(e.reason),n=N(e.blockerCode),E=L(e.hostPid),m=N(e.responseMessageId),l="clarify"===r||"blocked"===r;if(l&&!i)throw new _(`"${r}" reactions require a reason`,400);let T=l?i:null,u="blocked"===r?n:null;return c(e=>{var i;if(!e.prepare("SELECT 1 FROM messages WHERE thread_id = ? AND id = ? LIMIT 1").get(t,s))throw new _(`Message not found: ${s}`,404);let n=e.prepare(`SELECT type, reason, blocker_code, host_pid
281
+ ORDER BY m.timestamp DESC`).all(...p)){let e=`${t.thread_id}:${t.id}`;s.has(e)||s.set(e,{threadId:t.thread_id,messageId:t.id,role:t.role,participantId:t.participant_id,snippet:function(e,t){let a=A(e).replace(/\s+/g," ").trim();if(!a)return"";let s=t.filter(Boolean),r=a.toLowerCase(),i=s.reduce((e,t)=>{let a=r.indexOf(t);return -1===a?e:-1===e||a<e?a:e},-1),n=i>=0?Math.max(0,i-48):0,d=i>=0?Math.min(a.length,i+112):Math.min(a.length,160),o=n>0?"...":"",p=d<a.length?"...":"",_=`${o}${a.slice(n,d)}${p}`;if(0===s.length)return _;let E=RegExp(`(${s.map(I).join("|")})`,"giu");return _.replace(E,"<mark>$1</mark>")}(t.content,d),timestamp:t.timestamp,rootMessageId:t.root_message_id,sortRank:1/0,matchedByFts:!1})}return{results:Array.from(s.values()).sort((e,t)=>e.matchedByFts!==t.matchedByFts?e.matchedByFts?-1:1:e.sortRank!==t.sortRank?e.sortRank-t.sortRank:t.timestamp-e.timestamp).slice(n,n+i).map(e=>({threadId:e.threadId,messageId:e.messageId,role:e.role,participantId:e.participantId,snippet:e.snippet,timestamp:e.timestamp,rootMessageId:e.rootMessageId})),total:s.size}})}async function $(e){let t=e.threadId?.trim()||d,a=e.messageId?.trim(),s=e.participantId?.trim(),r=e.type;if(!a)throw new _("messageId is required",400);if(!s)throw new _("participantId is required",400);if(!o.has(r))throw new _(`Invalid reaction type: ${String(r)}`,400);let i=N(e.reason),n=N(e.blockerCode),E=h(e.hostPid),l=N(e.responseMessageId),m="clarify"===r||"blocked"===r;if(m&&!i)throw new _(`"${r}" reactions require a reason`,400);let c=m?i:null,T="blocked"===r?n:null;return u(e=>{var i;if(!e.prepare("SELECT 1 FROM messages WHERE thread_id = ? AND id = ? LIMIT 1").get(t,a))throw new _(`Message not found: ${a}`,404);let n=e.prepare(`SELECT type, reason, blocker_code, host_pid
274
282
  FROM message_reactions
275
- WHERE thread_id = ? AND message_id = ? AND participant_id = ?`).get(t,s,a);if(i=n?.type??null,!(!i||p[i].has(r)))throw new _(`Cannot transition reaction from "${n.type}" to "${r}"`,409);if(n&&n.type===r&&N(n.reason)===T&&N(n.blocker_code)===u&&L(n.host_pid)===E)return{updated:!1,reactions:g(e,t,[s]).get(s)??[]};let d=Date.now();return e.prepare(`INSERT INTO message_reactions (thread_id, message_id, participant_id, type, reason, blocker_code, host_pid, response_message_id, updated_at)
283
+ WHERE thread_id = ? AND message_id = ? AND participant_id = ?`).get(t,a,s);if(i=n?.type??null,!(!i||p[i].has(r)))throw new _(`Cannot transition reaction from "${n.type}" to "${r}"`,409);if(n&&n.type===r&&N(n.reason)===c&&N(n.blocker_code)===T&&h(n.host_pid)===E)return{updated:!1,reactions:g(e,t,[a]).get(a)??[]};let d=Date.now();return e.prepare(`INSERT INTO message_reactions (thread_id, message_id, participant_id, type, reason, blocker_code, host_pid, response_message_id, updated_at)
276
284
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
277
285
  ON CONFLICT(thread_id, message_id, participant_id)
278
286
  DO UPDATE SET
@@ -281,31 +289,31 @@ module.exports=[42639,e=>{"use strict";var t=e.i(85148),s=e.i(22734),a=e.i(14747
281
289
  blocker_code = excluded.blocker_code,
282
290
  host_pid = excluded.host_pid,
283
291
  response_message_id = COALESCE(excluded.response_message_id, message_reactions.response_message_id),
284
- updated_at = excluded.updated_at`).run(t,s,a,r,T,u,E,m,d),{updated:!0,reactions:g(e,t,[s]).get(s)??[]}})}async function $(e){let t=e.trim()||d;return c(e=>e.prepare(`SELECT root_message_id, COUNT(*) as reply_count, MAX(timestamp) as last_activity
292
+ updated_at = excluded.updated_at`).run(t,a,s,r,c,T,E,l,d),{updated:!0,reactions:g(e,t,[a]).get(a)??[]}})}async function J(e){let t=e.trim()||d;return u(e=>e.prepare(`SELECT root_message_id, COUNT(*) as reply_count, MAX(timestamp) as last_activity
285
293
  FROM messages
286
294
  WHERE thread_id = ? AND root_message_id IS NOT NULL
287
295
  GROUP BY root_message_id
288
- ORDER BY last_activity DESC`).all(t).map(s=>{let a=e.prepare(`SELECT DISTINCT participant_id FROM messages
289
- WHERE thread_id = ? AND root_message_id = ? AND participant_id IS NOT NULL`).all(t,s.root_message_id);return{rootMessageId:s.root_message_id,replyCount:s.reply_count,participants:a.map(e=>e.participant_id),lastActivityAt:s.last_activity}}))}async function J(e,t){if(0!==t.length&&e)return c(s=>{let a=s.prepare("INSERT INTO logs (agent_process_id, stream, line, timestamp) VALUES (?, ?, ?, ?)");s.transaction(()=>{for(let s of t)a.run(e,s.stream,s.line,s.timestamp)})()})}async function K(e){let t=e.trim();return t?c(e=>e.prepare(`SELECT l.id, l.agent_process_id, ap.agent_id as participant_id, l.stream, l.line, l.timestamp
296
+ ORDER BY last_activity DESC`).all(t).map(a=>{let s=e.prepare(`SELECT DISTINCT participant_id FROM messages
297
+ WHERE thread_id = ? AND root_message_id = ? AND participant_id IS NOT NULL`).all(t,a.root_message_id);return{rootMessageId:a.root_message_id,replyCount:a.reply_count,participants:s.map(e=>e.participant_id),lastActivityAt:a.last_activity}}))}async function K(e,t){if(0!==t.length&&e)return u(a=>{let s=a.prepare("INSERT INTO logs (agent_process_id, stream, line, timestamp) VALUES (?, ?, ?, ?)");a.transaction(()=>{for(let a of t)s.run(e,a.stream,a.line,a.timestamp)})()})}async function V(e){let t=e.trim();return t?u(e=>e.prepare(`SELECT l.id, l.agent_process_id, ap.agent_id as participant_id, l.stream, l.line, l.timestamp
290
298
  FROM logs l
291
299
  JOIN agent_processes ap ON ap.id = l.agent_process_id
292
300
  WHERE ap.workspace_id = ?
293
301
  ORDER BY l.timestamp DESC, l.id DESC
294
- LIMIT 100`).all(t).reverse()):[]}async function V(e){return 0===e.length?[]:c(t=>{let s=e.map(()=>"?").join(", ");return t.prepare(`SELECT ap.pid as process_pid, ap.agent_id as agent, l.stream, l.line, l.timestamp
302
+ LIMIT 100`).all(t).reverse()):[]}async function q(e){return 0===e.length?[]:u(t=>{let a=e.map(()=>"?").join(", ");return t.prepare(`SELECT ap.pid as process_pid, ap.agent_id as agent, l.stream, l.line, l.timestamp
295
303
  FROM logs l
296
304
  JOIN agent_processes ap ON ap.id = l.agent_process_id
297
- WHERE ap.pid IN (${s})
305
+ WHERE ap.pid IN (${a})
298
306
  ORDER BY l.timestamp ASC, l.id ASC
299
- LIMIT 200`).all(...e).map(e=>({processId:e.process_pid,agent:e.agent,stream:e.stream,line:e.line,timestamp:e.timestamp}))})}async function q(e){let t=e.trim();if(t)return c(e=>{e.prepare(`DELETE FROM logs WHERE agent_process_id IN (
307
+ LIMIT 200`).all(...e).map(e=>({processId:e.process_pid,agent:e.agent,stream:e.stream,line:e.line,timestamp:e.timestamp}))})}async function z(e){let t=e.trim();if(t)return u(e=>{e.prepare(`DELETE FROM logs WHERE agent_process_id IN (
300
308
  SELECT id FROM agent_processes WHERE workspace_id = ?
301
- )`).run(t)})}async function z(e,t=3e5){let s=e.trim()||d,a=Number.isFinite(t)?Math.max(t,1):3e5,r=Date.now(),i=r-a;return c(e=>({updated:e.prepare(`UPDATE message_reactions
309
+ )`).run(t)})}async function Q(e,t=3e5){let a=e.trim()||d,s=Number.isFinite(t)?Math.max(t,1):3e5,r=Date.now(),i=r-s;return u(e=>({updated:e.prepare(`UPDATE message_reactions
302
310
  SET type = 'blocked',
303
311
  reason = 'stale_timeout',
304
312
  blocker_code = 'stale_timeout',
305
313
  updated_at = ?
306
- WHERE thread_id = ? AND type = 'working' AND updated_at <= ?`).run(r,s,i).changes}))}async function Q(e,t,s){let a=e.trim()||d;return c(e=>{e.prepare(`INSERT INTO task_drafts (thread_id, message_id, data, updated_at)
314
+ WHERE thread_id = ? AND type = 'working' AND updated_at <= ?`).run(r,a,i).changes}))}async function Z(e,t,a){let s=e.trim()||d;return u(e=>{e.prepare(`INSERT INTO task_drafts (thread_id, message_id, data, updated_at)
307
315
  VALUES (?, ?, ?, ?)
308
316
  ON CONFLICT(thread_id, message_id)
309
- DO UPDATE SET data = excluded.data, updated_at = excluded.updated_at`).run(a,t,JSON.stringify(s),Date.now())})}async function Z(e){let t=e.trim()||d;return c(e=>{let s=e.prepare("SELECT message_id, data FROM task_drafts WHERE thread_id = ?").all(t),a={};for(let e of s)a[e.message_id]=JSON.parse(e.data);return a})}async function ee(e,t){let s=e.trim()||d;return c(e=>{e.prepare("DELETE FROM task_drafts WHERE thread_id = ? AND message_id = ?").run(s,t)})}e.s(["ReactionStoreError",()=>_,"appendChatRunStep",()=>x,"clearHistory",()=>G,"clearLogs",()=>q,"clearRootThread",()=>b,"createChatRun",()=>F,"deleteMessage",()=>j,"deleteTaskDraft",()=>ee,"getChatRun",()=>X,"getMessageThread",()=>B,"getProjectThreadIds",()=>M,"getThreadInfos",()=>$,"getThreadStatusSnapshot",()=>C,"getWorkspaceNames",()=>y,"listChatRunSteps",()=>W,"listChatRuns",()=>w,"listRootMessages",()=>f,"loadHistory",()=>D,"loadLogs",()=>K,"loadLogsByProcessPids",()=>V,"loadTaskDrafts",()=>Z,"saveLogs",()=>J,"saveMessages",()=>U,"saveTaskDraft",()=>Q,"searchMessages",()=>Y,"setReaction",()=>v,"sweepStaleWorkingReactions",()=>z,"updateChatRun",()=>k,"updateChatRunStep",()=>H,"updateMessageStatus",()=>P])}];
317
+ DO UPDATE SET data = excluded.data, updated_at = excluded.updated_at`).run(s,t,JSON.stringify(a),Date.now())})}async function ee(e){let t=e.trim()||d;return u(e=>{let a=e.prepare("SELECT message_id, data FROM task_drafts WHERE thread_id = ?").all(t),s={};for(let e of a)s[e.message_id]=JSON.parse(e.data);return s})}async function et(e,t){let a=e.trim()||d;return u(e=>{e.prepare("DELETE FROM task_drafts WHERE thread_id = ? AND message_id = ?").run(a,t)})}e.s(["ReactionStoreError",()=>_,"appendChatRunStep",()=>W,"clearHistory",()=>b,"clearLogs",()=>z,"clearRootThread",()=>v,"createChatRun",()=>F,"deleteMessage",()=>j,"deleteTaskDraft",()=>et,"getChatRun",()=>X,"getMessageThread",()=>G,"getProjectThreadIds",()=>D,"getThreadInfos",()=>J,"getThreadStatusSnapshot",()=>M,"getWorkspaceNames",()=>y,"listChatRunSteps",()=>P,"listChatRuns",()=>k,"listRootMessages",()=>f,"loadHistory",()=>C,"loadLogs",()=>V,"loadLogsByProcessPids",()=>q,"loadTaskDrafts",()=>ee,"saveLogs",()=>K,"saveMessages",()=>U,"saveTaskDraft",()=>Z,"searchMessages",()=>Y,"setReaction",()=>$,"sweepStaleChatRuns",()=>w,"sweepStaleWorkingReactions",()=>Q,"updateChatRun",()=>x,"updateChatRunStep",()=>H,"updateMessageStatus",()=>B])}];
310
318
 
311
319
  //# sourceMappingURL=lib_history-store_ts_2e721df2._.js.map