@circuitwall/jarela 2.2.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (703) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +2 -1
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/routes-manifest.json +8 -0
  6. package/.next/standalone/.next/server/app/_global-error/page.js +68 -68
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_not-found/page.js +76 -76
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +100 -93
  22. package/.next/standalone/.next/server/app/api/v1/access/route.js +176 -169
  23. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +89 -56
  24. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +139 -127
  26. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +107 -100
  27. package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +765 -753
  28. package/.next/standalone/.next/server/app/api/v1/agents/route.js +72 -65
  29. package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +371 -364
  30. package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +809 -802
  31. package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +9 -2
  32. package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +49 -49
  33. package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +910 -910
  34. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +583 -16
  35. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +41 -30
  37. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +48 -37
  38. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +697 -130
  39. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +703 -136
  41. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +796 -229
  43. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +762 -746
  45. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +1050 -1034
  46. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +673 -106
  47. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +811 -804
  49. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/api/v1/bridges/route.js +718 -706
  51. package/.next/standalone/.next/server/app/api/v1/bridges/route.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +9 -9
  53. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/api/v1/config/route.js +85 -85
  55. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +709 -709
  56. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/v1/credentials/route.js +2 -2
  58. package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +10 -10
  60. package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +796 -784
  61. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +30 -23
  62. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +86 -86
  63. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +57 -57
  65. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
  66. package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +385 -378
  67. package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +51 -44
  68. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +65 -65
  69. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +122 -122
  71. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +37 -37
  73. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/api/v1/env/route.js +9 -9
  75. package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +375 -368
  76. package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +51 -44
  77. package/.next/standalone/.next/server/app/api/v1/events/route.js +745 -178
  78. package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/api/v1/events/test/route.js +77 -77
  80. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +763 -763
  81. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
  82. package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +51 -44
  83. package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +16 -9
  84. package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +72 -65
  85. package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +41 -34
  86. package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +211 -204
  87. package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +140 -133
  88. package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +113 -106
  89. package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +121 -114
  90. package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +141 -134
  91. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +690 -690
  92. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +93 -93
  94. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +9 -9
  96. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/api/v1/extensions/route.js +185 -185
  98. package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +171 -171
  100. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
  101. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +396 -396
  102. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +212 -212
  104. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
  105. package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +235 -235
  106. package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +26 -26
  107. package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +228 -221
  108. package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +65 -58
  109. package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +79 -72
  110. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +9 -9
  111. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
  112. package/.next/standalone/.next/server/app/api/v1/health/route.js +783 -771
  113. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +140 -133
  114. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +9 -9
  115. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
  116. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +370 -363
  117. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +240 -233
  118. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +689 -682
  119. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +886 -879
  120. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +115 -108
  121. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +955 -948
  122. package/.next/standalone/.next/server/app/api/v1/integrations/route.js +223 -216
  123. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +876 -847
  124. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js.nft.json +1 -1
  125. package/.next/standalone/.next/server/app/api/v1/local-file/route.js +26 -26
  126. package/.next/standalone/.next/server/app/api/v1/logs/route.js +70 -70
  127. package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +79 -72
  128. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +991 -979
  129. package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +196 -196
  130. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +19 -7
  131. package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +539 -532
  132. package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +86 -79
  133. package/.next/standalone/.next/server/app/api/v1/memory/route.js +58 -51
  134. package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +138 -131
  135. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +381 -369
  136. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js.nft.json +1 -1
  137. package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +150 -143
  138. package/.next/standalone/.next/server/app/api/v1/models/route.js +634 -627
  139. package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +445 -445
  140. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +120 -120
  141. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +234 -234
  143. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +407 -407
  145. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +37 -37
  147. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +107 -107
  149. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +228 -228
  151. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +9 -9
  153. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
  154. package/.next/standalone/.next/server/app/api/v1/packages/route.js +148 -148
  155. package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
  156. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +787 -787
  157. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +529 -514
  159. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
  160. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +181 -181
  161. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
  162. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +258 -258
  163. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
  164. package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +37 -30
  165. package/.next/standalone/.next/server/app/api/v1/profile/route.js +171 -164
  166. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +51 -44
  167. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +15 -8
  168. package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +171 -164
  169. package/.next/standalone/.next/server/app/api/v1/providers/route.js +101 -94
  170. package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +457 -450
  171. package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +44 -37
  172. package/.next/standalone/.next/server/app/api/v1/redaction/route.js +65 -58
  173. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +617 -605
  174. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +44 -44
  175. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
  176. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +739 -732
  177. package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +329 -322
  178. package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +204 -197
  179. package/.next/standalone/.next/server/app/api/v1/security/state/route.js +58 -51
  180. package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +183 -176
  181. package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +194 -187
  182. package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +26 -26
  183. package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +776 -769
  184. package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +122 -115
  185. package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +334 -327
  186. package/.next/standalone/.next/server/app/api/v1/skills/route.js +873 -866
  187. package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +838 -808
  188. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +177 -177
  189. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
  190. package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +164 -164
  191. package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +122 -115
  192. package/.next/standalone/.next/server/app/api/v1/tasks/route.js +30 -23
  193. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +1436 -0
  194. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js.nft.json +1 -0
  195. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route_client-reference-manifest.js +1 -0
  196. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +638 -631
  197. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js.nft.json +1 -1
  198. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +60 -439
  199. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js.nft.json +1 -1
  200. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +172 -173
  201. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
  202. package/.next/standalone/.next/server/app/api/v1/threads/route.js +925 -913
  203. package/.next/standalone/.next/server/app/api/v1/tools/route.js +2 -2
  204. package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
  205. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +17 -17
  206. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
  207. package/.next/standalone/.next/server/app/api/v1/update/route.js +570 -570
  208. package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +241 -229
  209. package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +989 -977
  210. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +40 -28
  211. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +72 -72
  212. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
  213. package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +128 -128
  214. package/.next/standalone/.next/server/app/api/v1/watchers/route.js +164 -164
  215. package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
  216. package/.next/standalone/.next/server/app/icon.svg/route.js +62 -62
  217. package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +436 -436
  218. package/.next/standalone/.next/server/app/page.js +1179 -743
  219. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app/setup/page.js +99 -91
  221. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  222. package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
  223. package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +441 -1022
  224. package/.next/standalone/.next/server/chunks/1433.js +1 -1
  225. package/.next/standalone/.next/server/chunks/1638.js +1 -2
  226. package/.next/standalone/.next/server/chunks/1738.js +1 -1
  227. package/.next/standalone/.next/server/chunks/2068.js +47 -10
  228. package/.next/standalone/.next/server/chunks/210.js +3 -3
  229. package/.next/standalone/.next/server/chunks/2151.js +31 -1
  230. package/.next/standalone/.next/server/chunks/2207.js +1 -0
  231. package/.next/standalone/.next/server/chunks/2447.js +10 -5
  232. package/.next/standalone/.next/server/chunks/2471.js +45 -45
  233. package/.next/standalone/.next/server/chunks/2504.js +1 -1
  234. package/.next/standalone/.next/server/chunks/2695.js +17 -17
  235. package/.next/standalone/.next/server/chunks/3042.js +24 -16
  236. package/.next/standalone/.next/server/chunks/{4540.js → 309.js} +104 -38
  237. package/.next/standalone/.next/server/chunks/{2350.js → 3272.js} +104 -37
  238. package/.next/standalone/.next/server/chunks/3399.js +526 -526
  239. package/.next/standalone/.next/server/chunks/3524.js +150 -67
  240. package/.next/standalone/.next/server/chunks/3566.js +1 -1
  241. package/.next/standalone/.next/server/chunks/4189.js +946 -0
  242. package/.next/standalone/.next/server/chunks/4433.js +146 -146
  243. package/.next/standalone/.next/server/chunks/4508.js +3 -3
  244. package/.next/standalone/.next/server/chunks/4588.js +1 -0
  245. package/.next/standalone/.next/server/chunks/46.js +78 -28
  246. package/.next/standalone/.next/server/chunks/466.js +12 -0
  247. package/.next/standalone/.next/server/chunks/4868.js +206 -206
  248. package/.next/standalone/.next/server/chunks/4992.js +13 -0
  249. package/.next/standalone/.next/server/chunks/5120.js +963 -0
  250. package/.next/standalone/.next/server/chunks/5701.js +1 -1
  251. package/.next/standalone/.next/server/chunks/5900.js +1 -1
  252. package/.next/standalone/.next/server/chunks/5908.js +63 -42
  253. package/.next/standalone/.next/server/chunks/6142.js +10 -2
  254. package/.next/standalone/.next/server/chunks/6210.js +1 -0
  255. package/.next/standalone/.next/server/chunks/6213.js +1 -1
  256. package/.next/standalone/.next/server/chunks/6649.js +3 -3
  257. package/.next/standalone/.next/server/chunks/6703.js +3 -3
  258. package/.next/standalone/.next/server/chunks/7445.js +1 -0
  259. package/.next/standalone/.next/server/chunks/8067.js +12 -0
  260. package/.next/standalone/.next/server/chunks/8461.js +24 -17
  261. package/.next/standalone/.next/server/chunks/8558.js +1 -1
  262. package/.next/standalone/.next/server/chunks/8724.js +1 -1
  263. package/.next/standalone/.next/server/chunks/8849.js +91 -91
  264. package/.next/standalone/.next/server/chunks/9032.js +4 -3
  265. package/.next/standalone/.next/server/chunks/{2563.js → 9164.js} +33389 -31418
  266. package/.next/standalone/.next/server/chunks/9237.js +396 -396
  267. package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1672 -575
  268. package/.next/standalone/.next/server/chunks/9406.js +1 -1
  269. package/.next/standalone/.next/server/chunks/9590.js +68 -18
  270. package/.next/standalone/.next/server/chunks/9824.js +98 -98
  271. package/.next/standalone/.next/server/chunks/9826.js +1 -0
  272. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  273. package/.next/standalone/.next/server/middleware.js +486 -415
  274. package/.next/standalone/.next/server/pages/404.html +2 -2
  275. package/.next/standalone/.next/server/pages/500.html +1 -1
  276. package/.next/standalone/.next/server/preview-props.json +3 -3
  277. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  278. package/.next/standalone/.next/static/chunks/{1395-a340fb0a345382a4.js → 1395-e4a99912b8f83044.js} +13 -1
  279. package/.next/standalone/.next/static/chunks/app/_global-error/{page-36cb8b428b38b26a.js → page-6fc5f8e744c81802.js} +1 -1
  280. package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  281. package/.next/standalone/.next/static/chunks/app/api/v1/access/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  282. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  283. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6fc5f8e744c81802.js +17 -0
  284. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6fc5f8e744c81802.js +17 -0
  285. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6fc5f8e744c81802.js +17 -0
  286. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6fc5f8e744c81802.js +17 -0
  287. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6fc5f8e744c81802.js +17 -0
  288. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6fc5f8e744c81802.js +17 -0
  289. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6fc5f8e744c81802.js +17 -0
  290. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6fc5f8e744c81802.js +17 -0
  291. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6fc5f8e744c81802.js +17 -0
  292. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6fc5f8e744c81802.js +17 -0
  293. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6fc5f8e744c81802.js +17 -0
  294. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6fc5f8e744c81802.js +17 -0
  295. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6fc5f8e744c81802.js +17 -0
  296. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6fc5f8e744c81802.js +17 -0
  297. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6fc5f8e744c81802.js +17 -0
  298. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6fc5f8e744c81802.js +17 -0
  299. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6fc5f8e744c81802.js +17 -0
  300. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6fc5f8e744c81802.js +17 -0
  301. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6fc5f8e744c81802.js +17 -0
  302. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6fc5f8e744c81802.js +17 -0
  303. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6fc5f8e744c81802.js +17 -0
  304. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6fc5f8e744c81802.js +17 -0
  305. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6fc5f8e744c81802.js +17 -0
  306. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6fc5f8e744c81802.js +17 -0
  307. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6fc5f8e744c81802.js +17 -0
  308. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6fc5f8e744c81802.js +17 -0
  309. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6fc5f8e744c81802.js +17 -0
  310. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6fc5f8e744c81802.js +17 -0
  311. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6fc5f8e744c81802.js +17 -0
  312. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6fc5f8e744c81802.js +17 -0
  313. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6fc5f8e744c81802.js +17 -0
  314. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6fc5f8e744c81802.js +17 -0
  315. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6fc5f8e744c81802.js +17 -0
  316. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6fc5f8e744c81802.js +17 -0
  317. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6fc5f8e744c81802.js +17 -0
  318. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6fc5f8e744c81802.js +17 -0
  319. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6fc5f8e744c81802.js +17 -0
  320. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6fc5f8e744c81802.js +17 -0
  321. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6fc5f8e744c81802.js +17 -0
  322. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6fc5f8e744c81802.js +17 -0
  323. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6fc5f8e744c81802.js +17 -0
  324. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6fc5f8e744c81802.js +17 -0
  325. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6fc5f8e744c81802.js +17 -0
  326. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6fc5f8e744c81802.js +17 -0
  327. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6fc5f8e744c81802.js +17 -0
  328. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6fc5f8e744c81802.js +17 -0
  329. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6fc5f8e744c81802.js +17 -0
  330. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6fc5f8e744c81802.js +17 -0
  331. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6fc5f8e744c81802.js +17 -0
  332. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6fc5f8e744c81802.js +17 -0
  333. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6fc5f8e744c81802.js +17 -0
  334. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6fc5f8e744c81802.js +17 -0
  335. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6fc5f8e744c81802.js +17 -0
  336. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6fc5f8e744c81802.js +17 -0
  337. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6fc5f8e744c81802.js +17 -0
  338. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6fc5f8e744c81802.js +17 -0
  339. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6fc5f8e744c81802.js +17 -0
  340. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6fc5f8e744c81802.js +17 -0
  341. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6fc5f8e744c81802.js +17 -0
  342. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6fc5f8e744c81802.js +17 -0
  343. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6fc5f8e744c81802.js +17 -0
  344. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6fc5f8e744c81802.js +17 -0
  345. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6fc5f8e744c81802.js +17 -0
  346. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6fc5f8e744c81802.js +17 -0
  347. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6fc5f8e744c81802.js +17 -0
  348. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  349. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6fc5f8e744c81802.js +17 -0
  350. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6fc5f8e744c81802.js +17 -0
  351. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  352. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6fc5f8e744c81802.js +17 -0
  353. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6fc5f8e744c81802.js +17 -0
  354. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6fc5f8e744c81802.js +17 -0
  355. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6fc5f8e744c81802.js +17 -0
  356. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6fc5f8e744c81802.js +17 -0
  357. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6fc5f8e744c81802.js +17 -0
  358. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6fc5f8e744c81802.js +17 -0
  359. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6fc5f8e744c81802.js +17 -0
  360. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6fc5f8e744c81802.js +17 -0
  361. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6fc5f8e744c81802.js +17 -0
  362. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6fc5f8e744c81802.js +17 -0
  363. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6fc5f8e744c81802.js +17 -0
  364. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6fc5f8e744c81802.js +17 -0
  365. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6fc5f8e744c81802.js +17 -0
  366. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6fc5f8e744c81802.js +17 -0
  367. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6fc5f8e744c81802.js +17 -0
  368. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6fc5f8e744c81802.js +17 -0
  369. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6fc5f8e744c81802.js +17 -0
  370. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6fc5f8e744c81802.js +17 -0
  371. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6fc5f8e744c81802.js +17 -0
  372. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6fc5f8e744c81802.js +17 -0
  373. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6fc5f8e744c81802.js +17 -0
  374. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6fc5f8e744c81802.js +17 -0
  375. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6fc5f8e744c81802.js +17 -0
  376. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6fc5f8e744c81802.js +17 -0
  377. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6fc5f8e744c81802.js +17 -0
  378. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6fc5f8e744c81802.js +17 -0
  379. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6fc5f8e744c81802.js +17 -0
  380. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6fc5f8e744c81802.js +17 -0
  381. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6fc5f8e744c81802.js +17 -0
  382. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6fc5f8e744c81802.js +17 -0
  383. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6fc5f8e744c81802.js +17 -0
  384. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6fc5f8e744c81802.js +17 -0
  385. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6fc5f8e744c81802.js +17 -0
  386. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6fc5f8e744c81802.js +17 -0
  387. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6fc5f8e744c81802.js +17 -0
  388. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6fc5f8e744c81802.js +17 -0
  389. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6fc5f8e744c81802.js +17 -0
  390. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6fc5f8e744c81802.js +17 -0
  391. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6fc5f8e744c81802.js +17 -0
  392. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6fc5f8e744c81802.js +17 -0
  393. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6fc5f8e744c81802.js +17 -0
  394. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6fc5f8e744c81802.js +17 -0
  395. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6fc5f8e744c81802.js +17 -0
  396. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6fc5f8e744c81802.js +17 -0
  397. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6fc5f8e744c81802.js +17 -0
  398. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6fc5f8e744c81802.js +17 -0
  399. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6fc5f8e744c81802.js +17 -0
  400. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6fc5f8e744c81802.js +17 -0
  401. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6fc5f8e744c81802.js +17 -0
  402. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6fc5f8e744c81802.js +17 -0
  403. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6fc5f8e744c81802.js +17 -0
  404. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6fc5f8e744c81802.js +17 -0
  405. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6fc5f8e744c81802.js +17 -0
  406. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6fc5f8e744c81802.js +17 -0
  407. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6fc5f8e744c81802.js +17 -0
  408. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6fc5f8e744c81802.js +17 -0
  409. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6fc5f8e744c81802.js +17 -0
  410. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6fc5f8e744c81802.js +17 -0
  411. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6fc5f8e744c81802.js +17 -0
  412. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6fc5f8e744c81802.js +17 -0
  413. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6fc5f8e744c81802.js +17 -0
  414. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6fc5f8e744c81802.js +17 -0
  415. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6fc5f8e744c81802.js +17 -0
  416. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6fc5f8e744c81802.js +17 -0
  417. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6fc5f8e744c81802.js +17 -0
  418. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6fc5f8e744c81802.js +17 -0
  419. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6fc5f8e744c81802.js +17 -0
  420. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6fc5f8e744c81802.js +17 -0
  421. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6fc5f8e744c81802.js +17 -0
  422. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6fc5f8e744c81802.js +17 -0
  423. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6fc5f8e744c81802.js +17 -0
  424. package/.next/standalone/.next/static/chunks/app/{page-7017f07f8a7a083c.js → page-04748847c6ff866f.js} +1013 -585
  425. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6fc5f8e744c81802.js +17 -0
  426. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6fc5f8e744c81802.js +17 -0
  427. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6fc5f8e744c81802.js +17 -0
  428. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6fc5f8e744c81802.js +17 -0
  429. package/.next/standalone/.next/static/css/{d80058f0b9b41c09.css → 2669e8744cc8c212.css} +2 -2
  430. package/.next/standalone/docs/adoption/changesets.json +358 -0
  431. package/.next/standalone/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  432. package/.next/standalone/package.json +3 -3
  433. package/CHANGELOG.md +44 -0
  434. package/api/client.ts +9 -0
  435. package/api/types.ts +29 -0
  436. package/app/api/v1/lifecycle/adoption/route.ts +14 -2
  437. package/app/api/v1/models/[name]/compact-threads/route.ts +14 -11
  438. package/app/api/v1/threads/[thread_id]/activity/route.ts +19 -0
  439. package/app/api/v1/threads/[thread_id]/context-pin/route.test.ts +1 -0
  440. package/app/api/v1/threads/[thread_id]/context-pin/route.ts +2 -1
  441. package/app/api/v1/threads/[thread_id]/route.ts +5 -1
  442. package/app/api/v1/threads/[thread_id]/run/route.ts +0 -1
  443. package/components/chat/ChatView.tsx +52 -11
  444. package/components/chat/ContextBoundary.test.tsx +68 -1
  445. package/components/chat/ContextBoundary.tsx +92 -13
  446. package/components/chat/MessageBubble.tsx +12 -0
  447. package/components/chat/MessageList.test.tsx +31 -0
  448. package/components/chat/MessageList.tsx +49 -28
  449. package/components/chat/ToolList.test.tsx +92 -16
  450. package/components/chat/ToolList.tsx +59 -4
  451. package/components/chat/chat-helpers.test.tsx +24 -1
  452. package/components/chat/chat-helpers.ts +47 -4
  453. package/components/chat/useThreadActivity.test.tsx +113 -0
  454. package/components/chat/useThreadActivity.ts +94 -0
  455. package/components/chat/useThreadData.ts +16 -16
  456. package/components/chat/workflow-step-retry.ts +25 -0
  457. package/components/integrations/NetworkSection.tsx +2 -2
  458. package/components/ui/BootScreen.tsx +17 -0
  459. package/components/ui/WorkflowChecklist.tsx +71 -33
  460. package/hooks/useSSE.ts +28 -3
  461. package/lib/agents/citation-checker.test.ts +40 -2
  462. package/lib/agents/citation-checker.ts +56 -11
  463. package/lib/agents/compaction-pipeline.test.ts +202 -0
  464. package/lib/agents/compaction-pipeline.ts +483 -0
  465. package/lib/agents/context-boundary.ts +5 -6
  466. package/lib/agents/conversation-summary.ts +37 -21
  467. package/lib/agents/instruction-edits.test.ts +120 -0
  468. package/lib/agents/instruction-edits.ts +65 -42
  469. package/lib/agents/prepare/history-window.test.ts +18 -0
  470. package/lib/agents/prepare/history-window.ts +11 -2
  471. package/lib/agents/prepare/request.ts +4 -2
  472. package/lib/agents/prepare/system-prompt.test.ts +49 -0
  473. package/lib/agents/prepare/system-prompt.ts +16 -5
  474. package/lib/agents/prompt-registry.test.ts +5 -140
  475. package/lib/agents/prompt-registry.ts +45 -1
  476. package/lib/agents/prompt-variants.ts +146 -0
  477. package/lib/agents/proposals.test.ts +76 -0
  478. package/lib/agents/proposals.ts +13 -5
  479. package/lib/agents/run-registry.test.ts +22 -0
  480. package/lib/agents/run-registry.ts +29 -0
  481. package/lib/agents/run-thread.auto-boundary.test.ts +125 -5
  482. package/lib/agents/run-thread.retry.test.ts +67 -1
  483. package/lib/agents/run-thread.ts +110 -10
  484. package/lib/agents/sqlite-checkpoint-saver.test.ts +91 -0
  485. package/lib/agents/thread-activity.test.ts +31 -0
  486. package/lib/agents/thread-activity.ts +27 -0
  487. package/lib/agents/thread-compaction-state.test.ts +82 -0
  488. package/lib/agents/thread-compaction-state.ts +121 -0
  489. package/lib/agents/thread-compaction.test.ts +83 -4
  490. package/lib/agents/thread-compaction.ts +34 -11
  491. package/lib/agents/warm-summary-background.test.ts +219 -5
  492. package/lib/agents/warm-summary-background.ts +346 -143
  493. package/lib/agents/warm-topics.test.ts +191 -0
  494. package/lib/agents/warm-topics.ts +317 -0
  495. package/lib/agents/workflow-step-retry.test.ts +96 -0
  496. package/lib/agents/workflow-step-retry.ts +216 -0
  497. package/lib/api/browser-control.ts +0 -3
  498. package/lib/bridges/dispatcher.ts +1 -0
  499. package/lib/bridges/message-role.test.ts +81 -0
  500. package/lib/bridges/message-role.ts +23 -10
  501. package/lib/bridges/types.ts +6 -0
  502. package/lib/bridges/whatsapp-link.test.ts +32 -0
  503. package/lib/bridges/whatsapp-link.ts +21 -0
  504. package/lib/bridges/whatsapp.inbound.test.ts +239 -0
  505. package/lib/bridges/whatsapp.sender.test.ts +80 -1
  506. package/lib/bridges/whatsapp.ts +76 -38
  507. package/lib/db/migrations.ts +5 -0
  508. package/lib/env/config.ts +2 -0
  509. package/lib/env/schema.ts +12 -0
  510. package/lib/lifecycle/changeset-build.test.ts +93 -0
  511. package/lib/lifecycle/changeset-build.ts +210 -0
  512. package/lib/lifecycle/changesets.test.ts +101 -0
  513. package/lib/lifecycle/changesets.ts +166 -0
  514. package/lib/lifecycle/surface-collect.test.ts +88 -0
  515. package/lib/lifecycle/surface-collect.ts +64 -0
  516. package/lib/lifecycle/surface-snapshot.test.ts +104 -0
  517. package/lib/lifecycle/surface-snapshot.ts +210 -0
  518. package/lib/memory/record.ts +0 -2
  519. package/lib/pricing/snapshot.test.ts +70 -0
  520. package/lib/pricing/snapshot.ts +10 -2
  521. package/lib/providers/external.ts +0 -2
  522. package/lib/proxy/dispatcher.test.ts +119 -1
  523. package/lib/proxy/dispatcher.ts +22 -9
  524. package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  525. package/lib/stores/agent-configs.ts +10 -5
  526. package/lib/stores/bridges.test.ts +81 -0
  527. package/lib/stores/bridges.ts +9 -8
  528. package/lib/stores/proxy-config.test.ts +120 -0
  529. package/lib/stores/proxy-config.ts +22 -4
  530. package/lib/stores/threads.test.ts +9 -0
  531. package/lib/stores/threads.ts +33 -19
  532. package/lib/stores/version-adoption.test.ts +96 -0
  533. package/lib/stores/version-adoption.ts +239 -26
  534. package/lib/stores/workflow-progress.ts +3 -0
  535. package/lib/tools/communications/calendar.test.ts +43 -2
  536. package/lib/tools/communications/calendar.ts +2 -0
  537. package/lib/tools/communications/gmail.test.ts +51 -1
  538. package/lib/tools/communications/gmail.ts +44 -2
  539. package/lib/tools/communications/ms-todo.ts +0 -7
  540. package/lib/tools/communications/outlook-calendar.ts +2 -0
  541. package/lib/tools/communications/outlook.test.ts +33 -2
  542. package/lib/tools/communications/outlook.ts +2 -0
  543. package/lib/tools/filesystem/edit-match.test.ts +133 -0
  544. package/lib/tools/filesystem/edit-match.ts +7 -2
  545. package/lib/tools/general/memory.ts +1 -1
  546. package/lib/tools/general/workflow-progress.ts +2 -0
  547. package/lib/tools/runtime/catalog.ts +1 -25
  548. package/lib/tools/support/result-refs.test.ts +131 -0
  549. package/lib/tools/support/result-refs.ts +41 -9
  550. package/lib/triggers/registry.ts +0 -4
  551. package/lib/utils/source-link.test.ts +51 -0
  552. package/lib/utils/source-link.ts +45 -0
  553. package/package.json +3 -3
  554. package/scripts/install-to-system.ps1 +39 -11
  555. package/scripts/install-to-system.sh +37 -3
  556. package/.next/standalone/.next/server/chunks/3979.js +0 -581
  557. package/.next/standalone/.next/server/chunks/5936.js +0 -594
  558. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-36cb8b428b38b26a.js +0 -17
  559. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-36cb8b428b38b26a.js +0 -17
  560. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-36cb8b428b38b26a.js +0 -17
  561. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-36cb8b428b38b26a.js +0 -17
  562. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-36cb8b428b38b26a.js +0 -17
  563. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-36cb8b428b38b26a.js +0 -17
  564. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-36cb8b428b38b26a.js +0 -17
  565. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-36cb8b428b38b26a.js +0 -17
  566. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-36cb8b428b38b26a.js +0 -17
  567. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-36cb8b428b38b26a.js +0 -17
  568. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-36cb8b428b38b26a.js +0 -17
  569. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-36cb8b428b38b26a.js +0 -17
  570. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-36cb8b428b38b26a.js +0 -17
  571. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-36cb8b428b38b26a.js +0 -17
  572. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-36cb8b428b38b26a.js +0 -17
  573. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-36cb8b428b38b26a.js +0 -17
  574. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-36cb8b428b38b26a.js +0 -17
  575. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-36cb8b428b38b26a.js +0 -17
  576. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-36cb8b428b38b26a.js +0 -17
  577. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-36cb8b428b38b26a.js +0 -17
  578. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-36cb8b428b38b26a.js +0 -17
  579. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-36cb8b428b38b26a.js +0 -17
  580. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-36cb8b428b38b26a.js +0 -17
  581. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-36cb8b428b38b26a.js +0 -17
  582. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-36cb8b428b38b26a.js +0 -17
  583. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-36cb8b428b38b26a.js +0 -17
  584. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-36cb8b428b38b26a.js +0 -17
  585. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-36cb8b428b38b26a.js +0 -17
  586. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-36cb8b428b38b26a.js +0 -17
  587. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-36cb8b428b38b26a.js +0 -17
  588. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-36cb8b428b38b26a.js +0 -17
  589. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-36cb8b428b38b26a.js +0 -17
  590. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-36cb8b428b38b26a.js +0 -17
  591. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-36cb8b428b38b26a.js +0 -17
  592. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-36cb8b428b38b26a.js +0 -17
  593. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-36cb8b428b38b26a.js +0 -17
  594. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-36cb8b428b38b26a.js +0 -17
  595. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-36cb8b428b38b26a.js +0 -17
  596. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-36cb8b428b38b26a.js +0 -17
  597. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-36cb8b428b38b26a.js +0 -17
  598. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-36cb8b428b38b26a.js +0 -17
  599. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-36cb8b428b38b26a.js +0 -17
  600. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-36cb8b428b38b26a.js +0 -17
  601. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-36cb8b428b38b26a.js +0 -17
  602. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-36cb8b428b38b26a.js +0 -17
  603. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-36cb8b428b38b26a.js +0 -17
  604. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-36cb8b428b38b26a.js +0 -17
  605. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-36cb8b428b38b26a.js +0 -17
  606. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-36cb8b428b38b26a.js +0 -17
  607. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-36cb8b428b38b26a.js +0 -17
  608. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-36cb8b428b38b26a.js +0 -17
  609. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-36cb8b428b38b26a.js +0 -17
  610. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-36cb8b428b38b26a.js +0 -17
  611. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-36cb8b428b38b26a.js +0 -17
  612. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-36cb8b428b38b26a.js +0 -17
  613. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-36cb8b428b38b26a.js +0 -17
  614. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-36cb8b428b38b26a.js +0 -17
  615. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-36cb8b428b38b26a.js +0 -17
  616. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-36cb8b428b38b26a.js +0 -17
  617. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-36cb8b428b38b26a.js +0 -17
  618. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-36cb8b428b38b26a.js +0 -17
  619. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-36cb8b428b38b26a.js +0 -17
  620. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-36cb8b428b38b26a.js +0 -17
  621. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-36cb8b428b38b26a.js +0 -17
  622. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-36cb8b428b38b26a.js +0 -17
  623. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  624. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-36cb8b428b38b26a.js +0 -17
  625. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-36cb8b428b38b26a.js +0 -17
  626. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  627. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-36cb8b428b38b26a.js +0 -17
  628. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-36cb8b428b38b26a.js +0 -17
  629. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-36cb8b428b38b26a.js +0 -17
  630. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-36cb8b428b38b26a.js +0 -17
  631. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-36cb8b428b38b26a.js +0 -17
  632. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-36cb8b428b38b26a.js +0 -17
  633. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-36cb8b428b38b26a.js +0 -17
  634. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-36cb8b428b38b26a.js +0 -17
  635. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-36cb8b428b38b26a.js +0 -17
  636. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-36cb8b428b38b26a.js +0 -17
  637. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-36cb8b428b38b26a.js +0 -17
  638. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-36cb8b428b38b26a.js +0 -17
  639. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-36cb8b428b38b26a.js +0 -17
  640. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-36cb8b428b38b26a.js +0 -17
  641. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-36cb8b428b38b26a.js +0 -17
  642. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-36cb8b428b38b26a.js +0 -17
  643. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-36cb8b428b38b26a.js +0 -17
  644. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-36cb8b428b38b26a.js +0 -17
  645. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-36cb8b428b38b26a.js +0 -17
  646. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-36cb8b428b38b26a.js +0 -17
  647. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-36cb8b428b38b26a.js +0 -17
  648. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-36cb8b428b38b26a.js +0 -17
  649. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-36cb8b428b38b26a.js +0 -17
  650. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-36cb8b428b38b26a.js +0 -17
  651. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-36cb8b428b38b26a.js +0 -17
  652. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-36cb8b428b38b26a.js +0 -17
  653. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-36cb8b428b38b26a.js +0 -17
  654. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-36cb8b428b38b26a.js +0 -17
  655. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-36cb8b428b38b26a.js +0 -17
  656. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-36cb8b428b38b26a.js +0 -17
  657. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-36cb8b428b38b26a.js +0 -17
  658. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-36cb8b428b38b26a.js +0 -17
  659. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-36cb8b428b38b26a.js +0 -17
  660. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-36cb8b428b38b26a.js +0 -17
  661. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-36cb8b428b38b26a.js +0 -17
  662. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-36cb8b428b38b26a.js +0 -17
  663. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-36cb8b428b38b26a.js +0 -17
  664. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-36cb8b428b38b26a.js +0 -17
  665. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-36cb8b428b38b26a.js +0 -17
  666. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-36cb8b428b38b26a.js +0 -17
  667. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-36cb8b428b38b26a.js +0 -17
  668. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-36cb8b428b38b26a.js +0 -17
  669. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-36cb8b428b38b26a.js +0 -17
  670. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-36cb8b428b38b26a.js +0 -17
  671. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-36cb8b428b38b26a.js +0 -17
  672. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-36cb8b428b38b26a.js +0 -17
  673. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-36cb8b428b38b26a.js +0 -17
  674. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-36cb8b428b38b26a.js +0 -17
  675. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-36cb8b428b38b26a.js +0 -17
  676. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-36cb8b428b38b26a.js +0 -17
  677. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-36cb8b428b38b26a.js +0 -17
  678. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-36cb8b428b38b26a.js +0 -17
  679. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-36cb8b428b38b26a.js +0 -17
  680. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-36cb8b428b38b26a.js +0 -17
  681. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-36cb8b428b38b26a.js +0 -17
  682. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-36cb8b428b38b26a.js +0 -17
  683. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-36cb8b428b38b26a.js +0 -17
  684. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-36cb8b428b38b26a.js +0 -17
  685. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-36cb8b428b38b26a.js +0 -17
  686. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-36cb8b428b38b26a.js +0 -17
  687. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-36cb8b428b38b26a.js +0 -17
  688. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-36cb8b428b38b26a.js +0 -17
  689. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-36cb8b428b38b26a.js +0 -17
  690. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-36cb8b428b38b26a.js +0 -17
  691. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-36cb8b428b38b26a.js +0 -17
  692. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-36cb8b428b38b26a.js +0 -17
  693. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-36cb8b428b38b26a.js +0 -17
  694. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-36cb8b428b38b26a.js +0 -17
  695. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-36cb8b428b38b26a.js +0 -17
  696. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-36cb8b428b38b26a.js +0 -17
  697. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-36cb8b428b38b26a.js +0 -17
  698. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-36cb8b428b38b26a.js +0 -17
  699. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-36cb8b428b38b26a.js +0 -17
  700. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-36cb8b428b38b26a.js +0 -17
  701. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-36cb8b428b38b26a.js +0 -17
  702. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → hwujW4hR1b-r3k5WdMxZO}/_buildManifest.js +0 -0
  703. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → hwujW4hR1b-r3k5WdMxZO}/_ssgManifest.js +0 -0
