@circuitwall/jarela 2.2.1 → 2.3.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 (651) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +6 -5
  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 +93 -93
  22. package/.next/standalone/.next/server/app/api/v1/access/route.js +169 -169
  23. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +82 -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 +122 -122
  26. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +100 -100
  27. package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +753 -753
  28. package/.next/standalone/.next/server/app/api/v1/agents/route.js +65 -65
  29. package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +364 -364
  30. package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +802 -802
  31. package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +2 -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 +589 -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 +23 -23
  37. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +30 -30
  38. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +703 -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 +708 -135
  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 +802 -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 +739 -739
  45. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +1035 -1035
  46. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +679 -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 +804 -804
  49. package/.next/standalone/.next/server/app/api/v1/bridges/route.js +700 -700
  50. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +9 -9
  51. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/api/v1/config/route.js +85 -85
  53. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +709 -709
  54. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/api/v1/credentials/route.js +2 -2
  56. package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +10 -10
  58. package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +784 -784
  59. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +23 -23
  60. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +86 -86
  61. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +57 -57
  63. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +523 -523
  65. package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +44 -44
  66. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +65 -65
  67. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +122 -122
  69. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +37 -37
  71. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/api/v1/env/route.js +9 -9
  73. package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +368 -368
  74. package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +44 -44
  75. package/.next/standalone/.next/server/app/api/v1/events/route.js +751 -178
  76. package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/api/v1/events/test/route.js +77 -77
  78. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +763 -763
  79. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +44 -44
  81. package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +9 -9
  82. package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +65 -65
  83. package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +34 -34
  84. package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +204 -204
  85. package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +133 -133
  86. package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +106 -106
  87. package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +114 -114
  88. package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +134 -134
  89. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +690 -690
  90. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +93 -93
  92. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +9 -9
  94. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/v1/extensions/route.js +185 -185
  96. package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +171 -171
  98. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +396 -396
  100. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
  101. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +212 -212
  102. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +235 -235
  104. package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +26 -26
  105. package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +221 -221
  106. package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +58 -58
  107. package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +72 -72
  108. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +9 -9
  109. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
  110. package/.next/standalone/.next/server/app/api/v1/health/route.js +772 -772
  111. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +133 -133
  112. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +9 -9
  113. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
  114. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +363 -363
  115. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +233 -233
  116. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +682 -682
  117. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +879 -879
  118. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +108 -108
  119. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +952 -952
  120. package/.next/standalone/.next/server/app/api/v1/integrations/route.js +216 -216
  121. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +864 -847
  122. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js.nft.json +1 -1
  123. package/.next/standalone/.next/server/app/api/v1/local-file/route.js +26 -26
  124. package/.next/standalone/.next/server/app/api/v1/logs/route.js +70 -70
  125. package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +72 -72
  126. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +979 -979
  127. package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +196 -196
  128. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +2 -2
  129. package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +381 -381
  130. package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +79 -79
  131. package/.next/standalone/.next/server/app/api/v1/memory/route.js +51 -51
  132. package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +131 -131
  133. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +374 -369
  134. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js.nft.json +1 -1
  135. package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +143 -143
  136. package/.next/standalone/.next/server/app/api/v1/models/route.js +543 -543
  137. package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +445 -445
  138. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +120 -120
  139. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
  140. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +234 -234
  141. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +407 -407
  143. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +37 -37
  145. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +107 -107
  147. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +228 -228
  149. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +9 -9
  151. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/api/v1/packages/route.js +148 -148
  153. package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
  154. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +787 -787
  155. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
  156. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +507 -507
  157. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +181 -181
  159. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
  160. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +258 -258
  161. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
  162. package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +30 -30
  163. package/.next/standalone/.next/server/app/api/v1/profile/route.js +164 -164
  164. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +44 -44
  165. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +9 -9
  166. package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +164 -164
  167. package/.next/standalone/.next/server/app/api/v1/providers/route.js +94 -94
  168. package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +450 -450
  169. package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +37 -37
  170. package/.next/standalone/.next/server/app/api/v1/redaction/route.js +58 -58
  171. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +600 -600
  172. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +44 -44
  173. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
  174. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +732 -732
  175. package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +359 -359
  176. package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +197 -197
  177. package/.next/standalone/.next/server/app/api/v1/security/state/route.js +51 -51
  178. package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +176 -176
  179. package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +190 -190
  180. package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +26 -26
  181. package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +770 -770
  182. package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +115 -115
  183. package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +327 -327
  184. package/.next/standalone/.next/server/app/api/v1/skills/route.js +870 -870
  185. package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +838 -808
  186. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +177 -177
  187. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
  188. package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +164 -164
  189. package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +115 -115
  190. package/.next/standalone/.next/server/app/api/v1/tasks/route.js +23 -23
  191. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +1429 -0
  192. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js.nft.json +1 -0
  193. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route_client-reference-manifest.js +1 -0
  194. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +635 -634
  195. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js.nft.json +1 -1
  196. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +53 -439
  197. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js.nft.json +1 -1
  198. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +172 -172
  199. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
  200. package/.next/standalone/.next/server/app/api/v1/threads/route.js +908 -908
  201. package/.next/standalone/.next/server/app/api/v1/tools/route.js +2 -2
  202. package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
  203. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +17 -17
  204. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
  205. package/.next/standalone/.next/server/app/api/v1/update/route.js +570 -570
  206. package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +224 -224
  207. package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +975 -975
  208. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +23 -23
  209. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +72 -72
  210. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
  211. package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +128 -128
  212. package/.next/standalone/.next/server/app/api/v1/watchers/route.js +164 -164
  213. package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
  214. package/.next/standalone/.next/server/app/icon.svg/route.js +62 -62
  215. package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +436 -436
  216. package/.next/standalone/.next/server/app/page.js +1243 -854
  217. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  218. package/.next/standalone/.next/server/app/setup/page.js +91 -91
  219. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app-paths-manifest.json +6 -5
  221. package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +335 -986
  222. package/.next/standalone/.next/server/chunks/1433.js +1 -1
  223. package/.next/standalone/.next/server/chunks/1638.js +1 -2
  224. package/.next/standalone/.next/server/chunks/1738.js +1 -1
  225. package/.next/standalone/.next/server/chunks/210.js +6 -6
  226. package/.next/standalone/.next/server/chunks/2151.js +31 -1
  227. package/.next/standalone/.next/server/chunks/2207.js +1 -0
  228. package/.next/standalone/.next/server/chunks/2471.js +28 -28
  229. package/.next/standalone/.next/server/chunks/2504.js +1 -1
  230. package/.next/standalone/.next/server/chunks/2695.js +17 -17
  231. package/.next/standalone/.next/server/chunks/3042.js +14 -8
  232. package/.next/standalone/.next/server/chunks/3399.js +1 -1
  233. package/.next/standalone/.next/server/chunks/3566.js +1 -1
  234. package/.next/standalone/.next/server/chunks/4189.js +946 -0
  235. package/.next/standalone/.next/server/chunks/{9590.js → 423.js} +8 -3
  236. package/.next/standalone/.next/server/chunks/4433.js +146 -146
  237. package/.next/standalone/.next/server/chunks/4508.js +1 -1
  238. package/.next/standalone/.next/server/chunks/4588.js +1 -0
  239. package/.next/standalone/.next/server/chunks/46.js +5 -0
  240. package/.next/standalone/.next/server/chunks/466.js +12 -0
  241. package/.next/standalone/.next/server/chunks/4868.js +206 -206
  242. package/.next/standalone/.next/server/chunks/4992.js +13 -0
  243. package/.next/standalone/.next/server/chunks/5120.js +963 -0
  244. package/.next/standalone/.next/server/chunks/5701.js +1 -1
  245. package/.next/standalone/.next/server/chunks/5900.js +1 -1
  246. package/.next/standalone/.next/server/chunks/6210.js +1 -0
  247. package/.next/standalone/.next/server/chunks/6213.js +1 -1
  248. package/.next/standalone/.next/server/chunks/6649.js +2 -2
  249. package/.next/standalone/.next/server/chunks/6703.js +3 -3
  250. package/.next/standalone/.next/server/chunks/7445.js +1 -0
  251. package/.next/standalone/.next/server/chunks/8067.js +12 -0
  252. package/.next/standalone/.next/server/chunks/8461.js +14 -9
  253. package/.next/standalone/.next/server/chunks/8558.js +1 -1
  254. package/.next/standalone/.next/server/chunks/8724.js +1 -1
  255. package/.next/standalone/.next/server/chunks/8849.js +91 -91
  256. package/.next/standalone/.next/server/chunks/9032.js +6 -5
  257. package/.next/standalone/.next/server/chunks/{2563.js → 9164.js} +33173 -31461
  258. package/.next/standalone/.next/server/chunks/9237.js +396 -396
  259. package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1628 -570
  260. package/.next/standalone/.next/server/chunks/9406.js +1 -1
  261. package/.next/standalone/.next/server/chunks/9824.js +98 -98
  262. package/.next/standalone/.next/server/chunks/9826.js +1 -0
  263. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  264. package/.next/standalone/.next/server/middleware.js +415 -397
  265. package/.next/standalone/.next/server/pages/404.html +2 -2
  266. package/.next/standalone/.next/server/pages/500.html +1 -1
  267. package/.next/standalone/.next/server/preview-props.json +3 -3
  268. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  269. package/.next/standalone/.next/static/chunks/{1395-a340fb0a345382a4.js → 1395-e4a99912b8f83044.js} +13 -1
  270. package/.next/standalone/.next/static/chunks/app/_global-error/{page-36cb8b428b38b26a.js → page-6fc5f8e744c81802.js} +1 -1
  271. package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  272. package/.next/standalone/.next/static/chunks/app/api/v1/access/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  273. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  274. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6fc5f8e744c81802.js +17 -0
  275. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6fc5f8e744c81802.js +17 -0
  276. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6fc5f8e744c81802.js +17 -0
  277. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6fc5f8e744c81802.js +17 -0
  278. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6fc5f8e744c81802.js +17 -0
  279. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6fc5f8e744c81802.js +17 -0
  280. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6fc5f8e744c81802.js +17 -0
  281. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6fc5f8e744c81802.js +17 -0
  282. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6fc5f8e744c81802.js +17 -0
  283. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6fc5f8e744c81802.js +17 -0
  284. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6fc5f8e744c81802.js +17 -0
  285. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6fc5f8e744c81802.js +17 -0
  286. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6fc5f8e744c81802.js +17 -0
  287. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6fc5f8e744c81802.js +17 -0
  288. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6fc5f8e744c81802.js +17 -0
  289. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6fc5f8e744c81802.js +17 -0
  290. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6fc5f8e744c81802.js +17 -0
  291. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6fc5f8e744c81802.js +17 -0
  292. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6fc5f8e744c81802.js +17 -0
  293. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6fc5f8e744c81802.js +17 -0
  294. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6fc5f8e744c81802.js +17 -0
  295. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6fc5f8e744c81802.js +17 -0
  296. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6fc5f8e744c81802.js +17 -0
  297. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6fc5f8e744c81802.js +17 -0
  298. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6fc5f8e744c81802.js +17 -0
  299. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6fc5f8e744c81802.js +17 -0
  300. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6fc5f8e744c81802.js +17 -0
  301. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6fc5f8e744c81802.js +17 -0
  302. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6fc5f8e744c81802.js +17 -0
  303. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6fc5f8e744c81802.js +17 -0
  304. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6fc5f8e744c81802.js +17 -0
  305. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6fc5f8e744c81802.js +17 -0
  306. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6fc5f8e744c81802.js +17 -0
  307. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6fc5f8e744c81802.js +17 -0
  308. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6fc5f8e744c81802.js +17 -0
  309. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6fc5f8e744c81802.js +17 -0
  310. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6fc5f8e744c81802.js +17 -0
  311. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6fc5f8e744c81802.js +17 -0
  312. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6fc5f8e744c81802.js +17 -0
  313. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6fc5f8e744c81802.js +17 -0
  314. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6fc5f8e744c81802.js +17 -0
  315. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6fc5f8e744c81802.js +17 -0
  316. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6fc5f8e744c81802.js +17 -0
  317. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6fc5f8e744c81802.js +17 -0
  318. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6fc5f8e744c81802.js +17 -0
  319. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6fc5f8e744c81802.js +17 -0
  320. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6fc5f8e744c81802.js +17 -0
  321. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6fc5f8e744c81802.js +17 -0
  322. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6fc5f8e744c81802.js +17 -0
  323. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6fc5f8e744c81802.js +17 -0
  324. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6fc5f8e744c81802.js +17 -0
  325. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6fc5f8e744c81802.js +17 -0
  326. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6fc5f8e744c81802.js +17 -0
  327. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6fc5f8e744c81802.js +17 -0
  328. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6fc5f8e744c81802.js +17 -0
  329. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6fc5f8e744c81802.js +17 -0
  330. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6fc5f8e744c81802.js +17 -0
  331. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6fc5f8e744c81802.js +17 -0
  332. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6fc5f8e744c81802.js +17 -0
  333. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6fc5f8e744c81802.js +17 -0
  334. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6fc5f8e744c81802.js +17 -0
  335. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6fc5f8e744c81802.js +17 -0
  336. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6fc5f8e744c81802.js +17 -0
  337. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6fc5f8e744c81802.js +17 -0
  338. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6fc5f8e744c81802.js +17 -0
  339. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  340. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6fc5f8e744c81802.js +17 -0
  341. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6fc5f8e744c81802.js +17 -0
  342. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  343. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6fc5f8e744c81802.js +17 -0
  344. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6fc5f8e744c81802.js +17 -0
  345. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6fc5f8e744c81802.js +17 -0
  346. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6fc5f8e744c81802.js +17 -0
  347. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6fc5f8e744c81802.js +17 -0
  348. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6fc5f8e744c81802.js +17 -0
  349. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6fc5f8e744c81802.js +17 -0
  350. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6fc5f8e744c81802.js +17 -0
  351. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6fc5f8e744c81802.js +17 -0
  352. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6fc5f8e744c81802.js +17 -0
  353. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6fc5f8e744c81802.js +17 -0
  354. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6fc5f8e744c81802.js +17 -0
  355. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6fc5f8e744c81802.js +17 -0
  356. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6fc5f8e744c81802.js +17 -0
  357. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6fc5f8e744c81802.js +17 -0
  358. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6fc5f8e744c81802.js +17 -0
  359. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6fc5f8e744c81802.js +17 -0
  360. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6fc5f8e744c81802.js +17 -0
  361. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6fc5f8e744c81802.js +17 -0
  362. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6fc5f8e744c81802.js +17 -0
  363. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6fc5f8e744c81802.js +17 -0
  364. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6fc5f8e744c81802.js +17 -0
  365. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6fc5f8e744c81802.js +17 -0
  366. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6fc5f8e744c81802.js +17 -0
  367. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6fc5f8e744c81802.js +17 -0
  368. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6fc5f8e744c81802.js +17 -0
  369. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6fc5f8e744c81802.js +17 -0
  370. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6fc5f8e744c81802.js +17 -0
  371. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6fc5f8e744c81802.js +17 -0
  372. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6fc5f8e744c81802.js +17 -0
  373. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6fc5f8e744c81802.js +17 -0
  374. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6fc5f8e744c81802.js +17 -0
  375. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6fc5f8e744c81802.js +17 -0
  376. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6fc5f8e744c81802.js +17 -0
  377. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6fc5f8e744c81802.js +17 -0
  378. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6fc5f8e744c81802.js +17 -0
  379. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6fc5f8e744c81802.js +17 -0
  380. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6fc5f8e744c81802.js +17 -0
  381. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6fc5f8e744c81802.js +17 -0
  382. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6fc5f8e744c81802.js +17 -0
  383. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6fc5f8e744c81802.js +17 -0
  384. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6fc5f8e744c81802.js +17 -0
  385. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6fc5f8e744c81802.js +17 -0
  386. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6fc5f8e744c81802.js +17 -0
  387. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6fc5f8e744c81802.js +17 -0
  388. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6fc5f8e744c81802.js +17 -0
  389. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6fc5f8e744c81802.js +17 -0
  390. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6fc5f8e744c81802.js +17 -0
  391. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6fc5f8e744c81802.js +17 -0
  392. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6fc5f8e744c81802.js +17 -0
  393. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6fc5f8e744c81802.js +17 -0
  394. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6fc5f8e744c81802.js +17 -0
  395. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6fc5f8e744c81802.js +17 -0
  396. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6fc5f8e744c81802.js +17 -0
  397. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6fc5f8e744c81802.js +17 -0
  398. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6fc5f8e744c81802.js +17 -0
  399. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6fc5f8e744c81802.js +17 -0
  400. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6fc5f8e744c81802.js +17 -0
  401. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6fc5f8e744c81802.js +17 -0
  402. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6fc5f8e744c81802.js +17 -0
  403. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6fc5f8e744c81802.js +17 -0
  404. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6fc5f8e744c81802.js +17 -0
  405. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6fc5f8e744c81802.js +17 -0
  406. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6fc5f8e744c81802.js +17 -0
  407. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6fc5f8e744c81802.js +17 -0
  408. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6fc5f8e744c81802.js +17 -0
  409. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6fc5f8e744c81802.js +17 -0
  410. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6fc5f8e744c81802.js +17 -0
  411. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6fc5f8e744c81802.js +17 -0
  412. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6fc5f8e744c81802.js +17 -0
  413. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6fc5f8e744c81802.js +17 -0
  414. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6fc5f8e744c81802.js +17 -0
  415. package/.next/standalone/.next/static/chunks/app/{page-7017f07f8a7a083c.js → page-213a623b37226452.js} +1041 -652
  416. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6fc5f8e744c81802.js +17 -0
  417. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6fc5f8e744c81802.js +17 -0
  418. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6fc5f8e744c81802.js +17 -0
  419. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6fc5f8e744c81802.js +17 -0
  420. package/.next/standalone/.next/static/css/{d80058f0b9b41c09.css → 312542a5725ba0d5.css} +2 -2
  421. package/.next/standalone/docs/adoption/changesets.json +309 -0
  422. package/.next/standalone/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  423. package/.next/standalone/package.json +3 -3
  424. package/CHANGELOG.md +25 -0
  425. package/api/client.ts +9 -0
  426. package/api/types.ts +29 -0
  427. package/app/api/v1/lifecycle/adoption/route.ts +14 -2
  428. package/app/api/v1/models/[name]/compact-threads/route.ts +14 -11
  429. package/app/api/v1/threads/[thread_id]/activity/route.ts +19 -0
  430. package/app/api/v1/threads/[thread_id]/context-pin/route.test.ts +1 -0
  431. package/app/api/v1/threads/[thread_id]/context-pin/route.ts +2 -1
  432. package/app/api/v1/threads/[thread_id]/route.ts +5 -1
  433. package/components/chat/ChatView.tsx +52 -11
  434. package/components/chat/ContextBoundary.test.tsx +68 -1
  435. package/components/chat/ContextBoundary.tsx +92 -13
  436. package/components/chat/MessageList.test.tsx +31 -0
  437. package/components/chat/MessageList.tsx +49 -28
  438. package/components/chat/ToolList.test.tsx +92 -16
  439. package/components/chat/ToolList.tsx +59 -4
  440. package/components/chat/chat-helpers.test.tsx +24 -1
  441. package/components/chat/chat-helpers.ts +47 -4
  442. package/components/chat/useThreadActivity.test.tsx +113 -0
  443. package/components/chat/useThreadActivity.ts +94 -0
  444. package/components/chat/useThreadData.ts +16 -16
  445. package/components/chat/workflow-step-retry.ts +25 -0
  446. package/components/ui/BootScreen.tsx +17 -0
  447. package/components/ui/WorkflowChecklist.tsx +71 -33
  448. package/hooks/useSSE.ts +28 -3
  449. package/lib/agents/compaction-pipeline.test.ts +202 -0
  450. package/lib/agents/compaction-pipeline.ts +483 -0
  451. package/lib/agents/conversation-summary.ts +37 -21
  452. package/lib/agents/prepare/history-window.test.ts +18 -0
  453. package/lib/agents/prepare/history-window.ts +11 -2
  454. package/lib/agents/prepare/request.ts +4 -0
  455. package/lib/agents/prepare/system-prompt.test.ts +39 -0
  456. package/lib/agents/prepare/system-prompt.ts +8 -3
  457. package/lib/agents/prompt-registry.test.ts +5 -140
  458. package/lib/agents/prompt-registry.ts +45 -1
  459. package/lib/agents/prompt-variants.ts +146 -0
  460. package/lib/agents/run-registry.test.ts +22 -0
  461. package/lib/agents/run-registry.ts +29 -0
  462. package/lib/agents/run-thread.retry.test.ts +67 -1
  463. package/lib/agents/run-thread.ts +86 -1
  464. package/lib/agents/thread-activity.test.ts +31 -0
  465. package/lib/agents/thread-activity.ts +27 -0
  466. package/lib/agents/thread-compaction-state.test.ts +82 -0
  467. package/lib/agents/thread-compaction-state.ts +121 -0
  468. package/lib/agents/thread-compaction.test.ts +83 -4
  469. package/lib/agents/thread-compaction.ts +34 -11
  470. package/lib/agents/warm-summary-background.test.ts +219 -5
  471. package/lib/agents/warm-summary-background.ts +325 -142
  472. package/lib/agents/warm-topics.test.ts +37 -0
  473. package/lib/agents/warm-topics.ts +297 -0
  474. package/lib/agents/workflow-step-retry.test.ts +96 -0
  475. package/lib/agents/workflow-step-retry.ts +216 -0
  476. package/lib/api/browser-control.ts +0 -3
  477. package/lib/db/migrations.ts +5 -0
  478. package/lib/env/config.ts +2 -0
  479. package/lib/env/schema.ts +12 -0
  480. package/lib/lifecycle/changeset-build.test.ts +93 -0
  481. package/lib/lifecycle/changeset-build.ts +210 -0
  482. package/lib/lifecycle/changesets.test.ts +101 -0
  483. package/lib/lifecycle/changesets.ts +166 -0
  484. package/lib/lifecycle/surface-collect.test.ts +88 -0
  485. package/lib/lifecycle/surface-collect.ts +64 -0
  486. package/lib/lifecycle/surface-snapshot.test.ts +104 -0
  487. package/lib/lifecycle/surface-snapshot.ts +210 -0
  488. package/lib/memory/record.ts +0 -2
  489. package/lib/providers/external.ts +0 -2
  490. package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  491. package/lib/stores/threads.test.ts +9 -0
  492. package/lib/stores/threads.ts +21 -11
  493. package/lib/stores/version-adoption.test.ts +96 -0
  494. package/lib/stores/version-adoption.ts +239 -26
  495. package/lib/stores/workflow-progress.ts +3 -0
  496. package/lib/tools/communications/ms-todo.ts +0 -7
  497. package/lib/tools/general/memory.ts +1 -1
  498. package/lib/tools/general/workflow-progress.ts +2 -0
  499. package/lib/tools/runtime/catalog.ts +1 -25
  500. package/lib/triggers/registry.ts +0 -4
  501. package/package.json +3 -3
  502. package/scripts/install-to-system.ps1 +39 -11
  503. package/scripts/install-to-system.sh +37 -3
  504. package/.next/standalone/.next/server/chunks/3979.js +0 -581
  505. package/.next/standalone/.next/server/chunks/5936.js +0 -594
  506. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-36cb8b428b38b26a.js +0 -17
  507. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-36cb8b428b38b26a.js +0 -17
  508. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-36cb8b428b38b26a.js +0 -17
  509. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-36cb8b428b38b26a.js +0 -17
  510. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-36cb8b428b38b26a.js +0 -17
  511. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-36cb8b428b38b26a.js +0 -17
  512. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-36cb8b428b38b26a.js +0 -17
  513. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-36cb8b428b38b26a.js +0 -17
  514. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-36cb8b428b38b26a.js +0 -17
  515. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-36cb8b428b38b26a.js +0 -17
  516. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-36cb8b428b38b26a.js +0 -17
  517. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-36cb8b428b38b26a.js +0 -17
  518. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-36cb8b428b38b26a.js +0 -17
  519. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-36cb8b428b38b26a.js +0 -17
  520. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-36cb8b428b38b26a.js +0 -17
  521. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-36cb8b428b38b26a.js +0 -17
  522. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-36cb8b428b38b26a.js +0 -17
  523. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-36cb8b428b38b26a.js +0 -17
  524. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-36cb8b428b38b26a.js +0 -17
  525. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-36cb8b428b38b26a.js +0 -17
  526. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-36cb8b428b38b26a.js +0 -17
  527. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-36cb8b428b38b26a.js +0 -17
  528. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-36cb8b428b38b26a.js +0 -17
  529. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-36cb8b428b38b26a.js +0 -17
  530. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-36cb8b428b38b26a.js +0 -17
  531. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-36cb8b428b38b26a.js +0 -17
  532. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-36cb8b428b38b26a.js +0 -17
  533. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-36cb8b428b38b26a.js +0 -17
  534. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-36cb8b428b38b26a.js +0 -17
  535. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-36cb8b428b38b26a.js +0 -17
  536. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-36cb8b428b38b26a.js +0 -17
  537. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-36cb8b428b38b26a.js +0 -17
  538. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-36cb8b428b38b26a.js +0 -17
  539. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-36cb8b428b38b26a.js +0 -17
  540. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-36cb8b428b38b26a.js +0 -17
  541. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-36cb8b428b38b26a.js +0 -17
  542. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-36cb8b428b38b26a.js +0 -17
  543. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-36cb8b428b38b26a.js +0 -17
  544. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-36cb8b428b38b26a.js +0 -17
  545. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-36cb8b428b38b26a.js +0 -17
  546. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-36cb8b428b38b26a.js +0 -17
  547. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-36cb8b428b38b26a.js +0 -17
  548. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-36cb8b428b38b26a.js +0 -17
  549. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-36cb8b428b38b26a.js +0 -17
  550. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-36cb8b428b38b26a.js +0 -17
  551. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-36cb8b428b38b26a.js +0 -17
  552. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-36cb8b428b38b26a.js +0 -17
  553. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-36cb8b428b38b26a.js +0 -17
  554. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-36cb8b428b38b26a.js +0 -17
  555. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-36cb8b428b38b26a.js +0 -17
  556. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-36cb8b428b38b26a.js +0 -17
  557. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-36cb8b428b38b26a.js +0 -17
  558. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-36cb8b428b38b26a.js +0 -17
  559. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-36cb8b428b38b26a.js +0 -17
  560. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-36cb8b428b38b26a.js +0 -17
  561. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-36cb8b428b38b26a.js +0 -17
  562. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-36cb8b428b38b26a.js +0 -17
  563. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-36cb8b428b38b26a.js +0 -17
  564. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-36cb8b428b38b26a.js +0 -17
  565. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-36cb8b428b38b26a.js +0 -17
  566. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-36cb8b428b38b26a.js +0 -17
  567. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-36cb8b428b38b26a.js +0 -17
  568. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-36cb8b428b38b26a.js +0 -17
  569. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-36cb8b428b38b26a.js +0 -17
  570. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-36cb8b428b38b26a.js +0 -17
  571. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  572. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-36cb8b428b38b26a.js +0 -17
  573. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-36cb8b428b38b26a.js +0 -17
  574. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  575. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-36cb8b428b38b26a.js +0 -17
  576. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-36cb8b428b38b26a.js +0 -17
  577. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-36cb8b428b38b26a.js +0 -17
  578. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-36cb8b428b38b26a.js +0 -17
  579. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-36cb8b428b38b26a.js +0 -17
  580. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-36cb8b428b38b26a.js +0 -17
  581. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-36cb8b428b38b26a.js +0 -17
  582. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-36cb8b428b38b26a.js +0 -17
  583. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-36cb8b428b38b26a.js +0 -17
  584. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-36cb8b428b38b26a.js +0 -17
  585. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-36cb8b428b38b26a.js +0 -17
  586. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-36cb8b428b38b26a.js +0 -17
  587. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-36cb8b428b38b26a.js +0 -17
  588. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-36cb8b428b38b26a.js +0 -17
  589. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-36cb8b428b38b26a.js +0 -17
  590. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-36cb8b428b38b26a.js +0 -17
  591. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-36cb8b428b38b26a.js +0 -17
  592. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-36cb8b428b38b26a.js +0 -17
  593. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-36cb8b428b38b26a.js +0 -17
  594. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-36cb8b428b38b26a.js +0 -17
  595. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-36cb8b428b38b26a.js +0 -17
  596. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-36cb8b428b38b26a.js +0 -17
  597. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-36cb8b428b38b26a.js +0 -17
  598. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-36cb8b428b38b26a.js +0 -17
  599. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-36cb8b428b38b26a.js +0 -17
  600. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-36cb8b428b38b26a.js +0 -17
  601. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-36cb8b428b38b26a.js +0 -17
  602. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-36cb8b428b38b26a.js +0 -17
  603. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-36cb8b428b38b26a.js +0 -17
  604. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-36cb8b428b38b26a.js +0 -17
  605. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-36cb8b428b38b26a.js +0 -17
  606. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-36cb8b428b38b26a.js +0 -17
  607. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-36cb8b428b38b26a.js +0 -17
  608. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-36cb8b428b38b26a.js +0 -17
  609. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-36cb8b428b38b26a.js +0 -17
  610. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-36cb8b428b38b26a.js +0 -17
  611. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-36cb8b428b38b26a.js +0 -17
  612. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-36cb8b428b38b26a.js +0 -17
  613. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-36cb8b428b38b26a.js +0 -17
  614. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-36cb8b428b38b26a.js +0 -17
  615. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-36cb8b428b38b26a.js +0 -17
  616. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-36cb8b428b38b26a.js +0 -17
  617. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-36cb8b428b38b26a.js +0 -17
  618. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-36cb8b428b38b26a.js +0 -17
  619. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-36cb8b428b38b26a.js +0 -17
  620. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-36cb8b428b38b26a.js +0 -17
  621. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-36cb8b428b38b26a.js +0 -17
  622. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-36cb8b428b38b26a.js +0 -17
  623. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-36cb8b428b38b26a.js +0 -17
  624. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-36cb8b428b38b26a.js +0 -17
  625. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-36cb8b428b38b26a.js +0 -17
  626. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-36cb8b428b38b26a.js +0 -17
  627. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-36cb8b428b38b26a.js +0 -17
  628. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-36cb8b428b38b26a.js +0 -17
  629. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-36cb8b428b38b26a.js +0 -17
  630. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-36cb8b428b38b26a.js +0 -17
  631. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-36cb8b428b38b26a.js +0 -17
  632. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-36cb8b428b38b26a.js +0 -17
  633. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-36cb8b428b38b26a.js +0 -17
  634. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-36cb8b428b38b26a.js +0 -17
  635. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-36cb8b428b38b26a.js +0 -17
  636. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-36cb8b428b38b26a.js +0 -17
  637. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-36cb8b428b38b26a.js +0 -17
  638. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-36cb8b428b38b26a.js +0 -17
  639. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-36cb8b428b38b26a.js +0 -17
  640. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-36cb8b428b38b26a.js +0 -17
  641. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-36cb8b428b38b26a.js +0 -17
  642. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-36cb8b428b38b26a.js +0 -17
  643. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-36cb8b428b38b26a.js +0 -17
  644. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-36cb8b428b38b26a.js +0 -17
  645. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-36cb8b428b38b26a.js +0 -17
  646. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-36cb8b428b38b26a.js +0 -17
  647. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-36cb8b428b38b26a.js +0 -17
  648. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-36cb8b428b38b26a.js +0 -17
  649. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-36cb8b428b38b26a.js +0 -17
  650. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_buildManifest.js +0 -0
  651. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_ssgManifest.js +0 -0
