@circuitwall/jarela 2.7.0 → 3.0.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 (730) 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 +6 -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 +58 -58
  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 +127 -127
  22. package/.next/standalone/.next/server/app/api/v1/access/route.js +372 -372
  23. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +79 -79
  24. package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +641 -641
  25. package/.next/standalone/.next/server/app/api/v1/agents/[id]/duplicate/route.js +723 -723
  26. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +100 -100
  27. package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +65 -65
  28. package/.next/standalone/.next/server/app/api/v1/agents/recent-replies/route.js +227 -227
  29. package/.next/standalone/.next/server/app/api/v1/agents/route.js +16 -16
  30. package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +384 -384
  31. package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +9 -9
  32. package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +23 -23
  33. package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +203 -203
  34. package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +17 -17
  35. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +2 -2
  36. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +760 -760
  38. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +699 -699
  39. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +30 -30
  40. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +37 -37
  42. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +480 -480
  44. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +675 -675
  46. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +559 -559
  47. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +23 -23
  48. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +37 -37
  50. package/.next/standalone/.next/server/app/api/v1/bridges/route.js +1269 -1269
  51. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +199 -199
  52. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/api/v1/config/route.js +99 -99
  54. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +23 -23
  55. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/api/v1/credentials/route.js +169 -169
  57. package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +515 -515
  59. package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +380 -380
  60. package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +256 -256
  62. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +80 -97
  64. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +677 -677
  66. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/api/v1/documents/recall-policy/route.js +856 -0
  68. package/.next/standalone/.next/server/app/api/v1/documents/recall-policy/route.js.nft.json +1 -0
  69. package/.next/standalone/.next/server/app/api/v1/documents/recall-policy/route_client-reference-manifest.js +1 -0
  70. package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +299 -247
  71. package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +486 -486
  72. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +18 -11
  73. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +666 -666
  75. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
  76. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +128 -100
  77. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/api/v1/env/route.js +207 -207
  79. package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +128 -128
  80. package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +16 -16
  81. package/.next/standalone/.next/server/app/api/v1/events/route.js +154 -154
  82. package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/api/v1/events/test/route.js +16 -16
  84. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +97 -97
  85. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
  86. package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +188 -188
  87. package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +93 -93
  88. package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +9 -9
  89. package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +93 -93
  90. package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +69 -69
  91. package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +69 -69
  92. package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +65 -65
  93. package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +223 -223
  94. package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +44 -44
  95. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +93 -93
  96. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +44 -44
  98. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +16 -16
  100. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
  101. package/.next/standalone/.next/server/app/api/v1/extensions/route.js +722 -722
  102. package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +481 -481
  104. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
  105. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +378 -378
  106. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
  107. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +510 -510
  108. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
  109. package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +17 -17
  110. package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +33 -33
  111. package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +397 -397
  112. package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +129 -129
  113. package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +9 -9
  114. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +757 -757
  115. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
  116. package/.next/standalone/.next/server/app/api/v1/health/route.js +228 -228
  117. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +37 -37
  118. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +198 -198
  119. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
  120. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +9 -9
  121. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +845 -845
  122. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +23 -23
  123. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +106 -106
  124. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +747 -747
  125. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +37 -37
  126. package/.next/standalone/.next/server/app/api/v1/integrations/route.js +37 -37
  127. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +420 -420
  128. package/.next/standalone/.next/server/app/api/v1/local-file/route.js +34 -34
  129. package/.next/standalone/.next/server/app/api/v1/logs/route.js +819 -819
  130. package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +217 -217
  131. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +1034 -1034
  132. package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +2 -2
  133. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +58 -58
  134. package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +150 -150
  135. package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +72 -72
  136. package/.next/standalone/.next/server/app/api/v1/memory/route.js +9 -9
  137. package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +16 -16
  138. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +72 -72
  139. package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +87 -538
  140. package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js.nft.json +1 -1
  141. package/.next/standalone/.next/server/app/api/v1/models/route.js +273 -722
  142. package/.next/standalone/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  143. package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +73 -73
  144. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +248 -239
  145. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +128 -128
  147. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +44 -44
  149. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +72 -72
  151. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +37 -37
  153. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
  154. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +81 -81
  155. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
  156. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +34 -25
  157. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/api/v1/packages/route.js +48 -39
  159. package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
  160. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +51 -51
  161. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
  162. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +863 -863
  163. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
  164. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +230 -230
  165. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
  166. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +44 -44
  167. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
  168. package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +138 -138
  169. package/.next/standalone/.next/server/app/api/v1/profile/route.js +51 -51
  170. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +853 -680
  171. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +65 -65
  172. package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +171 -171
  173. package/.next/standalone/.next/server/app/api/v1/providers/route.js +96 -96
  174. package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +157 -157
  175. package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +47 -47
  176. package/.next/standalone/.next/server/app/api/v1/redaction/route.js +206 -206
  177. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +140 -140
  178. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +166 -166
  179. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
  180. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +52 -52
  181. package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +722 -722
  182. package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +23 -23
  183. package/.next/standalone/.next/server/app/api/v1/security/state/route.js +243 -243
  184. package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +518 -518
  185. package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +9 -9
  186. package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +25 -25
  187. package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +9 -9
  188. package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +609 -609
  189. package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +129 -129
  190. package/.next/standalone/.next/server/app/api/v1/skills/route.js +9 -9
  191. package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +112 -112
  192. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +86 -86
  193. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
  194. package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +9 -9
  195. package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +83 -83
  196. package/.next/standalone/.next/server/app/api/v1/tasks/route.js +23 -23
  197. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +121 -121
  198. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +139 -139
  199. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/messages/[message_id]/route.js +51 -51
  200. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +58 -58
  201. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +1182 -1182
  202. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
  203. package/.next/standalone/.next/server/app/api/v1/threads/route.js +158 -158
  204. package/.next/standalone/.next/server/app/api/v1/tools/route.js +137 -137
  205. package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
  206. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +73 -73
  207. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
  208. package/.next/standalone/.next/server/app/api/v1/update/route.js +72 -72
  209. package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +30 -30
  210. package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +79 -79
  211. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +9 -9
  212. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +45 -45
  213. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
  214. package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +2 -2
  215. package/.next/standalone/.next/server/app/api/v1/watchers/route.js +37 -37
  216. package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
  217. package/.next/standalone/.next/server/app/icon.svg/route.js +55 -55
  218. package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +18 -18
  219. package/.next/standalone/.next/server/app/page.js +2112 -1235
  220. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  221. package/.next/standalone/.next/server/app/setup/page.js +91 -91
  222. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  223. package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
  224. package/.next/standalone/.next/server/chunks/1244.js +136 -4
  225. package/.next/standalone/.next/server/chunks/1387.js +733 -57
  226. package/.next/standalone/.next/server/chunks/1433.js +1 -1
  227. package/.next/standalone/.next/server/chunks/210.js +3 -3
  228. package/.next/standalone/.next/server/chunks/2175.js +874 -0
  229. package/.next/standalone/.next/server/chunks/3042.js +34 -32
  230. package/.next/standalone/.next/server/chunks/309.js +21 -40
  231. package/.next/standalone/.next/server/chunks/3272.js +21 -40
  232. package/.next/standalone/.next/server/chunks/{540.js → 3326.js} +189 -61
  233. package/.next/standalone/.next/server/chunks/{6142.js → 3479.js} +170 -159
  234. package/.next/standalone/.next/server/chunks/3566.js +1 -1
  235. package/.next/standalone/.next/server/chunks/{5323.js → 3692.js} +31 -3
  236. package/.next/standalone/.next/server/chunks/4189.js +14 -2
  237. package/.next/standalone/.next/server/chunks/4377.js +2 -2
  238. package/.next/standalone/.next/server/chunks/4596.js +18 -9
  239. package/.next/standalone/.next/server/chunks/{639.js → 4728.js} +23676 -22755
  240. package/.next/standalone/.next/server/chunks/4955.js +81 -14
  241. package/.next/standalone/.next/server/chunks/5290.js +136 -5
  242. package/.next/standalone/.next/server/chunks/{2267.js → 6408.js} +990 -926
  243. package/.next/standalone/.next/server/chunks/{9667.js → 6911.js} +31 -3
  244. package/.next/standalone/.next/server/chunks/7033.js +7 -4
  245. package/.next/standalone/.next/server/chunks/7377.js +7 -4
  246. package/.next/standalone/.next/server/chunks/8461.js +31 -29
  247. package/.next/standalone/.next/server/chunks/9032.js +3 -3
  248. package/.next/standalone/.next/server/chunks/9174.js +18 -9
  249. package/.next/standalone/.next/server/chunks/9408.js +37 -15
  250. package/.next/standalone/.next/server/chunks/9824.js +2288 -2288
  251. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  252. package/.next/standalone/.next/server/middleware.js +104638 -104532
  253. package/.next/standalone/.next/server/pages/404.html +2 -2
  254. package/.next/standalone/.next/server/pages/500.html +1 -1
  255. package/.next/standalone/.next/server/preview-props.json +3 -3
  256. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  257. package/.next/standalone/.next/static/2BAUJZ7x8eXCYpuZ-Kp7h/_buildManifest.js +1 -0
  258. package/.next/standalone/.next/static/chunks/{877-145c9df8aa0aee63.js → 877-367eb49b20edd3d6.js} +38 -16
  259. package/.next/standalone/.next/static/chunks/app/_global-error/page-6cda89771c3f8ea4.js +17 -0
  260. package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/route-6cda89771c3f8ea4.js +17 -0
  261. package/.next/standalone/.next/static/chunks/app/api/v1/access/route-6cda89771c3f8ea4.js +17 -0
  262. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/route-6cda89771c3f8ea4.js +17 -0
  263. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6cda89771c3f8ea4.js +17 -0
  264. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/duplicate/route-6cda89771c3f8ea4.js +17 -0
  265. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6cda89771c3f8ea4.js +17 -0
  266. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6cda89771c3f8ea4.js +17 -0
  267. package/.next/standalone/.next/static/chunks/app/api/v1/agents/recent-replies/route-6cda89771c3f8ea4.js +17 -0
  268. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6cda89771c3f8ea4.js +17 -0
  269. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6cda89771c3f8ea4.js +17 -0
  270. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6cda89771c3f8ea4.js +17 -0
  271. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6cda89771c3f8ea4.js +17 -0
  272. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6cda89771c3f8ea4.js +17 -0
  273. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6cda89771c3f8ea4.js +17 -0
  274. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6cda89771c3f8ea4.js +17 -0
  275. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6cda89771c3f8ea4.js +17 -0
  276. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6cda89771c3f8ea4.js +17 -0
  277. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6cda89771c3f8ea4.js +17 -0
  278. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6cda89771c3f8ea4.js +17 -0
  279. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6cda89771c3f8ea4.js +17 -0
  280. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6cda89771c3f8ea4.js +17 -0
  281. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6cda89771c3f8ea4.js +17 -0
  282. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6cda89771c3f8ea4.js +17 -0
  283. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6cda89771c3f8ea4.js +17 -0
  284. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6cda89771c3f8ea4.js +17 -0
  285. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6cda89771c3f8ea4.js +17 -0
  286. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6cda89771c3f8ea4.js +17 -0
  287. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6cda89771c3f8ea4.js +17 -0
  288. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6cda89771c3f8ea4.js +17 -0
  289. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6cda89771c3f8ea4.js +17 -0
  290. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6cda89771c3f8ea4.js +17 -0
  291. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6cda89771c3f8ea4.js +17 -0
  292. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6cda89771c3f8ea4.js +17 -0
  293. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6cda89771c3f8ea4.js +17 -0
  294. package/.next/standalone/.next/static/chunks/app/api/v1/documents/recall-policy/route-6cda89771c3f8ea4.js +17 -0
  295. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6cda89771c3f8ea4.js +17 -0
  296. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6cda89771c3f8ea4.js +17 -0
  297. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6cda89771c3f8ea4.js +17 -0
  298. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6cda89771c3f8ea4.js +17 -0
  299. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6cda89771c3f8ea4.js +17 -0
  300. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6cda89771c3f8ea4.js +17 -0
  301. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6cda89771c3f8ea4.js +17 -0
  302. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6cda89771c3f8ea4.js +17 -0
  303. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6cda89771c3f8ea4.js +17 -0
  304. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6cda89771c3f8ea4.js +17 -0
  305. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6cda89771c3f8ea4.js +17 -0
  306. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6cda89771c3f8ea4.js +17 -0
  307. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6cda89771c3f8ea4.js +17 -0
  308. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6cda89771c3f8ea4.js +17 -0
  309. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6cda89771c3f8ea4.js +17 -0
  310. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6cda89771c3f8ea4.js +17 -0
  311. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6cda89771c3f8ea4.js +17 -0
  312. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6cda89771c3f8ea4.js +17 -0
  313. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6cda89771c3f8ea4.js +17 -0
  314. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6cda89771c3f8ea4.js +17 -0
  315. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6cda89771c3f8ea4.js +17 -0
  316. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6cda89771c3f8ea4.js +17 -0
  317. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6cda89771c3f8ea4.js +17 -0
  318. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6cda89771c3f8ea4.js +17 -0
  319. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6cda89771c3f8ea4.js +17 -0
  320. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6cda89771c3f8ea4.js +17 -0
  321. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6cda89771c3f8ea4.js +17 -0
  322. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6cda89771c3f8ea4.js +17 -0
  323. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6cda89771c3f8ea4.js +17 -0
  324. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6cda89771c3f8ea4.js +17 -0
  325. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6cda89771c3f8ea4.js +17 -0
  326. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6cda89771c3f8ea4.js +17 -0
  327. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6cda89771c3f8ea4.js +17 -0
  328. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6cda89771c3f8ea4.js +17 -0
  329. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6cda89771c3f8ea4.js +17 -0
  330. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6cda89771c3f8ea4.js +17 -0
  331. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6cda89771c3f8ea4.js +17 -0
  332. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6cda89771c3f8ea4.js +17 -0
  333. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6cda89771c3f8ea4.js +17 -0
  334. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6cda89771c3f8ea4.js +17 -0
  335. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6cda89771c3f8ea4.js +17 -0
  336. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6cda89771c3f8ea4.js +17 -0
  337. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6cda89771c3f8ea4.js +17 -0
  338. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6cda89771c3f8ea4.js +17 -0
  339. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6cda89771c3f8ea4.js +17 -0
  340. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6cda89771c3f8ea4.js +17 -0
  341. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6cda89771c3f8ea4.js +17 -0
  342. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6cda89771c3f8ea4.js +17 -0
  343. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6cda89771c3f8ea4.js +17 -0
  344. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6cda89771c3f8ea4.js +17 -0
  345. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6cda89771c3f8ea4.js +17 -0
  346. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6cda89771c3f8ea4.js +17 -0
  347. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6cda89771c3f8ea4.js +17 -0
  348. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6cda89771c3f8ea4.js +17 -0
  349. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6cda89771c3f8ea4.js +17 -0
  350. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6cda89771c3f8ea4.js +17 -0
  351. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6cda89771c3f8ea4.js +17 -0
  352. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6cda89771c3f8ea4.js +17 -0
  353. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6cda89771c3f8ea4.js +17 -0
  354. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6cda89771c3f8ea4.js +17 -0
  355. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6cda89771c3f8ea4.js +17 -0
  356. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6cda89771c3f8ea4.js +17 -0
  357. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6cda89771c3f8ea4.js +17 -0
  358. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6cda89771c3f8ea4.js +17 -0
  359. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6cda89771c3f8ea4.js +17 -0
  360. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6cda89771c3f8ea4.js +17 -0
  361. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6cda89771c3f8ea4.js +17 -0
  362. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6cda89771c3f8ea4.js +17 -0
  363. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6cda89771c3f8ea4.js +17 -0
  364. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6cda89771c3f8ea4.js +17 -0
  365. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6cda89771c3f8ea4.js +17 -0
  366. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6cda89771c3f8ea4.js +17 -0
  367. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6cda89771c3f8ea4.js +17 -0
  368. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6cda89771c3f8ea4.js +17 -0
  369. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6cda89771c3f8ea4.js +17 -0
  370. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6cda89771c3f8ea4.js +17 -0
  371. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6cda89771c3f8ea4.js +17 -0
  372. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6cda89771c3f8ea4.js +17 -0
  373. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6cda89771c3f8ea4.js +17 -0
  374. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6cda89771c3f8ea4.js +17 -0
  375. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6cda89771c3f8ea4.js +17 -0
  376. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6cda89771c3f8ea4.js +17 -0
  377. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6cda89771c3f8ea4.js +17 -0
  378. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6cda89771c3f8ea4.js +17 -0
  379. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6cda89771c3f8ea4.js +17 -0
  380. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6cda89771c3f8ea4.js +17 -0
  381. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6cda89771c3f8ea4.js +17 -0
  382. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6cda89771c3f8ea4.js +17 -0
  383. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6cda89771c3f8ea4.js +17 -0
  384. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6cda89771c3f8ea4.js +17 -0
  385. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6cda89771c3f8ea4.js +17 -0
  386. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6cda89771c3f8ea4.js +17 -0
  387. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6cda89771c3f8ea4.js +17 -0
  388. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6cda89771c3f8ea4.js +17 -0
  389. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6cda89771c3f8ea4.js +17 -0
  390. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6cda89771c3f8ea4.js +17 -0
  391. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6cda89771c3f8ea4.js +17 -0
  392. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6cda89771c3f8ea4.js +17 -0
  393. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6cda89771c3f8ea4.js +17 -0
  394. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/messages/[message_id]/route-6cda89771c3f8ea4.js +17 -0
  395. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6cda89771c3f8ea4.js +17 -0
  396. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6cda89771c3f8ea4.js +17 -0
  397. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6cda89771c3f8ea4.js +17 -0
  398. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6cda89771c3f8ea4.js +17 -0
  399. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6cda89771c3f8ea4.js +17 -0
  400. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6cda89771c3f8ea4.js +17 -0
  401. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6cda89771c3f8ea4.js +17 -0
  402. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6cda89771c3f8ea4.js +17 -0
  403. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6cda89771c3f8ea4.js +17 -0
  404. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6cda89771c3f8ea4.js +17 -0
  405. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6cda89771c3f8ea4.js +17 -0
  406. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6cda89771c3f8ea4.js +17 -0
  407. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6cda89771c3f8ea4.js +17 -0
  408. package/.next/standalone/.next/static/chunks/app/{page-64585ef79400f17f.js → page-a584dfa806a1afdb.js} +1082 -205
  409. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6cda89771c3f8ea4.js +17 -0
  410. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6cda89771c3f8ea4.js +17 -0
  411. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6cda89771c3f8ea4.js +17 -0
  412. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6cda89771c3f8ea4.js +17 -0
  413. package/.next/standalone/.next/static/css/19e1cd815490b47c.css +5 -0
  414. package/.next/standalone/docs/adoption/changesets.json +148 -0
  415. package/.next/standalone/package.json +5 -4
  416. package/CHANGELOG.md +51 -0
  417. package/README.md +115 -1
  418. package/api/client.startup.test.ts +29 -0
  419. package/api/client.ts +9 -2
  420. package/api/types.ts +20 -1
  421. package/app/api/v1/dashboard/pricing-task/route.ts +3 -1
  422. package/app/api/v1/documents/recall-policy/route.test.ts +59 -0
  423. package/app/api/v1/documents/recall-policy/route.ts +20 -0
  424. package/app/api/v1/documents/search/route.test.ts +36 -0
  425. package/app/api/v1/documents/search/route.ts +17 -5
  426. package/app/api/v1/documents/sources/[id]/reindex/route.test.ts +44 -0
  427. package/app/api/v1/documents/sources/[id]/reindex/route.ts +4 -1
  428. package/app/api/v1/documents/sources/route.test.ts +67 -0
  429. package/app/api/v1/documents/sources/route.ts +20 -2
  430. package/app/api/v1/models/[name]/route.ts +2 -0
  431. package/app/api/v1/models/route.ts +4 -0
  432. package/app/api/v1/providers/[provider]/models/route.test.ts +28 -0
  433. package/app/api/v1/providers/[provider]/models/route.ts +16 -2
  434. package/app/globals.css +51 -4
  435. package/components/agents/AgentsPanel.tsx +2 -2
  436. package/components/agents/agent-editor/AdvancedSection.tsx +1 -1
  437. package/components/agents/agent-editor/ModelSection.tsx +2 -2
  438. package/components/bridges/BridgeEditor.tsx +1 -1
  439. package/components/bridges/BridgesPanel.tsx +1 -1
  440. package/components/chat/InputBar.tsx +1 -1
  441. package/components/chat/MessageList.tsx +3 -3
  442. package/components/chat/useUserProfileAndAgent.test.tsx +43 -1
  443. package/components/chat/useUserProfileAndAgent.ts +16 -5
  444. package/components/credentials/CredentialsPanel.tsx +1 -1
  445. package/components/dashboard/CostBreakdown.test.tsx +34 -0
  446. package/components/dashboard/CostBreakdown.tsx +21 -0
  447. package/components/dashboard/DashboardPanel.test.tsx +9 -0
  448. package/components/dashboard/DashboardPanel.tsx +3 -3
  449. package/components/dashboard/Donuts.tsx +5 -2
  450. package/components/dashboard/ModelPricingSection.test.tsx +42 -0
  451. package/components/dashboard/ModelPricingSection.tsx +23 -21
  452. package/components/dashboard/Series.test.tsx +1 -0
  453. package/components/dashboard/Series.tsx +5 -0
  454. package/components/dashboard/SummaryCards.tsx +39 -27
  455. package/components/dashboard/VendorModelReportSection.tsx +2 -0
  456. package/components/documents/AddSourceFields.tsx +52 -15
  457. package/components/documents/AddSourceForm.tsx +61 -19
  458. package/components/documents/DocumentsPanel.tsx +22 -2
  459. package/components/documents/RecallExclusions.tsx +73 -0
  460. package/components/documents/SearchProbe.tsx +42 -5
  461. package/components/documents/helpers.ts +17 -3
  462. package/components/documents/indexing-controls.test.tsx +137 -0
  463. package/components/documents/useDocumentsPanel.test.tsx +87 -0
  464. package/components/documents/useDocumentsPanel.ts +47 -6
  465. package/components/env/EnvVarsPanel.tsx +1 -1
  466. package/components/harness/HarnessPanel.tsx +2 -2
  467. package/components/integrations/NetworkPanel.tsx +1 -1
  468. package/components/layout/AgentCardControls.test.tsx +162 -0
  469. package/components/layout/AgentCardControls.tsx +126 -0
  470. package/components/layout/AgentSwitcher.test.tsx +37 -0
  471. package/components/layout/AgentSwitcher.tsx +28 -3
  472. package/components/layout/AppShell.tsx +16 -9
  473. package/components/layout/MenuPanel.test.tsx +125 -2
  474. package/components/layout/MenuPanel.tsx +96 -2
  475. package/components/logs/LogsPanel.tsx +1 -1
  476. package/components/mcp/MCPPanel.tsx +1 -1
  477. package/components/memory/UnifiedMemoryPanel.tsx +4 -4
  478. package/components/models/CapBadges.tsx +1 -1
  479. package/components/models/EmbeddingModelSection.test.tsx +41 -0
  480. package/components/models/EmbeddingModelSection.tsx +5 -0
  481. package/components/models/ModelFeatureGuide.tsx +16 -8
  482. package/components/models/ModelsPanel.tsx +8 -3
  483. package/components/models/model-editor/ModelEditorBody.tsx +1 -0
  484. package/components/models/model-editor/ModelIdSection.tsx +5 -0
  485. package/components/profile/ProfileEditor.test.tsx +70 -0
  486. package/components/profile/ProfileEditor.tsx +6 -2
  487. package/components/profile/ProfilePanel.test.tsx +6 -0
  488. package/components/profile/ProfilePanel.tsx +1 -1
  489. package/components/scheduled-tasks/ScheduledTasksPanel.tsx +1 -1
  490. package/components/settings/AppearancePanel.tsx +1 -1
  491. package/components/settings/SettingsPanel.test.tsx +23 -0
  492. package/components/settings/SettingsPanel.tsx +2 -2
  493. package/components/skills/SkillsPanel.tsx +1 -1
  494. package/components/tools/BrowserPanel.tsx +1 -1
  495. package/components/tools/PackagesPanel.tsx +1 -1
  496. package/components/tools/UnifiedPackageList.tsx +1 -1
  497. package/components/ui/PanelHeader.tsx +1 -1
  498. package/components/ui/SubTabBar.tsx +1 -1
  499. package/docs/INSTALL.md +7 -5
  500. package/hooks/useAgents.ts +2 -2
  501. package/lib/agents/prepare/system-prompt.test.ts +65 -0
  502. package/lib/agents/prepare/system-prompt.ts +27 -20
  503. package/lib/agents/prompt-registry.test.ts +42 -0
  504. package/lib/agents/prompt-registry.ts +21 -0
  505. package/lib/bridges/whatsapp.inbound.test.ts +38 -1
  506. package/lib/bridges/whatsapp.ts +10 -33
  507. package/lib/db/index.ts +2 -0
  508. package/lib/db/migrations.test.ts +10 -0
  509. package/lib/db/migrations.ts +10 -0
  510. package/lib/db/statement-cache.test.ts +77 -0
  511. package/lib/db/statement-cache.ts +31 -0
  512. package/lib/documents/indexer.test.ts +16 -1
  513. package/lib/documents/indexer.ts +8 -7
  514. package/lib/documents/mail-source-config.ts +31 -0
  515. package/lib/documents/recall-policy.ts +24 -0
  516. package/lib/documents/remote/icloud.ts +56 -0
  517. package/lib/documents/remote/index.ts +4 -1
  518. package/lib/documents/remote/mail.test.ts +232 -0
  519. package/lib/documents/remote/mail.ts +48 -40
  520. package/lib/documents/search.test.ts +81 -2
  521. package/lib/documents/search.ts +47 -7
  522. package/lib/embeddings/cache.test.ts +16 -2
  523. package/lib/embeddings/index.test.ts +7 -0
  524. package/lib/embeddings/index.ts +12 -1
  525. package/lib/integrations/deepseek-web/manifest.ts +68 -0
  526. package/lib/integrations/gmail/manifest.ts +2 -3
  527. package/lib/integrations/icloud/manifest.ts +19 -5
  528. package/lib/integrations/registry.test.ts +8 -0
  529. package/lib/integrations/registry.ts +2 -0
  530. package/lib/lifecycle/changeset-build.test.ts +3 -0
  531. package/lib/lifecycle/changeset-build.ts +6 -0
  532. package/lib/lifecycle/changesets.ts +9 -0
  533. package/lib/pricing/llm-extract.ts +1 -1
  534. package/lib/pricing/maintenance-task.ts +19 -3
  535. package/lib/pricing/model-updates.test.ts +192 -0
  536. package/lib/pricing/model-updates.ts +205 -0
  537. package/lib/stores/app-settings.ts +17 -1
  538. package/lib/stores/dashboard-metrics-cache.test.ts +44 -0
  539. package/lib/stores/dashboard-metrics.test.ts +47 -4
  540. package/lib/stores/dashboard-metrics.ts +73 -8
  541. package/lib/stores/document-sources.ts +1 -0
  542. package/lib/stores/integrations.test.ts +20 -0
  543. package/lib/stores/integrations.ts +15 -4
  544. package/lib/stores/langgraph-store.test.ts +53 -0
  545. package/lib/stores/langgraph-store.ts +9 -21
  546. package/lib/stores/model-metadata.ts +89 -0
  547. package/lib/stores/threads.test.ts +34 -0
  548. package/lib/stores/threads.ts +17 -20
  549. package/lib/stores/tool-stats.test.ts +31 -0
  550. package/lib/stores/tool-stats.ts +16 -0
  551. package/lib/stores/version-adoption.test.ts +8 -0
  552. package/lib/stores/version-adoption.ts +5 -2
  553. package/lib/tools/general/documents.test.ts +5 -0
  554. package/lib/tools/general/pricing-maintenance.test.ts +5 -0
  555. package/lib/tools/general/pricing-maintenance.ts +4 -1
  556. package/lib/tools/packages/default-packages/icloud.test.ts +49 -0
  557. package/lib/tools/packages/default-packages/icloud.ts +8 -6
  558. package/lib/tools/packages/default-packages.test.ts +16 -0
  559. package/lib/tools/packages/langchain-packages.ts +2 -2
  560. package/lib/tools/runtime/category-filter.test.ts +22 -0
  561. package/lib/tools/web/deepseek.test.ts +76 -0
  562. package/lib/tools/web/deepseek.ts +68 -0
  563. package/lib/tools/web/fetch.test.ts +130 -2
  564. package/lib/tools/web/fetch.ts +48 -1
  565. package/lib/tools/web/search.test.ts +139 -2
  566. package/lib/tools/web/search.ts +48 -1
  567. package/lib/triggers/handlers/scheduled-task.test.ts +18 -0
  568. package/lib/triggers/handlers/scheduled-task.ts +6 -0
  569. package/lib/ui/feature-readiness.test.ts +7 -0
  570. package/lib/ui/feature-readiness.ts +2 -1
  571. package/package.json +5 -4
  572. package/scripts/check-npm-package.mjs +1 -0
  573. package/scripts/jarela-bin.mjs +3 -0
  574. package/scripts/runtime-version.mjs +19 -0
  575. package/scripts/start-prod.mjs +3 -0
  576. package/.next/standalone/.next/static/6qLnqWdsfBTJOAJApUYXy/_buildManifest.js +0 -1
  577. package/.next/standalone/.next/static/chunks/app/_global-error/page-f6b126e5c5b11551.js +0 -17
  578. package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/route-f6b126e5c5b11551.js +0 -17
  579. package/.next/standalone/.next/static/chunks/app/api/v1/access/route-f6b126e5c5b11551.js +0 -17
  580. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/route-f6b126e5c5b11551.js +0 -17
  581. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-f6b126e5c5b11551.js +0 -17
  582. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/duplicate/route-f6b126e5c5b11551.js +0 -17
  583. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-f6b126e5c5b11551.js +0 -17
  584. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-f6b126e5c5b11551.js +0 -17
  585. package/.next/standalone/.next/static/chunks/app/api/v1/agents/recent-replies/route-f6b126e5c5b11551.js +0 -17
  586. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-f6b126e5c5b11551.js +0 -17
  587. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-f6b126e5c5b11551.js +0 -17
  588. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-f6b126e5c5b11551.js +0 -17
  589. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-f6b126e5c5b11551.js +0 -17
  590. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-f6b126e5c5b11551.js +0 -17
  591. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-f6b126e5c5b11551.js +0 -17
  592. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-f6b126e5c5b11551.js +0 -17
  593. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-f6b126e5c5b11551.js +0 -17
  594. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-f6b126e5c5b11551.js +0 -17
  595. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-f6b126e5c5b11551.js +0 -17
  596. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-f6b126e5c5b11551.js +0 -17
  597. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-f6b126e5c5b11551.js +0 -17
  598. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-f6b126e5c5b11551.js +0 -17
  599. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-f6b126e5c5b11551.js +0 -17
  600. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-f6b126e5c5b11551.js +0 -17
  601. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-f6b126e5c5b11551.js +0 -17
  602. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-f6b126e5c5b11551.js +0 -17
  603. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-f6b126e5c5b11551.js +0 -17
  604. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-f6b126e5c5b11551.js +0 -17
  605. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-f6b126e5c5b11551.js +0 -17
  606. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-f6b126e5c5b11551.js +0 -17
  607. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-f6b126e5c5b11551.js +0 -17
  608. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-f6b126e5c5b11551.js +0 -17
  609. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-f6b126e5c5b11551.js +0 -17
  610. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-f6b126e5c5b11551.js +0 -17
  611. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-f6b126e5c5b11551.js +0 -17
  612. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-f6b126e5c5b11551.js +0 -17
  613. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-f6b126e5c5b11551.js +0 -17
  614. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-f6b126e5c5b11551.js +0 -17
  615. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-f6b126e5c5b11551.js +0 -17
  616. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-f6b126e5c5b11551.js +0 -17
  617. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-f6b126e5c5b11551.js +0 -17
  618. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-f6b126e5c5b11551.js +0 -17
  619. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-f6b126e5c5b11551.js +0 -17
  620. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-f6b126e5c5b11551.js +0 -17
  621. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-f6b126e5c5b11551.js +0 -17
  622. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-f6b126e5c5b11551.js +0 -17
  623. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-f6b126e5c5b11551.js +0 -17
  624. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-f6b126e5c5b11551.js +0 -17
  625. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-f6b126e5c5b11551.js +0 -17
  626. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-f6b126e5c5b11551.js +0 -17
  627. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-f6b126e5c5b11551.js +0 -17
  628. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-f6b126e5c5b11551.js +0 -17
  629. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-f6b126e5c5b11551.js +0 -17
  630. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-f6b126e5c5b11551.js +0 -17
  631. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-f6b126e5c5b11551.js +0 -17
  632. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-f6b126e5c5b11551.js +0 -17
  633. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-f6b126e5c5b11551.js +0 -17
  634. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-f6b126e5c5b11551.js +0 -17
  635. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-f6b126e5c5b11551.js +0 -17
  636. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-f6b126e5c5b11551.js +0 -17
  637. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-f6b126e5c5b11551.js +0 -17
  638. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-f6b126e5c5b11551.js +0 -17
  639. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-f6b126e5c5b11551.js +0 -17
  640. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-f6b126e5c5b11551.js +0 -17
  641. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-f6b126e5c5b11551.js +0 -17
  642. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-f6b126e5c5b11551.js +0 -17
  643. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-f6b126e5c5b11551.js +0 -17
  644. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-f6b126e5c5b11551.js +0 -17
  645. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-f6b126e5c5b11551.js +0 -17
  646. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-f6b126e5c5b11551.js +0 -17
  647. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-f6b126e5c5b11551.js +0 -17
  648. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-f6b126e5c5b11551.js +0 -17
  649. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-f6b126e5c5b11551.js +0 -17
  650. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-f6b126e5c5b11551.js +0 -17
  651. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-f6b126e5c5b11551.js +0 -17
  652. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-f6b126e5c5b11551.js +0 -17
  653. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-f6b126e5c5b11551.js +0 -17
  654. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-f6b126e5c5b11551.js +0 -17
  655. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-f6b126e5c5b11551.js +0 -17
  656. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-f6b126e5c5b11551.js +0 -17
  657. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-f6b126e5c5b11551.js +0 -17
  658. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-f6b126e5c5b11551.js +0 -17
  659. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-f6b126e5c5b11551.js +0 -17
  660. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-f6b126e5c5b11551.js +0 -17
  661. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-f6b126e5c5b11551.js +0 -17
  662. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-f6b126e5c5b11551.js +0 -17
  663. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-f6b126e5c5b11551.js +0 -17
  664. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-f6b126e5c5b11551.js +0 -17
  665. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-f6b126e5c5b11551.js +0 -17
  666. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-f6b126e5c5b11551.js +0 -17
  667. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-f6b126e5c5b11551.js +0 -17
  668. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-f6b126e5c5b11551.js +0 -17
  669. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-f6b126e5c5b11551.js +0 -17
  670. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-f6b126e5c5b11551.js +0 -17
  671. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-f6b126e5c5b11551.js +0 -17
  672. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-f6b126e5c5b11551.js +0 -17
  673. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-f6b126e5c5b11551.js +0 -17
  674. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-f6b126e5c5b11551.js +0 -17
  675. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-f6b126e5c5b11551.js +0 -17
  676. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-f6b126e5c5b11551.js +0 -17
  677. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-f6b126e5c5b11551.js +0 -17
  678. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-f6b126e5c5b11551.js +0 -17
  679. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-f6b126e5c5b11551.js +0 -17
  680. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-f6b126e5c5b11551.js +0 -17
  681. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-f6b126e5c5b11551.js +0 -17
  682. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-f6b126e5c5b11551.js +0 -17
  683. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-f6b126e5c5b11551.js +0 -17
  684. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-f6b126e5c5b11551.js +0 -17
  685. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-f6b126e5c5b11551.js +0 -17
  686. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-f6b126e5c5b11551.js +0 -17
  687. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-f6b126e5c5b11551.js +0 -17
  688. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-f6b126e5c5b11551.js +0 -17
  689. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-f6b126e5c5b11551.js +0 -17
  690. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-f6b126e5c5b11551.js +0 -17
  691. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-f6b126e5c5b11551.js +0 -17
  692. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-f6b126e5c5b11551.js +0 -17
  693. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-f6b126e5c5b11551.js +0 -17
  694. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-f6b126e5c5b11551.js +0 -17
  695. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-f6b126e5c5b11551.js +0 -17
  696. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-f6b126e5c5b11551.js +0 -17
  697. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-f6b126e5c5b11551.js +0 -17
  698. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-f6b126e5c5b11551.js +0 -17
  699. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-f6b126e5c5b11551.js +0 -17
  700. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-f6b126e5c5b11551.js +0 -17
  701. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-f6b126e5c5b11551.js +0 -17
  702. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-f6b126e5c5b11551.js +0 -17
  703. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-f6b126e5c5b11551.js +0 -17
  704. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-f6b126e5c5b11551.js +0 -17
  705. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-f6b126e5c5b11551.js +0 -17
  706. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-f6b126e5c5b11551.js +0 -17
  707. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-f6b126e5c5b11551.js +0 -17
  708. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-f6b126e5c5b11551.js +0 -17
  709. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-f6b126e5c5b11551.js +0 -17
  710. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-f6b126e5c5b11551.js +0 -17
  711. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/messages/[message_id]/route-f6b126e5c5b11551.js +0 -17
  712. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-f6b126e5c5b11551.js +0 -17
  713. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-f6b126e5c5b11551.js +0 -17
  714. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-f6b126e5c5b11551.js +0 -17
  715. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-f6b126e5c5b11551.js +0 -17
  716. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-f6b126e5c5b11551.js +0 -17
  717. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-f6b126e5c5b11551.js +0 -17
  718. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-f6b126e5c5b11551.js +0 -17
  719. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-f6b126e5c5b11551.js +0 -17
  720. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-f6b126e5c5b11551.js +0 -17
  721. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-f6b126e5c5b11551.js +0 -17
  722. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-f6b126e5c5b11551.js +0 -17
  723. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-f6b126e5c5b11551.js +0 -17
  724. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-f6b126e5c5b11551.js +0 -17
  725. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-f6b126e5c5b11551.js +0 -17
  726. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-f6b126e5c5b11551.js +0 -17
  727. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-f6b126e5c5b11551.js +0 -17
  728. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-f6b126e5c5b11551.js +0 -17
  729. package/.next/standalone/.next/static/css/c4a8bed1da2c748f.css +0 -5
  730. /package/.next/standalone/.next/static/{6qLnqWdsfBTJOAJApUYXy → 2BAUJZ7x8eXCYpuZ-Kp7h}/_ssgManifest.js +0 -0
