@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,963 @@
1
+ "use strict";
2
+ exports.id = 5120;
3
+ exports.ids = [3944,5120];
4
+ exports.modules = {
5
+
6
+ /***/ 3944:
7
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
+
9
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
+ /* harmony export */ M6: () => (/* binding */ enqueueThreadRun),
11
+ /* harmony export */ Zm: () => (/* binding */ QueueFullError),
12
+ /* harmony export */ getQueueDepth: () => (/* binding */ getQueueDepth),
13
+ /* harmony export */ vR: () => (/* binding */ QueueExpiredError)
14
+ /* harmony export */ });
15
+ /* unused harmony export __resetForTests */
16
+ /* harmony import */ var _lib_utils_global_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15559);
17
+ // Per-thread priority queue for agent runs.
18
+ //
19
+ // A thread can have one active run. Waiting interactive runs are selected
20
+ // before waiting background runs, while FIFO order is preserved within each
21
+ // lane. Different threads drain independently.
22
+ //
23
+ // In-memory + single-process. Multi-instance deployment would need a shared
24
+ // lock (Redis, Postgres advisory locks) — explicitly out of scope.
25
+
26
+ const queues = (0,_lib_utils_global_state__WEBPACK_IMPORTED_MODULE_0__/* .getOrCreateGlobal */ .X)("__jarela_thread_run_queues", ()=>new Map());
27
+ const DEFAULT_MAX_DEPTH = 16;
28
+ const sourceLanes = {
29
+ user: "interactive",
30
+ bridge: "interactive",
31
+ delegate: "interactive",
32
+ scheduler: "background",
33
+ watcher: "background",
34
+ trigger: "background",
35
+ extension: "background"
36
+ };
37
+ class QueueFullError extends Error {
38
+ constructor(thread_id, depth){
39
+ super(`Per-thread run queue full for thread ${thread_id} (depth=${depth})`);
40
+ this.name = "QueueFullError";
41
+ }
42
+ }
43
+ class QueueExpiredError extends Error {
44
+ constructor(thread_id, expiresAt){
45
+ super(`Queued run expired for thread ${thread_id} at ${expiresAt}`);
46
+ this.name = "QueueExpiredError";
47
+ }
48
+ }
49
+ function depth(queue) {
50
+ return (queue.active ? 1 : 0) + queue.interactive.length + queue.background.length;
51
+ }
52
+ function drain(thread_id, queue) {
53
+ if (queue.active) return;
54
+ const job = queue.interactive.shift() ?? queue.background.shift();
55
+ if (!job) {
56
+ if (queues.get(thread_id) === queue) queues.delete(thread_id);
57
+ return;
58
+ }
59
+ queue.active = job;
60
+ Promise.resolve().then(()=>{
61
+ if (job.expiresAt !== undefined && Date.now() >= job.expiresAt) {
62
+ throw new QueueExpiredError(thread_id, job.expiresAt);
63
+ }
64
+ return job.runner();
65
+ }).then((value)=>{
66
+ finish(thread_id, queue);
67
+ job.resolve(value);
68
+ }, (error)=>{
69
+ finish(thread_id, queue);
70
+ job.reject(error);
71
+ });
72
+ }
73
+ function finish(thread_id, queue) {
74
+ queue.active = undefined;
75
+ if (queues.get(thread_id) === queue) drain(thread_id, queue);
76
+ }
77
+ function enqueueThreadRun(thread_id, source, runner, options = {}) {
78
+ const queue = queues.get(thread_id) ?? {
79
+ interactive: [],
80
+ background: []
81
+ };
82
+ const currentDepth = depth(queue);
83
+ const max = options.maxDepth ?? DEFAULT_MAX_DEPTH;
84
+ if (currentDepth >= max) {
85
+ throw new QueueFullError(thread_id, currentDepth);
86
+ }
87
+ const lane = options.lane ?? sourceLanes[source];
88
+ const position = queue.active ? 1 + queue.interactive.length + (lane === "background" ? queue.background.length : 0) : queue.interactive.length + (lane === "background" ? queue.background.length : 0);
89
+ let resolve;
90
+ let reject;
91
+ const result = new Promise((res, rej)=>{
92
+ resolve = res;
93
+ reject = rej;
94
+ });
95
+ const job = {
96
+ runner,
97
+ expiresAt: options.expiresAt,
98
+ resolve,
99
+ reject
100
+ };
101
+ queue[lane].push(job);
102
+ queues.set(thread_id, queue);
103
+ drain(thread_id, queue);
104
+ return {
105
+ result,
106
+ position
107
+ };
108
+ }
109
+ /** Current queue depth for a thread, including the active job. */ function getQueueDepth(thread_id) {
110
+ const queue = queues.get(thread_id);
111
+ return queue ? depth(queue) : 0;
112
+ }
113
+ /** Reset all queue state. Test-only — never call from production code. */ function __resetForTests() {
114
+ queues.clear();
115
+ }
116
+
117
+
118
+ /***/ }),
119
+
120
+ /***/ 62174:
121
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
122
+
123
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
124
+ /* harmony export */ $V: () => (/* binding */ getLatestMessageUsageForThread),
125
+ /* harmony export */ kw: () => (/* binding */ getMessageUsageByIds),
126
+ /* harmony export */ up: () => (/* binding */ recordMessageUsage)
127
+ /* harmony export */ });
128
+ /* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
129
+ // ADR-0041. Immutable per-assistant-turn snapshot of LLM usage.
130
+ //
131
+ // Written once when an assistant turn is persisted (see
132
+ // `persistAssistantMessage` in lib/agents/run-thread.ts). Never updated.
133
+ // The dashboard reads this table in preference to recomputing tokens /
134
+ // cost from `messages.content` + current agent_configs joins.
135
+
136
+ function recordMessageUsage(input) {
137
+ const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
138
+ const t = input.tier_usage ?? null;
139
+ db.prepare(`INSERT OR IGNORE INTO message_usage (
140
+ message_id, thread_id, agent_id, agent_name, provider, model_id,
141
+ model_config_name, input_tokens, output_tokens,
142
+ input_rate_usd_per_mtok, output_rate_usd_per_mtok, cost_usd, created_at,
143
+ hot_tokens, warm_tokens, facts_tokens, overhead_tokens,
144
+ hot_budget_tokens, warm_budget_tokens, facts_budget_tokens, context_window_tokens,
145
+ cache_creation_input_tokens, cache_read_input_tokens, thinking_tokens
146
+ ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`).run(input.message_id, input.thread_id, input.agent_id, input.agent_name, input.provider, input.model_id, input.model_config_name, input.input_tokens, input.output_tokens, input.input_rate_usd_per_mtok, input.output_rate_usd_per_mtok, input.cost_usd, new Date().toISOString(), t?.hot_tokens ?? null, t?.warm_tokens ?? null, t?.facts_tokens ?? null, t?.overhead_tokens ?? null, t?.hot_budget_tokens ?? null, t?.warm_budget_tokens ?? null, t?.facts_budget_tokens ?? null, t?.context_window_tokens ?? null, input.cache_creation_input_tokens ?? null, input.cache_read_input_tokens ?? null, input.thinking_tokens ?? null);
147
+ }
148
+ function getMessageUsageByIds(messageIds) {
149
+ const out = new Map();
150
+ if (messageIds.length === 0) return out;
151
+ const placeholders = messageIds.map(()=>"?").join(",");
152
+ const rows = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT * FROM message_usage WHERE message_id IN (${placeholders})`).all(...messageIds);
153
+ for (const row of rows)out.set(row.message_id, row);
154
+ return out;
155
+ }
156
+ function getLatestMessageUsageForThread(threadId) {
157
+ return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM message_usage WHERE thread_id=? ORDER BY created_at DESC LIMIT 1").get(threadId) ?? null;
158
+ }
159
+
160
+
161
+ /***/ }),
162
+
163
+ /***/ 66963:
164
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
165
+
166
+
167
+ // EXPORTS
168
+ __webpack_require__.d(__webpack_exports__, {
169
+ w: () => (/* binding */ getCheckpointer)
170
+ });
171
+
172
+ // EXTERNAL MODULE: external "node:path"
173
+ var external_node_path_ = __webpack_require__(76760);
174
+ // EXTERNAL MODULE: ./lib/db/data-dir.ts
175
+ var data_dir = __webpack_require__(57477);
176
+ // EXTERNAL MODULE: external "node:sqlite"
177
+ var external_node_sqlite_ = __webpack_require__(80099);
178
+ // EXTERNAL MODULE: ./node_modules/@langchain/langgraph-checkpoint/dist/index.js + 86 modules
179
+ var dist = __webpack_require__(8808);
180
+ ;// ./lib/agents/sqlite-checkpoint-saver.ts
181
+
182
+
183
+ // In-tree LangGraph checkpoint saver backed by node:sqlite.
184
+ //
185
+ // Schema-compatible drop-in replacement for SqliteSaver from
186
+ // @langchain/langgraph-checkpoint-sqlite. The DDL is byte-identical so an
187
+ // existing checkpoints.db keeps working without migration.
188
+ const VALID_FILTER_KEYS = [
189
+ "source",
190
+ "step",
191
+ "parents"
192
+ ];
193
+ function buildLatestSelect(includeCheckpointId) {
194
+ return `
195
+ SELECT
196
+ thread_id,
197
+ checkpoint_ns,
198
+ checkpoint_id,
199
+ parent_checkpoint_id,
200
+ type,
201
+ checkpoint,
202
+ metadata,
203
+ (
204
+ SELECT
205
+ json_group_array(
206
+ json_object(
207
+ 'task_id', pw.task_id,
208
+ 'channel', pw.channel,
209
+ 'type', pw.type,
210
+ 'value', CAST(pw.value AS TEXT)
211
+ )
212
+ )
213
+ FROM writes as pw
214
+ WHERE pw.thread_id = checkpoints.thread_id
215
+ AND pw.checkpoint_ns = checkpoints.checkpoint_ns
216
+ AND pw.checkpoint_id = checkpoints.checkpoint_id
217
+ ) as pending_writes,
218
+ (
219
+ SELECT
220
+ json_group_array(
221
+ json_object(
222
+ 'type', ps.type,
223
+ 'value', CAST(ps.value AS TEXT)
224
+ )
225
+ )
226
+ FROM writes as ps
227
+ WHERE ps.thread_id = checkpoints.thread_id
228
+ AND ps.checkpoint_ns = checkpoints.checkpoint_ns
229
+ AND ps.checkpoint_id = checkpoints.parent_checkpoint_id
230
+ AND ps.channel = '${dist/* TASKS */.n3}'
231
+ ORDER BY ps.idx
232
+ ) as pending_sends
233
+ FROM checkpoints
234
+ WHERE thread_id = ? AND checkpoint_ns = ? ${includeCheckpointId ? "AND checkpoint_id = ?" : "ORDER BY checkpoint_id DESC LIMIT 1"}`;
235
+ }
236
+ // node:sqlite rejects `undefined` parameter binds; coerce to null.
237
+ function nv(v) {
238
+ return v === undefined ? null : v;
239
+ }
240
+ class NodeSqliteSaver extends dist/* BaseCheckpointSaver */.R1 {
241
+ constructor(db, serde){
242
+ super(serde), this.isSetup = false;
243
+ this.db = db;
244
+ }
245
+ static fromConnString(connStringOrLocalPath) {
246
+ return new NodeSqliteSaver(new external_node_sqlite_.DatabaseSync(connStringOrLocalPath));
247
+ }
248
+ setup() {
249
+ if (this.isSetup) return;
250
+ this.db.exec("PRAGMA journal_mode=WAL");
251
+ this.db.exec(`
252
+ CREATE TABLE IF NOT EXISTS checkpoints (
253
+ thread_id TEXT NOT NULL,
254
+ checkpoint_ns TEXT NOT NULL DEFAULT '',
255
+ checkpoint_id TEXT NOT NULL,
256
+ parent_checkpoint_id TEXT,
257
+ type TEXT,
258
+ checkpoint BLOB,
259
+ metadata BLOB,
260
+ PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id)
261
+ );`);
262
+ this.db.exec(`
263
+ CREATE TABLE IF NOT EXISTS writes (
264
+ thread_id TEXT NOT NULL,
265
+ checkpoint_ns TEXT NOT NULL DEFAULT '',
266
+ checkpoint_id TEXT NOT NULL,
267
+ task_id TEXT NOT NULL,
268
+ idx INTEGER NOT NULL,
269
+ channel TEXT NOT NULL,
270
+ type TEXT,
271
+ value BLOB,
272
+ PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id, task_id, idx)
273
+ );`);
274
+ this.withoutCheckpoint = this.db.prepare(buildLatestSelect(false));
275
+ this.withCheckpoint = this.db.prepare(buildLatestSelect(true));
276
+ this.isSetup = true;
277
+ }
278
+ txn(fn) {
279
+ this.db.exec("BEGIN");
280
+ try {
281
+ const result = fn();
282
+ this.db.exec("COMMIT");
283
+ return result;
284
+ } catch (err) {
285
+ try {
286
+ this.db.exec("ROLLBACK");
287
+ } catch {
288
+ // ignore rollback failure; surface the original error
289
+ }
290
+ throw err;
291
+ }
292
+ }
293
+ async decodeRowState(row) {
294
+ const pendingWrites = await Promise.all(JSON.parse(String(row.pending_writes ?? "[]")).map(async (write)=>{
295
+ return [
296
+ write.task_id,
297
+ write.channel,
298
+ await this.serde.loadsTyped(write.type ?? "json", write.value ?? "")
299
+ ];
300
+ }));
301
+ const checkpoint = await this.serde.loadsTyped(row.type ?? "json", row.checkpoint);
302
+ if (checkpoint.v < 4 && row.parent_checkpoint_id != null) {
303
+ await this.migratePendingSends(checkpoint, row.thread_id, row.parent_checkpoint_id);
304
+ }
305
+ const metadata = await this.serde.loadsTyped(row.type ?? "json", row.metadata);
306
+ return {
307
+ pendingWrites,
308
+ checkpoint,
309
+ metadata
310
+ };
311
+ }
312
+ async getTuple(config) {
313
+ this.setup();
314
+ const { thread_id, checkpoint_ns = "", checkpoint_id } = config.configurable ?? {};
315
+ const args = [
316
+ nv(thread_id),
317
+ checkpoint_ns
318
+ ];
319
+ if (checkpoint_id) args.push(checkpoint_id);
320
+ const stmt = checkpoint_id ? this.withCheckpoint : this.withoutCheckpoint;
321
+ const row = stmt.get(...args);
322
+ if (row === undefined) return undefined;
323
+ let finalConfig = config;
324
+ if (!checkpoint_id) {
325
+ finalConfig = {
326
+ configurable: {
327
+ thread_id: row.thread_id,
328
+ checkpoint_ns,
329
+ checkpoint_id: row.checkpoint_id
330
+ }
331
+ };
332
+ }
333
+ if (finalConfig.configurable?.thread_id === undefined || finalConfig.configurable?.checkpoint_id === undefined) {
334
+ throw new Error("Missing thread_id or checkpoint_id");
335
+ }
336
+ const { pendingWrites, checkpoint, metadata } = await this.decodeRowState(row);
337
+ return {
338
+ checkpoint,
339
+ config: finalConfig,
340
+ metadata,
341
+ parentConfig: row.parent_checkpoint_id ? {
342
+ configurable: {
343
+ thread_id: row.thread_id,
344
+ checkpoint_ns,
345
+ checkpoint_id: row.parent_checkpoint_id
346
+ }
347
+ } : undefined,
348
+ pendingWrites
349
+ };
350
+ }
351
+ async *list(config, options) {
352
+ const { limit, before, filter } = options ?? {};
353
+ this.setup();
354
+ const thread_id = config.configurable?.thread_id;
355
+ const checkpoint_ns = config.configurable?.checkpoint_ns;
356
+ let sql = `
357
+ SELECT
358
+ thread_id,
359
+ checkpoint_ns,
360
+ checkpoint_id,
361
+ parent_checkpoint_id,
362
+ type,
363
+ checkpoint,
364
+ metadata,
365
+ (
366
+ SELECT
367
+ json_group_array(
368
+ json_object(
369
+ 'task_id', pw.task_id,
370
+ 'channel', pw.channel,
371
+ 'type', pw.type,
372
+ 'value', CAST(pw.value AS TEXT)
373
+ )
374
+ )
375
+ FROM writes as pw
376
+ WHERE pw.thread_id = checkpoints.thread_id
377
+ AND pw.checkpoint_ns = checkpoints.checkpoint_ns
378
+ AND pw.checkpoint_id = checkpoints.checkpoint_id
379
+ ) as pending_writes,
380
+ (
381
+ SELECT
382
+ json_group_array(
383
+ json_object(
384
+ 'type', ps.type,
385
+ 'value', CAST(ps.value AS TEXT)
386
+ )
387
+ )
388
+ FROM writes as ps
389
+ WHERE ps.thread_id = checkpoints.thread_id
390
+ AND ps.checkpoint_ns = checkpoints.checkpoint_ns
391
+ AND ps.checkpoint_id = checkpoints.parent_checkpoint_id
392
+ AND ps.channel = '${dist/* TASKS */.n3}'
393
+ ORDER BY ps.idx
394
+ ) as pending_sends
395
+ FROM checkpoints\n`;
396
+ const whereClause = [];
397
+ if (thread_id !== undefined && thread_id !== null) whereClause.push("thread_id = ?");
398
+ if (checkpoint_ns !== undefined && checkpoint_ns !== null) {
399
+ whereClause.push("checkpoint_ns = ?");
400
+ }
401
+ if (before?.configurable?.checkpoint_id !== undefined) {
402
+ whereClause.push("checkpoint_id < ?");
403
+ }
404
+ const sanitizedFilter = Object.fromEntries(Object.entries(filter ?? {}).filter(([key, value])=>value !== undefined && VALID_FILTER_KEYS.includes(key)));
405
+ whereClause.push(...Object.entries(sanitizedFilter).map(([key])=>`jsonb(CAST(metadata AS TEXT))->'$.${key}' = ?`));
406
+ if (whereClause.length > 0) sql += `WHERE\n ${whereClause.join(" AND\n ")}\n`;
407
+ sql += "\nORDER BY checkpoint_id DESC";
408
+ if (limit) sql += ` LIMIT ${parseInt(String(limit), 10)}`;
409
+ const args = [
410
+ thread_id,
411
+ checkpoint_ns,
412
+ before?.configurable?.checkpoint_id,
413
+ ...Object.values(sanitizedFilter).map((value)=>JSON.stringify(value))
414
+ ].filter((value)=>value !== undefined && value !== null);
415
+ const rows = this.db.prepare(sql).all(...args);
416
+ for (const row of rows){
417
+ const { pendingWrites, checkpoint, metadata } = await this.decodeRowState(row);
418
+ yield {
419
+ config: {
420
+ configurable: {
421
+ thread_id: row.thread_id,
422
+ checkpoint_ns: row.checkpoint_ns,
423
+ checkpoint_id: row.checkpoint_id
424
+ }
425
+ },
426
+ checkpoint,
427
+ metadata,
428
+ parentConfig: row.parent_checkpoint_id ? {
429
+ configurable: {
430
+ thread_id: row.thread_id,
431
+ checkpoint_ns: row.checkpoint_ns,
432
+ checkpoint_id: row.parent_checkpoint_id
433
+ }
434
+ } : undefined,
435
+ pendingWrites
436
+ };
437
+ }
438
+ }
439
+ async put(config, checkpoint, metadata) {
440
+ this.setup();
441
+ if (!config.configurable) throw new Error("Empty configuration supplied.");
442
+ const thread_id = config.configurable?.thread_id;
443
+ const checkpoint_ns = config.configurable?.checkpoint_ns ?? "";
444
+ const parent_checkpoint_id = config.configurable?.checkpoint_id;
445
+ if (!thread_id) {
446
+ throw new Error(`Missing "thread_id" field in passed "config.configurable".`);
447
+ }
448
+ const preparedCheckpoint = (0,dist/* copyCheckpoint */.IE)(checkpoint);
449
+ const [[type1, serializedCheckpoint], [type2, serializedMetadata]] = await Promise.all([
450
+ this.serde.dumpsTyped(preparedCheckpoint),
451
+ this.serde.dumpsTyped(metadata)
452
+ ]);
453
+ if (type1 !== type2) {
454
+ throw new Error("Failed to serialized checkpoint and metadata to the same type.");
455
+ }
456
+ this.db.prepare(`INSERT OR REPLACE INTO checkpoints (thread_id, checkpoint_ns, checkpoint_id, parent_checkpoint_id, type, checkpoint, metadata) VALUES (?, ?, ?, ?, ?, ?, ?)`).run(thread_id, checkpoint_ns, checkpoint.id, nv(parent_checkpoint_id), type1, serializedCheckpoint, serializedMetadata);
457
+ return {
458
+ configurable: {
459
+ thread_id,
460
+ checkpoint_ns,
461
+ checkpoint_id: checkpoint.id
462
+ }
463
+ };
464
+ }
465
+ async putWrites(config, writes, taskId) {
466
+ this.setup();
467
+ if (!config.configurable) throw new Error("Empty configuration supplied.");
468
+ if (!config.configurable?.thread_id) {
469
+ throw new Error("Missing thread_id field in config.configurable.");
470
+ }
471
+ if (!config.configurable?.checkpoint_id) {
472
+ throw new Error("Missing checkpoint_id field in config.configurable.");
473
+ }
474
+ const stmt = this.db.prepare(`
475
+ INSERT OR REPLACE INTO writes
476
+ (thread_id, checkpoint_ns, checkpoint_id, task_id, idx, channel, type, value)
477
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)
478
+ `);
479
+ const rows = await Promise.all(writes.map(async (write, idx)=>{
480
+ const [type, serializedWrite] = await this.serde.dumpsTyped(write[1]);
481
+ return [
482
+ config.configurable?.thread_id,
483
+ config.configurable?.checkpoint_ns ?? "",
484
+ config.configurable?.checkpoint_id,
485
+ taskId,
486
+ idx,
487
+ write[0],
488
+ type,
489
+ serializedWrite
490
+ ];
491
+ }));
492
+ this.txn(()=>{
493
+ for (const row of rows)stmt.run(...row);
494
+ });
495
+ }
496
+ async deleteThread(threadId) {
497
+ this.setup();
498
+ this.txn(()=>{
499
+ this.db.prepare(`DELETE FROM checkpoints WHERE thread_id = ?`).run(threadId);
500
+ this.db.prepare(`DELETE FROM writes WHERE thread_id = ?`).run(threadId);
501
+ });
502
+ }
503
+ async migratePendingSends(checkpoint, threadId, parentCheckpointId) {
504
+ const row = this.db.prepare(`
505
+ SELECT
506
+ checkpoint_id,
507
+ json_group_array(
508
+ json_object(
509
+ 'type', ps.type,
510
+ 'value', CAST(ps.value AS TEXT)
511
+ )
512
+ ) as pending_sends
513
+ FROM writes as ps
514
+ WHERE ps.thread_id = ?
515
+ AND ps.checkpoint_id = ?
516
+ AND ps.channel = '${dist/* TASKS */.n3}'
517
+ ORDER BY ps.idx
518
+ `).get(threadId, parentCheckpointId);
519
+ const pendingSendsJson = String(row?.pending_sends ?? "[]");
520
+ const mutable = checkpoint;
521
+ mutable.channel_values ??= {};
522
+ mutable.channel_values[dist/* TASKS */.n3] = await Promise.all(JSON.parse(pendingSendsJson).map(({ type, value })=>this.serde.loadsTyped(type ?? "json", value ?? "")));
523
+ mutable.channel_versions[dist/* TASKS */.n3] = Object.keys(checkpoint.channel_versions).length > 0 ? (0,dist/* maxChannelVersion */.qU)(...Object.values(checkpoint.channel_versions)) : this.getNextVersion(undefined);
524
+ }
525
+ }
526
+
527
+ ;// ./lib/agents/checkpointer.ts
528
+
529
+
530
+
531
+ // Persistent graph state per thread_id. Multi-step plans, scratchpad messages,
532
+ // and any pending tool-call sequence survive process restarts and resume on
533
+ // the next agent.stream() with the same thread_id.
534
+ //
535
+ // Stored in a separate DB file (~/.jarela/checkpoints.db) so LangGraph
536
+ // manages its own schema independently of our own migrations under
537
+ // lib/db/. Both files use WAL mode via the same node:sqlite driver.
538
+ const CHECKPOINT_PATH = (0,external_node_path_.join)((0,data_dir/* getDataDir */.o)(), "checkpoints.db");
539
+ let _saver = null;
540
+ function getCheckpointer() {
541
+ if (!_saver) {
542
+ _saver = NodeSqliteSaver.fromConnString(CHECKPOINT_PATH);
543
+ }
544
+ return _saver;
545
+ }
546
+
547
+
548
+ /***/ }),
549
+
550
+ /***/ 68564:
551
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
552
+
553
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
554
+ /* harmony export */ AD: () => (/* binding */ startRun),
555
+ /* harmony export */ B1: () => (/* binding */ subscribe),
556
+ /* harmony export */ Cs: () => (/* binding */ waitForRun),
557
+ /* harmony export */ ES: () => (/* binding */ abortAllRuns),
558
+ /* harmony export */ JH: () => (/* binding */ finishRun),
559
+ /* harmony export */ KD: () => (/* binding */ abortRun),
560
+ /* harmony export */ Mh: () => (/* binding */ getRun),
561
+ /* harmony export */ QK: () => (/* binding */ drainSteering),
562
+ /* harmony export */ mq: () => (/* binding */ broadcast),
563
+ /* harmony export */ mx: () => (/* binding */ pushSteering)
564
+ /* harmony export */ });
565
+ /* unused harmony export waitForRunsToSettle */
566
+ /* harmony import */ var _lib_env_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67500);
567
+ /* harmony import */ var _lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15559);
568
+
569
+
570
+ // Read once at module init. JARELA_RUN_BUFFER_SIZE / JARELA_RUN_REGISTRY_TTL_MS
571
+ // override the defaults.
572
+ const MAX_BUFFERED = (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runBufferSize;
573
+ const RECENT_TTL_MS = (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runRegistryTtlMs;
574
+ // Idle (no-progress) ceiling and wall-clock ceiling: read fresh per-run
575
+ // from getConfig() so non-restart-required env reloads take effect.
576
+ function runIdleMs() {
577
+ return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runIdleMs;
578
+ }
579
+ function runMaxMs() {
580
+ return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runMaxMs;
581
+ }
582
+ const registryState = (0,_lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__/* .getOrCreateGlobal */ .X)("__jarela_active_run_registry", ()=>({
583
+ runs: new Map(),
584
+ waiters: new Map()
585
+ }));
586
+ const runs = registryState.runs;
587
+ // Cold-attach waiters: subscribers that opened a GET /run before the
588
+ // server-side run actually called startRun (typical for triggers /
589
+ // scheduler / watcher, which submit through `after()` + the per-thread
590
+ // queue, so there's a real delay between the user clicking "Run now"
591
+ // and the registry entry appearing). Resolved by `startRun` below.
592
+ const waiters = registryState.waiters;
593
+ /** Wait up to `timeoutMs` for a run to be registered on `thread_id`.
594
+ * Resolves immediately with the current run if one is already active,
595
+ * with the new run when `startRun` fires inside the window, or with
596
+ * `null` on timeout. `timeoutMs <= 0` short-circuits to the current
597
+ * state without waiting. Caller is responsible for closing the SSE
598
+ * stream when this resolves null. */ function waitForRun(thread_id, timeoutMs) {
599
+ const existing = runs.get(thread_id);
600
+ if (existing) return Promise.resolve(existing);
601
+ if (timeoutMs <= 0) return Promise.resolve(null);
602
+ return new Promise((resolve)=>{
603
+ let set = waiters.get(thread_id);
604
+ if (!set) {
605
+ set = new Set();
606
+ waiters.set(thread_id, set);
607
+ }
608
+ const fn = (run)=>{
609
+ clearTimeout(timer);
610
+ resolve(run);
611
+ };
612
+ set.add(fn);
613
+ const timer = setTimeout(()=>{
614
+ const cur = waiters.get(thread_id);
615
+ cur?.delete(fn);
616
+ if (cur && cur.size === 0) waiters.delete(thread_id);
617
+ resolve(null);
618
+ }, timeoutMs);
619
+ timer.unref?.();
620
+ });
621
+ }
622
+ function startRun(thread_id, agent_id) {
623
+ // If a stale completed run exists, drop it before starting a new one.
624
+ const existing = runs.get(thread_id);
625
+ if (existing && existing.status === "running") {
626
+ throw new Error(`A run is already active for thread ${thread_id}`);
627
+ }
628
+ const now = Date.now();
629
+ const run = {
630
+ thread_id,
631
+ agent_id,
632
+ started_at: now,
633
+ finished_at: null,
634
+ status: "running",
635
+ events: [],
636
+ subscribers: new Set(),
637
+ final_text: "",
638
+ abort: new AbortController(),
639
+ last_chunk_at: now,
640
+ inflight_tools: new Set(),
641
+ tool_started_at: new Map(),
642
+ tool_time_ms_done: 0,
643
+ steering: [],
644
+ phase: "starting",
645
+ phase_label: "Starting…"
646
+ };
647
+ runs.set(thread_id, run);
648
+ // Wake any GET subscribers that attached before the run was registered.
649
+ const pending = waiters.get(thread_id);
650
+ if (pending) {
651
+ waiters.delete(thread_id);
652
+ for (const fn of pending){
653
+ try {
654
+ fn(run);
655
+ } catch {}
656
+ }
657
+ }
658
+ scheduleIdleWatchdog(run);
659
+ scheduleMaxWatchdog(run);
660
+ return run;
661
+ }
662
+ // Synthesise a typed error chunk for the watchdog termination paths and
663
+ // fan it out to subscribers BEFORE flipping `status` to "error". The order
664
+ // matters: `broadcast()`'s status guard drops any chunk delivered after
665
+ // `finishRun()` has run, so calling finishRun first would silently swallow
666
+ // the error and the client's EventSource would just see the connection
667
+ // close with no terminal event — bubble keeps spinning, no toast. Doing
668
+ // it the other way around lets the client receive a real error event,
669
+ // render a "Run timed out" toast, and (if the consumer wires it up)
670
+ // trigger an auto-retry path. Followed by `done` so the consumer's
671
+ // for-await loop can break cleanly without waiting for an EOF.
672
+ function emitWatchdogTermination(run, code, message) {
673
+ if (run.status !== "running") return;
674
+ // Direct registry mutation so the broadcast goes through the regular
675
+ // path (subscribers + buffer + seq stamp) without re-entering any of
676
+ // the watchdog scheduling. Mirrors broadcast() but bypasses the
677
+ // status check we'd otherwise be racing against.
678
+ run.last_chunk_at = Date.now();
679
+ const errChunk = {
680
+ type: "error",
681
+ data: {
682
+ message,
683
+ code
684
+ }
685
+ };
686
+ if (run.events.length < MAX_BUFFERED) run.events.push(errChunk);
687
+ for (const fn of run.subscribers){
688
+ try {
689
+ fn(errChunk);
690
+ } catch {}
691
+ }
692
+ // Pair with a synthetic `done` so the client's consume() loop breaks
693
+ // on a terminal event rather than waiting for the EventSource to close.
694
+ const doneChunk = {
695
+ type: "done",
696
+ data: {}
697
+ };
698
+ if (run.events.length < MAX_BUFFERED) run.events.push(doneChunk);
699
+ for (const fn of run.subscribers){
700
+ try {
701
+ fn(doneChunk);
702
+ } catch {}
703
+ }
704
+ }
705
+ // Self-rearming idle watchdog. Fires when no chunk has arrived for
706
+ // `idleMs`; otherwise reschedules itself for `(last_chunk_at + idleMs) -
707
+ // now`. We never carry a handle on the run — the closure just bails if
708
+ // the run is no longer the registry's entry or no longer running.
709
+ function scheduleIdleWatchdog(run) {
710
+ const idleMs = runIdleMs();
711
+ const fireIn = Math.max(0, run.last_chunk_at + idleMs - Date.now());
712
+ setTimeout(()=>{
713
+ const cur = runs.get(run.thread_id);
714
+ if (cur !== run) return;
715
+ if (run.status !== "running") return;
716
+ const idle = Date.now() - run.last_chunk_at;
717
+ if (idle < idleMs) {
718
+ scheduleIdleWatchdog(run);
719
+ return;
720
+ }
721
+ if (run.inflight_tools.size > 0) {
722
+ // Tool execution in progress — silence here is the tool working,
723
+ // not a wedged provider stream. Skip the kill, re-check in idleMs.
724
+ // The tool_result will bump last_chunk_at when it lands.
725
+ setTimeout(()=>scheduleIdleWatchdog(run), idleMs).unref?.();
726
+ return;
727
+ }
728
+ console.warn(`[run-registry] idle watchdog: force-finishing stalled run for thread ${run.thread_id} after ${idle}ms of no progress`);
729
+ 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.`);
730
+ try {
731
+ run.abort.abort("run_idle_timeout");
732
+ } catch {}
733
+ finishRun(run, "error");
734
+ }, fireIn).unref?.();
735
+ }
736
+ // Wall-clock elapsed minus time spent inside tool calls (both completed and
737
+ // currently in flight). The wall-clock watchdog uses this so a 5-minute
738
+ // shell exec or a slow MCP roundtrip doesn't burn the agent's budget;
739
+ // tools enforce their own timeouts. See ActiveRun.tool_started_at for the
740
+ // rationale.
741
+ function effectiveElapsedMs(run, now) {
742
+ let inflightToolMs = 0;
743
+ for (const startedAt of run.tool_started_at.values()){
744
+ inflightToolMs += Math.max(0, now - startedAt);
745
+ }
746
+ return Math.max(0, now - run.started_at - run.tool_time_ms_done - inflightToolMs);
747
+ }
748
+ function scheduleMaxWatchdog(run) {
749
+ const max = runMaxMs();
750
+ const now = Date.now();
751
+ const fireIn = Math.max(0, max - effectiveElapsedMs(run, now));
752
+ setTimeout(()=>{
753
+ const cur = runs.get(run.thread_id);
754
+ if (cur !== run) return;
755
+ if (run.status !== "running") return;
756
+ const elapsed = effectiveElapsedMs(run, Date.now());
757
+ if (elapsed < max) {
758
+ // Tool time pushed the effective elapsed back below the ceiling —
759
+ // re-arm for the remaining budget. Without this, a tool that runs
760
+ // for longer than `max` between firing and resolving would let
761
+ // the next setTimeout overshoot.
762
+ scheduleMaxWatchdog(run);
763
+ return;
764
+ }
765
+ console.warn(`[run-registry] wall-clock watchdog: force-finishing run for thread ${run.thread_id} after ${elapsed}ms of agent time (excluding tool execution)`);
766
+ 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.`);
767
+ try {
768
+ run.abort.abort("run_watchdog_timeout");
769
+ } catch {}
770
+ finishRun(run, "error");
771
+ }, fireIn).unref?.();
772
+ }
773
+ // Mirrors the labels hooks/useSSE.ts derives from the same chunks.
774
+ function trackPhase(run, chunk) {
775
+ const data = chunk.data ?? {};
776
+ const set = (phase, label)=>{
777
+ run.phase = phase;
778
+ run.phase_label = label;
779
+ };
780
+ if (chunk.type === "status") {
781
+ const phase = typeof data.phase === "string" && data.phase ? data.phase : run.phase;
782
+ const label = typeof data.label === "string" && data.label.trim() ? data.label : "Thinking…";
783
+ set(phase, label);
784
+ } else if (chunk.type === "text_delta") {
785
+ set("responding", "Responding…");
786
+ } else if (chunk.type === "thinking_delta") {
787
+ if (run.inflight_tools.size === 0) set("thinking", "Thinking…");
788
+ } else if (chunk.type === "tool_call") {
789
+ const name = typeof data.name === "string" && data.name ? data.name : "tool";
790
+ set("tool", `Using ${name}…`);
791
+ } else if (chunk.type === "tool_result") {
792
+ const remaining = typeof data.id === "string" ? [
793
+ ...run.inflight_tools
794
+ ].filter((id)=>id !== data.id) : [
795
+ ...run.inflight_tools
796
+ ];
797
+ if (remaining.length === 0) set("thinking", "Thinking…");
798
+ }
799
+ }
800
+ function broadcast(run, chunk) {
801
+ // Identity-check: a superseded run must not smear trailing chunks onto
802
+ // the replacement entry in the registry.
803
+ if (runs.get(run.thread_id) !== run) return;
804
+ run.last_chunk_at = Date.now();
805
+ // Heartbeats exist solely to reset the idle watchdog when the provider
806
+ // is producing chunks that don't surface downstream (most commonly
807
+ // partial tool-call args while the model streams a large file_write
808
+ // body). The last_chunk_at bump above is the entire payload — don't
809
+ // buffer, don't fan out to subscribers, or the SSE wire would carry
810
+ // meaningless tick events.
811
+ if (chunk.type === "heartbeat") return;
812
+ trackPhase(run, chunk);
813
+ if (chunk.type === "text_delta") {
814
+ run.final_text += chunk.data.delta ?? "";
815
+ } else if (chunk.type === "reset_text") {
816
+ // Output-validator retry (ADR-0037) discarding a flagged completed
817
+ // reply — see StreamChunk in base.ts.
818
+ run.final_text = "";
819
+ } else if (chunk.type === "tool_call") {
820
+ const id = chunk.data.id;
821
+ if (id) {
822
+ run.inflight_tools.add(id);
823
+ run.tool_started_at.set(id, Date.now());
824
+ }
825
+ } else if (chunk.type === "tool_result") {
826
+ const id = chunk.data.id;
827
+ if (id) {
828
+ run.inflight_tools.delete(id);
829
+ const startedAt = run.tool_started_at.get(id);
830
+ if (startedAt !== undefined) {
831
+ run.tool_time_ms_done += Math.max(0, Date.now() - startedAt);
832
+ run.tool_started_at.delete(id);
833
+ // The tool just gave the agent its budget back; re-arm the
834
+ // wall-clock watchdog against the new effective elapsed.
835
+ scheduleMaxWatchdog(run);
836
+ }
837
+ }
838
+ }
839
+ if (run.events.length < MAX_BUFFERED) {
840
+ run.events.push(chunk);
841
+ }
842
+ for (const fn of run.subscribers){
843
+ try {
844
+ fn(chunk);
845
+ } catch {}
846
+ }
847
+ }
848
+ function finishRun(run, status) {
849
+ // Identity-check: a stale run finishing late must not flip the
850
+ // replacement's status or evict it from the registry.
851
+ if (runs.get(run.thread_id) !== run) return;
852
+ run.status = status;
853
+ run.finished_at = Date.now();
854
+ // Drop subscribers — late attachers should NOT keep getting events on a
855
+ // dead run. They'll get the buffered events on subscribe and that's it.
856
+ run.subscribers.clear();
857
+ // Auto-evict after TTL so memory doesn't grow with every conversation.
858
+ setTimeout(()=>{
859
+ const cur = runs.get(run.thread_id);
860
+ if (cur === run) runs.delete(run.thread_id);
861
+ }, RECENT_TTL_MS).unref?.();
862
+ }
863
+ function getRun(thread_id) {
864
+ return runs.get(thread_id) ?? null;
865
+ }
866
+ // Signal the agent stream to cancel. The stream loop in the route is wired
867
+ // to listen on the AbortController and exit early, emitting an error chunk
868
+ // the client (and the queue-drain hook) can react to. Idempotent.
869
+ function abortRun(thread_id, reason = "user_interrupted") {
870
+ const run = runs.get(thread_id);
871
+ if (!run || run.status !== "running") return false;
872
+ if (!run.abort.signal.aborted) {
873
+ try {
874
+ run.abort.abort(reason);
875
+ } catch {}
876
+ }
877
+ return true;
878
+ }
879
+ // Queue a user message typed while `thread_id` is streaming (ADR-0080).
880
+ // Returns false when there is nothing to steer, so the caller can fall back
881
+ // to starting a fresh turn.
882
+ function pushSteering(thread_id, text) {
883
+ const run = runs.get(thread_id);
884
+ if (!run || run.status !== "running" || run.abort.signal.aborted) return false;
885
+ const trimmed = text.trim();
886
+ if (!trimmed) return false;
887
+ run.steering.push(trimmed);
888
+ return true;
889
+ }
890
+ // Take everything queued so far, in arrival order. Deliberately not merged
891
+ // into a summary — collapsing several messages loses the user's intent.
892
+ function drainSteering(thread_id) {
893
+ const run = runs.get(thread_id);
894
+ if (!run || run.steering.length === 0) return [];
895
+ return run.steering.splice(0, run.steering.length);
896
+ }
897
+ // Abort every currently-running run. Used by the graceful-shutdown path so
898
+ // LangGraph stream loops bail out instead of continuing past process exit.
899
+ // Returns the number of runs that were signalled.
900
+ function abortAllRuns(reason = "server_shutdown") {
901
+ let count = 0;
902
+ for (const run of runs.values()){
903
+ if (run.status !== "running") continue;
904
+ if (run.abort.signal.aborted) continue;
905
+ try {
906
+ run.abort.abort(reason);
907
+ count++;
908
+ } catch {}
909
+ }
910
+ return count;
911
+ }
912
+ // Poll until every run has transitioned out of "running" (or until the
913
+ // caller-supplied deadline elapses). Used during graceful shutdown after
914
+ // `abortAllRuns()` so the stream `finally` blocks have a chance to flush
915
+ // the trailing error chunk and call `finishRun()`. Resolves to the count
916
+ // of runs still stuck in "running" when the deadline hit (0 = clean).
917
+ async function waitForRunsToSettle(timeoutMs) {
918
+ const deadline = Date.now() + Math.max(0, timeoutMs);
919
+ while(Date.now() < deadline){
920
+ let stillRunning = 0;
921
+ for (const run of runs.values())if (run.status === "running") stillRunning++;
922
+ if (stillRunning === 0) return 0;
923
+ await new Promise((resolve)=>setTimeout(resolve, 50));
924
+ }
925
+ let stillRunning = 0;
926
+ for (const run of runs.values())if (run.status === "running") stillRunning++;
927
+ return stillRunning;
928
+ }
929
+ // Replays buffered events synchronously, then subscribes for live ones.
930
+ // Returns an unsubscribe fn. Caller is responsible for calling it.
931
+ function subscribe(thread_id, onEvent) {
932
+ const run = runs.get(thread_id);
933
+ if (!run) return {
934
+ run: null,
935
+ unsubscribe: ()=>{}
936
+ };
937
+ // Replay buffered events first (so the new subscriber catches up).
938
+ for (const ev of run.events){
939
+ try {
940
+ onEvent(ev);
941
+ } catch {}
942
+ }
943
+ if (run.status !== "running") {
944
+ return {
945
+ run,
946
+ unsubscribe: ()=>{}
947
+ };
948
+ }
949
+ run.subscribers.add(onEvent);
950
+ return {
951
+ run,
952
+ unsubscribe: ()=>{
953
+ run.subscribers.delete(onEvent);
954
+ }
955
+ };
956
+ }
957
+
958
+
959
+ /***/ })
960
+
961
+ };
962
+ ;
963
+ //# sourceMappingURL=5120.js.map