@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
@@ -24,6 +24,573 @@ module.exports = require("node:process");
24
24
 
25
25
  module.exports = require("url");
26
26
 
27
+ /***/ }),
28
+
29
+ /***/ 3979:
30
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
31
+
32
+
33
+ // EXPORTS
34
+ __webpack_require__.d(__webpack_exports__, {
35
+ AX: () => (/* binding */ getBridgeRuntimeStatus),
36
+ HQ: () => (/* binding */ isBridgeRunning),
37
+ FN: () => (/* binding */ listBridgeChats),
38
+ qM: () => (/* binding */ lookupBridgeChat),
39
+ s: () => (/* binding */ removeBridgeAuth),
40
+ V_: () => (/* binding */ repairBridge),
41
+ kn: () => (/* binding */ startAllBridges),
42
+ c0: () => (/* binding */ startBridge),
43
+ aq: () => (/* binding */ stopBridge)
44
+ });
45
+
46
+ // UNUSED EXPORTS: restartBridge, stopAllBridges
47
+
48
+ // EXTERNAL MODULE: ./lib/stores/bridges.ts
49
+ var bridges = __webpack_require__(78361);
50
+ // EXTERNAL MODULE: ./lib/notifications/bus.ts
51
+ var bus = __webpack_require__(76445);
52
+ // EXTERNAL MODULE: ./lib/utils/global-state.ts
53
+ var global_state = __webpack_require__(15559);
54
+ // EXTERNAL MODULE: ./lib/stores/threads.ts
55
+ var threads = __webpack_require__(83042);
56
+ // EXTERNAL MODULE: ./lib/stores/agent-configs.ts
57
+ var agent_configs = __webpack_require__(41720);
58
+ // EXTERNAL MODULE: ./lib/agents/agent-turn.ts
59
+ var agent_turn = __webpack_require__(62032);
60
+ ;// ./lib/bridges/router.ts
61
+
62
+ /**
63
+ * Resolve which agent should handle an inbound message on (bridge, remote_jid).
64
+ * 0) Chat is on the ignore list → null (message dropped before any agent
65
+ * thread, memory write, or tool call runs — the "listen to everything
66
+ * except these chats" primitive).
67
+ * 1) Exact route match on (bridge_id, remote_jid)
68
+ * 2) Bridge-level catch-all route (`remote_jid='*'`) when present
69
+ * 3) null (dispatcher drops the message silently)
70
+ *
71
+ * Catch-all lets one agent handle all otherwise-unrouted chats on a bridge.
72
+ * This is especially useful for "triage" or "observer" agents. The ignore
73
+ * list is checked FIRST so it wins over both explicit routes and the
74
+ * catch-all — deleting an ignore entry is how you "resume listening".
75
+ */ function resolveRoute(bridge_id, remote_jid) {
76
+ if ((0,bridges/* isIgnored */.pi)(bridge_id, remote_jid)) return null;
77
+ return (0,bridges/* findRoute */.$6)(bridge_id, remote_jid) ?? (0,bridges/* findRoute */.$6)(bridge_id, "*");
78
+ }
79
+
80
+ // EXTERNAL MODULE: ./lib/utils/source-link.ts
81
+ var source_link = __webpack_require__(12262);
82
+ ;// ./lib/bridges/message-role.ts
83
+ /**
84
+ * Cross-adapter framing for bridge inbound messages.
85
+ *
86
+ * Bridge conversations are inherently multi-party: the paired user, one or
87
+ * more counterparts (1:1 partner or group members), and the agent that's
88
+ * observing/assisting. Without role framing, the LLM tends to read every
89
+ * inbound message as a direct command — even when the message was sent by
90
+ * the user's chat partner, who has no idea an agent is in the loop.
91
+ *
92
+ * This module is the single source of truth for that framing. Every bridge
93
+ * adapter (WhatsApp today; Telegram/Slack/Discord/email tomorrow) populates
94
+ * `InboundMessage.role` with one of these values, and the dispatcher feeds
95
+ * the message through `formatBridgePrompt` to produce the prefix the agent
96
+ * sees. Adding a new adapter is a matter of mapping its platform-specific
97
+ * "who sent this" signal onto `MessageRole`; the framing code does not need
98
+ * to change.
99
+ */
100
+ /**
101
+ * Build the prompt prefix the agent receives for one bridge-inbound message.
102
+ *
103
+ * Output shape:
104
+ *
105
+ * <one-line semantic note framing the role>
106
+ *
107
+ * [bridge:<id>]
108
+ * [chat_id:<id>]
109
+ * [chat_name:<label>]
110
+ * [chat_type:dm|group]
111
+ * [message_role:user|counterpart|agent]
112
+ * [sender_id:<id>]
113
+ * [sender_name:<label>]
114
+ * ([chat_link:<https url>] when the platform has a permalink for the chat)
115
+ * ([group_name:<label>] [participant_id:<id>] [participant_name:<label>] for groups)
116
+ *
117
+ * <raw text>
118
+ *
119
+ * The metadata block is keyed-tag for parseability; the leading note is
120
+ * prose so the LLM has an explicit framing without having to learn the
121
+ * convention. Both are stable across adapters.
122
+ */ function formatBridgePrompt(input) {
123
+ const note = roleNote(input.role, input.is_group, input.silent === true, input.event);
124
+ // Header values come from the platform (display names, group subjects) and
125
+ // are sender-controlled: a line break would forge extra headers or end the
126
+ // header block early, so every value is flattened onto one line.
127
+ const h = (value)=>String(value ?? "").replace(/[\r\n\u0085\u2028\u2029]+/g, " ");
128
+ const lines = [
129
+ `[bridge:${h(input.bridge_id)}]`,
130
+ `[chat_id:${h(input.chat_id)}]`,
131
+ `[chat_name:${h(input.chat_name)}]`,
132
+ `[chat_type:${input.is_group ? "group" : "dm"}]`,
133
+ `[message_role:${input.role}]`,
134
+ `[sender_id:${h(input.sender_id)}]`,
135
+ `[sender_name:${h(input.sender_name)}]`
136
+ ];
137
+ const chatLink = (0,source_link/* httpsUrlOrNull */.N)(input.chat_link);
138
+ if (chatLink) lines.push(`[chat_link:${chatLink}]`);
139
+ if (input.event) {
140
+ lines.push(`[event_type:${input.event.type}]`);
141
+ lines.push(`[event_subtype:${h(input.event.subtype)}]`);
142
+ }
143
+ if (input.is_group) {
144
+ lines.push(`[group_name:${h(input.chat_name)}]`);
145
+ lines.push(`[participant_id:${h(input.sender_id)}]`);
146
+ lines.push(`[participant_name:${h(input.sender_name)}]`);
147
+ }
148
+ return `${note}\n\n${lines.join("\n")}\n\n${input.text}`;
149
+ }
150
+ // Parses bridge prompt envelopes rendered by formatBridgePrompt().
151
+ // Back-compat: also accepts legacy keys (chat_jid/sender_jid) and optional
152
+ // prose preface before the [bridge:...] metadata block.
153
+ function parseBridgePrompt(raw) {
154
+ const start = raw.indexOf("[bridge:");
155
+ if (start < 0) return null;
156
+ const src = raw.slice(start);
157
+ const headers = {};
158
+ const lines = src.split("\n");
159
+ let i = 0;
160
+ for(; i < lines.length; i++){
161
+ const line = lines[i].replace(/\r$/, "");
162
+ if (line === "") {
163
+ i++;
164
+ break;
165
+ }
166
+ const m = /^\[([a-z_]+):([\s\S]*)\]$/.exec(line);
167
+ if (!m) return null;
168
+ headers[m[1]] = m[2];
169
+ }
170
+ const chatId = headers.chat_id || headers.chat_jid;
171
+ const senderId = headers.sender_id || headers.sender_jid || chatId;
172
+ if (!headers.bridge || !chatId || !headers.chat_type) return null;
173
+ return {
174
+ bridgeId: headers.bridge,
175
+ chatJid: chatId,
176
+ chatName: headers.chat_name || chatId,
177
+ isGroup: headers.chat_type === "group",
178
+ senderJid: senderId,
179
+ senderName: headers.sender_name || senderId || "Unknown",
180
+ chatLink: httpsUrlOrNull(headers.chat_link),
181
+ body: lines.slice(i).join("\n").trimEnd()
182
+ };
183
+ }
184
+ function roleNote(role, isGroup, silent, event) {
185
+ if (event) {
186
+ const evt = event.type === "group_profile_update" ? "group profile/settings update" : "group participant update";
187
+ return `The payload below is a ${evt} (${event.subtype}) emitted by the platform, not a normal chat message typed by a participant. ` + "Use it as conversation state/context. Do not assume someone is directly addressing you unless your instructions explicitly require replying to system events.";
188
+ }
189
+ if (silent) {
190
+ // Observer mode overrides the per-role framing: the agent is forbidden
191
+ // from speaking on the chat regardless of who sent the inbound message.
192
+ // It may still use the event as context and take non-chat actions that
193
+ // its normal instructions require.
194
+ if (role === "agent") {
195
+ return "The message below is your own prior output, surfaced again because the bridge adapter could not suppress its echo. Use it only as a record of what you previously said — do not respond to it.";
196
+ }
197
+ return "Silent / observer mode is enabled for this route. You are standing on the paired user's side and listening to the chat for context, memory, risk, or tasks that matter to the paired user's instructions. " + "Do not write to the chat, draft a chat reply, imitate a participant, or answer the sender conversationally. " + "Act only through allowed non-chat tools or internal state when your normal instructions require it. " + "Most observed messages need no visible response: if there is no important internal note, risk, or user-actionable item for the paired user inside Jarela, reply with exactly the single token NO_REPLY and nothing else.";
198
+ }
199
+ switch(role){
200
+ case "user":
201
+ return "The paired user themselves sent the message below in this conversation. Treat it as the user's own reaction/input to the prior chat — they are speaking to the other party, not directly to you. Use it to update your understanding of the user's intent.";
202
+ case "counterpart":
203
+ return isGroup ? "The message below was sent by another member of this group chat, addressed to the paired user. Respond on the user's behalf, in their voice, following your agent instructions and persona — do not introduce yourself as an assistant or break character. If your instructions tell you to stay silent or escalate to the user, do that instead." : "The message below was sent by the user's counterpart in this 1:1 chat, addressed to the paired user. Respond on the user's behalf, in their voice, following your agent instructions and persona — do not introduce yourself as an assistant or break character. If your instructions tell you to stay silent or escalate to the user, do that instead.";
204
+ case "agent":
205
+ return "The message below is your own prior output, surfaced again because the bridge adapter could not suppress its echo. Use it only as a record of what you previously said — do not respond to it.";
206
+ }
207
+ }
208
+
209
+ // EXTERNAL MODULE: ./lib/utils/error.ts
210
+ var error = __webpack_require__(22032);
211
+ // EXTERNAL MODULE: ./lib/agents/run-queue.ts
212
+ var run_queue = __webpack_require__(3944);
213
+ // EXTERNAL MODULE: ./lib/stores/automation-activity.ts
214
+ var automation_activity = __webpack_require__(26316);
215
+ ;// ./lib/bridges/dispatcher.ts
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+ /**
227
+ * Handle one inbound message from a bridge adapter:
228
+ * 1. Resolve the chat → agent route. Unrouted → publish an advisory
229
+ * event and drop. No thread created, no reply sent.
230
+ * 2. Use `getOrCreateAgentThread(agent_id)` (one-thread-per-agent
231
+ * invariant — `UNIQUE(agent_id)` on bridge_routes ensures no chat
232
+ * interleaving).
233
+ * 3. Drive the agent via the canonical `runAgentTurn` helper used by
234
+ * every external context turn.
235
+ * 4. Persist the assistant message and send the reply back through the
236
+ * adapter on the originating channel.
237
+ *
238
+ * Top-level try/catch — adapter callbacks must never throw into the Baileys
239
+ * socket event handler (would tear down the WS).
240
+ */ async function handleInboundMessage(adapter, msg) {
241
+ try {
242
+ const route = resolveRoute(adapter.bridge_id, msg.remote_jid);
243
+ if (!route) {
244
+ // Unrouted chats are silently dropped. We intentionally do NOT publish
245
+ // a notification here — the user already declared "this chat isn't
246
+ // monitored" by not configuring a route, so popping a toast for every
247
+ // inbound message in an active group would be noise. The console log
248
+ // remains for debugging; the chat picker in BridgeEditor still shows
249
+ // observed chats so a route can be added on demand.
250
+ console.log(`[bridge ${adapter.bridge_id}] dropped: no route for ${msg.remote_jid} (${msg.push_name ?? "?"})`);
251
+ return;
252
+ }
253
+ const agentId = route.agent_id;
254
+ const agent = (0,agent_configs/* getAgentConfig */.mJ)(agentId);
255
+ if (!agent) {
256
+ console.warn(`[bridge ${adapter.bridge_id}] route points at missing agent ${agentId}, dropping`);
257
+ return;
258
+ }
259
+ const thread = (0,threads/* getOrCreateAgentThread */.xH)(agentId);
260
+ // Stamp bridge/chat provenance + sender role onto every inbound prompt.
261
+ // Role framing (user / counterpart / agent) is shared across every
262
+ // bridge adapter via `formatBridgePrompt` — see lib/bridges/message-role.ts.
263
+ const chatName = msg.chat_name ?? msg.push_name ?? "unknown";
264
+ const senderJid = msg.sender_jid ?? msg.participant_jid ?? msg.remote_jid;
265
+ const senderName = msg.sender_name ?? msg.push_name ?? senderJid;
266
+ const silent = route.silent_mode === 1;
267
+ const willReply = !silent && msg.role === route.respond_to;
268
+ const activity = (0,automation_activity/* createAutomationActivity */.P2)({
269
+ threadId: thread.thread_id,
270
+ sourceKind: "bridge",
271
+ sourceId: `${adapter.bridge_id}:${msg.remote_jid}`,
272
+ label: `Message from ${senderName}`,
273
+ state: "checking",
274
+ detail: msg.text
275
+ });
276
+ const publishActivity = ()=>{
277
+ (0,bus/* publish */.mk)({
278
+ type: "automation_activity",
279
+ thread_id: thread.thread_id,
280
+ agent_id: agentId,
281
+ ts: Date.now()
282
+ });
283
+ };
284
+ publishActivity();
285
+ const promptText = formatBridgePrompt({
286
+ bridge_id: adapter.bridge_id,
287
+ chat_id: msg.remote_jid,
288
+ chat_name: chatName,
289
+ is_group: msg.is_group,
290
+ role: msg.role,
291
+ sender_id: senderJid,
292
+ sender_name: senderName,
293
+ chat_link: adapter.chatLink?.(msg.remote_jid) ?? null,
294
+ text: msg.text,
295
+ silent,
296
+ event: msg.event
297
+ });
298
+ const bridgeConversation = {
299
+ key: `${adapter.bridge_id}:${msg.remote_jid}`,
300
+ bridge_id: adapter.bridge_id,
301
+ chat_id: msg.remote_jid
302
+ };
303
+ // Keep typing outside the queue so users still see "thinking" while
304
+ // waiting behind other queued turns for the same thread.
305
+ let typingActive = willReply;
306
+ if (willReply) {
307
+ void adapter.sendTyping(msg.remote_jid, true).catch(()=>{});
308
+ }
309
+ const typingTimer = setInterval(()=>{
310
+ if (!typingActive) return;
311
+ void adapter.sendTyping(msg.remote_jid, true).catch(()=>{});
312
+ }, 8000);
313
+ typingTimer.unref?.();
314
+ let reply = "";
315
+ let suppressAssistant = false;
316
+ let aborted = false;
317
+ try {
318
+ // Surface the bridge kind+name in the system prompt so the agent
319
+ // knows it's answering on e.g. WhatsApp — fixes the "I don't have
320
+ // access to WhatsApp" reply on bridge-delivered turns. Falls back
321
+ // to bridge_id when the row was deleted between fetch and dispatch.
322
+ const bridge = (0,bridges/* getBridge */.e1)(adapter.bridge_id);
323
+ let result;
324
+ try {
325
+ result = await (0,agent_turn.runAgentTurn)({
326
+ thread_id: thread.thread_id,
327
+ queue_source: "bridge",
328
+ message: promptText,
329
+ attachments: msg.attachments,
330
+ user_category: "bridge",
331
+ assistant_category: "bridge",
332
+ user_message_metadata: {
333
+ bridge_conversation: bridgeConversation
334
+ },
335
+ assistant_message_metadata: {
336
+ bridge_conversation: bridgeConversation
337
+ },
338
+ history_bridge_key: bridgeConversation.key,
339
+ silent,
340
+ queue_lane: willReply ? "interactive" : "background",
341
+ queue_expires_at: willReply ? undefined : Date.now() + 5 * 60000,
342
+ on_queue_state: (state)=>{
343
+ (0,automation_activity/* updateAutomationActivity */.ou)(activity.msg_id, {
344
+ state: state === "queued" ? "queued" : "checking"
345
+ });
346
+ publishActivity();
347
+ },
348
+ delivery_channel: {
349
+ kind: bridge?.kind ?? "bridge",
350
+ name: bridge?.name ?? null
351
+ }
352
+ });
353
+ } catch (err) {
354
+ if (err instanceof run_queue/* QueueExpiredError */.vR) {
355
+ (0,automation_activity/* finalizeAutomationActivity */.lU)(activity.msg_id, {
356
+ disposition: "expired"
357
+ });
358
+ publishActivity();
359
+ return;
360
+ }
361
+ (0,automation_activity/* finalizeAutomationActivity */.lU)(activity.msg_id, {
362
+ disposition: "failed",
363
+ error: (0,error/* errorMessage */.g)(err)
364
+ });
365
+ publishActivity();
366
+ throw err;
367
+ }
368
+ reply = result.assistantContent.trim();
369
+ suppressAssistant = result.skippedAssistant;
370
+ aborted = result.aborted;
371
+ } finally{
372
+ typingActive = false;
373
+ clearInterval(typingTimer);
374
+ if (willReply) {
375
+ void adapter.sendTyping(msg.remote_jid, false).catch(()=>{});
376
+ }
377
+ }
378
+ // Outbound reply gate: silent_mode (master switch) AND respond_to
379
+ // (per-role trigger). Both must clear for a message to leave the
380
+ // dispatcher. The WhatsApp adapter also re-checks `route.silent_mode`
381
+ // inside its own sendText as a belt-and-suspenders guard, so even a
382
+ // tool that called adapter.sendText directly would be dropped.
383
+ let sendError = null;
384
+ if (reply.length > 0 && willReply) {
385
+ try {
386
+ await adapter.sendText(msg.remote_jid, reply);
387
+ } catch (sendErr) {
388
+ const m = (0,error/* errorMessage */.g)(sendErr);
389
+ sendError = m;
390
+ console.error(`[bridge ${adapter.bridge_id}] sendText failed:`, m);
391
+ }
392
+ }
393
+ (0,automation_activity/* finalizeAutomationActivity */.lU)(activity.msg_id, aborted ? {
394
+ disposition: "cancelled"
395
+ } : sendError ? {
396
+ disposition: "failed",
397
+ error: sendError
398
+ } : {
399
+ disposition: reply.length > 0 && !suppressAssistant ? "action" : "no_action",
400
+ preview: suppressAssistant ? undefined : reply.replace(/\s+/g, " ").slice(0, 120)
401
+ });
402
+ publishActivity();
403
+ if (!silent || !suppressAssistant) {
404
+ (0,bus/* publish */.mk)({
405
+ type: "bridge_message_received",
406
+ bridge_id: adapter.bridge_id,
407
+ remote_jid: msg.remote_jid,
408
+ push_name: msg.push_name,
409
+ is_group: msg.is_group,
410
+ thread_id: thread.thread_id,
411
+ agent_id: agentId,
412
+ preview: suppressAssistant ? "" : reply.replace(/\s+/g, " ").slice(0, 120),
413
+ ts: Date.now()
414
+ });
415
+ }
416
+ } catch (err) {
417
+ const m = (0,error/* errorMessage */.g)(err);
418
+ console.error(`[bridge ${adapter.bridge_id}] dispatcher error on ${msg.remote_jid}:`, m);
419
+ }
420
+ }
421
+
422
+ // EXTERNAL MODULE: ./lib/bridges/registry.ts + 5 modules
423
+ var registry = __webpack_require__(70309);
424
+ ;// ./lib/bridges/runtime.ts
425
+ /**
426
+ * Bridge lifecycle manager.
427
+ *
428
+ * Owns a `Map<bridge_id, BridgeAdapter>` plus a `Map<bridge_id, StatusUpdate>`
429
+ * of the latest known status per bridge (so the HTTP status endpoint can
430
+ * return live QR / connection state without consulting the adapter directly).
431
+ *
432
+ * - `startAllBridges()` — called at app boot; scans `bridges` for
433
+ * `enabled=1` rows and spins up their adapters.
434
+ * - `startBridge(id)` / `stopBridge(id)` / `restartBridge(id)` — called from
435
+ * the HTTP layer (toggle enabled, re-pair, delete).
436
+ *
437
+ * Pinned to globalThis so dev HMR doesn't double-start (same pattern as
438
+ * lib/scheduler/index.ts).
439
+ */
440
+
441
+
442
+
443
+
444
+
445
+ const state = (0,global_state/* getOrCreateGlobal */.X)("__jarela_bridges", ()=>({
446
+ adapters: new Map(),
447
+ status: new Map(),
448
+ started: false
449
+ }));
450
+ function makeAdapter(bridge_id, kind) {
451
+ const bridgeModule = (0,registry/* getBridgeModule */.ut)(kind);
452
+ if (!bridgeModule) throw new Error(`Unknown bridge kind: ${kind}`);
453
+ return bridgeModule.createAdapter(bridge_id);
454
+ }
455
+ async function removeBridgeAuth(bridge_id) {
456
+ const bridge = (0,bridges/* getBridge */.e1)(bridge_id);
457
+ if (!bridge) return;
458
+ await (0,registry/* getBridgeModule */.ut)(bridge.kind)?.removeAuth(bridge_id);
459
+ }
460
+ function wireAdapter(adapter) {
461
+ adapter.onInboundMessage((msg)=>handleInboundMessage(adapter, msg));
462
+ adapter.onStatusChange((update)=>{
463
+ state.status.set(adapter.bridge_id, update);
464
+ // Persist the user-visible bits so they survive a process restart.
465
+ const patch = {
466
+ status: update.status,
467
+ qr: update.qr_data_url ?? null,
468
+ last_error: update.error ?? null
469
+ };
470
+ if (update.paired_id !== undefined) patch.paired_id = update.paired_id;
471
+ (0,bridges/* updateBridge */.po)(adapter.bridge_id, patch);
472
+ (0,bus/* publish */.mk)({
473
+ type: "bridge_status",
474
+ bridge_id: adapter.bridge_id,
475
+ status: update.status,
476
+ error: update.error ?? null,
477
+ paired_id: update.paired_id ?? null,
478
+ ts: Date.now()
479
+ });
480
+ });
481
+ }
482
+ async function startBridge(bridge_id) {
483
+ if (state.adapters.has(bridge_id)) return;
484
+ const row = (0,bridges/* getBridge */.e1)(bridge_id);
485
+ if (!row) throw new Error(`Bridge ${bridge_id} not found`);
486
+ const adapter = makeAdapter(bridge_id, row.kind);
487
+ state.adapters.set(bridge_id, adapter);
488
+ wireAdapter(adapter);
489
+ try {
490
+ await adapter.start();
491
+ } catch (err) {
492
+ state.adapters.delete(bridge_id);
493
+ const m = (0,error/* errorMessage */.g)(err);
494
+ (0,bridges/* updateBridge */.po)(bridge_id, {
495
+ status: "error",
496
+ last_error: m
497
+ });
498
+ throw err;
499
+ }
500
+ }
501
+ async function stopBridge(bridge_id) {
502
+ const adapter = state.adapters.get(bridge_id);
503
+ state.adapters.delete(bridge_id);
504
+ state.status.delete(bridge_id);
505
+ if (adapter) {
506
+ try {
507
+ await adapter.stop();
508
+ } catch (err) {
509
+ console.error(`[bridge ${bridge_id}] stop failed:`, err);
510
+ }
511
+ }
512
+ // Persist that the bridge is down (in case status callback didn't fire).
513
+ (0,bridges/* updateBridge */.po)(bridge_id, {
514
+ status: "disconnected",
515
+ qr: null
516
+ });
517
+ }
518
+ async function restartBridge(bridge_id) {
519
+ await stopBridge(bridge_id);
520
+ await startBridge(bridge_id);
521
+ }
522
+ async function repairBridge(bridge_id) {
523
+ const bridge = (0,bridges/* getBridge */.e1)(bridge_id);
524
+ if (!bridge) throw new Error(`Bridge ${bridge_id} not found`);
525
+ const bridgeModule = (0,registry/* getBridgeModule */.ut)(bridge.kind);
526
+ if (!bridgeModule?.pairing) throw new Error(`Bridge kind "${bridge.kind}" does not support pairing`);
527
+ await stopBridge(bridge_id);
528
+ await bridgeModule.removeAuth(bridge_id);
529
+ (0,bridges/* updateBridge */.po)(bridge_id, {
530
+ status: "disconnected",
531
+ qr: null,
532
+ last_error: null,
533
+ paired_id: null
534
+ });
535
+ await startBridge(bridge_id);
536
+ }
537
+ function getBridgeRuntimeStatus(bridge_id) {
538
+ return state.status.get(bridge_id) ?? null;
539
+ }
540
+ function isBridgeRunning(bridge_id) {
541
+ return state.adapters.has(bridge_id);
542
+ }
543
+ /**
544
+ * Snapshot of chats the adapter has observed since connecting. Returns []
545
+ * when the bridge isn't running yet. Triggers a background refresh so that
546
+ * subsequent calls see newly-fetched group metadata.
547
+ */ function listBridgeChats(bridge_id) {
548
+ const adapter = state.adapters.get(bridge_id);
549
+ if (!adapter?.listChats) return [];
550
+ // Fire-and-forget — refreshChats hits a WS round-trip; HTTP shouldn't
551
+ // wait. The next poll will pick up any new entries.
552
+ void adapter.refreshChats?.().catch(()=>{});
553
+ return adapter.listChats();
554
+ }
555
+ /**
556
+ * Look up a freeform phone number (or other identifier) against the bridge
557
+ * and return the resolved chat if it exists, else null. Returns null also
558
+ * if the bridge isn't running.
559
+ */ async function lookupBridgeChat(bridge_id, input) {
560
+ const adapter = state.adapters.get(bridge_id);
561
+ if (!adapter?.lookupChat) return null;
562
+ return adapter.lookupChat(input);
563
+ }
564
+ /**
565
+ * Boot hook. Idempotent — safe to call from a layout module that may be
566
+ * evaluated multiple times in Next.js dev HMR.
567
+ */ async function startAllBridges() {
568
+ if (state.started) return;
569
+ state.started = true;
570
+ const rows = (0,bridges/* listBridges */.X9)();
571
+ for (const row of rows){
572
+ if (row.enabled !== 1) continue;
573
+ try {
574
+ await startBridge(row.id);
575
+ } catch (err) {
576
+ const m = (0,error/* errorMessage */.g)(err);
577
+ console.error(`[bridge ${row.id}] failed to start at boot:`, m);
578
+ // updateBridge already happened inside startBridge's catch.
579
+ }
580
+ }
581
+ }
582
+ // Stop every running bridge. Called from the graceful-shutdown path so
583
+ // WhatsApp WS sockets etc. close cleanly before the process exits. We
584
+ // await in parallel — a single slow `adapter.stop()` shouldn't gate the
585
+ // others — but the whole call is still bounded by the outer shutdown
586
+ // timeout in `lib/lifecycle/shutdown.ts`.
587
+ async function stopAllBridges() {
588
+ const ids = Array.from(state.adapters.keys());
589
+ await Promise.allSettled(ids.map((id)=>stopBridge(id)));
590
+ state.started = false;
591
+ }
592
+
593
+
27
594
  /***/ }),