@@ -31,6 +31,579 @@ module.exports = require("url");
31
31
 
32
32
  module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");
33
33
 
34
+ /***/ }),
35
+
36
+ /***/ 3979:
37
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
38
+
39
+
40
+ // EXPORTS
41
+ __webpack_require__.d(__webpack_exports__, {
42
+ AX: () => (/* binding */ getBridgeRuntimeStatus),
43
+ HQ: () => (/* binding */ isBridgeRunning),
44
+ FN: () => (/* binding */ listBridgeChats),
45
+ qM: () => (/* binding */ lookupBridgeChat),
46
+ s: () => (/* binding */ removeBridgeAuth),
47
+ V_: () => (/* binding */ repairBridge),
48
+ kn: () => (/* binding */ startAllBridges),
49
+ c0: () => (/* binding */ startBridge),
50
+ aq: () => (/* binding */ stopBridge)
51
+ });
52
+
53
+ // UNUSED EXPORTS: restartBridge, stopAllBridges
54
+
55
+ // EXTERNAL MODULE: ./lib/stores/bridges.ts
56
+ var bridges = __webpack_require__(78361);
57
+ // EXTERNAL MODULE: ./lib/notifications/bus.ts
58
+ var bus = __webpack_require__(76445);
59
+ // EXTERNAL MODULE: ./lib/utils/global-state.ts
60
+ var global_state = __webpack_require__(15559);
61
+ // EXTERNAL MODULE: ./lib/stores/threads.ts
62
+ var threads = __webpack_require__(83042);
63
+ // EXTERNAL MODULE: ./lib/stores/agent-configs.ts
64
+ var agent_configs = __webpack_require__(41720);
65
+ // EXTERNAL MODULE: ./lib/agents/agent-turn.ts
66
+ var agent_turn = __webpack_require__(62032);
67
+ ;// ./lib/bridges/router.ts
68
+
69
+ /**
70
+ * Resolve which agent should handle an inbound message on (bridge, remote_jid).
71
+ * 0) Chat is on the ignore list → null (message dropped before any agent
72
+ * thread, memory write, or tool call runs — the "listen to everything
73
+ * except these chats" primitive).
74
+ * 1) Exact route match on (bridge_id, remote_jid)
75
+ * 2) Bridge-level catch-all route (`remote_jid='*'`) when present
76
+ * 3) null (dispatcher drops the message silently)
77
+ *
78
+ * Catch-all lets one agent handle all otherwise-unrouted chats on a bridge.
79
+ * This is especially useful for "triage" or "observer" agents. The ignore
80
+ * list is checked FIRST so it wins over both explicit routes and the
81
+ * catch-all — deleting an ignore entry is how you "resume listening".
82
+ */ function resolveRoute(bridge_id, remote_jid) {
83
+ if ((0,bridges/* isIgnored */.pi)(bridge_id, remote_jid)) return null;
84
+ return (0,bridges/* findRoute */.$6)(bridge_id, remote_jid) ?? (0,bridges/* findRoute */.$6)(bridge_id, "*");
85
+ }
86
+
87
+ ;// ./lib/bridges/message-role.ts
88
+ /**
89
+ * Cross-adapter framing for bridge inbound messages.
90
+ *
91
+ * Bridge conversations are inherently multi-party: the paired user, one or
92
+ * more counterparts (1:1 partner or group members), and the agent that's
93
+ * observing/assisting. Without role framing, the LLM tends to read every
94
+ * inbound message as a direct command — even when the message was sent by
95
+ * the user's chat partner, who has no idea an agent is in the loop.
96
+ *
97
+ * This module is the single source of truth for that framing. Every bridge
98
+ * adapter (WhatsApp today; Telegram/Slack/Discord/email tomorrow) populates
99
+ * `InboundMessage.role` with one of these values, and the dispatcher feeds
100
+ * the message through `formatBridgePrompt` to produce the prefix the agent
101
+ * sees. Adding a new adapter is a matter of mapping its platform-specific
102
+ * "who sent this" signal onto `MessageRole`; the framing code does not need
103
+ * to change.
104
+ */ /**
105
+ * Who sent the message from the agent's perspective.
106
+ *
107
+ * - `user`: the paired account holder themselves — typed on their phone,
108
+ * in their browser, etc. The agent treats these as the user's own
109
+ * reaction/input to the conversation. Useful as an intent signal but
110
+ * NOT a direct command to the agent (the user is talking to the
111
+ * counterpart, not the agent).
112
+ *
113
+ * - `counterpart`: another participant in the chat — 1:1 partner in a DM,
114
+ * or another member in a group chat. The agent treats these as
115
+ * conversation context the user has not yet reacted to. Not a request
116
+ * directed at the agent.
117
+ *
118
+ * - `agent`: the agent's own prior output, surfaced inbound when the
119
+ * adapter cannot suppress its echo (rare). Adapters with reliable
120
+ * echo-filtering (e.g. WhatsApp's `sentIdsSet`) should never emit this
121
+ * value; it exists for adapters where deduplication is best-effort.
122
+ */ /**
123
+ * Build the prompt prefix the agent receives for one bridge-inbound message.
124
+ *
125
+ * Output shape:
126
+ *
127
+ * <one-line semantic note framing the role>
128
+ *
129
+ * [bridge:<id>]
130
+ * [chat_id:<id>]
131
+ * [chat_name:<label>]
132
+ * [chat_type:dm|group]
133
+ * [message_role:user|counterpart|agent]
134
+ * [sender_id:<id>]
135
+ * [sender_name:<label>]
136
+ * ([group_name:<label>] [participant_id:<id>] [participant_name:<label>] for groups)
137
+ *
138
+ * <raw text>
139
+ *
140
+ * The metadata block is keyed-tag for parseability; the leading note is
141
+ * prose so the LLM has an explicit framing without having to learn the
142
+ * convention. Both are stable across adapters.
143
+ */ function formatBridgePrompt(input) {
144
+ const note = roleNote(input.role, input.is_group, input.silent === true, input.event);
145
+ const lines = [
146
+ `[bridge:${input.bridge_id}]`,
147
+ `[chat_id:${input.chat_id}]`,
148
+ `[chat_name:${input.chat_name}]`,
149
+ `[chat_type:${input.is_group ? "group" : "dm"}]`,
150
+ `[message_role:${input.role}]`,
151
+ `[sender_id:${input.sender_id}]`,
152
+ `[sender_name:${input.sender_name}]`
153
+ ];
154
+ if (input.event) {
155
+ lines.push(`[event_type:${input.event.type}]`);
156
+ lines.push(`[event_subtype:${input.event.subtype}]`);
157
+ }
158
+ if (input.is_group) {
159
+ lines.push(`[group_name:${input.chat_name}]`);
160
+ lines.push(`[participant_id:${input.sender_id}]`);
161
+ lines.push(`[participant_name:${input.sender_name}]`);
162
+ }
163
+ return `${note}\n\n${lines.join("\n")}\n\n${input.text}`;
164
+ }
165
+ // Parses bridge prompt envelopes rendered by formatBridgePrompt().
166
+ // Back-compat: also accepts legacy keys (chat_jid/sender_jid) and optional
167
+ // prose preface before the [bridge:...] metadata block.
168
+ function parseBridgePrompt(raw) {
169
+ const start = raw.indexOf("[bridge:");
170
+ if (start < 0) return null;
171
+ const src = raw.slice(start);
172
+ const headers = {};
173
+ const lines = src.split("\n");
174
+ let i = 0;
175
+ for(; i < lines.length; i++){
176
+ const line = lines[i];
177
+ if (line === "") {
178
+ i++;
179
+ break;
180
+ }
181
+ const m = /^\[([a-z_]+):([\s\S]*)\]$/.exec(line);
182
+ if (!m) return null;
183
+ headers[m[1]] = m[2];
184
+ }
185
+ const chatId = headers.chat_id || headers.chat_jid;
186
+ const senderId = headers.sender_id || headers.sender_jid || chatId;
187
+ if (!headers.bridge || !chatId || !headers.chat_type) return null;
188
+ return {
189
+ bridgeId: headers.bridge,
190
+ chatJid: chatId,
191
+ chatName: headers.chat_name || chatId,
192
+ isGroup: headers.chat_type === "group",
193
+ senderJid: senderId,
194
+ senderName: headers.sender_name || senderId || "Unknown",
195
+ body: lines.slice(i).join("\n").trimEnd()
196
+ };
197
+ }
198
+ function roleNote(role, isGroup, silent, event) {
199
+ if (event) {
200
+ const evt = event.type === "group_profile_update" ? "group profile/settings update" : "group participant update";
201
+ 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.";
202
+ }
203
+ if (silent) {
204
+ // Observer mode overrides the per-role framing: the agent is forbidden
205
+ // from speaking on the chat regardless of who sent the inbound message.
206
+ // It may still use the event as context and take non-chat actions that
207
+ // its normal instructions require.
208
+ if (role === "agent") {
209
+ 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.";
210
+ }
211
+ 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.";
212
+ }
213
+ switch(role){
214
+ case "user":
215
+ 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.";
216
+ case "counterpart":
217
+ 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.";
218
+ case "agent":
219
+ 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.";
220
+ }
221
+ }
222
+
223
+ // EXTERNAL MODULE: ./lib/utils/error.ts
224
+ var error = __webpack_require__(22032);
225
+ // EXTERNAL MODULE: ./lib/agents/run-queue.ts
226
+ var run_queue = __webpack_require__(3944);
227
+ // EXTERNAL MODULE: ./lib/stores/automation-activity.ts
228
+ var automation_activity = __webpack_require__(26316);
229
+ ;// ./lib/bridges/dispatcher.ts
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+ /**
241
+ * Handle one inbound message from a bridge adapter:
242
+ * 1. Resolve the chat → agent route. Unrouted → publish an advisory
243
+ * event and drop. No thread created, no reply sent.
244
+ * 2. Use `getOrCreateAgentThread(agent_id)` (one-thread-per-agent
245
+ * invariant — `UNIQUE(agent_id)` on bridge_routes ensures no chat
246
+ * interleaving).
247
+ * 3. Drive the agent via the canonical `runAgentTurn` helper used by
248
+ * every external context turn.
249
+ * 4. Persist the assistant message and send the reply back through the
250
+ * adapter on the originating channel.
251
+ *
252
+ * Top-level try/catch — adapter callbacks must never throw into the Baileys
253
+ * socket event handler (would tear down the WS).
254
+ */ async function handleInboundMessage(adapter, msg) {
255
+ try {
256
+ const route = resolveRoute(adapter.bridge_id, msg.remote_jid);
257
+ if (!route) {
258
+ // Unrouted chats are silently dropped. We intentionally do NOT publish
259
+ // a notification here — the user already declared "this chat isn't
260
+ // monitored" by not configuring a route, so popping a toast for every
261
+ // inbound message in an active group would be noise. The console log
262
+ // remains for debugging; the chat picker in BridgeEditor still shows
263
+ // observed chats so a route can be added on demand.
264
+ console.log(`[bridge ${adapter.bridge_id}] dropped: no route for ${msg.remote_jid} (${msg.push_name ?? "?"})`);
265
+ return;
266
+ }
267
+ const agentId = route.agent_id;
268
+ const agent = (0,agent_configs/* getAgentConfig */.mJ)(agentId);
269
+ if (!agent) {
270
+ console.warn(`[bridge ${adapter.bridge_id}] route points at missing agent ${agentId}, dropping`);
271
+ return;
272
+ }
273
+ const thread = (0,threads/* getOrCreateAgentThread */.xH)(agentId);
274
+ // Stamp bridge/chat provenance + sender role onto every inbound prompt.
275
+ // Role framing (user / counterpart / agent) is shared across every
276
+ // bridge adapter via `formatBridgePrompt` — see lib/bridges/message-role.ts.
277
+ const chatName = msg.chat_name ?? msg.push_name ?? "unknown";
278
+ const senderJid = msg.sender_jid ?? msg.participant_jid ?? msg.remote_jid;
279
+ const senderName = msg.sender_name ?? msg.push_name ?? senderJid;
280
+ const silent = route.silent_mode === 1;
281
+ const willReply = !silent && msg.role === route.respond_to;
282
+ const activity = (0,automation_activity/* createAutomationActivity */.P2)({
283
+ threadId: thread.thread_id,
284
+ sourceKind: "bridge",
285
+ sourceId: `${adapter.bridge_id}:${msg.remote_jid}`,
286
+ label: `Message from ${senderName}`,
287
+ state: "checking",
288
+ detail: msg.text
289
+ });
290
+ const publishActivity = ()=>{
291
+ (0,bus/* publish */.mk)({
292
+ type: "automation_activity",
293
+ thread_id: thread.thread_id,
294
+ agent_id: agentId,
295
+ ts: Date.now()
296
+ });
297
+ };
298
+ publishActivity();
299
+ const promptText = formatBridgePrompt({
300
+ bridge_id: adapter.bridge_id,
301
+ chat_id: msg.remote_jid,
302
+ chat_name: chatName,
303
+ is_group: msg.is_group,
304
+ role: msg.role,
305
+ sender_id: senderJid,
306
+ sender_name: senderName,
307
+ text: msg.text,
308
+ silent,
309
+ event: msg.event
310
+ });
311
+ const bridgeConversation = {
312
+ key: `${adapter.bridge_id}:${msg.remote_jid}`,
313
+ bridge_id: adapter.bridge_id,
314
+ chat_id: msg.remote_jid
315
+ };
316
+ // Keep typing outside the queue so users still see "thinking" while
317
+ // waiting behind other queued turns for the same thread.
318
+ let typingActive = willReply;
319
+ if (willReply) {
320
+ void adapter.sendTyping(msg.remote_jid, true).catch(()=>{});
321
+ }
322
+ const typingTimer = setInterval(()=>{
323
+ if (!typingActive) return;
324
+ void adapter.sendTyping(msg.remote_jid, true).catch(()=>{});
325
+ }, 8000);
326
+ typingTimer.unref?.();
327
+ let reply = "";
328
+ let suppressAssistant = false;
329
+ let aborted = false;
330
+ try {
331
+ // Surface the bridge kind+name in the system prompt so the agent
332
+ // knows it's answering on e.g. WhatsApp — fixes the "I don't have
333
+ // access to WhatsApp" reply on bridge-delivered turns. Falls back
334
+ // to bridge_id when the row was deleted between fetch and dispatch.
335
+ const bridge = (0,bridges/* getBridge */.e1)(adapter.bridge_id);
336
+ let result;
337
+ try {
338
+ result = await (0,agent_turn.runAgentTurn)({
339
+ thread_id: thread.thread_id,
340
+ queue_source: "bridge",
341
+ message: promptText,
342
+ attachments: msg.attachments,
343
+ user_category: "bridge",
344
+ assistant_category: "bridge",
345
+ user_message_metadata: {
346
+ bridge_conversation: bridgeConversation
347
+ },
348
+ assistant_message_metadata: {
349
+ bridge_conversation: bridgeConversation
350
+ },
351
+ history_bridge_key: bridgeConversation.key,
352
+ silent,
353
+ queue_lane: willReply ? "interactive" : "background",
354
+ queue_expires_at: willReply ? undefined : Date.now() + 5 * 60000,
355
+ on_queue_state: (state)=>{
356
+ (0,automation_activity/* updateAutomationActivity */.ou)(activity.msg_id, {
357
+ state: state === "queued" ? "queued" : "checking"
358
+ });
359
+ publishActivity();
360
+ },
361
+ delivery_channel: {
362
+ kind: bridge?.kind ?? "bridge",
363
+ name: bridge?.name ?? null
364
+ }
365
+ });
366
+ } catch (err) {
367
+ if (err instanceof run_queue/* QueueExpiredError */.vR) {
368
+ (0,automation_activity/* finalizeAutomationActivity */.lU)(activity.msg_id, {
369
+ disposition: "expired"
370
+ });
371
+ publishActivity();
372
+ return;
373
+ }
374
+ (0,automation_activity/* finalizeAutomationActivity */.lU)(activity.msg_id, {
375
+ disposition: "failed",
376
+ error: (0,error/* errorMessage */.g)(err)
377
+ });
378
+ publishActivity();
379
+ throw err;
380
+ }
381
+ reply = result.assistantContent.trim();
382
+ suppressAssistant = result.skippedAssistant;
383
+ aborted = result.aborted;
384
+ } finally{
385
+ typingActive = false;
386
+ clearInterval(typingTimer);
387
+ if (willReply) {
388
+ void adapter.sendTyping(msg.remote_jid, false).catch(()=>{});
389
+ }
390
+ }
391
+ // Outbound reply gate: silent_mode (master switch) AND respond_to
392
+ // (per-role trigger). Both must clear for a message to leave the
393
+ // dispatcher. The WhatsApp adapter also re-checks `route.silent_mode`
394
+ // inside its own sendText as a belt-and-suspenders guard, so even a
395
+ // tool that called adapter.sendText directly would be dropped.
396
+ let sendError = null;
397
+ if (reply.length > 0 && willReply) {
398
+ try {
399
+ await adapter.sendText(msg.remote_jid, reply);
400
+ } catch (sendErr) {
401
+ const m = (0,error/* errorMessage */.g)(sendErr);
402
+ sendError = m;
403
+ console.error(`[bridge ${adapter.bridge_id}] sendText failed:`, m);
404
+ }
405
+ }
406
+ (0,automation_activity/* finalizeAutomationActivity */.lU)(activity.msg_id, aborted ? {
407
+ disposition: "cancelled"
408
+ } : sendError ? {
409
+ disposition: "failed",
410
+ error: sendError
411
+ } : {
412
+ disposition: reply.length > 0 && !suppressAssistant ? "action" : "no_action",
413
+ preview: suppressAssistant ? undefined : reply.replace(/\s+/g, " ").slice(0, 120)
414
+ });
415
+ publishActivity();
416
+ if (!silent || !suppressAssistant) {
417
+ (0,bus/* publish */.mk)({
418
+ type: "bridge_message_received",
419
+ bridge_id: adapter.bridge_id,
420
+ remote_jid: msg.remote_jid,
421
+ push_name: msg.push_name,
422
+ is_group: msg.is_group,
423
+ thread_id: thread.thread_id,
424
+ agent_id: agentId,
425
+ preview: suppressAssistant ? "" : reply.replace(/\s+/g, " ").slice(0, 120),
426
+ ts: Date.now()
427
+ });
428
+ }
429
+ } catch (err) {
430
+ const m = (0,error/* errorMessage */.g)(err);
431
+ console.error(`[bridge ${adapter.bridge_id}] dispatcher error on ${msg.remote_jid}:`, m);
432
+ }
433
+ }
434
+
435
+ // EXTERNAL MODULE: ./lib/bridges/registry.ts + 4 modules
436
+ var registry = __webpack_require__(44540);
437
+ ;// ./lib/bridges/runtime.ts
438
+ /**
439
+ * Bridge lifecycle manager.
440
+ *
441
+ * Owns a `Map<bridge_id, BridgeAdapter>` plus a `Map<bridge_id, StatusUpdate>`
442
+ * of the latest known status per bridge (so the HTTP status endpoint can
443
+ * return live QR / connection state without consulting the adapter directly).
444
+ *
445
+ * - `startAllBridges()` — called at app boot; scans `bridges` for
446
+ * `enabled=1` rows and spins up their adapters.
447
+ * - `startBridge(id)` / `stopBridge(id)` / `restartBridge(id)` — called from
448
+ * the HTTP layer (toggle enabled, re-pair, delete).
449
+ *
450
+ * Pinned to globalThis so dev HMR doesn't double-start (same pattern as
451
+ * lib/scheduler/index.ts).
452
+ */
453
+
454
+
455
+
456
+
457
+
458
+ const state = (0,global_state/* getOrCreateGlobal */.X)("__jarela_bridges", ()=>({
459
+ adapters: new Map(),
460
+ status: new Map(),
461
+ started: false
462
+ }));
463
+ function makeAdapter(bridge_id, kind) {
464
+ const bridgeModule = (0,registry/* getBridgeModule */.ut)(kind);
465
+ if (!bridgeModule) throw new Error(`Unknown bridge kind: ${kind}`);
466
+ return bridgeModule.createAdapter(bridge_id);
467
+ }
468
+ async function removeBridgeAuth(bridge_id) {
469
+ const bridge = (0,bridges/* getBridge */.e1)(bridge_id);
470
+ if (!bridge) return;
471
+ await (0,registry/* getBridgeModule */.ut)(bridge.kind)?.removeAuth(bridge_id);
472
+ }
473
+ function wireAdapter(adapter) {
474
+ adapter.onInboundMessage((msg)=>handleInboundMessage(adapter, msg));
475
+ adapter.onStatusChange((update)=>{
476
+ state.status.set(adapter.bridge_id, update);
477
+ // Persist the user-visible bits so they survive a process restart.
478
+ const patch = {
479
+ status: update.status,
480
+ qr: update.qr_data_url ?? null,
481
+ last_error: update.error ?? null
482
+ };
483
+ if (update.paired_id !== undefined) patch.paired_id = update.paired_id;
484
+ (0,bridges/* updateBridge */.po)(adapter.bridge_id, patch);
485
+ (0,bus/* publish */.mk)({
486
+ type: "bridge_status",
487
+ bridge_id: adapter.bridge_id,
488
+ status: update.status,
489
+ error: update.error ?? null,
490
+ paired_id: update.paired_id ?? null,
491
+ ts: Date.now()
492
+ });
493
+ });
494
+ }
495
+ async function startBridge(bridge_id) {
496
+ if (state.adapters.has(bridge_id)) return;
497
+ const row = (0,bridges/* getBridge */.e1)(bridge_id);
498
+ if (!row) throw new Error(`Bridge ${bridge_id} not found`);
499
+ const adapter = makeAdapter(bridge_id, row.kind);
500
+ state.adapters.set(bridge_id, adapter);
501
+ wireAdapter(adapter);
502
+ try {
503
+ await adapter.start();
504
+ } catch (err) {
505
+ state.adapters.delete(bridge_id);
506
+ const m = (0,error/* errorMessage */.g)(err);
507
+ (0,bridges/* updateBridge */.po)(bridge_id, {
508
+ status: "error",
509
+ last_error: m
510
+ });
511
+ throw err;
512
+ }
513
+ }
514
+ async function stopBridge(bridge_id) {
515
+ const adapter = state.adapters.get(bridge_id);
516
+ state.adapters.delete(bridge_id);
517
+ state.status.delete(bridge_id);
518
+ if (adapter) {
519
+ try {
520
+ await adapter.stop();
521
+ } catch (err) {
522
+ console.error(`[bridge ${bridge_id}] stop failed:`, err);
523
+ }
524
+ }
525
+ // Persist that the bridge is down (in case status callback didn't fire).
526
+ (0,bridges/* updateBridge */.po)(bridge_id, {
527
+ status: "disconnected",
528
+ qr: null
529
+ });
530
+ }
531
+ async function restartBridge(bridge_id) {
532
+ await stopBridge(bridge_id);
533
+ await startBridge(bridge_id);
534
+ }
535
+ async function repairBridge(bridge_id) {
536
+ const bridge = (0,bridges/* getBridge */.e1)(bridge_id);
537
+ if (!bridge) throw new Error(`Bridge ${bridge_id} not found`);
538
+ const bridgeModule = (0,registry/* getBridgeModule */.ut)(bridge.kind);
539
+ if (!bridgeModule?.pairing) throw new Error(`Bridge kind "${bridge.kind}" does not support pairing`);
540
+ await stopBridge(bridge_id);
541
+ await bridgeModule.removeAuth(bridge_id);
542
+ (0,bridges/* updateBridge */.po)(bridge_id, {
543
+ status: "disconnected",
544
+ qr: null,
545
+ last_error: null,
546
+ paired_id: null
547
+ });
548
+ await startBridge(bridge_id);
549
+ }
550
+ function getBridgeRuntimeStatus(bridge_id) {
551
+ return state.status.get(bridge_id) ?? null;
552
+ }
553
+ function isBridgeRunning(bridge_id) {
554
+ return state.adapters.has(bridge_id);
555
+ }
556
+ /**
557
+ * Snapshot of chats the adapter has observed since connecting. Returns []
558
+ * when the bridge isn't running yet. Triggers a background refresh so that
559
+ * subsequent calls see newly-fetched group metadata.
560
+ */ function listBridgeChats(bridge_id) {
561
+ const adapter = state.adapters.get(bridge_id);
562
+ if (!adapter?.listChats) return [];
563
+ // Fire-and-forget — refreshChats hits a WS round-trip; HTTP shouldn't
564
+ // wait. The next poll will pick up any new entries.
565
+ void adapter.refreshChats?.().catch(()=>{});
566
+ return adapter.listChats();
567
+ }
568
+ /**
569
+ * Look up a freeform phone number (or other identifier) against the bridge
570
+ * and return the resolved chat if it exists, else null. Returns null also
571
+ * if the bridge isn't running.
572
+ */ async function lookupBridgeChat(bridge_id, input) {
573
+ const adapter = state.adapters.get(bridge_id);
574
+ if (!adapter?.lookupChat) return null;
575
+ return adapter.lookupChat(input);
576
+ }
577
+ /**
578
+ * Boot hook. Idempotent — safe to call from a layout module that may be
579
+ * evaluated multiple times in Next.js dev HMR.
580
+ */ async function startAllBridges() {
581
+ if (state.started) return;
582
+ state.started = true;
583
+ const rows = (0,bridges/* listBridges */.X9)();
584
+ for (const row of rows){
585
+ if (row.enabled !== 1) continue;
586
+ try {
587
+ await startBridge(row.id);
588
+ } catch (err) {
589
+ const m = (0,error/* errorMessage */.g)(err);
590
+ console.error(`[bridge ${row.id}] failed to start at boot:`, m);
591
+ // updateBridge already happened inside startBridge's catch.
592
+ }
593
+ }
594
+ }
595
+ // Stop every running bridge. Called from the graceful-shutdown path so
596
+ // WhatsApp WS sockets etc. close cleanly before the process exits. We
597
+ // await in parallel — a single slow `adapter.stop()` shouldn't gate the
598
+ // others — but the whole call is still bounded by the outer shutdown
599
+ // timeout in `lib/lifecycle/shutdown.ts`.
600
+ async function stopAllBridges() {
601
+ const ids = Array.from(state.adapters.keys());
602
+ await Promise.allSettled(ids.map((id)=>stopBridge(id)));
603
+ state.started = false;
604
+ }
605
+
606
+
34
607
  /***/ }),
