@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.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +2 -1
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_global-error/page.js +68 -68
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +58 -58
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +127 -127
- package/.next/standalone/.next/server/app/api/v1/access/route.js +372 -372
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +79 -79
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +641 -641
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/duplicate/route.js +723 -723
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +100 -100
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/agents/recent-replies/route.js +227 -227
- package/.next/standalone/.next/server/app/api/v1/agents/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +384 -384
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +203 -203
- package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +17 -17
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +760 -760
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +699 -699
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +30 -30
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +480 -480
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +675 -675
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +559 -559
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js +1269 -1269
- package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +199 -199
- package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/config/route.js +99 -99
- package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/credentials/route.js +169 -169
- package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +515 -515
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +380 -380
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +256 -256
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +80 -97
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +677 -677
- package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/recall-policy/route.js +856 -0
- package/.next/standalone/.next/server/app/api/v1/documents/recall-policy/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/documents/recall-policy/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +299 -247
- package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +486 -486
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +18 -11
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +666 -666
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +128 -100
- package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/env/route.js +207 -207
- package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +128 -128
- package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/events/route.js +154 -154
- package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/events/test/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +97 -97
- package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +188 -188
- package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +93 -93
- package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +93 -93
- package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +69 -69
- package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +69 -69
- package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +223 -223
- package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +93 -93
- package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/route.js +722 -722
- package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +481 -481
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +378 -378
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +510 -510
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +17 -17
- package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +33 -33
- package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +397 -397
- package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +129 -129
- package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +757 -757
- package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/health/route.js +228 -228
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +198 -198
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +845 -845
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +106 -106
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +747 -747
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/integrations/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +420 -420
- package/.next/standalone/.next/server/app/api/v1/local-file/route.js +34 -34
- package/.next/standalone/.next/server/app/api/v1/logs/route.js +819 -819
- package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +217 -217
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +1034 -1034
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +58 -58
- package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +150 -150
- package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/memory/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +87 -538
- package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/models/route.js +273 -722
- package/.next/standalone/.next/server/app/api/v1/models/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +73 -73
- package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +248 -239
- package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +128 -128
- package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +81 -81
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +34 -25
- package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/route.js +48 -39
- package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +51 -51
- package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +863 -863
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +230 -230
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +138 -138
- package/.next/standalone/.next/server/app/api/v1/profile/route.js +51 -51
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +853 -680
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +171 -171
- package/.next/standalone/.next/server/app/api/v1/providers/route.js +96 -96
- package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +157 -157
- package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +47 -47
- package/.next/standalone/.next/server/app/api/v1/redaction/route.js +206 -206
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +140 -140
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +166 -166
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +52 -52
- package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +722 -722
- package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/security/state/route.js +243 -243
- package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +518 -518
- package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +25 -25
- package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +609 -609
- package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +129 -129
- package/.next/standalone/.next/server/app/api/v1/skills/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +112 -112
- package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +86 -86
- package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +83 -83
- package/.next/standalone/.next/server/app/api/v1/tasks/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +121 -121
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +139 -139
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/messages/[message_id]/route.js +51 -51
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +58 -58
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +1182 -1182
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/route.js +158 -158
- package/.next/standalone/.next/server/app/api/v1/tools/route.js +137 -137
- package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +73 -73
- package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/update/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +30 -30
- package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +79 -79
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +45 -45
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/watchers/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/icon.svg/route.js +55 -55
- package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +18 -18
- package/.next/standalone/.next/server/app/page.js +2112 -1235
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup/page.js +91 -91
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
- package/.next/standalone/.next/server/chunks/1244.js +136 -4
- package/.next/standalone/.next/server/chunks/1387.js +733 -57
- package/.next/standalone/.next/server/chunks/1433.js +1 -1
- package/.next/standalone/.next/server/chunks/210.js +3 -3
- package/.next/standalone/.next/server/chunks/2175.js +874 -0
- package/.next/standalone/.next/server/chunks/3042.js +34 -32
- package/.next/standalone/.next/server/chunks/309.js +21 -40
- package/.next/standalone/.next/server/chunks/3272.js +21 -40
- package/.next/standalone/.next/server/chunks/{540.js → 3326.js} +189 -61
- package/.next/standalone/.next/server/chunks/{6142.js → 3479.js} +170 -159
- package/.next/standalone/.next/server/chunks/3566.js +1 -1
- package/.next/standalone/.next/server/chunks/{5323.js → 3692.js} +31 -3
- package/.next/standalone/.next/server/chunks/4189.js +14 -2
- package/.next/standalone/.next/server/chunks/4377.js +2 -2
- package/.next/standalone/.next/server/chunks/4596.js +18 -9
- package/.next/standalone/.next/server/chunks/{639.js → 4728.js} +23676 -22755
- package/.next/standalone/.next/server/chunks/4955.js +81 -14
- package/.next/standalone/.next/server/chunks/5290.js +136 -5
- package/.next/standalone/.next/server/chunks/{2267.js → 6408.js} +990 -926
- package/.next/standalone/.next/server/chunks/{9667.js → 6911.js} +31 -3
- package/.next/standalone/.next/server/chunks/7033.js +7 -4
- package/.next/standalone/.next/server/chunks/7377.js +7 -4
- package/.next/standalone/.next/server/chunks/8461.js +31 -29
- package/.next/standalone/.next/server/chunks/9032.js +3 -3
- package/.next/standalone/.next/server/chunks/9174.js +18 -9
- package/.next/standalone/.next/server/chunks/9408.js +37 -15
- package/.next/standalone/.next/server/chunks/9824.js +2288 -2288
- package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
- package/.next/standalone/.next/server/middleware.js +104638 -104532
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/2BAUJZ7x8eXCYpuZ-Kp7h/_buildManifest.js +1 -0
- package/.next/standalone/.next/static/chunks/{877-145c9df8aa0aee63.js → 877-367eb49b20edd3d6.js} +38 -16
- package/.next/standalone/.next/static/chunks/app/_global-error/page-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/access/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/duplicate/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/recent-replies/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/recall-policy/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/messages/[message_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/{page-64585ef79400f17f.js → page-a584dfa806a1afdb.js} +1082 -205
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/css/19e1cd815490b47c.css +5 -0
- package/.next/standalone/docs/adoption/changesets.json +148 -0
- package/.next/standalone/package.json +5 -4
- package/CHANGELOG.md +51 -0
- package/README.md +115 -1
- package/api/client.startup.test.ts +29 -0
- package/api/client.ts +9 -2
- package/api/types.ts +20 -1
- package/app/api/v1/dashboard/pricing-task/route.ts +3 -1
- package/app/api/v1/documents/recall-policy/route.test.ts +59 -0
- package/app/api/v1/documents/recall-policy/route.ts +20 -0
- package/app/api/v1/documents/search/route.test.ts +36 -0
- package/app/api/v1/documents/search/route.ts +17 -5
- package/app/api/v1/documents/sources/[id]/reindex/route.test.ts +44 -0
- package/app/api/v1/documents/sources/[id]/reindex/route.ts +4 -1
- package/app/api/v1/documents/sources/route.test.ts +67 -0
- package/app/api/v1/documents/sources/route.ts +20 -2
- package/app/api/v1/models/[name]/route.ts +2 -0
- package/app/api/v1/models/route.ts +4 -0
- package/app/api/v1/providers/[provider]/models/route.test.ts +28 -0
- package/app/api/v1/providers/[provider]/models/route.ts +16 -2
- package/app/globals.css +51 -4
- package/components/agents/AgentsPanel.tsx +2 -2
- package/components/agents/agent-editor/AdvancedSection.tsx +1 -1
- package/components/agents/agent-editor/ModelSection.tsx +2 -2
- package/components/bridges/BridgeEditor.tsx +1 -1
- package/components/bridges/BridgesPanel.tsx +1 -1
- package/components/chat/InputBar.tsx +1 -1
- package/components/chat/MessageList.tsx +3 -3
- package/components/chat/useUserProfileAndAgent.test.tsx +43 -1
- package/components/chat/useUserProfileAndAgent.ts +16 -5
- package/components/credentials/CredentialsPanel.tsx +1 -1
- package/components/dashboard/CostBreakdown.test.tsx +34 -0
- package/components/dashboard/CostBreakdown.tsx +21 -0
- package/components/dashboard/DashboardPanel.test.tsx +9 -0
- package/components/dashboard/DashboardPanel.tsx +3 -3
- package/components/dashboard/Donuts.tsx +5 -2
- package/components/dashboard/ModelPricingSection.test.tsx +42 -0
- package/components/dashboard/ModelPricingSection.tsx +23 -21
- package/components/dashboard/Series.test.tsx +1 -0
- package/components/dashboard/Series.tsx +5 -0
- package/components/dashboard/SummaryCards.tsx +39 -27
- package/components/dashboard/VendorModelReportSection.tsx +2 -0
- package/components/documents/AddSourceFields.tsx +52 -15
- package/components/documents/AddSourceForm.tsx +61 -19
- package/components/documents/DocumentsPanel.tsx +22 -2
- package/components/documents/RecallExclusions.tsx +73 -0
- package/components/documents/SearchProbe.tsx +42 -5
- package/components/documents/helpers.ts +17 -3
- package/components/documents/indexing-controls.test.tsx +137 -0
- package/components/documents/useDocumentsPanel.test.tsx +87 -0
- package/components/documents/useDocumentsPanel.ts +47 -6
- package/components/env/EnvVarsPanel.tsx +1 -1
- package/components/harness/HarnessPanel.tsx +2 -2
- package/components/integrations/NetworkPanel.tsx +1 -1
- package/components/layout/AgentCardControls.test.tsx +162 -0
- package/components/layout/AgentCardControls.tsx +126 -0
- package/components/layout/AgentSwitcher.test.tsx +37 -0
- package/components/layout/AgentSwitcher.tsx +28 -3
- package/components/layout/AppShell.tsx +16 -9
- package/components/layout/MenuPanel.test.tsx +125 -2
- package/components/layout/MenuPanel.tsx +96 -2
- package/components/logs/LogsPanel.tsx +1 -1
- package/components/mcp/MCPPanel.tsx +1 -1
- package/components/memory/UnifiedMemoryPanel.tsx +4 -4
- package/components/models/CapBadges.tsx +1 -1
- package/components/models/EmbeddingModelSection.test.tsx +41 -0
- package/components/models/EmbeddingModelSection.tsx +5 -0
- package/components/models/ModelFeatureGuide.tsx +16 -8
- package/components/models/ModelsPanel.tsx +8 -3
- package/components/models/model-editor/ModelEditorBody.tsx +1 -0
- package/components/models/model-editor/ModelIdSection.tsx +5 -0
- package/components/profile/ProfileEditor.test.tsx +70 -0
- package/components/profile/ProfileEditor.tsx +6 -2
- package/components/profile/ProfilePanel.test.tsx +6 -0
- package/components/profile/ProfilePanel.tsx +1 -1
- package/components/scheduled-tasks/ScheduledTasksPanel.tsx +1 -1
- package/components/settings/AppearancePanel.tsx +1 -1
- package/components/settings/SettingsPanel.test.tsx +23 -0
- package/components/settings/SettingsPanel.tsx +2 -2
- package/components/skills/SkillsPanel.tsx +1 -1
- package/components/tools/BrowserPanel.tsx +1 -1
- package/components/tools/PackagesPanel.tsx +1 -1
- package/components/tools/UnifiedPackageList.tsx +1 -1
- package/components/ui/PanelHeader.tsx +1 -1
- package/components/ui/SubTabBar.tsx +1 -1
- package/docs/INSTALL.md +7 -5
- package/hooks/useAgents.ts +2 -2
- package/lib/agents/prepare/system-prompt.test.ts +65 -0
- package/lib/agents/prepare/system-prompt.ts +27 -20
- package/lib/agents/prompt-registry.test.ts +42 -0
- package/lib/agents/prompt-registry.ts +21 -0
- package/lib/bridges/whatsapp.inbound.test.ts +38 -1
- package/lib/bridges/whatsapp.ts +10 -33
- package/lib/db/index.ts +2 -0
- package/lib/db/migrations.test.ts +10 -0
- package/lib/db/migrations.ts +10 -0
- package/lib/db/statement-cache.test.ts +77 -0
- package/lib/db/statement-cache.ts +31 -0
- package/lib/documents/indexer.test.ts +16 -1
- package/lib/documents/indexer.ts +8 -7
- package/lib/documents/mail-source-config.ts +31 -0
- package/lib/documents/recall-policy.ts +24 -0
- package/lib/documents/remote/icloud.ts +56 -0
- package/lib/documents/remote/index.ts +4 -1
- package/lib/documents/remote/mail.test.ts +232 -0
- package/lib/documents/remote/mail.ts +48 -40
- package/lib/documents/search.test.ts +81 -2
- package/lib/documents/search.ts +47 -7
- package/lib/embeddings/cache.test.ts +16 -2
- package/lib/embeddings/index.test.ts +7 -0
- package/lib/embeddings/index.ts +12 -1
- package/lib/integrations/deepseek-web/manifest.ts +68 -0
- package/lib/integrations/gmail/manifest.ts +2 -3
- package/lib/integrations/icloud/manifest.ts +19 -5
- package/lib/integrations/registry.test.ts +8 -0
- package/lib/integrations/registry.ts +2 -0
- package/lib/lifecycle/changeset-build.test.ts +3 -0
- package/lib/lifecycle/changeset-build.ts +6 -0
- package/lib/lifecycle/changesets.ts +9 -0
- package/lib/pricing/llm-extract.ts +1 -1
- package/lib/pricing/maintenance-task.ts +19 -3
- package/lib/pricing/model-updates.test.ts +192 -0
- package/lib/pricing/model-updates.ts +205 -0
- package/lib/stores/app-settings.ts +17 -1
- package/lib/stores/dashboard-metrics-cache.test.ts +44 -0
- package/lib/stores/dashboard-metrics.test.ts +47 -4
- package/lib/stores/dashboard-metrics.ts +73 -8
- package/lib/stores/document-sources.ts +1 -0
- package/lib/stores/integrations.test.ts +20 -0
- package/lib/stores/integrations.ts +15 -4
- package/lib/stores/langgraph-store.test.ts +53 -0
- package/lib/stores/langgraph-store.ts +9 -21
- package/lib/stores/model-metadata.ts +89 -0
- package/lib/stores/threads.test.ts +34 -0
- package/lib/stores/threads.ts +17 -20
- package/lib/stores/tool-stats.test.ts +31 -0
- package/lib/stores/tool-stats.ts +16 -0
- package/lib/stores/version-adoption.test.ts +8 -0
- package/lib/stores/version-adoption.ts +5 -2
- package/lib/tools/general/documents.test.ts +5 -0
- package/lib/tools/general/pricing-maintenance.test.ts +5 -0
- package/lib/tools/general/pricing-maintenance.ts +4 -1
- package/lib/tools/packages/default-packages/icloud.test.ts +49 -0
- package/lib/tools/packages/default-packages/icloud.ts +8 -6
- package/lib/tools/packages/default-packages.test.ts +16 -0
- package/lib/tools/packages/langchain-packages.ts +2 -2
- package/lib/tools/runtime/category-filter.test.ts +22 -0
- package/lib/tools/web/deepseek.test.ts +76 -0
- package/lib/tools/web/deepseek.ts +68 -0
- package/lib/tools/web/fetch.test.ts +130 -2
- package/lib/tools/web/fetch.ts +48 -1
- package/lib/tools/web/search.test.ts +139 -2
- package/lib/tools/web/search.ts +48 -1
- package/lib/triggers/handlers/scheduled-task.test.ts +18 -0
- package/lib/triggers/handlers/scheduled-task.ts +6 -0
- package/lib/ui/feature-readiness.test.ts +7 -0
- package/lib/ui/feature-readiness.ts +2 -1
- package/package.json +5 -4
- package/scripts/check-npm-package.mjs +1 -0
- package/scripts/jarela-bin.mjs +3 -0
- package/scripts/runtime-version.mjs +19 -0
- package/scripts/start-prod.mjs +3 -0
- package/.next/standalone/.next/static/6qLnqWdsfBTJOAJApUYXy/_buildManifest.js +0 -1
- package/.next/standalone/.next/static/chunks/app/_global-error/page-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/access/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/duplicate/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/recent-replies/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/messages/[message_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/css/c4a8bed1da2c748f.css +0 -5
- /package/.next/standalone/.next/static/{6qLnqWdsfBTJOAJApUYXy → 2BAUJZ7x8eXCYpuZ-Kp7h}/_ssgManifest.js +0 -0
|
@@ -650,813 +650,778 @@ const SECTION_DISPLAY = {
|
|
|
650
650
|
|
|
651
651
|
/***/ }),
|
|
652
652
|
|
|
653
|
-
/***/
|
|
653
|
+
/***/ 524318:
|
|
654
654
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
655
655
|
|
|
656
|
-
__webpack_require__.r(__webpack_exports__);
|
|
657
656
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
658
|
-
/* harmony export */
|
|
659
|
-
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
660
|
-
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
661
|
-
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
662
|
-
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
663
|
-
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
657
|
+
/* harmony export */ u_: () => (/* binding */ DEFAULT_HOT_TURN_LIMIT)
|
|
664
658
|
/* harmony export */ });
|
|
665
|
-
/* harmony import */ var
|
|
666
|
-
|
|
667
|
-
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(684006);
|
|
668
|
-
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
669
|
-
/* 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__);
|
|
670
|
-
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(799373);
|
|
671
|
-
/* 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__);
|
|
672
|
-
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(434775);
|
|
673
|
-
/* 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__);
|
|
674
|
-
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(524235);
|
|
675
|
-
/* 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__);
|
|
676
|
-
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(200261);
|
|
677
|
-
/* 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__);
|
|
678
|
-
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(754365);
|
|
679
|
-
/* 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__);
|
|
680
|
-
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(590771);
|
|
681
|
-
/* 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__);
|
|
682
|
-
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(473461);
|
|
683
|
-
/* 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__);
|
|
684
|
-
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(767798);
|
|
685
|
-
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(192280);
|
|
686
|
-
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(662018);
|
|
687
|
-
/* 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__);
|
|
688
|
-
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(445696);
|
|
689
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(347929);
|
|
690
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
691
|
-
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(986439);
|
|
692
|
-
/* 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__);
|
|
693
|
-
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(710246);
|
|
694
|
-
/* 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__);
|
|
695
|
-
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(137527);
|
|
696
|
-
/* 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__);
|
|
659
|
+
/* harmony import */ var _lib_agents_harness_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(489793);
|
|
660
|
+
const DEFAULT_HOT_TURN_LIMIT = 12;
|
|
697
661
|
|
|
698
662
|
|
|
699
663
|
|
|
664
|
+
/***/ }),
|
|
700
665
|
|
|
666
|
+
/***/ 529294:
|
|
667
|
+
/***/ ((module) => {
|
|
701
668
|
|
|
669
|
+
module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
|
|
702
670
|
|
|
671
|
+
/***/ }),
|
|
703
672
|
|
|
673
|
+
/***/ 590347:
|
|
674
|
+
/***/ ((module) => {
|
|
704
675
|
|
|
676
|
+
module.exports = import("@langchain/mcp-adapters");;
|
|
705
677
|
|
|
678
|
+
/***/ }),
|
|
706
679
|
|
|
680
|
+
/***/ 594735:
|
|
681
|
+
/***/ ((module) => {
|
|
707
682
|
|
|
683
|
+
module.exports = require("events");
|
|
708
684
|
|
|
685
|
+
/***/ }),
|
|
709
686
|
|
|
687
|
+
/***/ 629021:
|
|
688
|
+
/***/ ((module) => {
|
|
710
689
|
|
|
690
|
+
module.exports = require("fs");
|
|
711
691
|
|
|
692
|
+
/***/ }),
|
|
712
693
|
|
|
694
|
+
/***/ 638522:
|
|
695
|
+
/***/ ((module) => {
|
|
713
696
|
|
|
697
|
+
module.exports = require("node:zlib");
|
|
714
698
|
|
|
715
|
-
|
|
716
|
-
// module.
|
|
717
|
-
const nextConfigOutput = "standalone"
|
|
718
|
-
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
719
|
-
definition: {
|
|
720
|
-
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
721
|
-
page: "/api/v1/mcp-servers/[name]/route",
|
|
722
|
-
pathname: "/api/v1/mcp-servers/[name]",
|
|
723
|
-
filename: "route",
|
|
724
|
-
bundlePath: "app/api/v1/mcp-servers/[name]/route"
|
|
725
|
-
},
|
|
726
|
-
distDir: ".next" || 0,
|
|
727
|
-
relativeProjectDir: false || '',
|
|
728
|
-
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/mcp-servers/[name]/route.ts",
|
|
729
|
-
nextConfigOutput,
|
|
730
|
-
// The lazy require factory ensures that:
|
|
731
|
-
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
732
|
-
// correctly attributing module load time to application-code rather than
|
|
733
|
-
// framework internals.
|
|
734
|
-
// - In all modes: async modules (route files with top-level await) are
|
|
735
|
-
// handled correctly — require() returns a Promise for such modules, which
|
|
736
|
-
// ensureUserland() awaits before the first request is handled.
|
|
737
|
-
userland: ()=>__webpack_require__(754172),
|
|
738
|
-
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
739
|
-
// server HMR updates are picked up without re-executing the entry chunk.
|
|
740
|
-
// Using require() (synchronous) avoids adding async overhead that would be
|
|
741
|
-
// incorrectly attributed to application-code time in devRequestTiming.
|
|
742
|
-
... false ? 0 : {}
|
|
743
|
-
});
|
|
744
|
-
// Pull out the exports that we need to expose from the module. This should
|
|
745
|
-
// be eliminated when we've moved the other routes to the new format. These
|
|
746
|
-
// are used to hook into the route.
|
|
747
|
-
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
748
|
-
function patchFetch() {
|
|
749
|
-
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
750
|
-
workAsyncStorage,
|
|
751
|
-
workUnitAsyncStorage
|
|
752
|
-
});
|
|
753
|
-
}
|
|
699
|
+
/***/ }),
|
|
754
700
|
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
701
|
+
/***/ 663033:
|
|
702
|
+
/***/ ((module) => {
|
|
703
|
+
|
|
704
|
+
module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
|
|
705
|
+
|
|
706
|
+
/***/ }),
|
|
707
|
+
|
|
708
|
+
/***/ 685678:
|
|
709
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
710
|
+
|
|
711
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
712
|
+
/* harmony export */ G4: () => (/* binding */ resolveContextWindowTokens),
|
|
713
|
+
/* harmony export */ S6: () => (/* binding */ agentToResponse),
|
|
714
|
+
/* harmony export */ aX: () => (/* binding */ bridgeToResponse),
|
|
715
|
+
/* harmony export */ mX: () => (/* binding */ messageToResponse),
|
|
716
|
+
/* harmony export */ sU: () => (/* binding */ mcpServerToResponse)
|
|
717
|
+
/* harmony export */ });
|
|
718
|
+
/* unused harmony exports messageUsageToResponse, parseToolEventsForResponse, parseMessageMetadataForResponse */
|
|
719
|
+
/* harmony import */ var _api_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(524318);
|
|
720
|
+
/* harmony import */ var _lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41720);
|
|
721
|
+
/* harmony import */ var _lib_utils_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(253638);
|
|
722
|
+
// Row → JSON-response serializers shared between list (`route.ts`) and
|
|
723
|
+
// item (`[id]/route.ts`) handlers. Keeping these in one place stops the
|
|
724
|
+
// list and item shapes from drifting (they were copy-pasted before).
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
function agentToResponse(a) {
|
|
729
|
+
return {
|
|
730
|
+
id: a.id,
|
|
731
|
+
usage_profile: a.usage_profile ?? "custom",
|
|
732
|
+
name: a.name,
|
|
733
|
+
icon: a.icon,
|
|
734
|
+
identity: a.identity,
|
|
735
|
+
instructions: a.instructions,
|
|
736
|
+
tools: (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_2__/* .parseJsonSafe */ .p)(a.tools, []),
|
|
737
|
+
model_config_name: a.model_config_name,
|
|
738
|
+
is_default: !!a.is_default,
|
|
739
|
+
history_limit: a.history_limit,
|
|
740
|
+
history_window_hours: a.history_window_hours,
|
|
741
|
+
hot_turn_limit: a.hot_turn_limit ?? _api_types__WEBPACK_IMPORTED_MODULE_0__/* .DEFAULT_HOT_TURN_LIMIT */ .u_,
|
|
742
|
+
warm_summary_limit: a.warm_summary_limit,
|
|
743
|
+
never_reply: !!a.never_reply,
|
|
744
|
+
adaptive_persona_enabled: !!a.adaptive_persona_enabled,
|
|
745
|
+
adaptive_persona_strength: a.adaptive_persona_strength,
|
|
746
|
+
adaptive_empathy: a.adaptive_empathy,
|
|
747
|
+
adaptive_expressiveness: a.adaptive_expressiveness,
|
|
748
|
+
adaptive_verbosity: a.adaptive_verbosity,
|
|
749
|
+
adaptive_mbti: a.adaptive_mbti,
|
|
750
|
+
voice_enabled: !!a.voice_enabled,
|
|
751
|
+
voice_model: a.voice_model,
|
|
752
|
+
voice_name: a.voice_name,
|
|
753
|
+
voice_stt_model: a.voice_stt_model,
|
|
754
|
+
voice_auto_speak: !!a.voice_auto_speak,
|
|
755
|
+
harness_id: a.harness_id,
|
|
756
|
+
delegate_targets: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .parseDelegateTargets */ .bg)(a.delegate_targets),
|
|
757
|
+
context_tier_proportions: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .getAgentTierProportions */ .fg)(a),
|
|
758
|
+
anti_hallucination_mode: a.anti_hallucination_mode === "off" || a.anti_hallucination_mode === "regex" || a.anti_hallucination_mode === "model" ? a.anti_hallucination_mode : null,
|
|
759
|
+
anti_hallucination_model_config: a.anti_hallucination_model_config,
|
|
760
|
+
citation_strictness: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .parseCitationStrictness */ .P2)(a.citation_strictness) ?? "off",
|
|
761
|
+
tool_credentials: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .getAgentToolCredentials */ .S2)(a),
|
|
762
|
+
router_policy: a.router_policy === "cheap" || a.router_policy === "fast" || a.router_policy === "balanced" || a.router_policy === "quality" ? a.router_policy : null,
|
|
763
|
+
router_enabled: a.router_enabled === 1 ? true : a.router_enabled === 0 ? false : null,
|
|
764
|
+
usage_strategy: a.usage_strategy === "cost_saving" || a.usage_strategy === "balanced" || a.usage_strategy === "high_reasoning" ? a.usage_strategy : null,
|
|
765
|
+
created_at: a.created_at,
|
|
766
|
+
updated_at: a.updated_at
|
|
767
|
+
};
|
|
785
768
|
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
802
|
-
const render404 = async ()=>{
|
|
803
|
-
// TODO: should route-module itself handle rendering the 404
|
|
804
|
-
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
805
|
-
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
806
|
-
} else {
|
|
807
|
-
res.end('This page could not be found');
|
|
808
|
-
}
|
|
809
|
-
return null;
|
|
769
|
+
function bridgeToResponse(r) {
|
|
770
|
+
return {
|
|
771
|
+
id: r.id,
|
|
772
|
+
kind: r.kind,
|
|
773
|
+
name: r.name,
|
|
774
|
+
status: r.status,
|
|
775
|
+
last_error: r.last_error,
|
|
776
|
+
paired_id: r.paired_id,
|
|
777
|
+
enabled: r.enabled === 1,
|
|
778
|
+
event_subscriptions: {
|
|
779
|
+
group_profile_updates: r.forward_group_profile_updates === 1,
|
|
780
|
+
group_participants_updates: r.forward_group_participants_updates === 1
|
|
781
|
+
},
|
|
782
|
+
created_at: r.created_at,
|
|
783
|
+
updated_at: r.updated_at
|
|
810
784
|
};
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
}
|
|
822
|
-
let cacheKey = null;
|
|
823
|
-
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
824
|
-
cacheKey = resolvedPathname;
|
|
825
|
-
// ensure /index and / is normalized to one key
|
|
826
|
-
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
827
|
-
}
|
|
828
|
-
// Before rendering (which initializes component tree modules), we have to
|
|
829
|
-
// set the reference manifests to our global store so Server Action's
|
|
830
|
-
// encryption util can access to them at the top level of the page module.
|
|
831
|
-
if (serverActionsManifest && clientReferenceManifest) {
|
|
832
|
-
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
833
|
-
page: srcPage,
|
|
834
|
-
clientReferenceManifest,
|
|
835
|
-
serverActionsManifest
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
const method = req.method || 'GET';
|
|
839
|
-
const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
|
|
840
|
-
const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
|
|
841
|
-
const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
|
|
842
|
-
const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
|
|
843
|
-
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
844
|
-
globalThis.__incrementalCache = incrementalCache;
|
|
845
|
-
const context = {
|
|
846
|
-
params,
|
|
847
|
-
previewProps,
|
|
848
|
-
renderOpts: {
|
|
849
|
-
experimental: {
|
|
850
|
-
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
851
|
-
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
852
|
-
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
853
|
-
},
|
|
854
|
-
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
855
|
-
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
856
|
-
isDraftMode,
|
|
857
|
-
incrementalCache,
|
|
858
|
-
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
859
|
-
cacheLifeProfiles: nextConfig.cacheLife,
|
|
860
|
-
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
861
|
-
waitUntil: ctx.waitUntil,
|
|
862
|
-
onClose: (cb)=>{
|
|
863
|
-
res.on('close', cb);
|
|
864
|
-
},
|
|
865
|
-
onAfterTaskError: undefined
|
|
866
|
-
},
|
|
867
|
-
sharedContext: {
|
|
868
|
-
buildId,
|
|
869
|
-
deploymentId
|
|
870
|
-
}
|
|
871
|
-
};
|
|
872
|
-
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
873
|
-
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
874
|
-
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));
|
|
875
|
-
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
876
|
-
try {
|
|
877
|
-
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
878
|
-
res.statusCode = 404;
|
|
879
|
-
// on-demand revalidate always sets this header
|
|
880
|
-
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
881
|
-
res.end('This page could not be found');
|
|
882
|
-
return null;
|
|
883
|
-
}
|
|
884
|
-
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
885
|
-
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
886
|
-
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
887
|
-
// Attempt using provided waitUntil if available
|
|
888
|
-
// if it's not we fallback to sendResponse's handling
|
|
889
|
-
if (pendingWaitUntil) {
|
|
890
|
-
if (ctx.waitUntil) {
|
|
891
|
-
ctx.waitUntil(pendingWaitUntil);
|
|
892
|
-
pendingWaitUntil = undefined;
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
const cacheTags = context.renderOpts.collectedTags;
|
|
896
|
-
// If the request is for a static response, we can cache it so long
|
|
897
|
-
// as it's not edge.
|
|
898
|
-
if (isIsr) {
|
|
899
|
-
const blob = await response.blob();
|
|
900
|
-
// Copy the headers from the response.
|
|
901
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
902
|
-
if (cacheTags) {
|
|
903
|
-
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
904
|
-
}
|
|
905
|
-
if (!headers['content-type'] && blob.type) {
|
|
906
|
-
headers['content-type'] = blob.type;
|
|
907
|
-
}
|
|
908
|
-
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
909
|
-
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
|
|
910
|
-
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
911
|
-
// build-time fallback in `build/index.ts` so cache entries
|
|
912
|
-
// and the response Cache-Control header agree on the route's
|
|
913
|
-
// effective expire. Routes that opt out of revalidation
|
|
914
|
-
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
915
|
-
// keep `expire: undefined`.
|
|
916
|
-
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
917
|
-
// Create the cache entry for the response.
|
|
918
|
-
const cacheEntry = {
|
|
919
|
-
value: {
|
|
920
|
-
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
921
|
-
status: response.status,
|
|
922
|
-
body: Buffer.from(await blob.arrayBuffer()),
|
|
923
|
-
headers
|
|
924
|
-
},
|
|
925
|
-
cacheControl: {
|
|
926
|
-
revalidate,
|
|
927
|
-
expire
|
|
928
|
-
}
|
|
929
|
-
};
|
|
930
|
-
return cacheEntry;
|
|
931
|
-
} else {
|
|
932
|
-
// send response without caching if not ISR
|
|
933
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
934
|
-
return null;
|
|
935
|
-
}
|
|
936
|
-
} catch (err) {
|
|
937
|
-
// if this is a background revalidate we need to report
|
|
938
|
-
// the request error here as it won't be bubbled
|
|
939
|
-
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
940
|
-
const silenceLog = false;
|
|
941
|
-
await routeModule.onRequestError(req, err, {
|
|
942
|
-
routerKind: 'App Router',
|
|
943
|
-
routePath: srcPage,
|
|
944
|
-
routeType: 'route',
|
|
945
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
946
|
-
isStaticGeneration: cacheKey !== null,
|
|
947
|
-
isOnDemandRevalidate
|
|
948
|
-
})
|
|
949
|
-
}, silenceLog, routerServerContext);
|
|
950
|
-
}
|
|
951
|
-
throw err;
|
|
952
|
-
}
|
|
953
|
-
};
|
|
954
|
-
const handleResponse = async (currentSpan)=>{
|
|
955
|
-
try {
|
|
956
|
-
var _cacheEntry_value;
|
|
957
|
-
const cacheEntry = await routeModule.handleResponse({
|
|
958
|
-
req,
|
|
959
|
-
nextConfig,
|
|
960
|
-
cacheKey,
|
|
961
|
-
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
962
|
-
isFallback: false,
|
|
963
|
-
previewProps,
|
|
964
|
-
prerenderManifest,
|
|
965
|
-
isRoutePPREnabled: false,
|
|
966
|
-
isOnDemandRevalidate,
|
|
967
|
-
revalidateOnlyGenerated,
|
|
968
|
-
responseGenerator,
|
|
969
|
-
waitUntil: ctx.waitUntil,
|
|
970
|
-
isMinimalMode
|
|
971
|
-
});
|
|
972
|
-
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
973
|
-
throw cacheEntry.error;
|
|
974
|
-
}
|
|
975
|
-
// we don't create a cacheEntry for ISR
|
|
976
|
-
if (!isIsr) {
|
|
977
|
-
return;
|
|
978
|
-
}
|
|
979
|
-
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) {
|
|
980
|
-
var _cacheEntry_value1;
|
|
981
|
-
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
982
|
-
}
|
|
983
|
-
if (!isMinimalMode) {
|
|
984
|
-
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
985
|
-
}
|
|
986
|
-
// Draft mode should never be cached
|
|
987
|
-
if (isDraftMode) {
|
|
988
|
-
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
989
|
-
}
|
|
990
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
991
|
-
if (!(isMinimalMode && isIsr)) {
|
|
992
|
-
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
993
|
-
}
|
|
994
|
-
// If cache control is already set on the response we don't
|
|
995
|
-
// override it to allow users to customize it via next.config
|
|
996
|
-
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
997
|
-
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
998
|
-
}
|
|
999
|
-
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'.
|
|
1000
|
-
new Response(cacheEntry.value.body, {
|
|
1001
|
-
headers,
|
|
1002
|
-
status: cacheEntry.value.status || 200
|
|
1003
|
-
}));
|
|
1004
|
-
return;
|
|
1005
|
-
} catch (err) {
|
|
1006
|
-
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
1007
|
-
const silenceLog = false;
|
|
1008
|
-
await routeModule.onRequestError(req, err, {
|
|
1009
|
-
routerKind: 'App Router',
|
|
1010
|
-
routePath: normalizedSrcPage,
|
|
1011
|
-
routeType: 'route',
|
|
1012
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1013
|
-
isStaticGeneration: cacheKey !== null,
|
|
1014
|
-
isOnDemandRevalidate
|
|
1015
|
-
})
|
|
1016
|
-
}, silenceLog, routerServerContext);
|
|
1017
|
-
}
|
|
1018
|
-
// rethrow so that we can handle serving error page
|
|
1019
|
-
// If this is during static generation, throw the error again.
|
|
1020
|
-
if (isIsr) throw err;
|
|
1021
|
-
// Otherwise, send a 500 response unless the original response has
|
|
1022
|
-
// already committed. In that case, preserve its status code for
|
|
1023
|
-
// telemetry while still recording the failure and terminating a response
|
|
1024
|
-
// that the failed pipeline left open.
|
|
1025
|
-
if (res.headersSent) {
|
|
1026
|
-
if (currentSpan) {
|
|
1027
|
-
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
1028
|
-
currentSpan.recordException(error);
|
|
1029
|
-
currentSpan.setStatus({
|
|
1030
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
1031
|
-
message: error.message
|
|
1032
|
-
});
|
|
1033
|
-
currentSpan.setAttribute('error.type', error.name);
|
|
1034
|
-
}
|
|
1035
|
-
if (!res.writableEnded && !res.destroyed) {
|
|
1036
|
-
res.end();
|
|
1037
|
-
}
|
|
1038
|
-
} else {
|
|
1039
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
1040
|
-
status: 500
|
|
1041
|
-
}));
|
|
1042
|
-
}
|
|
1043
|
-
return;
|
|
1044
|
-
} finally{
|
|
1045
|
-
;
|
|
1046
|
-
(()=>{
|
|
1047
|
-
if (!currentSpan) {
|
|
1048
|
-
return;
|
|
1049
|
-
}
|
|
1050
|
-
let statusCode = res.statusCode;
|
|
1051
|
-
currentSpan.setAttributes({
|
|
1052
|
-
'http.status_code': statusCode,
|
|
1053
|
-
'next.rsc': false
|
|
1054
|
-
});
|
|
1055
|
-
if (statusCode && statusCode >= 500) {
|
|
1056
|
-
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
1057
|
-
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
1058
|
-
currentSpan.setStatus({
|
|
1059
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
1060
|
-
});
|
|
1061
|
-
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
1062
|
-
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
1063
|
-
}
|
|
1064
|
-
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
1065
|
-
// We were unable to get attributes, probably OTEL is not enabled
|
|
1066
|
-
if (!rootSpanAttributes) {
|
|
1067
|
-
return;
|
|
1068
|
-
}
|
|
1069
|
-
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
1070
|
-
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
1074
|
-
const name = `${method} ${route}`;
|
|
1075
|
-
currentSpan.setAttributes({
|
|
1076
|
-
'next.route': route,
|
|
1077
|
-
'http.route': route,
|
|
1078
|
-
'next.span_name': name
|
|
1079
|
-
});
|
|
1080
|
-
currentSpan.updateName(name);
|
|
1081
|
-
// Propagate http.route to the request's root span if it isn't the
|
|
1082
|
-
// request span (e.g. a platform-created HTTP span in adapter
|
|
1083
|
-
// deployments).
|
|
1084
|
-
if (requestRootSpan && requestRootSpan !== currentSpan) {
|
|
1085
|
-
requestRootSpan.setAttribute('http.route', route);
|
|
1086
|
-
requestRootSpan.updateName(name);
|
|
1087
|
-
}
|
|
1088
|
-
})();
|
|
1089
|
-
}
|
|
785
|
+
}
|
|
786
|
+
function mcpServerToResponse(r) {
|
|
787
|
+
return {
|
|
788
|
+
name: r.name,
|
|
789
|
+
transport: r.transport,
|
|
790
|
+
spec: (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_2__/* .parseJsonSafe */ .p)(r.spec, null),
|
|
791
|
+
enabled: r.enabled === 1,
|
|
792
|
+
last_error: r.last_error,
|
|
793
|
+
created_at: r.created_at,
|
|
794
|
+
updated_at: r.updated_at
|
|
1090
795
|
};
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Shape a `message_usage` row into the over-the-wire `usage` object the
|
|
799
|
+
* chat panel's `ContextUsageBar` consumes. Returns `null` for messages
|
|
800
|
+
* that have no snapshot (user turns and legacy assistant rows recorded
|
|
801
|
+
* before the per-turn snapshot landed in ADR-0041).
|
|
802
|
+
*
|
|
803
|
+
* Anthropic prompt-cache tokens (PR #181 + the cache-fidelity follow-up)
|
|
804
|
+
* are surfaced as additive fields so future UI work can render a
|
|
805
|
+
* "served from cache" badge without another wire change. Both are
|
|
806
|
+
* `null` for rows that predate cache plumbing or for providers that
|
|
807
|
+
* don't expose a cache breakdown.
|
|
808
|
+
*/ function messageUsageToResponse(u) {
|
|
809
|
+
if (!u) return null;
|
|
810
|
+
return {
|
|
811
|
+
input_tokens: u.input_tokens,
|
|
812
|
+
output_tokens: u.output_tokens,
|
|
813
|
+
hot_tokens: u.hot_tokens,
|
|
814
|
+
warm_tokens: u.warm_tokens,
|
|
815
|
+
facts_tokens: u.facts_tokens,
|
|
816
|
+
overhead_tokens: u.overhead_tokens,
|
|
817
|
+
hot_budget_tokens: u.hot_budget_tokens,
|
|
818
|
+
warm_budget_tokens: u.warm_budget_tokens,
|
|
819
|
+
facts_budget_tokens: u.facts_budget_tokens,
|
|
820
|
+
context_window_tokens: u.context_window_tokens,
|
|
821
|
+
cache_creation_input_tokens: u.cache_creation_input_tokens,
|
|
822
|
+
cache_read_input_tokens: u.cache_read_input_tokens,
|
|
823
|
+
thinking_tokens: u.thinking_tokens ?? null,
|
|
824
|
+
cost_usd: u.cost_usd ?? null
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* Shape one message row into its over-the-wire form, attaching its
|
|
829
|
+
* per-turn `usage` snapshot when one exists. Pure data-shaping helper
|
|
830
|
+
* extracted from the threads GET route so the wire contract has unit
|
|
831
|
+
* coverage.
|
|
832
|
+
*/ function messageToResponse(m, usageById) {
|
|
833
|
+
return {
|
|
834
|
+
id: m.msg_id,
|
|
835
|
+
seq: m.seq,
|
|
836
|
+
role: m.role,
|
|
837
|
+
content: m.content,
|
|
838
|
+
created_at: m.created_at,
|
|
839
|
+
transcript_status: m.transcript_status,
|
|
840
|
+
status_reason: m.status_reason,
|
|
841
|
+
tool_events: parseToolEventsForResponse(m.tool_events),
|
|
842
|
+
category: m.category ?? null,
|
|
843
|
+
usage: messageUsageToResponse(usageById.get(m.msg_id)),
|
|
844
|
+
metadata: parseMessageMetadataForResponse(m.metadata)
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
/** Tolerant `tool_events` JSON parser shared with the route. Bad JSON
|
|
848
|
+
* and non-array payloads collapse to `undefined` so the wire shape
|
|
849
|
+
* always matches the typed client expectation. */ function parseToolEventsForResponse(raw) {
|
|
850
|
+
if (!raw) return undefined;
|
|
851
|
+
try {
|
|
852
|
+
const parsed = JSON.parse(raw);
|
|
853
|
+
return Array.isArray(parsed) ? parsed : undefined;
|
|
854
|
+
} catch {
|
|
855
|
+
return undefined;
|
|
1096
856
|
}
|
|
1097
|
-
|
|
857
|
+
}
|
|
858
|
+
/** Tolerant `metadata` JSON parser. Returns `null` for missing/blank/
|
|
859
|
+
* malformed/non-object payloads so the wire shape stays a plain object
|
|
860
|
+
* or null — readers can rely on `metadata?.citations?...` chaining. */ function parseMessageMetadataForResponse(raw) {
|
|
861
|
+
if (!raw) return null;
|
|
862
|
+
try {
|
|
863
|
+
const parsed = JSON.parse(raw);
|
|
864
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
865
|
+
return parsed;
|
|
866
|
+
} catch {
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Resolve the bar's 100% baseline. Per-row `context_window_tokens`
|
|
872
|
+
* (snapshotted at run time) wins so the bar matches the cap the agent
|
|
873
|
+
* actually applied; legacy rows fall back to the model-config value;
|
|
874
|
+
* unconfigured agents fall back to the default. Centralised so the
|
|
875
|
+
* route and the UI share the same precedence rule.
|
|
876
|
+
*/ function resolveContextWindowTokens(modelConfiguredTokens, defaultTokens) {
|
|
877
|
+
if (typeof modelConfiguredTokens === "number" && modelConfiguredTokens > 0) {
|
|
878
|
+
return modelConfiguredTokens;
|
|
879
|
+
}
|
|
880
|
+
return defaultTokens;
|
|
1098
881
|
}
|
|
1099
882
|
|
|
1100
|
-
//# sourceMappingURL=app-route.js.map
|
|
1101
883
|
|
|
884
|
+
/***/ }),
|
|
885
|
+
|
|
886
|
+
/***/ 710846:
|
|
887
|
+
/***/ ((module) => {
|
|
888
|
+
|
|
889
|
+
module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");
|
|
1102
890
|
|
|
1103
891
|
/***/ }),
|
|
1104
892
|
|
|
1105
|
-
/***/
|
|
893
|
+
/***/ 731421:
|
|
894
|
+
/***/ ((module) => {
|
|
895
|
+
|
|
896
|
+
module.exports = require("node:child_process");
|
|
897
|
+
|
|
898
|
+
/***/ }),
|
|
899
|
+
|
|
900
|
+
/***/ 739947:
|
|
1106
901
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1107
902
|
|
|
1108
903
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1109
|
-
/* harmony export */
|
|
904
|
+
/* harmony export */ Bm: () => (/* binding */ cachedJson),
|
|
905
|
+
/* harmony export */ HN: () => (/* binding */ notFoundResponse),
|
|
906
|
+
/* harmony export */ Jb: () => (/* binding */ validateBody),
|
|
907
|
+
/* harmony export */ K2: () => (/* binding */ createdResponse),
|
|
908
|
+
/* harmony export */ Ng: () => (/* binding */ noStoreJson),
|
|
909
|
+
/* harmony export */ yj: () => (/* binding */ errorResponse)
|
|
1110
910
|
/* harmony export */ });
|
|
1111
|
-
/* harmony import */ var
|
|
1112
|
-
|
|
911
|
+
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(945592);
|
|
912
|
+
// Shared HTTP response builders for app/api/v1/** route handlers.
|
|
913
|
+
//
|
|
914
|
+
// Goal: every error/success payload across the v1 surface has the same
|
|
915
|
+
// shape. Before this lived inline, response bodies drifted —
|
|
916
|
+
// `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
|
|
917
|
+
// some routes returned Zod's raw issue array, others stringified it.
|
|
1113
918
|
|
|
919
|
+
function errorResponse(message, status = 400) {
|
|
920
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
921
|
+
error: message
|
|
922
|
+
}, {
|
|
923
|
+
status
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
function notFoundResponse(message = "Not found") {
|
|
927
|
+
return errorResponse(message, 404);
|
|
928
|
+
}
|
|
929
|
+
function createdResponse(data) {
|
|
930
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
931
|
+
status: 201
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
// Wrap a 200 JSON response with a private Cache-Control header. Use on safe
|
|
935
|
+
// GET endpoints that serve user-scoped data the client refetches often (panel
|
|
936
|
+
// mounts, navigation back/forward) but mutates rarely. The TTL is short
|
|
937
|
+
// enough that explicit mutations — which patch the client-side ApiClient
|
|
938
|
+
// cache in place — stay observably consistent without an extra roundtrip.
|
|
939
|
+
//
|
|
940
|
+
// swrSeconds (optional): stale-while-revalidate window. When set, the browser
|
|
941
|
+
// serves the cached response immediately and refreshes in the background,
|
|
942
|
+
// making navigation feel instant. Use for data that can tolerate brief
|
|
943
|
+
// staleness (tool list, agent configs, model list). Omit for real-time data
|
|
944
|
+
// (dashboard metrics, credential state).
|
|
945
|
+
function cachedJson(data, maxAgeSeconds, swrSeconds) {
|
|
946
|
+
const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
|
|
947
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
948
|
+
headers: {
|
|
949
|
+
"Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
// Use for endpoints whose response contains live state that must never be
|
|
954
|
+
// served from cache — credentials, connection status, live config values.
|
|
955
|
+
function noStoreJson(data) {
|
|
956
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
957
|
+
headers: {
|
|
958
|
+
"Cache-Control": "no-store"
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
// Validate a JSON request body against a zod schema.
|
|
963
|
+
// Returns either the parsed data or a 400 NextResponse explaining the issue.
|
|
964
|
+
// Caller pattern:
|
|
965
|
+
// const parsed = await validateBody(req, Schema);
|
|
966
|
+
// if (parsed instanceof NextResponse) return parsed;
|
|
967
|
+
// // use parsed.field
|
|
968
|
+
async function validateBody(req, schema) {
|
|
969
|
+
let raw;
|
|
970
|
+
try {
|
|
971
|
+
raw = await req.json();
|
|
972
|
+
} catch {
|
|
973
|
+
return errorResponse("Request body must be valid JSON", 400);
|
|
974
|
+
}
|
|
975
|
+
const parsed = schema.safeParse(raw);
|
|
976
|
+
if (!parsed.success) {
|
|
977
|
+
return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
|
|
978
|
+
}
|
|
979
|
+
return parsed.data;
|
|
980
|
+
}
|
|
1114
981
|
|
|
1115
982
|
|
|
1116
983
|
/***/ }),
|
|
1117
984
|
|
|
1118
|
-
/***/
|
|
985
|
+
/***/ 744870:
|
|
1119
986
|
/***/ ((module) => {
|
|
1120
987
|
|
|
1121
|
-
module.exports = require("next/dist/server/app-
|
|
988
|
+
module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
|
|
1122
989
|
|
|
1123
990
|
/***/ }),
|
|
1124
991
|
|
|
1125
|
-
/***/
|
|
1126
|
-
/***/ ((
|
|
992
|
+
/***/ 754172:
|
|
993
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1127
994
|
|
|
1128
|
-
|
|
995
|
+
__webpack_require__.r(__webpack_exports__);
|
|
996
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
997
|
+
/* harmony export */ DELETE: () => (/* binding */ DELETE),
|
|
998
|
+
/* harmony export */ GET: () => (/* binding */ GET),
|
|
999
|
+
/* harmony export */ PUT: () => (/* binding */ PUT)
|
|
1000
|
+
/* harmony export */ });
|
|
1001
|
+
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(945592);
|
|
1002
|
+
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(497377);
|
|
1003
|
+
/* harmony import */ var _lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42666);
|
|
1004
|
+
/* harmony import */ var _lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(777955);
|
|
1005
|
+
/* harmony import */ var _lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(685678);
|
|
1006
|
+
/* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(739947);
|
|
1007
|
+
/* harmony import */ var _lib_utils_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(253638);
|
|
1129
1008
|
|
|
1130
|
-
/***/ }),
|
|
1131
1009
|
|
|
1132
|
-
/***/ 594735:
|
|
1133
|
-
/***/ ((module) => {
|
|
1134
1010
|
|
|
1135
|
-
module.exports = require("events");
|
|
1136
1011
|
|
|
1137
|
-
/***/ }),
|
|
1138
1012
|
|
|
1139
|
-
/***/ 629021:
|
|
1140
|
-
/***/ ((module) => {
|
|
1141
1013
|
|
|
1142
|
-
|
|
1014
|
+
|
|
1015
|
+
const PutBody = zod__WEBPACK_IMPORTED_MODULE_5__/* .object */ .Ikc({
|
|
1016
|
+
transport: zod__WEBPACK_IMPORTED_MODULE_5__/* ["enum"] */ .k5n([
|
|
1017
|
+
"stdio",
|
|
1018
|
+
"http"
|
|
1019
|
+
]).optional(),
|
|
1020
|
+
spec: zod__WEBPACK_IMPORTED_MODULE_5__/* .record */ .g1P(zod__WEBPACK_IMPORTED_MODULE_5__/* .string */ .YjP(), zod__WEBPACK_IMPORTED_MODULE_5__/* .unknown */ .L5J()).optional(),
|
|
1021
|
+
enabled: zod__WEBPACK_IMPORTED_MODULE_5__/* .boolean */ .zMY().optional()
|
|
1022
|
+
});
|
|
1023
|
+
async function GET(_req, { params }) {
|
|
1024
|
+
const { name } = await params;
|
|
1025
|
+
const r = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .getMcpServer */ .cw)(name);
|
|
1026
|
+
if (!r) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
1027
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json((0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__/* .mcpServerToResponse */ .sU)(r));
|
|
1028
|
+
}
|
|
1029
|
+
async function PUT(req, { params }) {
|
|
1030
|
+
const { name } = await params;
|
|
1031
|
+
const existing = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .getMcpServer */ .cw)(name);
|
|
1032
|
+
if (!existing) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
1033
|
+
const body = await (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .validateBody */ .Jb)(req, PutBody);
|
|
1034
|
+
if (body instanceof next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse) return body;
|
|
1035
|
+
const row = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .upsertMcpServer */ .te)({
|
|
1036
|
+
name,
|
|
1037
|
+
transport: body.transport ?? existing.transport,
|
|
1038
|
+
spec: body.spec ?? (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_6__/* .parseJsonSafe */ .p)(existing.spec, {}),
|
|
1039
|
+
enabled: body.enabled ?? existing.enabled === 1
|
|
1040
|
+
});
|
|
1041
|
+
(0,_lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__/* .invalidateMcpTools */ .H_)();
|
|
1042
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json((0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__/* .mcpServerToResponse */ .sU)(row));
|
|
1043
|
+
}
|
|
1044
|
+
async function DELETE(_req, { params }) {
|
|
1045
|
+
const { name } = await params;
|
|
1046
|
+
const ok = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .deleteMcpServer */ .le)(name);
|
|
1047
|
+
if (!ok) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
1048
|
+
(0,_lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__/* .invalidateMcpTools */ .H_)();
|
|
1049
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
1050
|
+
deleted: true
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1143
1054
|
|
|
1144
1055
|
/***/ }),
|
|
1145
1056
|
|
|
1146
|
-
/***/
|
|
1057
|
+
/***/ 775919:
|
|
1147
1058
|
/***/ ((module) => {
|
|
1148
1059
|
|
|
1149
|
-
module.exports = require("node:
|
|
1060
|
+
module.exports = require("node:worker_threads");
|
|
1150
1061
|
|
|
1151
1062
|
/***/ }),
|
|
1152
1063
|
|
|
1153
|
-
/***/
|
|
1064
|
+
/***/ 777030:
|
|
1154
1065
|
/***/ ((module) => {
|
|
1155
1066
|
|
|
1156
|
-
module.exports = require("
|
|
1067
|
+
module.exports = require("node:net");
|
|
1157
1068
|
|
|
1158
1069
|
/***/ }),
|
|
1159
1070
|
|
|
1160
|
-
/***/
|
|
1071
|
+
/***/ 777955:
|
|
1161
1072
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1162
1073
|
|
|
1163
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1164
|
-
/* harmony export */ G4: () => (/* binding */ resolveContextWindowTokens),
|
|
1165
|
-
/* harmony export */ S6: () => (/* binding */ agentToResponse),
|
|
1166
|
-
/* harmony export */ aX: () => (/* binding */ bridgeToResponse),
|
|
1167
|
-
/* harmony export */ mX: () => (/* binding */ messageToResponse),
|
|
1168
|
-
/* harmony export */ sU: () => (/* binding */ mcpServerToResponse)
|
|
1169
|
-
/* harmony export */ });
|
|
1170
|
-
/* unused harmony exports messageUsageToResponse, parseToolEventsForResponse, parseMessageMetadataForResponse */
|
|
1171
|
-
/* harmony import */ var _api_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(524318);
|
|
1172
|
-
/* harmony import */ var _lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41720);
|
|
1173
|
-
/* harmony import */ var _lib_utils_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(253638);
|
|
1174
|
-
// Row → JSON-response serializers shared between list (`route.ts`) and
|
|
1175
|
-
// item (`[id]/route.ts`) handlers. Keeping these in one place stops the
|
|
1176
|
-
// list and item shapes from drifting (they were copy-pasted before).
|
|
1177
1074
|
|
|
1075
|
+
// EXPORTS
|
|
1076
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1077
|
+
k2: () => (/* binding */ getMcpToolMeta),
|
|
1078
|
+
a2: () => (/* binding */ getMcpTools),
|
|
1079
|
+
H_: () => (/* binding */ invalidateMcpTools)
|
|
1080
|
+
});
|
|
1178
1081
|
|
|
1082
|
+
// UNUSED EXPORTS: buildSubprocessEnv
|
|
1179
1083
|
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
warm_summary_limit: a.warm_summary_limit,
|
|
1195
|
-
never_reply: !!a.never_reply,
|
|
1196
|
-
adaptive_persona_enabled: !!a.adaptive_persona_enabled,
|
|
1197
|
-
adaptive_persona_strength: a.adaptive_persona_strength,
|
|
1198
|
-
adaptive_empathy: a.adaptive_empathy,
|
|
1199
|
-
adaptive_expressiveness: a.adaptive_expressiveness,
|
|
1200
|
-
adaptive_verbosity: a.adaptive_verbosity,
|
|
1201
|
-
adaptive_mbti: a.adaptive_mbti,
|
|
1202
|
-
voice_enabled: !!a.voice_enabled,
|
|
1203
|
-
voice_model: a.voice_model,
|
|
1204
|
-
voice_name: a.voice_name,
|
|
1205
|
-
voice_stt_model: a.voice_stt_model,
|
|
1206
|
-
voice_auto_speak: !!a.voice_auto_speak,
|
|
1207
|
-
harness_id: a.harness_id,
|
|
1208
|
-
delegate_targets: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .parseDelegateTargets */ .bg)(a.delegate_targets),
|
|
1209
|
-
context_tier_proportions: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .getAgentTierProportions */ .fg)(a),
|
|
1210
|
-
anti_hallucination_mode: a.anti_hallucination_mode === "off" || a.anti_hallucination_mode === "regex" || a.anti_hallucination_mode === "model" ? a.anti_hallucination_mode : null,
|
|
1211
|
-
anti_hallucination_model_config: a.anti_hallucination_model_config,
|
|
1212
|
-
citation_strictness: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .parseCitationStrictness */ .P2)(a.citation_strictness) ?? "off",
|
|
1213
|
-
tool_credentials: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .getAgentToolCredentials */ .S2)(a),
|
|
1214
|
-
router_policy: a.router_policy === "cheap" || a.router_policy === "fast" || a.router_policy === "balanced" || a.router_policy === "quality" ? a.router_policy : null,
|
|
1215
|
-
router_enabled: a.router_enabled === 1 ? true : a.router_enabled === 0 ? false : null,
|
|
1216
|
-
usage_strategy: a.usage_strategy === "cost_saving" || a.usage_strategy === "balanced" || a.usage_strategy === "high_reasoning" ? a.usage_strategy : null,
|
|
1217
|
-
created_at: a.created_at,
|
|
1218
|
-
updated_at: a.updated_at
|
|
1219
|
-
};
|
|
1220
|
-
}
|
|
1221
|
-
function bridgeToResponse(r) {
|
|
1222
|
-
return {
|
|
1223
|
-
id: r.id,
|
|
1224
|
-
kind: r.kind,
|
|
1225
|
-
name: r.name,
|
|
1226
|
-
status: r.status,
|
|
1227
|
-
last_error: r.last_error,
|
|
1228
|
-
paired_id: r.paired_id,
|
|
1229
|
-
enabled: r.enabled === 1,
|
|
1230
|
-
event_subscriptions: {
|
|
1231
|
-
group_profile_updates: r.forward_group_profile_updates === 1,
|
|
1232
|
-
group_participants_updates: r.forward_group_participants_updates === 1
|
|
1233
|
-
},
|
|
1234
|
-
created_at: r.created_at,
|
|
1235
|
-
updated_at: r.updated_at
|
|
1236
|
-
};
|
|
1237
|
-
}
|
|
1238
|
-
function mcpServerToResponse(r) {
|
|
1084
|
+
// EXTERNAL MODULE: ./lib/stores/mcp-servers.ts
|
|
1085
|
+
var mcp_servers = __webpack_require__(42666);
|
|
1086
|
+
// EXTERNAL MODULE: ./lib/env/allowlist.ts
|
|
1087
|
+
var allowlist = __webpack_require__(423593);
|
|
1088
|
+
// EXTERNAL MODULE: ./lib/tools/security/subprocess-env.ts
|
|
1089
|
+
var subprocess_env = __webpack_require__(813638);
|
|
1090
|
+
// EXTERNAL MODULE: ./lib/utils/error.ts
|
|
1091
|
+
var error = __webpack_require__(922032);
|
|
1092
|
+
;// ./lib/mcp/tool-results.ts
|
|
1093
|
+
// Plain-argument tool invocation drops LangChain artifacts. Keep structured
|
|
1094
|
+
// output usable by the agent without exposing private MCP protocol metadata.
|
|
1095
|
+
const includeMcpStructuredContent = ({ result: [content, artifacts] })=>{
|
|
1096
|
+
const structured = artifacts.find((artifact)=>artifact.type === "mcp_structured_content");
|
|
1097
|
+
if (!structured) return;
|
|
1239
1098
|
return {
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1099
|
+
result: [
|
|
1100
|
+
[
|
|
1101
|
+
...typeof content === "string" ? content ? [
|
|
1102
|
+
{
|
|
1103
|
+
type: "text",
|
|
1104
|
+
text: content
|
|
1105
|
+
}
|
|
1106
|
+
] : [] : content,
|
|
1107
|
+
{
|
|
1108
|
+
type: "text",
|
|
1109
|
+
text: `Structured result (JSON):\n${JSON.stringify(structured.data)}`
|
|
1110
|
+
}
|
|
1111
|
+
],
|
|
1112
|
+
artifacts
|
|
1113
|
+
]
|
|
1247
1114
|
};
|
|
1248
|
-
}
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1117
|
+
;// ./lib/mcp/client.ts
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
// Singleton MCP client manager. Connects to enabled servers on first access,
|
|
1124
|
+
// caches the resulting StructuredTools, and invalidates on configuration
|
|
1125
|
+
// changes (when the API CRUD endpoints touch the table they call refresh()).
|
|
1126
|
+
//
|
|
1127
|
+
// We intentionally don't keep stdio child processes alive forever — the
|
|
1128
|
+
// MultiServerMCPClient owns connections, and if a server is disabled or
|
|
1129
|
+
// removed we close the existing client and rebuild on next access.
|
|
1130
|
+
let cachedTools = null;
|
|
1131
|
+
let cacheKey = ""; // hash of the enabled server set; cache invalidated on change
|
|
1132
|
+
let pending = null;
|
|
1133
|
+
let activeClient = null;
|
|
1134
|
+
// Incremented by invalidateMcpTools(); captured by getMcpTools() at the start
|
|
1135
|
+
// of each async run so a stale in-flight promise can detect it was superseded.
|
|
1136
|
+
let generation = 0;
|
|
1137
|
+
const mcpToolMeta = new Map();
|
|
1249
1138
|
/**
|
|
1250
|
-
*
|
|
1251
|
-
*
|
|
1252
|
-
*
|
|
1253
|
-
*
|
|
1139
|
+
* Return the declared metadata for an MCP tool (category, group,
|
|
1140
|
+
* credentials_required). Populated when getMcpTools() connects to servers;
|
|
1141
|
+
* sourced from the tool's `metadata` object which @langchain/mcp-adapters
|
|
1142
|
+
* populates from the MCP tool's `annotations` field.
|
|
1254
1143
|
*
|
|
1255
|
-
*
|
|
1256
|
-
*
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
* don't expose a cache breakdown.
|
|
1260
|
-
*/ function messageUsageToResponse(u) {
|
|
1261
|
-
if (!u) return null;
|
|
1262
|
-
return {
|
|
1263
|
-
input_tokens: u.input_tokens,
|
|
1264
|
-
output_tokens: u.output_tokens,
|
|
1265
|
-
hot_tokens: u.hot_tokens,
|
|
1266
|
-
warm_tokens: u.warm_tokens,
|
|
1267
|
-
facts_tokens: u.facts_tokens,
|
|
1268
|
-
overhead_tokens: u.overhead_tokens,
|
|
1269
|
-
hot_budget_tokens: u.hot_budget_tokens,
|
|
1270
|
-
warm_budget_tokens: u.warm_budget_tokens,
|
|
1271
|
-
facts_budget_tokens: u.facts_budget_tokens,
|
|
1272
|
-
context_window_tokens: u.context_window_tokens,
|
|
1273
|
-
cache_creation_input_tokens: u.cache_creation_input_tokens,
|
|
1274
|
-
cache_read_input_tokens: u.cache_read_input_tokens,
|
|
1275
|
-
thinking_tokens: u.thinking_tokens ?? null,
|
|
1276
|
-
cost_usd: u.cost_usd ?? null
|
|
1277
|
-
};
|
|
1144
|
+
* Returns stale (pre-invalidation) values during reconnect — intentional:
|
|
1145
|
+
* stale metadata is better than empty metadata for the credentials badge.
|
|
1146
|
+
*/ function getMcpToolMeta(name) {
|
|
1147
|
+
return mcpToolMeta.get(name);
|
|
1278
1148
|
}
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
* extracted from the threads GET route so the wire contract has unit
|
|
1283
|
-
* coverage.
|
|
1284
|
-
*/ function messageToResponse(m, usageById) {
|
|
1285
|
-
return {
|
|
1286
|
-
id: m.msg_id,
|
|
1287
|
-
seq: m.seq,
|
|
1288
|
-
role: m.role,
|
|
1289
|
-
content: m.content,
|
|
1290
|
-
created_at: m.created_at,
|
|
1291
|
-
transcript_status: m.transcript_status,
|
|
1292
|
-
status_reason: m.status_reason,
|
|
1293
|
-
tool_events: parseToolEventsForResponse(m.tool_events),
|
|
1294
|
-
category: m.category ?? null,
|
|
1295
|
-
usage: messageUsageToResponse(usageById.get(m.msg_id)),
|
|
1296
|
-
metadata: parseMessageMetadataForResponse(m.metadata)
|
|
1297
|
-
};
|
|
1149
|
+
function specHash(rows) {
|
|
1150
|
+
// Only enabled servers matter. Order by name so the hash is stable.
|
|
1151
|
+
return rows.filter((r)=>r.enabled === 1).sort((a, b)=>a.name.localeCompare(b.name)).map((r)=>`${r.name}:${r.transport}:${r.spec}`).join("|");
|
|
1298
1152
|
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1153
|
+
async function getMcpTools() {
|
|
1154
|
+
const rows = (0,mcp_servers/* listMcpServers */.n7)();
|
|
1155
|
+
const enabled = rows.filter((r)=>r.enabled === 1);
|
|
1156
|
+
const key = specHash(rows);
|
|
1157
|
+
if (cachedTools && cacheKey === key) return cachedTools;
|
|
1158
|
+
if (pending) return pending;
|
|
1159
|
+
if (enabled.length === 0) {
|
|
1160
|
+
cachedTools = [];
|
|
1161
|
+
cacheKey = key;
|
|
1162
|
+
return cachedTools;
|
|
1163
|
+
}
|
|
1164
|
+
const myGen = generation; // capture before async work; invalidation will increment this
|
|
1165
|
+
pending = (async ()=>{
|
|
1166
|
+
// Close prior client if we're rebuilding due to a config change.
|
|
1167
|
+
if (activeClient) {
|
|
1168
|
+
try {
|
|
1169
|
+
await activeClient.close();
|
|
1170
|
+
} catch {}
|
|
1171
|
+
activeClient = null;
|
|
1172
|
+
}
|
|
1173
|
+
const { MCPAdapter } = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 590347));
|
|
1174
|
+
// Connect each server in its own client so one broken server (e.g. missing
|
|
1175
|
+
// `uvx` on PATH, bad API key) doesn't poison the others. Previously a
|
|
1176
|
+
// single MCPAdapter.listTools() throw would mark ALL enabled
|
|
1177
|
+
// servers with the same error message — confusing because the UI showed
|
|
1178
|
+
// e.g. google-maps tagged with the `time` server's connection error.
|
|
1179
|
+
const tools = [];
|
|
1180
|
+
const newMeta = new Map(); // built in isolation; written atomically
|
|
1181
|
+
const subClients = [];
|
|
1182
|
+
for (const row of enabled){
|
|
1183
|
+
let serverConfig;
|
|
1184
|
+
try {
|
|
1185
|
+
const spec = JSON.parse(row.spec);
|
|
1186
|
+
if (row.transport === "stdio") {
|
|
1187
|
+
const s = spec;
|
|
1188
|
+
serverConfig = {
|
|
1189
|
+
transport: "stdio",
|
|
1190
|
+
command: s.command,
|
|
1191
|
+
args: s.args ?? [],
|
|
1192
|
+
mode: "auto",
|
|
1193
|
+
elicitation: false,
|
|
1194
|
+
// Inherit host env (PATH, HOME, proxies, registry configs) and
|
|
1195
|
+
// layer spec.env on top. See buildSubprocessEnv below.
|
|
1196
|
+
env: buildSubprocessEnv(s.env ?? {})
|
|
1197
|
+
};
|
|
1198
|
+
} else {
|
|
1199
|
+
const s = spec;
|
|
1200
|
+
serverConfig = {
|
|
1201
|
+
transport: "http",
|
|
1202
|
+
url: s.url,
|
|
1203
|
+
headers: s.headers ?? {},
|
|
1204
|
+
mode: "auto",
|
|
1205
|
+
elicitation: false
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
} catch (err) {
|
|
1209
|
+
(0,mcp_servers/* setMcpServerError */.KA)(row.name, `bad spec: ${(0,error/* errorMessage */.g)(err)}`);
|
|
1210
|
+
continue;
|
|
1211
|
+
}
|
|
1212
|
+
try {
|
|
1213
|
+
const client = new MCPAdapter({
|
|
1214
|
+
servers: {
|
|
1215
|
+
[row.name]: serverConfig
|
|
1216
|
+
},
|
|
1217
|
+
throwOnLoadError: false,
|
|
1218
|
+
prefixToolNameWithServerName: false,
|
|
1219
|
+
onConnectionError: "throw",
|
|
1220
|
+
afterToolCall: includeMcpStructuredContent
|
|
1221
|
+
});
|
|
1222
|
+
const serverTools = await client.listTools();
|
|
1223
|
+
tools.push(...serverTools);
|
|
1224
|
+
for (const t of serverTools){
|
|
1225
|
+
const raw = t.metadata ?? {};
|
|
1226
|
+
// @langchain/mcp-adapters may nest annotations under metadata.annotations
|
|
1227
|
+
// or spread them directly into metadata — handle both shapes.
|
|
1228
|
+
const ann = raw.annotations ?? raw;
|
|
1229
|
+
newMeta.set(t.name, {
|
|
1230
|
+
category: typeof ann.category === "string" ? ann.category : undefined,
|
|
1231
|
+
group: typeof ann.group === "string" ? ann.group : undefined,
|
|
1232
|
+
credentials_required: Array.isArray(ann.credentials_required) ? ann.credentials_required.filter((c)=>typeof c === "string") : undefined,
|
|
1233
|
+
integration: typeof ann.integration === "string" ? ann.integration : undefined,
|
|
1234
|
+
server_name: row.name
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
subClients.push(client);
|
|
1238
|
+
(0,mcp_servers/* setMcpServerError */.KA)(row.name, null);
|
|
1239
|
+
} catch (err) {
|
|
1240
|
+
const msg = (0,error/* errorMessage */.g)(err);
|
|
1241
|
+
console.error(`[mcp] server "${row.name}" failed:`, msg);
|
|
1242
|
+
(0,mcp_servers/* setMcpServerError */.KA)(row.name, msg);
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
// If invalidateMcpTools() was called while we were connecting, our results
|
|
1246
|
+
// are stale — discard them and let the next caller reconnect fresh.
|
|
1247
|
+
if (generation !== myGen) return cachedTools ?? [];
|
|
1248
|
+
// Atomically replace metadata so callers never see a partial update.
|
|
1249
|
+
mcpToolMeta.clear();
|
|
1250
|
+
for (const [k, v] of newMeta)mcpToolMeta.set(k, v);
|
|
1251
|
+
activeClient = {
|
|
1252
|
+
close: async ()=>{
|
|
1253
|
+
await Promise.allSettled(subClients.map((c)=>c.close()));
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
cachedTools = tools;
|
|
1257
|
+
cacheKey = key;
|
|
1258
|
+
return tools;
|
|
1259
|
+
})();
|
|
1303
1260
|
try {
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
return undefined;
|
|
1261
|
+
return await pending;
|
|
1262
|
+
} finally{
|
|
1263
|
+
pending = null;
|
|
1308
1264
|
}
|
|
1309
1265
|
}
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1266
|
+
// Called by API endpoints when a server is added/edited/deleted/toggled so
|
|
1267
|
+
// the next getAllTools() call re-resolves connections.
|
|
1268
|
+
function invalidateMcpTools() {
|
|
1269
|
+
cachedTools = null;
|
|
1270
|
+
cacheKey = "";
|
|
1271
|
+
pending = null; // clear dedup guard so the next caller starts a fresh connect
|
|
1272
|
+
generation++; // signal any in-flight promise to discard its writes
|
|
1273
|
+
// mcpToolMeta intentionally NOT cleared: stale metadata (category, group,
|
|
1274
|
+
// credentials_required) is better than empty during the reconnect window —
|
|
1275
|
+
// the credentials badge stays visible instead of silently disappearing.
|
|
1276
|
+
// The map is replaced atomically once the new connection completes.
|
|
1277
|
+
if (activeClient) {
|
|
1278
|
+
activeClient.close().catch(()=>{});
|
|
1279
|
+
activeClient = null;
|
|
1320
1280
|
}
|
|
1321
1281
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1282
|
+
// ── Subprocess environment ──────────────────────────────────────────────────
|
|
1283
|
+
// Be transparent: whatever the host can reach, the subprocess can reach.
|
|
1284
|
+
//
|
|
1285
|
+
// Why this design:
|
|
1286
|
+
// - On a clean machine (no JFrog, no special config), uv/npm fall through to
|
|
1287
|
+
// their public defaults. Nothing extra needed.
|
|
1288
|
+
// - On a corporate machine (JFrog or Artifactory in env / ~/.config/uv/uv.toml /
|
|
1289
|
+
// ~/.npmrc), public PyPI/npm are usually blocked at the network layer.
|
|
1290
|
+
// The user's existing config is the ONLY thing that works — so inherit it.
|
|
1291
|
+
// - Per-server overrides still work: spec.env wins over inherited env, so a
|
|
1292
|
+
// user who wants this specific server pinned to a custom registry can do
|
|
1293
|
+
// so without affecting everything else.
|
|
1294
|
+
//
|
|
1295
|
+
// The MCP SDK's default behavior (a curated minimal env) breaks corporate
|
|
1296
|
+
// installs because it strips registry env vars; we explicitly opt out of that.
|
|
1297
|
+
// Only a few env vars are worth scrubbing — the ones that actively confuse
|
|
1298
|
+
// stdio MCP processes or leak our internal state. Everything else flows.
|
|
1299
|
+
const SCRUBBED_VARS = new Set([
|
|
1300
|
+
// Our own DB path — irrelevant to MCP servers, and exposes our layout.
|
|
1301
|
+
"JARELA_DB_DIR",
|
|
1302
|
+
// Defensive: don't leak npm/yarn auth tokens into a stdio child unless
|
|
1303
|
+
// the server explicitly opted in via spec.env. (Most public MCP packages
|
|
1304
|
+
// don't need auth to install.)
|
|
1305
|
+
"NPM_TOKEN",
|
|
1306
|
+
"NODE_AUTH_TOKEN"
|
|
1307
|
+
]);
|
|
1308
|
+
function buildSubprocessEnv(userEnv) {
|
|
1309
|
+
const out = {};
|
|
1310
|
+
// 1. Inherit the host process env wholesale. This carries through:
|
|
1311
|
+
// - PATH (so uvx, npx, python, node are findable)
|
|
1312
|
+
// - HOME (so uv/pip/npm read user-level config files like ~/.config/uv/uv.toml,
|
|
1313
|
+
// ~/.npmrc, ~/.pip/pip.conf — which may pin JFrog, Artifactory, etc.)
|
|
1314
|
+
// - HTTP_PROXY / HTTPS_PROXY / NO_PROXY (corporate proxy routing)
|
|
1315
|
+
// - UV_INDEX_URL / PIP_INDEX_URL / npm_config_registry if the user set
|
|
1316
|
+
// them — letting their JFrog or Artifactory setup work transparently
|
|
1317
|
+
// - Locale, terminal, etc.
|
|
1318
|
+
for (const [k, v] of Object.entries(process.env)){
|
|
1319
|
+
if (typeof v !== "string") continue;
|
|
1320
|
+
if (SCRUBBED_VARS.has(k)) continue;
|
|
1321
|
+
out[k] = v;
|
|
1331
1322
|
}
|
|
1332
|
-
|
|
1323
|
+
// 1b. Merge in the env-sync full shell-env snapshot (lib/tools/subprocess-env.ts).
|
|
1324
|
+
// Covers vars the user's rc files export that never made it into
|
|
1325
|
+
// Jarela's own process.env — e.g. running as a launchd/systemd service.
|
|
1326
|
+
for (const [k, v] of Object.entries((0,subprocess_env/* getFullShellEnv */.l9)())){
|
|
1327
|
+
if (SCRUBBED_VARS.has(k)) continue;
|
|
1328
|
+
out[k] = v;
|
|
1329
|
+
}
|
|
1330
|
+
// 2. Inject env-sync-managed credentials from the encrypted integration
|
|
1331
|
+
// store. Service-mode installs (launchd, systemd, brew services)
|
|
1332
|
+
// start with no shell env, so ANTHROPIC_API_KEY / GITHUB_TOKEN / …
|
|
1333
|
+
// have to come from the store or downstream tools see nothing. This
|
|
1334
|
+
// layer goes after process.env so that when the store has been
|
|
1335
|
+
// refreshed by env-sync, the new value wins over a stale shell
|
|
1336
|
+
// export.
|
|
1337
|
+
for (const [k, v] of Object.entries((0,allowlist/* getInjectedSubprocessEnv */.xJ)())){
|
|
1338
|
+
out[k] = v;
|
|
1339
|
+
}
|
|
1340
|
+
// 3. Per-server spec.env layered on top — user's explicit config always
|
|
1341
|
+
// wins. Use this to (a) supply API keys, (b) pin THIS server to a
|
|
1342
|
+
// specific registry without affecting the rest, or (c) unset something
|
|
1343
|
+
// via empty string.
|
|
1344
|
+
for (const [k, v] of Object.entries(userEnv)){
|
|
1345
|
+
if (typeof v === "string") out[k] = v;
|
|
1346
|
+
}
|
|
1347
|
+
return out;
|
|
1333
1348
|
}
|
|
1334
1349
|
|
|
1335
1350
|
|
|
1336
1351
|
/***/ }),
|
|
1337
1352
|
|
|
1338
|
-
/***/
|
|
1353
|
+
/***/ 781630:
|
|
1339
1354
|
/***/ ((module) => {
|
|
1340
1355
|
|
|
1341
|
-
module.exports = require("
|
|
1356
|
+
module.exports = require("http");
|
|
1342
1357
|
|
|
1343
1358
|
/***/ }),
|
|
1344
1359
|
|
|
1345
|
-
/***/
|
|
1360
|
+
/***/ 848161:
|
|
1346
1361
|
/***/ ((module) => {
|
|
1347
1362
|
|
|
1348
|
-
module.exports = require("node:
|
|
1363
|
+
module.exports = require("node:os");
|
|
1349
1364
|
|
|
1350
1365
|
/***/ }),
|
|
1351
1366
|
|
|
1352
|
-
/***/
|
|
1353
|
-
/***/ ((
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
/* harmony export */ Bm: () => (/* binding */ cachedJson),
|
|
1357
|
-
/* harmony export */ HN: () => (/* binding */ notFoundResponse),
|
|
1358
|
-
/* harmony export */ Jb: () => (/* binding */ validateBody),
|
|
1359
|
-
/* harmony export */ K2: () => (/* binding */ createdResponse),
|
|
1360
|
-
/* harmony export */ Ng: () => (/* binding */ noStoreJson),
|
|
1361
|
-
/* harmony export */ yj: () => (/* binding */ errorResponse)
|
|
1362
|
-
/* harmony export */ });
|
|
1363
|
-
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(945592);
|
|
1364
|
-
// Shared HTTP response builders for app/api/v1/** route handlers.
|
|
1365
|
-
//
|
|
1366
|
-
// Goal: every error/success payload across the v1 surface has the same
|
|
1367
|
-
// shape. Before this lived inline, response bodies drifted —
|
|
1368
|
-
// `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
|
|
1369
|
-
// some routes returned Zod's raw issue array, others stringified it.
|
|
1370
|
-
|
|
1371
|
-
function errorResponse(message, status = 400) {
|
|
1372
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
1373
|
-
error: message
|
|
1374
|
-
}, {
|
|
1375
|
-
status
|
|
1376
|
-
});
|
|
1377
|
-
}
|
|
1378
|
-
function notFoundResponse(message = "Not found") {
|
|
1379
|
-
return errorResponse(message, 404);
|
|
1380
|
-
}
|
|
1381
|
-
function createdResponse(data) {
|
|
1382
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
1383
|
-
status: 201
|
|
1384
|
-
});
|
|
1385
|
-
}
|
|
1386
|
-
// Wrap a 200 JSON response with a private Cache-Control header. Use on safe
|
|
1387
|
-
// GET endpoints that serve user-scoped data the client refetches often (panel
|
|
1388
|
-
// mounts, navigation back/forward) but mutates rarely. The TTL is short
|
|
1389
|
-
// enough that explicit mutations — which patch the client-side ApiClient
|
|
1390
|
-
// cache in place — stay observably consistent without an extra roundtrip.
|
|
1391
|
-
//
|
|
1392
|
-
// swrSeconds (optional): stale-while-revalidate window. When set, the browser
|
|
1393
|
-
// serves the cached response immediately and refreshes in the background,
|
|
1394
|
-
// making navigation feel instant. Use for data that can tolerate brief
|
|
1395
|
-
// staleness (tool list, agent configs, model list). Omit for real-time data
|
|
1396
|
-
// (dashboard metrics, credential state).
|
|
1397
|
-
function cachedJson(data, maxAgeSeconds, swrSeconds) {
|
|
1398
|
-
const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
|
|
1399
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
1400
|
-
headers: {
|
|
1401
|
-
"Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
|
|
1402
|
-
}
|
|
1403
|
-
});
|
|
1404
|
-
}
|
|
1405
|
-
// Use for endpoints whose response contains live state that must never be
|
|
1406
|
-
// served from cache — credentials, connection status, live config values.
|
|
1407
|
-
function noStoreJson(data) {
|
|
1408
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
1409
|
-
headers: {
|
|
1410
|
-
"Cache-Control": "no-store"
|
|
1411
|
-
}
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
// Validate a JSON request body against a zod schema.
|
|
1415
|
-
// Returns either the parsed data or a 400 NextResponse explaining the issue.
|
|
1416
|
-
// Caller pattern:
|
|
1417
|
-
// const parsed = await validateBody(req, Schema);
|
|
1418
|
-
// if (parsed instanceof NextResponse) return parsed;
|
|
1419
|
-
// // use parsed.field
|
|
1420
|
-
async function validateBody(req, schema) {
|
|
1421
|
-
let raw;
|
|
1422
|
-
try {
|
|
1423
|
-
raw = await req.json();
|
|
1424
|
-
} catch {
|
|
1425
|
-
return errorResponse("Request body must be valid JSON", 400);
|
|
1426
|
-
}
|
|
1427
|
-
const parsed = schema.safeParse(raw);
|
|
1428
|
-
if (!parsed.success) {
|
|
1429
|
-
return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
|
|
1430
|
-
}
|
|
1431
|
-
return parsed.data;
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1367
|
+
/***/ 903295:
|
|
1368
|
+
/***/ ((module) => {
|
|
1369
|
+
|
|
1370
|
+
module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");
|
|
1434
1371
|
|
|
1435
1372
|
/***/ }),
|
|
1436
1373
|
|
|
1437
|
-
/***/
|
|
1374
|
+
/***/ 927910:
|
|
1438
1375
|
/***/ ((module) => {
|
|
1439
1376
|
|
|
1440
|
-
module.exports = require("
|
|
1377
|
+
module.exports = require("stream");
|
|
1441
1378
|
|
|
1442
1379
|
/***/ }),
|
|
1443
1380
|
|
|
1444
|
-
/***/
|
|
1381
|
+
/***/ 931768:
|
|
1445
1382
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1446
1383
|
|
|
1447
1384
|
__webpack_require__.r(__webpack_exports__);
|
|
1448
1385
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1449
|
-
/* harmony export */
|
|
1450
|
-
/* harmony export */
|
|
1451
|
-
/* harmony export */
|
|
1386
|
+
/* harmony export */ handler: () => (/* binding */ handler),
|
|
1387
|
+
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
1388
|
+
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
1389
|
+
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
1390
|
+
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
1391
|
+
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
1452
1392
|
/* harmony export */ });
|
|
1453
|
-
/* harmony import */ var
|
|
1454
|
-
/* harmony import */ var
|
|
1455
|
-
/* harmony import */ var
|
|
1456
|
-
/* harmony import */ var
|
|
1457
|
-
/* harmony import */ var
|
|
1458
|
-
/* harmony import */ var
|
|
1459
|
-
/* harmony import */ var
|
|
1393
|
+
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319225);
|
|
1394
|
+
/* 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__);
|
|
1395
|
+
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(684006);
|
|
1396
|
+
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
1397
|
+
/* 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__);
|
|
1398
|
+
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(799373);
|
|
1399
|
+
/* 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__);
|
|
1400
|
+
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(434775);
|
|
1401
|
+
/* 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__);
|
|
1402
|
+
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(524235);
|
|
1403
|
+
/* 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__);
|
|
1404
|
+
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(200261);
|
|
1405
|
+
/* 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__);
|
|
1406
|
+
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(754365);
|
|
1407
|
+
/* 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__);
|
|
1408
|
+
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(590771);
|
|
1409
|
+
/* 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__);
|
|
1410
|
+
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(473461);
|
|
1411
|
+
/* 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__);
|
|
1412
|
+
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(767798);
|
|
1413
|
+
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(192280);
|
|
1414
|
+
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(662018);
|
|
1415
|
+
/* 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__);
|
|
1416
|
+
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(445696);
|
|
1417
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(347929);
|
|
1418
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
1419
|
+
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(986439);
|
|
1420
|
+
/* 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__);
|
|
1421
|
+
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(710246);
|
|
1422
|
+
/* 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__);
|
|
1423
|
+
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(137527);
|
|
1424
|
+
/* 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__);
|
|
1460
1425
|
|
|
1461
1426
|
|
|
1462
1427
|
|
|
@@ -1464,369 +1429,404 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1464
1429
|
|
|
1465
1430
|
|
|
1466
1431
|
|
|
1467
|
-
const PutBody = zod__WEBPACK_IMPORTED_MODULE_5__/* .object */ .Ikc({
|
|
1468
|
-
transport: zod__WEBPACK_IMPORTED_MODULE_5__/* ["enum"] */ .k5n([
|
|
1469
|
-
"stdio",
|
|
1470
|
-
"http"
|
|
1471
|
-
]).optional(),
|
|
1472
|
-
spec: zod__WEBPACK_IMPORTED_MODULE_5__/* .record */ .g1P(zod__WEBPACK_IMPORTED_MODULE_5__/* .string */ .YjP(), zod__WEBPACK_IMPORTED_MODULE_5__/* .unknown */ .L5J()).optional(),
|
|
1473
|
-
enabled: zod__WEBPACK_IMPORTED_MODULE_5__/* .boolean */ .zMY().optional()
|
|
1474
|
-
});
|
|
1475
|
-
async function GET(_req, { params }) {
|
|
1476
|
-
const { name } = await params;
|
|
1477
|
-
const r = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .getMcpServer */ .cw)(name);
|
|
1478
|
-
if (!r) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
1479
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json((0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__/* .mcpServerToResponse */ .sU)(r));
|
|
1480
|
-
}
|
|
1481
|
-
async function PUT(req, { params }) {
|
|
1482
|
-
const { name } = await params;
|
|
1483
|
-
const existing = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .getMcpServer */ .cw)(name);
|
|
1484
|
-
if (!existing) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
1485
|
-
const body = await (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .validateBody */ .Jb)(req, PutBody);
|
|
1486
|
-
if (body instanceof next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse) return body;
|
|
1487
|
-
const row = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .upsertMcpServer */ .te)({
|
|
1488
|
-
name,
|
|
1489
|
-
transport: body.transport ?? existing.transport,
|
|
1490
|
-
spec: body.spec ?? (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_6__/* .parseJsonSafe */ .p)(existing.spec, {}),
|
|
1491
|
-
enabled: body.enabled ?? existing.enabled === 1
|
|
1492
|
-
});
|
|
1493
|
-
(0,_lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__/* .invalidateMcpTools */ .H_)();
|
|
1494
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json((0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__/* .mcpServerToResponse */ .sU)(row));
|
|
1495
|
-
}
|
|
1496
|
-
async function DELETE(_req, { params }) {
|
|
1497
|
-
const { name } = await params;
|
|
1498
|
-
const ok = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .deleteMcpServer */ .le)(name);
|
|
1499
|
-
if (!ok) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
1500
|
-
(0,_lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__/* .invalidateMcpTools */ .H_)();
|
|
1501
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
1502
|
-
deleted: true
|
|
1503
|
-
});
|
|
1504
|
-
}
|
|
1505
1432
|
|
|
1506
1433
|
|
|
1507
|
-
/***/ }),
|
|
1508
1434
|
|
|
1509
|
-
/***/ 775919:
|
|
1510
|
-
/***/ ((module) => {
|
|
1511
1435
|
|
|
1512
|
-
module.exports = require("node:worker_threads");
|
|
1513
1436
|
|
|
1514
|
-
/***/ }),
|
|
1515
1437
|
|
|
1516
|
-
/***/ 777030:
|
|
1517
|
-
/***/ ((module) => {
|
|
1518
1438
|
|
|
1519
|
-
module.exports = require("node:net");
|
|
1520
1439
|
|
|
1521
|
-
/***/ }),
|
|
1522
1440
|
|
|
1523
|
-
/***/ 777955:
|
|
1524
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1525
1441
|
|
|
1526
1442
|
|
|
1527
|
-
//
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1443
|
+
// We inject the nextConfigOutput here so that we can use them in the route
|
|
1444
|
+
// module.
|
|
1445
|
+
const nextConfigOutput = "standalone"
|
|
1446
|
+
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
1447
|
+
definition: {
|
|
1448
|
+
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
1449
|
+
page: "/api/v1/mcp-servers/[name]/route",
|
|
1450
|
+
pathname: "/api/v1/mcp-servers/[name]",
|
|
1451
|
+
filename: "route",
|
|
1452
|
+
bundlePath: "app/api/v1/mcp-servers/[name]/route"
|
|
1453
|
+
},
|
|
1454
|
+
distDir: ".next" || 0,
|
|
1455
|
+
relativeProjectDir: false || '',
|
|
1456
|
+
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/mcp-servers/[name]/route.ts",
|
|
1457
|
+
nextConfigOutput,
|
|
1458
|
+
// The lazy require factory ensures that:
|
|
1459
|
+
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
1460
|
+
// correctly attributing module load time to application-code rather than
|
|
1461
|
+
// framework internals.
|
|
1462
|
+
// - In all modes: async modules (route files with top-level await) are
|
|
1463
|
+
// handled correctly — require() returns a Promise for such modules, which
|
|
1464
|
+
// ensureUserland() awaits before the first request is handled.
|
|
1465
|
+
userland: ()=>__webpack_require__(754172),
|
|
1466
|
+
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
1467
|
+
// server HMR updates are picked up without re-executing the entry chunk.
|
|
1468
|
+
// Using require() (synchronous) avoids adding async overhead that would be
|
|
1469
|
+
// incorrectly attributed to application-code time in devRequestTiming.
|
|
1470
|
+
... false ? 0 : {}
|
|
1532
1471
|
});
|
|
1533
|
-
|
|
1534
|
-
//
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
// EXTERNAL MODULE: ./lib/utils/error.ts
|
|
1543
|
-
var error = __webpack_require__(922032);
|
|
1544
|
-
;// ./lib/mcp/tool-results.ts
|
|
1545
|
-
// Plain-argument tool invocation drops LangChain artifacts. Keep structured
|
|
1546
|
-
// output usable by the agent without exposing private MCP protocol metadata.
|
|
1547
|
-
const includeMcpStructuredContent = ({ result: [content, artifacts] })=>{
|
|
1548
|
-
const structured = artifacts.find((artifact)=>artifact.type === "mcp_structured_content");
|
|
1549
|
-
if (!structured) return;
|
|
1550
|
-
return {
|
|
1551
|
-
result: [
|
|
1552
|
-
[
|
|
1553
|
-
...typeof content === "string" ? content ? [
|
|
1554
|
-
{
|
|
1555
|
-
type: "text",
|
|
1556
|
-
text: content
|
|
1557
|
-
}
|
|
1558
|
-
] : [] : content,
|
|
1559
|
-
{
|
|
1560
|
-
type: "text",
|
|
1561
|
-
text: `Structured result (JSON):\n${JSON.stringify(structured.data)}`
|
|
1562
|
-
}
|
|
1563
|
-
],
|
|
1564
|
-
artifacts
|
|
1565
|
-
]
|
|
1566
|
-
};
|
|
1567
|
-
};
|
|
1568
|
-
|
|
1569
|
-
;// ./lib/mcp/client.ts
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
// Singleton MCP client manager. Connects to enabled servers on first access,
|
|
1576
|
-
// caches the resulting StructuredTools, and invalidates on configuration
|
|
1577
|
-
// changes (when the API CRUD endpoints touch the table they call refresh()).
|
|
1578
|
-
//
|
|
1579
|
-
// We intentionally don't keep stdio child processes alive forever — the
|
|
1580
|
-
// MultiServerMCPClient owns connections, and if a server is disabled or
|
|
1581
|
-
// removed we close the existing client and rebuild on next access.
|
|
1582
|
-
let cachedTools = null;
|
|
1583
|
-
let cacheKey = ""; // hash of the enabled server set; cache invalidated on change
|
|
1584
|
-
let pending = null;
|
|
1585
|
-
let activeClient = null;
|
|
1586
|
-
// Incremented by invalidateMcpTools(); captured by getMcpTools() at the start
|
|
1587
|
-
// of each async run so a stale in-flight promise can detect it was superseded.
|
|
1588
|
-
let generation = 0;
|
|
1589
|
-
const mcpToolMeta = new Map();
|
|
1590
|
-
/**
|
|
1591
|
-
* Return the declared metadata for an MCP tool (category, group,
|
|
1592
|
-
* credentials_required). Populated when getMcpTools() connects to servers;
|
|
1593
|
-
* sourced from the tool's `metadata` object which @langchain/mcp-adapters
|
|
1594
|
-
* populates from the MCP tool's `annotations` field.
|
|
1595
|
-
*
|
|
1596
|
-
* Returns stale (pre-invalidation) values during reconnect — intentional:
|
|
1597
|
-
* stale metadata is better than empty metadata for the credentials badge.
|
|
1598
|
-
*/ function getMcpToolMeta(name) {
|
|
1599
|
-
return mcpToolMeta.get(name);
|
|
1600
|
-
}
|
|
1601
|
-
function specHash(rows) {
|
|
1602
|
-
// Only enabled servers matter. Order by name so the hash is stable.
|
|
1603
|
-
return rows.filter((r)=>r.enabled === 1).sort((a, b)=>a.name.localeCompare(b.name)).map((r)=>`${r.name}:${r.transport}:${r.spec}`).join("|");
|
|
1472
|
+
// Pull out the exports that we need to expose from the module. This should
|
|
1473
|
+
// be eliminated when we've moved the other routes to the new format. These
|
|
1474
|
+
// are used to hook into the route.
|
|
1475
|
+
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
1476
|
+
function patchFetch() {
|
|
1477
|
+
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
1478
|
+
workAsyncStorage,
|
|
1479
|
+
workUnitAsyncStorage
|
|
1480
|
+
});
|
|
1604
1481
|
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
if (
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1482
|
+
|
|
1483
|
+
async function handler(req, res, ctx) {
|
|
1484
|
+
if (ctx.requestMeta) {
|
|
1485
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
|
|
1486
|
+
}
|
|
1487
|
+
if (routeModule.isDev) {
|
|
1488
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
|
1489
|
+
}
|
|
1490
|
+
let srcPage = "/api/v1/mcp-servers/[name]/route";
|
|
1491
|
+
// turbopack doesn't normalize `/index` in the page name
|
|
1492
|
+
// so we need to to process dynamic routes properly
|
|
1493
|
+
// TODO: fix turbopack providing differing value from webpack
|
|
1494
|
+
if (false) {} else if (srcPage === '/index') {
|
|
1495
|
+
// we always normalize /index specifically
|
|
1496
|
+
srcPage = '/';
|
|
1497
|
+
}
|
|
1498
|
+
const multiZoneDraftMode = false;
|
|
1499
|
+
// Registering `instrumentation.ts` usually installs the tracer provider, so
|
|
1500
|
+
// do it before starting the request span. The span is started before
|
|
1501
|
+
// `prepare`, so route module preparation is part of the request's trace.
|
|
1502
|
+
// When this request triggers registration, the lifecycle spans of
|
|
1503
|
+
// `instrumentation.ts` are emitted inside the request span.
|
|
1504
|
+
const { instrumentation } = await routeModule.ensureInstrumentation(req, {
|
|
1505
|
+
deferSpans: true
|
|
1506
|
+
});
|
|
1507
|
+
return routeModule.traceRequest(req, {
|
|
1508
|
+
tracer: (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)(),
|
|
1509
|
+
spanName: `${req.method || 'GET'} ${srcPage}`,
|
|
1510
|
+
httpTarget: req.url,
|
|
1511
|
+
instrumentation
|
|
1512
|
+
}, (requestSpan, requestRootSpan)=>handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan));
|
|
1513
|
+
}
|
|
1514
|
+
async function handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan) {
|
|
1515
|
+
const prepareResult = await routeModule.prepare(req, res, {
|
|
1516
|
+
srcPage,
|
|
1517
|
+
multiZoneDraftMode
|
|
1518
|
+
});
|
|
1519
|
+
if (!prepareResult) {
|
|
1520
|
+
res.statusCode = 400;
|
|
1521
|
+
res.end('Bad Request');
|
|
1522
|
+
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
|
1523
|
+
return null;
|
|
1615
1524
|
}
|
|
1616
|
-
const
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1525
|
+
const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
|
|
1526
|
+
const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
|
|
1527
|
+
// Only this route's prerenders can establish ISR or admit generated params.
|
|
1528
|
+
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]));
|
|
1529
|
+
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
1530
|
+
const render404 = async ()=>{
|
|
1531
|
+
// TODO: should route-module itself handle rendering the 404
|
|
1532
|
+
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
1533
|
+
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
1534
|
+
} else {
|
|
1535
|
+
res.end('This page could not be found');
|
|
1624
1536
|
}
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1537
|
+
return null;
|
|
1538
|
+
};
|
|
1539
|
+
if (isIsr && !isDraftMode) {
|
|
1540
|
+
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
1541
|
+
if (prerenderInfo) {
|
|
1542
|
+
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
1543
|
+
if (nextConfig.adapterPath) {
|
|
1544
|
+
return await render404();
|
|
1545
|
+
}
|
|
1546
|
+
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
let cacheKey = null;
|
|
1551
|
+
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
1552
|
+
cacheKey = resolvedPathname;
|
|
1553
|
+
// ensure /index and / is normalized to one key
|
|
1554
|
+
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
1555
|
+
}
|
|
1556
|
+
// Before rendering (which initializes component tree modules), we have to
|
|
1557
|
+
// set the reference manifests to our global store so Server Action's
|
|
1558
|
+
// encryption util can access to them at the top level of the page module.
|
|
1559
|
+
if (serverActionsManifest && clientReferenceManifest) {
|
|
1560
|
+
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
1561
|
+
page: srcPage,
|
|
1562
|
+
clientReferenceManifest,
|
|
1563
|
+
serverActionsManifest
|
|
1564
|
+
});
|
|
1565
|
+
}
|
|
1566
|
+
const method = req.method || 'GET';
|
|
1567
|
+
const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
|
|
1568
|
+
const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
|
|
1569
|
+
const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
|
|
1570
|
+
const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
|
|
1571
|
+
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
1572
|
+
globalThis.__incrementalCache = incrementalCache;
|
|
1573
|
+
const context = {
|
|
1574
|
+
params,
|
|
1575
|
+
previewProps,
|
|
1576
|
+
renderOpts: {
|
|
1577
|
+
experimental: {
|
|
1578
|
+
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
1579
|
+
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
1580
|
+
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
1581
|
+
},
|
|
1582
|
+
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
1583
|
+
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
1584
|
+
isDraftMode,
|
|
1585
|
+
incrementalCache,
|
|
1586
|
+
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
1587
|
+
cacheLifeProfiles: nextConfig.cacheLife,
|
|
1588
|
+
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
1589
|
+
waitUntil: ctx.waitUntil,
|
|
1590
|
+
onClose: (cb)=>{
|
|
1591
|
+
res.on('close', cb);
|
|
1592
|
+
},
|
|
1593
|
+
onAfterTaskError: undefined
|
|
1594
|
+
},
|
|
1595
|
+
sharedContext: {
|
|
1596
|
+
buildId,
|
|
1597
|
+
deploymentId
|
|
1598
|
+
}
|
|
1599
|
+
};
|
|
1600
|
+
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
1601
|
+
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
1602
|
+
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));
|
|
1603
|
+
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
1604
|
+
try {
|
|
1605
|
+
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
1606
|
+
res.statusCode = 404;
|
|
1607
|
+
// on-demand revalidate always sets this header
|
|
1608
|
+
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
1609
|
+
res.end('This page could not be found');
|
|
1610
|
+
return null;
|
|
1611
|
+
}
|
|
1612
|
+
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
1613
|
+
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
1614
|
+
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
1615
|
+
// Attempt using provided waitUntil if available
|
|
1616
|
+
// if it's not we fallback to sendResponse's handling
|
|
1617
|
+
if (pendingWaitUntil) {
|
|
1618
|
+
if (ctx.waitUntil) {
|
|
1619
|
+
ctx.waitUntil(pendingWaitUntil);
|
|
1620
|
+
pendingWaitUntil = undefined;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
const cacheTags = context.renderOpts.collectedTags;
|
|
1624
|
+
// If the request is for a static response, we can cache it so long
|
|
1625
|
+
// as it's not edge.
|
|
1626
|
+
if (isIsr) {
|
|
1627
|
+
const blob = await response.blob();
|
|
1628
|
+
// Copy the headers from the response.
|
|
1629
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
1630
|
+
if (cacheTags) {
|
|
1631
|
+
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
1632
|
+
}
|
|
1633
|
+
if (!headers['content-type'] && blob.type) {
|
|
1634
|
+
headers['content-type'] = blob.type;
|
|
1635
|
+
}
|
|
1636
|
+
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
1637
|
+
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
|
|
1638
|
+
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
1639
|
+
// build-time fallback in `build/index.ts` so cache entries
|
|
1640
|
+
// and the response Cache-Control header agree on the route's
|
|
1641
|
+
// effective expire. Routes that opt out of revalidation
|
|
1642
|
+
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
1643
|
+
// keep `expire: undefined`.
|
|
1644
|
+
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
1645
|
+
// Create the cache entry for the response.
|
|
1646
|
+
const cacheEntry = {
|
|
1647
|
+
value: {
|
|
1648
|
+
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
1649
|
+
status: response.status,
|
|
1650
|
+
body: Buffer.from(await blob.arrayBuffer()),
|
|
1651
|
+
headers
|
|
1652
|
+
},
|
|
1653
|
+
cacheControl: {
|
|
1654
|
+
revalidate,
|
|
1655
|
+
expire
|
|
1656
|
+
}
|
|
1657
|
+
};
|
|
1658
|
+
return cacheEntry;
|
|
1659
|
+
} else {
|
|
1660
|
+
// send response without caching if not ISR
|
|
1661
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
1662
|
+
return null;
|
|
1663
|
+
}
|
|
1664
|
+
} catch (err) {
|
|
1665
|
+
// if this is a background revalidate we need to report
|
|
1666
|
+
// the request error here as it won't be bubbled
|
|
1667
|
+
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
1668
|
+
const silenceLog = false;
|
|
1669
|
+
await routeModule.onRequestError(req, err, {
|
|
1670
|
+
routerKind: 'App Router',
|
|
1671
|
+
routePath: srcPage,
|
|
1672
|
+
routeType: 'route',
|
|
1673
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1674
|
+
isStaticGeneration: cacheKey !== null,
|
|
1675
|
+
isOnDemandRevalidate
|
|
1676
|
+
})
|
|
1677
|
+
}, silenceLog, routerServerContext);
|
|
1678
|
+
}
|
|
1679
|
+
throw err;
|
|
1680
|
+
}
|
|
1681
|
+
};
|
|
1682
|
+
const handleResponse = async (currentSpan)=>{
|
|
1683
|
+
try {
|
|
1684
|
+
var _cacheEntry_value;
|
|
1685
|
+
const cacheEntry = await routeModule.handleResponse({
|
|
1686
|
+
req,
|
|
1687
|
+
nextConfig,
|
|
1688
|
+
cacheKey,
|
|
1689
|
+
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
1690
|
+
isFallback: false,
|
|
1691
|
+
previewProps,
|
|
1692
|
+
prerenderManifest,
|
|
1693
|
+
isRoutePPREnabled: false,
|
|
1694
|
+
isOnDemandRevalidate,
|
|
1695
|
+
revalidateOnlyGenerated,
|
|
1696
|
+
responseGenerator,
|
|
1697
|
+
waitUntil: ctx.waitUntil,
|
|
1698
|
+
isMinimalMode
|
|
1699
|
+
});
|
|
1700
|
+
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
1701
|
+
throw cacheEntry.error;
|
|
1702
|
+
}
|
|
1703
|
+
// we don't create a cacheEntry for ISR
|
|
1704
|
+
if (!isIsr) {
|
|
1705
|
+
return;
|
|
1706
|
+
}
|
|
1707
|
+
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) {
|
|
1708
|
+
var _cacheEntry_value1;
|
|
1709
|
+
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
1710
|
+
}
|
|
1711
|
+
if (!isMinimalMode) {
|
|
1712
|
+
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
1713
|
+
}
|
|
1714
|
+
// Draft mode should never be cached
|
|
1715
|
+
if (isDraftMode) {
|
|
1716
|
+
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
1717
|
+
}
|
|
1718
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
1719
|
+
if (!(isMinimalMode && isIsr)) {
|
|
1720
|
+
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
1721
|
+
}
|
|
1722
|
+
// If cache control is already set on the response we don't
|
|
1723
|
+
// override it to allow users to customize it via next.config
|
|
1724
|
+
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
1725
|
+
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
1726
|
+
}
|
|
1727
|
+
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'.
|
|
1728
|
+
new Response(cacheEntry.value.body, {
|
|
1729
|
+
headers,
|
|
1730
|
+
status: cacheEntry.value.status || 200
|
|
1731
|
+
}));
|
|
1732
|
+
return;
|
|
1733
|
+
} catch (err) {
|
|
1734
|
+
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
1735
|
+
const silenceLog = false;
|
|
1736
|
+
await routeModule.onRequestError(req, err, {
|
|
1737
|
+
routerKind: 'App Router',
|
|
1738
|
+
routePath: normalizedSrcPage,
|
|
1739
|
+
routeType: 'route',
|
|
1740
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1741
|
+
isStaticGeneration: cacheKey !== null,
|
|
1742
|
+
isOnDemandRevalidate
|
|
1743
|
+
})
|
|
1744
|
+
}, silenceLog, routerServerContext);
|
|
1745
|
+
}
|
|
1746
|
+
// rethrow so that we can handle serving error page
|
|
1747
|
+
// If this is during static generation, throw the error again.
|
|
1748
|
+
if (isIsr) throw err;
|
|
1749
|
+
// Otherwise, send a 500 response unless the original response has
|
|
1750
|
+
// already committed. In that case, preserve its status code for
|
|
1751
|
+
// telemetry while still recording the failure and terminating a response
|
|
1752
|
+
// that the failed pipeline left open.
|
|
1753
|
+
if (res.headersSent) {
|
|
1754
|
+
if (currentSpan) {
|
|
1755
|
+
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
1756
|
+
currentSpan.recordException(error);
|
|
1757
|
+
currentSpan.setStatus({
|
|
1758
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
1759
|
+
message: error.message
|
|
1760
|
+
});
|
|
1761
|
+
currentSpan.setAttribute('error.type', error.name);
|
|
1659
1762
|
}
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1763
|
+
if (!res.writableEnded && !res.destroyed) {
|
|
1764
|
+
res.end();
|
|
1765
|
+
}
|
|
1766
|
+
} else {
|
|
1767
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
1768
|
+
status: 500
|
|
1769
|
+
}));
|
|
1663
1770
|
}
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1771
|
+
return;
|
|
1772
|
+
} finally{
|
|
1773
|
+
;
|
|
1774
|
+
(()=>{
|
|
1775
|
+
if (!currentSpan) {
|
|
1776
|
+
return;
|
|
1777
|
+
}
|
|
1778
|
+
let statusCode = res.statusCode;
|
|
1779
|
+
currentSpan.setAttributes({
|
|
1780
|
+
'http.status_code': statusCode,
|
|
1781
|
+
'next.rsc': false
|
|
1673
1782
|
});
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
// or spread them directly into metadata — handle both shapes.
|
|
1680
|
-
const ann = raw.annotations ?? raw;
|
|
1681
|
-
newMeta.set(t.name, {
|
|
1682
|
-
category: typeof ann.category === "string" ? ann.category : undefined,
|
|
1683
|
-
group: typeof ann.group === "string" ? ann.group : undefined,
|
|
1684
|
-
credentials_required: Array.isArray(ann.credentials_required) ? ann.credentials_required.filter((c)=>typeof c === "string") : undefined,
|
|
1685
|
-
integration: typeof ann.integration === "string" ? ann.integration : undefined,
|
|
1686
|
-
server_name: row.name
|
|
1783
|
+
if (statusCode && statusCode >= 500) {
|
|
1784
|
+
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
1785
|
+
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
1786
|
+
currentSpan.setStatus({
|
|
1787
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
1687
1788
|
});
|
|
1789
|
+
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
1790
|
+
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
1688
1791
|
}
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
(
|
|
1695
|
-
|
|
1792
|
+
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
1793
|
+
// We were unable to get attributes, probably OTEL is not enabled
|
|
1794
|
+
if (!rootSpanAttributes) {
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
1798
|
+
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
1799
|
+
return;
|
|
1800
|
+
}
|
|
1801
|
+
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
1802
|
+
const name = `${method} ${route}`;
|
|
1803
|
+
currentSpan.setAttributes({
|
|
1804
|
+
'next.route': route,
|
|
1805
|
+
'http.route': route,
|
|
1806
|
+
'next.span_name': name
|
|
1807
|
+
});
|
|
1808
|
+
currentSpan.updateName(name);
|
|
1809
|
+
// Propagate http.route to the request's root span if it isn't the
|
|
1810
|
+
// request span (e.g. a platform-created HTTP span in adapter
|
|
1811
|
+
// deployments).
|
|
1812
|
+
if (requestRootSpan && requestRootSpan !== currentSpan) {
|
|
1813
|
+
requestRootSpan.setAttribute('http.route', route);
|
|
1814
|
+
requestRootSpan.updateName(name);
|
|
1815
|
+
}
|
|
1816
|
+
})();
|
|
1696
1817
|
}
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
activeClient = {
|
|
1704
|
-
close: async ()=>{
|
|
1705
|
-
await Promise.allSettled(subClients.map((c)=>c.close()));
|
|
1706
|
-
}
|
|
1707
|
-
};
|
|
1708
|
-
cachedTools = tools;
|
|
1709
|
-
cacheKey = key;
|
|
1710
|
-
return tools;
|
|
1711
|
-
})();
|
|
1712
|
-
try {
|
|
1713
|
-
return await pending;
|
|
1714
|
-
} finally{
|
|
1715
|
-
pending = null;
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
// Called by API endpoints when a server is added/edited/deleted/toggled so
|
|
1719
|
-
// the next getAllTools() call re-resolves connections.
|
|
1720
|
-
function invalidateMcpTools() {
|
|
1721
|
-
cachedTools = null;
|
|
1722
|
-
cacheKey = "";
|
|
1723
|
-
pending = null; // clear dedup guard so the next caller starts a fresh connect
|
|
1724
|
-
generation++; // signal any in-flight promise to discard its writes
|
|
1725
|
-
// mcpToolMeta intentionally NOT cleared: stale metadata (category, group,
|
|
1726
|
-
// credentials_required) is better than empty during the reconnect window —
|
|
1727
|
-
// the credentials badge stays visible instead of silently disappearing.
|
|
1728
|
-
// The map is replaced atomically once the new connection completes.
|
|
1729
|
-
if (activeClient) {
|
|
1730
|
-
activeClient.close().catch(()=>{});
|
|
1731
|
-
activeClient = null;
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
// ── Subprocess environment ──────────────────────────────────────────────────
|
|
1735
|
-
// Be transparent: whatever the host can reach, the subprocess can reach.
|
|
1736
|
-
//
|
|
1737
|
-
// Why this design:
|
|
1738
|
-
// - On a clean machine (no JFrog, no special config), uv/npm fall through to
|
|
1739
|
-
// their public defaults. Nothing extra needed.
|
|
1740
|
-
// - On a corporate machine (JFrog or Artifactory in env / ~/.config/uv/uv.toml /
|
|
1741
|
-
// ~/.npmrc), public PyPI/npm are usually blocked at the network layer.
|
|
1742
|
-
// The user's existing config is the ONLY thing that works — so inherit it.
|
|
1743
|
-
// - Per-server overrides still work: spec.env wins over inherited env, so a
|
|
1744
|
-
// user who wants this specific server pinned to a custom registry can do
|
|
1745
|
-
// so without affecting everything else.
|
|
1746
|
-
//
|
|
1747
|
-
// The MCP SDK's default behavior (a curated minimal env) breaks corporate
|
|
1748
|
-
// installs because it strips registry env vars; we explicitly opt out of that.
|
|
1749
|
-
// Only a few env vars are worth scrubbing — the ones that actively confuse
|
|
1750
|
-
// stdio MCP processes or leak our internal state. Everything else flows.
|
|
1751
|
-
const SCRUBBED_VARS = new Set([
|
|
1752
|
-
// Our own DB path — irrelevant to MCP servers, and exposes our layout.
|
|
1753
|
-
"JARELA_DB_DIR",
|
|
1754
|
-
// Defensive: don't leak npm/yarn auth tokens into a stdio child unless
|
|
1755
|
-
// the server explicitly opted in via spec.env. (Most public MCP packages
|
|
1756
|
-
// don't need auth to install.)
|
|
1757
|
-
"NPM_TOKEN",
|
|
1758
|
-
"NODE_AUTH_TOKEN"
|
|
1759
|
-
]);
|
|
1760
|
-
function buildSubprocessEnv(userEnv) {
|
|
1761
|
-
const out = {};
|
|
1762
|
-
// 1. Inherit the host process env wholesale. This carries through:
|
|
1763
|
-
// - PATH (so uvx, npx, python, node are findable)
|
|
1764
|
-
// - HOME (so uv/pip/npm read user-level config files like ~/.config/uv/uv.toml,
|
|
1765
|
-
// ~/.npmrc, ~/.pip/pip.conf — which may pin JFrog, Artifactory, etc.)
|
|
1766
|
-
// - HTTP_PROXY / HTTPS_PROXY / NO_PROXY (corporate proxy routing)
|
|
1767
|
-
// - UV_INDEX_URL / PIP_INDEX_URL / npm_config_registry if the user set
|
|
1768
|
-
// them — letting their JFrog or Artifactory setup work transparently
|
|
1769
|
-
// - Locale, terminal, etc.
|
|
1770
|
-
for (const [k, v] of Object.entries(process.env)){
|
|
1771
|
-
if (typeof v !== "string") continue;
|
|
1772
|
-
if (SCRUBBED_VARS.has(k)) continue;
|
|
1773
|
-
out[k] = v;
|
|
1774
|
-
}
|
|
1775
|
-
// 1b. Merge in the env-sync full shell-env snapshot (lib/tools/subprocess-env.ts).
|
|
1776
|
-
// Covers vars the user's rc files export that never made it into
|
|
1777
|
-
// Jarela's own process.env — e.g. running as a launchd/systemd service.
|
|
1778
|
-
for (const [k, v] of Object.entries((0,subprocess_env/* getFullShellEnv */.l9)())){
|
|
1779
|
-
if (SCRUBBED_VARS.has(k)) continue;
|
|
1780
|
-
out[k] = v;
|
|
1781
|
-
}
|
|
1782
|
-
// 2. Inject env-sync-managed credentials from the encrypted integration
|
|
1783
|
-
// store. Service-mode installs (launchd, systemd, brew services)
|
|
1784
|
-
// start with no shell env, so ANTHROPIC_API_KEY / GITHUB_TOKEN / …
|
|
1785
|
-
// have to come from the store or downstream tools see nothing. This
|
|
1786
|
-
// layer goes after process.env so that when the store has been
|
|
1787
|
-
// refreshed by env-sync, the new value wins over a stale shell
|
|
1788
|
-
// export.
|
|
1789
|
-
for (const [k, v] of Object.entries((0,allowlist/* getInjectedSubprocessEnv */.xJ)())){
|
|
1790
|
-
out[k] = v;
|
|
1791
|
-
}
|
|
1792
|
-
// 3. Per-server spec.env layered on top — user's explicit config always
|
|
1793
|
-
// wins. Use this to (a) supply API keys, (b) pin THIS server to a
|
|
1794
|
-
// specific registry without affecting the rest, or (c) unset something
|
|
1795
|
-
// via empty string.
|
|
1796
|
-
for (const [k, v] of Object.entries(userEnv)){
|
|
1797
|
-
if (typeof v === "string") out[k] = v;
|
|
1818
|
+
};
|
|
1819
|
+
// When invoked directly, the request span was started before `prepare`;
|
|
1820
|
+
// record the request target as normalized by it. next-server's request span
|
|
1821
|
+
// already has it.
|
|
1822
|
+
if (!isWrappedByNextServer && req.url !== undefined) {
|
|
1823
|
+
requestSpan == null ? void 0 : requestSpan.setAttribute('http.target', req.url);
|
|
1798
1824
|
}
|
|
1799
|
-
|
|
1825
|
+
await handleResponse(requestSpan);
|
|
1800
1826
|
}
|
|
1801
1827
|
|
|
1828
|
+
//# sourceMappingURL=app-route.js.map
|
|
1802
1829
|
|
|
1803
|
-
/***/ }),
|
|
1804
|
-
|
|
1805
|
-
/***/ 781630:
|
|
1806
|
-
/***/ ((module) => {
|
|
1807
|
-
|
|
1808
|
-
module.exports = require("http");
|
|
1809
|
-
|
|
1810
|
-
/***/ }),
|
|
1811
|
-
|
|
1812
|
-
/***/ 848161:
|
|
1813
|
-
/***/ ((module) => {
|
|
1814
|
-
|
|
1815
|
-
module.exports = require("node:os");
|
|
1816
|
-
|
|
1817
|
-
/***/ }),
|
|
1818
|
-
|
|
1819
|
-
/***/ 903295:
|
|
1820
|
-
/***/ ((module) => {
|
|
1821
|
-
|
|
1822
|
-
module.exports = require("next/dist/server/app-render/after-task-async-storage.external.js");
|
|
1823
|
-
|
|
1824
|
-
/***/ }),
|
|
1825
|
-
|
|
1826
|
-
/***/ 927910:
|
|
1827
|
-
/***/ ((module) => {
|
|
1828
|
-
|
|
1829
|
-
module.exports = require("stream");
|
|
1830
1830
|
|
|
1831
1831
|
/***/ }),
|
|
1832
1832
|
|
|
@@ -1872,7 +1872,7 @@ module.exports = require("next/dist/shared/lib/no-fallback-error.external");
|
|
|
1872
1872
|
var __webpack_require__ = require("../../../../../webpack-runtime.js");
|
|
1873
1873
|
__webpack_require__.C(exports);
|
|
1874
1874
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
1875
|
-
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,4891,4992,1244], () => (__webpack_exec__(
|
|
1875
|
+
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,4891,4992,1244], () => (__webpack_exec__(931768)));
|
|
1876
1876
|
module.exports = __webpack_exports__;
|
|
1877
1877
|
|
|
1878
1878
|
})();
|