28
595
 
29
596
  /***/ 8128:
@@ -54,7 +621,183 @@ module.exports = require("assert");
54
621
 
55
622
  /***/ }),
56
623
 
57
- /***/ 15903:
624
+ /***/ 16602:
625
+ /***/ ((module) => {
626
+
627
+ module.exports = import("@whiskeysockets/baileys");;
628
+
629
+ /***/ }),
630
+
631
+ /***/ 16698:
632
+ /***/ ((module) => {
633
+
634
+ module.exports = require("node:async_hooks");
635
+
636
+ /***/ }),
637
+
638
+ /***/ 18470:
639
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
640
+
641
+ __webpack_require__.r(__webpack_exports__);
642
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
643
+ /* harmony export */ GET: () => (/* binding */ GET)
644
+ /* harmony export */ });
645
+ /* harmony import */ var _lib_notifications_bus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76445);
646
+ /* harmony import */ var _lib_scheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69428);
647
+ /* harmony import */ var _lib_bridges_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3979);
648
+ /* harmony import */ var _lib_api_sse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53854);
649
+ /* harmony import */ var _lib_crypto_master_key__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28226);
650
+ /**
651
+ * @public — `GET /api/v1/events` (Server-Sent Events)
652
+ *
653
+ * Live notification stream — run completion, watcher fires, queue
654
+ * progress, etc. UI subscribes here for real-time updates; external
655
+ * scripts can subscribe over the same SSE wire format. See `docs/api.md`.
656
+ */
657
+
658
+
659
+
660
+
661
+ const enc = new TextEncoder();
662
+ const sse = (obj)=>enc.encode(`data: ${JSON.stringify(obj)}\n\n`);
663
+ // Long-lived SSE stream of app events (run completions, scheduled-task fires).
664
+ // The browser subscribes once on app boot and renders Web Notifications.
665
+ // Pass `?since=<unixMs>` to replay events newer than a timestamp on reconnect.
666
+ function GET(req) {
667
+ // Wake the scheduler on every SSE subscription. Cheap (idempotent), and
668
+ // guarantees a freshly-loaded dev server has a ticking scheduler the
669
+ // moment the UI opens its event stream — before this, the scheduler was
670
+ // only started lazily on the first agent run, so a server restart could
671
+ // leave scheduled tasks dormant until you sent a chat message.
672
+ (0,_lib_scheduler__WEBPACK_IMPORTED_MODULE_1__/* .startScheduler */ .wP)();
673
+ // Bring up enabled bridges (WhatsApp adapters). Idempotent — runtime.ts
674
+ // pins state to globalThis so this is a no-op after the first call.
675
+ // Fire-and-forget: bridge connect can take seconds, the SSE stream below
676
+ // mustn't block waiting for WebSocket handshakes.
677
+ //
678
+ // Defer past the PIN unlock when locked (ADR-0063): startAllBridges
679
+ // reads encrypted credentials and would throw MasterKeyLockedError.
680
+ const launchBridges = ()=>{
681
+ void (0,_lib_bridges_runtime__WEBPACK_IMPORTED_MODULE_2__/* .startAllBridges */ .kn)().catch((err)=>{
682
+ console.error("[bridges] startAllBridges failed:", err);
683
+ });
684
+ };
685
+ if ((0,_lib_crypto_master_key__WEBPACK_IMPORTED_MODULE_3__/* .isMasterKeyLocked */ .wL)()) {
686
+ (0,_lib_crypto_master_key__WEBPACK_IMPORTED_MODULE_3__/* .onMasterKeyUnlocked */ .um)(launchBridges);
687
+ } else {
688
+ launchBridges();
689
+ }
690
+ const url = new URL(req.url);
691
+ const sinceTs = Number(url.searchParams.get("since")) || 0;
692
+ const stream = new ReadableStream({
693
+ start (controller) {
694
+ let alive = true;
695
+ const safeEnqueue = (chunk)=>{
696
+ if (!alive) return;
697
+ try {
698
+ controller.enqueue(chunk);
699
+ } catch {
700
+ alive = false;
701
+ }
702
+ };
703
+ // Replay anything missed since the client's last seen timestamp.
704
+ for (const ev of (0,_lib_notifications_bus__WEBPACK_IMPORTED_MODULE_0__/* .recentSince */ ._2)(sinceTs)){
705
+ safeEnqueue(sse({
706
+ ...ev
707
+ }));
708
+ }
709
+ // Subscribe to live events.
710
+ const unsubscribe = (0,_lib_notifications_bus__WEBPACK_IMPORTED_MODULE_0__/* .subscribe */ .B1)((ev)=>{
711
+ safeEnqueue(sse({
712
+ ...ev
713
+ }));
714
+ });
715
+ // Heartbeat so intermediate proxies don't time out the connection.
716
+ const heartbeat = setInterval(()=>{
717
+ safeEnqueue(enc.encode(": heartbeat\n\n"));
718
+ }, 30000);
719
+ heartbeat.unref?.();
720
+ const cleanup = ()=>{
721
+ alive = false;
722
+ clearInterval(heartbeat);
723
+ unsubscribe();
724
+ try {
725
+ controller.close();
726
+ } catch {}
727
+ };
728
+ req.signal.addEventListener("abort", cleanup);
729
+ },
730
+ cancel () {}
731
+ });
732
+ return (0,_lib_api_sse__WEBPACK_IMPORTED_MODULE_4__/* .sseResponse */ .t)(stream, {
733
+ disableProxyBuffering: false
734
+ });
735
+ }
736
+
737
+
738
+ /***/ }),
739
+
740
+ /***/ 19225:
741
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
742
+
743
+
744
+ if (false) {} else {
745
+ if (false) {} else {
746
+ if (false) {} else {
747
+ if (false) {} else {
748
+ module.exports = __webpack_require__(44870);
749
+ }
750
+ }
751
+ }
752
+ }
753
+
754
+ //# sourceMappingURL=module.compiled.js.map
755
+
756
+ /***/ }),
757
+
758
+ /***/ 27910:
759
+ /***/ ((module) => {
760
+
761
+ module.exports = require("stream");
762
+
763
+ /***/ }),
764
+
765
+ /***/ 28354:
766
+ /***/ ((module) => {
767
+
768
+ module.exports = require("util");
769
+
770
+ /***/ }),
771
+
772
+ /***/ 29021:
773
+ /***/ ((module) => {
774
+
775
+ module.exports = require("fs");
776
+
777
+ /***/ }),
778
+
779
+ /***/ 29294:
780
+ /***/ ((module) => {
781
+
782
+ module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
783
+
784
+ /***/ }),
785
+
786
+ /***/ 31421:
787
+ /***/ ((module) => {
788
+
789
+ module.exports = require("node:child_process");
790
+
791
+ /***/ }),
792
+
793
+ /***/ 33873:
794
+ /***/ ((module) => {
795
+
796
+ module.exports = require("path");
797
+
798
+ /***/ }),
799
+
800
+ /***/ 36349:
58
801
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
59
802
 