35
608
 
36
609
  /***/ 8128:
@@ -293,135 +866,7 @@ module.exports = require("node:util");
293
866
 
294
867
  /***/ }),
295
868
 
296
- /***/ 63033:
297
- /***/ ((module) => {
298
-
299
- module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
300
-
301
- /***/ }),
302
-
303
- /***/ 73024:
304
- /***/ ((module) => {
305
-
306
- module.exports = require("node:fs");
307
-
308
- /***/ }),
309
-
310
- /***/ 74075:
311
- /***/ ((module) => {
312
-
313
- module.exports = require("zlib");
314
-
315
- /***/ }),
316
-
317
- /***/ 75919:
318
- /***/ ((module) => {
319
-
320
- module.exports = require("node:worker_threads");
321
-
322
- /***/ }),
323
-
324
- /***/ 76760:
325
- /***/ ((module) => {
326
-
327
- module.exports = require("node:path");
328
-
329
- /***/ }),
330
-
331
- /***/ 77030:
332
- /***/ ((module) => {
333
-
334
- module.exports = require("node:net");
335
-
336
- /***/ }),
337
-
338
- /***/ 77598:
339
- /***/ ((module) => {
340
-
341
- module.exports = require("node:crypto");
342
-
343
- /***/ }),
344
-
345
- /***/ 79428:
346
- /***/ ((module) => {
347
-
348
- module.exports = require("buffer");
349
-
350
- /***/ }),
351
-
352
- /***/ 79748:
353
- /***/ ((module) => {
354
-
355
- module.exports = require("fs/promises");
356
-
357
- /***/ }),
358
-
359
- /***/ 80099:
360
- /***/ ((module) => {
361
-
362
- module.exports = require("node:sqlite");
363
-
364
- /***/ }),
365
-
366
- /***/ 80481:
367
- /***/ ((module) => {
368
-
369
- module.exports = require("node:readline");
370
-
371
- /***/ }),
372
-
373
- /***/ 80924:
374
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
375
-
376
- __webpack_require__.r(__webpack_exports__);
377
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
378
- /* harmony export */ POST: () => (/* binding */ POST)
379
- /* harmony export */ });
380
- /* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
381
- /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97377);
382
- /* harmony import */ var _lib_stores_bridges__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(78361);
383
- /* harmony import */ var _lib_bridges_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3979);
384
- /* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39947);
385
-
386
-
387
-
388
-
389
-
390
- const Schema = zod__WEBPACK_IMPORTED_MODULE_4__/* .object */ .Ikc({
391
- input: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .YjP().trim().min(1).max(160).optional(),
392
- /** @deprecated Use `input`; retained for existing WhatsApp clients. */ phone: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .YjP().trim().min(3).max(40).optional()
393
- }).refine((value)=>Boolean(value.input || value.phone), "input is required");
394
- /**
395
- * Resolve a channel-specific identifier to a chat on the selected bridge.
396
- *
397
- * 200 + `{ chat: null }` means no matching chat exists — distinct
398
- * from a 404 (bridge not found) or 409 (bridge not connected).
399
- */ async function POST(req, { params }) {
400
- const { id } = await params;
401
- if (!(0,_lib_stores_bridges__WEBPACK_IMPORTED_MODULE_1__/* .getBridge */ .e1)(id)) return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
402
- error: "not found"
403
- }, {
404
- status: 404
405
- });
406
- const parsed = await (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .validateBody */ .Jb)(req, Schema);
407
- if (parsed instanceof next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse) return parsed;
408
- const chat = await (0,_lib_bridges_runtime__WEBPACK_IMPORTED_MODULE_2__/* .lookupBridgeChat */ .qM)(id, parsed.input ?? parsed.phone);
409
- return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
410
- chat
411
- });
412
- }
413
-
414
-
415
- /***/ }),
416
-
417
- /***/ 81630:
418
- /***/ ((module) => {
419
-
420
- module.exports = require("http");
421
-
422
- /***/ }),
423
-
424
- /***/ 82855:
869
+ /***/ 59861:
425
870
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
426
871
 