@@ -170,668 +170,157 @@ module.exports = require("next/dist/server/app-render/action-async-storage.exter
170
170
 
171
171
  /***/ }),
172
172
 
173
- /***/ 27910:
174
- /***/ ((module) => {
175
-
176
- module.exports = require("stream");
177
-
178
- /***/ }),
179
-
180
- /***/ 28354:
181
- /***/ ((module) => {
182
-
183
- module.exports = require("util");
184
-
185
- /***/ }),
186
-
187
- /***/ 29021:
188
- /***/ ((module) => {
189
-
190
- module.exports = require("fs");
191
-
192
- /***/ }),
193
-
194
- /***/ 29294:
195
- /***/ ((module) => {
196
-
197
- module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
198
-
199
- /***/ }),
200
-
201
- /***/ 31421:
202
- /***/ ((module) => {
203
-
204
- module.exports = require("node:child_process");
205
-
206
- /***/ }),
207
-
208
- /***/ 33873:
209
- /***/ ((module) => {
210
-
211
- module.exports = require("path");
212
-
213
- /***/ }),
214
-
215
- /***/ 35133:
173
+ /***/ 24187:
216
174
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
217
175
 
218
176
  __webpack_require__.r(__webpack_exports__);
219
177
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
220
- /* harmony export */ GET: () => (/* binding */ GET)
178
+ /* harmony export */ handler: () => (/* binding */ handler),
179
+ /* harmony export */ patchFetch: () => (/* binding */ patchFetch),
180
+ /* harmony export */ routeModule: () => (/* binding */ routeModule),
181
+ /* harmony export */ serverHooks: () => (/* binding */ serverHooks),
182
+ /* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
183
+ /* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
221
184
  /* harmony export */ });
