@circuitwall/jarela 2.2.1 → 2.4.0

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 (703) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +2 -1
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/routes-manifest.json +8 -0
  6. package/.next/standalone/.next/server/app/_global-error/page.js +68 -68
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_not-found/page.js +76 -76
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +100 -93
  22. package/.next/standalone/.next/server/app/api/v1/access/route.js +176 -169
  23. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +89 -56
  24. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +139 -127
  26. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +107 -100
  27. package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +765 -753
  28. package/.next/standalone/.next/server/app/api/v1/agents/route.js +72 -65
  29. package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +371 -364
  30. package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +809 -802
  31. package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +9 -2
  32. package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +49 -49
  33. package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +910 -910
  34. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +583 -16
  35. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +41 -30
  37. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +48 -37
  38. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +697 -130
  39. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +703 -136
  41. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +796 -229
  43. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +762 -746
  45. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +1050 -1034
  46. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +673 -106
  47. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +811 -804
  49. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/api/v1/bridges/route.js +718 -706
  51. package/.next/standalone/.next/server/app/api/v1/bridges/route.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +9 -9
  53. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/api/v1/config/route.js +85 -85
  55. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +709 -709
  56. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/v1/credentials/route.js +2 -2
  58. package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +10 -10
  60. package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +796 -784
  61. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +30 -23
  62. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +86 -86
  63. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +57 -57
  65. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
  66. package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +385 -378
  67. package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +51 -44
  68. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +65 -65
  69. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +122 -122
  71. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +37 -37
  73. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/api/v1/env/route.js +9 -9
  75. package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +375 -368
  76. package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +51 -44
  77. package/.next/standalone/.next/server/app/api/v1/events/route.js +745 -178
  78. package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/api/v1/events/test/route.js +77 -77
  80. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +763 -763
  81. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
  82. package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +51 -44
  83. package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +16 -9
  84. package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +72 -65
  85. package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +41 -34
  86. package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +211 -204
  87. package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +140 -133
  88. package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +113 -106
  89. package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +121 -114
  90. package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +141 -134
  91. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +690 -690
  92. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +93 -93
  94. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +9 -9
  96. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/api/v1/extensions/route.js +185 -185
  98. package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +171 -171
  100. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
  101. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +396 -396
  102. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +212 -212
  104. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
  105. package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +235 -235
  106. package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +26 -26
  107. package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +228 -221
  108. package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +65 -58
  109. package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +79 -72
  110. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +9 -9
  111. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
  112. package/.next/standalone/.next/server/app/api/v1/health/route.js +783 -771
  113. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +140 -133
  114. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +9 -9
  115. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
  116. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +370 -363
  117. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +240 -233
  118. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +689 -682
  119. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +886 -879
  120. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +115 -108
  121. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +955 -948
  122. package/.next/standalone/.next/server/app/api/v1/integrations/route.js +223 -216
  123. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +876 -847
  124. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js.nft.json +1 -1
  125. package/.next/standalone/.next/server/app/api/v1/local-file/route.js +26 -26
  126. package/.next/standalone/.next/server/app/api/v1/logs/route.js +70 -70
  127. package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +79 -72
  128. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +991 -979
  129. package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +196 -196
  130. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +19 -7
  131. package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +539 -532
  132. package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +86 -79
  133. package/.next/standalone/.next/server/app/api/v1/memory/route.js +58 -51
  134. package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +138 -131
  135. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +381 -369
  136. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js.nft.json +1 -1
  137. package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +150 -143
  138. package/.next/standalone/.next/server/app/api/v1/models/route.js +634 -627
  139. package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +445 -445
  140. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +120 -120
  141. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +234 -234
  143. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +407 -407
  145. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +37 -37
  147. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +107 -107
  149. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +228 -228
  151. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +9 -9
  153. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
  154. package/.next/standalone/.next/server/app/api/v1/packages/route.js +148 -148
  155. package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
  156. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +787 -787
  157. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +529 -514
  159. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
  160. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +181 -181
  161. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
  162. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +258 -258
  163. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
  164. package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +37 -30
  165. package/.next/standalone/.next/server/app/api/v1/profile/route.js +171 -164
  166. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +51 -44
  167. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +15 -8
  168. package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +171 -164
  169. package/.next/standalone/.next/server/app/api/v1/providers/route.js +101 -94
  170. package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +457 -450
  171. package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +44 -37
  172. package/.next/standalone/.next/server/app/api/v1/redaction/route.js +65 -58
  173. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +617 -605
  174. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +44 -44
  175. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
  176. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +739 -732
  177. package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +329 -322
  178. package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +204 -197
  179. package/.next/standalone/.next/server/app/api/v1/security/state/route.js +58 -51
  180. package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +183 -176
  181. package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +194 -187
  182. package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +26 -26
  183. package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +776 -769
  184. package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +122 -115
  185. package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +334 -327
  186. package/.next/standalone/.next/server/app/api/v1/skills/route.js +873 -866
  187. package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +838 -808
  188. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +177 -177
  189. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
  190. package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +164 -164
  191. package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +122 -115
  192. package/.next/standalone/.next/server/app/api/v1/tasks/route.js +30 -23
  193. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +1436 -0
  194. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js.nft.json +1 -0
  195. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route_client-reference-manifest.js +1 -0
  196. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +638 -631
  197. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js.nft.json +1 -1
  198. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +60 -439
  199. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js.nft.json +1 -1
  200. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +172 -173
  201. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
  202. package/.next/standalone/.next/server/app/api/v1/threads/route.js +925 -913
  203. package/.next/standalone/.next/server/app/api/v1/tools/route.js +2 -2
  204. package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
  205. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +17 -17
  206. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
  207. package/.next/standalone/.next/server/app/api/v1/update/route.js +570 -570
  208. package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +241 -229
  209. package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +989 -977
  210. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +40 -28
  211. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +72 -72
  212. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
  213. package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +128 -128
  214. package/.next/standalone/.next/server/app/api/v1/watchers/route.js +164 -164
  215. package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
  216. package/.next/standalone/.next/server/app/icon.svg/route.js +62 -62
  217. package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +436 -436
  218. package/.next/standalone/.next/server/app/page.js +1179 -743
  219. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app/setup/page.js +99 -91
  221. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  222. package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
  223. package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +441 -1022
  224. package/.next/standalone/.next/server/chunks/1433.js +1 -1
  225. package/.next/standalone/.next/server/chunks/1638.js +1 -2
  226. package/.next/standalone/.next/server/chunks/1738.js +1 -1
  227. package/.next/standalone/.next/server/chunks/2068.js +47 -10
  228. package/.next/standalone/.next/server/chunks/210.js +3 -3
  229. package/.next/standalone/.next/server/chunks/2151.js +31 -1
  230. package/.next/standalone/.next/server/chunks/2207.js +1 -0
  231. package/.next/standalone/.next/server/chunks/2447.js +10 -5
  232. package/.next/standalone/.next/server/chunks/2471.js +45 -45
  233. package/.next/standalone/.next/server/chunks/2504.js +1 -1
  234. package/.next/standalone/.next/server/chunks/2695.js +17 -17
  235. package/.next/standalone/.next/server/chunks/3042.js +24 -16
  236. package/.next/standalone/.next/server/chunks/{4540.js → 309.js} +104 -38
  237. package/.next/standalone/.next/server/chunks/{2350.js → 3272.js} +104 -37
  238. package/.next/standalone/.next/server/chunks/3399.js +526 -526
  239. package/.next/standalone/.next/server/chunks/3524.js +150 -67
  240. package/.next/standalone/.next/server/chunks/3566.js +1 -1
  241. package/.next/standalone/.next/server/chunks/4189.js +946 -0
  242. package/.next/standalone/.next/server/chunks/4433.js +146 -146
  243. package/.next/standalone/.next/server/chunks/4508.js +3 -3
  244. package/.next/standalone/.next/server/chunks/4588.js +1 -0
  245. package/.next/standalone/.next/server/chunks/46.js +78 -28
  246. package/.next/standalone/.next/server/chunks/466.js +12 -0
  247. package/.next/standalone/.next/server/chunks/4868.js +206 -206
  248. package/.next/standalone/.next/server/chunks/4992.js +13 -0
  249. package/.next/standalone/.next/server/chunks/5120.js +963 -0
  250. package/.next/standalone/.next/server/chunks/5701.js +1 -1
  251. package/.next/standalone/.next/server/chunks/5900.js +1 -1
  252. package/.next/standalone/.next/server/chunks/5908.js +63 -42
  253. package/.next/standalone/.next/server/chunks/6142.js +10 -2
  254. package/.next/standalone/.next/server/chunks/6210.js +1 -0
  255. package/.next/standalone/.next/server/chunks/6213.js +1 -1
  256. package/.next/standalone/.next/server/chunks/6649.js +3 -3
  257. package/.next/standalone/.next/server/chunks/6703.js +3 -3
  258. package/.next/standalone/.next/server/chunks/7445.js +1 -0
  259. package/.next/standalone/.next/server/chunks/8067.js +12 -0
  260. package/.next/standalone/.next/server/chunks/8461.js +24 -17
  261. package/.next/standalone/.next/server/chunks/8558.js +1 -1
  262. package/.next/standalone/.next/server/chunks/8724.js +1 -1
  263. package/.next/standalone/.next/server/chunks/8849.js +91 -91
  264. package/.next/standalone/.next/server/chunks/9032.js +4 -3
  265. package/.next/standalone/.next/server/chunks/{2563.js → 9164.js} +33389 -31418
  266. package/.next/standalone/.next/server/chunks/9237.js +396 -396
  267. package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1672 -575
  268. package/.next/standalone/.next/server/chunks/9406.js +1 -1
  269. package/.next/standalone/.next/server/chunks/9590.js +68 -18
  270. package/.next/standalone/.next/server/chunks/9824.js +98 -98
  271. package/.next/standalone/.next/server/chunks/9826.js +1 -0
  272. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  273. package/.next/standalone/.next/server/middleware.js +486 -415
  274. package/.next/standalone/.next/server/pages/404.html +2 -2
  275. package/.next/standalone/.next/server/pages/500.html +1 -1
  276. package/.next/standalone/.next/server/preview-props.json +3 -3
  277. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  278. package/.next/standalone/.next/static/chunks/{1395-a340fb0a345382a4.js → 1395-e4a99912b8f83044.js} +13 -1
  279. package/.next/standalone/.next/static/chunks/app/_global-error/{page-36cb8b428b38b26a.js → page-6fc5f8e744c81802.js} +1 -1
  280. package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  281. package/.next/standalone/.next/static/chunks/app/api/v1/access/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  282. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  283. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6fc5f8e744c81802.js +17 -0
  284. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6fc5f8e744c81802.js +17 -0
  285. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6fc5f8e744c81802.js +17 -0
  286. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6fc5f8e744c81802.js +17 -0
  287. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6fc5f8e744c81802.js +17 -0
  288. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6fc5f8e744c81802.js +17 -0
  289. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6fc5f8e744c81802.js +17 -0
  290. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6fc5f8e744c81802.js +17 -0
  291. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6fc5f8e744c81802.js +17 -0
  292. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6fc5f8e744c81802.js +17 -0
  293. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6fc5f8e744c81802.js +17 -0
  294. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6fc5f8e744c81802.js +17 -0
  295. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6fc5f8e744c81802.js +17 -0
  296. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6fc5f8e744c81802.js +17 -0
  297. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6fc5f8e744c81802.js +17 -0
  298. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6fc5f8e744c81802.js +17 -0
  299. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6fc5f8e744c81802.js +17 -0
  300. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6fc5f8e744c81802.js +17 -0
  301. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6fc5f8e744c81802.js +17 -0
  302. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6fc5f8e744c81802.js +17 -0
  303. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6fc5f8e744c81802.js +17 -0
  304. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6fc5f8e744c81802.js +17 -0
  305. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6fc5f8e744c81802.js +17 -0
  306. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6fc5f8e744c81802.js +17 -0
  307. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6fc5f8e744c81802.js +17 -0
  308. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6fc5f8e744c81802.js +17 -0
  309. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6fc5f8e744c81802.js +17 -0
  310. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6fc5f8e744c81802.js +17 -0
  311. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6fc5f8e744c81802.js +17 -0
  312. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6fc5f8e744c81802.js +17 -0
  313. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6fc5f8e744c81802.js +17 -0
  314. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6fc5f8e744c81802.js +17 -0
  315. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6fc5f8e744c81802.js +17 -0
  316. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6fc5f8e744c81802.js +17 -0
  317. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6fc5f8e744c81802.js +17 -0
  318. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6fc5f8e744c81802.js +17 -0
  319. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6fc5f8e744c81802.js +17 -0
  320. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6fc5f8e744c81802.js +17 -0
  321. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6fc5f8e744c81802.js +17 -0
  322. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6fc5f8e744c81802.js +17 -0
  323. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6fc5f8e744c81802.js +17 -0
  324. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6fc5f8e744c81802.js +17 -0
  325. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6fc5f8e744c81802.js +17 -0
  326. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6fc5f8e744c81802.js +17 -0
  327. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6fc5f8e744c81802.js +17 -0
  328. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6fc5f8e744c81802.js +17 -0
  329. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6fc5f8e744c81802.js +17 -0
  330. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6fc5f8e744c81802.js +17 -0
  331. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6fc5f8e744c81802.js +17 -0
  332. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6fc5f8e744c81802.js +17 -0
  333. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6fc5f8e744c81802.js +17 -0
  334. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6fc5f8e744c81802.js +17 -0
  335. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6fc5f8e744c81802.js +17 -0
  336. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6fc5f8e744c81802.js +17 -0
  337. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6fc5f8e744c81802.js +17 -0
  338. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6fc5f8e744c81802.js +17 -0
  339. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6fc5f8e744c81802.js +17 -0
  340. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6fc5f8e744c81802.js +17 -0
  341. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6fc5f8e744c81802.js +17 -0
  342. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6fc5f8e744c81802.js +17 -0
  343. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6fc5f8e744c81802.js +17 -0
  344. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6fc5f8e744c81802.js +17 -0
  345. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6fc5f8e744c81802.js +17 -0
  346. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6fc5f8e744c81802.js +17 -0
  347. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6fc5f8e744c81802.js +17 -0
  348. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  349. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6fc5f8e744c81802.js +17 -0
  350. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6fc5f8e744c81802.js +17 -0
  351. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  352. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6fc5f8e744c81802.js +17 -0
  353. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6fc5f8e744c81802.js +17 -0
  354. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6fc5f8e744c81802.js +17 -0
  355. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6fc5f8e744c81802.js +17 -0
  356. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6fc5f8e744c81802.js +17 -0
  357. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6fc5f8e744c81802.js +17 -0
  358. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6fc5f8e744c81802.js +17 -0
  359. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6fc5f8e744c81802.js +17 -0
  360. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6fc5f8e744c81802.js +17 -0
  361. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6fc5f8e744c81802.js +17 -0
  362. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6fc5f8e744c81802.js +17 -0
  363. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6fc5f8e744c81802.js +17 -0
  364. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6fc5f8e744c81802.js +17 -0
  365. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6fc5f8e744c81802.js +17 -0
  366. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6fc5f8e744c81802.js +17 -0
  367. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6fc5f8e744c81802.js +17 -0
  368. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6fc5f8e744c81802.js +17 -0
  369. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6fc5f8e744c81802.js +17 -0
  370. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6fc5f8e744c81802.js +17 -0
  371. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6fc5f8e744c81802.js +17 -0
  372. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6fc5f8e744c81802.js +17 -0
  373. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6fc5f8e744c81802.js +17 -0
  374. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6fc5f8e744c81802.js +17 -0
  375. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6fc5f8e744c81802.js +17 -0
  376. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6fc5f8e744c81802.js +17 -0
  377. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6fc5f8e744c81802.js +17 -0
  378. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6fc5f8e744c81802.js +17 -0
  379. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6fc5f8e744c81802.js +17 -0
  380. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6fc5f8e744c81802.js +17 -0
  381. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6fc5f8e744c81802.js +17 -0
  382. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6fc5f8e744c81802.js +17 -0
  383. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6fc5f8e744c81802.js +17 -0
  384. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6fc5f8e744c81802.js +17 -0
  385. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6fc5f8e744c81802.js +17 -0
  386. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6fc5f8e744c81802.js +17 -0
  387. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6fc5f8e744c81802.js +17 -0
  388. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6fc5f8e744c81802.js +17 -0
  389. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6fc5f8e744c81802.js +17 -0
  390. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6fc5f8e744c81802.js +17 -0
  391. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6fc5f8e744c81802.js +17 -0
  392. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6fc5f8e744c81802.js +17 -0
  393. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6fc5f8e744c81802.js +17 -0
  394. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6fc5f8e744c81802.js +17 -0
  395. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6fc5f8e744c81802.js +17 -0
  396. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6fc5f8e744c81802.js +17 -0
  397. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6fc5f8e744c81802.js +17 -0
  398. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6fc5f8e744c81802.js +17 -0
  399. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6fc5f8e744c81802.js +17 -0
  400. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6fc5f8e744c81802.js +17 -0
  401. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6fc5f8e744c81802.js +17 -0
  402. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6fc5f8e744c81802.js +17 -0
  403. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6fc5f8e744c81802.js +17 -0
  404. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6fc5f8e744c81802.js +17 -0
  405. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6fc5f8e744c81802.js +17 -0
  406. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6fc5f8e744c81802.js +17 -0
  407. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6fc5f8e744c81802.js +17 -0
  408. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6fc5f8e744c81802.js +17 -0
  409. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6fc5f8e744c81802.js +17 -0
  410. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6fc5f8e744c81802.js +17 -0
  411. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6fc5f8e744c81802.js +17 -0
  412. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6fc5f8e744c81802.js +17 -0
  413. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6fc5f8e744c81802.js +17 -0
  414. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6fc5f8e744c81802.js +17 -0
  415. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6fc5f8e744c81802.js +17 -0
  416. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6fc5f8e744c81802.js +17 -0
  417. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6fc5f8e744c81802.js +17 -0
  418. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6fc5f8e744c81802.js +17 -0
  419. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6fc5f8e744c81802.js +17 -0
  420. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6fc5f8e744c81802.js +17 -0
  421. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6fc5f8e744c81802.js +17 -0
  422. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6fc5f8e744c81802.js +17 -0
  423. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6fc5f8e744c81802.js +17 -0
  424. package/.next/standalone/.next/static/chunks/app/{page-7017f07f8a7a083c.js → page-04748847c6ff866f.js} +1013 -585
  425. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6fc5f8e744c81802.js +17 -0
  426. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6fc5f8e744c81802.js +17 -0
  427. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6fc5f8e744c81802.js +17 -0
  428. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6fc5f8e744c81802.js +17 -0
  429. package/.next/standalone/.next/static/css/{d80058f0b9b41c09.css → 2669e8744cc8c212.css} +2 -2
  430. package/.next/standalone/docs/adoption/changesets.json +358 -0
  431. package/.next/standalone/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  432. package/.next/standalone/package.json +3 -3
  433. package/CHANGELOG.md +44 -0
  434. package/api/client.ts +9 -0
  435. package/api/types.ts +29 -0
  436. package/app/api/v1/lifecycle/adoption/route.ts +14 -2
  437. package/app/api/v1/models/[name]/compact-threads/route.ts +14 -11
  438. package/app/api/v1/threads/[thread_id]/activity/route.ts +19 -0
  439. package/app/api/v1/threads/[thread_id]/context-pin/route.test.ts +1 -0
  440. package/app/api/v1/threads/[thread_id]/context-pin/route.ts +2 -1
  441. package/app/api/v1/threads/[thread_id]/route.ts +5 -1
  442. package/app/api/v1/threads/[thread_id]/run/route.ts +0 -1
  443. package/components/chat/ChatView.tsx +52 -11
  444. package/components/chat/ContextBoundary.test.tsx +68 -1
  445. package/components/chat/ContextBoundary.tsx +92 -13
  446. package/components/chat/MessageBubble.tsx +12 -0
  447. package/components/chat/MessageList.test.tsx +31 -0
  448. package/components/chat/MessageList.tsx +49 -28
  449. package/components/chat/ToolList.test.tsx +92 -16
  450. package/components/chat/ToolList.tsx +59 -4
  451. package/components/chat/chat-helpers.test.tsx +24 -1
  452. package/components/chat/chat-helpers.ts +47 -4
  453. package/components/chat/useThreadActivity.test.tsx +113 -0
  454. package/components/chat/useThreadActivity.ts +94 -0
  455. package/components/chat/useThreadData.ts +16 -16
  456. package/components/chat/workflow-step-retry.ts +25 -0
  457. package/components/integrations/NetworkSection.tsx +2 -2
  458. package/components/ui/BootScreen.tsx +17 -0
  459. package/components/ui/WorkflowChecklist.tsx +71 -33
  460. package/hooks/useSSE.ts +28 -3
  461. package/lib/agents/citation-checker.test.ts +40 -2
  462. package/lib/agents/citation-checker.ts +56 -11
  463. package/lib/agents/compaction-pipeline.test.ts +202 -0
  464. package/lib/agents/compaction-pipeline.ts +483 -0
  465. package/lib/agents/context-boundary.ts +5 -6
  466. package/lib/agents/conversation-summary.ts +37 -21
  467. package/lib/agents/instruction-edits.test.ts +120 -0
  468. package/lib/agents/instruction-edits.ts +65 -42
  469. package/lib/agents/prepare/history-window.test.ts +18 -0
  470. package/lib/agents/prepare/history-window.ts +11 -2
  471. package/lib/agents/prepare/request.ts +4 -2
  472. package/lib/agents/prepare/system-prompt.test.ts +49 -0
  473. package/lib/agents/prepare/system-prompt.ts +16 -5
  474. package/lib/agents/prompt-registry.test.ts +5 -140
  475. package/lib/agents/prompt-registry.ts +45 -1
  476. package/lib/agents/prompt-variants.ts +146 -0
  477. package/lib/agents/proposals.test.ts +76 -0
  478. package/lib/agents/proposals.ts +13 -5
  479. package/lib/agents/run-registry.test.ts +22 -0
  480. package/lib/agents/run-registry.ts +29 -0
  481. package/lib/agents/run-thread.auto-boundary.test.ts +125 -5
  482. package/lib/agents/run-thread.retry.test.ts +67 -1
  483. package/lib/agents/run-thread.ts +110 -10
  484. package/lib/agents/sqlite-checkpoint-saver.test.ts +91 -0
  485. package/lib/agents/thread-activity.test.ts +31 -0
  486. package/lib/agents/thread-activity.ts +27 -0
  487. package/lib/agents/thread-compaction-state.test.ts +82 -0
  488. package/lib/agents/thread-compaction-state.ts +121 -0
  489. package/lib/agents/thread-compaction.test.ts +83 -4
  490. package/lib/agents/thread-compaction.ts +34 -11
  491. package/lib/agents/warm-summary-background.test.ts +219 -5
  492. package/lib/agents/warm-summary-background.ts +346 -143
  493. package/lib/agents/warm-topics.test.ts +191 -0
  494. package/lib/agents/warm-topics.ts +317 -0
  495. package/lib/agents/workflow-step-retry.test.ts +96 -0
  496. package/lib/agents/workflow-step-retry.ts +216 -0
  497. package/lib/api/browser-control.ts +0 -3
  498. package/lib/bridges/dispatcher.ts +1 -0
  499. package/lib/bridges/message-role.test.ts +81 -0
  500. package/lib/bridges/message-role.ts +23 -10
  501. package/lib/bridges/types.ts +6 -0
  502. package/lib/bridges/whatsapp-link.test.ts +32 -0
  503. package/lib/bridges/whatsapp-link.ts +21 -0
  504. package/lib/bridges/whatsapp.inbound.test.ts +239 -0
  505. package/lib/bridges/whatsapp.sender.test.ts +80 -1
  506. package/lib/bridges/whatsapp.ts +76 -38
  507. package/lib/db/migrations.ts +5 -0
  508. package/lib/env/config.ts +2 -0
  509. package/lib/env/schema.ts +12 -0
  510. package/lib/lifecycle/changeset-build.test.ts +93 -0
  511. package/lib/lifecycle/changeset-build.ts +210 -0
  512. package/lib/lifecycle/changesets.test.ts +101 -0
  513. package/lib/lifecycle/changesets.ts +166 -0
  514. package/lib/lifecycle/surface-collect.test.ts +88 -0
  515. package/lib/lifecycle/surface-collect.ts +64 -0
  516. package/lib/lifecycle/surface-snapshot.test.ts +104 -0
  517. package/lib/lifecycle/surface-snapshot.ts +210 -0
  518. package/lib/memory/record.ts +0 -2
  519. package/lib/pricing/snapshot.test.ts +70 -0
  520. package/lib/pricing/snapshot.ts +10 -2
  521. package/lib/providers/external.ts +0 -2
  522. package/lib/proxy/dispatcher.test.ts +119 -1
  523. package/lib/proxy/dispatcher.ts +22 -9
  524. package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  525. package/lib/stores/agent-configs.ts +10 -5
  526. package/lib/stores/bridges.test.ts +81 -0
  527. package/lib/stores/bridges.ts +9 -8
  528. package/lib/stores/proxy-config.test.ts +120 -0
  529. package/lib/stores/proxy-config.ts +22 -4
  530. package/lib/stores/threads.test.ts +9 -0
  531. package/lib/stores/threads.ts +33 -19
  532. package/lib/stores/version-adoption.test.ts +96 -0
  533. package/lib/stores/version-adoption.ts +239 -26
  534. package/lib/stores/workflow-progress.ts +3 -0
  535. package/lib/tools/communications/calendar.test.ts +43 -2
  536. package/lib/tools/communications/calendar.ts +2 -0
  537. package/lib/tools/communications/gmail.test.ts +51 -1
  538. package/lib/tools/communications/gmail.ts +44 -2
  539. package/lib/tools/communications/ms-todo.ts +0 -7
  540. package/lib/tools/communications/outlook-calendar.ts +2 -0
  541. package/lib/tools/communications/outlook.test.ts +33 -2
  542. package/lib/tools/communications/outlook.ts +2 -0
  543. package/lib/tools/filesystem/edit-match.test.ts +133 -0
  544. package/lib/tools/filesystem/edit-match.ts +7 -2
  545. package/lib/tools/general/memory.ts +1 -1
  546. package/lib/tools/general/workflow-progress.ts +2 -0
  547. package/lib/tools/runtime/catalog.ts +1 -25
  548. package/lib/tools/support/result-refs.test.ts +131 -0
  549. package/lib/tools/support/result-refs.ts +41 -9
  550. package/lib/triggers/registry.ts +0 -4
  551. package/lib/utils/source-link.test.ts +51 -0
  552. package/lib/utils/source-link.ts +45 -0
  553. package/package.json +3 -3
  554. package/scripts/install-to-system.ps1 +39 -11
  555. package/scripts/install-to-system.sh +37 -3
  556. package/.next/standalone/.next/server/chunks/3979.js +0 -581
  557. package/.next/standalone/.next/server/chunks/5936.js +0 -594
  558. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-36cb8b428b38b26a.js +0 -17
  559. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-36cb8b428b38b26a.js +0 -17
  560. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-36cb8b428b38b26a.js +0 -17
  561. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-36cb8b428b38b26a.js +0 -17
  562. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-36cb8b428b38b26a.js +0 -17
  563. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-36cb8b428b38b26a.js +0 -17
  564. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-36cb8b428b38b26a.js +0 -17
  565. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-36cb8b428b38b26a.js +0 -17
  566. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-36cb8b428b38b26a.js +0 -17
  567. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-36cb8b428b38b26a.js +0 -17
  568. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-36cb8b428b38b26a.js +0 -17
  569. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-36cb8b428b38b26a.js +0 -17
  570. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-36cb8b428b38b26a.js +0 -17
  571. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-36cb8b428b38b26a.js +0 -17
  572. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-36cb8b428b38b26a.js +0 -17
  573. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-36cb8b428b38b26a.js +0 -17
  574. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-36cb8b428b38b26a.js +0 -17
  575. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-36cb8b428b38b26a.js +0 -17
  576. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-36cb8b428b38b26a.js +0 -17
  577. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-36cb8b428b38b26a.js +0 -17
  578. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-36cb8b428b38b26a.js +0 -17
  579. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-36cb8b428b38b26a.js +0 -17
  580. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-36cb8b428b38b26a.js +0 -17
  581. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-36cb8b428b38b26a.js +0 -17
  582. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-36cb8b428b38b26a.js +0 -17
  583. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-36cb8b428b38b26a.js +0 -17
  584. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-36cb8b428b38b26a.js +0 -17
  585. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-36cb8b428b38b26a.js +0 -17
  586. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-36cb8b428b38b26a.js +0 -17
  587. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-36cb8b428b38b26a.js +0 -17
  588. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-36cb8b428b38b26a.js +0 -17
  589. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-36cb8b428b38b26a.js +0 -17
  590. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-36cb8b428b38b26a.js +0 -17
  591. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-36cb8b428b38b26a.js +0 -17
  592. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-36cb8b428b38b26a.js +0 -17
  593. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-36cb8b428b38b26a.js +0 -17
  594. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-36cb8b428b38b26a.js +0 -17
  595. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-36cb8b428b38b26a.js +0 -17
  596. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-36cb8b428b38b26a.js +0 -17
  597. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-36cb8b428b38b26a.js +0 -17
  598. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-36cb8b428b38b26a.js +0 -17
  599. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-36cb8b428b38b26a.js +0 -17
  600. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-36cb8b428b38b26a.js +0 -17
  601. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-36cb8b428b38b26a.js +0 -17
  602. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-36cb8b428b38b26a.js +0 -17
  603. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-36cb8b428b38b26a.js +0 -17
  604. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-36cb8b428b38b26a.js +0 -17
  605. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-36cb8b428b38b26a.js +0 -17
  606. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-36cb8b428b38b26a.js +0 -17
  607. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-36cb8b428b38b26a.js +0 -17
  608. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-36cb8b428b38b26a.js +0 -17
  609. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-36cb8b428b38b26a.js +0 -17
  610. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-36cb8b428b38b26a.js +0 -17
  611. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-36cb8b428b38b26a.js +0 -17
  612. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-36cb8b428b38b26a.js +0 -17
  613. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-36cb8b428b38b26a.js +0 -17
  614. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-36cb8b428b38b26a.js +0 -17
  615. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-36cb8b428b38b26a.js +0 -17
  616. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-36cb8b428b38b26a.js +0 -17
  617. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-36cb8b428b38b26a.js +0 -17
  618. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-36cb8b428b38b26a.js +0 -17
  619. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-36cb8b428b38b26a.js +0 -17
  620. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-36cb8b428b38b26a.js +0 -17
  621. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-36cb8b428b38b26a.js +0 -17
  622. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-36cb8b428b38b26a.js +0 -17
  623. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  624. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-36cb8b428b38b26a.js +0 -17
  625. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-36cb8b428b38b26a.js +0 -17
  626. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  627. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-36cb8b428b38b26a.js +0 -17
  628. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-36cb8b428b38b26a.js +0 -17
  629. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-36cb8b428b38b26a.js +0 -17
  630. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-36cb8b428b38b26a.js +0 -17
  631. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-36cb8b428b38b26a.js +0 -17
  632. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-36cb8b428b38b26a.js +0 -17
  633. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-36cb8b428b38b26a.js +0 -17
  634. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-36cb8b428b38b26a.js +0 -17
  635. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-36cb8b428b38b26a.js +0 -17
  636. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-36cb8b428b38b26a.js +0 -17
  637. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-36cb8b428b38b26a.js +0 -17
  638. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-36cb8b428b38b26a.js +0 -17
  639. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-36cb8b428b38b26a.js +0 -17
  640. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-36cb8b428b38b26a.js +0 -17
  641. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-36cb8b428b38b26a.js +0 -17
  642. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-36cb8b428b38b26a.js +0 -17
  643. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-36cb8b428b38b26a.js +0 -17
  644. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-36cb8b428b38b26a.js +0 -17
  645. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-36cb8b428b38b26a.js +0 -17
  646. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-36cb8b428b38b26a.js +0 -17
  647. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-36cb8b428b38b26a.js +0 -17
  648. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-36cb8b428b38b26a.js +0 -17
  649. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-36cb8b428b38b26a.js +0 -17
  650. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-36cb8b428b38b26a.js +0 -17
  651. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-36cb8b428b38b26a.js +0 -17
  652. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-36cb8b428b38b26a.js +0 -17
  653. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-36cb8b428b38b26a.js +0 -17
  654. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-36cb8b428b38b26a.js +0 -17
  655. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-36cb8b428b38b26a.js +0 -17
  656. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-36cb8b428b38b26a.js +0 -17
  657. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-36cb8b428b38b26a.js +0 -17
  658. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-36cb8b428b38b26a.js +0 -17
  659. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-36cb8b428b38b26a.js +0 -17
  660. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-36cb8b428b38b26a.js +0 -17
  661. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-36cb8b428b38b26a.js +0 -17
  662. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-36cb8b428b38b26a.js +0 -17
  663. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-36cb8b428b38b26a.js +0 -17
  664. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-36cb8b428b38b26a.js +0 -17
  665. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-36cb8b428b38b26a.js +0 -17
  666. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-36cb8b428b38b26a.js +0 -17
  667. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-36cb8b428b38b26a.js +0 -17
  668. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-36cb8b428b38b26a.js +0 -17
  669. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-36cb8b428b38b26a.js +0 -17
  670. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-36cb8b428b38b26a.js +0 -17
  671. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-36cb8b428b38b26a.js +0 -17
  672. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-36cb8b428b38b26a.js +0 -17
  673. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-36cb8b428b38b26a.js +0 -17
  674. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-36cb8b428b38b26a.js +0 -17
  675. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-36cb8b428b38b26a.js +0 -17
  676. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-36cb8b428b38b26a.js +0 -17
  677. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-36cb8b428b38b26a.js +0 -17
  678. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-36cb8b428b38b26a.js +0 -17
  679. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-36cb8b428b38b26a.js +0 -17
  680. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-36cb8b428b38b26a.js +0 -17
  681. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-36cb8b428b38b26a.js +0 -17
  682. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-36cb8b428b38b26a.js +0 -17
  683. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-36cb8b428b38b26a.js +0 -17
  684. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-36cb8b428b38b26a.js +0 -17
  685. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-36cb8b428b38b26a.js +0 -17
  686. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-36cb8b428b38b26a.js +0 -17
  687. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-36cb8b428b38b26a.js +0 -17
  688. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-36cb8b428b38b26a.js +0 -17
  689. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-36cb8b428b38b26a.js +0 -17
  690. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-36cb8b428b38b26a.js +0 -17
  691. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-36cb8b428b38b26a.js +0 -17
  692. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-36cb8b428b38b26a.js +0 -17
  693. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-36cb8b428b38b26a.js +0 -17
  694. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-36cb8b428b38b26a.js +0 -17
  695. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-36cb8b428b38b26a.js +0 -17
  696. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-36cb8b428b38b26a.js +0 -17
  697. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-36cb8b428b38b26a.js +0 -17
  698. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-36cb8b428b38b26a.js +0 -17
  699. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-36cb8b428b38b26a.js +0 -17
  700. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-36cb8b428b38b26a.js +0 -17
  701. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-36cb8b428b38b26a.js +0 -17
  702. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → hwujW4hR1b-r3k5WdMxZO}/_buildManifest.js +0 -0
  703. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → hwujW4hR1b-r3k5WdMxZO}/_ssgManifest.js +0 -0