@@ -12,874 +12,874 @@ module.exports = require("next/dist/server/runtime-reacts.external.js");
12
12
 
13
13
  /***/ }),
14
14
 
15
- /***/ 150927:
16
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
17
-
18
- __webpack_require__.r(__webpack_exports__);
19
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20
- /* harmony export */ handler: () => (/* binding */ handler),
21
- /* harmony export */ patchFetch: () => (/* binding */ patchFetch),
22
- /* harmony export */ routeModule: () => (/* binding */ routeModule),
23
- /* harmony export */ serverHooks: () => (/* binding */ serverHooks),
24
- /* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
25
- /* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
26
- /* harmony export */ });
27
- /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319225);
28
- /* 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__);
29
- /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(684006);
30
- /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
31
- /* 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__);
32
- /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(799373);
33
- /* 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__);
34
- /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(434775);
35
- /* 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__);
36
- /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(524235);
37
- /* 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__);
38
- /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(200261);
39
- /* 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__);
40
- /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(754365);
41
- /* 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__);
42
- /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(590771);
43
- /* 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__);
44
- /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(473461);
45
- /* 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__);
46
- /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(767798);
47
- /* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(192280);
48
- /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(662018);
49
- /* 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__);
50
- /* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(445696);
51
- /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(347929);
52
- /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
53
- /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(986439);
54
- /* 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__);
55
- /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(710246);
56
- /* 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__);
57
- /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(137527);
58
- /* 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__);
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
15
+ /***/ 176760:
16
+ /***/ ((module) => {
70
17
 
18
+ module.exports = require("node:path");
71
19
 
20
+ /***/ }),
72
21
 