60
803
  __webpack_require__.r(__webpack_exports__);
@@ -496,182 +1239,6 @@ async function handler(req, res, ctx) {
496
1239
  //# sourceMappingURL=app-route.js.map
497
1240
 
498
1241
 
499
- /***/ }),
500
-
501
- /***/ 16602:
502
- /***/ ((module) => {
503
-
504
- module.exports = import("@whiskeysockets/baileys");;
505
-
506
- /***/ }),
507
-
508
- /***/ 16698:
509
- /***/ ((module) => {
510
-
511
- module.exports = require("node:async_hooks");
512
-
513
- /***/ }),
514
-
515
- /***/ 18470:
516
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
517
-
518
- __webpack_require__.r(__webpack_exports__);
519
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
520
- /* harmony export */ GET: () => (/* binding */ GET)
521
- /* harmony export */ });
522
- /* harmony import */ var _lib_notifications_bus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76445);
523
- /* harmony import */ var _lib_scheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69428);
524
- /* harmony import */ var _lib_bridges_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3979);
525
- /* harmony import */ var _lib_api_sse__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53854);
526
- /* harmony import */ var _lib_crypto_master_key__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28226);
527
- /**
528
- * @public — `GET /api/v1/events` (Server-Sent Events)
529
- *
530
- * Live notification stream — run completion, watcher fires, queue
531
- * progress, etc. UI subscribes here for real-time updates; external
532
- * scripts can subscribe over the same SSE wire format. See `docs/api.md`.
533
- */
534
-
535
-
536
-
537
-
538
- const enc = new TextEncoder();
539
- const sse = (obj)=>enc.encode(`data: ${JSON.stringify(obj)}\n\n`);
540
- // Long-lived SSE stream of app events (run completions, scheduled-task fires).
541
- // The browser subscribes once on app boot and renders Web Notifications.
542
- // Pass `?since=<unixMs>` to replay events newer than a timestamp on reconnect.
543
- function GET(req) {
544
- // Wake the scheduler on every SSE subscription. Cheap (idempotent), and
545
- // guarantees a freshly-loaded dev server has a ticking scheduler the
546
- // moment the UI opens its event stream — before this, the scheduler was
547
- // only started lazily on the first agent run, so a server restart could
548
- // leave scheduled tasks dormant until you sent a chat message.
549
- (0,_lib_scheduler__WEBPACK_IMPORTED_MODULE_1__/* .startScheduler */ .wP)();
550
- // Bring up enabled bridges (WhatsApp adapters). Idempotent — runtime.ts
551
- // pins state to globalThis so this is a no-op after the first call.
552
- // Fire-and-forget: bridge connect can take seconds, the SSE stream below
553
- // mustn't block waiting for WebSocket handshakes.
554
- //
555
- // Defer past the PIN unlock when locked (ADR-0063): startAllBridges
556
- // reads encrypted credentials and would throw MasterKeyLockedError.
557
- const launchBridges = ()=>{
558
- void (0,_lib_bridges_runtime__WEBPACK_IMPORTED_MODULE_2__/* .startAllBridges */ .kn)().catch((err)=>{
559
- console.error("[bridges] startAllBridges failed:", err);
560
- });
561
- };
562
- if ((0,_lib_crypto_master_key__WEBPACK_IMPORTED_MODULE_3__/* .isMasterKeyLocked */ .wL)()) {
563
- (0,_lib_crypto_master_key__WEBPACK_IMPORTED_MODULE_3__/* .onMasterKeyUnlocked */ .um)(launchBridges);
564
- } else {
565
- launchBridges();
566
- }
567
- const url = new URL(req.url);
568
- const sinceTs = Number(url.searchParams.get("since")) || 0;
569
- const stream = new ReadableStream({
570
- start (controller) {
571
- let alive = true;
572
- const safeEnqueue = (chunk)=>{
573
- if (!alive) return;
574
- try {
575
- controller.enqueue(chunk);
576
- } catch {
577
- alive = false;
578
- }
579
- };
580
- // Replay anything missed since the client's last seen timestamp.
581
- for (const ev of (0,_lib_notifications_bus__WEBPACK_IMPORTED_MODULE_0__/* .recentSince */ ._2)(sinceTs)){
582
- safeEnqueue(sse({
583
- ...ev
584
- }));
585
- }
586
- // Subscribe to live events.
587
- const unsubscribe = (0,_lib_notifications_bus__WEBPACK_IMPORTED_MODULE_0__/* .subscribe */ .B1)((ev)=>{
588
- safeEnqueue(sse({
589
- ...ev
590
- }));
591
- });
592
- // Heartbeat so intermediate proxies don't time out the connection.
593
- const heartbeat = setInterval(()=>{
594
- safeEnqueue(enc.encode(": heartbeat\n\n"));
595
- }, 30000);
596
- heartbeat.unref?.();
597
- const cleanup = ()=>{
598
- alive = false;
599
- clearInterval(heartbeat);
600
- unsubscribe();
601
- try {
602
- controller.close();
603
- } catch {}
604
- };
605
- req.signal.addEventListener("abort", cleanup);
606
- },
607
- cancel () {}
608
- });
609
- return (0,_lib_api_sse__WEBPACK_IMPORTED_MODULE_4__/* .sseResponse */ .t)(stream, {
610
- disableProxyBuffering: false
611
- });
612
- }
613
-
614
-
615
- /***/ }),
616
-
617
- /***/ 19225:
618
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
619
-
620
-
621
- if (false) {} else {
622
- if (false) {} else {
623
- if (false) {} else {
624
- if (false) {} else {
625
- module.exports = __webpack_require__(44870);
626
- }
627
- }
628
- }
629
- }
630
-
631
- //# sourceMappingURL=module.compiled.js.map
632
-
633
- /***/ }),
634
-
635
- /***/ 27910:
636
- /***/ ((module) => {
637
-
638
- module.exports = require("stream");
639
-
640
- /***/ }),
641
-
642
- /***/ 28354:
643
- /***/ ((module) => {
644
-
645
- module.exports = require("util");
646
-
647
- /***/ }),
648
-
649
- /***/ 29021:
650
- /***/ ((module) => {
651
-
652
- module.exports = require("fs");
653
-
654
- /***/ }),
655
-
656
- /***/ 29294:
657
- /***/ ((module) => {
658
-
659
- module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
660
-
661
- /***/ }),
662
-
663
- /***/ 31421:
664
- /***/ ((module) => {
665
-
666
- module.exports = require("node:child_process");
667
-
668
- /***/ }),
669
-
670
- /***/ 33873:
671
- /***/ ((module) => {
672
-
673
- module.exports = require("path");
674
-
675
1242
  /***/ }),
676
1243
 
677
1244
  /***/ 37067:
@@ -980,7 +1547,7 @@ module.exports = import("@huggingface/transformers");;
980
1547
  var __webpack_require__ = require("../../../../webpack-runtime.js");
981
1548
  __webpack_require__.C(exports);
982
1549
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
983
- var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,3524,9640,3175,6142,540,4955,5908,5936,424,4540,3979], () => (__webpack_exec__(15903)));
1550
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,540,4189,4955,5908,5120,1388,309], () => (__webpack_exec__(36349)));
984
1551
  module.exports = __webpack_exports__;
985
1552
 
986
1553
  })();