@@ -0,0 +1,1436 @@
1
+ "use strict";
2
+ (() => {
3
+ var exports = {};
4
+ exports.id = 7548;
5
+ exports.ids = [3944,7548];
6
+ exports.modules = {
7
+
8
+ /***/ 261:
9
+ /***/ ((module) => {
10
+
11
+ module.exports = require("next/dist/shared/lib/router/utils/app-paths");
12
+
13
+ /***/ }),
14
+
15
+ /***/ 1195:
16
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
17
+
18
+ __webpack_require__.r(__webpack_exports__);
19
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20
+ /* harmony export */ GET: () => (/* binding */ GET)
21
+ /* harmony export */ });
22
+ /* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
23
+ /* harmony import */ var _lib_stores_threads__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83042);
24
+ /* harmony import */ var _lib_agents_thread_activity__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63541);
25
+ /**
26
+ * UI-internal — `GET /api/v1/threads/[thread_id]/activity`
27
+ *
28
+ * One snapshot of what the thread is doing (agent turn phase, queued turns,
29
+ * compaction), polled by the chat so it can show and resume activity that
30
+ * started elsewhere: the scheduler, a watcher, a bridge, or another device.
31
+ */
32
+
33
+
34
+ async function GET(_req, { params }) {
35
+ const { thread_id } = await params;
36
+ if (!(0,_lib_stores_threads__WEBPACK_IMPORTED_MODULE_1__/* .getThread */ .fG)(thread_id)) return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
37
+ error: "Thread not found"
38
+ }, {
39
+ status: 404
40
+ });
41
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json((0,_lib_agents_thread_activity__WEBPACK_IMPORTED_MODULE_2__/* .getThreadActivity */ .C)(thread_id), {
42
+ headers: {
43
+ "Cache-Control": "no-store"
44
+ }
45
+ });
46
+ }
47
+
48
+
49
+ /***/ }),
50
+
51
+ /***/ 1708:
52
+ /***/ ((module) => {
53
+
54
+ module.exports = require("node:process");
55
+
56
+ /***/ }),
57
+
58
+ /***/ 1932:
59
+ /***/ ((module) => {
60
+
61
+ module.exports = require("url");
62
+
63
+ /***/ }),
64
+
65
+ /***/ 3295:
66
+ /***/ ((module) => {
67
+
68
+ module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");
69
+
70
+ /***/ }),
71
+
72
+ /***/ 3944:
73
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
74
+
75
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
76
+ /* harmony export */ M6: () => (/* binding */ enqueueThreadRun),
77
+ /* harmony export */ Zm: () => (/* binding */ QueueFullError),
78
+ /* harmony export */ getQueueDepth: () => (/* binding */ getQueueDepth),
79
+ /* harmony export */ vR: () => (/* binding */ QueueExpiredError)
80
+ /* harmony export */ });
81
+ /* unused harmony export __resetForTests */
82
+ /* harmony import */ var _lib_utils_global_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15559);
83
+ // Per-thread priority queue for agent runs.
84
+ //
85
+ // A thread can have one active run. Waiting interactive runs are selected
86
+ // before waiting background runs, while FIFO order is preserved within each
87
+ // lane. Different threads drain independently.
88
+ //
89
+ // In-memory + single-process. Multi-instance deployment would need a shared
90
+ // lock (Redis, Postgres advisory locks) — explicitly out of scope.
91
+
92
+ const queues = (0,_lib_utils_global_state__WEBPACK_IMPORTED_MODULE_0__/* .getOrCreateGlobal */ .X)("__jarela_thread_run_queues", ()=>new Map());
93
+ const DEFAULT_MAX_DEPTH = 16;
94
+ const sourceLanes = {
95
+ user: "interactive",
96
+ bridge: "interactive",
97
+ delegate: "interactive",
98
+ scheduler: "background",
99
+ watcher: "background",
100
+ trigger: "background",
101
+ extension: "background"
102
+ };
103
+ class QueueFullError extends Error {
104
+ constructor(thread_id, depth){
105
+ super(`Per-thread run queue full for thread ${thread_id} (depth=${depth})`);
106
+ this.name = "QueueFullError";
107
+ }
108
+ }
109
+ class QueueExpiredError extends Error {
110
+ constructor(thread_id, expiresAt){
111
+ super(`Queued run expired for thread ${thread_id} at ${expiresAt}`);
112
+ this.name = "QueueExpiredError";
113
+ }
114
+ }
115
+ function depth(queue) {
116
+ return (queue.active ? 1 : 0) + queue.interactive.length + queue.background.length;
117
+ }
118
+ function drain(thread_id, queue) {
119
+ if (queue.active) return;
120
+ const job = queue.interactive.shift() ?? queue.background.shift();
121
+ if (!job) {
122
+ if (queues.get(thread_id) === queue) queues.delete(thread_id);
123
+ return;
124
+ }
125
+ queue.active = job;
126
+ Promise.resolve().then(()=>{
127
+ if (job.expiresAt !== undefined && Date.now() >= job.expiresAt) {
128
+ throw new QueueExpiredError(thread_id, job.expiresAt);
129
+ }
130
+ return job.runner();
131
+ }).then((value)=>{
132
+ finish(thread_id, queue);
133
+ job.resolve(value);
134
+ }, (error)=>{
135
+ finish(thread_id, queue);
136
+ job.reject(error);
137
+ });
138
+ }
139
+ function finish(thread_id, queue) {
140
+ queue.active = undefined;
141
+ if (queues.get(thread_id) === queue) drain(thread_id, queue);
142
+ }
143
+ function enqueueThreadRun(thread_id, source, runner, options = {}) {
144
+ const queue = queues.get(thread_id) ?? {
145
+ interactive: [],
146
+ background: []
147
+ };
148
+ const currentDepth = depth(queue);
149
+ const max = options.maxDepth ?? DEFAULT_MAX_DEPTH;
150
+ if (currentDepth >= max) {
151
+ throw new QueueFullError(thread_id, currentDepth);
152
+ }
153
+ const lane = options.lane ?? sourceLanes[source];
154
+ const position = queue.active ? 1 + queue.interactive.length + (lane === "background" ? queue.background.length : 0) : queue.interactive.length + (lane === "background" ? queue.background.length : 0);
155
+ let resolve;
156
+ let reject;
157
+ const result = new Promise((res, rej)=>{
158
+ resolve = res;
159
+ reject = rej;
160
+ });
161
+ const job = {
162
+ runner,
163
+ expiresAt: options.expiresAt,
164
+ resolve,
165
+ reject
166
+ };
167
+ queue[lane].push(job);
168
+ queues.set(thread_id, queue);
169
+ drain(thread_id, queue);
170
+ return {
171
+ result,
172
+ position
173
+ };
174
+ }
175
+ /** Current queue depth for a thread, including the active job. */ function getQueueDepth(thread_id) {
176
+ const queue = queues.get(thread_id);
177
+ return queue ? depth(queue) : 0;
178
+ }
179
+ /** Reset all queue state. Test-only — never call from production code. */ function __resetForTests() {
180
+ queues.clear();
181
+ }
182
+
183
+
184
+ /***/ }),
185
+
186
+ /***/ 8128:
187
+ /***/ ((module) => {
188
+
189
+ module.exports = require("next/dist/server/runtime-reacts.external.js");
190
+
191
+ /***/ }),
192
+
193
+ /***/ 9956:
194
+ /***/ ((module) => {
195
+
196
+ module.exports = require("undici");
197
+
198
+ /***/ }),
199
+
200
+ /***/ 10846:
201
+ /***/ ((module) => {
202
+
203
+ module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");
204
+
205
+ /***/ }),
206
+
207
+ /***/ 11075:
208
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
209
+
210
+ __webpack_require__.r(__webpack_exports__);
211
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
212
+ /* harmony export */ handler: () => (/* binding */ handler),
213
+ /* harmony export */ patchFetch: () => (/* binding */ patchFetch),
214
+ /* harmony export */ routeModule: () => (/* binding */ routeModule),
215
+ /* harmony export */ serverHooks: () => (/* binding */ serverHooks),
216
+ /* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
217
+ /* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
218
+ /* harmony export */ });
219
+ /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
220
+ /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__);
221
+ /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
222
+ /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
223
+ /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__);
224
+ /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
225
+ /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__);
226
+ /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
227
+ /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__);
228
+ /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
229
+ /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__);
230
+ /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
231
+ /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__);
232
+ /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
233
+ /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__);
234
+ /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
235
+ /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__);
236
+ /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
237
+ /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__);
238
+ /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
239
+ /* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
240
+ /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
241
+ /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__);
242
+ /* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
243
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
244
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
245
+ /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
246
+ /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__);
247
+ /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
248
+ /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__);
249
+ /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
250
+ /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__);
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+ // We inject the nextConfigOutput here so that we can use them in the route
270
+ // module.
271
+ const nextConfigOutput = "standalone"
272
+ const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
273
+ definition: {
274
+ kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
275
+ page: "/api/v1/threads/[thread_id]/activity/route",
276
+ pathname: "/api/v1/threads/[thread_id]/activity",
277
+ filename: "route",
278
+ bundlePath: "app/api/v1/threads/[thread_id]/activity/route"
279
+ },
280
+ distDir: ".next" || 0,
281
+ relativeProjectDir: false || '',
282
+ resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/threads/[thread_id]/activity/route.ts",
283
+ nextConfigOutput,
284
+ // The lazy require factory ensures that:
285
+ // - In dev: devRequestTimingInternalsEnd is set before userland executes,
286
+ // correctly attributing module load time to application-code rather than
287
+ // framework internals.
288
+ // - In all modes: async modules (route files with top-level await) are
289
+ // handled correctly — require() returns a Promise for such modules, which
290
+ // ensureUserland() awaits before the first request is handled.
291
+ userland: ()=>__webpack_require__(1195),
292
+ // In Turbopack dev mode, also provide a synchronous per-request getter so
293
+ // server HMR updates are picked up without re-executing the entry chunk.
294
+ // Using require() (synchronous) avoids adding async overhead that would be
295
+ // incorrectly attributed to application-code time in devRequestTiming.
296
+ ... false ? 0 : {}
297
+ });
298
+ // Pull out the exports that we need to expose from the module. This should
299
+ // be eliminated when we've moved the other routes to the new format. These
300
+ // are used to hook into the route.
301
+ const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
302
+ function patchFetch() {
303
+ return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
304
+ workAsyncStorage,
305
+ workUnitAsyncStorage
306
+ });
307
+ }
308
+
309
+ async function handler(req, res, ctx) {
310
+ if (ctx.requestMeta) {
311
+ (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
312
+ }
313
+ if (routeModule.isDev) {
314
+ (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
315
+ }
316
+ let srcPage = "/api/v1/threads/[thread_id]/activity/route";
317
+ // turbopack doesn't normalize `/index` in the page name
318
+ // so we need to to process dynamic routes properly
319
+ // TODO: fix turbopack providing differing value from webpack
320
+ if (false) {} else if (srcPage === '/index') {
321
+ // we always normalize /index specifically
322
+ srcPage = '/';
323
+ }
324
+ const multiZoneDraftMode = false;
325
+ const prepareResult = await routeModule.prepare(req, res, {
326
+ srcPage,
327
+ multiZoneDraftMode
328
+ });
329
+ if (!prepareResult) {
330
+ res.statusCode = 400;
331
+ res.end('Bad Request');
332
+ ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
333
+ return null;
334
+ }
335
+ const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
336
+ const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
337
+ // Only this route's prerenders can establish ISR or admit generated params.
338
+ const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]) && (routeModule.isDev || (0,next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__.isRouteCacheOwner)(resolvedPathname, routeModule.cacheOwner, prerenderManifest.routes[resolvedPathname]));
339
+ let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
340
+ const render404 = async ()=>{
341
+ // TODO: should route-module itself handle rendering the 404
342
+ if (routerServerContext == null ? void 0 : routerServerContext.render404) {
343
+ await routerServerContext.render404(req, res, parsedUrl, false);
344
+ } else {
345
+ res.end('This page could not be found');
346
+ }
347
+ return null;
348
+ };
349
+ if (isIsr && !isDraftMode) {
350
+ const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
351
+ if (prerenderInfo) {
352
+ if (prerenderInfo.fallback === false && !isPrerendered) {
353
+ if (nextConfig.adapterPath) {
354
+ return await render404();
355
+ }
356
+ throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
357
+ }
358
+ }
359
+ }
360
+ let cacheKey = null;
361
+ if (isIsr && !routeModule.isDev && !isDraftMode) {
362
+ cacheKey = resolvedPathname;
363
+ // ensure /index and / is normalized to one key
364
+ cacheKey = cacheKey === '/index' ? '/' : cacheKey;
365
+ }
366
+ // Before rendering (which initializes component tree modules), we have to
367
+ // set the reference manifests to our global store so Server Action's
368
+ // encryption util can access to them at the top level of the page module.
369
+ if (serverActionsManifest && clientReferenceManifest) {
370
+ (0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
371
+ page: srcPage,
372
+ clientReferenceManifest,
373
+ serverActionsManifest
374
+ });
375
+ }
376
+ const method = req.method || 'GET';
377
+ const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
378
+ const activeSpan = tracer.getActiveScopeSpan();
379
+ const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
380
+ const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
381
+ const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
382
+ incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
383
+ globalThis.__incrementalCache = incrementalCache;
384
+ const context = {
385
+ params,
386
+ previewProps,
387
+ renderOpts: {
388
+ experimental: {
389
+ authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
390
+ useCacheTimeout: nextConfig.experimental.useCacheTimeout,
391
+ durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
392
+ },
393
+ cacheComponents: Boolean(nextConfig.cacheComponents),
394
+ validationLevel: nextConfig.experimental.instantInsights.validationLevel,
395
+ isDraftMode,
396
+ incrementalCache,
397
+ hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
398
+ cacheLifeProfiles: nextConfig.cacheLife,
399
+ staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
400
+ waitUntil: ctx.waitUntil,
401
+ onClose: (cb)=>{
402
+ res.on('close', cb);
403
+ },
404
+ onAfterTaskError: undefined
405
+ },
406
+ sharedContext: {
407
+ buildId,
408
+ deploymentId
409
+ }
410
+ };
411
+ const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
412
+ const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
413
+ const nextReq = next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.signalFromNodeResponse)(res));
414
+ const responseGenerator = async ({ previousCacheEntry })=>{
415
+ try {
416
+ if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
417
+ res.statusCode = 404;
418
+ // on-demand revalidate always sets this header
419
+ res.setHeader('x-nextjs-cache', 'REVALIDATED');
420
+ res.end('This page could not be found');
421
+ return null;
422
+ }
423
+ const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
424
+ req.fetchMetrics = context.renderOpts.fetchMetrics;
425
+ let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
426
+ // Attempt using provided waitUntil if available
427
+ // if it's not we fallback to sendResponse's handling
428
+ if (pendingWaitUntil) {
429
+ if (ctx.waitUntil) {
430
+ ctx.waitUntil(pendingWaitUntil);
431
+ pendingWaitUntil = undefined;
432
+ }
433
+ }
434
+ const cacheTags = context.renderOpts.collectedTags;
435
+ // If the request is for a static response, we can cache it so long
436
+ // as it's not edge.
437
+ if (isIsr) {
438
+ const blob = await response.blob();
439
+ // Copy the headers from the response.
440
+ const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
441
+ if (cacheTags) {
442
+ headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
443
+ }
444
+ if (!headers['content-type'] && blob.type) {
445
+ headers['content-type'] = blob.type;
446
+ }
447
+ const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
448
+ const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? // route has a numeric `revalidate` but didn't declare an
449
+ // explicit `expire` (e.g. via `cacheLife`). This mirrors the
450
+ // build-time fallback in `build/index.ts` so cache entries
451
+ // and the response Cache-Control header agree on the route's
452
+ // effective expire. Routes that opt out of revalidation
453
+ // (`revalidate: false`) or that are dynamic (`revalidate: 0`)
454
+ // keep `expire: undefined`.
455
+ revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
456
+ // Create the cache entry for the response.
457
+ const cacheEntry = {
458
+ value: {
459
+ kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
460
+ status: response.status,
461
+ body: Buffer.from(await blob.arrayBuffer()),
462
+ headers
463
+ },
464
+ cacheControl: {
465
+ revalidate,
466
+ expire
467
+ }
468
+ };
469
+ return cacheEntry;
470
+ } else {
471
+ // send response without caching if not ISR
472
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
473
+ return null;
474
+ }
475
+ } catch (err) {
476
+ // if this is a background revalidate we need to report
477
+ // the request error here as it won't be bubbled
478
+ if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
479
+ const silenceLog = false;
480
+ await routeModule.onRequestError(req, err, {
481
+ routerKind: 'App Router',
482
+ routePath: srcPage,
483
+ routeType: 'route',
484
+ revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
485
+ isStaticGeneration: cacheKey !== null,
486
+ isOnDemandRevalidate
487
+ })
488
+ }, silenceLog, routerServerContext);
489
+ }
490
+ throw err;
491
+ }
492
+ };
493
+ const handleResponse = async (currentSpan, parentSpan)=>{
494
+ try {
495
+ var _cacheEntry_value;
496
+ const cacheEntry = await routeModule.handleResponse({
497
+ req,
498
+ nextConfig,
499
+ cacheKey,
500
+ routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
501
+ isFallback: false,
502
+ previewProps,
503
+ prerenderManifest,
504
+ isRoutePPREnabled: false,
505
+ isOnDemandRevalidate,
506
+ revalidateOnlyGenerated,
507
+ responseGenerator,
508
+ waitUntil: ctx.waitUntil,
509
+ isMinimalMode
510
+ });
511
+ if (cacheEntry !== null && 'error' in cacheEntry) {
512
+ throw cacheEntry.error;
513
+ }
514
+ // we don't create a cacheEntry for ISR
515
+ if (!isIsr) {
516
+ return;
517
+ }
518
+ if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE) {
519
+ var _cacheEntry_value1;
520
+ throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
521
+ }
522
+ if (!isMinimalMode) {
523
+ res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
524
+ }
525
+ // Draft mode should never be cached
526
+ if (isDraftMode) {
527
+ res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
528
+ }
529
+ const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
530
+ if (!(isMinimalMode && isIsr)) {
531
+ headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
532
+ }
533
+ // If cache control is already set on the response we don't
534
+ // override it to allow users to customize it via next.config
535
+ if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
536
+ headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
537
+ }
538
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.
539
+ new Response(cacheEntry.value.body, {
540
+ headers,
541
+ status: cacheEntry.value.status || 200
542
+ }));
543
+ return;
544
+ } catch (err) {
545
+ if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
546
+ const silenceLog = false;
547
+ await routeModule.onRequestError(req, err, {
548
+ routerKind: 'App Router',
549
+ routePath: normalizedSrcPage,
550
+ routeType: 'route',
551
+ revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
552
+ isStaticGeneration: cacheKey !== null,
553
+ isOnDemandRevalidate
554
+ })
555
+ }, silenceLog, routerServerContext);
556
+ }
557
+ // rethrow so that we can handle serving error page
558
+ // If this is during static generation, throw the error again.
559
+ if (isIsr) throw err;
560
+ // Otherwise, send a 500 response unless the original response has
561
+ // already committed. In that case, preserve its status code for
562
+ // telemetry while still recording the failure and terminating a response
563
+ // that the failed pipeline left open.
564
+ if (res.headersSent) {
565
+ if (currentSpan) {
566
+ const error = err instanceof Error ? err : new Error('Unknown app route error');
567
+ currentSpan.recordException(error);
568
+ currentSpan.setStatus({
569
+ code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
570
+ message: error.message
571
+ });
572
+ currentSpan.setAttribute('error.type', error.name);
573
+ }
574
+ if (!res.writableEnded && !res.destroyed) {
575
+ res.end();
576
+ }
577
+ } else {
578
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
579
+ status: 500
580
+ }));
581
+ }
582
+ return;
583
+ } finally{
584
+ ;
585
+ (()=>{
586
+ if (!currentSpan) {
587
+ return;
588
+ }
589
+ let statusCode = res.statusCode;
590
+ currentSpan.setAttributes({
591
+ 'http.status_code': statusCode,
592
+ 'next.rsc': false
593
+ });
594
+ if (statusCode && statusCode >= 500) {
595
+ // For 5xx status codes: SHOULD be set to 'Error' span status.
596
+ // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
597
+ currentSpan.setStatus({
598
+ code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
599
+ });
600
+ // For span status 'Error', SHOULD set 'error.type' attribute.
601
+ currentSpan.setAttribute('error.type', statusCode.toString());
602
+ }
603
+ const rootSpanAttributes = tracer.getRootSpanAttributes();
604
+ // We were unable to get attributes, probably OTEL is not enabled
605
+ if (!rootSpanAttributes) {
606
+ return;
607
+ }
608
+ if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
609
+ console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
610
+ return;
611
+ }
612
+ const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
613
+ const name = `${method} ${route}`;
614
+ currentSpan.setAttributes({
615
+ 'next.route': route,
616
+ 'http.route': route,
617
+ 'next.span_name': name
618
+ });
619
+ currentSpan.updateName(name);
620
+ // Propagate http.route to the parent span if one exists (e.g.
621
+ // a platform-created HTTP span in adapter deployments).
622
+ if (parentSpan && parentSpan !== currentSpan) {
623
+ parentSpan.setAttribute('http.route', route);
624
+ parentSpan.updateName(name);
625
+ }
626
+ })();
627
+ }
628
+ };
629
+ // TODO: activeSpan code path is for when wrapped by
630
+ // next-server can be removed when this is no longer used
631
+ if (isWrappedByNextServer && activeSpan) {
632
+ await handleResponse(activeSpan, undefined);
633
+ } else {
634
+ let parentSpan = tracer.getActiveScopeSpan();
635
+ await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
636
+ spanName: `${method} ${srcPage}`,
637
+ kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
638
+ attributes: {
639
+ 'http.method': method,
640
+ 'http.target': req.url
641
+ }
642
+ }, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
643
+ }
644
+ }
645
+
646
+ //# sourceMappingURL=app-route.js.map
647
+
648
+
649
+ /***/ }),
650
+
651
+ /***/ 16698:
652
+ /***/ ((module) => {
653
+
654
+ module.exports = require("node:async_hooks");
655
+
656
+ /***/ }),
657
+
658
+ /***/ 19121:
659
+ /***/ ((module) => {
660
+
661
+ module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
662
+
663
+ /***/ }),
664
+
665
+ /***/ 27910:
666
+ /***/ ((module) => {
667
+
668
+ module.exports = require("stream");
669
+
670
+ /***/ }),
671
+
672
+ /***/ 28354:
673
+ /***/ ((module) => {
674
+
675
+ module.exports = require("util");
676
+
677
+ /***/ }),
678
+
679
+ /***/ 29021:
680
+ /***/ ((module) => {
681
+
682
+ module.exports = require("fs");
683
+
684
+ /***/ }),
685
+
686
+ /***/ 29294:
687
+ /***/ ((module) => {
688
+
689
+ module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
690
+
691
+ /***/ }),
692
+
693
+ /***/ 31421:
694
+ /***/ ((module) => {
695
+
696
+ module.exports = require("node:child_process");
697
+
698
+ /***/ }),
699
+
700
+ /***/ 33873:
701
+ /***/ ((module) => {
702
+
703
+ module.exports = require("path");
704
+
705
+ /***/ }),
706
+
707
+ /***/ 37067:
708
+ /***/ ((module) => {
709
+
710
+ module.exports = require("node:http");
711
+
712
+ /***/ }),
713
+
714
+ /***/ 38522:
715
+ /***/ ((module) => {
716
+
717
+ module.exports = require("node:zlib");
718
+
719
+ /***/ }),
720
+
721
+ /***/ 44708:
722
+ /***/ ((module) => {
723
+
724
+ module.exports = require("node:https");
725
+
726
+ /***/ }),
727
+
728
+ /***/ 44870:
729
+ /***/ ((module) => {
730
+
731
+ module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
732
+
733
+ /***/ }),
734
+
735
+ /***/ 48161:
736
+ /***/ ((module) => {
737
+
738
+ module.exports = require("node:os");
739
+
740
+ /***/ }),
741
+
742
+ /***/ 51455:
743
+ /***/ ((module) => {
744
+
745
+ module.exports = require("node:fs/promises");
746
+
747
+ /***/ }),
748
+
749
+ /***/ 55511:
750
+ /***/ ((module) => {
751
+
752
+ module.exports = require("crypto");
753
+
754
+ /***/ }),
755
+
756
+ /***/ 55591:
757
+ /***/ ((module) => {
758
+
759
+ module.exports = require("https");
760
+
761
+ /***/ }),
762
+
763
+ /***/ 57075:
764
+ /***/ ((module) => {
765
+
766
+ module.exports = require("node:stream");
767
+
768
+ /***/ }),
769
+
770
+ /***/ 57975:
771
+ /***/ ((module) => {
772
+
773
+ module.exports = require("node:util");
774
+
775
+ /***/ }),
776
+
777
+ /***/ 63033:
778
+ /***/ ((module) => {
779
+
780
+ module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
781
+
782
+ /***/ }),
783
+
784
+ /***/ 63541:
785
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
786
+
787
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
788
+ /* harmony export */ C: () => (/* binding */ getThreadActivity)
789
+ /* harmony export */ });
790
+ /* harmony import */ var _lib_agents_run_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68564);
791
+ /* harmony import */ var _lib_agents_run_queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3944);
792
+ /* harmony import */ var _lib_agents_thread_compaction_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(87313);
793
+
794
+
795
+
796
+ function getThreadActivity(threadId) {
797
+ const active = (0,_lib_agents_run_registry__WEBPACK_IMPORTED_MODULE_0__/* .getRun */ .Mh)(threadId);
798
+ const run = active && active.status === "running" ? {
799
+ phase: active.phase,
800
+ label: active.phase_label,
801
+ started_at: active.started_at,
802
+ agent_id: active.agent_id
803
+ } : null;
804
+ const queue_depth = (0,_lib_agents_run_queue__WEBPACK_IMPORTED_MODULE_1__.getQueueDepth)(threadId);
805
+ const attempt = (0,_lib_agents_thread_compaction_state__WEBPACK_IMPORTED_MODULE_2__/* .currentCompaction */ .$I)(threadId);
806
+ const compaction = attempt ? {
807
+ kind: attempt.kind,
808
+ boundary_seq: attempt.boundarySeq,
809
+ started_at: attempt.startedAt,
810
+ deadline_at: attempt.deadlineAt
811
+ } : null;
812
+ return {
813
+ run,
814
+ queue_depth,
815
+ compaction,
816
+ busy: run !== null || queue_depth > 0 || compaction !== null
817
+ };
818
+ }
819
+
820
+
821
+ /***/ }),
822
+
823
+ /***/ 68564:
824
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
825
+
826
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
827
+ /* harmony export */ AD: () => (/* binding */ startRun),
828
+ /* harmony export */ B1: () => (/* binding */ subscribe),
829
+ /* harmony export */ Cs: () => (/* binding */ waitForRun),
830
+ /* harmony export */ ES: () => (/* binding */ abortAllRuns),
831
+ /* harmony export */ JH: () => (/* binding */ finishRun),
832
+ /* harmony export */ KD: () => (/* binding */ abortRun),
833
+ /* harmony export */ Mh: () => (/* binding */ getRun),
834
+ /* harmony export */ QK: () => (/* binding */ drainSteering),
835
+ /* harmony export */ mq: () => (/* binding */ broadcast),
836
+ /* harmony export */ mx: () => (/* binding */ pushSteering)
837
+ /* harmony export */ });
838
+ /* unused harmony export waitForRunsToSettle */
839
+ /* harmony import */ var _lib_env_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67500);
840
+ /* harmony import */ var _lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15559);
841
+
842
+
843
+ // Read once at module init. JARELA_RUN_BUFFER_SIZE / JARELA_RUN_REGISTRY_TTL_MS
844
+ // override the defaults.
845
+ const MAX_BUFFERED = (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runBufferSize;
846
+ const RECENT_TTL_MS = (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runRegistryTtlMs;
847
+ // Idle (no-progress) ceiling and wall-clock ceiling: read fresh per-run
848
+ // from getConfig() so non-restart-required env reloads take effect.
849
+ function runIdleMs() {
850
+ return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runIdleMs;
851
+ }
852
+ function runMaxMs() {
853
+ return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runMaxMs;
854
+ }
855
+ const registryState = (0,_lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__/* .getOrCreateGlobal */ .X)("__jarela_active_run_registry", ()=>({
856
+ runs: new Map(),
857
+ waiters: new Map()
858
+ }));
859
+ const runs = registryState.runs;
860
+ // Cold-attach waiters: subscribers that opened a GET /run before the
861
+ // server-side run actually called startRun (typical for triggers /
862
+ // scheduler / watcher, which submit through `after()` + the per-thread
863
+ // queue, so there's a real delay between the user clicking "Run now"
864
+ // and the registry entry appearing). Resolved by `startRun` below.
865
+ const waiters = registryState.waiters;
866
+ /** Wait up to `timeoutMs` for a run to be registered on `thread_id`.
867
+ * Resolves immediately with the current run if one is already active,
868
+ * with the new run when `startRun` fires inside the window, or with
869
+ * `null` on timeout. `timeoutMs <= 0` short-circuits to the current
870
+ * state without waiting. Caller is responsible for closing the SSE
871
+ * stream when this resolves null. */ function waitForRun(thread_id, timeoutMs) {
872
+ const existing = runs.get(thread_id);
873
+ if (existing) return Promise.resolve(existing);
874
+ if (timeoutMs <= 0) return Promise.resolve(null);
875
+ return new Promise((resolve)=>{
876
+ let set = waiters.get(thread_id);
877
+ if (!set) {
878
+ set = new Set();
879
+ waiters.set(thread_id, set);
880
+ }
881
+ const fn = (run)=>{
882
+ clearTimeout(timer);
883
+ resolve(run);
884
+ };
885
+ set.add(fn);
886
+ const timer = setTimeout(()=>{
887
+ const cur = waiters.get(thread_id);
888
+ cur?.delete(fn);
889
+ if (cur && cur.size === 0) waiters.delete(thread_id);
890
+ resolve(null);
891
+ }, timeoutMs);
892
+ timer.unref?.();
893
+ });
894
+ }
895
+ function startRun(thread_id, agent_id) {
896
+ // If a stale completed run exists, drop it before starting a new one.
897
+ const existing = runs.get(thread_id);
898
+ if (existing && existing.status === "running") {
899
+ throw new Error(`A run is already active for thread ${thread_id}`);
900
+ }
901
+ const now = Date.now();
902
+ const run = {
903
+ thread_id,
904
+ agent_id,
905
+ started_at: now,
906
+ finished_at: null,
907
+ status: "running",
908
+ events: [],
909
+ subscribers: new Set(),
910
+ final_text: "",
911
+ abort: new AbortController(),
912
+ last_chunk_at: now,
913
+ inflight_tools: new Set(),
914
+ tool_started_at: new Map(),
915
+ tool_time_ms_done: 0,
916
+ steering: [],
917
+ phase: "starting",
918
+ phase_label: "Starting…"
919
+ };
920
+ runs.set(thread_id, run);
921
+ // Wake any GET subscribers that attached before the run was registered.
922
+ const pending = waiters.get(thread_id);
923
+ if (pending) {
924
+ waiters.delete(thread_id);
925
+ for (const fn of pending){
926
+ try {
927
+ fn(run);
928
+ } catch {}
929
+ }
930
+ }
931
+ scheduleIdleWatchdog(run);
932
+ scheduleMaxWatchdog(run);
933
+ return run;
934
+ }
935
+ // Synthesise a typed error chunk for the watchdog termination paths and
936
+ // fan it out to subscribers BEFORE flipping `status` to "error". The order
937
+ // matters: `broadcast()`'s status guard drops any chunk delivered after
938
+ // `finishRun()` has run, so calling finishRun first would silently swallow
939
+ // the error and the client's EventSource would just see the connection
940
+ // close with no terminal event — bubble keeps spinning, no toast. Doing
941
+ // it the other way around lets the client receive a real error event,
942
+ // render a "Run timed out" toast, and (if the consumer wires it up)
943
+ // trigger an auto-retry path. Followed by `done` so the consumer's
944
+ // for-await loop can break cleanly without waiting for an EOF.
945
+ function emitWatchdogTermination(run, code, message) {
946
+ if (run.status !== "running") return;
947
+ // Direct registry mutation so the broadcast goes through the regular
948
+ // path (subscribers + buffer + seq stamp) without re-entering any of
949
+ // the watchdog scheduling. Mirrors broadcast() but bypasses the
950
+ // status check we'd otherwise be racing against.
951
+ run.last_chunk_at = Date.now();
952
+ const errChunk = {
953
+ type: "error",
954
+ data: {
955
+ message,
956
+ code
957
+ }
958
+ };
959
+ if (run.events.length < MAX_BUFFERED) run.events.push(errChunk);
960
+ for (const fn of run.subscribers){
961
+ try {
962
+ fn(errChunk);
963
+ } catch {}
964
+ }
965
+ // Pair with a synthetic `done` so the client's consume() loop breaks
966
+ // on a terminal event rather than waiting for the EventSource to close.
967
+ const doneChunk = {
968
+ type: "done",
969
+ data: {}
970
+ };
971
+ if (run.events.length < MAX_BUFFERED) run.events.push(doneChunk);
972
+ for (const fn of run.subscribers){
973
+ try {
974
+ fn(doneChunk);
975
+ } catch {}
976
+ }
977
+ }
978
+ // Self-rearming idle watchdog. Fires when no chunk has arrived for
979
+ // `idleMs`; otherwise reschedules itself for `(last_chunk_at + idleMs) -
980
+ // now`. We never carry a handle on the run — the closure just bails if
981
+ // the run is no longer the registry's entry or no longer running.
982
+ function scheduleIdleWatchdog(run) {
983
+ const idleMs = runIdleMs();
984
+ const fireIn = Math.max(0, run.last_chunk_at + idleMs - Date.now());
985
+ setTimeout(()=>{
986
+ const cur = runs.get(run.thread_id);
987
+ if (cur !== run) return;
988
+ if (run.status !== "running") return;
989
+ const idle = Date.now() - run.last_chunk_at;
990
+ if (idle < idleMs) {
991
+ scheduleIdleWatchdog(run);
992
+ return;
993
+ }
994
+ if (run.inflight_tools.size > 0) {
995
+ // Tool execution in progress — silence here is the tool working,
996
+ // not a wedged provider stream. Skip the kill, re-check in idleMs.
997
+ // The tool_result will bump last_chunk_at when it lands.
998
+ setTimeout(()=>scheduleIdleWatchdog(run), idleMs).unref?.();
999
+ return;
1000
+ }
1001
+ console.warn(`[run-registry] idle watchdog: force-finishing stalled run for thread ${run.thread_id} after ${idle}ms of no progress`);
1002
+ emitWatchdogTermination(run, "run_idle_timeout", `Run timed out — no progress for ${Math.round(idle / 1000)}s. The provider stream went silent before the agent finished. Try again, or split the request into smaller steps.`);
1003
+ try {
1004
+ run.abort.abort("run_idle_timeout");
1005
+ } catch {}
1006
+ finishRun(run, "error");
1007
+ }, fireIn).unref?.();
1008
+ }
1009
+ // Wall-clock elapsed minus time spent inside tool calls (both completed and
1010
+ // currently in flight). The wall-clock watchdog uses this so a 5-minute
1011
+ // shell exec or a slow MCP roundtrip doesn't burn the agent's budget;
1012
+ // tools enforce their own timeouts. See ActiveRun.tool_started_at for the
1013
+ // rationale.
1014
+ function effectiveElapsedMs(run, now) {
1015
+ let inflightToolMs = 0;
1016
+ for (const startedAt of run.tool_started_at.values()){
1017
+ inflightToolMs += Math.max(0, now - startedAt);
1018
+ }
1019
+ return Math.max(0, now - run.started_at - run.tool_time_ms_done - inflightToolMs);
1020
+ }
1021
+ function scheduleMaxWatchdog(run) {
1022
+ const max = runMaxMs();
1023
+ const now = Date.now();
1024
+ const fireIn = Math.max(0, max - effectiveElapsedMs(run, now));
1025
+ setTimeout(()=>{
1026
+ const cur = runs.get(run.thread_id);
1027
+ if (cur !== run) return;
1028
+ if (run.status !== "running") return;
1029
+ const elapsed = effectiveElapsedMs(run, Date.now());
1030
+ if (elapsed < max) {
1031
+ // Tool time pushed the effective elapsed back below the ceiling —
1032
+ // re-arm for the remaining budget. Without this, a tool that runs
1033
+ // for longer than `max` between firing and resolving would let
1034
+ // the next setTimeout overshoot.
1035
+ scheduleMaxWatchdog(run);
1036
+ return;
1037
+ }
1038
+ console.warn(`[run-registry] wall-clock watchdog: force-finishing run for thread ${run.thread_id} after ${elapsed}ms of agent time (excluding tool execution)`);
1039
+ emitWatchdogTermination(run, "run_max_timeout", `Run exceeded the wall-clock limit (${Math.round(max / 1000)}s of agent time, excluding tool execution). The agent was force-stopped. Try a smaller scope or raise JARELA_RUN_MAX_MS if this is expected.`);
1040
+ try {
1041
+ run.abort.abort("run_watchdog_timeout");
1042
+ } catch {}
1043
+ finishRun(run, "error");
1044
+ }, fireIn).unref?.();
1045
+ }
1046
+ // Mirrors the labels hooks/useSSE.ts derives from the same chunks.
1047
+ function trackPhase(run, chunk) {
1048
+ const data = chunk.data ?? {};
1049
+ const set = (phase, label)=>{
1050
+ run.phase = phase;
1051
+ run.phase_label = label;
1052
+ };
1053
+ if (chunk.type === "status") {
1054
+ const phase = typeof data.phase === "string" && data.phase ? data.phase : run.phase;
1055
+ const label = typeof data.label === "string" && data.label.trim() ? data.label : "Thinking…";
1056
+ set(phase, label);
1057
+ } else if (chunk.type === "text_delta") {
1058
+ set("responding", "Responding…");
1059
+ } else if (chunk.type === "thinking_delta") {
1060
+ if (run.inflight_tools.size === 0) set("thinking", "Thinking…");
1061
+ } else if (chunk.type === "tool_call") {
1062
+ const name = typeof data.name === "string" && data.name ? data.name : "tool";
1063
+ set("tool", `Using ${name}…`);
1064
+ } else if (chunk.type === "tool_result") {
1065
+ const remaining = typeof data.id === "string" ? [
1066
+ ...run.inflight_tools
1067
+ ].filter((id)=>id !== data.id) : [
1068
+ ...run.inflight_tools
1069
+ ];
1070
+ if (remaining.length === 0) set("thinking", "Thinking…");
1071
+ }
1072
+ }
1073
+ function broadcast(run, chunk) {
1074
+ // Identity-check: a superseded run must not smear trailing chunks onto
1075
+ // the replacement entry in the registry.
1076
+ if (runs.get(run.thread_id) !== run) return;
1077
+ run.last_chunk_at = Date.now();
1078
+ // Heartbeats exist solely to reset the idle watchdog when the provider
1079
+ // is producing chunks that don't surface downstream (most commonly
1080
+ // partial tool-call args while the model streams a large file_write
1081
+ // body). The last_chunk_at bump above is the entire payload — don't
1082
+ // buffer, don't fan out to subscribers, or the SSE wire would carry
1083
+ // meaningless tick events.
1084
+ if (chunk.type === "heartbeat") return;
1085
+ trackPhase(run, chunk);
1086
+ if (chunk.type === "text_delta") {
1087
+ run.final_text += chunk.data.delta ?? "";
1088
+ } else if (chunk.type === "reset_text") {
1089
+ // Output-validator retry (ADR-0037) discarding a flagged completed
1090
+ // reply — see StreamChunk in base.ts.
1091
+ run.final_text = "";
1092
+ } else if (chunk.type === "tool_call") {
1093
+ const id = chunk.data.id;
1094
+ if (id) {
1095
+ run.inflight_tools.add(id);
1096
+ run.tool_started_at.set(id, Date.now());
1097
+ }
1098
+ } else if (chunk.type === "tool_result") {
1099
+ const id = chunk.data.id;
1100
+ if (id) {
1101
+ run.inflight_tools.delete(id);
1102
+ const startedAt = run.tool_started_at.get(id);
1103
+ if (startedAt !== undefined) {
1104
+ run.tool_time_ms_done += Math.max(0, Date.now() - startedAt);
1105
+ run.tool_started_at.delete(id);
1106
+ // The tool just gave the agent its budget back; re-arm the
1107
+ // wall-clock watchdog against the new effective elapsed.
1108
+ scheduleMaxWatchdog(run);
1109
+ }
1110
+ }
1111
+ }
1112
+ if (run.events.length < MAX_BUFFERED) {
1113
+ run.events.push(chunk);
1114
+ }
1115
+ for (const fn of run.subscribers){
1116
+ try {
1117
+ fn(chunk);
1118
+ } catch {}
1119
+ }
1120
+ }
1121
+ function finishRun(run, status) {
1122
+ // Identity-check: a stale run finishing late must not flip the
1123
+ // replacement's status or evict it from the registry.
1124
+ if (runs.get(run.thread_id) !== run) return;
1125
+ run.status = status;
1126
+ run.finished_at = Date.now();
1127
+ // Drop subscribers — late attachers should NOT keep getting events on a
1128
+ // dead run. They'll get the buffered events on subscribe and that's it.
1129
+ run.subscribers.clear();
1130
+ // Auto-evict after TTL so memory doesn't grow with every conversation.
1131
+ setTimeout(()=>{
1132
+ const cur = runs.get(run.thread_id);
1133
+ if (cur === run) runs.delete(run.thread_id);
1134
+ }, RECENT_TTL_MS).unref?.();
1135
+ }
1136
+ function getRun(thread_id) {
1137
+ return runs.get(thread_id) ?? null;
1138
+ }
1139
+ // Signal the agent stream to cancel. The stream loop in the route is wired
1140
+ // to listen on the AbortController and exit early, emitting an error chunk
1141
+ // the client (and the queue-drain hook) can react to. Idempotent.
1142
+ function abortRun(thread_id, reason = "user_interrupted") {
1143
+ const run = runs.get(thread_id);
1144
+ if (!run || run.status !== "running") return false;
1145
+ if (!run.abort.signal.aborted) {
1146
+ try {
1147
+ run.abort.abort(reason);
1148
+ } catch {}
1149
+ }
1150
+ return true;
1151
+ }
1152
+ // Queue a user message typed while `thread_id` is streaming (ADR-0080).
1153
+ // Returns false when there is nothing to steer, so the caller can fall back
1154
+ // to starting a fresh turn.
1155
+ function pushSteering(thread_id, text) {
1156
+ const run = runs.get(thread_id);
1157
+ if (!run || run.status !== "running" || run.abort.signal.aborted) return false;
1158
+ const trimmed = text.trim();
1159
+ if (!trimmed) return false;
1160
+ run.steering.push(trimmed);
1161
+ return true;
1162
+ }
1163
+ // Take everything queued so far, in arrival order. Deliberately not merged
1164
+ // into a summary — collapsing several messages loses the user's intent.
1165
+ function drainSteering(thread_id) {
1166
+ const run = runs.get(thread_id);
1167
+ if (!run || run.steering.length === 0) return [];
1168
+ return run.steering.splice(0, run.steering.length);
1169
+ }
1170
+ // Abort every currently-running run. Used by the graceful-shutdown path so
1171
+ // LangGraph stream loops bail out instead of continuing past process exit.
1172
+ // Returns the number of runs that were signalled.
1173
+ function abortAllRuns(reason = "server_shutdown") {
1174
+ let count = 0;
1175
+ for (const run of runs.values()){
1176
+ if (run.status !== "running") continue;
1177
+ if (run.abort.signal.aborted) continue;
1178
+ try {
1179
+ run.abort.abort(reason);
1180
+ count++;
1181
+ } catch {}
1182
+ }
1183
+ return count;
1184
+ }
1185
+ // Poll until every run has transitioned out of "running" (or until the
1186
+ // caller-supplied deadline elapses). Used during graceful shutdown after
1187
+ // `abortAllRuns()` so the stream `finally` blocks have a chance to flush
1188
+ // the trailing error chunk and call `finishRun()`. Resolves to the count
1189
+ // of runs still stuck in "running" when the deadline hit (0 = clean).
1190
+ async function waitForRunsToSettle(timeoutMs) {
1191
+ const deadline = Date.now() + Math.max(0, timeoutMs);
1192
+ while(Date.now() < deadline){
1193
+ let stillRunning = 0;
1194
+ for (const run of runs.values())if (run.status === "running") stillRunning++;
1195
+ if (stillRunning === 0) return 0;
1196
+ await new Promise((resolve)=>setTimeout(resolve, 50));
1197
+ }
1198
+ let stillRunning = 0;
1199
+ for (const run of runs.values())if (run.status === "running") stillRunning++;
1200
+ return stillRunning;
1201
+ }
1202
+ // Replays buffered events synchronously, then subscribes for live ones.
1203
+ // Returns an unsubscribe fn. Caller is responsible for calling it.
1204
+ function subscribe(thread_id, onEvent) {
1205
+ const run = runs.get(thread_id);
1206
+ if (!run) return {
1207
+ run: null,
1208
+ unsubscribe: ()=>{}
1209
+ };
1210
+ // Replay buffered events first (so the new subscriber catches up).
1211
+ for (const ev of run.events){
1212
+ try {
1213
+ onEvent(ev);
1214
+ } catch {}
1215
+ }
1216
+ if (run.status !== "running") {
1217
+ return {
1218
+ run,
1219
+ unsubscribe: ()=>{}
1220
+ };
1221
+ }
1222
+ run.subscribers.add(onEvent);
1223
+ return {
1224
+ run,
1225
+ unsubscribe: ()=>{
1226
+ run.subscribers.delete(onEvent);
1227
+ }
1228
+ };
1229
+ }
1230
+
1231
+
1232
+ /***/ }),
1233
+
1234
+ /***/ 73024:
1235
+ /***/ ((module) => {
1236
+
1237
+ module.exports = require("node:fs");
1238
+
1239
+ /***/ }),
1240
+
1241
+ /***/ 75919:
1242
+ /***/ ((module) => {
1243
+
1244
+ module.exports = require("node:worker_threads");
1245
+
1246
+ /***/ }),
1247
+
1248
+ /***/ 76760:
1249
+ /***/ ((module) => {
1250
+
1251
+ module.exports = require("node:path");
1252
+
1253
+ /***/ }),
1254
+
1255
+ /***/ 77030:
1256
+ /***/ ((module) => {
1257
+
1258
+ module.exports = require("node:net");
1259
+
1260
+ /***/ }),
1261
+
1262
+ /***/ 77598:
1263
+ /***/ ((module) => {
1264
+
1265
+ module.exports = require("node:crypto");
1266
+
1267
+ /***/ }),
1268
+
1269
+ /***/ 79428:
1270
+ /***/ ((module) => {
1271
+
1272
+ module.exports = require("buffer");
1273
+
1274
+ /***/ }),
1275
+
1276
+ /***/ 80099:
1277
+ /***/ ((module) => {
1278
+
1279
+ module.exports = require("node:sqlite");
1280
+
1281
+ /***/ }),
1282
+
1283
+ /***/ 80481:
1284
+ /***/ ((module) => {
1285
+
1286
+ module.exports = require("node:readline");
1287
+
1288
+ /***/ }),
1289
+
1290
+ /***/ 81630:
1291
+ /***/ ((module) => {
1292
+
1293
+ module.exports = require("http");
1294
+
1295
+ /***/ }),
1296
+
1297
+ /***/ 86439:
1298
+ /***/ ((module) => {
1299
+
1300
+ module.exports = require("next/dist/shared/lib/no-fallback-error.external");
1301
+
1302
+ /***/ }),
1303
+
1304
+ /***/ 87313:
1305
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1306
+
1307
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1308
+ /* harmony export */ $I: () => (/* binding */ currentCompaction),
1309
+ /* harmony export */ D0: () => (/* binding */ isCompactionRunning),
1310
+ /* harmony export */ Dc: () => (/* binding */ getCompactionAttempt),
1311
+ /* harmony export */ PL: () => (/* binding */ runTrackedCompaction),
1312
+ /* harmony export */ nQ: () => (/* binding */ CompactionTimeoutError)
1313
+ /* harmony export */ });
1314
+ /* unused harmony export __resetCompactionAttemptsForTests */
1315
+ /* harmony import */ var _lib_env_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67500);
1316
+ /* harmony import */ var _lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15559);
1317
+
1318
+
1319
+ class CompactionTimeoutError extends Error {
1320
+ constructor(threadId, kind, timeoutMs){
1321
+ super(`${kind} compaction for thread ${threadId} timed out after ${timeoutMs} ms`);
1322
+ this.name = "CompactionTimeoutError";
1323
+ }
1324
+ }
1325
+ const attempts = (0,_lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__/* .getOrCreateGlobal */ .X)("__jarela_thread_compaction_attempts", ()=>new Map());
1326
+ function slotFor(threadId) {
1327
+ let slot = attempts.get(threadId);
1328
+ if (!slot) {
1329
+ slot = new Map();
1330
+ attempts.set(threadId, slot);
1331
+ }
1332
+ return slot;
1333
+ }
1334
+ function release(attempt) {
1335
+ const slot = attempts.get(attempt.threadId);
1336
+ if (slot?.get(attempt.kind) !== attempt) return;
1337
+ slot.delete(attempt.kind);
1338
+ if (slot.size === 0) attempts.delete(attempt.threadId);
1339
+ }
1340
+ function getCompactionAttempt(threadId, kind) {
1341
+ return attempts.get(threadId)?.get(kind) ?? null;
1342
+ }
1343
+ function isCompactionRunning(threadId, kind) {
1344
+ const slot = attempts.get(threadId);
1345
+ if (!slot) return false;
1346
+ return kind ? slot.has(kind) : slot.size > 0;
1347
+ }
1348
+ const KIND_PRIORITY = [
1349
+ "manual",
1350
+ "auto",
1351
+ "refresh"
1352
+ ];
1353
+ /** The most significant compaction running on the thread, if any. */ function currentCompaction(threadId) {
1354
+ const slot = attempts.get(threadId);
1355
+ if (!slot) return null;
1356
+ for (const kind of KIND_PRIORITY){
1357
+ const attempt = slot.get(kind);
1358
+ if (attempt) return attempt;
1359
+ }
1360
+ return null;
1361
+ }
1362
+ /**
1363
+ * Register a compaction on the thread synchronously, run it, and release it
1364
+ * when it settles or its deadline passes. On timeout the attempt stops being
1365
+ * current — pass it to compactThreadWarmContext so a late result is dropped
1366
+ * instead of committed — and the promise rejects with CompactionTimeoutError.
1367
+ * A newer attempt of the same kind replaces (and invalidates) an older one.
1368
+ */ function runTrackedCompaction(threadId, kind, boundarySeq, run, timeoutMs = (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().compactionTimeoutMs) {
1369
+ const startedAt = Date.now();
1370
+ let current = true;
1371
+ const attempt = {
1372
+ threadId,
1373
+ kind,
1374
+ boundarySeq,
1375
+ startedAt,
1376
+ deadlineAt: startedAt + timeoutMs,
1377
+ isCurrent: ()=>current && attempts.get(threadId)?.get(kind) === attempt
1378
+ };
1379
+ slotFor(threadId).set(kind, attempt);
1380
+ let timer = null;
1381
+ const deadline = new Promise((_, reject)=>{
1382
+ timer = setTimeout(()=>{
1383
+ current = false;
1384
+ release(attempt);
1385
+ reject(new CompactionTimeoutError(threadId, kind, timeoutMs));
1386
+ }, timeoutMs);
1387
+ timer.unref?.();
1388
+ });
1389
+ let work;
1390
+ try {
1391
+ work = run(attempt);
1392
+ } catch (err) {
1393
+ work = Promise.reject(err);
1394
+ }
1395
+ return Promise.race([
1396
+ work,
1397
+ deadline
1398
+ ]).finally(()=>{
1399
+ if (timer) clearTimeout(timer);
1400
+ current = false;
1401
+ release(attempt);
1402
+ });
1403
+ }
1404
+ function __resetCompactionAttemptsForTests() {
1405
+ attempts.clear();
1406
+ }
1407
+
1408
+
1409
+ /***/ }),
1410
+
1411
+ /***/ 94735:
1412
+ /***/ ((module) => {
1413
+
1414
+ module.exports = require("events");
1415
+
1416
+ /***/ }),
1417
+
1418
+ /***/ 99253:
1419
+ /***/ ((module) => {
1420
+
1421
+ module.exports = import("@huggingface/transformers");;
1422
+
1423
+ /***/ })
1424
+
1425
+ };
1426
+ ;
1427
+
1428
+ // load runtime
1429
+ var __webpack_require__ = require("../../../../../../webpack-runtime.js");
1430
+ __webpack_require__.C(exports);
1431
+ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
1432
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46,3042], () => (__webpack_exec__(11075)));
1433
+ module.exports = __webpack_exports__;
1434
+
1435
+ })();
1436
+ //# sourceMappingURL=route.js.map