22
+ /***/ 184536:
23
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
73
24
 
25
+ // ESM COMPAT FLAG
26
+ __webpack_require__.r(__webpack_exports__);
74
27
 
28
+ // EXPORTS
29
+ __webpack_require__.d(__webpack_exports__, {
30
+ GET: () => (/* binding */ GET)
31
+ });
75
32
 
33
+ // EXTERNAL MODULE: ./node_modules/next/dist/api/server.js
34
+ var server = __webpack_require__(945592);
35
+ // EXTERNAL MODULE: ./lib/api/sse.ts
36
+ var sse = __webpack_require__(553854);
37
+ // EXTERNAL MODULE: ./lib/env/config.ts
38
+ var config = __webpack_require__(367500);
39
+ ;// ./lib/logging/sink.ts
40
+ // In-process log capture.
41
+ //
42
+ // Patches the four `console.{log,info,warn,error}` methods so every line
43
+ // written to stdout/stderr is also pushed onto an in-memory ring buffer
44
+ // and broadcast to subscribers (the live SSE endpoint). The original
45
+ // stdout/stderr write is preserved verbatim — operators tailing the
46
+ // terminal see exactly the same output as before; the panel is purely
47
+ // additive.
48
+ //
49
+ // Bounded: ring caps at 2000 entries (~150 KB at typical line size) so a
50
+ // runaway log spew doesn't grow memory unbounded. Late subscribers see
51
+ // the most recent slice + everything after they connect.
52
+ //
53
+ // See ADR-0058.
54
+ //
55
+ // SECURITY NOTE: log lines often contain provider error bodies that
56
+ // happen to include credential material. Before storing or broadcasting
57
+ // we run each line through a redaction pass that replaces obvious
58
+ // `Authorization: Bearer …` / `api[_-]?key=…` / `token=…` patterns with
59
+ // `[redacted]`. This is best-effort; the underlying terminal output is
60
+ // unchanged (operators retain full fidelity for debugging on a trusted
61
+ // machine). The SSE endpoint is loopback-gated by the same auth rules
62
+ // as the rest of the API.
76
63
 