222
- /* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39947);
223
- /* harmony import */ var _lib_stores_dashboard_metrics__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14955);
224
- /* harmony import */ var _lib_pricing_snapshot__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76142);
225
- /* harmony import */ var _lib_stores_model_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80937);
226
- /* harmony import */ var _lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41720);
185
+ /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
186
+ /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__);
187
+ /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
188
+ /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
189
+ /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__);
190
+ /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
191
+ /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__);
192
+ /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
193
+ /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__);
194
+ /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
195
+ /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__);
196
+ /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
197
+ /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__);
198
+ /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
199
+ /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__);
200
+ /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
201
+ /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__);
202
+ /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
203
+ /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__);
204
+ /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
205
+ /* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
206
+ /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
207
+ /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__);
208
+ /* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
209
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
210
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
211
+ /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
212
+ /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__);
213
+ /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
214
+ /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__);
215
+ /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
216
+ /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__);
227
217
 
228
218
 
229
219
 
230
220
 
231
221
 
232
- function defaultPricingProviders() {
233
- const providers = new Set();
234
- const defaultModel = (0,_lib_stores_model_config__WEBPACK_IMPORTED_MODULE_3__/* .getDefaultModelConfig */ .lB)();
235
- if (defaultModel?.provider?.trim()) {
236
- providers.add(defaultModel.provider.trim().toLowerCase());
237
- }
238
- const defaultAgent = (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_4__/* .getDefaultAgentConfig */ .vU)();
239
- if (defaultAgent?.model_config_name?.trim()) {
240
- const cfg = (0,_lib_stores_model_config__WEBPACK_IMPORTED_MODULE_3__/* .getModelConfig */ .Ac)(defaultAgent.model_config_name.trim());
241
- if (cfg?.provider?.trim()) {
242
- providers.add(cfg.provider.trim().toLowerCase());
243
- }
244
- }
245
- return [
246
- ...providers
247
- ];
248
- }
249
- async function GET(req) {
250
- try {
251
- await (0,_lib_pricing_snapshot__WEBPACK_IMPORTED_MODULE_2__/* .refreshPricingSnapshot */ .O)({
252
- force: false,
253
- providers: defaultPricingProviders()
254
- });
255
- const daysRaw = req.nextUrl.searchParams.get("days");
256
- const days = daysRaw ? Number(daysRaw) : undefined;
257
- const metrics = await (0,_lib_stores_dashboard_metrics__WEBPACK_IMPORTED_MODULE_1__/* .getDashboardMetrics */ .cU)(days);
258
- return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_0__/* .cachedJson */ .Bm)(metrics, 30);
259
- } catch (err) {
260
- console.error("[dashboard-metrics] failed:", err);
261
- return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_0__/* .errorResponse */ .yj)("Failed to load dashboard metrics", 500);
262
- }
263
- }
264
222
 
