@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
|
@@ -19,1419 +19,1419 @@ module.exports = require("node:async_hooks");
|
|
|
19
19
|
|
|
20
20
|
/***/ }),
|
|
21
21
|
|
|
22
|
-
/***/
|
|
22
|
+
/***/ 26522:
|
|
23
23
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
24
24
|
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
25
26
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
26
|
-
/* harmony export */
|
|
27
|
-
/* harmony export */
|
|
28
|
-
/* harmony export */
|
|
29
|
-
/* harmony export */
|
|
30
|
-
/* harmony export */
|
|
31
|
-
/* harmony export */
|
|
32
|
-
/* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
|
|
33
|
-
/* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
|
|
34
|
-
/* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
|
|
35
|
-
/* harmony export */ mJ: () => (/* binding */ getAgentConfig),
|
|
36
|
-
/* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
|
|
37
|
-
/* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
|
|
38
|
-
/* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
|
|
39
|
-
/* harmony export */ vv: () => (/* binding */ duplicateAgentConfig),
|
|
40
|
-
/* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
|
|
41
|
-
/* harmony export */ zb: () => (/* binding */ listAgentConfigs)
|
|
27
|
+
/* harmony export */ handler: () => (/* binding */ handler),
|
|
28
|
+
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
29
|
+
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
30
|
+
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
31
|
+
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
32
|
+
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
42
33
|
/* harmony export */ });
|
|
43
|
-
/* harmony import */ var
|
|
44
|
-
/* harmony import */ var
|
|
45
|
-
/* harmony import */ var
|
|
34
|
+
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319225);
|
|
35
|
+
/* 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__);
|
|
36
|
+
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(684006);
|
|
37
|
+
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
38
|
+
/* 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__);
|
|
39
|
+
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(799373);
|
|
40
|
+
/* 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__);
|
|
41
|
+
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(434775);
|
|
42
|
+
/* 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__);
|
|
43
|
+
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(524235);
|
|
44
|
+
/* 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__);
|
|
45
|
+
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(200261);
|
|
46
|
+
/* 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__);
|
|
47
|
+
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(754365);
|
|
48
|
+
/* 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__);
|
|
49
|
+
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(590771);
|
|
50
|
+
/* 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__);
|
|
51
|
+
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(473461);
|
|
52
|
+
/* 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__);
|
|
53
|
+
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(767798);
|
|
54
|
+
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(192280);
|
|
55
|
+
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(662018);
|
|
56
|
+
/* 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__);
|
|
57
|
+
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(445696);
|
|
58
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(347929);
|
|
59
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
60
|
+
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(986439);
|
|
61
|
+
/* 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__);
|
|
62
|
+
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(710246);
|
|
63
|
+
/* 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__);
|
|
64
|
+
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(137527);
|
|
65
|
+
/* 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__);
|
|
46
66
|
|
|
47
67
|
|
|
48
68
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
// We inject the nextConfigOutput here so that we can use them in the route
|
|
85
|
+
// module.
|
|
86
|
+
const nextConfigOutput = "standalone"
|
|
87
|
+
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
88
|
+
definition: {
|
|
89
|
+
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
90
|
+
page: "/api/v1/bridges/route",
|
|
91
|
+
pathname: "/api/v1/bridges",
|
|
92
|
+
filename: "route",
|
|
93
|
+
bundlePath: "app/api/v1/bridges/route"
|
|
94
|
+
},
|
|
95
|
+
distDir: ".next" || 0,
|
|
96
|
+
relativeProjectDir: false || '',
|
|
97
|
+
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/bridges/route.ts",
|
|
98
|
+
nextConfigOutput,
|
|
99
|
+
// The lazy require factory ensures that:
|
|
100
|
+
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
101
|
+
// correctly attributing module load time to application-code rather than
|
|
102
|
+
// framework internals.
|
|
103
|
+
// - In all modes: async modules (route files with top-level await) are
|
|
104
|
+
// handled correctly — require() returns a Promise for such modules, which
|
|
105
|
+
// ensureUserland() awaits before the first request is handled.
|
|
106
|
+
userland: ()=>__webpack_require__(165581),
|
|
107
|
+
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
108
|
+
// server HMR updates are picked up without re-executing the entry chunk.
|
|
109
|
+
// Using require() (synchronous) avoids adding async overhead that would be
|
|
110
|
+
// incorrectly attributed to application-code time in devRequestTiming.
|
|
111
|
+
... false ? 0 : {}
|
|
112
|
+
});
|
|
113
|
+
// Pull out the exports that we need to expose from the module. This should
|
|
114
|
+
// be eliminated when we've moved the other routes to the new format. These
|
|
115
|
+
// are used to hook into the route.
|
|
116
|
+
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
117
|
+
function patchFetch() {
|
|
118
|
+
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
119
|
+
workAsyncStorage,
|
|
120
|
+
workUnitAsyncStorage
|
|
121
|
+
});
|
|
56
122
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
* back to the model config's value (or built-in defaults) on null.
|
|
62
|
-
*/ function getAgentTierProportions(row) {
|
|
63
|
-
const raw = row.context_tier_proportions;
|
|
64
|
-
if (!raw) return null;
|
|
65
|
-
try {
|
|
66
|
-
const parsed = JSON.parse(raw);
|
|
67
|
-
const hot = Number(parsed.hot);
|
|
68
|
-
const warm = Number(parsed.warm);
|
|
69
|
-
const facts = Number(parsed.facts);
|
|
70
|
-
if (![
|
|
71
|
-
hot,
|
|
72
|
-
warm,
|
|
73
|
-
facts
|
|
74
|
-
].every((n)=>Number.isFinite(n) && n >= 0)) return null;
|
|
75
|
-
if (hot + warm + facts <= 0) return null;
|
|
76
|
-
return {
|
|
77
|
-
hot,
|
|
78
|
-
warm,
|
|
79
|
-
facts
|
|
80
|
-
};
|
|
81
|
-
} catch {
|
|
82
|
-
return null;
|
|
123
|
+
|
|
124
|
+
async function handler(req, res, ctx) {
|
|
125
|
+
if (ctx.requestMeta) {
|
|
126
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
|
|
83
127
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// Default agent always first; then by the timestamp of each agent's latest message.
|
|
87
|
-
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT a.*
|
|
88
|
-
FROM agent_configs a
|
|
89
|
-
LEFT JOIN (
|
|
90
|
-
SELECT t.agent_id, MAX(m.created_at) AS last_message_at
|
|
91
|
-
FROM threads t
|
|
92
|
-
JOIN messages m ON m.thread_id = t.thread_id
|
|
93
|
-
GROUP BY t.agent_id
|
|
94
|
-
) latest ON latest.agent_id = a.id
|
|
95
|
-
ORDER BY a.is_default DESC, COALESCE(latest.last_message_at, a.created_at) DESC, a.id ASC`).all();
|
|
96
|
-
}
|
|
97
|
-
function getDefaultAgentConfig() {
|
|
98
|
-
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE is_default=1 LIMIT 1").get() ?? null;
|
|
99
|
-
}
|
|
100
|
-
function getAgentConfig(id) {
|
|
101
|
-
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE id=?").get(id) ?? null;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Parse the JSON-encoded delegate whitelist into a deduped string[]. Returns
|
|
105
|
-
* an empty array for NULL, blank, or malformed JSON (delegation is opt-in).
|
|
106
|
-
*/ /**
|
|
107
|
-
* Parse the agent's tool allowlist (`tools` column, stored as a JSON string).
|
|
108
|
-
* Returns an empty array on NULL/blank/malformed JSON — same defensive shape
|
|
109
|
-
* as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
|
|
110
|
-
* inline should switch to this getter so the serialization contract stays
|
|
111
|
-
* owned by this store.
|
|
112
|
-
*/ function getAgentTools(cfg) {
|
|
113
|
-
if (!cfg?.tools) return [];
|
|
114
|
-
try {
|
|
115
|
-
const parsed = JSON.parse(cfg.tools);
|
|
116
|
-
if (!Array.isArray(parsed)) return [];
|
|
117
|
-
return parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
118
|
-
} catch {
|
|
119
|
-
return [];
|
|
128
|
+
if (routeModule.isDev) {
|
|
129
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
|
120
130
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return Array.from(new Set(ids));
|
|
129
|
-
} catch {
|
|
130
|
-
return [];
|
|
131
|
+
let srcPage = "/api/v1/bridges/route";
|
|
132
|
+
// turbopack doesn't normalize `/index` in the page name
|
|
133
|
+
// so we need to to process dynamic routes properly
|
|
134
|
+
// TODO: fix turbopack providing differing value from webpack
|
|
135
|
+
if (false) {} else if (srcPage === '/index') {
|
|
136
|
+
// we always normalize /index specifically
|
|
137
|
+
srcPage = '/';
|
|
131
138
|
}
|
|
139
|
+
const multiZoneDraftMode = false;
|
|
140
|
+
// Registering `instrumentation.ts` usually installs the tracer provider, so
|
|
141
|
+
// do it before starting the request span. The span is started before
|
|
142
|
+
// `prepare`, so route module preparation is part of the request's trace.
|
|
143
|
+
// When this request triggers registration, the lifecycle spans of
|
|
144
|
+
// `instrumentation.ts` are emitted inside the request span.
|
|
145
|
+
const { instrumentation } = await routeModule.ensureInstrumentation(req, {
|
|
146
|
+
deferSpans: true
|
|
147
|
+
});
|
|
148
|
+
return routeModule.traceRequest(req, {
|
|
149
|
+
tracer: (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)(),
|
|
150
|
+
spanName: `${req.method || 'GET'} ${srcPage}`,
|
|
151
|
+
httpTarget: req.url,
|
|
152
|
+
instrumentation
|
|
153
|
+
}, (requestSpan, requestRootSpan)=>handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan));
|
|
132
154
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const out = {};
|
|
144
|
-
for (const [k, v] of Object.entries(parsed)){
|
|
145
|
-
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
146
|
-
}
|
|
147
|
-
return out;
|
|
148
|
-
} catch {
|
|
149
|
-
return {};
|
|
155
|
+
async function handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan) {
|
|
156
|
+
const prepareResult = await routeModule.prepare(req, res, {
|
|
157
|
+
srcPage,
|
|
158
|
+
multiZoneDraftMode
|
|
159
|
+
});
|
|
160
|
+
if (!prepareResult) {
|
|
161
|
+
res.statusCode = 400;
|
|
162
|
+
res.end('Bad Request');
|
|
163
|
+
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
|
164
|
+
return null;
|
|
150
165
|
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const empathy = input.adaptive_empathy ?? existing?.adaptive_empathy ?? _lib_agents_usage_profile__WEBPACK_IMPORTED_MODULE_2__/* .DEFAULT_PERSONA_STYLE */ .vs.empathy;
|
|
163
|
-
const expressiveness = input.adaptive_expressiveness ?? existing?.adaptive_expressiveness ?? _lib_agents_usage_profile__WEBPACK_IMPORTED_MODULE_2__/* .DEFAULT_PERSONA_STYLE */ .vs.expressiveness;
|
|
164
|
-
const verbosity = input.adaptive_verbosity ?? existing?.adaptive_verbosity ?? _lib_agents_usage_profile__WEBPACK_IMPORTED_MODULE_2__/* .DEFAULT_PERSONA_STYLE */ .vs.verbosity;
|
|
165
|
-
if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
|
|
166
|
-
// harness_id: explicit `undefined` means "keep existing"; explicit `null`
|
|
167
|
-
// means "use the global default". Empty string is normalised to null too,
|
|
168
|
-
// matching how the AgentEditor sends "" for the inherit option.
|
|
169
|
-
const harnessId = input.harness_id === undefined ? existing?.harness_id ?? null : input.harness_id && input.harness_id.length > 0 ? input.harness_id : null;
|
|
170
|
-
// delegate_targets: undefined = keep existing; explicit empty array clears.
|
|
171
|
-
const delegateTargets = input.delegate_targets === undefined ? existing?.delegate_targets ?? null : JSON.stringify(Array.from(new Set(input.delegate_targets.filter((id)=>id && id !== input.id))));
|
|
172
|
-
// context_tier_proportions: undefined = keep existing; null = clear and
|
|
173
|
-
// inherit from the model; object = serialise as JSON. Negative values are
|
|
174
|
-
// clamped to 0 so the upsert can't poison the column with bad data.
|
|
175
|
-
const tierProportions = input.context_tier_proportions === undefined ? existing?.context_tier_proportions ?? null : input.context_tier_proportions === null ? null : JSON.stringify({
|
|
176
|
-
hot: Math.max(0, Number(input.context_tier_proportions.hot) || 0),
|
|
177
|
-
warm: Math.max(0, Number(input.context_tier_proportions.warm) || 0),
|
|
178
|
-
facts: Math.max(0, Number(input.context_tier_proportions.facts) || 0)
|
|
179
|
-
});
|
|
180
|
-
// Anti-hallucination override: `undefined` keeps existing; `null` clears
|
|
181
|
-
// the override (inherits env). Empty-string model is normalised to null
|
|
182
|
-
// so the editor can ship "" for the inherit option.
|
|
183
|
-
const antiHallucMode = input.anti_hallucination_mode === undefined ? existing?.anti_hallucination_mode ?? null : input.anti_hallucination_mode === null ? null : input.anti_hallucination_mode === "off" || input.anti_hallucination_mode === "regex" || input.anti_hallucination_mode === "model" ? input.anti_hallucination_mode : null;
|
|
184
|
-
const antiHallucModel = input.anti_hallucination_model_config === undefined ? existing?.anti_hallucination_model_config ?? null : input.anti_hallucination_model_config && input.anti_hallucination_model_config.trim().length > 0 ? input.anti_hallucination_model_config.trim() : null;
|
|
185
|
-
const citationStrictness = input.citation_strictness === undefined ? parseCitationStrictness(existing?.citation_strictness) ?? "off" : parseCitationStrictness(input.citation_strictness) ?? "off";
|
|
186
|
-
const toolCredentials = serialiseToolCredentials(input.tool_credentials, existing?.tool_credentials ?? null);
|
|
187
|
-
const VALID_ROUTER_POLICIES = new Set([
|
|
188
|
-
"cheap",
|
|
189
|
-
"fast",
|
|
190
|
-
"balanced",
|
|
191
|
-
"quality"
|
|
192
|
-
]);
|
|
193
|
-
const routerPolicy = input.router_policy === undefined ? existing?.router_policy ?? null : input.router_policy !== null && VALID_ROUTER_POLICIES.has(input.router_policy) ? input.router_policy : null;
|
|
194
|
-
const routerEnabled = input.router_enabled === undefined ? existing?.router_enabled ?? null : input.router_enabled === null ? null : input.router_enabled ? 1 : 0;
|
|
195
|
-
const VALID_USAGE_STRATEGIES = new Set([
|
|
196
|
-
"cost_saving",
|
|
197
|
-
"fast",
|
|
198
|
-
"balanced",
|
|
199
|
-
"high_reasoning"
|
|
200
|
-
]);
|
|
201
|
-
const usageStrategy = input.usage_strategy === undefined ? existing?.usage_strategy ?? null : input.usage_strategy !== null && VALID_USAGE_STRATEGIES.has(input.usage_strategy) ? input.usage_strategy : null;
|
|
202
|
-
const requestedWarmSummaryLimit = input.warm_summary_limit ?? existing?.warm_summary_limit ?? 50;
|
|
203
|
-
const warmSummaryLimit = Number.isFinite(requestedWarmSummaryLimit) ? Math.max(0, Math.floor(requestedWarmSummaryLimit)) : existing?.warm_summary_limit ?? 50;
|
|
204
|
-
db.prepare(`INSERT OR REPLACE INTO agent_configs
|
|
205
|
-
(id, name, icon, identity, instructions, tools, model_config_name, is_default,
|
|
206
|
-
history_limit, history_window_hours, warm_summary_limit, never_reply,
|
|
207
|
-
hot_turn_limit,
|
|
208
|
-
adaptive_persona_enabled, adaptive_persona_strength, adaptive_empathy, adaptive_expressiveness, adaptive_verbosity, adaptive_mbti,
|
|
209
|
-
voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
|
|
210
|
-
harness_id, delegate_targets, context_tier_proportions,
|
|
211
|
-
anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
|
|
212
|
-
tool_credentials, router_policy, router_enabled, usage_strategy, usage_profile, display_filters,
|
|
213
|
-
created_at, updated_at)
|
|
214
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(input.id, input.name, input.icon ?? null, input.identity, input.instructions, JSON.stringify(input.tools), input.model_config_name ?? null, input.is_default ? 1 : existing?.is_default ?? 0, input.history_limit ?? existing?.history_limit ?? 50, input.history_window_hours ?? existing?.history_window_hours ?? 8, warmSummaryLimit, // never_reply is a boolean toggle — explicit `undefined` means "keep existing"
|
|
215
|
-
// (important for PATCH-style updates that omit the field).
|
|
216
|
-
input.never_reply === undefined ? existing?.never_reply ?? 0 : input.never_reply ? 1 : 0, Math.max(0, Math.floor(input.hot_turn_limit ?? existing?.hot_turn_limit ?? 12)), input.adaptive_persona_enabled === undefined ? existing?.adaptive_persona_enabled ?? 0 : input.adaptive_persona_enabled ? 1 : 0, clampPercent(strength, existing?.adaptive_persona_strength ?? 50), clampPercent(empathy, existing?.adaptive_empathy ?? 50), clampPercent(expressiveness, existing?.adaptive_expressiveness ?? 50), clampPercent(verbosity, existing?.adaptive_verbosity ?? 50), mbti, input.voice_enabled === undefined ? existing?.voice_enabled ?? 0 : input.voice_enabled ? 1 : 0, (input.voice_model ?? existing?.voice_model ?? "gemini-2.5-flash-preview-tts").trim() || "gemini-2.5-flash-preview-tts", (input.voice_name ?? existing?.voice_name ?? "Kore").trim() || "Kore", (input.voice_stt_model ?? existing?.voice_stt_model ?? "gemini-2.5-flash").trim() || "gemini-2.5-flash", input.voice_auto_speak === undefined ? existing?.voice_auto_speak ?? 1 : input.voice_auto_speak ? 1 : 0, harnessId, delegateTargets, tierProportions, antiHallucMode, antiHallucModel, citationStrictness, toolCredentials, routerPolicy, routerEnabled, usageStrategy, input.usage_profile ?? existing?.usage_profile ?? "custom", existing?.display_filters ?? null, created_at, t);
|
|
217
|
-
return getAgentConfig(input.id);
|
|
218
|
-
}
|
|
219
|
-
function clampPercent(next, fallback) {
|
|
220
|
-
const n = Number.isFinite(next) ? Number(next) : fallback;
|
|
221
|
-
return Math.max(0, Math.min(100, Math.round(n)));
|
|
222
|
-
}
|
|
223
|
-
function serialiseToolCredentials(input, existing) {
|
|
224
|
-
if (input === undefined) return existing;
|
|
225
|
-
const cleaned = {};
|
|
226
|
-
for (const [k, v] of Object.entries(input)){
|
|
227
|
-
if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
|
|
228
|
-
cleaned[k] = v;
|
|
166
|
+
const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
|
|
167
|
+
const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
|
|
168
|
+
// Only this route's prerenders can establish ISR or admit generated params.
|
|
169
|
+
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]));
|
|
170
|
+
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
171
|
+
const render404 = async ()=>{
|
|
172
|
+
// TODO: should route-module itself handle rendering the 404
|
|
173
|
+
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
174
|
+
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
175
|
+
} else {
|
|
176
|
+
res.end('This page could not be found');
|
|
229
177
|
}
|
|
230
|
-
|
|
231
|
-
if (Object.keys(cleaned).length === 0) return null;
|
|
232
|
-
return JSON.stringify(cleaned);
|
|
233
|
-
}
|
|
234
|
-
function deleteAgentConfig(id) {
|
|
235
|
-
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM agent_configs WHERE id=?").run(id).changes > 0;
|
|
236
|
-
}
|
|
237
|
-
function generateAgentId(name) {
|
|
238
|
-
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
239
|
-
const suffix = Math.random().toString(36).slice(2, 6);
|
|
240
|
-
return slug ? `${slug}-${suffix}` : `agent-${suffix}`;
|
|
241
|
-
}
|
|
242
|
-
const DUPLICATE_RESET_COLUMNS = new Set([
|
|
243
|
-
"id",
|
|
244
|
-
"name",
|
|
245
|
-
"is_default",
|
|
246
|
-
"created_at",
|
|
247
|
-
"updated_at"
|
|
248
|
-
]);
|
|
249
|
-
/**
|
|
250
|
-
* Copy an agent's full configuration into a new, non-default agent so the
|
|
251
|
-
* user can reuse a tuned setup as a starting point. Columns are discovered
|
|
252
|
-
* from the table so settings added later are copied too. Conversation state
|
|
253
|
-
* (threads, messages) is never copied. Returns null if the source is missing.
|
|
254
|
-
*/ function duplicateAgentConfig(sourceId, name) {
|
|
255
|
-
return (0,_lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__/* .withDbTransaction */ .J)(()=>{
|
|
256
|
-
const source = getAgentConfig(sourceId);
|
|
257
|
-
if (!source) return null;
|
|
258
|
-
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
259
|
-
const newName = name?.trim() || `${source.name} (copy)`;
|
|
260
|
-
let id = generateAgentId(newName);
|
|
261
|
-
// INSERT would fail on a collision, but never silently replace (unlike upsert).
|
|
262
|
-
while(getAgentConfig(id))id = generateAgentId(newName);
|
|
263
|
-
const columns = db.prepare("PRAGMA table_info(agent_configs)").all().map((c)=>c.name).filter((c)=>!DUPLICATE_RESET_COLUMNS.has(c)).map((c)=>`"${c.replace(/"/g, '""')}"`).join(", ");
|
|
264
|
-
const t = now();
|
|
265
|
-
db.prepare(`INSERT INTO agent_configs (id, name, is_default, created_at, updated_at, ${columns})
|
|
266
|
-
SELECT ?, ?, 0, ?, ?, ${columns} FROM agent_configs WHERE id = ?`).run(id, newName, t, t, sourceId);
|
|
267
|
-
return getAgentConfig(id);
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
// ── ADR-0022: per-agent message-channel display filters ─────────────────
|
|
271
|
-
// Canonical channel keys mirrored in `hooks/useMessageFilters.ts`. Kept
|
|
272
|
-
// in sync there by importing this constant — single source of truth.
|
|
273
|
-
const DISPLAY_FILTER_KEYS = [
|
|
274
|
-
"scheduled_task",
|
|
275
|
-
"watcher",
|
|
276
|
-
"bridge",
|
|
277
|
-
"extension",
|
|
278
|
-
"page_capture",
|
|
279
|
-
"synthetic",
|
|
280
|
-
"tool_use",
|
|
281
|
-
"thinking"
|
|
282
|
-
];
|
|
283
|
-
const DISPLAY_FILTER_DEFAULTS = {
|
|
284
|
-
scheduled_task: true,
|
|
285
|
-
watcher: true,
|
|
286
|
-
bridge: true,
|
|
287
|
-
extension: true,
|
|
288
|
-
page_capture: true,
|
|
289
|
-
synthetic: true,
|
|
290
|
-
tool_use: true,
|
|
291
|
-
thinking: true
|
|
292
|
-
};
|
|
293
|
-
function parseDisplayFilters(raw) {
|
|
294
|
-
if (!raw) return {
|
|
295
|
-
...DISPLAY_FILTER_DEFAULTS
|
|
178
|
+
return null;
|
|
296
179
|
};
|
|
297
|
-
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
};
|
|
180
|
+
if (isIsr && !isDraftMode) {
|
|
181
|
+
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
182
|
+
if (prerenderInfo) {
|
|
183
|
+
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
184
|
+
if (nextConfig.adapterPath) {
|
|
185
|
+
return await render404();
|
|
186
|
+
}
|
|
187
|
+
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
308
190
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Merge a partial filter map into the agent's stored prefs. Pass `null` to
|
|
317
|
-
* reset to defaults (clears the column). Safe against concurrent toggles
|
|
318
|
-
* from multiple browser tabs because the merge happens server-side.
|
|
319
|
-
*/ function updateAgentDisplayFilters(id, patch) {
|
|
320
|
-
const row = getAgentConfig(id);
|
|
321
|
-
if (!row) return null;
|
|
322
|
-
if (patch === null) {
|
|
323
|
-
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=NULL, updated_at=? WHERE id=?").run(now(), id);
|
|
324
|
-
return {
|
|
325
|
-
...DISPLAY_FILTER_DEFAULTS
|
|
326
|
-
};
|
|
191
|
+
let cacheKey = null;
|
|
192
|
+
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
193
|
+
cacheKey = resolvedPathname;
|
|
194
|
+
// ensure /index and / is normalized to one key
|
|
195
|
+
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
327
196
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
197
|
+
// Before rendering (which initializes component tree modules), we have to
|
|
198
|
+
// set the reference manifests to our global store so Server Action's
|
|
199
|
+
// encryption util can access to them at the top level of the page module.
|
|
200
|
+
if (serverActionsManifest && clientReferenceManifest) {
|
|
201
|
+
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
202
|
+
page: srcPage,
|
|
203
|
+
clientReferenceManifest,
|
|
204
|
+
serverActionsManifest
|
|
205
|
+
});
|
|
334
206
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
/***/ 79868:
|
|
364
|
-
/***/ ((module) => {
|
|
365
|
-
|
|
366
|
-
module.exports = require("node:sqlite");
|
|
367
|
-
|
|
368
|
-
/***/ }),
|
|
369
|
-
|
|
370
|
-
/***/ 108128:
|
|
371
|
-
/***/ ((module) => {
|
|
372
|
-
|
|
373
|
-
module.exports = require("next/dist/server/runtime-reacts.external.js");
|
|
374
|
-
|
|
375
|
-
/***/ }),
|
|
376
|
-
|
|
377
|
-
/***/ 116602:
|
|
378
|
-
/***/ ((module) => {
|
|
379
|
-
|
|
380
|
-
module.exports = import("@whiskeysockets/baileys");;
|
|
381
|
-
|
|
382
|
-
/***/ }),
|
|
383
|
-
|
|
384
|
-
/***/ 149720:
|
|
385
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
386
|
-
|
|
387
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
388
|
-
/* harmony export */ Ng: () => (/* binding */ USAGE_PROFILE_VALUES),
|
|
389
|
-
/* harmony export */ R3: () => (/* binding */ USAGE_PROFILES),
|
|
390
|
-
/* harmony export */ vs: () => (/* binding */ DEFAULT_PERSONA_STYLE)
|
|
391
|
-
/* harmony export */ });
|
|
392
|
-
const USAGE_PROFILE_VALUES = [
|
|
393
|
-
"home",
|
|
394
|
-
"work",
|
|
395
|
-
"dev",
|
|
396
|
-
"custom"
|
|
397
|
-
];
|
|
398
|
-
const DEFAULT_PERSONA_STYLE = {
|
|
399
|
-
strength: 50,
|
|
400
|
-
empathy: 50,
|
|
401
|
-
expressiveness: 50,
|
|
402
|
-
verbosity: 50
|
|
403
|
-
};
|
|
404
|
-
const USAGE_PROFILES = {
|
|
405
|
-
home: {
|
|
406
|
-
label: "Home",
|
|
407
|
-
hint: "Friendly summaries, chat-first layout, everyday integrations",
|
|
408
|
-
compactChat: true,
|
|
409
|
-
style: {
|
|
410
|
-
strength: 40,
|
|
411
|
-
empathy: 80,
|
|
412
|
-
expressiveness: 65,
|
|
413
|
-
verbosity: 25
|
|
414
|
-
},
|
|
415
|
-
responseInstruction: "Lead with a short useful summary and the next action. Use approachable, plain language. Avoid technical jargon and routine diagnostic narration. Expand after the summary when asked, when troubleshooting needs it, or when risk or complexity requires it.",
|
|
416
|
-
citationStrictness: "standard"
|
|
417
|
-
},
|
|
418
|
-
work: {
|
|
419
|
-
label: "Work",
|
|
420
|
-
hint: "Professional decisions, next steps, balanced detail",
|
|
421
|
-
compactChat: true,
|
|
422
|
-
style: {
|
|
423
|
-
strength: 30,
|
|
424
|
-
empathy: 55,
|
|
425
|
-
expressiveness: 35,
|
|
426
|
-
verbosity: 45
|
|
427
|
-
},
|
|
428
|
-
responseInstruction: "Be professional and outcome-focused. Lead with the decision or result, then action items, owners and deadlines only when known. Separate decisions, assumptions, and open questions. Add rationale and tradeoffs where useful, not a routine execution log.",
|
|
429
|
-
citationStrictness: "standard"
|
|
430
|
-
},
|
|
431
|
-
dev: {
|
|
432
|
-
label: "Developer",
|
|
433
|
-
hint: "Full diagnostics, evidence-backed claims, explicit validation",
|
|
434
|
-
compactChat: false,
|
|
435
|
-
style: {
|
|
436
|
-
strength: 20,
|
|
437
|
-
empathy: 30,
|
|
438
|
-
expressiveness: 20,
|
|
439
|
-
verbosity: 60
|
|
207
|
+
const method = req.method || 'GET';
|
|
208
|
+
const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
|
|
209
|
+
const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
|
|
210
|
+
const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
|
|
211
|
+
const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
|
|
212
|
+
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
213
|
+
globalThis.__incrementalCache = incrementalCache;
|
|
214
|
+
const context = {
|
|
215
|
+
params,
|
|
216
|
+
previewProps,
|
|
217
|
+
renderOpts: {
|
|
218
|
+
experimental: {
|
|
219
|
+
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
220
|
+
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
221
|
+
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
222
|
+
},
|
|
223
|
+
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
224
|
+
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
225
|
+
isDraftMode,
|
|
226
|
+
incrementalCache,
|
|
227
|
+
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
228
|
+
cacheLifeProfiles: nextConfig.cacheLife,
|
|
229
|
+
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
230
|
+
waitUntil: ctx.waitUntil,
|
|
231
|
+
onClose: (cb)=>{
|
|
232
|
+
res.on('close', cb);
|
|
233
|
+
},
|
|
234
|
+
onAfterTaskError: undefined
|
|
440
235
|
},
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
236
|
+
sharedContext: {
|
|
237
|
+
buildId,
|
|
238
|
+
deploymentId
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
242
|
+
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
243
|
+
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));
|
|
244
|
+
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
245
|
+
try {
|
|
246
|
+
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
247
|
+
res.statusCode = 404;
|
|
248
|
+
// on-demand revalidate always sets this header
|
|
249
|
+
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
250
|
+
res.end('This page could not be found');
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
254
|
+
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
255
|
+
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
256
|
+
// Attempt using provided waitUntil if available
|
|
257
|
+
// if it's not we fallback to sendResponse's handling
|
|
258
|
+
if (pendingWaitUntil) {
|
|
259
|
+
if (ctx.waitUntil) {
|
|
260
|
+
ctx.waitUntil(pendingWaitUntil);
|
|
261
|
+
pendingWaitUntil = undefined;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
const cacheTags = context.renderOpts.collectedTags;
|
|
265
|
+
// If the request is for a static response, we can cache it so long
|
|
266
|
+
// as it's not edge.
|
|
267
|
+
if (isIsr) {
|
|
268
|
+
const blob = await response.blob();
|
|
269
|
+
// Copy the headers from the response.
|
|
270
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
271
|
+
if (cacheTags) {
|
|
272
|
+
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
273
|
+
}
|
|
274
|
+
if (!headers['content-type'] && blob.type) {
|
|
275
|
+
headers['content-type'] = blob.type;
|
|
276
|
+
}
|
|
277
|
+
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
278
|
+
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
|
|
279
|
+
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
280
|
+
// build-time fallback in `build/index.ts` so cache entries
|
|
281
|
+
// and the response Cache-Control header agree on the route's
|
|
282
|
+
// effective expire. Routes that opt out of revalidation
|
|
283
|
+
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
284
|
+
// keep `expire: undefined`.
|
|
285
|
+
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
286
|
+
// Create the cache entry for the response.
|
|
287
|
+
const cacheEntry = {
|
|
288
|
+
value: {
|
|
289
|
+
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
290
|
+
status: response.status,
|
|
291
|
+
body: Buffer.from(await blob.arrayBuffer()),
|
|
292
|
+
headers
|
|
293
|
+
},
|
|
294
|
+
cacheControl: {
|
|
295
|
+
revalidate,
|
|
296
|
+
expire
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
return cacheEntry;
|
|
300
|
+
} else {
|
|
301
|
+
// send response without caching if not ISR
|
|
302
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
} catch (err) {
|
|
306
|
+
// if this is a background revalidate we need to report
|
|
307
|
+
// the request error here as it won't be bubbled
|
|
308
|
+
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
309
|
+
const silenceLog = false;
|
|
310
|
+
await routeModule.onRequestError(req, err, {
|
|
311
|
+
routerKind: 'App Router',
|
|
312
|
+
routePath: srcPage,
|
|
313
|
+
routeType: 'route',
|
|
314
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
315
|
+
isStaticGeneration: cacheKey !== null,
|
|
316
|
+
isOnDemandRevalidate
|
|
317
|
+
})
|
|
318
|
+
}, silenceLog, routerServerContext);
|
|
319
|
+
}
|
|
320
|
+
throw err;
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
const handleResponse = async (currentSpan)=>{
|
|
324
|
+
try {
|
|
325
|
+
var _cacheEntry_value;
|
|
326
|
+
const cacheEntry = await routeModule.handleResponse({
|
|
327
|
+
req,
|
|
328
|
+
nextConfig,
|
|
329
|
+
cacheKey,
|
|
330
|
+
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
331
|
+
isFallback: false,
|
|
332
|
+
previewProps,
|
|
333
|
+
prerenderManifest,
|
|
334
|
+
isRoutePPREnabled: false,
|
|
335
|
+
isOnDemandRevalidate,
|
|
336
|
+
revalidateOnlyGenerated,
|
|
337
|
+
responseGenerator,
|
|
338
|
+
waitUntil: ctx.waitUntil,
|
|
339
|
+
isMinimalMode
|
|
340
|
+
});
|
|
341
|
+
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
342
|
+
throw cacheEntry.error;
|
|
343
|
+
}
|
|
344
|
+
// we don't create a cacheEntry for ISR
|
|
345
|
+
if (!isIsr) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
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) {
|
|
349
|
+
var _cacheEntry_value1;
|
|
350
|
+
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
351
|
+
}
|
|
352
|
+
if (!isMinimalMode) {
|
|
353
|
+
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
354
|
+
}
|
|
355
|
+
// Draft mode should never be cached
|
|
356
|
+
if (isDraftMode) {
|
|
357
|
+
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
358
|
+
}
|
|
359
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
360
|
+
if (!(isMinimalMode && isIsr)) {
|
|
361
|
+
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
362
|
+
}
|
|
363
|
+
// If cache control is already set on the response we don't
|
|
364
|
+
// override it to allow users to customize it via next.config
|
|
365
|
+
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
366
|
+
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
367
|
+
}
|
|
368
|
+
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'.
|
|
369
|
+
new Response(cacheEntry.value.body, {
|
|
370
|
+
headers,
|
|
371
|
+
status: cacheEntry.value.status || 200
|
|
372
|
+
}));
|
|
373
|
+
return;
|
|
374
|
+
} catch (err) {
|
|
375
|
+
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
376
|
+
const silenceLog = false;
|
|
377
|
+
await routeModule.onRequestError(req, err, {
|
|
378
|
+
routerKind: 'App Router',
|
|
379
|
+
routePath: normalizedSrcPage,
|
|
380
|
+
routeType: 'route',
|
|
381
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
382
|
+
isStaticGeneration: cacheKey !== null,
|
|
383
|
+
isOnDemandRevalidate
|
|
384
|
+
})
|
|
385
|
+
}, silenceLog, routerServerContext);
|
|
386
|
+
}
|
|
387
|
+
// rethrow so that we can handle serving error page
|
|
388
|
+
// If this is during static generation, throw the error again.
|
|
389
|
+
if (isIsr) throw err;
|
|
390
|
+
// Otherwise, send a 500 response unless the original response has
|
|
391
|
+
// already committed. In that case, preserve its status code for
|
|
392
|
+
// telemetry while still recording the failure and terminating a response
|
|
393
|
+
// that the failed pipeline left open.
|
|
394
|
+
if (res.headersSent) {
|
|
395
|
+
if (currentSpan) {
|
|
396
|
+
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
397
|
+
currentSpan.recordException(error);
|
|
398
|
+
currentSpan.setStatus({
|
|
399
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
400
|
+
message: error.message
|
|
401
|
+
});
|
|
402
|
+
currentSpan.setAttribute('error.type', error.name);
|
|
403
|
+
}
|
|
404
|
+
if (!res.writableEnded && !res.destroyed) {
|
|
405
|
+
res.end();
|
|
406
|
+
}
|
|
407
|
+
} else {
|
|
408
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
409
|
+
status: 500
|
|
410
|
+
}));
|
|
411
|
+
}
|
|
412
|
+
return;
|
|
413
|
+
} finally{
|
|
414
|
+
;
|
|
415
|
+
(()=>{
|
|
416
|
+
if (!currentSpan) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
let statusCode = res.statusCode;
|
|
420
|
+
currentSpan.setAttributes({
|
|
421
|
+
'http.status_code': statusCode,
|
|
422
|
+
'next.rsc': false
|
|
423
|
+
});
|
|
424
|
+
if (statusCode && statusCode >= 500) {
|
|
425
|
+
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
426
|
+
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
427
|
+
currentSpan.setStatus({
|
|
428
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
429
|
+
});
|
|
430
|
+
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
431
|
+
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
432
|
+
}
|
|
433
|
+
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
434
|
+
// We were unable to get attributes, probably OTEL is not enabled
|
|
435
|
+
if (!rootSpanAttributes) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
439
|
+
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
443
|
+
const name = `${method} ${route}`;
|
|
444
|
+
currentSpan.setAttributes({
|
|
445
|
+
'next.route': route,
|
|
446
|
+
'http.route': route,
|
|
447
|
+
'next.span_name': name
|
|
448
|
+
});
|
|
449
|
+
currentSpan.updateName(name);
|
|
450
|
+
// Propagate http.route to the request's root span if it isn't the
|
|
451
|
+
// request span (e.g. a platform-created HTTP span in adapter
|
|
452
|
+
// deployments).
|
|
453
|
+
if (requestRootSpan && requestRootSpan !== currentSpan) {
|
|
454
|
+
requestRootSpan.setAttribute('http.route', route);
|
|
455
|
+
requestRootSpan.updateName(name);
|
|
456
|
+
}
|
|
457
|
+
})();
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
// When invoked directly, the request span was started before `prepare`;
|
|
461
|
+
// record the request target as normalized by it. next-server's request span
|
|
462
|
+
// already has it.
|
|
463
|
+
if (!isWrappedByNextServer && req.url !== undefined) {
|
|
464
|
+
requestSpan == null ? void 0 : requestSpan.setAttribute('http.target', req.url);
|
|
451
465
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
/***/ }),
|
|
466
|
+
await handleResponse(requestSpan);
|
|
467
|
+
}
|
|
456
468
|
|
|
457
|
-
|
|
458
|
-
/***/ ((module) => {
|
|
469
|
+
//# sourceMappingURL=app-route.js.map
|
|
459
470
|
|
|
460
|
-
module.exports = require("node:stream");
|
|
461
471
|
|
|
462
472
|
/***/ }),
|
|
463
473
|
|
|
464
|
-
/***/
|
|
474
|
+
/***/ 41720:
|
|
465
475
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
466
476
|
|
|
467
|
-
__webpack_require__.r(__webpack_exports__);
|
|
468
477
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
469
|
-
/* harmony export */
|
|
470
|
-
/* harmony export */
|
|
478
|
+
/* harmony export */ BM: () => (/* binding */ upsertAgentConfig),
|
|
479
|
+
/* harmony export */ E1: () => (/* binding */ updateAgentDisplayFilters),
|
|
480
|
+
/* harmony export */ P2: () => (/* binding */ parseCitationStrictness),
|
|
481
|
+
/* harmony export */ S2: () => (/* binding */ getAgentToolCredentials),
|
|
482
|
+
/* harmony export */ SJ: () => (/* binding */ generateAgentId),
|
|
483
|
+
/* harmony export */ TG: () => (/* binding */ getAgentTools),
|
|
484
|
+
/* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
|
|
485
|
+
/* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
|
|
486
|
+
/* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
|
|
487
|
+
/* harmony export */ mJ: () => (/* binding */ getAgentConfig),
|
|
488
|
+
/* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
|
|
489
|
+
/* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
|
|
490
|
+
/* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
|
|
491
|
+
/* harmony export */ vv: () => (/* binding */ duplicateAgentConfig),
|
|
492
|
+
/* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
|
|
493
|
+
/* harmony export */ zb: () => (/* binding */ listAgentConfigs)
|
|
471
494
|
/* harmony export */ });
|
|
472
|
-
/* harmony import */ var
|
|
473
|
-
/* harmony import */ var
|
|
474
|
-
/* harmony import */ var
|
|
475
|
-
/* harmony import */ var _lib_api_serializers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(685678);
|
|
476
|
-
/* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(739947);
|
|
477
|
-
/* harmony import */ var _lib_bridges_registry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(870309);
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
495
|
+
/* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(251244);
|
|
496
|
+
/* harmony import */ var _lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(999043);
|
|
497
|
+
/* harmony import */ var _lib_agents_usage_profile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(149720);
|
|
481
498
|
|
|
482
499
|
|
|
483
500
|
|
|
484
|
-
|
|
485
|
-
|
|
501
|
+
const now = ()=>new Date().toISOString();
|
|
502
|
+
/** Coerce arbitrary input (DB row TEXT, API body, undefined) to the enum.
|
|
503
|
+
* Returns `null` for null/undefined/unknown values so callers can default. */ function parseCitationStrictness(value) {
|
|
504
|
+
if (value === "off" || value === "informational" || value === "standard" || value === "strict") {
|
|
505
|
+
return value;
|
|
506
|
+
}
|
|
507
|
+
return null;
|
|
486
508
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
509
|
+
/**
|
|
510
|
+
* Parse the JSON-encoded per-agent override of context tier proportions.
|
|
511
|
+
* Returns `null` for NULL, blank, malformed JSON, or any payload that
|
|
512
|
+
* doesn't have three finite non-negative numeric fields. Callers fall
|
|
513
|
+
* back to the model config's value (or built-in defaults) on null.
|
|
514
|
+
*/ function getAgentTierProportions(row) {
|
|
515
|
+
const raw = row.context_tier_proportions;
|
|
516
|
+
if (!raw) return null;
|
|
517
|
+
try {
|
|
518
|
+
const parsed = JSON.parse(raw);
|
|
519
|
+
const hot = Number(parsed.hot);
|
|
520
|
+
const warm = Number(parsed.warm);
|
|
521
|
+
const facts = Number(parsed.facts);
|
|
522
|
+
if (![
|
|
523
|
+
hot,
|
|
524
|
+
warm,
|
|
525
|
+
facts
|
|
526
|
+
].every((n)=>Number.isFinite(n) && n >= 0)) return null;
|
|
527
|
+
if (hot + warm + facts <= 0) return null;
|
|
528
|
+
return {
|
|
529
|
+
hot,
|
|
530
|
+
warm,
|
|
531
|
+
facts
|
|
532
|
+
};
|
|
533
|
+
} catch {
|
|
534
|
+
return null;
|
|
535
|
+
}
|
|
496
536
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
function
|
|
537
|
+
function listAgentConfigs() {
|
|
538
|
+
// Default agent always first; then by the timestamp of each agent's latest message.
|
|
539
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT a.*
|
|
540
|
+
FROM agent_configs a
|
|
541
|
+
LEFT JOIN (
|
|
542
|
+
SELECT t.agent_id, MAX(m.created_at) AS last_message_at
|
|
543
|
+
FROM threads t
|
|
544
|
+
JOIN messages m ON m.thread_id = t.thread_id
|
|
545
|
+
GROUP BY t.agent_id
|
|
546
|
+
) latest ON latest.agent_id = a.id
|
|
547
|
+
ORDER BY a.is_default DESC, COALESCE(latest.last_message_at, a.created_at) DESC, a.id ASC`).all();
|
|
548
|
+
}
|
|
549
|
+
function getDefaultAgentConfig() {
|
|
550
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE is_default=1 LIMIT 1").get() ?? null;
|
|
551
|
+
}
|
|
552
|
+
function getAgentConfig(id) {
|
|
553
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE id=?").get(id) ?? null;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Parse the JSON-encoded delegate whitelist into a deduped string[]. Returns
|
|
557
|
+
* an empty array for NULL, blank, or malformed JSON (delegation is opt-in).
|
|
558
|
+
*/ /**
|
|
559
|
+
* Parse the agent's tool allowlist (`tools` column, stored as a JSON string).
|
|
560
|
+
* Returns an empty array on NULL/blank/malformed JSON — same defensive shape
|
|
561
|
+
* as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
|
|
562
|
+
* inline should switch to this getter so the serialization contract stays
|
|
563
|
+
* owned by this store.
|
|
564
|
+
*/ function getAgentTools(cfg) {
|
|
565
|
+
if (!cfg?.tools) return [];
|
|
566
|
+
try {
|
|
567
|
+
const parsed = JSON.parse(cfg.tools);
|
|
568
|
+
if (!Array.isArray(parsed)) return [];
|
|
569
|
+
return parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
570
|
+
} catch {
|
|
571
|
+
return [];
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
function parseDelegateTargets(raw) {
|
|
575
|
+
if (!raw) return [];
|
|
576
|
+
try {
|
|
577
|
+
const parsed = JSON.parse(raw);
|
|
578
|
+
if (!Array.isArray(parsed)) return [];
|
|
579
|
+
const ids = parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
580
|
+
return Array.from(new Set(ids));
|
|
581
|
+
} catch {
|
|
582
|
+
return [];
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Parse the per-agent `{ toolName: credentialId }` override map stored in
|
|
587
|
+
* the `tool_credentials` column. Returns an empty record on NULL / blank /
|
|
588
|
+
* malformed JSON / non-string entries so downstream code can treat the
|
|
589
|
+
* result as a plain lookup without further validation.
|
|
590
|
+
*/ function getAgentToolCredentials(cfg) {
|
|
591
|
+
if (!cfg?.tool_credentials) return {};
|
|
525
592
|
try {
|
|
526
|
-
|
|
593
|
+
const parsed = JSON.parse(cfg.tool_credentials);
|
|
594
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
595
|
+
const out = {};
|
|
596
|
+
for (const [k, v] of Object.entries(parsed)){
|
|
597
|
+
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
598
|
+
}
|
|
599
|
+
return out;
|
|
527
600
|
} catch {
|
|
528
|
-
return
|
|
601
|
+
return {};
|
|
529
602
|
}
|
|
530
603
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
/*
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
"
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
604
|
+
function upsertAgentConfig(input) {
|
|
605
|
+
return (0,_lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__/* .withDbTransaction */ .J)(()=>upsertAgentConfigTransaction(input));
|
|
606
|
+
}
|
|
607
|
+
function upsertAgentConfigTransaction(input) {
|
|
608
|
+
const t = now();
|
|
609
|
+
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
610
|
+
const existing = getAgentConfig(input.id);
|
|
611
|
+
const created_at = existing?.created_at ?? t;
|
|
612
|
+
const mbti = input.adaptive_mbti ?? existing?.adaptive_mbti ?? "INTJ";
|
|
613
|
+
const strength = input.adaptive_persona_strength ?? existing?.adaptive_persona_strength ?? _lib_agents_usage_profile__WEBPACK_IMPORTED_MODULE_2__/* .DEFAULT_PERSONA_STYLE */ .vs.strength;
|
|
614
|
+
const empathy = input.adaptive_empathy ?? existing?.adaptive_empathy ?? _lib_agents_usage_profile__WEBPACK_IMPORTED_MODULE_2__/* .DEFAULT_PERSONA_STYLE */ .vs.empathy;
|
|
615
|
+
const expressiveness = input.adaptive_expressiveness ?? existing?.adaptive_expressiveness ?? _lib_agents_usage_profile__WEBPACK_IMPORTED_MODULE_2__/* .DEFAULT_PERSONA_STYLE */ .vs.expressiveness;
|
|
616
|
+
const verbosity = input.adaptive_verbosity ?? existing?.adaptive_verbosity ?? _lib_agents_usage_profile__WEBPACK_IMPORTED_MODULE_2__/* .DEFAULT_PERSONA_STYLE */ .vs.verbosity;
|
|
617
|
+
if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
|
|
618
|
+
// harness_id: explicit `undefined` means "keep existing"; explicit `null`
|
|
619
|
+
// means "use the global default". Empty string is normalised to null too,
|
|
620
|
+
// matching how the AgentEditor sends "" for the inherit option.
|
|
621
|
+
const harnessId = input.harness_id === undefined ? existing?.harness_id ?? null : input.harness_id && input.harness_id.length > 0 ? input.harness_id : null;
|
|
622
|
+
// delegate_targets: undefined = keep existing; explicit empty array clears.
|
|
623
|
+
const delegateTargets = input.delegate_targets === undefined ? existing?.delegate_targets ?? null : JSON.stringify(Array.from(new Set(input.delegate_targets.filter((id)=>id && id !== input.id))));
|
|
624
|
+
// context_tier_proportions: undefined = keep existing; null = clear and
|
|
625
|
+
// inherit from the model; object = serialise as JSON. Negative values are
|
|
626
|
+
// clamped to 0 so the upsert can't poison the column with bad data.
|
|
627
|
+
const tierProportions = input.context_tier_proportions === undefined ? existing?.context_tier_proportions ?? null : input.context_tier_proportions === null ? null : JSON.stringify({
|
|
628
|
+
hot: Math.max(0, Number(input.context_tier_proportions.hot) || 0),
|
|
629
|
+
warm: Math.max(0, Number(input.context_tier_proportions.warm) || 0),
|
|
630
|
+
facts: Math.max(0, Number(input.context_tier_proportions.facts) || 0)
|
|
631
|
+
});
|
|
632
|
+
// Anti-hallucination override: `undefined` keeps existing; `null` clears
|
|
633
|
+
// the override (inherits env). Empty-string model is normalised to null
|
|
634
|
+
// so the editor can ship "" for the inherit option.
|
|
635
|
+
const antiHallucMode = input.anti_hallucination_mode === undefined ? existing?.anti_hallucination_mode ?? null : input.anti_hallucination_mode === null ? null : input.anti_hallucination_mode === "off" || input.anti_hallucination_mode === "regex" || input.anti_hallucination_mode === "model" ? input.anti_hallucination_mode : null;
|
|
636
|
+
const antiHallucModel = input.anti_hallucination_model_config === undefined ? existing?.anti_hallucination_model_config ?? null : input.anti_hallucination_model_config && input.anti_hallucination_model_config.trim().length > 0 ? input.anti_hallucination_model_config.trim() : null;
|
|
637
|
+
const citationStrictness = input.citation_strictness === undefined ? parseCitationStrictness(existing?.citation_strictness) ?? "off" : parseCitationStrictness(input.citation_strictness) ?? "off";
|
|
638
|
+
const toolCredentials = serialiseToolCredentials(input.tool_credentials, existing?.tool_credentials ?? null);
|
|
639
|
+
const VALID_ROUTER_POLICIES = new Set([
|
|
640
|
+
"cheap",
|
|
641
|
+
"fast",
|
|
642
|
+
"balanced",
|
|
643
|
+
"quality"
|
|
644
|
+
]);
|
|
645
|
+
const routerPolicy = input.router_policy === undefined ? existing?.router_policy ?? null : input.router_policy !== null && VALID_ROUTER_POLICIES.has(input.router_policy) ? input.router_policy : null;
|
|
646
|
+
const routerEnabled = input.router_enabled === undefined ? existing?.router_enabled ?? null : input.router_enabled === null ? null : input.router_enabled ? 1 : 0;
|
|
647
|
+
const VALID_USAGE_STRATEGIES = new Set([
|
|
648
|
+
"cost_saving",
|
|
649
|
+
"fast",
|
|
650
|
+
"balanced",
|
|
651
|
+
"high_reasoning"
|
|
652
|
+
]);
|
|
653
|
+
const usageStrategy = input.usage_strategy === undefined ? existing?.usage_strategy ?? null : input.usage_strategy !== null && VALID_USAGE_STRATEGIES.has(input.usage_strategy) ? input.usage_strategy : null;
|
|
654
|
+
const requestedWarmSummaryLimit = input.warm_summary_limit ?? existing?.warm_summary_limit ?? 50;
|
|
655
|
+
const warmSummaryLimit = Number.isFinite(requestedWarmSummaryLimit) ? Math.max(0, Math.floor(requestedWarmSummaryLimit)) : existing?.warm_summary_limit ?? 50;
|
|
656
|
+
db.prepare(`INSERT OR REPLACE INTO agent_configs
|
|
657
|
+
(id, name, icon, identity, instructions, tools, model_config_name, is_default,
|
|
658
|
+
history_limit, history_window_hours, warm_summary_limit, never_reply,
|
|
659
|
+
hot_turn_limit,
|
|
660
|
+
adaptive_persona_enabled, adaptive_persona_strength, adaptive_empathy, adaptive_expressiveness, adaptive_verbosity, adaptive_mbti,
|
|
661
|
+
voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
|
|
662
|
+
harness_id, delegate_targets, context_tier_proportions,
|
|
663
|
+
anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
|
|
664
|
+
tool_credentials, router_policy, router_enabled, usage_strategy, usage_profile, display_filters,
|
|
665
|
+
created_at, updated_at)
|
|
666
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(input.id, input.name, input.icon ?? null, input.identity, input.instructions, JSON.stringify(input.tools), input.model_config_name ?? null, input.is_default ? 1 : existing?.is_default ?? 0, input.history_limit ?? existing?.history_limit ?? 50, input.history_window_hours ?? existing?.history_window_hours ?? 8, warmSummaryLimit, // never_reply is a boolean toggle — explicit `undefined` means "keep existing"
|
|
667
|
+
// (important for PATCH-style updates that omit the field).
|
|
668
|
+
input.never_reply === undefined ? existing?.never_reply ?? 0 : input.never_reply ? 1 : 0, Math.max(0, Math.floor(input.hot_turn_limit ?? existing?.hot_turn_limit ?? 12)), input.adaptive_persona_enabled === undefined ? existing?.adaptive_persona_enabled ?? 0 : input.adaptive_persona_enabled ? 1 : 0, clampPercent(strength, existing?.adaptive_persona_strength ?? 50), clampPercent(empathy, existing?.adaptive_empathy ?? 50), clampPercent(expressiveness, existing?.adaptive_expressiveness ?? 50), clampPercent(verbosity, existing?.adaptive_verbosity ?? 50), mbti, input.voice_enabled === undefined ? existing?.voice_enabled ?? 0 : input.voice_enabled ? 1 : 0, (input.voice_model ?? existing?.voice_model ?? "gemini-2.5-flash-preview-tts").trim() || "gemini-2.5-flash-preview-tts", (input.voice_name ?? existing?.voice_name ?? "Kore").trim() || "Kore", (input.voice_stt_model ?? existing?.voice_stt_model ?? "gemini-2.5-flash").trim() || "gemini-2.5-flash", input.voice_auto_speak === undefined ? existing?.voice_auto_speak ?? 1 : input.voice_auto_speak ? 1 : 0, harnessId, delegateTargets, tierProportions, antiHallucMode, antiHallucModel, citationStrictness, toolCredentials, routerPolicy, routerEnabled, usageStrategy, input.usage_profile ?? existing?.usage_profile ?? "custom", existing?.display_filters ?? null, created_at, t);
|
|
669
|
+
return getAgentConfig(input.id);
|
|
670
|
+
}
|
|
671
|
+
function clampPercent(next, fallback) {
|
|
672
|
+
const n = Number.isFinite(next) ? Number(next) : fallback;
|
|
673
|
+
return Math.max(0, Math.min(100, Math.round(n)));
|
|
674
|
+
}
|
|
675
|
+
function serialiseToolCredentials(input, existing) {
|
|
676
|
+
if (input === undefined) return existing;
|
|
677
|
+
const cleaned = {};
|
|
678
|
+
for (const [k, v] of Object.entries(input)){
|
|
679
|
+
if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
|
|
680
|
+
cleaned[k] = v;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
if (Object.keys(cleaned).length === 0) return null;
|
|
684
|
+
return JSON.stringify(cleaned);
|
|
685
|
+
}
|
|
686
|
+
function deleteAgentConfig(id) {
|
|
687
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM agent_configs WHERE id=?").run(id).changes > 0;
|
|
688
|
+
}
|
|
689
|
+
function generateAgentId(name) {
|
|
690
|
+
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
691
|
+
const suffix = Math.random().toString(36).slice(2, 6);
|
|
692
|
+
return slug ? `${slug}-${suffix}` : `agent-${suffix}`;
|
|
693
|
+
}
|
|
694
|
+
const DUPLICATE_RESET_COLUMNS = new Set([
|
|
695
|
+
"id",
|
|
696
|
+
"name",
|
|
697
|
+
"is_default",
|
|
698
|
+
"created_at",
|
|
699
|
+
"updated_at"
|
|
700
|
+
]);
|
|
701
|
+
/**
|
|
702
|
+
* Copy an agent's full configuration into a new, non-default agent so the
|
|
703
|
+
* user can reuse a tuned setup as a starting point. Columns are discovered
|
|
704
|
+
* from the table so settings added later are copied too. Conversation state
|
|
705
|
+
* (threads, messages) is never copied. Returns null if the source is missing.
|
|
706
|
+
*/ function duplicateAgentConfig(sourceId, name) {
|
|
707
|
+
return (0,_lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__/* .withDbTransaction */ .J)(()=>{
|
|
708
|
+
const source = getAgentConfig(sourceId);
|
|
709
|
+
if (!source) return null;
|
|
710
|
+
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
711
|
+
const newName = name?.trim() || `${source.name} (copy)`;
|
|
712
|
+
let id = generateAgentId(newName);
|
|
713
|
+
// INSERT would fail on a collision, but never silently replace (unlike upsert).
|
|
714
|
+
while(getAgentConfig(id))id = generateAgentId(newName);
|
|
715
|
+
const columns = db.prepare("PRAGMA table_info(agent_configs)").all().map((c)=>c.name).filter((c)=>!DUPLICATE_RESET_COLUMNS.has(c)).map((c)=>`"${c.replace(/"/g, '""')}"`).join(", ");
|
|
716
|
+
const t = now();
|
|
717
|
+
db.prepare(`INSERT INTO agent_configs (id, name, is_default, created_at, updated_at, ${columns})
|
|
718
|
+
SELECT ?, ?, 0, ?, ?, ${columns} FROM agent_configs WHERE id = ?`).run(id, newName, t, t, sourceId);
|
|
719
|
+
return getAgentConfig(id);
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
// ── ADR-0022: per-agent message-channel display filters ─────────────────
|
|
723
|
+
// Canonical channel keys mirrored in `hooks/useMessageFilters.ts`. Kept
|
|
724
|
+
// in sync there by importing this constant — single source of truth.
|
|
725
|
+
const DISPLAY_FILTER_KEYS = [
|
|
726
|
+
"scheduled_task",
|
|
727
|
+
"watcher",
|
|
728
|
+
"bridge",
|
|
729
|
+
"extension",
|
|
730
|
+
"page_capture",
|
|
731
|
+
"synthetic",
|
|
732
|
+
"tool_use",
|
|
733
|
+
"thinking"
|
|
621
734
|
];
|
|
622
|
-
const
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
735
|
+
const DISPLAY_FILTER_DEFAULTS = {
|
|
736
|
+
scheduled_task: true,
|
|
737
|
+
watcher: true,
|
|
738
|
+
bridge: true,
|
|
739
|
+
extension: true,
|
|
740
|
+
page_capture: true,
|
|
741
|
+
synthetic: true,
|
|
742
|
+
tool_use: true,
|
|
743
|
+
thinking: true
|
|
744
|
+
};
|
|
745
|
+
function parseDisplayFilters(raw) {
|
|
746
|
+
if (!raw) return {
|
|
747
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
748
|
+
};
|
|
749
|
+
try {
|
|
750
|
+
const parsed = JSON.parse(raw);
|
|
751
|
+
// Merge over defaults so newly-added channels stay visible on old rows.
|
|
752
|
+
return {
|
|
753
|
+
...DISPLAY_FILTER_DEFAULTS,
|
|
754
|
+
...parsed
|
|
755
|
+
};
|
|
756
|
+
} catch {
|
|
757
|
+
return {
|
|
758
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
759
|
+
};
|
|
760
|
+
}
|
|
627
761
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
self_config: {
|
|
646
|
-
title: "Self-configuration proposals",
|
|
647
|
-
hint: "Lets the agent propose config changes (install MCP, edit agent, set keys) for user approval."
|
|
762
|
+
function getAgentDisplayFilters(id) {
|
|
763
|
+
const row = getAgentConfig(id);
|
|
764
|
+
if (!row) return null;
|
|
765
|
+
return parseDisplayFilters(row.display_filters);
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Merge a partial filter map into the agent's stored prefs. Pass `null` to
|
|
769
|
+
* reset to defaults (clears the column). Safe against concurrent toggles
|
|
770
|
+
* from multiple browser tabs because the merge happens server-side.
|
|
771
|
+
*/ function updateAgentDisplayFilters(id, patch) {
|
|
772
|
+
const row = getAgentConfig(id);
|
|
773
|
+
if (!row) return null;
|
|
774
|
+
if (patch === null) {
|
|
775
|
+
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=NULL, updated_at=? WHERE id=?").run(now(), id);
|
|
776
|
+
return {
|
|
777
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
778
|
+
};
|
|
648
779
|
}
|
|
649
|
-
|
|
780
|
+
const current = parseDisplayFilters(row.display_filters);
|
|
781
|
+
const next = {
|
|
782
|
+
...current
|
|
783
|
+
};
|
|
784
|
+
for (const k of DISPLAY_FILTER_KEYS){
|
|
785
|
+
if (k in patch && typeof patch[k] === "boolean") next[k] = patch[k];
|
|
786
|
+
}
|
|
787
|
+
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=?, updated_at=? WHERE id=?").run(JSON.stringify(next), now(), id);
|
|
788
|
+
return next;
|
|
789
|
+
}
|
|
650
790
|
|
|
651
791
|
|
|
652
792
|
/***/ }),
|
|
653
793
|
|
|
654
|
-
/***/
|
|
655
|
-
/***/ ((
|
|
656
|
-
|
|
657
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
658
|
-
/* harmony export */ u_: () => (/* binding */ DEFAULT_HOT_TURN_LIMIT)
|
|
659
|
-
/* harmony export */ });
|
|
660
|
-
/* harmony import */ var _lib_agents_harness_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(489793);
|
|
661
|
-
const DEFAULT_HOT_TURN_LIMIT = 12;
|
|
662
|
-
|
|
794
|
+
/***/ 51455:
|
|
795
|
+
/***/ ((module) => {
|
|
663
796
|
|
|
797
|
+
module.exports = require("node:fs/promises");
|
|
664
798
|
|
|
665
799
|
/***/ }),
|
|
666
800
|
|
|
667
|
-
/***/
|
|
801
|
+
/***/ 55591:
|
|
668
802
|
/***/ ((module) => {
|
|
669
803
|
|
|
670
|
-
module.exports = require("
|
|
804
|
+
module.exports = require("https");
|
|
671
805
|
|
|
672
806
|
/***/ }),
|
|
673
807
|
|
|
674
|
-
/***/
|
|
808
|
+
/***/ 74075:
|
|
675
809
|
/***/ ((module) => {
|
|
676
810
|
|
|
677
|
-
module.exports = require("
|
|
811
|
+
module.exports = require("zlib");
|
|
678
812
|
|
|
679
813
|
/***/ }),
|
|
680
814
|
|
|
681
|
-
/***/
|
|
815
|
+
/***/ 79868:
|
|
682
816
|
/***/ ((module) => {
|
|
683
817
|
|
|
684
|
-
module.exports = require("
|
|
818
|
+
module.exports = require("node:sqlite");
|
|
685
819
|
|
|
686
820
|
/***/ }),
|
|
687
821
|
|
|
688
|
-
/***/
|
|
822
|
+
/***/ 108128:
|
|
689
823
|
/***/ ((module) => {
|
|
690
824
|
|
|
691
|
-
module.exports = require("
|
|
825
|
+
module.exports = require("next/dist/server/runtime-reacts.external.js");
|
|
692
826
|
|
|
693
827
|
/***/ }),
|
|
694
828
|
|
|
695
|
-
/***/
|
|
829
|
+
/***/ 116602:
|
|
696
830
|
/***/ ((module) => {
|
|
697
831
|
|
|
698
|
-
module.exports =
|
|
832
|
+
module.exports = import("@whiskeysockets/baileys");;
|
|
699
833
|
|
|
700
834
|
/***/ }),
|
|
701
835
|
|
|
702
|
-
/***/
|
|
836
|
+
/***/ 149720:
|
|
703
837
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
704
838
|
|
|
705
839
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
706
|
-
/* harmony export */
|
|
707
|
-
/* harmony export */
|
|
708
|
-
/* harmony export */
|
|
709
|
-
/* harmony export */ mX: () => (/* binding */ messageToResponse),
|
|
710
|
-
/* harmony export */ sU: () => (/* binding */ mcpServerToResponse)
|
|
840
|
+
/* harmony export */ Ng: () => (/* binding */ USAGE_PROFILE_VALUES),
|
|
841
|
+
/* harmony export */ R3: () => (/* binding */ USAGE_PROFILES),
|
|
842
|
+
/* harmony export */ vs: () => (/* binding */ DEFAULT_PERSONA_STYLE)
|
|
711
843
|
/* harmony export */ });
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
enabled: r.enabled === 1,
|
|
772
|
-
event_subscriptions: {
|
|
773
|
-
group_profile_updates: r.forward_group_profile_updates === 1,
|
|
774
|
-
group_participants_updates: r.forward_group_participants_updates === 1
|
|
775
|
-
},
|
|
776
|
-
created_at: r.created_at,
|
|
777
|
-
updated_at: r.updated_at
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
|
-
function mcpServerToResponse(r) {
|
|
781
|
-
return {
|
|
782
|
-
name: r.name,
|
|
783
|
-
transport: r.transport,
|
|
784
|
-
spec: (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_2__/* .parseJsonSafe */ .p)(r.spec, null),
|
|
785
|
-
enabled: r.enabled === 1,
|
|
786
|
-
last_error: r.last_error,
|
|
787
|
-
created_at: r.created_at,
|
|
788
|
-
updated_at: r.updated_at
|
|
789
|
-
};
|
|
790
|
-
}
|
|
791
|
-
/**
|
|
792
|
-
* Shape a `message_usage` row into the over-the-wire `usage` object the
|
|
793
|
-
* chat panel's `ContextUsageBar` consumes. Returns `null` for messages
|
|
794
|
-
* that have no snapshot (user turns and legacy assistant rows recorded
|
|
795
|
-
* before the per-turn snapshot landed in ADR-0041).
|
|
796
|
-
*
|
|
797
|
-
* Anthropic prompt-cache tokens (PR #181 + the cache-fidelity follow-up)
|
|
798
|
-
* are surfaced as additive fields so future UI work can render a
|
|
799
|
-
* "served from cache" badge without another wire change. Both are
|
|
800
|
-
* `null` for rows that predate cache plumbing or for providers that
|
|
801
|
-
* don't expose a cache breakdown.
|
|
802
|
-
*/ function messageUsageToResponse(u) {
|
|
803
|
-
if (!u) return null;
|
|
804
|
-
return {
|
|
805
|
-
input_tokens: u.input_tokens,
|
|
806
|
-
output_tokens: u.output_tokens,
|
|
807
|
-
hot_tokens: u.hot_tokens,
|
|
808
|
-
warm_tokens: u.warm_tokens,
|
|
809
|
-
facts_tokens: u.facts_tokens,
|
|
810
|
-
overhead_tokens: u.overhead_tokens,
|
|
811
|
-
hot_budget_tokens: u.hot_budget_tokens,
|
|
812
|
-
warm_budget_tokens: u.warm_budget_tokens,
|
|
813
|
-
facts_budget_tokens: u.facts_budget_tokens,
|
|
814
|
-
context_window_tokens: u.context_window_tokens,
|
|
815
|
-
cache_creation_input_tokens: u.cache_creation_input_tokens,
|
|
816
|
-
cache_read_input_tokens: u.cache_read_input_tokens,
|
|
817
|
-
thinking_tokens: u.thinking_tokens ?? null,
|
|
818
|
-
cost_usd: u.cost_usd ?? null
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
/**
|
|
822
|
-
* Shape one message row into its over-the-wire form, attaching its
|
|
823
|
-
* per-turn `usage` snapshot when one exists. Pure data-shaping helper
|
|
824
|
-
* extracted from the threads GET route so the wire contract has unit
|
|
825
|
-
* coverage.
|
|
826
|
-
*/ function messageToResponse(m, usageById) {
|
|
827
|
-
return {
|
|
828
|
-
id: m.msg_id,
|
|
829
|
-
seq: m.seq,
|
|
830
|
-
role: m.role,
|
|
831
|
-
content: m.content,
|
|
832
|
-
created_at: m.created_at,
|
|
833
|
-
transcript_status: m.transcript_status,
|
|
834
|
-
status_reason: m.status_reason,
|
|
835
|
-
tool_events: parseToolEventsForResponse(m.tool_events),
|
|
836
|
-
category: m.category ?? null,
|
|
837
|
-
usage: messageUsageToResponse(usageById.get(m.msg_id)),
|
|
838
|
-
metadata: parseMessageMetadataForResponse(m.metadata)
|
|
839
|
-
};
|
|
840
|
-
}
|
|
841
|
-
/** Tolerant `tool_events` JSON parser shared with the route. Bad JSON
|
|
842
|
-
* and non-array payloads collapse to `undefined` so the wire shape
|
|
843
|
-
* always matches the typed client expectation. */ function parseToolEventsForResponse(raw) {
|
|
844
|
-
if (!raw) return undefined;
|
|
845
|
-
try {
|
|
846
|
-
const parsed = JSON.parse(raw);
|
|
847
|
-
return Array.isArray(parsed) ? parsed : undefined;
|
|
848
|
-
} catch {
|
|
849
|
-
return undefined;
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
/** Tolerant `metadata` JSON parser. Returns `null` for missing/blank/
|
|
853
|
-
* malformed/non-object payloads so the wire shape stays a plain object
|
|
854
|
-
* or null — readers can rely on `metadata?.citations?...` chaining. */ function parseMessageMetadataForResponse(raw) {
|
|
855
|
-
if (!raw) return null;
|
|
856
|
-
try {
|
|
857
|
-
const parsed = JSON.parse(raw);
|
|
858
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
859
|
-
return parsed;
|
|
860
|
-
} catch {
|
|
861
|
-
return null;
|
|
844
|
+
const USAGE_PROFILE_VALUES = [
|
|
845
|
+
"home",
|
|
846
|
+
"work",
|
|
847
|
+
"dev",
|
|
848
|
+
"custom"
|
|
849
|
+
];
|
|
850
|
+
const DEFAULT_PERSONA_STYLE = {
|
|
851
|
+
strength: 50,
|
|
852
|
+
empathy: 50,
|
|
853
|
+
expressiveness: 50,
|
|
854
|
+
verbosity: 50
|
|
855
|
+
};
|
|
856
|
+
const USAGE_PROFILES = {
|
|
857
|
+
home: {
|
|
858
|
+
label: "Home",
|
|
859
|
+
hint: "Friendly summaries, chat-first layout, everyday integrations",
|
|
860
|
+
compactChat: true,
|
|
861
|
+
style: {
|
|
862
|
+
strength: 40,
|
|
863
|
+
empathy: 80,
|
|
864
|
+
expressiveness: 65,
|
|
865
|
+
verbosity: 25
|
|
866
|
+
},
|
|
867
|
+
responseInstruction: "Lead with a short useful summary and the next action. Use approachable, plain language. Avoid technical jargon and routine diagnostic narration. Expand after the summary when asked, when troubleshooting needs it, or when risk or complexity requires it.",
|
|
868
|
+
citationStrictness: "standard"
|
|
869
|
+
},
|
|
870
|
+
work: {
|
|
871
|
+
label: "Work",
|
|
872
|
+
hint: "Professional decisions, next steps, balanced detail",
|
|
873
|
+
compactChat: true,
|
|
874
|
+
style: {
|
|
875
|
+
strength: 30,
|
|
876
|
+
empathy: 55,
|
|
877
|
+
expressiveness: 35,
|
|
878
|
+
verbosity: 45
|
|
879
|
+
},
|
|
880
|
+
responseInstruction: "Be professional and outcome-focused. Lead with the decision or result, then action items, owners and deadlines only when known. Separate decisions, assumptions, and open questions. Add rationale and tradeoffs where useful, not a routine execution log.",
|
|
881
|
+
citationStrictness: "standard"
|
|
882
|
+
},
|
|
883
|
+
dev: {
|
|
884
|
+
label: "Developer",
|
|
885
|
+
hint: "Full diagnostics, evidence-backed claims, explicit validation",
|
|
886
|
+
compactChat: false,
|
|
887
|
+
style: {
|
|
888
|
+
strength: 20,
|
|
889
|
+
empathy: 30,
|
|
890
|
+
expressiveness: 20,
|
|
891
|
+
verbosity: 60
|
|
892
|
+
},
|
|
893
|
+
responseInstruction: "Be precise and evidence-first. Ground every factual claim in observed tool results or provided sources. Distinguish observations from inferences, assumptions, and unknowns; assumptions do not substantiate factual claims. Name relevant files, commands, test results, validation limits, and reproducible next checks. Give a compact evidence summary when brevity is requested, not an unsupported conclusion.",
|
|
894
|
+
citationStrictness: "strict"
|
|
895
|
+
},
|
|
896
|
+
custom: {
|
|
897
|
+
label: "Custom / Everything",
|
|
898
|
+
hint: "All integrations, full diagnostics, no added response-style rules",
|
|
899
|
+
compactChat: false,
|
|
900
|
+
style: null,
|
|
901
|
+
responseInstruction: "No preset response organization. Follow the agent instructions, explicit user requests, and any enabled style controls.",
|
|
902
|
+
citationStrictness: "off"
|
|
862
903
|
}
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
/***/ }),
|
|
908
|
+
|
|
909
|
+
/***/ 157075:
|
|
910
|
+
/***/ ((module) => {
|
|
911
|
+
|
|
912
|
+
module.exports = require("node:stream");
|
|
913
|
+
|
|
914
|
+
/***/ }),
|
|
915
|
+
|
|
916
|
+
/***/ 165581:
|
|
917
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
918
|
+
|
|
919
|
+
__webpack_require__.r(__webpack_exports__);
|
|
920
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
921
|
+
/* harmony export */ GET: () => (/* binding */ GET),
|
|
922
|
+
/* harmony export */ POST: () => (/* binding */ POST)
|
|
923
|
+
/* harmony export */ });
|
|
924
|
+
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(945592);
|
|
925
|
+
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(497377);
|
|
926
|
+
/* harmony import */ var _lib_stores_bridges__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(478361);
|
|
927
|
+
/* harmony import */ var _lib_api_serializers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(685678);
|
|
928
|
+
/* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(739947);
|
|
929
|
+
/* harmony import */ var _lib_bridges_registry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(870309);
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
function GET() {
|
|
937
|
+
return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .cachedJson */ .Bm)((0,_lib_stores_bridges__WEBPACK_IMPORTED_MODULE_1__/* .listBridges */ .X9)().map(_lib_api_serializers__WEBPACK_IMPORTED_MODULE_2__/* .bridgeToResponse */ .aX), 15);
|
|
863
938
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
}
|
|
874
|
-
return defaultTokens;
|
|
939
|
+
const CreateSchema = zod__WEBPACK_IMPORTED_MODULE_5__/* .object */ .Ikc({
|
|
940
|
+
kind: zod__WEBPACK_IMPORTED_MODULE_5__/* .string */ .YjP().trim().min(1).refine(_lib_bridges_registry__WEBPACK_IMPORTED_MODULE_4__/* .isBridgeKind */ .M4, "Unknown bridge kind"),
|
|
941
|
+
name: zod__WEBPACK_IMPORTED_MODULE_5__/* .string */ .YjP().trim().min(1).max(120)
|
|
942
|
+
});
|
|
943
|
+
async function POST(req) {
|
|
944
|
+
const parsed = await (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .validateBody */ .Jb)(req, CreateSchema);
|
|
945
|
+
if (parsed instanceof next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse) return parsed;
|
|
946
|
+
const row = (0,_lib_stores_bridges__WEBPACK_IMPORTED_MODULE_1__/* .createBridge */ .OO)(parsed);
|
|
947
|
+
return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .createdResponse */ .K2)((0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_2__/* .bridgeToResponse */ .aX)(row));
|
|
875
948
|
}
|
|
876
949
|
|
|
877
950
|
|
|
878
951
|
/***/ }),
|
|
879
952
|
|
|
880
|
-
/***/
|
|
953
|
+
/***/ 176760:
|
|
881
954
|
/***/ ((module) => {
|
|
882
955
|
|
|
883
|
-
module.exports = require("
|
|
956
|
+
module.exports = require("node:path");
|
|
884
957
|
|
|
885
958
|
/***/ }),
|
|
886
959
|
|
|
887
|
-
/***/
|
|
960
|
+
/***/ 200261:
|
|
888
961
|
/***/ ((module) => {
|
|
889
962
|
|
|
890
|
-
module.exports = require("
|
|
963
|
+
module.exports = require("next/dist/shared/lib/router/utils/app-paths");
|
|
891
964
|
|
|
892
965
|
/***/ }),
|
|
893
966
|
|
|
894
|
-
/***/
|
|
967
|
+
/***/ 253638:
|
|
895
968
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
896
969
|
|
|
897
970
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
898
|
-
/* harmony export */
|
|
899
|
-
/* harmony export */ HN: () => (/* binding */ notFoundResponse),
|
|
900
|
-
/* harmony export */ Jb: () => (/* binding */ validateBody),
|
|
901
|
-
/* harmony export */ K2: () => (/* binding */ createdResponse),
|
|
902
|
-
/* harmony export */ Ng: () => (/* binding */ noStoreJson),
|
|
903
|
-
/* harmony export */ yj: () => (/* binding */ errorResponse)
|
|
971
|
+
/* harmony export */ p: () => (/* binding */ parseJsonSafe)
|
|
904
972
|
/* harmony export */ });
|
|
905
|
-
|
|
906
|
-
//
|
|
907
|
-
//
|
|
908
|
-
|
|
909
|
-
// shape. Before this lived inline, response bodies drifted —
|
|
910
|
-
// `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
|
|
911
|
-
// some routes returned Zod's raw issue array, others stringified it.
|
|
912
|
-
|
|
913
|
-
function errorResponse(message, status = 400) {
|
|
914
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
915
|
-
error: message
|
|
916
|
-
}, {
|
|
917
|
-
status
|
|
918
|
-
});
|
|
919
|
-
}
|
|
920
|
-
function notFoundResponse(message = "Not found") {
|
|
921
|
-
return errorResponse(message, 404);
|
|
922
|
-
}
|
|
923
|
-
function createdResponse(data) {
|
|
924
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
925
|
-
status: 201
|
|
926
|
-
});
|
|
927
|
-
}
|
|
928
|
-
// Wrap a 200 JSON response with a private Cache-Control header. Use on safe
|
|
929
|
-
// GET endpoints that serve user-scoped data the client refetches often (panel
|
|
930
|
-
// mounts, navigation back/forward) but mutates rarely. The TTL is short
|
|
931
|
-
// enough that explicit mutations — which patch the client-side ApiClient
|
|
932
|
-
// cache in place — stay observably consistent without an extra roundtrip.
|
|
933
|
-
//
|
|
934
|
-
// swrSeconds (optional): stale-while-revalidate window. When set, the browser
|
|
935
|
-
// serves the cached response immediately and refreshes in the background,
|
|
936
|
-
// making navigation feel instant. Use for data that can tolerate brief
|
|
937
|
-
// staleness (tool list, agent configs, model list). Omit for real-time data
|
|
938
|
-
// (dashboard metrics, credential state).
|
|
939
|
-
function cachedJson(data, maxAgeSeconds, swrSeconds) {
|
|
940
|
-
const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
|
|
941
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
942
|
-
headers: {
|
|
943
|
-
"Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
|
|
944
|
-
}
|
|
945
|
-
});
|
|
946
|
-
}
|
|
947
|
-
// Use for endpoints whose response contains live state that must never be
|
|
948
|
-
// served from cache — credentials, connection status, live config values.
|
|
949
|
-
function noStoreJson(data) {
|
|
950
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
951
|
-
headers: {
|
|
952
|
-
"Cache-Control": "no-store"
|
|
953
|
-
}
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
// Validate a JSON request body against a zod schema.
|
|
957
|
-
// Returns either the parsed data or a 400 NextResponse explaining the issue.
|
|
958
|
-
// Caller pattern:
|
|
959
|
-
// const parsed = await validateBody(req, Schema);
|
|
960
|
-
// if (parsed instanceof NextResponse) return parsed;
|
|
961
|
-
// // use parsed.field
|
|
962
|
-
async function validateBody(req, schema) {
|
|
963
|
-
let raw;
|
|
973
|
+
// JSON.parse with a fallback value when the input is malformed (or empty).
|
|
974
|
+
// Used everywhere we read responses from external APIs — they're contractually
|
|
975
|
+
// JSON but a transient 502 / proxy interstitial occasionally returns HTML.
|
|
976
|
+
function parseJsonSafe(text, fallback) {
|
|
964
977
|
try {
|
|
965
|
-
|
|
978
|
+
return JSON.parse(text);
|
|
966
979
|
} catch {
|
|
967
|
-
return
|
|
968
|
-
}
|
|
969
|
-
const parsed = schema.safeParse(raw);
|
|
970
|
-
if (!parsed.success) {
|
|
971
|
-
return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
|
|
980
|
+
return fallback;
|
|
972
981
|
}
|
|
973
|
-
return parsed.data;
|
|
974
982
|
}
|
|
975
983
|
|
|
976
984
|
|
|
977
985
|
/***/ }),
|
|
978
986
|
|
|
979
|
-
/***/
|
|
987
|
+
/***/ 257975:
|
|
988
|
+
/***/ ((module) => {
|
|
989
|
+
|
|
990
|
+
module.exports = require("node:util");
|
|
991
|
+
|
|
992
|
+
/***/ }),
|
|
993
|
+
|
|
994
|
+
/***/ 309956:
|
|
995
|
+
/***/ ((module) => {
|
|
996
|
+
|
|
997
|
+
module.exports = require("undici");
|
|
998
|
+
|
|
999
|
+
/***/ }),
|
|
1000
|
+
|
|
1001
|
+
/***/ 328354:
|
|
1002
|
+
/***/ ((module) => {
|
|
1003
|
+
|
|
1004
|
+
module.exports = require("util");
|
|
1005
|
+
|
|
1006
|
+
/***/ }),
|
|
1007
|
+
|
|
1008
|
+
/***/ 333873:
|
|
1009
|
+
/***/ ((module) => {
|
|
1010
|
+
|
|
1011
|
+
module.exports = require("path");
|
|
1012
|
+
|
|
1013
|
+
/***/ }),
|
|
1014
|
+
|
|
1015
|
+
/***/ 344708:
|
|
1016
|
+
/***/ ((module) => {
|
|
1017
|
+
|
|
1018
|
+
module.exports = require("node:https");
|
|
1019
|
+
|
|
1020
|
+
/***/ }),
|
|
1021
|
+
|
|
1022
|
+
/***/ 379551:
|
|
1023
|
+
/***/ ((module) => {
|
|
1024
|
+
|
|
1025
|
+
module.exports = require("url");
|
|
1026
|
+
|
|
1027
|
+
/***/ }),
|
|
1028
|
+
|
|
1029
|
+
/***/ 380481:
|
|
1030
|
+
/***/ ((module) => {
|
|
1031
|
+
|
|
1032
|
+
module.exports = require("node:readline");
|
|
1033
|
+
|
|
1034
|
+
/***/ }),
|
|
1035
|
+
|
|
1036
|
+
/***/ 399253:
|
|
1037
|
+
/***/ ((module) => {
|
|
1038
|
+
|
|
1039
|
+
module.exports = import("@huggingface/transformers");;
|
|
1040
|
+
|
|
1041
|
+
/***/ }),
|
|
1042
|
+
|
|
1043
|
+
/***/ 419121:
|
|
1044
|
+
/***/ ((module) => {
|
|
1045
|
+
|
|
1046
|
+
module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
|
|
1047
|
+
|
|
1048
|
+
/***/ }),
|
|
1049
|
+
|
|
1050
|
+
/***/ 455511:
|
|
980
1051
|
/***/ ((module) => {
|
|
981
1052
|
|
|
982
|
-
module.exports = require("
|
|
1053
|
+
module.exports = require("crypto");
|
|
983
1054
|
|
|
984
1055
|
/***/ }),
|
|
985
1056
|
|
|
986
|
-
/***/
|
|
1057
|
+
/***/ 489793:
|
|
987
1058
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
988
1059
|
|
|
989
|
-
__webpack_require__.r(__webpack_exports__);
|
|
990
1060
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
991
|
-
/* harmony export */
|
|
992
|
-
/* harmony export */
|
|
993
|
-
/* harmony export */
|
|
994
|
-
/* harmony export */
|
|
995
|
-
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
996
|
-
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
1061
|
+
/* harmony export */ RX: () => (/* binding */ DEFAULT_HARNESS_ID),
|
|
1062
|
+
/* harmony export */ YX: () => (/* binding */ CUSTOM_HARNESS_ID_PREFIX),
|
|
1063
|
+
/* harmony export */ cX: () => (/* binding */ HARNESS_SECTION_KEYS),
|
|
1064
|
+
/* harmony export */ vf: () => (/* binding */ isBuiltinHarnessId)
|
|
997
1065
|
/* harmony export */ });
|
|
998
|
-
/* harmony
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1066
|
+
/* unused harmony exports BUILTIN_HARNESS_ID_PREFIX, SECTION_DISPLAY */
|
|
1067
|
+
const HARNESS_SECTION_KEYS = [
|
|
1068
|
+
"capabilities",
|
|
1069
|
+
"plan_first",
|
|
1070
|
+
"presentation",
|
|
1071
|
+
"citation",
|
|
1072
|
+
"self_config"
|
|
1073
|
+
];
|
|
1074
|
+
const BUILTIN_HARNESS_ID_PREFIX = "builtin:";
|
|
1075
|
+
const CUSTOM_HARNESS_ID_PREFIX = "custom:";
|
|
1076
|
+
const DEFAULT_HARNESS_ID = "builtin:default";
|
|
1077
|
+
function isBuiltinHarnessId(id) {
|
|
1078
|
+
return id.startsWith(BUILTIN_HARNESS_ID_PREFIX);
|
|
1079
|
+
}
|
|
1080
|
+
const SECTION_DISPLAY = {
|
|
1081
|
+
capabilities: {
|
|
1082
|
+
title: "Host capabilities",
|
|
1083
|
+
hint: "What the surrounding app can do — notifications, scheduling, watchers, document indexing."
|
|
1084
|
+
},
|
|
1085
|
+
plan_first: {
|
|
1086
|
+
title: "Plan-first acknowledgment",
|
|
1087
|
+
hint: "Acknowledge-before-acting rules, action principle, anti-fabrication, follow-through."
|
|
1088
|
+
},
|
|
1089
|
+
presentation: {
|
|
1090
|
+
title: "Output formatting",
|
|
1091
|
+
hint: "Markdown / HTML extras, code fences, images, maps, citation refs block."
|
|
1092
|
+
},
|
|
1093
|
+
citation: {
|
|
1094
|
+
title: "Source attribution",
|
|
1095
|
+
hint: "Anti-hallucination rules: every substantive claim must be tagged with its source."
|
|
1096
|
+
},
|
|
1097
|
+
self_config: {
|
|
1098
|
+
title: "Self-configuration proposals",
|
|
1099
|
+
hint: "Lets the agent propose config changes (install MCP, edit agent, set keys) for user approval."
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1030
1102
|
|
|
1031
1103
|
|
|
1104
|
+
/***/ }),
|
|
1032
1105
|
|
|
1106
|
+
/***/ 524318:
|
|
1107
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1033
1108
|
|
|
1109
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1110
|
+
/* harmony export */ u_: () => (/* binding */ DEFAULT_HOT_TURN_LIMIT)
|
|
1111
|
+
/* harmony export */ });
|
|
1112
|
+
/* harmony import */ var _lib_agents_harness_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(489793);
|
|
1113
|
+
const DEFAULT_HOT_TURN_LIMIT = 12;
|
|
1034
1114
|
|
|
1035
1115
|
|
|
1036
1116
|
|
|
1117
|
+
/***/ }),
|
|
1037
1118
|
|
|
1119
|
+
/***/ 529294:
|
|
1120
|
+
/***/ ((module) => {
|
|
1038
1121
|
|
|
1122
|
+
module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
|
|
1039
1123
|
|
|
1124
|
+
/***/ }),
|
|
1040
1125
|
|
|
1126
|
+
/***/ 594735:
|
|
1127
|
+
/***/ ((module) => {
|
|
1041
1128
|
|
|
1129
|
+
module.exports = require("events");
|
|
1042
1130
|
|
|
1131
|
+
/***/ }),
|
|
1043
1132
|
|
|
1133
|
+
/***/ 629021:
|
|
1134
|
+
/***/ ((module) => {
|
|
1044
1135
|
|
|
1136
|
+
module.exports = require("fs");
|
|
1045
1137
|
|
|
1138
|
+
/***/ }),
|
|
1046
1139
|
|
|
1140
|
+
/***/ 638522:
|
|
1141
|
+
/***/ ((module) => {
|
|
1047
1142
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1143
|
+
module.exports = require("node:zlib");
|
|
1144
|
+
|
|
1145
|
+
/***/ }),
|
|
1146
|
+
|
|
1147
|
+
/***/ 663033:
|
|
1148
|
+
/***/ ((module) => {
|
|
1149
|
+
|
|
1150
|
+
module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
|
|
1151
|
+
|
|
1152
|
+
/***/ }),
|
|
1153
|
+
|
|
1154
|
+
/***/ 685678:
|
|
1155
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1156
|
+
|
|
1157
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1158
|
+
/* harmony export */ G4: () => (/* binding */ resolveContextWindowTokens),
|
|
1159
|
+
/* harmony export */ S6: () => (/* binding */ agentToResponse),
|
|
1160
|
+
/* harmony export */ aX: () => (/* binding */ bridgeToResponse),
|
|
1161
|
+
/* harmony export */ mX: () => (/* binding */ messageToResponse),
|
|
1162
|
+
/* harmony export */ sU: () => (/* binding */ mcpServerToResponse)
|
|
1163
|
+
/* harmony export */ });
|
|
1164
|
+
/* unused harmony exports messageUsageToResponse, parseToolEventsForResponse, parseMessageMetadataForResponse */
|
|
1165
|
+
/* harmony import */ var _api_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(524318);
|
|
1166
|
+
/* harmony import */ var _lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41720);
|
|
1167
|
+
/* harmony import */ var _lib_utils_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(253638);
|
|
1168
|
+
// Row → JSON-response serializers shared between list (`route.ts`) and
|
|
1169
|
+
// item (`[id]/route.ts`) handlers. Keeping these in one place stops the
|
|
1170
|
+
// list and item shapes from drifting (they were copy-pasted before).
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
function agentToResponse(a) {
|
|
1175
|
+
return {
|
|
1176
|
+
id: a.id,
|
|
1177
|
+
usage_profile: a.usage_profile ?? "custom",
|
|
1178
|
+
name: a.name,
|
|
1179
|
+
icon: a.icon,
|
|
1180
|
+
identity: a.identity,
|
|
1181
|
+
instructions: a.instructions,
|
|
1182
|
+
tools: (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_2__/* .parseJsonSafe */ .p)(a.tools, []),
|
|
1183
|
+
model_config_name: a.model_config_name,
|
|
1184
|
+
is_default: !!a.is_default,
|
|
1185
|
+
history_limit: a.history_limit,
|
|
1186
|
+
history_window_hours: a.history_window_hours,
|
|
1187
|
+
hot_turn_limit: a.hot_turn_limit ?? _api_types__WEBPACK_IMPORTED_MODULE_0__/* .DEFAULT_HOT_TURN_LIMIT */ .u_,
|
|
1188
|
+
warm_summary_limit: a.warm_summary_limit,
|
|
1189
|
+
never_reply: !!a.never_reply,
|
|
1190
|
+
adaptive_persona_enabled: !!a.adaptive_persona_enabled,
|
|
1191
|
+
adaptive_persona_strength: a.adaptive_persona_strength,
|
|
1192
|
+
adaptive_empathy: a.adaptive_empathy,
|
|
1193
|
+
adaptive_expressiveness: a.adaptive_expressiveness,
|
|
1194
|
+
adaptive_verbosity: a.adaptive_verbosity,
|
|
1195
|
+
adaptive_mbti: a.adaptive_mbti,
|
|
1196
|
+
voice_enabled: !!a.voice_enabled,
|
|
1197
|
+
voice_model: a.voice_model,
|
|
1198
|
+
voice_name: a.voice_name,
|
|
1199
|
+
voice_stt_model: a.voice_stt_model,
|
|
1200
|
+
voice_auto_speak: !!a.voice_auto_speak,
|
|
1201
|
+
harness_id: a.harness_id,
|
|
1202
|
+
delegate_targets: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .parseDelegateTargets */ .bg)(a.delegate_targets),
|
|
1203
|
+
context_tier_proportions: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .getAgentTierProportions */ .fg)(a),
|
|
1204
|
+
anti_hallucination_mode: a.anti_hallucination_mode === "off" || a.anti_hallucination_mode === "regex" || a.anti_hallucination_mode === "model" ? a.anti_hallucination_mode : null,
|
|
1205
|
+
anti_hallucination_model_config: a.anti_hallucination_model_config,
|
|
1206
|
+
citation_strictness: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .parseCitationStrictness */ .P2)(a.citation_strictness) ?? "off",
|
|
1207
|
+
tool_credentials: (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .getAgentToolCredentials */ .S2)(a),
|
|
1208
|
+
router_policy: a.router_policy === "cheap" || a.router_policy === "fast" || a.router_policy === "balanced" || a.router_policy === "quality" ? a.router_policy : null,
|
|
1209
|
+
router_enabled: a.router_enabled === 1 ? true : a.router_enabled === 0 ? false : null,
|
|
1210
|
+
usage_strategy: a.usage_strategy === "cost_saving" || a.usage_strategy === "balanced" || a.usage_strategy === "high_reasoning" ? a.usage_strategy : null,
|
|
1211
|
+
created_at: a.created_at,
|
|
1212
|
+
updated_at: a.updated_at
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
function bridgeToResponse(r) {
|
|
1216
|
+
return {
|
|
1217
|
+
id: r.id,
|
|
1218
|
+
kind: r.kind,
|
|
1219
|
+
name: r.name,
|
|
1220
|
+
status: r.status,
|
|
1221
|
+
last_error: r.last_error,
|
|
1222
|
+
paired_id: r.paired_id,
|
|
1223
|
+
enabled: r.enabled === 1,
|
|
1224
|
+
event_subscriptions: {
|
|
1225
|
+
group_profile_updates: r.forward_group_profile_updates === 1,
|
|
1226
|
+
group_participants_updates: r.forward_group_participants_updates === 1
|
|
1227
|
+
},
|
|
1228
|
+
created_at: r.created_at,
|
|
1229
|
+
updated_at: r.updated_at
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
function mcpServerToResponse(r) {
|
|
1233
|
+
return {
|
|
1234
|
+
name: r.name,
|
|
1235
|
+
transport: r.transport,
|
|
1236
|
+
spec: (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_2__/* .parseJsonSafe */ .p)(r.spec, null),
|
|
1237
|
+
enabled: r.enabled === 1,
|
|
1238
|
+
last_error: r.last_error,
|
|
1239
|
+
created_at: r.created_at,
|
|
1240
|
+
updated_at: r.updated_at
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Shape a `message_usage` row into the over-the-wire `usage` object the
|
|
1245
|
+
* chat panel's `ContextUsageBar` consumes. Returns `null` for messages
|
|
1246
|
+
* that have no snapshot (user turns and legacy assistant rows recorded
|
|
1247
|
+
* before the per-turn snapshot landed in ADR-0041).
|
|
1248
|
+
*
|
|
1249
|
+
* Anthropic prompt-cache tokens (PR #181 + the cache-fidelity follow-up)
|
|
1250
|
+
* are surfaced as additive fields so future UI work can render a
|
|
1251
|
+
* "served from cache" badge without another wire change. Both are
|
|
1252
|
+
* `null` for rows that predate cache plumbing or for providers that
|
|
1253
|
+
* don't expose a cache breakdown.
|
|
1254
|
+
*/ function messageUsageToResponse(u) {
|
|
1255
|
+
if (!u) return null;
|
|
1256
|
+
return {
|
|
1257
|
+
input_tokens: u.input_tokens,
|
|
1258
|
+
output_tokens: u.output_tokens,
|
|
1259
|
+
hot_tokens: u.hot_tokens,
|
|
1260
|
+
warm_tokens: u.warm_tokens,
|
|
1261
|
+
facts_tokens: u.facts_tokens,
|
|
1262
|
+
overhead_tokens: u.overhead_tokens,
|
|
1263
|
+
hot_budget_tokens: u.hot_budget_tokens,
|
|
1264
|
+
warm_budget_tokens: u.warm_budget_tokens,
|
|
1265
|
+
facts_budget_tokens: u.facts_budget_tokens,
|
|
1266
|
+
context_window_tokens: u.context_window_tokens,
|
|
1267
|
+
cache_creation_input_tokens: u.cache_creation_input_tokens,
|
|
1268
|
+
cache_read_input_tokens: u.cache_read_input_tokens,
|
|
1269
|
+
thinking_tokens: u.thinking_tokens ?? null,
|
|
1270
|
+
cost_usd: u.cost_usd ?? null
|
|
1271
|
+
};
|
|
1086
1272
|
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
// `prepare`, so route module preparation is part of the request's trace.
|
|
1107
|
-
// When this request triggers registration, the lifecycle spans of
|
|
1108
|
-
// `instrumentation.ts` are emitted inside the request span.
|
|
1109
|
-
const { instrumentation } = await routeModule.ensureInstrumentation(req, {
|
|
1110
|
-
deferSpans: true
|
|
1111
|
-
});
|
|
1112
|
-
return routeModule.traceRequest(req, {
|
|
1113
|
-
tracer: (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)(),
|
|
1114
|
-
spanName: `${req.method || 'GET'} ${srcPage}`,
|
|
1115
|
-
httpTarget: req.url,
|
|
1116
|
-
instrumentation
|
|
1117
|
-
}, (requestSpan, requestRootSpan)=>handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan));
|
|
1273
|
+
/**
|
|
1274
|
+
* Shape one message row into its over-the-wire form, attaching its
|
|
1275
|
+
* per-turn `usage` snapshot when one exists. Pure data-shaping helper
|
|
1276
|
+
* extracted from the threads GET route so the wire contract has unit
|
|
1277
|
+
* coverage.
|
|
1278
|
+
*/ function messageToResponse(m, usageById) {
|
|
1279
|
+
return {
|
|
1280
|
+
id: m.msg_id,
|
|
1281
|
+
seq: m.seq,
|
|
1282
|
+
role: m.role,
|
|
1283
|
+
content: m.content,
|
|
1284
|
+
created_at: m.created_at,
|
|
1285
|
+
transcript_status: m.transcript_status,
|
|
1286
|
+
status_reason: m.status_reason,
|
|
1287
|
+
tool_events: parseToolEventsForResponse(m.tool_events),
|
|
1288
|
+
category: m.category ?? null,
|
|
1289
|
+
usage: messageUsageToResponse(usageById.get(m.msg_id)),
|
|
1290
|
+
metadata: parseMessageMetadataForResponse(m.metadata)
|
|
1291
|
+
};
|
|
1118
1292
|
}
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
return null;
|
|
1293
|
+
/** Tolerant `tool_events` JSON parser shared with the route. Bad JSON
|
|
1294
|
+
* and non-array payloads collapse to `undefined` so the wire shape
|
|
1295
|
+
* always matches the typed client expectation. */ function parseToolEventsForResponse(raw) {
|
|
1296
|
+
if (!raw) return undefined;
|
|
1297
|
+
try {
|
|
1298
|
+
const parsed = JSON.parse(raw);
|
|
1299
|
+
return Array.isArray(parsed) ? parsed : undefined;
|
|
1300
|
+
} catch {
|
|
1301
|
+
return undefined;
|
|
1129
1302
|
}
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
if (
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
res.end('This page could not be found');
|
|
1141
|
-
}
|
|
1303
|
+
}
|
|
1304
|
+
/** Tolerant `metadata` JSON parser. Returns `null` for missing/blank/
|
|
1305
|
+
* malformed/non-object payloads so the wire shape stays a plain object
|
|
1306
|
+
* or null — readers can rely on `metadata?.citations?...` chaining. */ function parseMessageMetadataForResponse(raw) {
|
|
1307
|
+
if (!raw) return null;
|
|
1308
|
+
try {
|
|
1309
|
+
const parsed = JSON.parse(raw);
|
|
1310
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return null;
|
|
1311
|
+
return parsed;
|
|
1312
|
+
} catch {
|
|
1142
1313
|
return null;
|
|
1143
|
-
};
|
|
1144
|
-
if (isIsr && !isDraftMode) {
|
|
1145
|
-
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
1146
|
-
if (prerenderInfo) {
|
|
1147
|
-
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
1148
|
-
if (nextConfig.adapterPath) {
|
|
1149
|
-
return await render404();
|
|
1150
|
-
}
|
|
1151
|
-
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
let cacheKey = null;
|
|
1156
|
-
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
1157
|
-
cacheKey = resolvedPathname;
|
|
1158
|
-
// ensure /index and / is normalized to one key
|
|
1159
|
-
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
1160
|
-
}
|
|
1161
|
-
// Before rendering (which initializes component tree modules), we have to
|
|
1162
|
-
// set the reference manifests to our global store so Server Action's
|
|
1163
|
-
// encryption util can access to them at the top level of the page module.
|
|
1164
|
-
if (serverActionsManifest && clientReferenceManifest) {
|
|
1165
|
-
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
1166
|
-
page: srcPage,
|
|
1167
|
-
clientReferenceManifest,
|
|
1168
|
-
serverActionsManifest
|
|
1169
|
-
});
|
|
1170
1314
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
value: {
|
|
1253
|
-
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
1254
|
-
status: response.status,
|
|
1255
|
-
body: Buffer.from(await blob.arrayBuffer()),
|
|
1256
|
-
headers
|
|
1257
|
-
},
|
|
1258
|
-
cacheControl: {
|
|
1259
|
-
revalidate,
|
|
1260
|
-
expire
|
|
1261
|
-
}
|
|
1262
|
-
};
|
|
1263
|
-
return cacheEntry;
|
|
1264
|
-
} else {
|
|
1265
|
-
// send response without caching if not ISR
|
|
1266
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
1267
|
-
return null;
|
|
1268
|
-
}
|
|
1269
|
-
} catch (err) {
|
|
1270
|
-
// if this is a background revalidate we need to report
|
|
1271
|
-
// the request error here as it won't be bubbled
|
|
1272
|
-
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
1273
|
-
const silenceLog = false;
|
|
1274
|
-
await routeModule.onRequestError(req, err, {
|
|
1275
|
-
routerKind: 'App Router',
|
|
1276
|
-
routePath: srcPage,
|
|
1277
|
-
routeType: 'route',
|
|
1278
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1279
|
-
isStaticGeneration: cacheKey !== null,
|
|
1280
|
-
isOnDemandRevalidate
|
|
1281
|
-
})
|
|
1282
|
-
}, silenceLog, routerServerContext);
|
|
1283
|
-
}
|
|
1284
|
-
throw err;
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Resolve the bar's 100% baseline. Per-row `context_window_tokens`
|
|
1318
|
+
* (snapshotted at run time) wins so the bar matches the cap the agent
|
|
1319
|
+
* actually applied; legacy rows fall back to the model-config value;
|
|
1320
|
+
* unconfigured agents fall back to the default. Centralised so the
|
|
1321
|
+
* route and the UI share the same precedence rule.
|
|
1322
|
+
*/ function resolveContextWindowTokens(modelConfiguredTokens, defaultTokens) {
|
|
1323
|
+
if (typeof modelConfiguredTokens === "number" && modelConfiguredTokens > 0) {
|
|
1324
|
+
return modelConfiguredTokens;
|
|
1325
|
+
}
|
|
1326
|
+
return defaultTokens;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
|
|
1330
|
+
/***/ }),
|
|
1331
|
+
|
|
1332
|
+
/***/ 710846:
|
|
1333
|
+
/***/ ((module) => {
|
|
1334
|
+
|
|
1335
|
+
module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");
|
|
1336
|
+
|
|
1337
|
+
/***/ }),
|
|
1338
|
+
|
|
1339
|
+
/***/ 731421:
|
|
1340
|
+
/***/ ((module) => {
|
|
1341
|
+
|
|
1342
|
+
module.exports = require("node:child_process");
|
|
1343
|
+
|
|
1344
|
+
/***/ }),
|
|
1345
|
+
|
|
1346
|
+
/***/ 739947:
|
|
1347
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1348
|
+
|
|
1349
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1350
|
+
/* harmony export */ Bm: () => (/* binding */ cachedJson),
|
|
1351
|
+
/* harmony export */ HN: () => (/* binding */ notFoundResponse),
|
|
1352
|
+
/* harmony export */ Jb: () => (/* binding */ validateBody),
|
|
1353
|
+
/* harmony export */ K2: () => (/* binding */ createdResponse),
|
|
1354
|
+
/* harmony export */ Ng: () => (/* binding */ noStoreJson),
|
|
1355
|
+
/* harmony export */ yj: () => (/* binding */ errorResponse)
|
|
1356
|
+
/* harmony export */ });
|
|
1357
|
+
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(945592);
|
|
1358
|
+
// Shared HTTP response builders for app/api/v1/** route handlers.
|
|
1359
|
+
//
|
|
1360
|
+
// Goal: every error/success payload across the v1 surface has the same
|
|
1361
|
+
// shape. Before this lived inline, response bodies drifted —
|
|
1362
|
+
// `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
|
|
1363
|
+
// some routes returned Zod's raw issue array, others stringified it.
|
|
1364
|
+
|
|
1365
|
+
function errorResponse(message, status = 400) {
|
|
1366
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
1367
|
+
error: message
|
|
1368
|
+
}, {
|
|
1369
|
+
status
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
function notFoundResponse(message = "Not found") {
|
|
1373
|
+
return errorResponse(message, 404);
|
|
1374
|
+
}
|
|
1375
|
+
function createdResponse(data) {
|
|
1376
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
1377
|
+
status: 201
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
// Wrap a 200 JSON response with a private Cache-Control header. Use on safe
|
|
1381
|
+
// GET endpoints that serve user-scoped data the client refetches often (panel
|
|
1382
|
+
// mounts, navigation back/forward) but mutates rarely. The TTL is short
|
|
1383
|
+
// enough that explicit mutations — which patch the client-side ApiClient
|
|
1384
|
+
// cache in place — stay observably consistent without an extra roundtrip.
|
|
1385
|
+
//
|
|
1386
|
+
// swrSeconds (optional): stale-while-revalidate window. When set, the browser
|
|
1387
|
+
// serves the cached response immediately and refreshes in the background,
|
|
1388
|
+
// making navigation feel instant. Use for data that can tolerate brief
|
|
1389
|
+
// staleness (tool list, agent configs, model list). Omit for real-time data
|
|
1390
|
+
// (dashboard metrics, credential state).
|
|
1391
|
+
function cachedJson(data, maxAgeSeconds, swrSeconds) {
|
|
1392
|
+
const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
|
|
1393
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
1394
|
+
headers: {
|
|
1395
|
+
"Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
|
|
1285
1396
|
}
|
|
1286
|
-
};
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
1295
|
-
isFallback: false,
|
|
1296
|
-
previewProps,
|
|
1297
|
-
prerenderManifest,
|
|
1298
|
-
isRoutePPREnabled: false,
|
|
1299
|
-
isOnDemandRevalidate,
|
|
1300
|
-
revalidateOnlyGenerated,
|
|
1301
|
-
responseGenerator,
|
|
1302
|
-
waitUntil: ctx.waitUntil,
|
|
1303
|
-
isMinimalMode
|
|
1304
|
-
});
|
|
1305
|
-
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
1306
|
-
throw cacheEntry.error;
|
|
1307
|
-
}
|
|
1308
|
-
// we don't create a cacheEntry for ISR
|
|
1309
|
-
if (!isIsr) {
|
|
1310
|
-
return;
|
|
1311
|
-
}
|
|
1312
|
-
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) {
|
|
1313
|
-
var _cacheEntry_value1;
|
|
1314
|
-
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
1315
|
-
}
|
|
1316
|
-
if (!isMinimalMode) {
|
|
1317
|
-
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
1318
|
-
}
|
|
1319
|
-
// Draft mode should never be cached
|
|
1320
|
-
if (isDraftMode) {
|
|
1321
|
-
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
1322
|
-
}
|
|
1323
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
1324
|
-
if (!(isMinimalMode && isIsr)) {
|
|
1325
|
-
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
1326
|
-
}
|
|
1327
|
-
// If cache control is already set on the response we don't
|
|
1328
|
-
// override it to allow users to customize it via next.config
|
|
1329
|
-
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
1330
|
-
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
1331
|
-
}
|
|
1332
|
-
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'.
|
|
1333
|
-
new Response(cacheEntry.value.body, {
|
|
1334
|
-
headers,
|
|
1335
|
-
status: cacheEntry.value.status || 200
|
|
1336
|
-
}));
|
|
1337
|
-
return;
|
|
1338
|
-
} catch (err) {
|
|
1339
|
-
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
1340
|
-
const silenceLog = false;
|
|
1341
|
-
await routeModule.onRequestError(req, err, {
|
|
1342
|
-
routerKind: 'App Router',
|
|
1343
|
-
routePath: normalizedSrcPage,
|
|
1344
|
-
routeType: 'route',
|
|
1345
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1346
|
-
isStaticGeneration: cacheKey !== null,
|
|
1347
|
-
isOnDemandRevalidate
|
|
1348
|
-
})
|
|
1349
|
-
}, silenceLog, routerServerContext);
|
|
1350
|
-
}
|
|
1351
|
-
// rethrow so that we can handle serving error page
|
|
1352
|
-
// If this is during static generation, throw the error again.
|
|
1353
|
-
if (isIsr) throw err;
|
|
1354
|
-
// Otherwise, send a 500 response unless the original response has
|
|
1355
|
-
// already committed. In that case, preserve its status code for
|
|
1356
|
-
// telemetry while still recording the failure and terminating a response
|
|
1357
|
-
// that the failed pipeline left open.
|
|
1358
|
-
if (res.headersSent) {
|
|
1359
|
-
if (currentSpan) {
|
|
1360
|
-
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
1361
|
-
currentSpan.recordException(error);
|
|
1362
|
-
currentSpan.setStatus({
|
|
1363
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
1364
|
-
message: error.message
|
|
1365
|
-
});
|
|
1366
|
-
currentSpan.setAttribute('error.type', error.name);
|
|
1367
|
-
}
|
|
1368
|
-
if (!res.writableEnded && !res.destroyed) {
|
|
1369
|
-
res.end();
|
|
1370
|
-
}
|
|
1371
|
-
} else {
|
|
1372
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
1373
|
-
status: 500
|
|
1374
|
-
}));
|
|
1375
|
-
}
|
|
1376
|
-
return;
|
|
1377
|
-
} finally{
|
|
1378
|
-
;
|
|
1379
|
-
(()=>{
|
|
1380
|
-
if (!currentSpan) {
|
|
1381
|
-
return;
|
|
1382
|
-
}
|
|
1383
|
-
let statusCode = res.statusCode;
|
|
1384
|
-
currentSpan.setAttributes({
|
|
1385
|
-
'http.status_code': statusCode,
|
|
1386
|
-
'next.rsc': false
|
|
1387
|
-
});
|
|
1388
|
-
if (statusCode && statusCode >= 500) {
|
|
1389
|
-
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
1390
|
-
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
1391
|
-
currentSpan.setStatus({
|
|
1392
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
1393
|
-
});
|
|
1394
|
-
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
1395
|
-
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
1396
|
-
}
|
|
1397
|
-
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
1398
|
-
// We were unable to get attributes, probably OTEL is not enabled
|
|
1399
|
-
if (!rootSpanAttributes) {
|
|
1400
|
-
return;
|
|
1401
|
-
}
|
|
1402
|
-
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
1403
|
-
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
1404
|
-
return;
|
|
1405
|
-
}
|
|
1406
|
-
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
1407
|
-
const name = `${method} ${route}`;
|
|
1408
|
-
currentSpan.setAttributes({
|
|
1409
|
-
'next.route': route,
|
|
1410
|
-
'http.route': route,
|
|
1411
|
-
'next.span_name': name
|
|
1412
|
-
});
|
|
1413
|
-
currentSpan.updateName(name);
|
|
1414
|
-
// Propagate http.route to the request's root span if it isn't the
|
|
1415
|
-
// request span (e.g. a platform-created HTTP span in adapter
|
|
1416
|
-
// deployments).
|
|
1417
|
-
if (requestRootSpan && requestRootSpan !== currentSpan) {
|
|
1418
|
-
requestRootSpan.setAttribute('http.route', route);
|
|
1419
|
-
requestRootSpan.updateName(name);
|
|
1420
|
-
}
|
|
1421
|
-
})();
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
// Use for endpoints whose response contains live state that must never be
|
|
1400
|
+
// served from cache — credentials, connection status, live config values.
|
|
1401
|
+
function noStoreJson(data) {
|
|
1402
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
1403
|
+
headers: {
|
|
1404
|
+
"Cache-Control": "no-store"
|
|
1422
1405
|
}
|
|
1423
|
-
};
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
// Validate a JSON request body against a zod schema.
|
|
1409
|
+
// Returns either the parsed data or a 400 NextResponse explaining the issue.
|
|
1410
|
+
// Caller pattern:
|
|
1411
|
+
// const parsed = await validateBody(req, Schema);
|
|
1412
|
+
// if (parsed instanceof NextResponse) return parsed;
|
|
1413
|
+
// // use parsed.field
|
|
1414
|
+
async function validateBody(req, schema) {
|
|
1415
|
+
let raw;
|
|
1416
|
+
try {
|
|
1417
|
+
raw = await req.json();
|
|
1418
|
+
} catch {
|
|
1419
|
+
return errorResponse("Request body must be valid JSON", 400);
|
|
1429
1420
|
}
|
|
1430
|
-
|
|
1421
|
+
const parsed = schema.safeParse(raw);
|
|
1422
|
+
if (!parsed.success) {
|
|
1423
|
+
return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
|
|
1424
|
+
}
|
|
1425
|
+
return parsed.data;
|
|
1431
1426
|
}
|
|
1432
1427
|
|
|
1433
|
-
//# sourceMappingURL=app-route.js.map
|
|
1434
1428
|
|
|
1429
|
+
/***/ }),
|
|
1430
|
+
|
|
1431
|
+
/***/ 744870:
|
|
1432
|
+
/***/ ((module) => {
|
|
1433
|
+
|
|
1434
|
+
module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
|
|
1435
1435
|
|
|
1436
1436
|
/***/ }),
|
|
1437
1437
|
|
|
@@ -1867,7 +1867,7 @@ module.exports = require("next/dist/shared/lib/no-fallback-error.external");
|
|
|
1867
1867
|
var __webpack_require__ = require("../../../../webpack-runtime.js");
|
|
1868
1868
|
__webpack_require__.C(exports);
|
|
1869
1869
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
1870
|
-
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,4891,4992,1244,309], () => (__webpack_exec__(
|
|
1870
|
+
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,4891,4992,1244,309], () => (__webpack_exec__(26522)));
|
|
1871
1871
|
module.exports = __webpack_exports__;
|
|
1872
1872
|
|
|
1873
1873
|
})();
|