77
- // We inject the nextConfigOutput here so that we can use them in the route
78
- // module.
79
- const nextConfigOutput = "standalone"
80
- const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
81
- definition: {
82
- kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
83
- page: "/api/v1/logs/route",
84
- pathname: "/api/v1/logs",
85
- filename: "route",
86
- bundlePath: "app/api/v1/logs/route"
87
- },
88
- distDir: ".next" || 0,
89
- relativeProjectDir: false || '',
90
- resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/logs/route.ts",
91
- nextConfigOutput,
92
- // The lazy require factory ensures that:
93
- // - In dev: devRequestTimingInternalsEnd is set before userland executes,
94
- // correctly attributing module load time to application-code rather than
95
- // framework internals.
96
- // - In all modes: async modules (route files with top-level await) are
97
- // handled correctly — require() returns a Promise for such modules, which
98
- // ensureUserland() awaits before the first request is handled.
99
- userland: ()=>__webpack_require__(184536),
100
- // In Turbopack dev mode, also provide a synchronous per-request getter so
101
- // server HMR updates are picked up without re-executing the entry chunk.
102
- // Using require() (synchronous) avoids adding async overhead that would be
103
- // incorrectly attributed to application-code time in devRequestTiming.
104
- ... false ? 0 : {}
105
- });
106
- // Pull out the exports that we need to expose from the module. This should
107
- // be eliminated when we've moved the other routes to the new format. These
108
- // are used to hook into the route.
109
- const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
110
- function patchFetch() {
111
- return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
112
- workAsyncStorage,
113
- workUnitAsyncStorage
114
- });
64
+ // "log" is treated as info-tier when filtering — Node's console.log writes
65
+ // to stdout, same severity as console.info.
66
+ const LEVEL_RANK = {
67
+ log: 1,
68
+ info: 1,
69
+ warn: 2,
70
+ error: 3
71
+ };
72
+ const CONFIG_LEVEL_RANK = {
73
+ debug: 0,
74
+ info: 1,
75
+ warn: 2,
76
+ error: 3
77
+ };
78
+ // JARELA_LOGS_RING_SIZE / JARELA_LOG_LEVEL override these. Read at first
79
+ // pushEntry, then memoised — the ring grows up to this cap and changes
80
+ // require restart (the splice() math closes over the cap value).
81
+ let _ringCap = null;
82
+ function ringCapacity() {
83
+ if (_ringCap === null) _ringCap = (0,config/* getConfig */.z)().logsRingSize;
84
+ return _ringCap;
115
85
  }
