@circuitwall/jarela 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +6 -5
- 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 +8 -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 +76 -76
- 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 +93 -93
- package/.next/standalone/.next/server/app/api/v1/access/route.js +169 -169
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +82 -56
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +122 -122
- 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 +753 -753
- package/.next/standalone/.next/server/app/api/v1/agents/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +364 -364
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +802 -802
- package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +49 -49
- package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +910 -910
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +589 -16
- 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 +23 -23
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +30 -30
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +703 -130
- 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 +708 -135
- 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 +802 -229
- 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 +739 -739
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +1035 -1035
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +679 -106
- 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 +804 -804
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js +700 -700
- package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +9 -9
- 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 +85 -85
- package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +709 -709
- 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 +2 -2
- 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 +10 -10
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +784 -784
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +86 -86
- 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 +57 -57
- 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/search/route.js +523 -523
- package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +65 -65
- 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 +122 -122
- 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 +37 -37
- 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 +9 -9
- package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +368 -368
- package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/events/route.js +751 -178
- 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 +77 -77
- package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +763 -763
- 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 +44 -44
- package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +34 -34
- package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +204 -204
- package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +133 -133
- package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +106 -106
- package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +114 -114
- package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +134 -134
- package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +690 -690
- 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 +93 -93
- 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 +9 -9
- 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 +185 -185
- 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 +171 -171
- 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 +396 -396
- 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 +212 -212
- 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 +235 -235
- package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +26 -26
- package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +221 -221
- package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +58 -58
- package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +9 -9
- 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 +772 -772
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +133 -133
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +9 -9
- 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 +363 -363
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +233 -233
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +682 -682
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +879 -879
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +108 -108
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +952 -952
- package/.next/standalone/.next/server/app/api/v1/integrations/route.js +216 -216
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +864 -847
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/local-file/route.js +26 -26
- package/.next/standalone/.next/server/app/api/v1/logs/route.js +70 -70
- package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +979 -979
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +196 -196
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +381 -381
- package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +79 -79
- package/.next/standalone/.next/server/app/api/v1/memory/route.js +51 -51
- package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +131 -131
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +374 -369
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +143 -143
- package/.next/standalone/.next/server/app/api/v1/models/route.js +543 -543
- package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +445 -445
- package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +120 -120
- 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 +234 -234
- 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 +407 -407
- 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 +37 -37
- 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 +107 -107
- 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 +228 -228
- 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 +9 -9
- 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 +148 -148
- 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 +787 -787
- 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 +507 -507
- 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 +181 -181
- 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 +258 -258
- 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 +30 -30
- package/.next/standalone/.next/server/app/api/v1/profile/route.js +164 -164
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +164 -164
- package/.next/standalone/.next/server/app/api/v1/providers/route.js +94 -94
- package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +450 -450
- package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/redaction/route.js +58 -58
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +600 -600
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +44 -44
- 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 +732 -732
- package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +359 -359
- package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +197 -197
- package/.next/standalone/.next/server/app/api/v1/security/state/route.js +51 -51
- package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +176 -176
- package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +190 -190
- package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +26 -26
- package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +770 -770
- package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +115 -115
- package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +327 -327
- package/.next/standalone/.next/server/app/api/v1/skills/route.js +870 -870
- package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +838 -808
- package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +177 -177
- 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 +164 -164
- package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +115 -115
- 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 +1429 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +635 -634
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +53 -439
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +172 -172
- 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 +908 -908
- package/.next/standalone/.next/server/app/api/v1/tools/route.js +2 -2
- 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 +17 -17
- 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 +570 -570
- package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +224 -224
- package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +975 -975
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +72 -72
- 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 +128 -128
- package/.next/standalone/.next/server/app/api/v1/watchers/route.js +164 -164
- 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 +62 -62
- package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +436 -436
- package/.next/standalone/.next/server/app/page.js +1243 -854
- 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 +6 -5
- package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +335 -986
- package/.next/standalone/.next/server/chunks/1433.js +1 -1
- package/.next/standalone/.next/server/chunks/1638.js +1 -2
- package/.next/standalone/.next/server/chunks/1738.js +1 -1
- package/.next/standalone/.next/server/chunks/210.js +6 -6
- package/.next/standalone/.next/server/chunks/2151.js +31 -1
- package/.next/standalone/.next/server/chunks/2207.js +1 -0
- package/.next/standalone/.next/server/chunks/2471.js +28 -28
- package/.next/standalone/.next/server/chunks/2504.js +1 -1
- package/.next/standalone/.next/server/chunks/2695.js +17 -17
- package/.next/standalone/.next/server/chunks/3042.js +14 -8
- package/.next/standalone/.next/server/chunks/3399.js +1 -1
- package/.next/standalone/.next/server/chunks/3566.js +1 -1
- package/.next/standalone/.next/server/chunks/4189.js +946 -0
- package/.next/standalone/.next/server/chunks/{9590.js → 423.js} +8 -3
- package/.next/standalone/.next/server/chunks/4433.js +146 -146
- package/.next/standalone/.next/server/chunks/4508.js +1 -1
- package/.next/standalone/.next/server/chunks/4588.js +1 -0
- package/.next/standalone/.next/server/chunks/46.js +5 -0
- package/.next/standalone/.next/server/chunks/466.js +12 -0
- package/.next/standalone/.next/server/chunks/4868.js +206 -206
- package/.next/standalone/.next/server/chunks/4992.js +13 -0
- package/.next/standalone/.next/server/chunks/5120.js +963 -0
- package/.next/standalone/.next/server/chunks/5701.js +1 -1
- package/.next/standalone/.next/server/chunks/5900.js +1 -1
- package/.next/standalone/.next/server/chunks/6210.js +1 -0
- package/.next/standalone/.next/server/chunks/6213.js +1 -1
- package/.next/standalone/.next/server/chunks/6649.js +2 -2
- package/.next/standalone/.next/server/chunks/6703.js +3 -3
- package/.next/standalone/.next/server/chunks/7445.js +1 -0
- package/.next/standalone/.next/server/chunks/8067.js +12 -0
- package/.next/standalone/.next/server/chunks/8461.js +14 -9
- package/.next/standalone/.next/server/chunks/8558.js +1 -1
- package/.next/standalone/.next/server/chunks/8724.js +1 -1
- package/.next/standalone/.next/server/chunks/8849.js +91 -91
- package/.next/standalone/.next/server/chunks/9032.js +6 -5
- package/.next/standalone/.next/server/chunks/{2563.js → 9164.js} +33173 -31461
- package/.next/standalone/.next/server/chunks/9237.js +396 -396
- package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1628 -570
- package/.next/standalone/.next/server/chunks/9406.js +1 -1
- package/.next/standalone/.next/server/chunks/9824.js +98 -98
- package/.next/standalone/.next/server/chunks/9826.js +1 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
- package/.next/standalone/.next/server/middleware.js +415 -397
- 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/chunks/{1395-a340fb0a345382a4.js → 1395-e4a99912b8f83044.js} +13 -1
- package/.next/standalone/.next/static/chunks/app/_global-error/{page-36cb8b428b38b26a.js → page-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/access/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/{page-7017f07f8a7a083c.js → page-213a623b37226452.js} +1041 -652
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/css/{d80058f0b9b41c09.css → 312542a5725ba0d5.css} +2 -2
- package/.next/standalone/docs/adoption/changesets.json +309 -0
- package/.next/standalone/lib/skills/builtins/memory-organization/SKILL.md +16 -0
- package/.next/standalone/package.json +3 -3
- package/CHANGELOG.md +25 -0
- package/api/client.ts +9 -0
- package/api/types.ts +29 -0
- package/app/api/v1/lifecycle/adoption/route.ts +14 -2
- package/app/api/v1/models/[name]/compact-threads/route.ts +14 -11
- package/app/api/v1/threads/[thread_id]/activity/route.ts +19 -0
- package/app/api/v1/threads/[thread_id]/context-pin/route.test.ts +1 -0
- package/app/api/v1/threads/[thread_id]/context-pin/route.ts +2 -1
- package/app/api/v1/threads/[thread_id]/route.ts +5 -1
- package/components/chat/ChatView.tsx +52 -11
- package/components/chat/ContextBoundary.test.tsx +68 -1
- package/components/chat/ContextBoundary.tsx +92 -13
- package/components/chat/MessageList.test.tsx +31 -0
- package/components/chat/MessageList.tsx +49 -28
- package/components/chat/ToolList.test.tsx +92 -16
- package/components/chat/ToolList.tsx +59 -4
- package/components/chat/chat-helpers.test.tsx +24 -1
- package/components/chat/chat-helpers.ts +47 -4
- package/components/chat/useThreadActivity.test.tsx +113 -0
- package/components/chat/useThreadActivity.ts +94 -0
- package/components/chat/useThreadData.ts +16 -16
- package/components/chat/workflow-step-retry.ts +25 -0
- package/components/ui/BootScreen.tsx +17 -0
- package/components/ui/WorkflowChecklist.tsx +71 -33
- package/hooks/useSSE.ts +28 -3
- package/lib/agents/compaction-pipeline.test.ts +202 -0
- package/lib/agents/compaction-pipeline.ts +483 -0
- package/lib/agents/conversation-summary.ts +37 -21
- package/lib/agents/prepare/history-window.test.ts +18 -0
- package/lib/agents/prepare/history-window.ts +11 -2
- package/lib/agents/prepare/request.ts +4 -0
- package/lib/agents/prepare/system-prompt.test.ts +39 -0
- package/lib/agents/prepare/system-prompt.ts +8 -3
- package/lib/agents/prompt-registry.test.ts +5 -140
- package/lib/agents/prompt-registry.ts +45 -1
- package/lib/agents/prompt-variants.ts +146 -0
- package/lib/agents/run-registry.test.ts +22 -0
- package/lib/agents/run-registry.ts +29 -0
- package/lib/agents/run-thread.retry.test.ts +67 -1
- package/lib/agents/run-thread.ts +86 -1
- package/lib/agents/thread-activity.test.ts +31 -0
- package/lib/agents/thread-activity.ts +27 -0
- package/lib/agents/thread-compaction-state.test.ts +82 -0
- package/lib/agents/thread-compaction-state.ts +121 -0
- package/lib/agents/thread-compaction.test.ts +83 -4
- package/lib/agents/thread-compaction.ts +34 -11
- package/lib/agents/warm-summary-background.test.ts +219 -5
- package/lib/agents/warm-summary-background.ts +325 -142
- package/lib/agents/warm-topics.test.ts +37 -0
- package/lib/agents/warm-topics.ts +297 -0
- package/lib/agents/workflow-step-retry.test.ts +96 -0
- package/lib/agents/workflow-step-retry.ts +216 -0
- package/lib/api/browser-control.ts +0 -3
- package/lib/db/migrations.ts +5 -0
- package/lib/env/config.ts +2 -0
- package/lib/env/schema.ts +12 -0
- package/lib/lifecycle/changeset-build.test.ts +93 -0
- package/lib/lifecycle/changeset-build.ts +210 -0
- package/lib/lifecycle/changesets.test.ts +101 -0
- package/lib/lifecycle/changesets.ts +166 -0
- package/lib/lifecycle/surface-collect.test.ts +88 -0
- package/lib/lifecycle/surface-collect.ts +64 -0
- package/lib/lifecycle/surface-snapshot.test.ts +104 -0
- package/lib/lifecycle/surface-snapshot.ts +210 -0
- package/lib/memory/record.ts +0 -2
- package/lib/providers/external.ts +0 -2
- package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
- package/lib/stores/threads.test.ts +9 -0
- package/lib/stores/threads.ts +21 -11
- package/lib/stores/version-adoption.test.ts +96 -0
- package/lib/stores/version-adoption.ts +239 -26
- package/lib/stores/workflow-progress.ts +3 -0
- package/lib/tools/communications/ms-todo.ts +0 -7
- package/lib/tools/general/memory.ts +1 -1
- package/lib/tools/general/workflow-progress.ts +2 -0
- package/lib/tools/runtime/catalog.ts +1 -25
- package/lib/triggers/registry.ts +0 -4
- package/package.json +3 -3
- package/scripts/install-to-system.ps1 +39 -11
- package/scripts/install-to-system.sh +37 -3
- package/.next/standalone/.next/server/chunks/3979.js +0 -581
- package/.next/standalone/.next/server/chunks/5936.js +0 -594
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-36cb8b428b38b26a.js +0 -17
- /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_ssgManifest.js +0 -0
|
@@ -349,1061 +349,1061 @@ function buildSubprocessEnv(userEnv) {
|
|
|
349
349
|
|
|
350
350
|
/***/ }),
|
|
351
351
|
|
|
352
|
-
/***/
|
|
353
|
-
/***/ ((
|
|
354
|
-
|
|
355
|
-
module.exports = require("node:child_process");
|
|
352
|
+
/***/ 30977:
|
|
353
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
356
354
|
|
|
357
|
-
|
|
355
|
+
__webpack_require__.r(__webpack_exports__);
|
|
356
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
357
|
+
/* harmony export */ handler: () => (/* binding */ handler),
|
|
358
|
+
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
359
|
+
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
360
|
+
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
361
|
+
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
362
|
+
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
363
|
+
/* harmony export */ });
|
|
364
|
+
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
|
|
365
|
+
/* 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__);
|
|
366
|
+
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
|
|
367
|
+
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
368
|
+
/* 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__);
|
|
369
|
+
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
|
|
370
|
+
/* 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__);
|
|
371
|
+
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
|
|
372
|
+
/* 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__);
|
|
373
|
+
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
|
|
374
|
+
/* 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__);
|
|
375
|
+
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
|
|
376
|
+
/* 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__);
|
|
377
|
+
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
|
|
378
|
+
/* 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__);
|
|
379
|
+
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
|
|
380
|
+
/* 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__);
|
|
381
|
+
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
|
|
382
|
+
/* 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__);
|
|
383
|
+
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
|
|
384
|
+
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
|
|
385
|
+
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
|
|
386
|
+
/* 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__);
|
|
387
|
+
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
|
|
388
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
|
|
389
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
390
|
+
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
|
|
391
|
+
/* 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__);
|
|
392
|
+
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
|
|
393
|
+
/* 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__);
|
|
394
|
+
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
|
|
395
|
+
/* 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__);
|
|
358
396
|
|
|
359
|
-
/***/ 33873:
|
|
360
|
-
/***/ ((module) => {
|
|
361
397
|
|
|
362
|
-
module.exports = require("path");
|
|
363
398
|
|
|
364
|
-
/***/ }),
|
|
365
399
|
|
|
366
|
-
/***/ 37067:
|
|
367
|
-
/***/ ((module) => {
|
|
368
400
|
|
|
369
|
-
module.exports = require("node:http");
|
|
370
401
|
|
|
371
|
-
/***/ }),
|
|
372
402
|
|
|
373
|
-
/***/ 38522:
|
|
374
|
-
/***/ ((module) => {
|
|
375
403
|
|
|
376
|
-
module.exports = require("node:zlib");
|
|
377
404
|
|
|
378
|
-
/***/ }),
|
|
379
405
|
|
|
380
|
-
/***/ 39947:
|
|
381
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
382
406
|
|
|
383
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
384
|
-
/* harmony export */ Bm: () => (/* binding */ cachedJson),
|
|
385
|
-
/* harmony export */ HN: () => (/* binding */ notFoundResponse),
|
|
386
|
-
/* harmony export */ Jb: () => (/* binding */ validateBody),
|
|
387
|
-
/* harmony export */ K2: () => (/* binding */ createdResponse),
|
|
388
|
-
/* harmony export */ Ng: () => (/* binding */ noStoreJson),
|
|
389
|
-
/* harmony export */ yj: () => (/* binding */ errorResponse)
|
|
390
|
-
/* harmony export */ });
|
|
391
|
-
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
392
|
-
// Shared HTTP response builders for app/api/v1/** route handlers.
|
|
393
|
-
//
|
|
394
|
-
// Goal: every error/success payload across the v1 surface has the same
|
|
395
|
-
// shape. Before this lived inline, response bodies drifted —
|
|
396
|
-
// `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
|
|
397
|
-
// some routes returned Zod's raw issue array, others stringified it.
|
|
398
407
|
|
|
399
|
-
function errorResponse(message, status = 400) {
|
|
400
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
401
|
-
error: message
|
|
402
|
-
}, {
|
|
403
|
-
status
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
function notFoundResponse(message = "Not found") {
|
|
407
|
-
return errorResponse(message, 404);
|
|
408
|
-
}
|
|
409
|
-
function createdResponse(data) {
|
|
410
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
411
|
-
status: 201
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
// Wrap a 200 JSON response with a private Cache-Control header. Use on safe
|
|
415
|
-
// GET endpoints that serve user-scoped data the client refetches often (panel
|
|
416
|
-
// mounts, navigation back/forward) but mutates rarely. The TTL is short
|
|
417
|
-
// enough that explicit mutations — which patch the client-side ApiClient
|
|
418
|
-
// cache in place — stay observably consistent without an extra roundtrip.
|
|
419
|
-
//
|
|
420
|
-
// swrSeconds (optional): stale-while-revalidate window. When set, the browser
|
|
421
|
-
// serves the cached response immediately and refreshes in the background,
|
|
422
|
-
// making navigation feel instant. Use for data that can tolerate brief
|
|
423
|
-
// staleness (tool list, agent configs, model list). Omit for real-time data
|
|
424
|
-
// (dashboard metrics, credential state).
|
|
425
|
-
function cachedJson(data, maxAgeSeconds, swrSeconds) {
|
|
426
|
-
const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
|
|
427
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
428
|
-
headers: {
|
|
429
|
-
"Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
// Use for endpoints whose response contains live state that must never be
|
|
434
|
-
// served from cache — credentials, connection status, live config values.
|
|
435
|
-
function noStoreJson(data) {
|
|
436
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
437
|
-
headers: {
|
|
438
|
-
"Cache-Control": "no-store"
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
// Validate a JSON request body against a zod schema.
|
|
443
|
-
// Returns either the parsed data or a 400 NextResponse explaining the issue.
|
|
444
|
-
// Caller pattern:
|
|
445
|
-
// const parsed = await validateBody(req, Schema);
|
|
446
|
-
// if (parsed instanceof NextResponse) return parsed;
|
|
447
|
-
// // use parsed.field
|
|
448
|
-
async function validateBody(req, schema) {
|
|
449
|
-
let raw;
|
|
450
|
-
try {
|
|
451
|
-
raw = await req.json();
|
|
452
|
-
} catch {
|
|
453
|
-
return errorResponse("Request body must be valid JSON", 400);
|
|
454
|
-
}
|
|
455
|
-
const parsed = schema.safeParse(raw);
|
|
456
|
-
if (!parsed.success) {
|
|
457
|
-
return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
|
|
458
|
-
}
|
|
459
|
-
return parsed.data;
|
|
460
|
-
}
|
|
461
408
|
|
|
462
409
|
|
|
463
|
-
/***/ }),
|
|
464
410
|
|
|
465
|
-
/***/ 41720:
|
|
466
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
467
411
|
|
|
468
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
469
|
-
/* harmony export */ BM: () => (/* binding */ upsertAgentConfig),
|
|
470
|
-
/* harmony export */ E1: () => (/* binding */ updateAgentDisplayFilters),
|
|
471
|
-
/* harmony export */ P2: () => (/* binding */ parseCitationStrictness),
|
|
472
|
-
/* harmony export */ S2: () => (/* binding */ getAgentToolCredentials),
|
|
473
|
-
/* harmony export */ SJ: () => (/* binding */ generateAgentId),
|
|
474
|
-
/* harmony export */ TG: () => (/* binding */ getAgentTools),
|
|
475
|
-
/* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
|
|
476
|
-
/* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
|
|
477
|
-
/* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
|
|
478
|
-
/* harmony export */ mJ: () => (/* binding */ getAgentConfig),
|
|
479
|
-
/* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
|
|
480
|
-
/* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
|
|
481
|
-
/* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
|
|
482
|
-
/* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
|
|
483
|
-
/* harmony export */ zb: () => (/* binding */ listAgentConfigs)
|
|
484
|
-
/* harmony export */ });
|
|
485
|
-
/* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
|
486
|
-
/* harmony import */ var _lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99043);
|
|
487
|
-
/* harmony import */ var _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66849);
|
|
488
412
|
|
|
489
413
|
|
|
414
|
+
// We inject the nextConfigOutput here so that we can use them in the route
|
|
415
|
+
// module.
|
|
416
|
+
const nextConfigOutput = "standalone"
|
|
417
|
+
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
418
|
+
definition: {
|
|
419
|
+
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
420
|
+
page: "/api/v1/mcp-servers/[name]/route",
|
|
421
|
+
pathname: "/api/v1/mcp-servers/[name]",
|
|
422
|
+
filename: "route",
|
|
423
|
+
bundlePath: "app/api/v1/mcp-servers/[name]/route"
|
|
424
|
+
},
|
|
425
|
+
distDir: ".next" || 0,
|
|
426
|
+
relativeProjectDir: false || '',
|
|
427
|
+
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/mcp-servers/[name]/route.ts",
|
|
428
|
+
nextConfigOutput,
|
|
429
|
+
// The lazy require factory ensures that:
|
|
430
|
+
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
431
|
+
// correctly attributing module load time to application-code rather than
|
|
432
|
+
// framework internals.
|
|
433
|
+
// - In all modes: async modules (route files with top-level await) are
|
|
434
|
+
// handled correctly — require() returns a Promise for such modules, which
|
|
435
|
+
// ensureUserland() awaits before the first request is handled.
|
|
436
|
+
userland: ()=>__webpack_require__(54172),
|
|
437
|
+
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
438
|
+
// server HMR updates are picked up without re-executing the entry chunk.
|
|
439
|
+
// Using require() (synchronous) avoids adding async overhead that would be
|
|
440
|
+
// incorrectly attributed to application-code time in devRequestTiming.
|
|
441
|
+
... false ? 0 : {}
|
|
442
|
+
});
|
|
443
|
+
// Pull out the exports that we need to expose from the module. This should
|
|
444
|
+
// be eliminated when we've moved the other routes to the new format. These
|
|
445
|
+
// are used to hook into the route.
|
|
446
|
+
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
447
|
+
function patchFetch() {
|
|
448
|
+
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
449
|
+
workAsyncStorage,
|
|
450
|
+
workUnitAsyncStorage
|
|
451
|
+
});
|
|
452
|
+
}
|
|
490
453
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
if (value === "off" || value === "informational" || value === "standard" || value === "strict") {
|
|
495
|
-
return value;
|
|
454
|
+
async function handler(req, res, ctx) {
|
|
455
|
+
if (ctx.requestMeta) {
|
|
456
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
|
|
496
457
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
if (hot + warm + facts <= 0) return null;
|
|
518
|
-
return {
|
|
519
|
-
hot,
|
|
520
|
-
warm,
|
|
521
|
-
facts
|
|
522
|
-
};
|
|
523
|
-
} catch {
|
|
458
|
+
if (routeModule.isDev) {
|
|
459
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
|
460
|
+
}
|
|
461
|
+
let srcPage = "/api/v1/mcp-servers/[name]/route";
|
|
462
|
+
// turbopack doesn't normalize `/index` in the page name
|
|
463
|
+
// so we need to to process dynamic routes properly
|
|
464
|
+
// TODO: fix turbopack providing differing value from webpack
|
|
465
|
+
if (false) {} else if (srcPage === '/index') {
|
|
466
|
+
// we always normalize /index specifically
|
|
467
|
+
srcPage = '/';
|
|
468
|
+
}
|
|
469
|
+
const multiZoneDraftMode = false;
|
|
470
|
+
const prepareResult = await routeModule.prepare(req, res, {
|
|
471
|
+
srcPage,
|
|
472
|
+
multiZoneDraftMode
|
|
473
|
+
});
|
|
474
|
+
if (!prepareResult) {
|
|
475
|
+
res.statusCode = 400;
|
|
476
|
+
res.end('Bad Request');
|
|
477
|
+
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
|
524
478
|
return null;
|
|
525
479
|
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
//
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
ORDER BY a.is_default DESC, COALESCE(latest.last_message_at, a.created_at) DESC, a.id ASC`).all();
|
|
538
|
-
}
|
|
539
|
-
function getDefaultAgentConfig() {
|
|
540
|
-
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE is_default=1 LIMIT 1").get() ?? null;
|
|
541
|
-
}
|
|
542
|
-
function getAgentConfig(id) {
|
|
543
|
-
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE id=?").get(id) ?? null;
|
|
544
|
-
}
|
|
545
|
-
/**
|
|
546
|
-
* Parse the JSON-encoded delegate whitelist into a deduped string[]. Returns
|
|
547
|
-
* an empty array for NULL, blank, or malformed JSON (delegation is opt-in).
|
|
548
|
-
*/ /**
|
|
549
|
-
* Parse the agent's tool allowlist (`tools` column, stored as a JSON string).
|
|
550
|
-
* Returns an empty array on NULL/blank/malformed JSON — same defensive shape
|
|
551
|
-
* as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
|
|
552
|
-
* inline should switch to this getter so the serialization contract stays
|
|
553
|
-
* owned by this store.
|
|
554
|
-
*/ function getAgentTools(cfg) {
|
|
555
|
-
if (!cfg?.tools) return [];
|
|
556
|
-
try {
|
|
557
|
-
const parsed = JSON.parse(cfg.tools);
|
|
558
|
-
if (!Array.isArray(parsed)) return [];
|
|
559
|
-
return parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
560
|
-
} catch {
|
|
561
|
-
return [];
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
function parseDelegateTargets(raw) {
|
|
565
|
-
if (!raw) return [];
|
|
566
|
-
try {
|
|
567
|
-
const parsed = JSON.parse(raw);
|
|
568
|
-
if (!Array.isArray(parsed)) return [];
|
|
569
|
-
const ids = parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
570
|
-
return Array.from(new Set(ids));
|
|
571
|
-
} catch {
|
|
572
|
-
return [];
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Parse the per-agent `{ toolName: credentialId }` override map stored in
|
|
577
|
-
* the `tool_credentials` column. Returns an empty record on NULL / blank /
|
|
578
|
-
* malformed JSON / non-string entries so downstream code can treat the
|
|
579
|
-
* result as a plain lookup without further validation.
|
|
580
|
-
*/ function getAgentToolCredentials(cfg) {
|
|
581
|
-
if (!cfg?.tool_credentials) return {};
|
|
582
|
-
try {
|
|
583
|
-
const parsed = JSON.parse(cfg.tool_credentials);
|
|
584
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
585
|
-
const out = {};
|
|
586
|
-
for (const [k, v] of Object.entries(parsed)){
|
|
587
|
-
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
480
|
+
const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
|
|
481
|
+
const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
|
|
482
|
+
// Only this route's prerenders can establish ISR or admit generated params.
|
|
483
|
+
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]));
|
|
484
|
+
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
485
|
+
const render404 = async ()=>{
|
|
486
|
+
// TODO: should route-module itself handle rendering the 404
|
|
487
|
+
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
488
|
+
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
489
|
+
} else {
|
|
490
|
+
res.end('This page could not be found');
|
|
588
491
|
}
|
|
589
|
-
return
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
const existing = getAgentConfig(input.id);
|
|
601
|
-
const created_at = existing?.created_at ?? t;
|
|
602
|
-
const mbti = input.adaptive_mbti ?? toMbti(existing?.adaptive_mbti) ?? "INTJ";
|
|
603
|
-
const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
|
|
604
|
-
const strength = input.adaptive_persona_strength ?? preset.strength;
|
|
605
|
-
const empathy = input.adaptive_empathy ?? preset.empathy;
|
|
606
|
-
const expressiveness = input.adaptive_expressiveness ?? preset.expressiveness;
|
|
607
|
-
const verbosity = input.adaptive_verbosity ?? preset.verbosity;
|
|
608
|
-
if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
|
|
609
|
-
// harness_id: explicit `undefined` means "keep existing"; explicit `null`
|
|
610
|
-
// means "use the global default". Empty string is normalised to null too,
|
|
611
|
-
// matching how the AgentEditor sends "" for the inherit option.
|
|
612
|
-
const harnessId = input.harness_id === undefined ? existing?.harness_id ?? null : input.harness_id && input.harness_id.length > 0 ? input.harness_id : null;
|
|
613
|
-
// delegate_targets: undefined = keep existing; explicit empty array clears.
|
|
614
|
-
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))));
|
|
615
|
-
// context_tier_proportions: undefined = keep existing; null = clear and
|
|
616
|
-
// inherit from the model; object = serialise as JSON. Negative values are
|
|
617
|
-
// clamped to 0 so the upsert can't poison the column with bad data.
|
|
618
|
-
const tierProportions = input.context_tier_proportions === undefined ? existing?.context_tier_proportions ?? null : input.context_tier_proportions === null ? null : JSON.stringify({
|
|
619
|
-
hot: Math.max(0, Number(input.context_tier_proportions.hot) || 0),
|
|
620
|
-
warm: Math.max(0, Number(input.context_tier_proportions.warm) || 0),
|
|
621
|
-
facts: Math.max(0, Number(input.context_tier_proportions.facts) || 0)
|
|
622
|
-
});
|
|
623
|
-
// Anti-hallucination override: `undefined` keeps existing; `null` clears
|
|
624
|
-
// the override (inherits env). Empty-string model is normalised to null
|
|
625
|
-
// so the editor can ship "" for the inherit option.
|
|
626
|
-
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;
|
|
627
|
-
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;
|
|
628
|
-
const citationStrictness = input.citation_strictness === undefined ? parseCitationStrictness(existing?.citation_strictness) ?? "off" : parseCitationStrictness(input.citation_strictness) ?? "off";
|
|
629
|
-
const toolCredentials = serialiseToolCredentials(input.tool_credentials, existing?.tool_credentials ?? null);
|
|
630
|
-
const VALID_ROUTER_POLICIES = new Set([
|
|
631
|
-
"cheap",
|
|
632
|
-
"fast",
|
|
633
|
-
"balanced",
|
|
634
|
-
"quality"
|
|
635
|
-
]);
|
|
636
|
-
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;
|
|
637
|
-
const routerEnabled = input.router_enabled === undefined ? existing?.router_enabled ?? null : input.router_enabled === null ? null : input.router_enabled ? 1 : 0;
|
|
638
|
-
const VALID_USAGE_STRATEGIES = new Set([
|
|
639
|
-
"cost_saving",
|
|
640
|
-
"fast",
|
|
641
|
-
"balanced",
|
|
642
|
-
"high_reasoning"
|
|
643
|
-
]);
|
|
644
|
-
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;
|
|
645
|
-
const requestedWarmSummaryLimit = input.warm_summary_limit ?? existing?.warm_summary_limit ?? 50;
|
|
646
|
-
const warmSummaryLimit = Number.isFinite(requestedWarmSummaryLimit) ? Math.max(0, Math.floor(requestedWarmSummaryLimit)) : existing?.warm_summary_limit ?? 50;
|
|
647
|
-
db.prepare(`INSERT OR REPLACE INTO agent_configs
|
|
648
|
-
(id, name, icon, identity, instructions, tools, model_config_name, is_default,
|
|
649
|
-
history_limit, history_window_hours, warm_summary_limit, never_reply,
|
|
650
|
-
hot_turn_limit,
|
|
651
|
-
adaptive_persona_enabled, adaptive_persona_strength, adaptive_empathy, adaptive_expressiveness, adaptive_verbosity, adaptive_mbti,
|
|
652
|
-
voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
|
|
653
|
-
harness_id, delegate_targets, context_tier_proportions,
|
|
654
|
-
anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
|
|
655
|
-
tool_credentials, router_policy, router_enabled, usage_strategy,
|
|
656
|
-
created_at, updated_at)
|
|
657
|
-
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"
|
|
658
|
-
// (important for PATCH-style updates that omit the field).
|
|
659
|
-
input.never_reply === undefined ? existing?.never_reply ?? 0 : input.never_reply ? 1 : 0, Math.max(0, Math.floor(input.hot_turn_limit ?? existing?.hot_turn_limit ?? 12)), input.adaptive_persona_enabled === undefined ? existing?.adaptive_persona_enabled ?? 0 : input.adaptive_persona_enabled ? 1 : 0, clampPercent(strength, existing?.adaptive_persona_strength ?? 50), clampPercent(empathy, existing?.adaptive_empathy ?? 50), clampPercent(expressiveness, existing?.adaptive_expressiveness ?? 50), clampPercent(verbosity, existing?.adaptive_verbosity ?? 50), mbti, input.voice_enabled === undefined ? existing?.voice_enabled ?? 0 : input.voice_enabled ? 1 : 0, (input.voice_model ?? existing?.voice_model ?? "gemini-2.5-flash-preview-tts").trim() || "gemini-2.5-flash-preview-tts", (input.voice_name ?? existing?.voice_name ?? "Kore").trim() || "Kore", (input.voice_stt_model ?? existing?.voice_stt_model ?? "gemini-2.5-flash").trim() || "gemini-2.5-flash", input.voice_auto_speak === undefined ? existing?.voice_auto_speak ?? 1 : input.voice_auto_speak ? 1 : 0, harnessId, delegateTargets, tierProportions, antiHallucMode, antiHallucModel, citationStrictness, toolCredentials, routerPolicy, routerEnabled, usageStrategy, created_at, t);
|
|
660
|
-
return getAgentConfig(input.id);
|
|
661
|
-
}
|
|
662
|
-
function clampPercent(next, fallback) {
|
|
663
|
-
const n = Number.isFinite(next) ? Number(next) : fallback;
|
|
664
|
-
return Math.max(0, Math.min(100, Math.round(n)));
|
|
665
|
-
}
|
|
666
|
-
function serialiseToolCredentials(input, existing) {
|
|
667
|
-
if (input === undefined) return existing;
|
|
668
|
-
const cleaned = {};
|
|
669
|
-
for (const [k, v] of Object.entries(input)){
|
|
670
|
-
if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
|
|
671
|
-
cleaned[k] = v;
|
|
492
|
+
return null;
|
|
493
|
+
};
|
|
494
|
+
if (isIsr && !isDraftMode) {
|
|
495
|
+
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
496
|
+
if (prerenderInfo) {
|
|
497
|
+
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
498
|
+
if (nextConfig.adapterPath) {
|
|
499
|
+
return await render404();
|
|
500
|
+
}
|
|
501
|
+
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
502
|
+
}
|
|
672
503
|
}
|
|
673
504
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
return v in _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e ? v : null;
|
|
680
|
-
}
|
|
681
|
-
function deleteAgentConfig(id) {
|
|
682
|
-
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM agent_configs WHERE id=?").run(id).changes > 0;
|
|
683
|
-
}
|
|
684
|
-
function generateAgentId(name) {
|
|
685
|
-
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
686
|
-
const suffix = Math.random().toString(36).slice(2, 6);
|
|
687
|
-
return slug ? `${slug}-${suffix}` : `agent-${suffix}`;
|
|
688
|
-
}
|
|
689
|
-
// ── ADR-0022: per-agent message-channel display filters ─────────────────
|
|
690
|
-
// Canonical channel keys mirrored in `hooks/useMessageFilters.ts`. Kept
|
|
691
|
-
// in sync there by importing this constant — single source of truth.
|
|
692
|
-
const DISPLAY_FILTER_KEYS = [
|
|
693
|
-
"scheduled_task",
|
|
694
|
-
"watcher",
|
|
695
|
-
"bridge",
|
|
696
|
-
"extension",
|
|
697
|
-
"page_capture",
|
|
698
|
-
"synthetic",
|
|
699
|
-
"tool_use",
|
|
700
|
-
"thinking"
|
|
701
|
-
];
|
|
702
|
-
const DISPLAY_FILTER_DEFAULTS = {
|
|
703
|
-
scheduled_task: true,
|
|
704
|
-
watcher: true,
|
|
705
|
-
bridge: true,
|
|
706
|
-
extension: true,
|
|
707
|
-
page_capture: true,
|
|
708
|
-
synthetic: true,
|
|
709
|
-
tool_use: true,
|
|
710
|
-
thinking: true
|
|
711
|
-
};
|
|
712
|
-
function parseDisplayFilters(raw) {
|
|
713
|
-
if (!raw) return {
|
|
714
|
-
...DISPLAY_FILTER_DEFAULTS
|
|
715
|
-
};
|
|
716
|
-
try {
|
|
717
|
-
const parsed = JSON.parse(raw);
|
|
718
|
-
// Merge over defaults so newly-added channels stay visible on old rows.
|
|
719
|
-
return {
|
|
720
|
-
...DISPLAY_FILTER_DEFAULTS,
|
|
721
|
-
...parsed
|
|
722
|
-
};
|
|
723
|
-
} catch {
|
|
724
|
-
return {
|
|
725
|
-
...DISPLAY_FILTER_DEFAULTS
|
|
726
|
-
};
|
|
505
|
+
let cacheKey = null;
|
|
506
|
+
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
507
|
+
cacheKey = resolvedPathname;
|
|
508
|
+
// ensure /index and / is normalized to one key
|
|
509
|
+
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
727
510
|
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
if (
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
* from multiple browser tabs because the merge happens server-side.
|
|
738
|
-
*/ function updateAgentDisplayFilters(id, patch) {
|
|
739
|
-
const row = getAgentConfig(id);
|
|
740
|
-
if (!row) return null;
|
|
741
|
-
if (patch === null) {
|
|
742
|
-
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=NULL, updated_at=? WHERE id=?").run(now(), id);
|
|
743
|
-
return {
|
|
744
|
-
...DISPLAY_FILTER_DEFAULTS
|
|
745
|
-
};
|
|
511
|
+
// Before rendering (which initializes component tree modules), we have to
|
|
512
|
+
// set the reference manifests to our global store so Server Action's
|
|
513
|
+
// encryption util can access to them at the top level of the page module.
|
|
514
|
+
if (serverActionsManifest && clientReferenceManifest) {
|
|
515
|
+
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
516
|
+
page: srcPage,
|
|
517
|
+
clientReferenceManifest,
|
|
518
|
+
serverActionsManifest
|
|
519
|
+
});
|
|
746
520
|
}
|
|
747
|
-
const
|
|
748
|
-
const
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
spec: (0,_lib_crypto_envelope__WEBPACK_IMPORTED_MODULE_1__/* .decryptIfNeeded */ .qU)(row.spec)
|
|
521
|
+
const method = req.method || 'GET';
|
|
522
|
+
const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
|
|
523
|
+
const activeSpan = tracer.getActiveScopeSpan();
|
|
524
|
+
const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
|
|
525
|
+
const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
|
|
526
|
+
const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
|
|
527
|
+
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
528
|
+
globalThis.__incrementalCache = incrementalCache;
|
|
529
|
+
const context = {
|
|
530
|
+
params,
|
|
531
|
+
previewProps,
|
|
532
|
+
renderOpts: {
|
|
533
|
+
experimental: {
|
|
534
|
+
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
535
|
+
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
536
|
+
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
537
|
+
},
|
|
538
|
+
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
539
|
+
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
540
|
+
isDraftMode,
|
|
541
|
+
incrementalCache,
|
|
542
|
+
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
543
|
+
cacheLifeProfiles: nextConfig.cacheLife,
|
|
544
|
+
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
545
|
+
waitUntil: ctx.waitUntil,
|
|
546
|
+
onClose: (cb)=>{
|
|
547
|
+
res.on('close', cb);
|
|
548
|
+
},
|
|
549
|
+
onAfterTaskError: undefined
|
|
550
|
+
},
|
|
551
|
+
sharedContext: {
|
|
552
|
+
buildId,
|
|
553
|
+
deploymentId
|
|
554
|
+
}
|
|
782
555
|
};
|
|
556
|
+
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
557
|
+
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
558
|
+
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));
|
|
559
|
+
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
560
|
+
try {
|
|
561
|
+
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
562
|
+
res.statusCode = 404;
|
|
563
|
+
// on-demand revalidate always sets this header
|
|
564
|
+
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
565
|
+
res.end('This page could not be found');
|
|
566
|
+
return null;
|
|
567
|
+
}
|
|
568
|
+
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
569
|
+
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
570
|
+
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
571
|
+
// Attempt using provided waitUntil if available
|
|
572
|
+
// if it's not we fallback to sendResponse's handling
|
|
573
|
+
if (pendingWaitUntil) {
|
|
574
|
+
if (ctx.waitUntil) {
|
|
575
|
+
ctx.waitUntil(pendingWaitUntil);
|
|
576
|
+
pendingWaitUntil = undefined;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
const cacheTags = context.renderOpts.collectedTags;
|
|
580
|
+
// If the request is for a static response, we can cache it so long
|
|
581
|
+
// as it's not edge.
|
|
582
|
+
if (isIsr) {
|
|
583
|
+
const blob = await response.blob();
|
|
584
|
+
// Copy the headers from the response.
|
|
585
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
586
|
+
if (cacheTags) {
|
|
587
|
+
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
588
|
+
}
|
|
589
|
+
if (!headers['content-type'] && blob.type) {
|
|
590
|
+
headers['content-type'] = blob.type;
|
|
591
|
+
}
|
|
592
|
+
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
593
|
+
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
|
|
594
|
+
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
595
|
+
// build-time fallback in `build/index.ts` so cache entries
|
|
596
|
+
// and the response Cache-Control header agree on the route's
|
|
597
|
+
// effective expire. Routes that opt out of revalidation
|
|
598
|
+
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
599
|
+
// keep `expire: undefined`.
|
|
600
|
+
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
601
|
+
// Create the cache entry for the response.
|
|
602
|
+
const cacheEntry = {
|
|
603
|
+
value: {
|
|
604
|
+
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
605
|
+
status: response.status,
|
|
606
|
+
body: Buffer.from(await blob.arrayBuffer()),
|
|
607
|
+
headers
|
|
608
|
+
},
|
|
609
|
+
cacheControl: {
|
|
610
|
+
revalidate,
|
|
611
|
+
expire
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
return cacheEntry;
|
|
615
|
+
} else {
|
|
616
|
+
// send response without caching if not ISR
|
|
617
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
} catch (err) {
|
|
621
|
+
// if this is a background revalidate we need to report
|
|
622
|
+
// the request error here as it won't be bubbled
|
|
623
|
+
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
624
|
+
const silenceLog = false;
|
|
625
|
+
await routeModule.onRequestError(req, err, {
|
|
626
|
+
routerKind: 'App Router',
|
|
627
|
+
routePath: srcPage,
|
|
628
|
+
routeType: 'route',
|
|
629
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
630
|
+
isStaticGeneration: cacheKey !== null,
|
|
631
|
+
isOnDemandRevalidate
|
|
632
|
+
})
|
|
633
|
+
}, silenceLog, routerServerContext);
|
|
634
|
+
}
|
|
635
|
+
throw err;
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
const handleResponse = async (currentSpan, parentSpan)=>{
|
|
639
|
+
try {
|
|
640
|
+
var _cacheEntry_value;
|
|
641
|
+
const cacheEntry = await routeModule.handleResponse({
|
|
642
|
+
req,
|
|
643
|
+
nextConfig,
|
|
644
|
+
cacheKey,
|
|
645
|
+
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
646
|
+
isFallback: false,
|
|
647
|
+
previewProps,
|
|
648
|
+
prerenderManifest,
|
|
649
|
+
isRoutePPREnabled: false,
|
|
650
|
+
isOnDemandRevalidate,
|
|
651
|
+
revalidateOnlyGenerated,
|
|
652
|
+
responseGenerator,
|
|
653
|
+
waitUntil: ctx.waitUntil,
|
|
654
|
+
isMinimalMode
|
|
655
|
+
});
|
|
656
|
+
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
657
|
+
throw cacheEntry.error;
|
|
658
|
+
}
|
|
659
|
+
// we don't create a cacheEntry for ISR
|
|
660
|
+
if (!isIsr) {
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
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) {
|
|
664
|
+
var _cacheEntry_value1;
|
|
665
|
+
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
666
|
+
}
|
|
667
|
+
if (!isMinimalMode) {
|
|
668
|
+
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
669
|
+
}
|
|
670
|
+
// Draft mode should never be cached
|
|
671
|
+
if (isDraftMode) {
|
|
672
|
+
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
673
|
+
}
|
|
674
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
675
|
+
if (!(isMinimalMode && isIsr)) {
|
|
676
|
+
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
677
|
+
}
|
|
678
|
+
// If cache control is already set on the response we don't
|
|
679
|
+
// override it to allow users to customize it via next.config
|
|
680
|
+
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
681
|
+
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
682
|
+
}
|
|
683
|
+
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'.
|
|
684
|
+
new Response(cacheEntry.value.body, {
|
|
685
|
+
headers,
|
|
686
|
+
status: cacheEntry.value.status || 200
|
|
687
|
+
}));
|
|
688
|
+
return;
|
|
689
|
+
} catch (err) {
|
|
690
|
+
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
691
|
+
const silenceLog = false;
|
|
692
|
+
await routeModule.onRequestError(req, err, {
|
|
693
|
+
routerKind: 'App Router',
|
|
694
|
+
routePath: normalizedSrcPage,
|
|
695
|
+
routeType: 'route',
|
|
696
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
697
|
+
isStaticGeneration: cacheKey !== null,
|
|
698
|
+
isOnDemandRevalidate
|
|
699
|
+
})
|
|
700
|
+
}, silenceLog, routerServerContext);
|
|
701
|
+
}
|
|
702
|
+
// rethrow so that we can handle serving error page
|
|
703
|
+
// If this is during static generation, throw the error again.
|
|
704
|
+
if (isIsr) throw err;
|
|
705
|
+
// Otherwise, send a 500 response unless the original response has
|
|
706
|
+
// already committed. In that case, preserve its status code for
|
|
707
|
+
// telemetry while still recording the failure and terminating a response
|
|
708
|
+
// that the failed pipeline left open.
|
|
709
|
+
if (res.headersSent) {
|
|
710
|
+
if (currentSpan) {
|
|
711
|
+
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
712
|
+
currentSpan.recordException(error);
|
|
713
|
+
currentSpan.setStatus({
|
|
714
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
715
|
+
message: error.message
|
|
716
|
+
});
|
|
717
|
+
currentSpan.setAttribute('error.type', error.name);
|
|
718
|
+
}
|
|
719
|
+
if (!res.writableEnded && !res.destroyed) {
|
|
720
|
+
res.end();
|
|
721
|
+
}
|
|
722
|
+
} else {
|
|
723
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
724
|
+
status: 500
|
|
725
|
+
}));
|
|
726
|
+
}
|
|
727
|
+
return;
|
|
728
|
+
} finally{
|
|
729
|
+
;
|
|
730
|
+
(()=>{
|
|
731
|
+
if (!currentSpan) {
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
let statusCode = res.statusCode;
|
|
735
|
+
currentSpan.setAttributes({
|
|
736
|
+
'http.status_code': statusCode,
|
|
737
|
+
'next.rsc': false
|
|
738
|
+
});
|
|
739
|
+
if (statusCode && statusCode >= 500) {
|
|
740
|
+
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
741
|
+
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
742
|
+
currentSpan.setStatus({
|
|
743
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
744
|
+
});
|
|
745
|
+
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
746
|
+
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
747
|
+
}
|
|
748
|
+
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
749
|
+
// We were unable to get attributes, probably OTEL is not enabled
|
|
750
|
+
if (!rootSpanAttributes) {
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
754
|
+
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
758
|
+
const name = `${method} ${route}`;
|
|
759
|
+
currentSpan.setAttributes({
|
|
760
|
+
'next.route': route,
|
|
761
|
+
'http.route': route,
|
|
762
|
+
'next.span_name': name
|
|
763
|
+
});
|
|
764
|
+
currentSpan.updateName(name);
|
|
765
|
+
// Propagate http.route to the parent span if one exists (e.g.
|
|
766
|
+
// a platform-created HTTP span in adapter deployments).
|
|
767
|
+
if (parentSpan && parentSpan !== currentSpan) {
|
|
768
|
+
parentSpan.setAttribute('http.route', route);
|
|
769
|
+
parentSpan.updateName(name);
|
|
770
|
+
}
|
|
771
|
+
})();
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
// TODO: activeSpan code path is for when wrapped by
|
|
775
|
+
// next-server can be removed when this is no longer used
|
|
776
|
+
if (isWrappedByNextServer && activeSpan) {
|
|
777
|
+
await handleResponse(activeSpan, undefined);
|
|
778
|
+
} else {
|
|
779
|
+
let parentSpan = tracer.getActiveScopeSpan();
|
|
780
|
+
await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
|
|
781
|
+
spanName: `${method} ${srcPage}`,
|
|
782
|
+
kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
|
|
783
|
+
attributes: {
|
|
784
|
+
'http.method': method,
|
|
785
|
+
'http.target': req.url
|
|
786
|
+
}
|
|
787
|
+
}, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
|
|
788
|
+
}
|
|
783
789
|
}
|
|
784
|
-
function listMcpServers() {
|
|
785
|
-
const rows = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM mcp_servers ORDER BY name ASC").all();
|
|
786
|
-
return rows.map(decryptRow);
|
|
787
|
-
}
|
|
788
|
-
function getMcpServer(name) {
|
|
789
|
-
const row = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM mcp_servers WHERE name=?").get(name) ?? null;
|
|
790
|
-
return row ? decryptRow(row) : null;
|
|
791
|
-
}
|
|
792
|
-
function upsertMcpServer(input) {
|
|
793
|
-
const t = now();
|
|
794
|
-
const existing = getMcpServer(input.name);
|
|
795
|
-
const created_at = existing?.created_at ?? t;
|
|
796
|
-
const enabled = input.enabled === false ? 0 : 1;
|
|
797
|
-
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`INSERT OR REPLACE INTO mcp_servers (name, transport, spec, enabled, last_error, created_at, updated_at)
|
|
798
|
-
VALUES (?, ?, ?, ?, NULL, ?, ?)`).run(input.name, input.transport, (0,_lib_crypto_envelope__WEBPACK_IMPORTED_MODULE_1__/* .encrypt */ .w)(JSON.stringify(input.spec)), enabled, created_at, t);
|
|
799
|
-
return getMcpServer(input.name);
|
|
800
|
-
}
|
|
801
|
-
function deleteMcpServer(name) {
|
|
802
|
-
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM mcp_servers WHERE name=?").run(name).changes > 0;
|
|
803
|
-
}
|
|
804
|
-
function setMcpServerError(name, error) {
|
|
805
|
-
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE mcp_servers SET last_error=?, updated_at=? WHERE name=?").run(error, now(), name);
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
/***/ }),
|
|
810
|
-
|
|
811
|
-
/***/ 44708:
|
|
812
|
-
/***/ ((module) => {
|
|
813
|
-
|
|
814
|
-
module.exports = require("node:https");
|
|
815
|
-
|
|
816
|
-
/***/ }),
|
|
817
|
-
|
|
818
|
-
/***/ 44870:
|
|
819
|
-
/***/ ((module) => {
|
|
820
|
-
|
|
821
|
-
module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
|
|
822
|
-
|
|
823
|
-
/***/ }),
|
|
824
|
-
|
|
825
|
-
/***/ 48161:
|
|
826
|
-
/***/ ((module) => {
|
|
827
|
-
|
|
828
|
-
module.exports = require("node:os");
|
|
829
|
-
|
|
830
|
-
/***/ }),
|
|
831
|
-
|
|
832
|
-
/***/ 51455:
|
|
833
|
-
/***/ ((module) => {
|
|
834
|
-
|
|
835
|
-
module.exports = require("node:fs/promises");
|
|
836
|
-
|
|
837
|
-
/***/ }),
|
|
838
|
-
|
|
839
|
-
/***/ 53638:
|
|
840
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
841
|
-
|
|
842
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
843
|
-
/* harmony export */ p: () => (/* binding */ parseJsonSafe)
|
|
844
|
-
/* harmony export */ });
|
|
845
|
-
// JSON.parse with a fallback value when the input is malformed (or empty).
|
|
846
|
-
// Used everywhere we read responses from external APIs — they're contractually
|
|
847
|
-
// JSON but a transient 502 / proxy interstitial occasionally returns HTML.
|
|
848
|
-
function parseJsonSafe(text, fallback) {
|
|
849
|
-
try {
|
|
850
|
-
return JSON.parse(text);
|
|
851
|
-
} catch {
|
|
852
|
-
return fallback;
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
/***/ }),
|
|
858
|
-
|
|
859
|
-
/***/ 54172:
|
|
860
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
861
|
-
|
|
862
|
-
__webpack_require__.r(__webpack_exports__);
|
|
863
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
864
|
-
/* harmony export */ DELETE: () => (/* binding */ DELETE),
|
|
865
|
-
/* harmony export */ GET: () => (/* binding */ GET),
|
|
866
|
-
/* harmony export */ PUT: () => (/* binding */ PUT)
|
|
867
|
-
/* harmony export */ });
|
|
868
|
-
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
869
|
-
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97377);
|
|
870
|
-
/* harmony import */ var _lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42666);
|
|
871
|
-
/* harmony import */ var _lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30572);
|
|
872
|
-
/* harmony import */ var _lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85678);
|
|
873
|
-
/* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(39947);
|
|
874
|
-
/* harmony import */ var _lib_utils_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(53638);
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
const PutBody = zod__WEBPACK_IMPORTED_MODULE_5__/* .object */ .Ikc({
|
|
883
|
-
transport: zod__WEBPACK_IMPORTED_MODULE_5__/* ["enum"] */ .k5n([
|
|
884
|
-
"stdio",
|
|
885
|
-
"http"
|
|
886
|
-
]).optional(),
|
|
887
|
-
spec: zod__WEBPACK_IMPORTED_MODULE_5__/* .record */ .g1P(zod__WEBPACK_IMPORTED_MODULE_5__/* .string */ .YjP(), zod__WEBPACK_IMPORTED_MODULE_5__/* .unknown */ .L5J()).optional(),
|
|
888
|
-
enabled: zod__WEBPACK_IMPORTED_MODULE_5__/* .boolean */ .zMY().optional()
|
|
889
|
-
});
|
|
890
|
-
async function GET(_req, { params }) {
|
|
891
|
-
const { name } = await params;
|
|
892
|
-
const r = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .getMcpServer */ .cw)(name);
|
|
893
|
-
if (!r) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
894
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json((0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__/* .mcpServerToResponse */ .sU)(r));
|
|
895
|
-
}
|
|
896
|
-
async function PUT(req, { params }) {
|
|
897
|
-
const { name } = await params;
|
|
898
|
-
const existing = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .getMcpServer */ .cw)(name);
|
|
899
|
-
if (!existing) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
900
|
-
const body = await (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .validateBody */ .Jb)(req, PutBody);
|
|
901
|
-
if (body instanceof next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse) return body;
|
|
902
|
-
const row = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .upsertMcpServer */ .te)({
|
|
903
|
-
name,
|
|
904
|
-
transport: body.transport ?? existing.transport,
|
|
905
|
-
spec: body.spec ?? (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_6__/* .parseJsonSafe */ .p)(existing.spec, {}),
|
|
906
|
-
enabled: body.enabled ?? existing.enabled === 1
|
|
907
|
-
});
|
|
908
|
-
(0,_lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__/* .invalidateMcpTools */ .H_)();
|
|
909
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json((0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__/* .mcpServerToResponse */ .sU)(row));
|
|
910
|
-
}
|
|
911
|
-
async function DELETE(_req, { params }) {
|
|
912
|
-
const { name } = await params;
|
|
913
|
-
const ok = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .deleteMcpServer */ .le)(name);
|
|
914
|
-
if (!ok) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
915
|
-
(0,_lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__/* .invalidateMcpTools */ .H_)();
|
|
916
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
917
|
-
deleted: true
|
|
918
|
-
});
|
|
919
|
-
}
|
|
920
|
-
|
|
921
790
|
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
/***/ 55511:
|
|
925
|
-
/***/ ((module) => {
|
|
926
|
-
|
|
927
|
-
module.exports = require("crypto");
|
|
928
|
-
|
|
929
|
-
/***/ }),
|
|
930
|
-
|
|
931
|
-
/***/ 55591:
|
|
932
|
-
/***/ ((module) => {
|
|
791
|
+
//# sourceMappingURL=app-route.js.map
|
|
933
792
|
|
|
934
|
-
module.exports = require("https");
|
|
935
793
|
|
|
936
794
|
/***/ }),
|
|
937
795
|
|
|
938
|
-
/***/
|
|
796
|
+
/***/ 31421:
|
|
939
797
|
/***/ ((module) => {
|
|
940
798
|
|
|
941
|
-
module.exports = require("node:
|
|
799
|
+
module.exports = require("node:child_process");
|
|
942
800
|
|
|
943
801
|
/***/ }),
|
|
944
802
|
|
|
945
|
-
/***/
|
|
803
|
+
/***/ 33873:
|
|
946
804
|
/***/ ((module) => {
|
|
947
805
|
|
|
948
|
-
module.exports = require("
|
|
806
|
+
module.exports = require("path");
|
|
949
807
|
|
|
950
808
|
/***/ }),
|
|
951
809
|
|
|
952
|
-
/***/
|
|
810
|
+
/***/ 37067:
|
|
953
811
|
/***/ ((module) => {
|
|
954
812
|
|
|
955
|
-
module.exports = require("
|
|
813
|
+
module.exports = require("node:http");
|
|
956
814
|
|
|
957
815
|
/***/ }),
|
|
958
816
|
|
|
959
|
-
/***/
|
|
817
|
+
/***/ 38522:
|
|
960
818
|
/***/ ((module) => {
|
|
961
819
|
|
|
962
|
-
module.exports = require("node:
|
|
820
|
+
module.exports = require("node:zlib");
|
|
963
821
|
|
|
964
822
|
/***/ }),
|
|
965
823
|
|
|
966
|
-
/***/
|
|
824
|
+
/***/ 39947:
|
|
967
825
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
968
826
|
|
|
969
|
-
__webpack_require__.r(__webpack_exports__);
|
|
970
827
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
971
|
-
/* harmony export */
|
|
972
|
-
/* harmony export */
|
|
973
|
-
/* harmony export */
|
|
974
|
-
/* harmony export */
|
|
975
|
-
/* harmony export */
|
|
976
|
-
/* harmony export */
|
|
828
|
+
/* harmony export */ Bm: () => (/* binding */ cachedJson),
|
|
829
|
+
/* harmony export */ HN: () => (/* binding */ notFoundResponse),
|
|
830
|
+
/* harmony export */ Jb: () => (/* binding */ validateBody),
|
|
831
|
+
/* harmony export */ K2: () => (/* binding */ createdResponse),
|
|
832
|
+
/* harmony export */ Ng: () => (/* binding */ noStoreJson),
|
|
833
|
+
/* harmony export */ yj: () => (/* binding */ errorResponse)
|
|
977
834
|
/* harmony export */ });
|
|
978
|
-
/* harmony import */ var
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
|
|
986
|
-
/* 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__);
|
|
987
|
-
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
|
|
988
|
-
/* 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__);
|
|
989
|
-
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
|
|
990
|
-
/* 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__);
|
|
991
|
-
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
|
|
992
|
-
/* 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__);
|
|
993
|
-
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
|
|
994
|
-
/* 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__);
|
|
995
|
-
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
|
|
996
|
-
/* 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__);
|
|
997
|
-
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
|
|
998
|
-
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
|
|
999
|
-
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
|
|
1000
|
-
/* 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__);
|
|
1001
|
-
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
|
|
1002
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
|
|
1003
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
1004
|
-
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
|
|
1005
|
-
/* 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__);
|
|
1006
|
-
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
|
|
1007
|
-
/* 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__);
|
|
1008
|
-
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
|
|
1009
|
-
/* 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__);
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
835
|
+
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
836
|
+
// Shared HTTP response builders for app/api/v1/** route handlers.
|
|
837
|
+
//
|
|
838
|
+
// Goal: every error/success payload across the v1 surface has the same
|
|
839
|
+
// shape. Before this lived inline, response bodies drifted —
|
|
840
|
+
// `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
|
|
841
|
+
// some routes returned Zod's raw issue array, others stringified it.
|
|
1027
842
|
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
1034
|
-
page: "/api/v1/mcp-servers/[name]/route",
|
|
1035
|
-
pathname: "/api/v1/mcp-servers/[name]",
|
|
1036
|
-
filename: "route",
|
|
1037
|
-
bundlePath: "app/api/v1/mcp-servers/[name]/route"
|
|
1038
|
-
},
|
|
1039
|
-
distDir: ".next" || 0,
|
|
1040
|
-
relativeProjectDir: false || '',
|
|
1041
|
-
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/mcp-servers/[name]/route.ts",
|
|
1042
|
-
nextConfigOutput,
|
|
1043
|
-
// The lazy require factory ensures that:
|
|
1044
|
-
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
1045
|
-
// correctly attributing module load time to application-code rather than
|
|
1046
|
-
// framework internals.
|
|
1047
|
-
// - In all modes: async modules (route files with top-level await) are
|
|
1048
|
-
// handled correctly — require() returns a Promise for such modules, which
|
|
1049
|
-
// ensureUserland() awaits before the first request is handled.
|
|
1050
|
-
userland: ()=>__webpack_require__(54172),
|
|
1051
|
-
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
1052
|
-
// server HMR updates are picked up without re-executing the entry chunk.
|
|
1053
|
-
// Using require() (synchronous) avoids adding async overhead that would be
|
|
1054
|
-
// incorrectly attributed to application-code time in devRequestTiming.
|
|
1055
|
-
... false ? 0 : {}
|
|
1056
|
-
});
|
|
1057
|
-
// Pull out the exports that we need to expose from the module. This should
|
|
1058
|
-
// be eliminated when we've moved the other routes to the new format. These
|
|
1059
|
-
// are used to hook into the route.
|
|
1060
|
-
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
1061
|
-
function patchFetch() {
|
|
1062
|
-
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
1063
|
-
workAsyncStorage,
|
|
1064
|
-
workUnitAsyncStorage
|
|
843
|
+
function errorResponse(message, status = 400) {
|
|
844
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
845
|
+
error: message
|
|
846
|
+
}, {
|
|
847
|
+
status
|
|
1065
848
|
});
|
|
1066
849
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
850
|
+
function notFoundResponse(message = "Not found") {
|
|
851
|
+
return errorResponse(message, 404);
|
|
852
|
+
}
|
|
853
|
+
function createdResponse(data) {
|
|
854
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
855
|
+
status: 201
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
// Wrap a 200 JSON response with a private Cache-Control header. Use on safe
|
|
859
|
+
// GET endpoints that serve user-scoped data the client refetches often (panel
|
|
860
|
+
// mounts, navigation back/forward) but mutates rarely. The TTL is short
|
|
861
|
+
// enough that explicit mutations — which patch the client-side ApiClient
|
|
862
|
+
// cache in place — stay observably consistent without an extra roundtrip.
|
|
863
|
+
//
|
|
864
|
+
// swrSeconds (optional): stale-while-revalidate window. When set, the browser
|
|
865
|
+
// serves the cached response immediately and refreshes in the background,
|
|
866
|
+
// making navigation feel instant. Use for data that can tolerate brief
|
|
867
|
+
// staleness (tool list, agent configs, model list). Omit for real-time data
|
|
868
|
+
// (dashboard metrics, credential state).
|
|
869
|
+
function cachedJson(data, maxAgeSeconds, swrSeconds) {
|
|
870
|
+
const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
|
|
871
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
872
|
+
headers: {
|
|
873
|
+
"Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
|
|
874
|
+
}
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
// Use for endpoints whose response contains live state that must never be
|
|
878
|
+
// served from cache — credentials, connection status, live config values.
|
|
879
|
+
function noStoreJson(data) {
|
|
880
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
881
|
+
headers: {
|
|
882
|
+
"Cache-Control": "no-store"
|
|
883
|
+
}
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
// Validate a JSON request body against a zod schema.
|
|
887
|
+
// Returns either the parsed data or a 400 NextResponse explaining the issue.
|
|
888
|
+
// Caller pattern:
|
|
889
|
+
// const parsed = await validateBody(req, Schema);
|
|
890
|
+
// if (parsed instanceof NextResponse) return parsed;
|
|
891
|
+
// // use parsed.field
|
|
892
|
+
async function validateBody(req, schema) {
|
|
893
|
+
let raw;
|
|
894
|
+
try {
|
|
895
|
+
raw = await req.json();
|
|
896
|
+
} catch {
|
|
897
|
+
return errorResponse("Request body must be valid JSON", 400);
|
|
1074
898
|
}
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
// TODO: fix turbopack providing differing value from webpack
|
|
1079
|
-
if (false) {} else if (srcPage === '/index') {
|
|
1080
|
-
// we always normalize /index specifically
|
|
1081
|
-
srcPage = '/';
|
|
899
|
+
const parsed = schema.safeParse(raw);
|
|
900
|
+
if (!parsed.success) {
|
|
901
|
+
return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
|
|
1082
902
|
}
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
903
|
+
return parsed.data;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
/***/ }),
|
|
908
|
+
|
|
909
|
+
/***/ 41720:
|
|
910
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
911
|
+
|
|
912
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
913
|
+
/* harmony export */ BM: () => (/* binding */ upsertAgentConfig),
|
|
914
|
+
/* harmony export */ E1: () => (/* binding */ updateAgentDisplayFilters),
|
|
915
|
+
/* harmony export */ P2: () => (/* binding */ parseCitationStrictness),
|
|
916
|
+
/* harmony export */ S2: () => (/* binding */ getAgentToolCredentials),
|
|
917
|
+
/* harmony export */ SJ: () => (/* binding */ generateAgentId),
|
|
918
|
+
/* harmony export */ TG: () => (/* binding */ getAgentTools),
|
|
919
|
+
/* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
|
|
920
|
+
/* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
|
|
921
|
+
/* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
|
|
922
|
+
/* harmony export */ mJ: () => (/* binding */ getAgentConfig),
|
|
923
|
+
/* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
|
|
924
|
+
/* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
|
|
925
|
+
/* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
|
|
926
|
+
/* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
|
|
927
|
+
/* harmony export */ zb: () => (/* binding */ listAgentConfigs)
|
|
928
|
+
/* harmony export */ });
|
|
929
|
+
/* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
|
930
|
+
/* harmony import */ var _lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99043);
|
|
931
|
+
/* harmony import */ var _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66849);
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
const now = ()=>new Date().toISOString();
|
|
936
|
+
/** Coerce arbitrary input (DB row TEXT, API body, undefined) to the enum.
|
|
937
|
+
* Returns `null` for null/undefined/unknown values so callers can default. */ function parseCitationStrictness(value) {
|
|
938
|
+
if (value === "off" || value === "informational" || value === "standard" || value === "strict") {
|
|
939
|
+
return value;
|
|
1093
940
|
}
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
941
|
+
return null;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Parse the JSON-encoded per-agent override of context tier proportions.
|
|
945
|
+
* Returns `null` for NULL, blank, malformed JSON, or any payload that
|
|
946
|
+
* doesn't have three finite non-negative numeric fields. Callers fall
|
|
947
|
+
* back to the model config's value (or built-in defaults) on null.
|
|
948
|
+
*/ function getAgentTierProportions(row) {
|
|
949
|
+
const raw = row.context_tier_proportions;
|
|
950
|
+
if (!raw) return null;
|
|
951
|
+
try {
|
|
952
|
+
const parsed = JSON.parse(raw);
|
|
953
|
+
const hot = Number(parsed.hot);
|
|
954
|
+
const warm = Number(parsed.warm);
|
|
955
|
+
const facts = Number(parsed.facts);
|
|
956
|
+
if (![
|
|
957
|
+
hot,
|
|
958
|
+
warm,
|
|
959
|
+
facts
|
|
960
|
+
].every((n)=>Number.isFinite(n) && n >= 0)) return null;
|
|
961
|
+
if (hot + warm + facts <= 0) return null;
|
|
962
|
+
return {
|
|
963
|
+
hot,
|
|
964
|
+
warm,
|
|
965
|
+
facts
|
|
966
|
+
};
|
|
967
|
+
} catch {
|
|
1106
968
|
return null;
|
|
1107
|
-
};
|
|
1108
|
-
if (isIsr && !isDraftMode) {
|
|
1109
|
-
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
1110
|
-
if (prerenderInfo) {
|
|
1111
|
-
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
1112
|
-
if (nextConfig.adapterPath) {
|
|
1113
|
-
return await render404();
|
|
1114
|
-
}
|
|
1115
|
-
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
969
|
}
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
970
|
+
}
|
|
971
|
+
function listAgentConfigs() {
|
|
972
|
+
// Default agent always first; then by the timestamp of each agent's latest message.
|
|
973
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT a.*
|
|
974
|
+
FROM agent_configs a
|
|
975
|
+
LEFT JOIN (
|
|
976
|
+
SELECT t.agent_id, MAX(m.created_at) AS last_message_at
|
|
977
|
+
FROM threads t
|
|
978
|
+
JOIN messages m ON m.thread_id = t.thread_id
|
|
979
|
+
GROUP BY t.agent_id
|
|
980
|
+
) latest ON latest.agent_id = a.id
|
|
981
|
+
ORDER BY a.is_default DESC, COALESCE(latest.last_message_at, a.created_at) DESC, a.id ASC`).all();
|
|
982
|
+
}
|
|
983
|
+
function getDefaultAgentConfig() {
|
|
984
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE is_default=1 LIMIT 1").get() ?? null;
|
|
985
|
+
}
|
|
986
|
+
function getAgentConfig(id) {
|
|
987
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE id=?").get(id) ?? null;
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* Parse the JSON-encoded delegate whitelist into a deduped string[]. Returns
|
|
991
|
+
* an empty array for NULL, blank, or malformed JSON (delegation is opt-in).
|
|
992
|
+
*/ /**
|
|
993
|
+
* Parse the agent's tool allowlist (`tools` column, stored as a JSON string).
|
|
994
|
+
* Returns an empty array on NULL/blank/malformed JSON — same defensive shape
|
|
995
|
+
* as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
|
|
996
|
+
* inline should switch to this getter so the serialization contract stays
|
|
997
|
+
* owned by this store.
|
|
998
|
+
*/ function getAgentTools(cfg) {
|
|
999
|
+
if (!cfg?.tools) return [];
|
|
1000
|
+
try {
|
|
1001
|
+
const parsed = JSON.parse(cfg.tools);
|
|
1002
|
+
if (!Array.isArray(parsed)) return [];
|
|
1003
|
+
return parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
1004
|
+
} catch {
|
|
1005
|
+
return [];
|
|
1124
1006
|
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
(
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1007
|
+
}
|
|
1008
|
+
function parseDelegateTargets(raw) {
|
|
1009
|
+
if (!raw) return [];
|
|
1010
|
+
try {
|
|
1011
|
+
const parsed = JSON.parse(raw);
|
|
1012
|
+
if (!Array.isArray(parsed)) return [];
|
|
1013
|
+
const ids = parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
1014
|
+
return Array.from(new Set(ids));
|
|
1015
|
+
} catch {
|
|
1016
|
+
return [];
|
|
1134
1017
|
}
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
1150
|
-
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
1151
|
-
},
|
|
1152
|
-
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
1153
|
-
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
1154
|
-
isDraftMode,
|
|
1155
|
-
incrementalCache,
|
|
1156
|
-
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
1157
|
-
cacheLifeProfiles: nextConfig.cacheLife,
|
|
1158
|
-
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
1159
|
-
waitUntil: ctx.waitUntil,
|
|
1160
|
-
onClose: (cb)=>{
|
|
1161
|
-
res.on('close', cb);
|
|
1162
|
-
},
|
|
1163
|
-
onAfterTaskError: undefined
|
|
1164
|
-
},
|
|
1165
|
-
sharedContext: {
|
|
1166
|
-
buildId,
|
|
1167
|
-
deploymentId
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* Parse the per-agent `{ toolName: credentialId }` override map stored in
|
|
1021
|
+
* the `tool_credentials` column. Returns an empty record on NULL / blank /
|
|
1022
|
+
* malformed JSON / non-string entries so downstream code can treat the
|
|
1023
|
+
* result as a plain lookup without further validation.
|
|
1024
|
+
*/ function getAgentToolCredentials(cfg) {
|
|
1025
|
+
if (!cfg?.tool_credentials) return {};
|
|
1026
|
+
try {
|
|
1027
|
+
const parsed = JSON.parse(cfg.tool_credentials);
|
|
1028
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
1029
|
+
const out = {};
|
|
1030
|
+
for (const [k, v] of Object.entries(parsed)){
|
|
1031
|
+
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
1168
1032
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
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
|
-
|
|
1033
|
+
return out;
|
|
1034
|
+
} catch {
|
|
1035
|
+
return {};
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
function upsertAgentConfig(input) {
|
|
1039
|
+
return (0,_lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__/* .withDbTransaction */ .J)(()=>upsertAgentConfigTransaction(input));
|
|
1040
|
+
}
|
|
1041
|
+
function upsertAgentConfigTransaction(input) {
|
|
1042
|
+
const t = now();
|
|
1043
|
+
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
1044
|
+
const existing = getAgentConfig(input.id);
|
|
1045
|
+
const created_at = existing?.created_at ?? t;
|
|
1046
|
+
const mbti = input.adaptive_mbti ?? toMbti(existing?.adaptive_mbti) ?? "INTJ";
|
|
1047
|
+
const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
|
|
1048
|
+
const strength = input.adaptive_persona_strength ?? preset.strength;
|
|
1049
|
+
const empathy = input.adaptive_empathy ?? preset.empathy;
|
|
1050
|
+
const expressiveness = input.adaptive_expressiveness ?? preset.expressiveness;
|
|
1051
|
+
const verbosity = input.adaptive_verbosity ?? preset.verbosity;
|
|
1052
|
+
if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
|
|
1053
|
+
// harness_id: explicit `undefined` means "keep existing"; explicit `null`
|
|
1054
|
+
// means "use the global default". Empty string is normalised to null too,
|
|
1055
|
+
// matching how the AgentEditor sends "" for the inherit option.
|
|
1056
|
+
const harnessId = input.harness_id === undefined ? existing?.harness_id ?? null : input.harness_id && input.harness_id.length > 0 ? input.harness_id : null;
|
|
1057
|
+
// delegate_targets: undefined = keep existing; explicit empty array clears.
|
|
1058
|
+
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))));
|
|
1059
|
+
// context_tier_proportions: undefined = keep existing; null = clear and
|
|
1060
|
+
// inherit from the model; object = serialise as JSON. Negative values are
|
|
1061
|
+
// clamped to 0 so the upsert can't poison the column with bad data.
|
|
1062
|
+
const tierProportions = input.context_tier_proportions === undefined ? existing?.context_tier_proportions ?? null : input.context_tier_proportions === null ? null : JSON.stringify({
|
|
1063
|
+
hot: Math.max(0, Number(input.context_tier_proportions.hot) || 0),
|
|
1064
|
+
warm: Math.max(0, Number(input.context_tier_proportions.warm) || 0),
|
|
1065
|
+
facts: Math.max(0, Number(input.context_tier_proportions.facts) || 0)
|
|
1066
|
+
});
|
|
1067
|
+
// Anti-hallucination override: `undefined` keeps existing; `null` clears
|
|
1068
|
+
// the override (inherits env). Empty-string model is normalised to null
|
|
1069
|
+
// so the editor can ship "" for the inherit option.
|
|
1070
|
+
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;
|
|
1071
|
+
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;
|
|
1072
|
+
const citationStrictness = input.citation_strictness === undefined ? parseCitationStrictness(existing?.citation_strictness) ?? "off" : parseCitationStrictness(input.citation_strictness) ?? "off";
|
|
1073
|
+
const toolCredentials = serialiseToolCredentials(input.tool_credentials, existing?.tool_credentials ?? null);
|
|
1074
|
+
const VALID_ROUTER_POLICIES = new Set([
|
|
1075
|
+
"cheap",
|
|
1076
|
+
"fast",
|
|
1077
|
+
"balanced",
|
|
1078
|
+
"quality"
|
|
1079
|
+
]);
|
|
1080
|
+
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;
|
|
1081
|
+
const routerEnabled = input.router_enabled === undefined ? existing?.router_enabled ?? null : input.router_enabled === null ? null : input.router_enabled ? 1 : 0;
|
|
1082
|
+
const VALID_USAGE_STRATEGIES = new Set([
|
|
1083
|
+
"cost_saving",
|
|
1084
|
+
"fast",
|
|
1085
|
+
"balanced",
|
|
1086
|
+
"high_reasoning"
|
|
1087
|
+
]);
|
|
1088
|
+
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;
|
|
1089
|
+
const requestedWarmSummaryLimit = input.warm_summary_limit ?? existing?.warm_summary_limit ?? 50;
|
|
1090
|
+
const warmSummaryLimit = Number.isFinite(requestedWarmSummaryLimit) ? Math.max(0, Math.floor(requestedWarmSummaryLimit)) : existing?.warm_summary_limit ?? 50;
|
|
1091
|
+
db.prepare(`INSERT OR REPLACE INTO agent_configs
|
|
1092
|
+
(id, name, icon, identity, instructions, tools, model_config_name, is_default,
|
|
1093
|
+
history_limit, history_window_hours, warm_summary_limit, never_reply,
|
|
1094
|
+
hot_turn_limit,
|
|
1095
|
+
adaptive_persona_enabled, adaptive_persona_strength, adaptive_empathy, adaptive_expressiveness, adaptive_verbosity, adaptive_mbti,
|
|
1096
|
+
voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
|
|
1097
|
+
harness_id, delegate_targets, context_tier_proportions,
|
|
1098
|
+
anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
|
|
1099
|
+
tool_credentials, router_policy, router_enabled, usage_strategy,
|
|
1100
|
+
created_at, updated_at)
|
|
1101
|
+
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"
|
|
1102
|
+
// (important for PATCH-style updates that omit the field).
|
|
1103
|
+
input.never_reply === undefined ? existing?.never_reply ?? 0 : input.never_reply ? 1 : 0, Math.max(0, Math.floor(input.hot_turn_limit ?? existing?.hot_turn_limit ?? 12)), input.adaptive_persona_enabled === undefined ? existing?.adaptive_persona_enabled ?? 0 : input.adaptive_persona_enabled ? 1 : 0, clampPercent(strength, existing?.adaptive_persona_strength ?? 50), clampPercent(empathy, existing?.adaptive_empathy ?? 50), clampPercent(expressiveness, existing?.adaptive_expressiveness ?? 50), clampPercent(verbosity, existing?.adaptive_verbosity ?? 50), mbti, input.voice_enabled === undefined ? existing?.voice_enabled ?? 0 : input.voice_enabled ? 1 : 0, (input.voice_model ?? existing?.voice_model ?? "gemini-2.5-flash-preview-tts").trim() || "gemini-2.5-flash-preview-tts", (input.voice_name ?? existing?.voice_name ?? "Kore").trim() || "Kore", (input.voice_stt_model ?? existing?.voice_stt_model ?? "gemini-2.5-flash").trim() || "gemini-2.5-flash", input.voice_auto_speak === undefined ? existing?.voice_auto_speak ?? 1 : input.voice_auto_speak ? 1 : 0, harnessId, delegateTargets, tierProportions, antiHallucMode, antiHallucModel, citationStrictness, toolCredentials, routerPolicy, routerEnabled, usageStrategy, created_at, t);
|
|
1104
|
+
return getAgentConfig(input.id);
|
|
1105
|
+
}
|
|
1106
|
+
function clampPercent(next, fallback) {
|
|
1107
|
+
const n = Number.isFinite(next) ? Number(next) : fallback;
|
|
1108
|
+
return Math.max(0, Math.min(100, Math.round(n)));
|
|
1109
|
+
}
|
|
1110
|
+
function serialiseToolCredentials(input, existing) {
|
|
1111
|
+
if (input === undefined) return existing;
|
|
1112
|
+
const cleaned = {};
|
|
1113
|
+
for (const [k, v] of Object.entries(input)){
|
|
1114
|
+
if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
|
|
1115
|
+
cleaned[k] = v;
|
|
1250
1116
|
}
|
|
1117
|
+
}
|
|
1118
|
+
if (Object.keys(cleaned).length === 0) return null;
|
|
1119
|
+
return JSON.stringify(cleaned);
|
|
1120
|
+
}
|
|
1121
|
+
function toMbti(v) {
|
|
1122
|
+
if (!v) return null;
|
|
1123
|
+
return v in _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e ? v : null;
|
|
1124
|
+
}
|
|
1125
|
+
function deleteAgentConfig(id) {
|
|
1126
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM agent_configs WHERE id=?").run(id).changes > 0;
|
|
1127
|
+
}
|
|
1128
|
+
function generateAgentId(name) {
|
|
1129
|
+
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
1130
|
+
const suffix = Math.random().toString(36).slice(2, 6);
|
|
1131
|
+
return slug ? `${slug}-${suffix}` : `agent-${suffix}`;
|
|
1132
|
+
}
|
|
1133
|
+
// ── ADR-0022: per-agent message-channel display filters ─────────────────
|
|
1134
|
+
// Canonical channel keys mirrored in `hooks/useMessageFilters.ts`. Kept
|
|
1135
|
+
// in sync there by importing this constant — single source of truth.
|
|
1136
|
+
const DISPLAY_FILTER_KEYS = [
|
|
1137
|
+
"scheduled_task",
|
|
1138
|
+
"watcher",
|
|
1139
|
+
"bridge",
|
|
1140
|
+
"extension",
|
|
1141
|
+
"page_capture",
|
|
1142
|
+
"synthetic",
|
|
1143
|
+
"tool_use",
|
|
1144
|
+
"thinking"
|
|
1145
|
+
];
|
|
1146
|
+
const DISPLAY_FILTER_DEFAULTS = {
|
|
1147
|
+
scheduled_task: true,
|
|
1148
|
+
watcher: true,
|
|
1149
|
+
bridge: true,
|
|
1150
|
+
extension: true,
|
|
1151
|
+
page_capture: true,
|
|
1152
|
+
synthetic: true,
|
|
1153
|
+
tool_use: true,
|
|
1154
|
+
thinking: true
|
|
1155
|
+
};
|
|
1156
|
+
function parseDisplayFilters(raw) {
|
|
1157
|
+
if (!raw) return {
|
|
1158
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
1251
1159
|
};
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
1287
|
-
}
|
|
1288
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
1289
|
-
if (!(isMinimalMode && isIsr)) {
|
|
1290
|
-
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
1291
|
-
}
|
|
1292
|
-
// If cache control is already set on the response we don't
|
|
1293
|
-
// override it to allow users to customize it via next.config
|
|
1294
|
-
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
1295
|
-
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
1296
|
-
}
|
|
1297
|
-
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'.
|
|
1298
|
-
new Response(cacheEntry.value.body, {
|
|
1299
|
-
headers,
|
|
1300
|
-
status: cacheEntry.value.status || 200
|
|
1301
|
-
}));
|
|
1302
|
-
return;
|
|
1303
|
-
} catch (err) {
|
|
1304
|
-
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
1305
|
-
const silenceLog = false;
|
|
1306
|
-
await routeModule.onRequestError(req, err, {
|
|
1307
|
-
routerKind: 'App Router',
|
|
1308
|
-
routePath: normalizedSrcPage,
|
|
1309
|
-
routeType: 'route',
|
|
1310
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1311
|
-
isStaticGeneration: cacheKey !== null,
|
|
1312
|
-
isOnDemandRevalidate
|
|
1313
|
-
})
|
|
1314
|
-
}, silenceLog, routerServerContext);
|
|
1315
|
-
}
|
|
1316
|
-
// rethrow so that we can handle serving error page
|
|
1317
|
-
// If this is during static generation, throw the error again.
|
|
1318
|
-
if (isIsr) throw err;
|
|
1319
|
-
// Otherwise, send a 500 response unless the original response has
|
|
1320
|
-
// already committed. In that case, preserve its status code for
|
|
1321
|
-
// telemetry while still recording the failure and terminating a response
|
|
1322
|
-
// that the failed pipeline left open.
|
|
1323
|
-
if (res.headersSent) {
|
|
1324
|
-
if (currentSpan) {
|
|
1325
|
-
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
1326
|
-
currentSpan.recordException(error);
|
|
1327
|
-
currentSpan.setStatus({
|
|
1328
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
1329
|
-
message: error.message
|
|
1330
|
-
});
|
|
1331
|
-
currentSpan.setAttribute('error.type', error.name);
|
|
1332
|
-
}
|
|
1333
|
-
if (!res.writableEnded && !res.destroyed) {
|
|
1334
|
-
res.end();
|
|
1335
|
-
}
|
|
1336
|
-
} else {
|
|
1337
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
1338
|
-
status: 500
|
|
1339
|
-
}));
|
|
1340
|
-
}
|
|
1341
|
-
return;
|
|
1342
|
-
} finally{
|
|
1343
|
-
;
|
|
1344
|
-
(()=>{
|
|
1345
|
-
if (!currentSpan) {
|
|
1346
|
-
return;
|
|
1347
|
-
}
|
|
1348
|
-
let statusCode = res.statusCode;
|
|
1349
|
-
currentSpan.setAttributes({
|
|
1350
|
-
'http.status_code': statusCode,
|
|
1351
|
-
'next.rsc': false
|
|
1352
|
-
});
|
|
1353
|
-
if (statusCode && statusCode >= 500) {
|
|
1354
|
-
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
1355
|
-
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
1356
|
-
currentSpan.setStatus({
|
|
1357
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
1358
|
-
});
|
|
1359
|
-
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
1360
|
-
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
1361
|
-
}
|
|
1362
|
-
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
1363
|
-
// We were unable to get attributes, probably OTEL is not enabled
|
|
1364
|
-
if (!rootSpanAttributes) {
|
|
1365
|
-
return;
|
|
1366
|
-
}
|
|
1367
|
-
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
1368
|
-
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
1369
|
-
return;
|
|
1370
|
-
}
|
|
1371
|
-
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
1372
|
-
const name = `${method} ${route}`;
|
|
1373
|
-
currentSpan.setAttributes({
|
|
1374
|
-
'next.route': route,
|
|
1375
|
-
'http.route': route,
|
|
1376
|
-
'next.span_name': name
|
|
1377
|
-
});
|
|
1378
|
-
currentSpan.updateName(name);
|
|
1379
|
-
// Propagate http.route to the parent span if one exists (e.g.
|
|
1380
|
-
// a platform-created HTTP span in adapter deployments).
|
|
1381
|
-
if (parentSpan && parentSpan !== currentSpan) {
|
|
1382
|
-
parentSpan.setAttribute('http.route', route);
|
|
1383
|
-
parentSpan.updateName(name);
|
|
1384
|
-
}
|
|
1385
|
-
})();
|
|
1386
|
-
}
|
|
1160
|
+
try {
|
|
1161
|
+
const parsed = JSON.parse(raw);
|
|
1162
|
+
// Merge over defaults so newly-added channels stay visible on old rows.
|
|
1163
|
+
return {
|
|
1164
|
+
...DISPLAY_FILTER_DEFAULTS,
|
|
1165
|
+
...parsed
|
|
1166
|
+
};
|
|
1167
|
+
} catch {
|
|
1168
|
+
return {
|
|
1169
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
function getAgentDisplayFilters(id) {
|
|
1174
|
+
const row = getAgentConfig(id);
|
|
1175
|
+
if (!row) return null;
|
|
1176
|
+
return parseDisplayFilters(row.display_filters);
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Merge a partial filter map into the agent's stored prefs. Pass `null` to
|
|
1180
|
+
* reset to defaults (clears the column). Safe against concurrent toggles
|
|
1181
|
+
* from multiple browser tabs because the merge happens server-side.
|
|
1182
|
+
*/ function updateAgentDisplayFilters(id, patch) {
|
|
1183
|
+
const row = getAgentConfig(id);
|
|
1184
|
+
if (!row) return null;
|
|
1185
|
+
if (patch === null) {
|
|
1186
|
+
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=NULL, updated_at=? WHERE id=?").run(now(), id);
|
|
1187
|
+
return {
|
|
1188
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
const current = parseDisplayFilters(row.display_filters);
|
|
1192
|
+
const next = {
|
|
1193
|
+
...current
|
|
1387
1194
|
};
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
if (isWrappedByNextServer && activeSpan) {
|
|
1391
|
-
await handleResponse(activeSpan, undefined);
|
|
1392
|
-
} else {
|
|
1393
|
-
let parentSpan = tracer.getActiveScopeSpan();
|
|
1394
|
-
await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
|
|
1395
|
-
spanName: `${method} ${srcPage}`,
|
|
1396
|
-
kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
|
|
1397
|
-
attributes: {
|
|
1398
|
-
'http.method': method,
|
|
1399
|
-
'http.target': req.url
|
|
1400
|
-
}
|
|
1401
|
-
}, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
|
|
1195
|
+
for (const k of DISPLAY_FILTER_KEYS){
|
|
1196
|
+
if (k in patch && typeof patch[k] === "boolean") next[k] = patch[k];
|
|
1402
1197
|
}
|
|
1198
|
+
(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);
|
|
1199
|
+
return next;
|
|
1403
1200
|
}
|
|
1404
1201
|
|
|
1405
|
-
//# sourceMappingURL=app-route.js.map
|
|
1406
1202
|
|
|
1203
|
+
/***/ }),
|
|
1204
|
+
|
|
1205
|
+
/***/ 42666:
|
|
1206
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1207
|
+
|
|
1208
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1209
|
+
/* harmony export */ KA: () => (/* binding */ setMcpServerError),
|
|
1210
|
+
/* harmony export */ cw: () => (/* binding */ getMcpServer),
|
|
1211
|
+
/* harmony export */ le: () => (/* binding */ deleteMcpServer),
|
|
1212
|
+
/* harmony export */ n7: () => (/* binding */ listMcpServers),
|
|
1213
|
+
/* harmony export */ te: () => (/* binding */ upsertMcpServer)
|
|
1214
|
+
/* harmony export */ });
|
|
1215
|
+
/* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
|
1216
|
+
/* harmony import */ var _lib_crypto_envelope__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10938);
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
const now = ()=>new Date().toISOString();
|
|
1220
|
+
// `spec` may contain MCP env vars like GITHUB_TOKEN, GOOGLE_MAPS_API_KEY,
|
|
1221
|
+
// BRAVE_API_KEY etc. — encrypted at rest (ADR-0005). Decrypt on read.
|
|
1222
|
+
function decryptRow(row) {
|
|
1223
|
+
return {
|
|
1224
|
+
...row,
|
|
1225
|
+
spec: (0,_lib_crypto_envelope__WEBPACK_IMPORTED_MODULE_1__/* .decryptIfNeeded */ .qU)(row.spec)
|
|
1226
|
+
};
|
|
1227
|
+
}
|
|
1228
|
+
function listMcpServers() {
|
|
1229
|
+
const rows = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM mcp_servers ORDER BY name ASC").all();
|
|
1230
|
+
return rows.map(decryptRow);
|
|
1231
|
+
}
|
|
1232
|
+
function getMcpServer(name) {
|
|
1233
|
+
const row = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM mcp_servers WHERE name=?").get(name) ?? null;
|
|
1234
|
+
return row ? decryptRow(row) : null;
|
|
1235
|
+
}
|
|
1236
|
+
function upsertMcpServer(input) {
|
|
1237
|
+
const t = now();
|
|
1238
|
+
const existing = getMcpServer(input.name);
|
|
1239
|
+
const created_at = existing?.created_at ?? t;
|
|
1240
|
+
const enabled = input.enabled === false ? 0 : 1;
|
|
1241
|
+
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`INSERT OR REPLACE INTO mcp_servers (name, transport, spec, enabled, last_error, created_at, updated_at)
|
|
1242
|
+
VALUES (?, ?, ?, ?, NULL, ?, ?)`).run(input.name, input.transport, (0,_lib_crypto_envelope__WEBPACK_IMPORTED_MODULE_1__/* .encrypt */ .w)(JSON.stringify(input.spec)), enabled, created_at, t);
|
|
1243
|
+
return getMcpServer(input.name);
|
|
1244
|
+
}
|
|
1245
|
+
function deleteMcpServer(name) {
|
|
1246
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM mcp_servers WHERE name=?").run(name).changes > 0;
|
|
1247
|
+
}
|
|
1248
|
+
function setMcpServerError(name, error) {
|
|
1249
|
+
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE mcp_servers SET last_error=?, updated_at=? WHERE name=?").run(error, now(), name);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
/***/ }),
|
|
1254
|
+
|
|
1255
|
+
/***/ 44708:
|
|
1256
|
+
/***/ ((module) => {
|
|
1257
|
+
|
|
1258
|
+
module.exports = require("node:https");
|
|
1259
|
+
|
|
1260
|
+
/***/ }),
|
|
1261
|
+
|
|
1262
|
+
/***/ 44870:
|
|
1263
|
+
/***/ ((module) => {
|
|
1264
|
+
|
|
1265
|
+
module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
|
|
1266
|
+
|
|
1267
|
+
/***/ }),
|
|
1268
|
+
|
|
1269
|
+
/***/ 48161:
|
|
1270
|
+
/***/ ((module) => {
|
|
1271
|
+
|
|
1272
|
+
module.exports = require("node:os");
|
|
1273
|
+
|
|
1274
|
+
/***/ }),
|
|
1275
|
+
|
|
1276
|
+
/***/ 51455:
|
|
1277
|
+
/***/ ((module) => {
|
|
1278
|
+
|
|
1279
|
+
module.exports = require("node:fs/promises");
|
|
1280
|
+
|
|
1281
|
+
/***/ }),
|
|
1282
|
+
|
|
1283
|
+
/***/ 53638:
|
|
1284
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1285
|
+
|
|
1286
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1287
|
+
/* harmony export */ p: () => (/* binding */ parseJsonSafe)
|
|
1288
|
+
/* harmony export */ });
|
|
1289
|
+
// JSON.parse with a fallback value when the input is malformed (or empty).
|
|
1290
|
+
// Used everywhere we read responses from external APIs — they're contractually
|
|
1291
|
+
// JSON but a transient 502 / proxy interstitial occasionally returns HTML.
|
|
1292
|
+
function parseJsonSafe(text, fallback) {
|
|
1293
|
+
try {
|
|
1294
|
+
return JSON.parse(text);
|
|
1295
|
+
} catch {
|
|
1296
|
+
return fallback;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
/***/ }),
|
|
1302
|
+
|
|
1303
|
+
/***/ 54172:
|
|
1304
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1305
|
+
|
|
1306
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1307
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1308
|
+
/* harmony export */ DELETE: () => (/* binding */ DELETE),
|
|
1309
|
+
/* harmony export */ GET: () => (/* binding */ GET),
|
|
1310
|
+
/* harmony export */ PUT: () => (/* binding */ PUT)
|
|
1311
|
+
/* harmony export */ });
|
|
1312
|
+
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
1313
|
+
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97377);
|
|
1314
|
+
/* harmony import */ var _lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42666);
|
|
1315
|
+
/* harmony import */ var _lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30572);
|
|
1316
|
+
/* harmony import */ var _lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85678);
|
|
1317
|
+
/* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(39947);
|
|
1318
|
+
/* harmony import */ var _lib_utils_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(53638);
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
const PutBody = zod__WEBPACK_IMPORTED_MODULE_5__/* .object */ .Ikc({
|
|
1327
|
+
transport: zod__WEBPACK_IMPORTED_MODULE_5__/* ["enum"] */ .k5n([
|
|
1328
|
+
"stdio",
|
|
1329
|
+
"http"
|
|
1330
|
+
]).optional(),
|
|
1331
|
+
spec: zod__WEBPACK_IMPORTED_MODULE_5__/* .record */ .g1P(zod__WEBPACK_IMPORTED_MODULE_5__/* .string */ .YjP(), zod__WEBPACK_IMPORTED_MODULE_5__/* .unknown */ .L5J()).optional(),
|
|
1332
|
+
enabled: zod__WEBPACK_IMPORTED_MODULE_5__/* .boolean */ .zMY().optional()
|
|
1333
|
+
});
|
|
1334
|
+
async function GET(_req, { params }) {
|
|
1335
|
+
const { name } = await params;
|
|
1336
|
+
const r = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .getMcpServer */ .cw)(name);
|
|
1337
|
+
if (!r) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
1338
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json((0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__/* .mcpServerToResponse */ .sU)(r));
|
|
1339
|
+
}
|
|
1340
|
+
async function PUT(req, { params }) {
|
|
1341
|
+
const { name } = await params;
|
|
1342
|
+
const existing = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .getMcpServer */ .cw)(name);
|
|
1343
|
+
if (!existing) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
1344
|
+
const body = await (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .validateBody */ .Jb)(req, PutBody);
|
|
1345
|
+
if (body instanceof next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse) return body;
|
|
1346
|
+
const row = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .upsertMcpServer */ .te)({
|
|
1347
|
+
name,
|
|
1348
|
+
transport: body.transport ?? existing.transport,
|
|
1349
|
+
spec: body.spec ?? (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_6__/* .parseJsonSafe */ .p)(existing.spec, {}),
|
|
1350
|
+
enabled: body.enabled ?? existing.enabled === 1
|
|
1351
|
+
});
|
|
1352
|
+
(0,_lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__/* .invalidateMcpTools */ .H_)();
|
|
1353
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json((0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_3__/* .mcpServerToResponse */ .sU)(row));
|
|
1354
|
+
}
|
|
1355
|
+
async function DELETE(_req, { params }) {
|
|
1356
|
+
const { name } = await params;
|
|
1357
|
+
const ok = (0,_lib_stores_mcp_servers__WEBPACK_IMPORTED_MODULE_1__/* .deleteMcpServer */ .le)(name);
|
|
1358
|
+
if (!ok) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_4__/* .notFoundResponse */ .HN)("MCP server not found");
|
|
1359
|
+
(0,_lib_mcp_client__WEBPACK_IMPORTED_MODULE_2__/* .invalidateMcpTools */ .H_)();
|
|
1360
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
1361
|
+
deleted: true
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
|
|
1366
|
+
/***/ }),
|
|
1367
|
+
|
|
1368
|
+
/***/ 55511:
|
|
1369
|
+
/***/ ((module) => {
|
|
1370
|
+
|
|
1371
|
+
module.exports = require("crypto");
|
|
1372
|
+
|
|
1373
|
+
/***/ }),
|
|
1374
|
+
|
|
1375
|
+
/***/ 55591:
|
|
1376
|
+
/***/ ((module) => {
|
|
1377
|
+
|
|
1378
|
+
module.exports = require("https");
|
|
1379
|
+
|
|
1380
|
+
/***/ }),
|
|
1381
|
+
|
|
1382
|
+
/***/ 57075:
|
|
1383
|
+
/***/ ((module) => {
|
|
1384
|
+
|
|
1385
|
+
module.exports = require("node:stream");
|
|
1386
|
+
|
|
1387
|
+
/***/ }),
|
|
1388
|
+
|
|
1389
|
+
/***/ 57975:
|
|
1390
|
+
/***/ ((module) => {
|
|
1391
|
+
|
|
1392
|
+
module.exports = require("node:util");
|
|
1393
|
+
|
|
1394
|
+
/***/ }),
|
|
1395
|
+
|
|
1396
|
+
/***/ 63033:
|
|
1397
|
+
/***/ ((module) => {
|
|
1398
|
+
|
|
1399
|
+
module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
|
|
1400
|
+
|
|
1401
|
+
/***/ }),
|
|
1402
|
+
|
|
1403
|
+
/***/ 73024:
|
|
1404
|
+
/***/ ((module) => {
|
|
1405
|
+
|
|
1406
|
+
module.exports = require("node:fs");
|
|
1407
1407
|
|
|
1408
1408
|
/***/ }),
|
|
1409
1409
|
|
|
@@ -1717,7 +1717,7 @@ module.exports = import("@huggingface/transformers");;
|
|
|
1717
1717
|
var __webpack_require__ = require("../../../../../webpack-runtime.js");
|
|
1718
1718
|
__webpack_require__.C(exports);
|
|
1719
1719
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
1720
|
-
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46], () => (__webpack_exec__(
|
|
1720
|
+
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46], () => (__webpack_exec__(30977)));
|
|
1721
1721
|
module.exports = __webpack_exports__;
|
|
1722
1722
|
|
|
1723
1723
|
})();
|