427
872
  __webpack_require__.r(__webpack_exports__);
@@ -863,6 +1308,134 @@ async function handler(req, res, ctx) {
863
1308
  //# sourceMappingURL=app-route.js.map
864
1309
 
865
1310
 
1311
+ /***/ }),
1312
+
1313
+ /***/ 63033:
1314
+ /***/ ((module) => {
1315
+
1316
+ module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
1317
+
1318
+ /***/ }),
1319
+
1320
+ /***/ 73024:
1321
+ /***/ ((module) => {
1322
+
1323
+ module.exports = require("node:fs");
1324
+
1325
+ /***/ }),
1326
+
1327
+ /***/ 74075:
1328
+ /***/ ((module) => {
1329
+
1330
+ module.exports = require("zlib");
1331
+
1332
+ /***/ }),
1333
+
1334
+ /***/ 75919:
1335
+ /***/ ((module) => {
1336
+
1337
+ module.exports = require("node:worker_threads");
1338
+
1339
+ /***/ }),
1340
+
1341
+ /***/ 76760:
1342
+ /***/ ((module) => {
1343
+
1344
+ module.exports = require("node:path");
1345
+
1346
+ /***/ }),
1347
+
1348
+ /***/ 77030:
1349
+ /***/ ((module) => {
1350
+
1351
+ module.exports = require("node:net");
1352
+
1353
+ /***/ }),
1354
+
1355
+ /***/ 77598:
1356
+ /***/ ((module) => {
1357
+
1358
+ module.exports = require("node:crypto");
1359
+
1360
+ /***/ }),
1361
+
1362
+ /***/ 79428:
1363
+ /***/ ((module) => {
1364
+
1365
+ module.exports = require("buffer");
1366
+
1367
+ /***/ }),
1368
+
1369
+ /***/ 79748:
1370
+ /***/ ((module) => {
1371
+
1372
+ module.exports = require("fs/promises");
1373
+
1374
+ /***/ }),
1375
+
1376
+ /***/ 80099:
1377
+ /***/ ((module) => {
1378
+
1379
+ module.exports = require("node:sqlite");
1380
+
1381
+ /***/ }),
1382
+
1383
+ /***/ 80481:
1384
+ /***/ ((module) => {
1385
+
1386
+ module.exports = require("node:readline");
1387
+
1388
+ /***/ }),
1389
+
1390
+ /***/ 80924:
1391
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1392
+
1393
+ __webpack_require__.r(__webpack_exports__);
1394
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1395
+ /* harmony export */ POST: () => (/* binding */ POST)
1396
+ /* harmony export */ });
1397
+ /* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
1398
+ /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97377);
1399
+ /* harmony import */ var _lib_stores_bridges__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(78361);
1400
+ /* harmony import */ var _lib_bridges_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3979);
1401
+ /* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39947);
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+ const Schema = zod__WEBPACK_IMPORTED_MODULE_4__/* .object */ .Ikc({
1408
+ input: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .YjP().trim().min(1).max(160).optional(),
1409
+ /** @deprecated Use `input`; retained for existing WhatsApp clients. */ phone: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .YjP().trim().min(3).max(40).optional()
1410
+ }).refine((value)=>Boolean(value.input || value.phone), "input is required");
1411
+ /**
1412
+ * Resolve a channel-specific identifier to a chat on the selected bridge.
1413
+ *
1414
+ * 200 + `{ chat: null }` means no matching chat exists — distinct
1415
+ * from a 404 (bridge not found) or 409 (bridge not connected).
1416
+ */ async function POST(req, { params }) {
1417
+ const { id } = await params;
1418
+ if (!(0,_lib_stores_bridges__WEBPACK_IMPORTED_MODULE_1__/* .getBridge */ .e1)(id)) return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
1419
+ error: "not found"
1420
+ }, {
1421
+ status: 404
1422
+ });
1423
+ const parsed = await (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .validateBody */ .Jb)(req, Schema);
1424
+ if (parsed instanceof next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse) return parsed;
1425
+ const chat = await (0,_lib_bridges_runtime__WEBPACK_IMPORTED_MODULE_2__/* .lookupBridgeChat */ .qM)(id, parsed.input ?? parsed.phone);
1426
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
1427
+ chat
1428
+ });
1429
+ }
1430
+
1431
+
1432
+ /***/ }),
1433
+
1434
+ /***/ 81630:
1435
+ /***/ ((module) => {
1436
+
1437
+ module.exports = require("http");
1438
+
866
1439
  /***/ }),
867
1440
 
868
1441
  /***/ 86439:
@@ -900,7 +1473,7 @@ module.exports = import("@huggingface/transformers");;
900
1473
  var __webpack_require__ = require("../../../../../../webpack-runtime.js");
901
1474
  __webpack_require__.C(exports);
902
1475
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
903
- var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,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__(82855)));
1476
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,540,4189,4955,5908,5120,1388,4540], () => (__webpack_exec__(59861)));
904
1477
  module.exports = __webpack_exports__;
905
1478
 
906
1479
  })();