116
-
117
- async function handler(req, res, ctx) {
118
- if (ctx.requestMeta) {
119
- (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
120
- }
121
- if (routeModule.isDev) {
122
- (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
86
+ function passesLogLevel(level) {
87
+ const min = CONFIG_LEVEL_RANK[(0,config/* getConfig */.z)().logLevel];
88
+ return LEVEL_RANK[level] >= min;
89
+ }
90
+ // Shared state lives on globalThis so every module instance of this file
91
+ // (Next.js bundles routes separately and may hot-reload in dev) reads and
92
+ // writes the SAME ring + subscriber set + seq counter as the console-patch
93
+ // closure. Without this, the first sink instance to patch console owns the
94
+ // live state, and any other instance (e.g. the one imported by the /api/v1/logs
95
+ // route bundle) sees an empty ring + empty subscribers and the Logs panel
96
+ // never receives anything.
97
+ const STATE_KEY = Symbol.for("@jarela/log-sink-state");
98
+ function sinkState() {
99
+ const g = globalThis;
100
+ if (!g[STATE_KEY]) {
101
+ g[STATE_KEY] = {
102
+ ring: [],
103
+ subscribers: new Set(),
104
+ nextSeq: 1
105
+ };
123
106
  }
124
- let srcPage = "/api/v1/logs/route";
125
- // turbopack doesn't normalize `/index` in the page name
126
- // so we need to to process dynamic routes properly
127
- // TODO: fix turbopack providing differing value from webpack
128
- if (false) {} else if (srcPage === '/index') {
129
- // we always normalize /index specifically
130
- srcPage = '/';
107
+ return g[STATE_KEY];
108
+ }
109
+ const PATCH_MARK = Symbol.for("@jarela/console-patched");
110
+ const REDACTION_PATTERNS = [
111
+ // Authorization / Proxy-Authorization header values.
112
+ [
113
+ /(authorization\s*[:=]\s*(?:bearer|basic)\s+)\S+/gi,
114
+ "$1[redacted]"
115
+ ],
116
+ // api_key / apikey / api-key in url query strings or JSON-ish text.
117
+ [
118
+ /(api[_-]?key["'\s:=]+)([A-Za-z0-9._-]{8,})/gi,
119
+ "$1[redacted]"
120
+ ],
121
+ // OpenAI / Anthropic / GitHub style tokens. Conservative — don't redact
122
+ // tokens shorter than 16 chars (false-positive on agent IDs etc.).
123
+ [
124
+ /\bsk-[A-Za-z0-9_-]{20,}\b/g,
125
+ "[redacted-key]"
126
+ ],
127
+ [
128
+ /\bghp_[A-Za-z0-9_-]{20,}\b/g,
129
+ "[redacted-token]"
130
+ ],
131
+ [
132
+ /\bgho_[A-Za-z0-9_-]{20,}\b/g,
133
+ "[redacted-token]"
134
+ ],
135
+ // Atlassian-style JWT-ish values in URL.
136
+ [
137
+ /(token\s*[:=]\s*)[A-Za-z0-9._-]{20,}/g,
138
+ "$1[redacted]"
139
+ ],
140
+ // PIN-like 6-digit values in JSON bodies posted to /api/v1/security/*
141
+ // (ADR-0063). The keys are `pin`, `newPin`, `currentPin`.
142
+ [
143
+ /("(?:pin|newPin|currentPin)"\s*:\s*")\d{6}(")/gi,
144
+ "$1[redacted]$2"
145
+ ]
146
+ ];
147
+ function redact(line) {
148
+ let out = line;
149
+ for (const [re, replacement] of REDACTION_PATTERNS){
150
+ out = out.replace(re, replacement);
131
151
  }
132
- const multiZoneDraftMode = false;
133
- // Registering `instrumentation.ts` usually installs the tracer provider, so
134
- // do it before starting the request span. The span is started before
135
- // `prepare`, so route module preparation is part of the request's trace.
136
- // When this request triggers registration, the lifecycle spans of
137
- // `instrumentation.ts` are emitted inside the request span.
138
- const { instrumentation } = await routeModule.ensureInstrumentation(req, {
139
- deferSpans: true
140
- });
141
- return routeModule.traceRequest(req, {
142
- tracer: (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)(),
143
- spanName: `${req.method || 'GET'} ${srcPage}`,
144
- httpTarget: req.url,
145
- instrumentation
146
- }, (requestSpan, requestRootSpan)=>handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan));
152
+ return out;
147
153
  }
148
- async function handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan) {
149
- const prepareResult = await routeModule.prepare(req, res, {
150
- srcPage,
151
- multiZoneDraftMode
152
- });
153
- if (!prepareResult) {
154
- res.statusCode = 400;
155
- res.end('Bad Request');
156
- ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
157
- return null;
158
- }
159
- const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
160
- const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
161
- // Only this route's prerenders can establish ISR or admit generated params.
162
- 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]));
163
- let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
164
- const render404 = async ()=>{
165
- // TODO: should route-module itself handle rendering the 404
166
- if (routerServerContext == null ? void 0 : routerServerContext.render404) {
167
- await routerServerContext.render404(req, res, parsedUrl, false);
168
- } else {
169
- res.end('This page could not be found');
154
+ function pushEntry(level, args) {
155
+ // Filter by configured level — terminal output is never filtered (the
156
+ // patched console wrapper invoked the original BEFORE this), so this only
157
+ // gates what lands in the in-app Logs panel + SSE feed.
158
+ if (!passesLogLevel(level)) return;
159
+ // Match Node's util.format-ish behaviour: stringify each arg and join with
160
+ // spaces. Errors flatten to .stack when present.
161
+ const text = redact(args.map((a)=>{
162
+ if (a instanceof Error) return a.stack ?? a.message;
163
+ if (typeof a === "string") return a;
164
+ try {
165
+ return JSON.stringify(a);
166
+ } catch {
167
+ return String(a);
170
168
  }
171
- return null;
169
+ }).join(" "));
170
+ const s = sinkState();
171
+ const entry = {
172
+ seq: s.nextSeq,
173
+ ts: Date.now(),
174
+ level,
175
+ text
172
176
  };
173
- if (isIsr && !isDraftMode) {
174
- const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
175
- if (prerenderInfo) {
176
- if (prerenderInfo.fallback === false && !isPrerendered) {
177
- if (nextConfig.adapterPath) {
178
- return await render404();
179
- }
180
- throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
181
- }
182
- }
177
+ s.nextSeq += 1;
178
+ s.ring.push(entry);
179
+ const cap = ringCapacity();
180
+ if (s.ring.length > cap) {
181
+ s.ring.splice(0, s.ring.length - cap);
183
182
  }
184
- let cacheKey = null;
185
- if (isIsr && !routeModule.isDev && !isDraftMode) {
186
- cacheKey = resolvedPathname;
187
- // ensure /index and / is normalized to one key
188
- cacheKey = cacheKey === '/index' ? '/' : cacheKey;
183
+ for (const sub of s.subscribers){
184
+ try {
185
+ sub(entry);
186
+ } catch {}
189
187
  }
190
- // Before rendering (which initializes component tree modules), we have to
191
- // set the reference manifests to our global store so Server Action's
192
- // encryption util can access to them at the top level of the page module.
193
- if (serverActionsManifest && clientReferenceManifest) {
194
- (0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
195
- page: srcPage,
196
- clientReferenceManifest,
197
- serverActionsManifest
198
- });
188
+ }
189
+ /**
190
+ * Patch console.{log,info,warn,error} once. Idempotent via a global
191
+ * Symbol so dev HMR / multiple imports never double-patch.
192
+ *
193
+ * The original methods are kept verbatim — patched versions invoke the
194
+ * originals first (so stdout/stderr output is unchanged), THEN push to
195
+ * the ring + subscribers. Throws inside the ring path are swallowed so
196
+ * a logging bug can't cascade into a console crash.
197
+ */ function installConsolePatch() {
198
+ const c = console;
199
+ if (c[PATCH_MARK]) return;
200
+ const levels = [
201
+ "log",
202
+ "info",
203
+ "warn",
204
+ "error"
205
+ ];
206
+ for (const level of levels){
207
+ const original = c[level].bind(console);
208
+ c[level] = (...args)=>{
209
+ original(...args);
210
+ try {
211
+ pushEntry(level, args);
212
+ } catch {}
213
+ };
199
214
  }
200
- const method = req.method || 'GET';
201
- const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
202
- const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
203
- const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
204
- const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
205
- incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
206
- globalThis.__incrementalCache = incrementalCache;
207
- const context = {
208
- params,
209
- previewProps,
210
- renderOpts: {
211
- experimental: {
212
- authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
213
- useCacheTimeout: nextConfig.experimental.useCacheTimeout,
214
- durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
215
- },
216
- cacheComponents: Boolean(nextConfig.cacheComponents),
217
- validationLevel: nextConfig.experimental.instantInsights.validationLevel,
218
- isDraftMode,
219
- incrementalCache,
220
- hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
221
- cacheLifeProfiles: nextConfig.cacheLife,
222
- staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
223
- waitUntil: ctx.waitUntil,
224
- onClose: (cb)=>{
225
- res.on('close', cb);
226
- },
227
- onAfterTaskError: undefined
228
- },
229
- sharedContext: {
230
- buildId,
231
- deploymentId
232
- }
215
+ c[PATCH_MARK] = true;
216
+ }
217
+ /**
218
+ * Subscribe to live log entries. Returns an unsubscribe function. SSE
219
+ * route uses this to forward each new line to the connected client.
220
+ *
221
+ * Note: subscribers do NOT receive the historical ring — call
222
+ * `recentEntries()` first to replay backlog, then subscribe for new lines.
223
+ */ function subscribe(fn) {
224
+ const s = sinkState();
225
+ s.subscribers.add(fn);
226
+ return ()=>{
227
+ s.subscribers.delete(fn);
233
228
  };
234
- const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
235
- const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
236
- const nextReq = next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.signalFromNodeResponse)(res));
237
- const responseGenerator = async ({ previousCacheEntry })=>{
238
- try {
239
- if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
240
- res.statusCode = 404;
241
- // on-demand revalidate always sets this header
242
- res.setHeader('x-nextjs-cache', 'REVALIDATED');
243
- res.end('This page could not be found');
244
- return null;
245
- }
246
- const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
247
- req.fetchMetrics = context.renderOpts.fetchMetrics;
248
- let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
249
- // Attempt using provided waitUntil if available
250
- // if it's not we fallback to sendResponse's handling
251
- if (pendingWaitUntil) {
252
- if (ctx.waitUntil) {
253
- ctx.waitUntil(pendingWaitUntil);
254
- pendingWaitUntil = undefined;
229
+ }
230
+ /** Most recent N entries (most-recent-first ordering optional via reverse). */ function recentEntries(limit) {
231
+ const s = sinkState();
232
+ if (!limit || limit >= s.ring.length) return s.ring.slice();
233
+ return s.ring.slice(-limit);
234
+ }
235
+ /** Test-only: clear ring + subscriber set + reset seq + ring-cap memo. */ function _resetLogSink() {
236
+ const s = sinkState();
237
+ s.ring.length = 0;
238
+ s.subscribers.clear();
239
+ s.nextSeq = 1;
240
+ _ringCap = null;
241
+ }
242
+
243
+ ;// ./app/api/v1/logs/route.ts
244
+ // Live server-log feed for the Logs panel.
245
+ //
246
+ // GET /api/v1/logs — replay ring + subscribe to new lines (SSE)
247
+ // GET /api/v1/logs?since=<seq> — replay only entries newer than this seq
248
+ // (used by the panel on reconnect)
249
+ // GET /api/v1/logs?recent=<N> — return the most recent N entries as JSON
250
+ // (no SSE — for snapshot/export)
251
+ //
252
+ // SSE events are JSON-encoded LogEntry objects, one per `data:` line. The
253
+ // `seq` field on each entry lets the client drop duplicates if the EventSource
254
+ // reconnects (similar pattern to how lib/agents/run-registry.ts replays).
255
+ //
256
+ // See ADR-0058.
257
+
258
+
259
+
260
+ // Auto-install the console patch on first request. instrumentation-node.ts
261
+ // installs it eagerly in production, but dev / edge-runtime skip the boot
262
+ // hook — without this fallback, dev would silently see no logs in the
263
+ // panel. installConsolePatch is idempotent.
264
+ let _patched = false;
265
+ function ensurePatched() {
266
+ if (_patched) return;
267
+ installConsolePatch();
268
+ _patched = true;
269
+ }
270
+ const enc = new TextEncoder();
271
+ const route_sse = (obj)=>enc.encode(`data: ${JSON.stringify(obj)}\n\n`);
272
+ async function GET(req) {
273
+ ensurePatched();
274
+ const url = new URL(req.url);
275
+ const recentParam = url.searchParams.get("recent");
276
+ if (recentParam) {
277
+ // Snapshot mode — return JSON array, no streaming.
278
+ const n = Math.max(0, Math.min(2000, Number(recentParam) | 0));
279
+ return server.NextResponse.json({
280
+ entries: recentEntries(n)
281
+ });
282
+ }
283
+ const sinceParam = url.searchParams.get("since");
284
+ const sinceSeq = sinceParam ? Math.max(0, Number(sinceParam) | 0) : 0;
285
+ // Hoisted cleanup so the cancel() callback can reach into start()'s
286
+ // closure when the client disconnects (browser tab closed, panel
287
+ // unmounted, navigation away). ReadableStream doesn't pass the
288
+ // controller into cancel(), so we stash the unsub + heartbeat handles
289
+ // here.
290
+ let cleanup = null;
291
+ const stream = new ReadableStream({
292
+ start (controller) {
293
+ let clientGone = false;
294
+ const safeEnqueue = (chunk)=>{
295
+ if (clientGone) return;
296
+ try {
297
+ controller.enqueue(chunk);
298
+ } catch {
299
+ clientGone = true;
255
300
  }
301
+ };
302
+ // Replay ring filtered by since-seq.
303
+ for (const entry of recentEntries()){
304
+ if (entry.seq > sinceSeq) safeEnqueue(route_sse(entry));
256
305
  }
257
- const cacheTags = context.renderOpts.collectedTags;
258
- // If the request is for a static response, we can cache it so long
259
- // as it's not edge.
260
- if (isIsr) {
261
- const blob = await response.blob();
262
- // Copy the headers from the response.
263
- const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
264
- if (cacheTags) {
265
- headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
266
- }
267
- if (!headers['content-type'] && blob.type) {
268
- headers['content-type'] = blob.type;
269
- }
270
- const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
271
- const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? // route has a numeric `revalidate` but didn't declare an
272
- // explicit `expire` (e.g. via `cacheLife`). This mirrors the
273
- // build-time fallback in `build/index.ts` so cache entries
274
- // and the response Cache-Control header agree on the route's
275
- // effective expire. Routes that opt out of revalidation
276
- // (`revalidate: false`) or that are dynamic (`revalidate: 0`)
277
- // keep `expire: undefined`.
278
- revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
279
- // Create the cache entry for the response.
280
- const cacheEntry = {
281
- value: {
282
- kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
283
- status: response.status,
284
- body: Buffer.from(await blob.arrayBuffer()),
285
- headers
286
- },
287
- cacheControl: {
288
- revalidate,
289
- expire
290
- }
291
- };
292
- return cacheEntry;
293
- } else {
294
- // send response without caching if not ISR
295
- await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
296
- return null;
297
- }
298
- } catch (err) {
299
- // if this is a background revalidate we need to report
300
- // the request error here as it won't be bubbled
301
- if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
302
- const silenceLog = false;
303
- await routeModule.onRequestError(req, err, {
304
- routerKind: 'App Router',
305
- routePath: srcPage,
306
- routeType: 'route',
307
- revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
308
- isStaticGeneration: cacheKey !== null,
309
- isOnDemandRevalidate
310
- })
311
- }, silenceLog, routerServerContext);
312
- }
313
- throw err;
314
- }
315
- };
316
- const handleResponse = async (currentSpan)=>{
317
- try {
318
- var _cacheEntry_value;
319
- const cacheEntry = await routeModule.handleResponse({
320
- req,
321
- nextConfig,
322
- cacheKey,
323
- routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
324
- isFallback: false,
325
- previewProps,
326
- prerenderManifest,
327
- isRoutePPREnabled: false,
328
- isOnDemandRevalidate,
329
- revalidateOnlyGenerated,
330
- responseGenerator,
331
- waitUntil: ctx.waitUntil,
332
- isMinimalMode
306
+ // Subscribe for live entries until the client disconnects.
307
+ const unsubscribe = subscribe((entry)=>{
308
+ safeEnqueue(route_sse(entry));
333
309
  });
334
- if (cacheEntry !== null && 'error' in cacheEntry) {
335
- throw cacheEntry.error;
336
- }
337
- // we don't create a cacheEntry for ISR
338
- if (!isIsr) {
339
- return;
340
- }
341
- 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) {
342
- var _cacheEntry_value1;
343
- throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
344
- }
345
- if (!isMinimalMode) {
346
- res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
347
- }
348
- // Draft mode should never be cached
349
- if (isDraftMode) {
350
- res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
351
- }
352
- const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
353
- if (!(isMinimalMode && isIsr)) {
354
- headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
355
- }
356
- // If cache control is already set on the response we don't
357
- // override it to allow users to customize it via next.config
358
- if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
359
- headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
360
- }
361
- 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'.
362
- new Response(cacheEntry.value.body, {
363
- headers,
364
- status: cacheEntry.value.status || 200
365
- }));
366
- return;
367
- } catch (err) {
368
- if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
369
- const silenceLog = false;
370
- await routeModule.onRequestError(req, err, {
371
- routerKind: 'App Router',
372
- routePath: normalizedSrcPage,
373
- routeType: 'route',
374
- revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
375
- isStaticGeneration: cacheKey !== null,
376
- isOnDemandRevalidate
377
- })
378
- }, silenceLog, routerServerContext);
379
- }
380
- // rethrow so that we can handle serving error page
381
- // If this is during static generation, throw the error again.
382
- if (isIsr) throw err;
383
- // Otherwise, send a 500 response unless the original response has
384
- // already committed. In that case, preserve its status code for
385
- // telemetry while still recording the failure and terminating a response
386
- // that the failed pipeline left open.
387
- if (res.headersSent) {
388
- if (currentSpan) {
389
- const error = err instanceof Error ? err : new Error('Unknown app route error');
390
- currentSpan.recordException(error);
391
- currentSpan.setStatus({
392
- code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
393
- message: error.message
394
- });
395
- currentSpan.setAttribute('error.type', error.name);
396
- }
397
- if (!res.writableEnded && !res.destroyed) {
398
- res.end();
399
- }
400
- } else {
401
- await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
402
- status: 500
403
- }));
404
- }
405
- return;
406
- } finally{
407
- ;
408
- (()=>{
409
- if (!currentSpan) {
410
- return;
411
- }
412
- let statusCode = res.statusCode;
413
- currentSpan.setAttributes({
414
- 'http.status_code': statusCode,
415
- 'next.rsc': false
416
- });
417
- if (statusCode && statusCode >= 500) {
418
- // For 5xx status codes: SHOULD be set to 'Error' span status.
419
- // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
420
- currentSpan.setStatus({
421
- code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
422
- });
423
- // For span status 'Error', SHOULD set 'error.type' attribute.
424
- currentSpan.setAttribute('error.type', statusCode.toString());
425
- }
426
- const rootSpanAttributes = tracer.getRootSpanAttributes();
427
- // We were unable to get attributes, probably OTEL is not enabled
428
- if (!rootSpanAttributes) {
429
- return;
430
- }
431
- if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
432
- console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
433
- return;
434
- }
435
- const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
436
- const name = `${method} ${route}`;
437
- currentSpan.setAttributes({
438
- 'next.route': route,
439
- 'http.route': route,
440
- 'next.span_name': name
441
- });
442
- currentSpan.updateName(name);
443
- // Propagate http.route to the request's root span if it isn't the
444
- // request span (e.g. a platform-created HTTP span in adapter
445
- // deployments).
446
- if (requestRootSpan && requestRootSpan !== currentSpan) {
447
- requestRootSpan.setAttribute('http.route', route);
448
- requestRootSpan.updateName(name);
310
+ // Heartbeat every 25s so corporate proxies don't kill an idle
311
+ // connection. SSE comments (lines starting with ":") are ignored
312
+ // by EventSource on the client.
313
+ const heartbeat = setInterval(()=>{
314
+ if (clientGone) return;
315
+ try {
316
+ controller.enqueue(enc.encode(": heartbeat\n\n"));
317
+ } catch {
318
+ clientGone = true;
449
319
  }
450
- })();
320
+ }, 25000);
321
+ heartbeat.unref?.();
322
+ cleanup = ()=>{
323
+ clientGone = true;
324
+ clearInterval(heartbeat);
325
+ unsubscribe();
326
+ };
327
+ },
328
+ cancel () {
329
+ cleanup?.();
451
330
  }
452
- };
453
- // When invoked directly, the request span was started before `prepare`;
454
- // record the request target as normalized by it. next-server's request span
455
- // already has it.
456
- if (!isWrappedByNextServer && req.url !== undefined) {
457
- requestSpan == null ? void 0 : requestSpan.setAttribute('http.target', req.url);
458
- }
459
- await handleResponse(requestSpan);
331
+ });
332
+ return (0,sse/* sseResponse */.t)(stream);
460
333
  }