265
223
 
266
- /***/ }),
267
224
 
268
- /***/ 37067:
269
- /***/ ((module) => {
270
225
 
271
- module.exports = require("node:http");
272
226
 
273
- /***/ }),
274
227
 
275
- /***/ 38522:
276
- /***/ ((module) => {
277
228
 
278
- module.exports = require("node:zlib");
279
229
 
280
- /***/ }),
281
230
 
282
- /***/ 39947:
283
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
284
231
 
285
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286
- /* harmony export */ Bm: () => (/* binding */ cachedJson),
287
- /* harmony export */ HN: () => (/* binding */ notFoundResponse),
288
- /* harmony export */ Jb: () => (/* binding */ validateBody),
289
- /* harmony export */ K2: () => (/* binding */ createdResponse),
290
- /* harmony export */ Ng: () => (/* binding */ noStoreJson),
291
- /* harmony export */ yj: () => (/* binding */ errorResponse)
292
- /* harmony export */ });
293
- /* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
294
- // Shared HTTP response builders for app/api/v1/** route handlers.
295
- //
296
- // Goal: every error/success payload across the v1 surface has the same
297
- // shape. Before this lived inline, response bodies drifted —
298
- // `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
299
- // some routes returned Zod's raw issue array, others stringified it.
300
232
 
301
- function errorResponse(message, status = 400) {
302
- return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
303
- error: message
304
- }, {
305
- status
306
- });
307
- }
308
- function notFoundResponse(message = "Not found") {
309
- return errorResponse(message, 404);
310
- }
311
- function createdResponse(data) {
312
- return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
313
- status: 201
314
- });
315
- }
316
- // Wrap a 200 JSON response with a private Cache-Control header. Use on safe
317
- // GET endpoints that serve user-scoped data the client refetches often (panel
318
- // mounts, navigation back/forward) but mutates rarely. The TTL is short
319
- // enough that explicit mutations — which patch the client-side ApiClient
320
- // cache in place — stay observably consistent without an extra roundtrip.
321
- //
322
- // swrSeconds (optional): stale-while-revalidate window. When set, the browser
323
- // serves the cached response immediately and refreshes in the background,
324
- // making navigation feel instant. Use for data that can tolerate brief
325
- // staleness (tool list, agent configs, model list). Omit for real-time data
326
- // (dashboard metrics, credential state).
327
- function cachedJson(data, maxAgeSeconds, swrSeconds) {
328
- const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
329
- return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
330
- headers: {
331
- "Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
332
- }
333
- });
334
- }
335
- // Use for endpoints whose response contains live state that must never be
336
- // served from cache — credentials, connection status, live config values.
337
- function noStoreJson(data) {
338
- return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
339
- headers: {
340
- "Cache-Control": "no-store"
341
- }
233
+
234
+
235
+ // We inject the nextConfigOutput here so that we can use them in the route
236
+ // module.
237
+ const nextConfigOutput = "standalone"
238
+ const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
239
+ definition: {
240
+ kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
241
+ page: "/api/v1/dashboard/metrics/route",
242
+ pathname: "/api/v1/dashboard/metrics",
243
+ filename: "route",
244
+ bundlePath: "app/api/v1/dashboard/metrics/route"
245
+ },
246
+ distDir: ".next" || 0,
247
+ relativeProjectDir: false || '',
248
+ resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/dashboard/metrics/route.ts",
249
+ nextConfigOutput,
250
+ // The lazy require factory ensures that:
251
+ // - In dev: devRequestTimingInternalsEnd is set before userland executes,
252
+ // correctly attributing module load time to application-code rather than
253
+ // framework internals.
254
+ // - In all modes: async modules (route files with top-level await) are
255
+ // handled correctly — require() returns a Promise for such modules, which
256
+ // ensureUserland() awaits before the first request is handled.
257
+ userland: ()=>__webpack_require__(35133),
258
+ // In Turbopack dev mode, also provide a synchronous per-request getter so
259
+ // server HMR updates are picked up without re-executing the entry chunk.
260
+ // Using require() (synchronous) avoids adding async overhead that would be
261
+ // incorrectly attributed to application-code time in devRequestTiming.
262
+ ... false ? 0 : {}
263
+ });
264
+ // Pull out the exports that we need to expose from the module. This should
265
+ // be eliminated when we've moved the other routes to the new format. These
266
+ // are used to hook into the route.
267
+ const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
268
+ function patchFetch() {
269
+ return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
270
+ workAsyncStorage,
271
+ workUnitAsyncStorage
342
272
  });
343
273
  }
344
- // Validate a JSON request body against a zod schema.
345
- // Returns either the parsed data or a 400 NextResponse explaining the issue.
346
- // Caller pattern:
347
- // const parsed = await validateBody(req, Schema);
348
- // if (parsed instanceof NextResponse) return parsed;
349
- // // use parsed.field
350
- async function validateBody(req, schema) {
351
- let raw;
352
- try {
353
- raw = await req.json();
354
- } catch {
355
- return errorResponse("Request body must be valid JSON", 400);
274
+
275
+ async function handler(req, res, ctx) {
276
+ if (ctx.requestMeta) {
277
+ (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
356
278
  }
357
- const parsed = schema.safeParse(raw);
358
- if (!parsed.success) {
359
- return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
279
+ if (routeModule.isDev) {
280
+ (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
360
281
  }
361
- return parsed.data;
362
- }
363
-
364
-
365
- /***/ }),
366
-
367
- /***/ 41720:
368
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
369
-
370
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
371
- /* harmony export */ BM: () => (/* binding */ upsertAgentConfig),
372
- /* harmony export */ E1: () => (/* binding */ updateAgentDisplayFilters),
373
- /* harmony export */ P2: () => (/* binding */ parseCitationStrictness),
374
- /* harmony export */ S2: () => (/* binding */ getAgentToolCredentials),
375
- /* harmony export */ SJ: () => (/* binding */ generateAgentId),
376
- /* harmony export */ TG: () => (/* binding */ getAgentTools),
377
- /* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
378
- /* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
379
- /* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
380
- /* harmony export */ mJ: () => (/* binding */ getAgentConfig),
381
- /* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
382
- /* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
383
- /* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
384
- /* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
385
- /* harmony export */ zb: () => (/* binding */ listAgentConfigs)
386
- /* harmony export */ });
387
- /* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
388
- /* harmony import */ var _lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99043);
389
- /* harmony import */ var _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66849);
390
-
391
-
392
-
393
- const now = ()=>new Date().toISOString();
394
- /** Coerce arbitrary input (DB row TEXT, API body, undefined) to the enum.
395
- * Returns `null` for null/undefined/unknown values so callers can default. */ function parseCitationStrictness(value) {
396
- if (value === "off" || value === "informational" || value === "standard" || value === "strict") {
397
- return value;
282
+ let srcPage = "/api/v1/dashboard/metrics/route";
283
+ // turbopack doesn't normalize `/index` in the page name
284
+ // so we need to to process dynamic routes properly
285
+ // TODO: fix turbopack providing differing value from webpack
286
+ if (false) {} else if (srcPage === '/index') {
287
+ // we always normalize /index specifically
288
+ srcPage = '/';
398
289
  }
399
- return null;
400
- }
401
- /**
402
- * Parse the JSON-encoded per-agent override of context tier proportions.
403
- * Returns `null` for NULL, blank, malformed JSON, or any payload that
404
- * doesn't have three finite non-negative numeric fields. Callers fall
405
- * back to the model config's value (or built-in defaults) on null.
406
- */ function getAgentTierProportions(row) {
407
- const raw = row.context_tier_proportions;
408
- if (!raw) return null;
409
- try {
410
- const parsed = JSON.parse(raw);
411
- const hot = Number(parsed.hot);
412
- const warm = Number(parsed.warm);
413
- const facts = Number(parsed.facts);
414
- if (![
415
- hot,
416
- warm,
417
- facts
418
- ].every((n)=>Number.isFinite(n) && n >= 0)) return null;
419
- if (hot + warm + facts <= 0) return null;
420
- return {
421
- hot,
422
- warm,
423
- facts
424
- };
425
- } catch {
290
+ const multiZoneDraftMode = false;
291
+ const prepareResult = await routeModule.prepare(req, res, {
292
+ srcPage,
293
+ multiZoneDraftMode
294
+ });
295
+ if (!prepareResult) {
296
+ res.statusCode = 400;
297
+ res.end('Bad Request');
298
+ ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
426
299
  return null;
427
300
  }
428
- }
429
- function listAgentConfigs() {
430
- // Default agent always first; then by the timestamp of each agent's latest message.
431
- return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT a.*
432
- FROM agent_configs a
433
- LEFT JOIN (
434
- SELECT t.agent_id, MAX(m.created_at) AS last_message_at
435
- FROM threads t
436
- JOIN messages m ON m.thread_id = t.thread_id
437
- GROUP BY t.agent_id
438
- ) latest ON latest.agent_id = a.id
439
- ORDER BY a.is_default DESC, COALESCE(latest.last_message_at, a.created_at) DESC, a.id ASC`).all();
440
- }
441
- function getDefaultAgentConfig() {
442
- return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE is_default=1 LIMIT 1").get() ?? null;
443
- }
444
- function getAgentConfig(id) {
445
- return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE id=?").get(id) ?? null;
446
- }
447
- /**
448
- * Parse the JSON-encoded delegate whitelist into a deduped string[]. Returns
449
- * an empty array for NULL, blank, or malformed JSON (delegation is opt-in).
450
- */ /**
451
- * Parse the agent's tool allowlist (`tools` column, stored as a JSON string).
452
- * Returns an empty array on NULL/blank/malformed JSON — same defensive shape
453
- * as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
454
- * inline should switch to this getter so the serialization contract stays
455
- * owned by this store.
456
- */ function getAgentTools(cfg) {
457
- if (!cfg?.tools) return [];
458
- try {
459
- const parsed = JSON.parse(cfg.tools);
460
- if (!Array.isArray(parsed)) return [];
461
- return parsed.filter((x)=>typeof x === "string" && x.length > 0);
462
- } catch {
463
- return [];
464
- }
465
- }
466
- function parseDelegateTargets(raw) {
467
- if (!raw) return [];
468
- try {
469
- const parsed = JSON.parse(raw);
470
- if (!Array.isArray(parsed)) return [];
471
- const ids = parsed.filter((x)=>typeof x === "string" && x.length > 0);
472
- return Array.from(new Set(ids));
473
- } catch {
474
- return [];
475
- }
476
- }
477
- /**
478
- * Parse the per-agent `{ toolName: credentialId }` override map stored in
479
- * the `tool_credentials` column. Returns an empty record on NULL / blank /
480
- * malformed JSON / non-string entries so downstream code can treat the
481
- * result as a plain lookup without further validation.
482
- */ function getAgentToolCredentials(cfg) {
483
- if (!cfg?.tool_credentials) return {};
484
- try {
485
- const parsed = JSON.parse(cfg.tool_credentials);
486
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
487
- const out = {};
488
- for (const [k, v] of Object.entries(parsed)){
489
- if (typeof v === "string" && v.length > 0) out[k] = v;
301
+ const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
302
+ const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
303
+ // Only this route's prerenders can establish ISR or admit generated params.
304
+ const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]) && (routeModule.isDev || (0,next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__.isRouteCacheOwner)(resolvedPathname, routeModule.cacheOwner, prerenderManifest.routes[resolvedPathname]));
305
+ let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
306
+ const render404 = async ()=>{
307
+ // TODO: should route-module itself handle rendering the 404
308
+ if (routerServerContext == null ? void 0 : routerServerContext.render404) {
309
+ await routerServerContext.render404(req, res, parsedUrl, false);
310
+ } else {
311
+ res.end('This page could not be found');
490
312
  }
491
- return out;
492
- } catch {
493
- return {};
494
- }
495
- }
496
- function upsertAgentConfig(input) {
497
- return (0,_lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__/* .withDbTransaction */ .J)(()=>upsertAgentConfigTransaction(input));
498
- }
499
- function upsertAgentConfigTransaction(input) {
500
- const t = now();
501
- const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
502
- const existing = getAgentConfig(input.id);
503
- const created_at = existing?.created_at ?? t;
504
- const mbti = input.adaptive_mbti ?? toMbti(existing?.adaptive_mbti) ?? "INTJ";
505
- const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
506
- const strength = input.adaptive_persona_strength ?? preset.strength;
507
- const empathy = input.adaptive_empathy ?? preset.empathy;
508
- const expressiveness = input.adaptive_expressiveness ?? preset.expressiveness;
509
- const verbosity = input.adaptive_verbosity ?? preset.verbosity;
510
- if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
511
- // harness_id: explicit `undefined` means "keep existing"; explicit `null`
512
- // means "use the global default". Empty string is normalised to null too,
513
- // matching how the AgentEditor sends "" for the inherit option.
514
- const harnessId = input.harness_id === undefined ? existing?.harness_id ?? null : input.harness_id && input.harness_id.length > 0 ? input.harness_id : null;
515
- // delegate_targets: undefined = keep existing; explicit empty array clears.
516
- const delegateTargets = input.delegate_targets === undefined ? existing?.delegate_targets ?? null : JSON.stringify(Array.from(new Set(input.delegate_targets.filter((id)=>id && id !== input.id))));
517
- // context_tier_proportions: undefined = keep existing; null = clear and
518
- // inherit from the model; object = serialise as JSON. Negative values are
519
- // clamped to 0 so the upsert can't poison the column with bad data.
520
- const tierProportions = input.context_tier_proportions === undefined ? existing?.context_tier_proportions ?? null : input.context_tier_proportions === null ? null : JSON.stringify({
521
- hot: Math.max(0, Number(input.context_tier_proportions.hot) || 0),
522
- warm: Math.max(0, Number(input.context_tier_proportions.warm) || 0),
523
- facts: Math.max(0, Number(input.context_tier_proportions.facts) || 0)
524
- });
525
- // Anti-hallucination override: `undefined` keeps existing; `null` clears
526
- // the override (inherits env). Empty-string model is normalised to null
527
- // so the editor can ship "" for the inherit option.
528
- const antiHallucMode = input.anti_hallucination_mode === undefined ? existing?.anti_hallucination_mode ?? null : input.anti_hallucination_mode === null ? null : input.anti_hallucination_mode === "off" || input.anti_hallucination_mode === "regex" || input.anti_hallucination_mode === "model" ? input.anti_hallucination_mode : null;
529
- const antiHallucModel = input.anti_hallucination_model_config === undefined ? existing?.anti_hallucination_model_config ?? null : input.anti_hallucination_model_config && input.anti_hallucination_model_config.trim().length > 0 ? input.anti_hallucination_model_config.trim() : null;
530
- const citationStrictness = input.citation_strictness === undefined ? parseCitationStrictness(existing?.citation_strictness) ?? "off" : parseCitationStrictness(input.citation_strictness) ?? "off";
531
- const toolCredentials = serialiseToolCredentials(input.tool_credentials, existing?.tool_credentials ?? null);
532
- const VALID_ROUTER_POLICIES = new Set([
533
- "cheap",
534
- "fast",
535
- "balanced",
536
- "quality"
537
- ]);
538
- const routerPolicy = input.router_policy === undefined ? existing?.router_policy ?? null : input.router_policy !== null && VALID_ROUTER_POLICIES.has(input.router_policy) ? input.router_policy : null;
539
- const routerEnabled = input.router_enabled === undefined ? existing?.router_enabled ?? null : input.router_enabled === null ? null : input.router_enabled ? 1 : 0;
540
- const VALID_USAGE_STRATEGIES = new Set([
541
- "cost_saving",
542
- "fast",
543
- "balanced",
544
- "high_reasoning"
545
- ]);
546
- const usageStrategy = input.usage_strategy === undefined ? existing?.usage_strategy ?? null : input.usage_strategy !== null && VALID_USAGE_STRATEGIES.has(input.usage_strategy) ? input.usage_strategy : null;
547
- const requestedWarmSummaryLimit = input.warm_summary_limit ?? existing?.warm_summary_limit ?? 50;
548
- const warmSummaryLimit = Number.isFinite(requestedWarmSummaryLimit) ? Math.max(0, Math.floor(requestedWarmSummaryLimit)) : existing?.warm_summary_limit ?? 50;
549
- db.prepare(`INSERT OR REPLACE INTO agent_configs
550
- (id, name, icon, identity, instructions, tools, model_config_name, is_default,
551
- history_limit, history_window_hours, warm_summary_limit, never_reply,
552
- hot_turn_limit,
553
- adaptive_persona_enabled, adaptive_persona_strength, adaptive_empathy, adaptive_expressiveness, adaptive_verbosity, adaptive_mbti,
554
- voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
555
- harness_id, delegate_targets, context_tier_proportions,
556
- anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
557
- tool_credentials, router_policy, router_enabled, usage_strategy,
558
- created_at, updated_at)
559
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(input.id, input.name, input.icon ?? null, input.identity, input.instructions, JSON.stringify(input.tools), input.model_config_name ?? null, input.is_default ? 1 : existing?.is_default ?? 0, input.history_limit ?? existing?.history_limit ?? 50, input.history_window_hours ?? existing?.history_window_hours ?? 8, warmSummaryLimit, // never_reply is a boolean toggle — explicit `undefined` means "keep existing"
560
- // (important for PATCH-style updates that omit the field).
561
- input.never_reply === undefined ? existing?.never_reply ?? 0 : input.never_reply ? 1 : 0, Math.max(0, Math.floor(input.hot_turn_limit ?? existing?.hot_turn_limit ?? 12)), input.adaptive_persona_enabled === undefined ? existing?.adaptive_persona_enabled ?? 0 : input.adaptive_persona_enabled ? 1 : 0, clampPercent(strength, existing?.adaptive_persona_strength ?? 50), clampPercent(empathy, existing?.adaptive_empathy ?? 50), clampPercent(expressiveness, existing?.adaptive_expressiveness ?? 50), clampPercent(verbosity, existing?.adaptive_verbosity ?? 50), mbti, input.voice_enabled === undefined ? existing?.voice_enabled ?? 0 : input.voice_enabled ? 1 : 0, (input.voice_model ?? existing?.voice_model ?? "gemini-2.5-flash-preview-tts").trim() || "gemini-2.5-flash-preview-tts", (input.voice_name ?? existing?.voice_name ?? "Kore").trim() || "Kore", (input.voice_stt_model ?? existing?.voice_stt_model ?? "gemini-2.5-flash").trim() || "gemini-2.5-flash", input.voice_auto_speak === undefined ? existing?.voice_auto_speak ?? 1 : input.voice_auto_speak ? 1 : 0, harnessId, delegateTargets, tierProportions, antiHallucMode, antiHallucModel, citationStrictness, toolCredentials, routerPolicy, routerEnabled, usageStrategy, created_at, t);
562
- return getAgentConfig(input.id);
563
- }
564
- function clampPercent(next, fallback) {
565
- const n = Number.isFinite(next) ? Number(next) : fallback;
566
- return Math.max(0, Math.min(100, Math.round(n)));
567
- }
568
- function serialiseToolCredentials(input, existing) {
569
- if (input === undefined) return existing;
570
- const cleaned = {};
571
- for (const [k, v] of Object.entries(input)){
572
- if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
573
- cleaned[k] = v;
574
- }
575
- }
576
- if (Object.keys(cleaned).length === 0) return null;
577
- return JSON.stringify(cleaned);
578
- }
579
- function toMbti(v) {
580
- if (!v) return null;
581
- return v in _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e ? v : null;
582
- }
583
- function deleteAgentConfig(id) {
584
- return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM agent_configs WHERE id=?").run(id).changes > 0;
585
- }
586
- function generateAgentId(name) {
587
- const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
588
- const suffix = Math.random().toString(36).slice(2, 6);
589
- return slug ? `${slug}-${suffix}` : `agent-${suffix}`;
590
- }
591
- // ── ADR-0022: per-agent message-channel display filters ─────────────────
592
- // Canonical channel keys mirrored in `hooks/useMessageFilters.ts`. Kept
593
- // in sync there by importing this constant — single source of truth.
594
- const DISPLAY_FILTER_KEYS = [
595
- "scheduled_task",
596
- "watcher",
597
- "bridge",
598
- "extension",
599
- "page_capture",
600
- "synthetic",
601
- "tool_use",
602
- "thinking"
603
- ];
604
- const DISPLAY_FILTER_DEFAULTS = {
605
- scheduled_task: true,
606
- watcher: true,
607
- bridge: true,
608
- extension: true,
609
- page_capture: true,
610
- synthetic: true,
611
- tool_use: true,
612
- thinking: true
613
- };
614
- function parseDisplayFilters(raw) {
615
- if (!raw) return {
616
- ...DISPLAY_FILTER_DEFAULTS
617
- };
618
- try {
619
- const parsed = JSON.parse(raw);
620
- // Merge over defaults so newly-added channels stay visible on old rows.
621
- return {
622
- ...DISPLAY_FILTER_DEFAULTS,
623
- ...parsed
624
- };
625
- } catch {
626
- return {
627
- ...DISPLAY_FILTER_DEFAULTS
628
- };
629
- }
630
- }
631
- function getAgentDisplayFilters(id) {
632
- const row = getAgentConfig(id);
633
- if (!row) return null;
634
- return parseDisplayFilters(row.display_filters);
635
- }
636
- /**
637
- * Merge a partial filter map into the agent's stored prefs. Pass `null` to
638
- * reset to defaults (clears the column). Safe against concurrent toggles
639
- * from multiple browser tabs because the merge happens server-side.
640
- */ function updateAgentDisplayFilters(id, patch) {
641
- const row = getAgentConfig(id);
642
- if (!row) return null;
643
- if (patch === null) {
644
- (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=NULL, updated_at=? WHERE id=?").run(now(), id);
645
- return {
646
- ...DISPLAY_FILTER_DEFAULTS
647
- };
648
- }
649
- const current = parseDisplayFilters(row.display_filters);
650
- const next = {
651
- ...current
652
- };
653
- for (const k of DISPLAY_FILTER_KEYS){
654
- if (k in patch && typeof patch[k] === "boolean") next[k] = patch[k];
655
- }
656
- (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=?, updated_at=? WHERE id=?").run(JSON.stringify(next), now(), id);
657
- return next;
658
- }
659
-
660
-
661
- /***/ }),
662
-
663
- /***/ 44708:
664
- /***/ ((module) => {
665
-
666
- module.exports = require("node:https");
667
-
668
- /***/ }),
669
-
670
- /***/ 44870:
671
- /***/ ((module) => {
672
-
673
- module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
674
-
675
- /***/ }),
676
-
677
- /***/ 48161:
678
- /***/ ((module) => {
679
-
680
- module.exports = require("node:os");
681
-
682
- /***/ }),
683
-
684
- /***/ 48833:
685
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
686
-
687
- __webpack_require__.r(__webpack_exports__);
688
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
689
- /* harmony export */ handler: () => (/* binding */ handler),
690
- /* harmony export */ patchFetch: () => (/* binding */ patchFetch),
691
- /* harmony export */ routeModule: () => (/* binding */ routeModule),
692
- /* harmony export */ serverHooks: () => (/* binding */ serverHooks),
693
- /* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
694
- /* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
695
- /* harmony export */ });
696
- /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
697
- /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__);
698
- /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
699
- /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
700
- /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__);
701
- /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
702
- /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__);
703
- /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
704
- /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__);
705
- /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
706
- /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__);
707
- /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
708
- /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__);
709
- /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
710
- /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__);
711
- /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
712
- /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__);
713
- /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
714
- /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__);
715
- /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
716
- /* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
717
- /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
718
- /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__);
719
- /* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
720
- /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
721
- /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
722
- /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
723
- /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__);
724
- /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
725
- /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__);
726
- /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
727
- /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__);
728
-
729
-
730
-
731
-
732
-
733
-
734
-
735
-
736
-
737
-
738
-
739
-
740
-
741
-
742
-
743
-
744
-
745
-
746
- // We inject the nextConfigOutput here so that we can use them in the route
747
- // module.
748
- const nextConfigOutput = "standalone"
749
- const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
750
- definition: {
751
- kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
752
- page: "/api/v1/dashboard/metrics/route",
753
- pathname: "/api/v1/dashboard/metrics",
754
- filename: "route",
755
- bundlePath: "app/api/v1/dashboard/metrics/route"
756
- },
757
- distDir: ".next" || 0,
758
- relativeProjectDir: false || '',
759
- resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/dashboard/metrics/route.ts",
760
- nextConfigOutput,
761
- // The lazy require factory ensures that:
762
- // - In dev: devRequestTimingInternalsEnd is set before userland executes,
763
- // correctly attributing module load time to application-code rather than
764
- // framework internals.
765
- // - In all modes: async modules (route files with top-level await) are
766
- // handled correctly — require() returns a Promise for such modules, which
767
- // ensureUserland() awaits before the first request is handled.
768
- userland: ()=>__webpack_require__(35133),
769
- // In Turbopack dev mode, also provide a synchronous per-request getter so
770
- // server HMR updates are picked up without re-executing the entry chunk.
771
- // Using require() (synchronous) avoids adding async overhead that would be
772
- // incorrectly attributed to application-code time in devRequestTiming.
773
- ... false ? 0 : {}
774
- });
775
- // Pull out the exports that we need to expose from the module. This should
776
- // be eliminated when we've moved the other routes to the new format. These
777
- // are used to hook into the route.
778
- const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
779
- function patchFetch() {
780
- return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
781
- workAsyncStorage,
782
- workUnitAsyncStorage
783
- });
784
- }
785
-
786
- async function handler(req, res, ctx) {
787
- if (ctx.requestMeta) {
788
- (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
789
- }
790
- if (routeModule.isDev) {
791
- (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
792
- }
793
- let srcPage = "/api/v1/dashboard/metrics/route";
794
- // turbopack doesn't normalize `/index` in the page name
795
- // so we need to to process dynamic routes properly
796
- // TODO: fix turbopack providing differing value from webpack
797
- if (false) {} else if (srcPage === '/index') {
798
- // we always normalize /index specifically
799
- srcPage = '/';
800
- }
801
- const multiZoneDraftMode = false;
802
- const prepareResult = await routeModule.prepare(req, res, {
803
- srcPage,
804
- multiZoneDraftMode
805
- });
806
- if (!prepareResult) {
807
- res.statusCode = 400;
808
- res.end('Bad Request');
809
- ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
810
- return null;
811
- }
812
- const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
813
- const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
814
- // Only this route's prerenders can establish ISR or admit generated params.
815
- const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]) && (routeModule.isDev || (0,next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__.isRouteCacheOwner)(resolvedPathname, routeModule.cacheOwner, prerenderManifest.routes[resolvedPathname]));
816
- let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
817
- const render404 = async ()=>{
818
- // TODO: should route-module itself handle rendering the 404
819
- if (routerServerContext == null ? void 0 : routerServerContext.render404) {
820
- await routerServerContext.render404(req, res, parsedUrl, false);
821
- } else {
822
- res.end('This page could not be found');
823
- }
824
- return null;
825
- };
826
- if (isIsr && !isDraftMode) {
827
- const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
828
- if (prerenderInfo) {
829
- if (prerenderInfo.fallback === false && !isPrerendered) {
830
- if (nextConfig.adapterPath) {
831
- return await render404();
832
- }
833
- throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
834
- }
313
+ return null;
314
+ };
315
+ if (isIsr && !isDraftMode) {
316
+ const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
317
+ if (prerenderInfo) {
318
+ if (prerenderInfo.fallback === false && !isPrerendered) {
319
+ if (nextConfig.adapterPath) {
320
+ return await render404();
321
+ }
322
+ throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
323
+ }
835
324
  }
836
325
  }
837
326
  let cacheKey = null;
@@ -967,161 +456,677 @@ async function handler(req, res, ctx) {
967
456
  throw err;
968
457
  }
969
458
  };
970
- const handleResponse = async (currentSpan, parentSpan)=>{
971
- try {
972
- var _cacheEntry_value;
973
- const cacheEntry = await routeModule.handleResponse({
974
- req,
975
- nextConfig,
976
- cacheKey,
977
- routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
978
- isFallback: false,
979
- previewProps,
980
- prerenderManifest,
981
- isRoutePPREnabled: false,
982
- isOnDemandRevalidate,
983
- revalidateOnlyGenerated,
984
- responseGenerator,
985
- waitUntil: ctx.waitUntil,
986
- isMinimalMode
987
- });
988
- if (cacheEntry !== null && 'error' in cacheEntry) {
989
- throw cacheEntry.error;
990
- }
991
- // we don't create a cacheEntry for ISR
992
- if (!isIsr) {
993
- return;
994
- }
995
- if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE) {
996
- var _cacheEntry_value1;
997
- throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
998
- }
999
- if (!isMinimalMode) {
1000
- res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
1001
- }
1002
- // Draft mode should never be cached
1003
- if (isDraftMode) {
1004
- res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
1005
- }
1006
- const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
1007
- if (!(isMinimalMode && isIsr)) {
1008
- headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
1009
- }
1010
- // If cache control is already set on the response we don't
1011
- // override it to allow users to customize it via next.config
1012
- if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
1013
- headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
1014
- }
1015
- await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.
1016
- new Response(cacheEntry.value.body, {
1017
- headers,
1018
- status: cacheEntry.value.status || 200
1019
- }));
1020
- return;
1021
- } catch (err) {
1022
- if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
1023
- const silenceLog = false;
1024
- await routeModule.onRequestError(req, err, {
1025
- routerKind: 'App Router',
1026
- routePath: normalizedSrcPage,
1027
- routeType: 'route',
1028
- revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
1029
- isStaticGeneration: cacheKey !== null,
1030
- isOnDemandRevalidate
1031
- })
1032
- }, silenceLog, routerServerContext);
1033
- }
1034
- // rethrow so that we can handle serving error page
1035
- // If this is during static generation, throw the error again.
1036
- if (isIsr) throw err;
1037
- // Otherwise, send a 500 response unless the original response has
1038
- // already committed. In that case, preserve its status code for
1039
- // telemetry while still recording the failure and terminating a response
1040
- // that the failed pipeline left open.
1041
- if (res.headersSent) {
1042
- if (currentSpan) {
1043
- const error = err instanceof Error ? err : new Error('Unknown app route error');
1044
- currentSpan.recordException(error);
1045
- currentSpan.setStatus({
1046
- code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
1047
- message: error.message
1048
- });
1049
- currentSpan.setAttribute('error.type', error.name);
1050
- }
1051
- if (!res.writableEnded && !res.destroyed) {
1052
- res.end();
1053
- }
1054
- } else {
1055
- await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
1056
- status: 500
1057
- }));
1058
- }
1059
- return;
1060
- } finally{
1061
- ;
1062
- (()=>{
1063
- if (!currentSpan) {
1064
- return;
1065
- }
1066
- let statusCode = res.statusCode;
1067
- currentSpan.setAttributes({
1068
- 'http.status_code': statusCode,
1069
- 'next.rsc': false
1070
- });
1071
- if (statusCode && statusCode >= 500) {
1072
- // For 5xx status codes: SHOULD be set to 'Error' span status.
1073
- // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
1074
- currentSpan.setStatus({
1075
- code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
1076
- });
1077
- // For span status 'Error', SHOULD set 'error.type' attribute.
1078
- currentSpan.setAttribute('error.type', statusCode.toString());
1079
- }
1080
- const rootSpanAttributes = tracer.getRootSpanAttributes();
1081
- // We were unable to get attributes, probably OTEL is not enabled
1082
- if (!rootSpanAttributes) {
1083
- return;
1084
- }
1085
- if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
1086
- console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
1087
- return;
1088
- }
1089
- const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
1090
- const name = `${method} ${route}`;
1091
- currentSpan.setAttributes({
1092
- 'next.route': route,
1093
- 'http.route': route,
1094
- 'next.span_name': name
1095
- });
1096
- currentSpan.updateName(name);
1097
- // Propagate http.route to the parent span if one exists (e.g.
1098
- // a platform-created HTTP span in adapter deployments).
1099
- if (parentSpan && parentSpan !== currentSpan) {
1100
- parentSpan.setAttribute('http.route', route);
1101
- parentSpan.updateName(name);
1102
- }
1103
- })();
1104
- }
459
+ const handleResponse = async (currentSpan, parentSpan)=>{
460
+ try {
461
+ var _cacheEntry_value;
462
+ const cacheEntry = await routeModule.handleResponse({
463
+ req,
464
+ nextConfig,
465
+ cacheKey,
466
+ routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
467
+ isFallback: false,
468
+ previewProps,
469
+ prerenderManifest,
470
+ isRoutePPREnabled: false,
471
+ isOnDemandRevalidate,
472
+ revalidateOnlyGenerated,
473
+ responseGenerator,
474
+ waitUntil: ctx.waitUntil,
475
+ isMinimalMode
476
+ });
477
+ if (cacheEntry !== null && 'error' in cacheEntry) {
478
+ throw cacheEntry.error;
479
+ }
480
+ // we don't create a cacheEntry for ISR
481
+ if (!isIsr) {
482
+ return;
483
+ }
484
+ if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE) {
485
+ var _cacheEntry_value1;
486
+ throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
487
+ }
488
+ if (!isMinimalMode) {
489
+ res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
490
+ }
491
+ // Draft mode should never be cached
492
+ if (isDraftMode) {
493
+ res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
494
+ }
495
+ const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
496
+ if (!(isMinimalMode && isIsr)) {
497
+ headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
498
+ }
499
+ // If cache control is already set on the response we don't
500
+ // override it to allow users to customize it via next.config
501
+ if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
502
+ headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
503
+ }
504
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.
505
+ new Response(cacheEntry.value.body, {
506
+ headers,
507
+ status: cacheEntry.value.status || 200
508
+ }));
509
+ return;
510
+ } catch (err) {
511
+ if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
512
+ const silenceLog = false;
513
+ await routeModule.onRequestError(req, err, {
514
+ routerKind: 'App Router',
515
+ routePath: normalizedSrcPage,
516
+ routeType: 'route',
517
+ revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
518
+ isStaticGeneration: cacheKey !== null,
519
+ isOnDemandRevalidate
520
+ })
521
+ }, silenceLog, routerServerContext);
522
+ }
523
+ // rethrow so that we can handle serving error page
524
+ // If this is during static generation, throw the error again.
525
+ if (isIsr) throw err;
526
+ // Otherwise, send a 500 response unless the original response has
527
+ // already committed. In that case, preserve its status code for
528
+ // telemetry while still recording the failure and terminating a response
529
+ // that the failed pipeline left open.
530
+ if (res.headersSent) {
531
+ if (currentSpan) {
532
+ const error = err instanceof Error ? err : new Error('Unknown app route error');
533
+ currentSpan.recordException(error);
534
+ currentSpan.setStatus({
535
+ code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
536
+ message: error.message
537
+ });
538
+ currentSpan.setAttribute('error.type', error.name);
539
+ }
540
+ if (!res.writableEnded && !res.destroyed) {
541
+ res.end();
542
+ }
543
+ } else {
544
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
545
+ status: 500
546
+ }));
547
+ }
548
+ return;
549
+ } finally{
550
+ ;
551
+ (()=>{
552
+ if (!currentSpan) {
553
+ return;
554
+ }
555
+ let statusCode = res.statusCode;
556
+ currentSpan.setAttributes({
557
+ 'http.status_code': statusCode,
558
+ 'next.rsc': false
559
+ });
560
+ if (statusCode && statusCode >= 500) {
561
+ // For 5xx status codes: SHOULD be set to 'Error' span status.
562
+ // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
563
+ currentSpan.setStatus({
564
+ code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
565
+ });
566
+ // For span status 'Error', SHOULD set 'error.type' attribute.
567
+ currentSpan.setAttribute('error.type', statusCode.toString());
568
+ }
569
+ const rootSpanAttributes = tracer.getRootSpanAttributes();
570
+ // We were unable to get attributes, probably OTEL is not enabled
571
+ if (!rootSpanAttributes) {
572
+ return;
573
+ }
574
+ if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
575
+ console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
576
+ return;
577
+ }
578
+ const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
579
+ const name = `${method} ${route}`;
580
+ currentSpan.setAttributes({
581
+ 'next.route': route,
582
+ 'http.route': route,
583
+ 'next.span_name': name
584
+ });
585
+ currentSpan.updateName(name);
586
+ // Propagate http.route to the parent span if one exists (e.g.
587
+ // a platform-created HTTP span in adapter deployments).
588
+ if (parentSpan && parentSpan !== currentSpan) {
589
+ parentSpan.setAttribute('http.route', route);
590
+ parentSpan.updateName(name);
591
+ }
592
+ })();
593
+ }
594
+ };
595
+ // TODO: activeSpan code path is for when wrapped by
596
+ // next-server can be removed when this is no longer used
597
+ if (isWrappedByNextServer && activeSpan) {
598
+ await handleResponse(activeSpan, undefined);
599
+ } else {
600
+ let parentSpan = tracer.getActiveScopeSpan();
601
+ await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
602
+ spanName: `${method} ${srcPage}`,
603
+ kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
604
+ attributes: {
605
+ 'http.method': method,
606
+ 'http.target': req.url
607
+ }
608
+ }, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
609
+ }
610
+ }
611
+
612
+ //# sourceMappingURL=app-route.js.map
613
+
614
+
615
+ /***/ }),
616
+
617
+ /***/ 27910:
618
+ /***/ ((module) => {
619
+
620
+ module.exports = require("stream");
621
+
622
+ /***/ }),
623
+
624
+ /***/ 28354:
625
+ /***/ ((module) => {
626
+
627
+ module.exports = require("util");
628
+
629
+ /***/ }),
630
+
631
+ /***/ 29021:
632
+ /***/ ((module) => {
633
+
634
+ module.exports = require("fs");
635
+
636
+ /***/ }),
637
+
638
+ /***/ 29294:
639
+ /***/ ((module) => {
640
+
641
+ module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
642
+
643
+ /***/ }),
644
+
645
+ /***/ 31421:
646
+ /***/ ((module) => {
647
+
648
+ module.exports = require("node:child_process");
649
+
650
+ /***/ }),
651
+
652
+ /***/ 33873:
653
+ /***/ ((module) => {
654
+
655
+ module.exports = require("path");
656
+
657
+ /***/ }),
658
+
659
+ /***/ 35133:
660
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
661
+
662
+ __webpack_require__.r(__webpack_exports__);
663
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
664
+ /* harmony export */ GET: () => (/* binding */ GET)
665
+ /* harmony export */ });
666
+ /* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(39947);
667
+ /* harmony import */ var _lib_stores_dashboard_metrics__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14955);
668
+ /* harmony import */ var _lib_pricing_snapshot__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76142);
669
+ /* harmony import */ var _lib_stores_model_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(80937);
670
+ /* harmony import */ var _lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41720);
671
+
672
+
673
+
674
+
675
+
676
+ function defaultPricingProviders() {
677
+ const providers = new Set();
678
+ const defaultModel = (0,_lib_stores_model_config__WEBPACK_IMPORTED_MODULE_3__/* .getDefaultModelConfig */ .lB)();
679
+ if (defaultModel?.provider?.trim()) {
680
+ providers.add(defaultModel.provider.trim().toLowerCase());
681
+ }
682
+ const defaultAgent = (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_4__/* .getDefaultAgentConfig */ .vU)();
683
+ if (defaultAgent?.model_config_name?.trim()) {
684
+ const cfg = (0,_lib_stores_model_config__WEBPACK_IMPORTED_MODULE_3__/* .getModelConfig */ .Ac)(defaultAgent.model_config_name.trim());
685
+ if (cfg?.provider?.trim()) {
686
+ providers.add(cfg.provider.trim().toLowerCase());
687
+ }
688
+ }
689
+ return [
690
+ ...providers
691
+ ];
692
+ }
693
+ async function GET(req) {
694
+ try {
695
+ await (0,_lib_pricing_snapshot__WEBPACK_IMPORTED_MODULE_2__/* .refreshPricingSnapshot */ .O)({
696
+ force: false,
697
+ providers: defaultPricingProviders()
698
+ });
699
+ const daysRaw = req.nextUrl.searchParams.get("days");
700
+ const days = daysRaw ? Number(daysRaw) : undefined;
701
+ const metrics = await (0,_lib_stores_dashboard_metrics__WEBPACK_IMPORTED_MODULE_1__/* .getDashboardMetrics */ .cU)(days);
702
+ return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_0__/* .cachedJson */ .Bm)(metrics, 30);
703
+ } catch (err) {
704
+ console.error("[dashboard-metrics] failed:", err);
705
+ return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_0__/* .errorResponse */ .yj)("Failed to load dashboard metrics", 500);
706
+ }
707
+ }
708
+
709
+
710
+ /***/ }),
711
+
712
+ /***/ 37067:
713
+ /***/ ((module) => {
714
+
715
+ module.exports = require("node:http");
716
+
717
+ /***/ }),
718
+
719
+ /***/ 38522:
720
+ /***/ ((module) => {
721
+
722
+ module.exports = require("node:zlib");
723
+
724
+ /***/ }),
725
+
726
+ /***/ 39947:
727
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
728
+
729
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
730
+ /* harmony export */ Bm: () => (/* binding */ cachedJson),
731
+ /* harmony export */ HN: () => (/* binding */ notFoundResponse),
732
+ /* harmony export */ Jb: () => (/* binding */ validateBody),
733
+ /* harmony export */ K2: () => (/* binding */ createdResponse),
734
+ /* harmony export */ Ng: () => (/* binding */ noStoreJson),
735
+ /* harmony export */ yj: () => (/* binding */ errorResponse)
736
+ /* harmony export */ });
737
+ /* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
738
+ // Shared HTTP response builders for app/api/v1/** route handlers.
739
+ //
740
+ // Goal: every error/success payload across the v1 surface has the same
741
+ // shape. Before this lived inline, response bodies drifted —
742
+ // `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
743
+ // some routes returned Zod's raw issue array, others stringified it.
744
+
745
+ function errorResponse(message, status = 400) {
746
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
747
+ error: message
748
+ }, {
749
+ status
750
+ });
751
+ }
752
+ function notFoundResponse(message = "Not found") {
753
+ return errorResponse(message, 404);
754
+ }
755
+ function createdResponse(data) {
756
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
757
+ status: 201
758
+ });
759
+ }
760
+ // Wrap a 200 JSON response with a private Cache-Control header. Use on safe
761
+ // GET endpoints that serve user-scoped data the client refetches often (panel
762
+ // mounts, navigation back/forward) but mutates rarely. The TTL is short
763
+ // enough that explicit mutations — which patch the client-side ApiClient
764
+ // cache in place — stay observably consistent without an extra roundtrip.
765
+ //
766
+ // swrSeconds (optional): stale-while-revalidate window. When set, the browser
767
+ // serves the cached response immediately and refreshes in the background,
768
+ // making navigation feel instant. Use for data that can tolerate brief
769
+ // staleness (tool list, agent configs, model list). Omit for real-time data
770
+ // (dashboard metrics, credential state).
771
+ function cachedJson(data, maxAgeSeconds, swrSeconds) {
772
+ const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
773
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
774
+ headers: {
775
+ "Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
776
+ }
777
+ });
778
+ }
779
+ // Use for endpoints whose response contains live state that must never be
780
+ // served from cache — credentials, connection status, live config values.
781
+ function noStoreJson(data) {
782
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
783
+ headers: {
784
+ "Cache-Control": "no-store"
785
+ }
786
+ });
787
+ }
788
+ // Validate a JSON request body against a zod schema.
789
+ // Returns either the parsed data or a 400 NextResponse explaining the issue.
790
+ // Caller pattern:
791
+ // const parsed = await validateBody(req, Schema);
792
+ // if (parsed instanceof NextResponse) return parsed;
793
+ // // use parsed.field
794
+ async function validateBody(req, schema) {
795
+ let raw;
796
+ try {
797
+ raw = await req.json();
798
+ } catch {
799
+ return errorResponse("Request body must be valid JSON", 400);
800
+ }
801
+ const parsed = schema.safeParse(raw);
802
+ if (!parsed.success) {
803
+ return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
804
+ }
805
+ return parsed.data;
806
+ }
807
+
808
+
809
+ /***/ }),
810
+
811
+ /***/ 41720:
812
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
813
+
814
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
815
+ /* harmony export */ BM: () => (/* binding */ upsertAgentConfig),
816
+ /* harmony export */ E1: () => (/* binding */ updateAgentDisplayFilters),
817
+ /* harmony export */ P2: () => (/* binding */ parseCitationStrictness),
818
+ /* harmony export */ S2: () => (/* binding */ getAgentToolCredentials),
819
+ /* harmony export */ SJ: () => (/* binding */ generateAgentId),
820
+ /* harmony export */ TG: () => (/* binding */ getAgentTools),
821
+ /* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
822
+ /* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
823
+ /* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
824
+ /* harmony export */ mJ: () => (/* binding */ getAgentConfig),
825
+ /* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
826
+ /* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
827
+ /* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
828
+ /* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
829
+ /* harmony export */ zb: () => (/* binding */ listAgentConfigs)
830
+ /* harmony export */ });
831
+ /* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
832
+ /* harmony import */ var _lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99043);
833
+ /* harmony import */ var _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66849);
834
+
835
+
836
+
837
+ const now = ()=>new Date().toISOString();
838
+ /** Coerce arbitrary input (DB row TEXT, API body, undefined) to the enum.
839
+ * Returns `null` for null/undefined/unknown values so callers can default. */ function parseCitationStrictness(value) {
840
+ if (value === "off" || value === "informational" || value === "standard" || value === "strict") {
841
+ return value;
842
+ }
843
+ return null;
844
+ }
845
+ /**
846
+ * Parse the JSON-encoded per-agent override of context tier proportions.
847
+ * Returns `null` for NULL, blank, malformed JSON, or any payload that
848
+ * doesn't have three finite non-negative numeric fields. Callers fall
849
+ * back to the model config's value (or built-in defaults) on null.
850
+ */ function getAgentTierProportions(row) {
851
+ const raw = row.context_tier_proportions;
852
+ if (!raw) return null;
853
+ try {
854
+ const parsed = JSON.parse(raw);
855
+ const hot = Number(parsed.hot);
856
+ const warm = Number(parsed.warm);
857
+ const facts = Number(parsed.facts);
858
+ if (![
859
+ hot,
860
+ warm,
861
+ facts
862
+ ].every((n)=>Number.isFinite(n) && n >= 0)) return null;
863
+ if (hot + warm + facts <= 0) return null;
864
+ return {
865
+ hot,
866
+ warm,
867
+ facts
868
+ };
869
+ } catch {
870
+ return null;
871
+ }
872
+ }
873
+ function listAgentConfigs() {
874
+ // Default agent always first; then by the timestamp of each agent's latest message.
875
+ return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT a.*
876
+ FROM agent_configs a
877
+ LEFT JOIN (
878
+ SELECT t.agent_id, MAX(m.created_at) AS last_message_at
879
+ FROM threads t
880
+ JOIN messages m ON m.thread_id = t.thread_id
881
+ GROUP BY t.agent_id
882
+ ) latest ON latest.agent_id = a.id
883
+ ORDER BY a.is_default DESC, COALESCE(latest.last_message_at, a.created_at) DESC, a.id ASC`).all();
884
+ }
885
+ function getDefaultAgentConfig() {
886
+ return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE is_default=1 LIMIT 1").get() ?? null;
887
+ }
888
+ function getAgentConfig(id) {
889
+ return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE id=?").get(id) ?? null;
890
+ }
891
+ /**
892
+ * Parse the JSON-encoded delegate whitelist into a deduped string[]. Returns
893
+ * an empty array for NULL, blank, or malformed JSON (delegation is opt-in).
894
+ */ /**
895
+ * Parse the agent's tool allowlist (`tools` column, stored as a JSON string).
896
+ * Returns an empty array on NULL/blank/malformed JSON — same defensive shape
897
+ * as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
898
+ * inline should switch to this getter so the serialization contract stays
899
+ * owned by this store.
900
+ */ function getAgentTools(cfg) {
901
+ if (!cfg?.tools) return [];
902
+ try {
903
+ const parsed = JSON.parse(cfg.tools);
904
+ if (!Array.isArray(parsed)) return [];
905
+ return parsed.filter((x)=>typeof x === "string" && x.length > 0);
906
+ } catch {
907
+ return [];
908
+ }
909
+ }
910
+ function parseDelegateTargets(raw) {
911
+ if (!raw) return [];
912
+ try {
913
+ const parsed = JSON.parse(raw);
914
+ if (!Array.isArray(parsed)) return [];
915
+ const ids = parsed.filter((x)=>typeof x === "string" && x.length > 0);
916
+ return Array.from(new Set(ids));
917
+ } catch {
918
+ return [];
919
+ }
920
+ }
921
+ /**
922
+ * Parse the per-agent `{ toolName: credentialId }` override map stored in
923
+ * the `tool_credentials` column. Returns an empty record on NULL / blank /
924
+ * malformed JSON / non-string entries so downstream code can treat the
925
+ * result as a plain lookup without further validation.
926
+ */ function getAgentToolCredentials(cfg) {
927
+ if (!cfg?.tool_credentials) return {};
928
+ try {
929
+ const parsed = JSON.parse(cfg.tool_credentials);
930
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
931
+ const out = {};
932
+ for (const [k, v] of Object.entries(parsed)){
933
+ if (typeof v === "string" && v.length > 0) out[k] = v;
934
+ }
935
+ return out;
936
+ } catch {
937
+ return {};
938
+ }
939
+ }
940
+ function upsertAgentConfig(input) {
941
+ return (0,_lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__/* .withDbTransaction */ .J)(()=>upsertAgentConfigTransaction(input));
942
+ }
943
+ function upsertAgentConfigTransaction(input) {
944
+ const t = now();
945
+ const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
946
+ const existing = getAgentConfig(input.id);
947
+ const created_at = existing?.created_at ?? t;
948
+ const existingMbti = toMbti(existing?.adaptive_mbti);
949
+ const mbti = input.adaptive_mbti ?? existingMbti ?? "INTJ";
950
+ const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
951
+ // Omitted sliders keep their tuned values; they only fall back to the
952
+ // preset when the type changes or the agent is new. Otherwise every
953
+ // partial update (approved proposals, tool edits) reset them.
954
+ const keepTuned = existing !== null && existing !== undefined && mbti === existingMbti;
955
+ const strength = input.adaptive_persona_strength ?? (keepTuned ? existing.adaptive_persona_strength : preset.strength);
956
+ const empathy = input.adaptive_empathy ?? (keepTuned ? existing.adaptive_empathy : preset.empathy);
957
+ const expressiveness = input.adaptive_expressiveness ?? (keepTuned ? existing.adaptive_expressiveness : preset.expressiveness);
958
+ const verbosity = input.adaptive_verbosity ?? (keepTuned ? existing.adaptive_verbosity : preset.verbosity);
959
+ if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
960
+ // harness_id: explicit `undefined` means "keep existing"; explicit `null`
961
+ // means "use the global default". Empty string is normalised to null too,
962
+ // matching how the AgentEditor sends "" for the inherit option.
963
+ const harnessId = input.harness_id === undefined ? existing?.harness_id ?? null : input.harness_id && input.harness_id.length > 0 ? input.harness_id : null;
964
+ // delegate_targets: undefined = keep existing; explicit empty array clears.
965
+ const delegateTargets = input.delegate_targets === undefined ? existing?.delegate_targets ?? null : JSON.stringify(Array.from(new Set(input.delegate_targets.filter((id)=>id && id !== input.id))));
966
+ // context_tier_proportions: undefined = keep existing; null = clear and
967
+ // inherit from the model; object = serialise as JSON. Negative values are
968
+ // clamped to 0 so the upsert can't poison the column with bad data.
969
+ const tierProportions = input.context_tier_proportions === undefined ? existing?.context_tier_proportions ?? null : input.context_tier_proportions === null ? null : JSON.stringify({
970
+ hot: Math.max(0, Number(input.context_tier_proportions.hot) || 0),
971
+ warm: Math.max(0, Number(input.context_tier_proportions.warm) || 0),
972
+ facts: Math.max(0, Number(input.context_tier_proportions.facts) || 0)
973
+ });
974
+ // Anti-hallucination override: `undefined` keeps existing; `null` clears
975
+ // the override (inherits env). Empty-string model is normalised to null
976
+ // so the editor can ship "" for the inherit option.
977
+ const antiHallucMode = input.anti_hallucination_mode === undefined ? existing?.anti_hallucination_mode ?? null : input.anti_hallucination_mode === null ? null : input.anti_hallucination_mode === "off" || input.anti_hallucination_mode === "regex" || input.anti_hallucination_mode === "model" ? input.anti_hallucination_mode : null;
978
+ const antiHallucModel = input.anti_hallucination_model_config === undefined ? existing?.anti_hallucination_model_config ?? null : input.anti_hallucination_model_config && input.anti_hallucination_model_config.trim().length > 0 ? input.anti_hallucination_model_config.trim() : null;
979
+ const citationStrictness = input.citation_strictness === undefined ? parseCitationStrictness(existing?.citation_strictness) ?? "off" : parseCitationStrictness(input.citation_strictness) ?? "off";
980
+ const toolCredentials = serialiseToolCredentials(input.tool_credentials, existing?.tool_credentials ?? null);
981
+ const VALID_ROUTER_POLICIES = new Set([
982
+ "cheap",
983
+ "fast",
984
+ "balanced",
985
+ "quality"
986
+ ]);
987
+ const routerPolicy = input.router_policy === undefined ? existing?.router_policy ?? null : input.router_policy !== null && VALID_ROUTER_POLICIES.has(input.router_policy) ? input.router_policy : null;
988
+ const routerEnabled = input.router_enabled === undefined ? existing?.router_enabled ?? null : input.router_enabled === null ? null : input.router_enabled ? 1 : 0;
989
+ const VALID_USAGE_STRATEGIES = new Set([
990
+ "cost_saving",
991
+ "fast",
992
+ "balanced",
993
+ "high_reasoning"
994
+ ]);
995
+ const usageStrategy = input.usage_strategy === undefined ? existing?.usage_strategy ?? null : input.usage_strategy !== null && VALID_USAGE_STRATEGIES.has(input.usage_strategy) ? input.usage_strategy : null;
996
+ const requestedWarmSummaryLimit = input.warm_summary_limit ?? existing?.warm_summary_limit ?? 50;
997
+ const warmSummaryLimit = Number.isFinite(requestedWarmSummaryLimit) ? Math.max(0, Math.floor(requestedWarmSummaryLimit)) : existing?.warm_summary_limit ?? 50;
998
+ db.prepare(`INSERT OR REPLACE INTO agent_configs
999
+ (id, name, icon, identity, instructions, tools, model_config_name, is_default,
1000
+ history_limit, history_window_hours, warm_summary_limit, never_reply,
1001
+ hot_turn_limit,
1002
+ adaptive_persona_enabled, adaptive_persona_strength, adaptive_empathy, adaptive_expressiveness, adaptive_verbosity, adaptive_mbti,
1003
+ voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
1004
+ harness_id, delegate_targets, context_tier_proportions,
1005
+ anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
1006
+ tool_credentials, router_policy, router_enabled, usage_strategy,
1007
+ created_at, updated_at)
1008
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(input.id, input.name, input.icon ?? null, input.identity, input.instructions, JSON.stringify(input.tools), input.model_config_name ?? null, input.is_default ? 1 : existing?.is_default ?? 0, input.history_limit ?? existing?.history_limit ?? 50, input.history_window_hours ?? existing?.history_window_hours ?? 8, warmSummaryLimit, // never_reply is a boolean toggle — explicit `undefined` means "keep existing"
1009
+ // (important for PATCH-style updates that omit the field).
1010
+ input.never_reply === undefined ? existing?.never_reply ?? 0 : input.never_reply ? 1 : 0, Math.max(0, Math.floor(input.hot_turn_limit ?? existing?.hot_turn_limit ?? 12)), input.adaptive_persona_enabled === undefined ? existing?.adaptive_persona_enabled ?? 0 : input.adaptive_persona_enabled ? 1 : 0, clampPercent(strength, existing?.adaptive_persona_strength ?? 50), clampPercent(empathy, existing?.adaptive_empathy ?? 50), clampPercent(expressiveness, existing?.adaptive_expressiveness ?? 50), clampPercent(verbosity, existing?.adaptive_verbosity ?? 50), mbti, input.voice_enabled === undefined ? existing?.voice_enabled ?? 0 : input.voice_enabled ? 1 : 0, (input.voice_model ?? existing?.voice_model ?? "gemini-2.5-flash-preview-tts").trim() || "gemini-2.5-flash-preview-tts", (input.voice_name ?? existing?.voice_name ?? "Kore").trim() || "Kore", (input.voice_stt_model ?? existing?.voice_stt_model ?? "gemini-2.5-flash").trim() || "gemini-2.5-flash", input.voice_auto_speak === undefined ? existing?.voice_auto_speak ?? 1 : input.voice_auto_speak ? 1 : 0, harnessId, delegateTargets, tierProportions, antiHallucMode, antiHallucModel, citationStrictness, toolCredentials, routerPolicy, routerEnabled, usageStrategy, created_at, t);
1011
+ return getAgentConfig(input.id);
1012
+ }
1013
+ function clampPercent(next, fallback) {
1014
+ const n = Number.isFinite(next) ? Number(next) : fallback;
1015
+ return Math.max(0, Math.min(100, Math.round(n)));
1016
+ }
1017
+ function serialiseToolCredentials(input, existing) {
1018
+ if (input === undefined) return existing;
1019
+ const cleaned = {};
1020
+ for (const [k, v] of Object.entries(input)){
1021
+ if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
1022
+ cleaned[k] = v;
1023
+ }
1024
+ }
1025
+ if (Object.keys(cleaned).length === 0) return null;
1026
+ return JSON.stringify(cleaned);
1027
+ }
1028
+ function toMbti(v) {
1029
+ if (!v) return null;
1030
+ return v in _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e ? v : null;
1031
+ }
1032
+ function deleteAgentConfig(id) {
1033
+ return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM agent_configs WHERE id=?").run(id).changes > 0;
1034
+ }
1035
+ function generateAgentId(name) {
1036
+ const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
1037
+ const suffix = Math.random().toString(36).slice(2, 6);
1038
+ return slug ? `${slug}-${suffix}` : `agent-${suffix}`;
1039
+ }
1040
+ // ── ADR-0022: per-agent message-channel display filters ─────────────────
1041
+ // Canonical channel keys mirrored in `hooks/useMessageFilters.ts`. Kept
1042
+ // in sync there by importing this constant — single source of truth.
1043
+ const DISPLAY_FILTER_KEYS = [
1044
+ "scheduled_task",
1045
+ "watcher",
1046
+ "bridge",
1047
+ "extension",
1048
+ "page_capture",
1049
+ "synthetic",
1050
+ "tool_use",
1051
+ "thinking"
1052
+ ];
1053
+ const DISPLAY_FILTER_DEFAULTS = {
1054
+ scheduled_task: true,
1055
+ watcher: true,
1056
+ bridge: true,
1057
+ extension: true,
1058
+ page_capture: true,
1059
+ synthetic: true,
1060
+ tool_use: true,
1061
+ thinking: true
1062
+ };
1063
+ function parseDisplayFilters(raw) {
1064
+ if (!raw) return {
1065
+ ...DISPLAY_FILTER_DEFAULTS
1066
+ };
1067
+ try {
1068
+ const parsed = JSON.parse(raw);
1069
+ // Merge over defaults so newly-added channels stay visible on old rows.
1070
+ return {
1071
+ ...DISPLAY_FILTER_DEFAULTS,
1072
+ ...parsed
1073
+ };
1074
+ } catch {
1075
+ return {
1076
+ ...DISPLAY_FILTER_DEFAULTS
1077
+ };
1078
+ }
1079
+ }
1080
+ function getAgentDisplayFilters(id) {
1081
+ const row = getAgentConfig(id);
1082
+ if (!row) return null;
1083
+ return parseDisplayFilters(row.display_filters);
1084
+ }
1085
+ /**
1086
+ * Merge a partial filter map into the agent's stored prefs. Pass `null` to
1087
+ * reset to defaults (clears the column). Safe against concurrent toggles
1088
+ * from multiple browser tabs because the merge happens server-side.
1089
+ */ function updateAgentDisplayFilters(id, patch) {
1090
+ const row = getAgentConfig(id);
1091
+ if (!row) return null;
1092
+ if (patch === null) {
1093
+ (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=NULL, updated_at=? WHERE id=?").run(now(), id);
1094
+ return {
1095
+ ...DISPLAY_FILTER_DEFAULTS
1096
+ };
1097
+ }
1098
+ const current = parseDisplayFilters(row.display_filters);
1099
+ const next = {
1100
+ ...current
1105
1101
  };
1106
- // TODO: activeSpan code path is for when wrapped by
1107
- // next-server can be removed when this is no longer used
1108
- if (isWrappedByNextServer && activeSpan) {
1109
- await handleResponse(activeSpan, undefined);
1110
- } else {
1111
- let parentSpan = tracer.getActiveScopeSpan();
1112
- await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
1113
- spanName: `${method} ${srcPage}`,
1114
- kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
1115
- attributes: {
1116
- 'http.method': method,
1117
- 'http.target': req.url
1118
- }
1119
- }, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
1102
+ for (const k of DISPLAY_FILTER_KEYS){
1103
+ if (k in patch && typeof patch[k] === "boolean") next[k] = patch[k];
1120
1104
  }
1105
+ (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=?, updated_at=? WHERE id=?").run(JSON.stringify(next), now(), id);
1106
+ return next;
1121
1107
  }
1122
1108
 
1123
- //# sourceMappingURL=app-route.js.map
1124
1109
 
1110
+ /***/ }),
1111
+
1112
+ /***/ 44708:
1113
+ /***/ ((module) => {
1114
+
1115
+ module.exports = require("node:https");
1116
+
1117
+ /***/ }),
1118
+
1119
+ /***/ 44870:
1120
+ /***/ ((module) => {
1121
+
1122
+ module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
1123
+
1124
+ /***/ }),
1125
+
1126
+ /***/ 48161:
1127
+ /***/ ((module) => {
1128
+
1129
+ module.exports = require("node:os");
1125
1130
 
1126
1131
  /***/ }),
1127
1132
 
@@ -1188,6 +1193,13 @@ module.exports = require("node:path");
1188
1193
 
1189
1194
  /***/ }),
1190
1195
 
1196
+ /***/ 77030:
1197
+ /***/ ((module) => {
1198
+
1199
+ module.exports = require("node:net");
1200
+
1201
+ /***/ }),
1202
+
1191
1203
  /***/ 77598:
1192
1204
  /***/ ((module) => {
1193
1205
 
@@ -1251,7 +1263,7 @@ module.exports = import("@huggingface/transformers");;
1251
1263
  var __webpack_require__ = require("../../../../../webpack-runtime.js");
1252
1264
  __webpack_require__.C(exports);
1253
1265
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
1254
- var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46,6142,4955], () => (__webpack_exec__(48833)));
1266
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46,6142,4955], () => (__webpack_exec__(24187)));
1255
1267
  module.exports = __webpack_exports__;
1256
1268
 
1257
1269
  })();