461
334
 
462
- //# sourceMappingURL=app-route.js.map
463
-
464
335
 
465
336
  /***/ }),
466
337
 
467
- /***/ 176760:
338
+ /***/ 200261:
468
339
  /***/ ((module) => {
469
340
 
470
- module.exports = require("node:path");
341
+ module.exports = require("next/dist/shared/lib/router/utils/app-paths");
471
342
 
472
343
  /***/ }),
473
344
 
474
- /***/ 184536:
475
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
345
+ /***/ 333873:
346
+ /***/ ((module) => {
476
347
 
477
- // ESM COMPAT FLAG
478
- __webpack_require__.r(__webpack_exports__);
348
+ module.exports = require("path");
479
349
 
480
- // EXPORTS
481
- __webpack_require__.d(__webpack_exports__, {
482
- GET: () => (/* binding */ GET)
483
- });
350
+ /***/ }),
484
351
 
485
- // EXTERNAL MODULE: ./node_modules/next/dist/api/server.js
486
- var server = __webpack_require__(945592);
487
- // EXTERNAL MODULE: ./lib/api/sse.ts
488
- var sse = __webpack_require__(553854);
489
- // EXTERNAL MODULE: ./lib/env/config.ts
490
- var config = __webpack_require__(367500);
491
- ;// ./lib/logging/sink.ts
492
- // In-process log capture.
493
- //
494
- // Patches the four `console.{log,info,warn,error}` methods so every line
495
- // written to stdout/stderr is also pushed onto an in-memory ring buffer
496
- // and broadcast to subscribers (the live SSE endpoint). The original
497
- // stdout/stderr write is preserved verbatim — operators tailing the
498
- // terminal see exactly the same output as before; the panel is purely
499
- // additive.
500
- //
501
- // Bounded: ring caps at 2000 entries (~150 KB at typical line size) so a
502
- // runaway log spew doesn't grow memory unbounded. Late subscribers see
503
- // the most recent slice + everything after they connect.
504
- //
505
- // See ADR-0058.
506
- //
507
- // SECURITY NOTE: log lines often contain provider error bodies that
508
- // happen to include credential material. Before storing or broadcasting
509
- // we run each line through a redaction pass that replaces obvious
510
- // `Authorization: Bearer …` / `api[_-]?key=…` / `token=…` patterns with
511
- // `[redacted]`. This is best-effort; the underlying terminal output is
512
- // unchanged (operators retain full fidelity for debugging on a trusted
513
- // machine). The SSE endpoint is loopback-gated by the same auth rules
514
- // as the rest of the API.
352
+ /***/ 419121:
353
+ /***/ ((module) => {
515
354
 
516
- // "log" is treated as info-tier when filtering — Node's console.log writes
517
- // to stdout, same severity as console.info.
518
- const LEVEL_RANK = {
519
- log: 1,
520
- info: 1,
521
- warn: 2,
522
- error: 3
523
- };
524
- const CONFIG_LEVEL_RANK = {
525
- debug: 0,
526
- info: 1,
527
- warn: 2,
528
- error: 3
529
- };
530
- // JARELA_LOGS_RING_SIZE / JARELA_LOG_LEVEL override these. Read at first
531
- // pushEntry, then memoised — the ring grows up to this cap and changes
532
- // require restart (the splice() math closes over the cap value).
533
- let _ringCap = null;
534
- function ringCapacity() {
535
- if (_ringCap === null) _ringCap = (0,config/* getConfig */.z)().logsRingSize;
536
- return _ringCap;
537
- }
538
- function passesLogLevel(level) {
539
- const min = CONFIG_LEVEL_RANK[(0,config/* getConfig */.z)().logLevel];
540
- return LEVEL_RANK[level] >= min;
541
- }
542
- // Shared state lives on globalThis so every module instance of this file
543
- // (Next.js bundles routes separately and may hot-reload in dev) reads and
544
- // writes the SAME ring + subscriber set + seq counter as the console-patch
545
- // closure. Without this, the first sink instance to patch console owns the
546
- // live state, and any other instance (e.g. the one imported by the /api/v1/logs
547
- // route bundle) sees an empty ring + empty subscribers and the Logs panel
548
- // never receives anything.
549
- const STATE_KEY = Symbol.for("@jarela/log-sink-state");
550
- function sinkState() {
551
- const g = globalThis;
552
- if (!g[STATE_KEY]) {
553
- g[STATE_KEY] = {
554
- ring: [],
555
- subscribers: new Set(),
556
- nextSeq: 1
557
- };
558
- }
559
- return g[STATE_KEY];
560
- }
561
- const PATCH_MARK = Symbol.for("@jarela/console-patched");
562
- const REDACTION_PATTERNS = [
563
- // Authorization / Proxy-Authorization header values.
564
- [
565
- /(authorization\s*[:=]\s*(?:bearer|basic)\s+)\S+/gi,
566
- "$1[redacted]"
567
- ],
568
- // api_key / apikey / api-key in url query strings or JSON-ish text.
569
- [
570
- /(api[_-]?key["'\s:=]+)([A-Za-z0-9._-]{8,})/gi,
571
- "$1[redacted]"
572
- ],
573
- // OpenAI / Anthropic / GitHub style tokens. Conservative — don't redact
574
- // tokens shorter than 16 chars (false-positive on agent IDs etc.).
575
- [
576
- /\bsk-[A-Za-z0-9_-]{20,}\b/g,
577
- "[redacted-key]"
578
- ],
579
- [
580
- /\bghp_[A-Za-z0-9_-]{20,}\b/g,
581
- "[redacted-token]"
582
- ],
583
- [
584
- /\bgho_[A-Za-z0-9_-]{20,}\b/g,
585
- "[redacted-token]"
586
- ],
587
- // Atlassian-style JWT-ish values in URL.
588
- [
589
- /(token\s*[:=]\s*)[A-Za-z0-9._-]{20,}/g,
590
- "$1[redacted]"
591
- ],
592
- // PIN-like 6-digit values in JSON bodies posted to /api/v1/security/*
593
- // (ADR-0063). The keys are `pin`, `newPin`, `currentPin`.
594
- [
595
- /("(?:pin|newPin|currentPin)"\s*:\s*")\d{6}(")/gi,
596
- "$1[redacted]$2"
597
- ]
598
- ];
599
- function redact(line) {
600
- let out = line;
601
- for (const [re, replacement] of REDACTION_PATTERNS){
602
- out = out.replace(re, replacement);
603
- }
604
- return out;
605
- }
606
- function pushEntry(level, args) {
607
- // Filter by configured level — terminal output is never filtered (the
608
- // patched console wrapper invoked the original BEFORE this), so this only
609
- // gates what lands in the in-app Logs panel + SSE feed.
610
- if (!passesLogLevel(level)) return;
611
- // Match Node's util.format-ish behaviour: stringify each arg and join with
612
- // spaces. Errors flatten to .stack when present.
613
- const text = redact(args.map((a)=>{
614
- if (a instanceof Error) return a.stack ?? a.message;
615
- if (typeof a === "string") return a;
616
- try {
617
- return JSON.stringify(a);
618
- } catch {
619
- return String(a);
620
- }
621
- }).join(" "));
622
- const s = sinkState();
623
- const entry = {
624
- seq: s.nextSeq,
625
- ts: Date.now(),
626
- level,
627
- text
628
- };
629
- s.nextSeq += 1;
630
- s.ring.push(entry);
631
- const cap = ringCapacity();
632
- if (s.ring.length > cap) {
633
- s.ring.splice(0, s.ring.length - cap);
634
- }
635
- for (const sub of s.subscribers){
636
- try {
637
- sub(entry);
638
- } catch {}
639
- }
640
- }
641
- /**
642
- * Patch console.{log,info,warn,error} once. Idempotent via a global
643
- * Symbol so dev HMR / multiple imports never double-patch.
644
- *
645
- * The original methods are kept verbatim — patched versions invoke the
646
- * originals first (so stdout/stderr output is unchanged), THEN push to
647
- * the ring + subscribers. Throws inside the ring path are swallowed so
648
- * a logging bug can't cascade into a console crash.
649
- */ function installConsolePatch() {
650
- const c = console;
651
- if (c[PATCH_MARK]) return;
652
- const levels = [
653
- "log",
654
- "info",
655
- "warn",
656
- "error"
657
- ];
658
- for (const level of levels){
659
- const original = c[level].bind(console);
660
- c[level] = (...args)=>{
661
- original(...args);
662
- try {
663
- pushEntry(level, args);
664
- } catch {}
665
- };
666
- }
667
- c[PATCH_MARK] = true;
668
- }
669
- /**
670
- * Subscribe to live log entries. Returns an unsubscribe function. SSE
671
- * route uses this to forward each new line to the connected client.
672
- *
673
- * Note: subscribers do NOT receive the historical ring — call
674
- * `recentEntries()` first to replay backlog, then subscribe for new lines.
675
- */ function subscribe(fn) {
676
- const s = sinkState();
677
- s.subscribers.add(fn);
678
- return ()=>{
679
- s.subscribers.delete(fn);
355
+ module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
356
+
357
+ /***/ }),
358
+
359
+ /***/ 455511:
360
+ /***/ ((module) => {
361
+
362
+ module.exports = require("crypto");
363
+
364
+ /***/ }),
365
+
366
+ /***/ 529294:
367
+ /***/ ((module) => {
368
+
369
+ module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
370
+
371
+ /***/ }),
372
+
373
+ /***/ 553854:
374
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
375
+
376
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
377
+ /* harmony export */ t: () => (/* binding */ sseResponse)
378
+ /* harmony export */ });
379
+ // Shared response builder for Server-Sent Event streams. Centralises the
380
+ // content-type / cache-control / connection / proxy-buffering headers so
381
+ // every SSE endpoint behaves identically through nginx, tailscale-serve,
382
+ // and Cloudflare. See ADR-0009 for the proxy story.
383
+ function sseResponse(stream, opts = {}) {
384
+ const { disableProxyBuffering = true } = opts;
385
+ const headers = {
386
+ "Content-Type": "text/event-stream",
387
+ "Cache-Control": "no-cache",
388
+ Connection: "keep-alive"
680
389
  };
681
- }
682
- /** Most recent N entries (most-recent-first ordering optional via reverse). */ function recentEntries(limit) {
683
- const s = sinkState();
684
- if (!limit || limit >= s.ring.length) return s.ring.slice();
685
- return s.ring.slice(-limit);
686
- }
687
- /** Test-only: clear ring + subscriber set + reset seq + ring-cap memo. */ function _resetLogSink() {
688
- const s = sinkState();
689
- s.ring.length = 0;
690
- s.subscribers.clear();
691
- s.nextSeq = 1;
692
- _ringCap = null;
390
+ if (disableProxyBuffering) headers["X-Accel-Buffering"] = "no";
391
+ return new Response(stream, {
392
+ headers
393
+ });
693
394
  }
694
395
 
695
- ;// ./app/api/v1/logs/route.ts
696
- // Live server-log feed for the Logs panel.
697
- //
698
- // GET /api/v1/logs — replay ring + subscribe to new lines (SSE)
699
- // GET /api/v1/logs?since=<seq> — replay only entries newer than this seq
700
- // (used by the panel on reconnect)
701
- // GET /api/v1/logs?recent=<N> — return the most recent N entries as JSON
702
- // (no SSE — for snapshot/export)
703
- //
704
- // SSE events are JSON-encoded LogEntry objects, one per `data:` line. The
705
- // `seq` field on each entry lets the client drop duplicates if the EventSource
706
- // reconnects (similar pattern to how lib/agents/run-registry.ts replays).
707
- //
708
- // See ADR-0058.
709
396
 
397
+ /***/ }),
710
398
 
399
+ /***/ 663033:
400
+ /***/ ((module) => {
711
401
 
712
- // Auto-install the console patch on first request. instrumentation-node.ts
713
- // installs it eagerly in production, but dev / edge-runtime skip the boot
714
- // hook — without this fallback, dev would silently see no logs in the
715
- // panel. installConsolePatch is idempotent.
716
- let _patched = false;
717
- function ensurePatched() {
718
- if (_patched) return;
719
- installConsolePatch();
720
- _patched = true;
721
- }
722
- const enc = new TextEncoder();
723
- const route_sse = (obj)=>enc.encode(`data: ${JSON.stringify(obj)}\n\n`);
724
- async function GET(req) {
725
- ensurePatched();
726
- const url = new URL(req.url);
727
- const recentParam = url.searchParams.get("recent");
728
- if (recentParam) {
729
- // Snapshot mode — return JSON array, no streaming.
730
- const n = Math.max(0, Math.min(2000, Number(recentParam) | 0));
731
- return server.NextResponse.json({
732
- entries: recentEntries(n)
733
- });
734
- }
735
- const sinceParam = url.searchParams.get("since");
736
- const sinceSeq = sinceParam ? Math.max(0, Number(sinceParam) | 0) : 0;
737
- // Hoisted cleanup so the cancel() callback can reach into start()'s
738
- // closure when the client disconnects (browser tab closed, panel
739
- // unmounted, navigation away). ReadableStream doesn't pass the
740
- // controller into cancel(), so we stash the unsub + heartbeat handles
741
- // here.
742
- let cleanup = null;
743
- const stream = new ReadableStream({
744
- start (controller) {
745
- let clientGone = false;
746
- const safeEnqueue = (chunk)=>{
747
- if (clientGone) return;
748
- try {
749
- controller.enqueue(chunk);
750
- } catch {
751
- clientGone = true;
402
+ module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
403
+
404
+ /***/ }),
405
+
406
+ /***/ 710846:
407
+ /***/ ((module) => {
408
+
409
+ module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");
410
+
411
+ /***/ }),
412
+
413
+ /***/ 744870:
414
+ /***/ ((module) => {
415
+
416
+ module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
417
+
418
+ /***/ }),
419
+
420
+ /***/ 848161:
421
+ /***/ ((module) => {
422
+
423
+ module.exports = require("node:os");
424
+
425
+ /***/ }),
426
+
427
+ /***/ 903295:
428
+ /***/ ((module) => {
429
+
430
+ module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");
431
+
432
+ /***/ }),
433
+
434
+ /***/ 952028:
435
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
436
+
437
+ __webpack_require__.r(__webpack_exports__);
438
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
439
+ /* harmony export */ handler: () => (/* binding */ handler),
440
+ /* harmony export */ patchFetch: () => (/* binding */ patchFetch),
441
+ /* harmony export */ routeModule: () => (/* binding */ routeModule),
442
+ /* harmony export */ serverHooks: () => (/* binding */ serverHooks),
443
+ /* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
444
+ /* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
445
+ /* harmony export */ });
446
+ /* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319225);
447
+ /* 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__);
448
+ /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(684006);
449
+ /* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
450
+ /* 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__);
451
+ /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(799373);
452
+ /* 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__);
453
+ /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(434775);
454
+ /* 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__);
455
+ /* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(524235);
456
+ /* 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__);
457
+ /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(200261);
458
+ /* 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__);
459
+ /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(754365);
460
+ /* 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__);
461
+ /* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(590771);
462
+ /* 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__);
463
+ /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(473461);
464
+ /* 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__);
465
+ /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(767798);
466
+ /* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(192280);
467
+ /* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(662018);
468
+ /* 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__);
469
+ /* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(445696);
470
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(347929);
471
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
472
+ /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(986439);
473
+ /* 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__);
474
+ /* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(710246);
475
+ /* 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__);
476
+ /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(137527);
477
+ /* 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__);
478
+
479
+
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+ // We inject the nextConfigOutput here so that we can use them in the route
497
+ // module.
498
+ const nextConfigOutput = "standalone"
499
+ const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
500
+ definition: {
501
+ kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
502
+ page: "/api/v1/logs/route",
503
+ pathname: "/api/v1/logs",
504
+ filename: "route",
505
+ bundlePath: "app/api/v1/logs/route"
506
+ },
507
+ distDir: ".next" || 0,
508
+ relativeProjectDir: false || '',
509
+ resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/logs/route.ts",
510
+ nextConfigOutput,
511
+ // The lazy require factory ensures that:
512
+ // - In dev: devRequestTimingInternalsEnd is set before userland executes,
513
+ // correctly attributing module load time to application-code rather than
514
+ // framework internals.
515
+ // - In all modes: async modules (route files with top-level await) are
516
+ // handled correctly — require() returns a Promise for such modules, which
517
+ // ensureUserland() awaits before the first request is handled.
518
+ userland: ()=>__webpack_require__(184536),
519
+ // In Turbopack dev mode, also provide a synchronous per-request getter so
520
+ // server HMR updates are picked up without re-executing the entry chunk.
521
+ // Using require() (synchronous) avoids adding async overhead that would be
522
+ // incorrectly attributed to application-code time in devRequestTiming.
523
+ ... false ? 0 : {}
524
+ });
525
+ // Pull out the exports that we need to expose from the module. This should
526
+ // be eliminated when we've moved the other routes to the new format. These
527
+ // are used to hook into the route.
528
+ const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
529
+ function patchFetch() {
530
+ return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
531
+ workAsyncStorage,
532
+ workUnitAsyncStorage
533
+ });
534
+ }
535
+
536
+ async function handler(req, res, ctx) {
537
+ if (ctx.requestMeta) {
538
+ (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
539
+ }
540
+ if (routeModule.isDev) {
541
+ (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
542
+ }
543
+ let srcPage = "/api/v1/logs/route";
544
+ // turbopack doesn't normalize `/index` in the page name
545
+ // so we need to to process dynamic routes properly
546
+ // TODO: fix turbopack providing differing value from webpack
547
+ if (false) {} else if (srcPage === '/index') {
548
+ // we always normalize /index specifically
549
+ srcPage = '/';
550
+ }
551
+ const multiZoneDraftMode = false;
552
+ // Registering `instrumentation.ts` usually installs the tracer provider, so
553
+ // do it before starting the request span. The span is started before
554
+ // `prepare`, so route module preparation is part of the request's trace.
555
+ // When this request triggers registration, the lifecycle spans of
556
+ // `instrumentation.ts` are emitted inside the request span.
557
+ const { instrumentation } = await routeModule.ensureInstrumentation(req, {
558
+ deferSpans: true
559
+ });
560
+ return routeModule.traceRequest(req, {
561
+ tracer: (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)(),
562
+ spanName: `${req.method || 'GET'} ${srcPage}`,
563
+ httpTarget: req.url,
564
+ instrumentation
565
+ }, (requestSpan, requestRootSpan)=>handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan));
566
+ }
567
+ async function handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan) {
568
+ const prepareResult = await routeModule.prepare(req, res, {
569
+ srcPage,
570
+ multiZoneDraftMode
571
+ });
572
+ if (!prepareResult) {
573
+ res.statusCode = 400;
574
+ res.end('Bad Request');
575
+ ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
576
+ return null;
577
+ }
578
+ const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
579
+ const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
580
+ // Only this route's prerenders can establish ISR or admit generated params.
581
+ 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]));
582
+ let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
583
+ const render404 = async ()=>{
584
+ // TODO: should route-module itself handle rendering the 404
585
+ if (routerServerContext == null ? void 0 : routerServerContext.render404) {
586
+ await routerServerContext.render404(req, res, parsedUrl, false);
587
+ } else {
588
+ res.end('This page could not be found');
589
+ }
590
+ return null;
591
+ };
592
+ if (isIsr && !isDraftMode) {
593
+ const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
594
+ if (prerenderInfo) {
595
+ if (prerenderInfo.fallback === false && !isPrerendered) {
596
+ if (nextConfig.adapterPath) {
597
+ return await render404();
598
+ }
599
+ throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
600
+ }
601
+ }
602
+ }
603
+ let cacheKey = null;
604
+ if (isIsr && !routeModule.isDev && !isDraftMode) {
605
+ cacheKey = resolvedPathname;
606
+ // ensure /index and / is normalized to one key
607
+ cacheKey = cacheKey === '/index' ? '/' : cacheKey;
608
+ }
609
+ // Before rendering (which initializes component tree modules), we have to
610
+ // set the reference manifests to our global store so Server Action's
611
+ // encryption util can access to them at the top level of the page module.
612
+ if (serverActionsManifest && clientReferenceManifest) {
613
+ (0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
614
+ page: srcPage,
615
+ clientReferenceManifest,
616
+ serverActionsManifest
617
+ });
618
+ }
619
+ const method = req.method || 'GET';
620
+ const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
621
+ const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
622
+ const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
623
+ const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
624
+ incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
625
+ globalThis.__incrementalCache = incrementalCache;
626
+ const context = {
627
+ params,
628
+ previewProps,
629
+ renderOpts: {
630
+ experimental: {
631
+ authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
632
+ useCacheTimeout: nextConfig.experimental.useCacheTimeout,
633
+ durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
634
+ },
635
+ cacheComponents: Boolean(nextConfig.cacheComponents),
636
+ validationLevel: nextConfig.experimental.instantInsights.validationLevel,
637
+ isDraftMode,
638
+ incrementalCache,
639
+ hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
640
+ cacheLifeProfiles: nextConfig.cacheLife,
641
+ staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
642
+ waitUntil: ctx.waitUntil,
643
+ onClose: (cb)=>{
644
+ res.on('close', cb);
645
+ },
646
+ onAfterTaskError: undefined
647
+ },
648
+ sharedContext: {
649
+ buildId,
650
+ deploymentId
651
+ }
652
+ };
653
+ const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
654
+ const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
655
+ const nextReq = next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0,next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__.signalFromNodeResponse)(res));
656
+ const responseGenerator = async ({ previousCacheEntry })=>{
657
+ try {
658
+ if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
659
+ res.statusCode = 404;
660
+ // on-demand revalidate always sets this header
661
+ res.setHeader('x-nextjs-cache', 'REVALIDATED');
662
+ res.end('This page could not be found');
663
+ return null;
664
+ }
665
+ const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
666
+ req.fetchMetrics = context.renderOpts.fetchMetrics;
667
+ let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
668
+ // Attempt using provided waitUntil if available
669
+ // if it's not we fallback to sendResponse's handling
670
+ if (pendingWaitUntil) {
671
+ if (ctx.waitUntil) {
672
+ ctx.waitUntil(pendingWaitUntil);
673
+ pendingWaitUntil = undefined;
674
+ }
675
+ }
676
+ const cacheTags = context.renderOpts.collectedTags;
677
+ // If the request is for a static response, we can cache it so long
678
+ // as it's not edge.
679
+ if (isIsr) {
680
+ const blob = await response.blob();
681
+ // Copy the headers from the response.
682
+ const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
683
+ if (cacheTags) {
684
+ headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
685
+ }
686
+ if (!headers['content-type'] && blob.type) {
687
+ headers['content-type'] = blob.type;
688
+ }
689
+ const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
690
+ const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? // route has a numeric `revalidate` but didn't declare an
691
+ // explicit `expire` (e.g. via `cacheLife`). This mirrors the
692
+ // build-time fallback in `build/index.ts` so cache entries
693
+ // and the response Cache-Control header agree on the route's
694
+ // effective expire. Routes that opt out of revalidation
695
+ // (`revalidate: false`) or that are dynamic (`revalidate: 0`)
696
+ // keep `expire: undefined`.
697
+ revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
698
+ // Create the cache entry for the response.
699
+ const cacheEntry = {
700
+ value: {
701
+ kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
702
+ status: response.status,
703
+ body: Buffer.from(await blob.arrayBuffer()),
704
+ headers
705
+ },
706
+ cacheControl: {
707
+ revalidate,
708
+ expire
709
+ }
710
+ };
711
+ return cacheEntry;
712
+ } else {
713
+ // send response without caching if not ISR
714
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
715
+ return null;
716
+ }
717
+ } catch (err) {
718
+ // if this is a background revalidate we need to report
719
+ // the request error here as it won't be bubbled
720
+ if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
721
+ const silenceLog = false;
722
+ await routeModule.onRequestError(req, err, {
723
+ routerKind: 'App Router',
724
+ routePath: srcPage,
725
+ routeType: 'route',
726
+ revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
727
+ isStaticGeneration: cacheKey !== null,
728
+ isOnDemandRevalidate
729
+ })
730
+ }, silenceLog, routerServerContext);
731
+ }
732
+ throw err;
733
+ }
734
+ };
735
+ const handleResponse = async (currentSpan)=>{
736
+ try {
737
+ var _cacheEntry_value;
738
+ const cacheEntry = await routeModule.handleResponse({
739
+ req,
740
+ nextConfig,
741
+ cacheKey,
742
+ routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
743
+ isFallback: false,
744
+ previewProps,
745
+ prerenderManifest,
746
+ isRoutePPREnabled: false,
747
+ isOnDemandRevalidate,
748
+ revalidateOnlyGenerated,
749
+ responseGenerator,
750
+ waitUntil: ctx.waitUntil,
751
+ isMinimalMode
752
+ });
753
+ if (cacheEntry !== null && 'error' in cacheEntry) {
754
+ throw cacheEntry.error;
755
+ }
756
+ // we don't create a cacheEntry for ISR
757
+ if (!isIsr) {
758
+ return;
759
+ }
760
+ 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) {
761
+ var _cacheEntry_value1;
762
+ throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
763
+ }
764
+ if (!isMinimalMode) {
765
+ res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
766
+ }
767
+ // Draft mode should never be cached
768
+ if (isDraftMode) {
769
+ res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
770
+ }
771
+ const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
772
+ if (!(isMinimalMode && isIsr)) {
773
+ headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
774
+ }
775
+ // If cache control is already set on the response we don't
776
+ // override it to allow users to customize it via next.config
777
+ if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
778
+ headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
779
+ }
780
+ 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'.
781
+ new Response(cacheEntry.value.body, {
782
+ headers,
783
+ status: cacheEntry.value.status || 200
784
+ }));
785
+ return;
786
+ } catch (err) {
787
+ if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
788
+ const silenceLog = false;
789
+ await routeModule.onRequestError(req, err, {
790
+ routerKind: 'App Router',
791
+ routePath: normalizedSrcPage,
792
+ routeType: 'route',
793
+ revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
794
+ isStaticGeneration: cacheKey !== null,
795
+ isOnDemandRevalidate
796
+ })
797
+ }, silenceLog, routerServerContext);
798
+ }
799
+ // rethrow so that we can handle serving error page
800
+ // If this is during static generation, throw the error again.
801
+ if (isIsr) throw err;
802
+ // Otherwise, send a 500 response unless the original response has
803
+ // already committed. In that case, preserve its status code for
804
+ // telemetry while still recording the failure and terminating a response
805
+ // that the failed pipeline left open.
806
+ if (res.headersSent) {
807
+ if (currentSpan) {
808
+ const error = err instanceof Error ? err : new Error('Unknown app route error');
809
+ currentSpan.recordException(error);
810
+ currentSpan.setStatus({
811
+ code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
812
+ message: error.message
813
+ });
814
+ currentSpan.setAttribute('error.type', error.name);
752
815
  }
753
- };
754
- // Replay ring filtered by since-seq.
755
- for (const entry of recentEntries()){
756
- if (entry.seq > sinceSeq) safeEnqueue(route_sse(entry));
816
+ if (!res.writableEnded && !res.destroyed) {
817
+ res.end();
818
+ }
819
+ } else {
820
+ await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
821
+ status: 500
822
+ }));
757
823
  }
758
- // Subscribe for live entries until the client disconnects.
759
- const unsubscribe = subscribe((entry)=>{
760
- safeEnqueue(route_sse(entry));
761
- });
762
- // Heartbeat every 25s so corporate proxies don't kill an idle
763
- // connection. SSE comments (lines starting with ":") are ignored
764
- // by EventSource on the client.
765
- const heartbeat = setInterval(()=>{
766
- if (clientGone) return;
767
- try {
768
- controller.enqueue(enc.encode(": heartbeat\n\n"));
769
- } catch {
770
- clientGone = true;
824
+ return;
825
+ } finally{
826
+ ;
827
+ (()=>{
828
+ if (!currentSpan) {
829
+ return;
771
830
  }
772
- }, 25000);
773
- heartbeat.unref?.();
774
- cleanup = ()=>{
775
- clientGone = true;
776
- clearInterval(heartbeat);
777
- unsubscribe();
778
- };
779
- },
780
- cancel () {
781
- cleanup?.();
831
+ let statusCode = res.statusCode;
832
+ currentSpan.setAttributes({
833
+ 'http.status_code': statusCode,
834
+ 'next.rsc': false
835
+ });
836
+ if (statusCode && statusCode >= 500) {
837
+ // For 5xx status codes: SHOULD be set to 'Error' span status.
838
+ // x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
839
+ currentSpan.setStatus({
840
+ code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
841
+ });
842
+ // For span status 'Error', SHOULD set 'error.type' attribute.
843
+ currentSpan.setAttribute('error.type', statusCode.toString());
844
+ }
845
+ const rootSpanAttributes = tracer.getRootSpanAttributes();
846
+ // We were unable to get attributes, probably OTEL is not enabled
847
+ if (!rootSpanAttributes) {
848
+ return;
849
+ }
850
+ if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
851
+ console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
852
+ return;
853
+ }
854
+ const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
855
+ const name = `${method} ${route}`;
856
+ currentSpan.setAttributes({
857
+ 'next.route': route,
858
+ 'http.route': route,
859
+ 'next.span_name': name
860
+ });
861
+ currentSpan.updateName(name);
862
+ // Propagate http.route to the request's root span if it isn't the
863
+ // request span (e.g. a platform-created HTTP span in adapter
864
+ // deployments).
865
+ if (requestRootSpan && requestRootSpan !== currentSpan) {
866
+ requestRootSpan.setAttribute('http.route', route);
867
+ requestRootSpan.updateName(name);
868
+ }
869
+ })();
782
870
  }
783
- });
784
- return (0,sse/* sseResponse */.t)(stream);
785
- }
786
-
787
-
788
- /***/ }),
789
-
790
- /***/ 200261:
791
- /***/ ((module) => {
792
-
793
- module.exports = require("next/dist/shared/lib/router/utils/app-paths");
794
-
795
- /***/ }),
796
-
797
- /***/ 333873:
798
- /***/ ((module) => {
799
-
800
- module.exports = require("path");
801
-
802
- /***/ }),
803
-
804
- /***/ 419121:
805
- /***/ ((module) => {
806
-
807
- module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
808
-
809
- /***/ }),
810
-
811
- /***/ 455511:
812
- /***/ ((module) => {
813
-
814
- module.exports = require("crypto");
815
-
816
- /***/ }),
817
-
818
- /***/ 529294:
819
- /***/ ((module) => {
820
-
821
- module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
822
-
823
- /***/ }),
824
-
825
- /***/ 553854:
826
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
827
-
828
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
829
- /* harmony export */ t: () => (/* binding */ sseResponse)
830
- /* harmony export */ });
831
- // Shared response builder for Server-Sent Event streams. Centralises the
832
- // content-type / cache-control / connection / proxy-buffering headers so
833
- // every SSE endpoint behaves identically through nginx, tailscale-serve,
834
- // and Cloudflare. See ADR-0009 for the proxy story.
835
- function sseResponse(stream, opts = {}) {
836
- const { disableProxyBuffering = true } = opts;
837
- const headers = {
838
- "Content-Type": "text/event-stream",
839
- "Cache-Control": "no-cache",
840
- Connection: "keep-alive"
841
871
  };
842
- if (disableProxyBuffering) headers["X-Accel-Buffering"] = "no";
843
- return new Response(stream, {
844
- headers
845
- });
872
+ // When invoked directly, the request span was started before `prepare`;
873
+ // record the request target as normalized by it. next-server's request span
874
+ // already has it.
875
+ if (!isWrappedByNextServer && req.url !== undefined) {
876
+ requestSpan == null ? void 0 : requestSpan.setAttribute('http.target', req.url);
877
+ }
878
+ await handleResponse(requestSpan);
846
879
  }
847
880
 
881
+ //# sourceMappingURL=app-route.js.map
848
882
 
849
- /***/ }),
850
-
851
- /***/ 663033:
852
- /***/ ((module) => {
853
-
854
- module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
855
-
856
- /***/ }),
857
-
858
- /***/ 710846:
859
- /***/ ((module) => {
860
-
861
- module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");
862
-
863
- /***/ }),
864
-
865
- /***/ 744870:
866
- /***/ ((module) => {
867
-
868
- module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
869
-
870
- /***/ }),
871
-
872
- /***/ 848161:
873
- /***/ ((module) => {
874
-
875
- module.exports = require("node:os");
876
-
877
- /***/ }),
878
-
879
- /***/ 903295:
880
- /***/ ((module) => {
881
-
882
- module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");
883
883
 
884
884
  /***/ }),
885
885
 
@@ -904,7 +904,7 @@ module.exports = require("next/dist/shared/lib/no-fallback-error.external");
904
904
  var __webpack_require__ = require("../../../../webpack-runtime.js");
905
905
  __webpack_require__.C(exports);
906
906
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
907
- var __webpack_exports__ = __webpack_require__.X(0, [2970,1813,4992], () => (__webpack_exec__(150927)));
907
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,1813,4992], () => (__webpack_exec__(952028)));
908
908
  module.exports = __webpack_exports__;
909
909
 
910
910
  })();