@circuitwall/jarela 2.2.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +2 -1
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +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 +100 -93
- package/.next/standalone/.next/server/app/api/v1/access/route.js +176 -169
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +89 -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 +139 -127
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +107 -100
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +765 -753
- package/.next/standalone/.next/server/app/api/v1/agents/route.js +72 -65
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +371 -364
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +809 -802
- package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +9 -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 +583 -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 +41 -30
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +48 -37
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +697 -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 +703 -136
- 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 +796 -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 +762 -746
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +1050 -1034
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +673 -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 +811 -804
- package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js +718 -706
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js.nft.json +1 -1
- 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 +796 -784
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +30 -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 +385 -378
- package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +51 -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 +375 -368
- package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/events/route.js +745 -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 +51 -44
- package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +16 -9
- package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +72 -65
- package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +41 -34
- package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +211 -204
- package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +140 -133
- package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +113 -106
- package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +121 -114
- package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +141 -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 +228 -221
- package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +65 -58
- package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +79 -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 +783 -771
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +140 -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 +370 -363
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +240 -233
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +689 -682
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +886 -879
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +115 -108
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +955 -948
- package/.next/standalone/.next/server/app/api/v1/integrations/route.js +223 -216
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +876 -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 +79 -72
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +991 -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 +19 -7
- package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +539 -532
- package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +86 -79
- package/.next/standalone/.next/server/app/api/v1/memory/route.js +58 -51
- package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +138 -131
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +381 -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 +150 -143
- package/.next/standalone/.next/server/app/api/v1/models/route.js +634 -627
- 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 +529 -514
- 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 +37 -30
- package/.next/standalone/.next/server/app/api/v1/profile/route.js +171 -164
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +15 -8
- package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +171 -164
- package/.next/standalone/.next/server/app/api/v1/providers/route.js +101 -94
- package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +457 -450
- package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +44 -37
- package/.next/standalone/.next/server/app/api/v1/redaction/route.js +65 -58
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +617 -605
- 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 +739 -732
- package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +329 -322
- package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +204 -197
- package/.next/standalone/.next/server/app/api/v1/security/state/route.js +58 -51
- package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +183 -176
- package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +194 -187
- 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 +776 -769
- package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +122 -115
- package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +334 -327
- package/.next/standalone/.next/server/app/api/v1/skills/route.js +873 -866
- 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 +122 -115
- package/.next/standalone/.next/server/app/api/v1/tasks/route.js +30 -23
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +1436 -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 +638 -631
- 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 +60 -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 -173
- 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 +925 -913
- 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 +241 -229
- package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +989 -977
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +40 -28
- 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 +1179 -743
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup/page.js +99 -91
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
- package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +441 -1022
- 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/2068.js +47 -10
- package/.next/standalone/.next/server/chunks/210.js +3 -3
- 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/2447.js +10 -5
- package/.next/standalone/.next/server/chunks/2471.js +45 -45
- 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 +24 -16
- package/.next/standalone/.next/server/chunks/{4540.js → 309.js} +104 -38
- package/.next/standalone/.next/server/chunks/{2350.js → 3272.js} +104 -37
- package/.next/standalone/.next/server/chunks/3399.js +526 -526
- package/.next/standalone/.next/server/chunks/3524.js +150 -67
- 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/4433.js +146 -146
- package/.next/standalone/.next/server/chunks/4508.js +3 -3
- package/.next/standalone/.next/server/chunks/4588.js +1 -0
- package/.next/standalone/.next/server/chunks/46.js +78 -28
- 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/5908.js +63 -42
- package/.next/standalone/.next/server/chunks/6142.js +10 -2
- 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 +3 -3
- 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 +24 -17
- 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 +4 -3
- package/.next/standalone/.next/server/chunks/{2563.js → 9164.js} +33389 -31418
- package/.next/standalone/.next/server/chunks/9237.js +396 -396
- package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1672 -575
- package/.next/standalone/.next/server/chunks/9406.js +1 -1
- package/.next/standalone/.next/server/chunks/9590.js +68 -18
- 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 +486 -415
- 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-04748847c6ff866f.js} +1013 -585
- 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 → 2669e8744cc8c212.css} +2 -2
- package/.next/standalone/docs/adoption/changesets.json +358 -0
- package/.next/standalone/lib/skills/builtins/memory-organization/SKILL.md +16 -0
- package/.next/standalone/package.json +3 -3
- package/CHANGELOG.md +44 -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/app/api/v1/threads/[thread_id]/run/route.ts +0 -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/MessageBubble.tsx +12 -0
- 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/integrations/NetworkSection.tsx +2 -2
- package/components/ui/BootScreen.tsx +17 -0
- package/components/ui/WorkflowChecklist.tsx +71 -33
- package/hooks/useSSE.ts +28 -3
- package/lib/agents/citation-checker.test.ts +40 -2
- package/lib/agents/citation-checker.ts +56 -11
- package/lib/agents/compaction-pipeline.test.ts +202 -0
- package/lib/agents/compaction-pipeline.ts +483 -0
- package/lib/agents/context-boundary.ts +5 -6
- package/lib/agents/conversation-summary.ts +37 -21
- package/lib/agents/instruction-edits.test.ts +120 -0
- package/lib/agents/instruction-edits.ts +65 -42
- 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 -2
- package/lib/agents/prepare/system-prompt.test.ts +49 -0
- package/lib/agents/prepare/system-prompt.ts +16 -5
- 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/proposals.test.ts +76 -0
- package/lib/agents/proposals.ts +13 -5
- package/lib/agents/run-registry.test.ts +22 -0
- package/lib/agents/run-registry.ts +29 -0
- package/lib/agents/run-thread.auto-boundary.test.ts +125 -5
- package/lib/agents/run-thread.retry.test.ts +67 -1
- package/lib/agents/run-thread.ts +110 -10
- package/lib/agents/sqlite-checkpoint-saver.test.ts +91 -0
- 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 +346 -143
- package/lib/agents/warm-topics.test.ts +191 -0
- package/lib/agents/warm-topics.ts +317 -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/bridges/dispatcher.ts +1 -0
- package/lib/bridges/message-role.test.ts +81 -0
- package/lib/bridges/message-role.ts +23 -10
- package/lib/bridges/types.ts +6 -0
- package/lib/bridges/whatsapp-link.test.ts +32 -0
- package/lib/bridges/whatsapp-link.ts +21 -0
- package/lib/bridges/whatsapp.inbound.test.ts +239 -0
- package/lib/bridges/whatsapp.sender.test.ts +80 -1
- package/lib/bridges/whatsapp.ts +76 -38
- 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/pricing/snapshot.test.ts +70 -0
- package/lib/pricing/snapshot.ts +10 -2
- package/lib/providers/external.ts +0 -2
- package/lib/proxy/dispatcher.test.ts +119 -1
- package/lib/proxy/dispatcher.ts +22 -9
- package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
- package/lib/stores/agent-configs.ts +10 -5
- package/lib/stores/bridges.test.ts +81 -0
- package/lib/stores/bridges.ts +9 -8
- package/lib/stores/proxy-config.test.ts +120 -0
- package/lib/stores/proxy-config.ts +22 -4
- package/lib/stores/threads.test.ts +9 -0
- package/lib/stores/threads.ts +33 -19
- 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/calendar.test.ts +43 -2
- package/lib/tools/communications/calendar.ts +2 -0
- package/lib/tools/communications/gmail.test.ts +51 -1
- package/lib/tools/communications/gmail.ts +44 -2
- package/lib/tools/communications/ms-todo.ts +0 -7
- package/lib/tools/communications/outlook-calendar.ts +2 -0
- package/lib/tools/communications/outlook.test.ts +33 -2
- package/lib/tools/communications/outlook.ts +2 -0
- package/lib/tools/filesystem/edit-match.test.ts +133 -0
- package/lib/tools/filesystem/edit-match.ts +7 -2
- 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/tools/support/result-refs.test.ts +131 -0
- package/lib/tools/support/result-refs.ts +41 -9
- package/lib/triggers/registry.ts +0 -4
- package/lib/utils/source-link.test.ts +51 -0
- package/lib/utils/source-link.ts +45 -0
- 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 → hwujW4hR1b-r3k5WdMxZO}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → hwujW4hR1b-r3k5WdMxZO}/_ssgManifest.js +0 -0
|
@@ -104,848 +104,853 @@ module.exports = require("next/dist/server/app-render/action-async-storage.exter
|
|
|
104
104
|
|
|
105
105
|
/***/ }),
|
|
106
106
|
|
|
107
|
-
/***/
|
|
108
|
-
/***/ ((
|
|
107
|
+
/***/ 27910:
|
|
108
|
+
/***/ ((module) => {
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
/* 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__);
|
|
124
|
-
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
|
|
125
|
-
/* 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__);
|
|
126
|
-
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
|
|
127
|
-
/* 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__);
|
|
128
|
-
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
|
|
129
|
-
/* 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__);
|
|
130
|
-
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
|
|
131
|
-
/* 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__);
|
|
132
|
-
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
|
|
133
|
-
/* 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__);
|
|
134
|
-
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
|
|
135
|
-
/* 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__);
|
|
136
|
-
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
|
|
137
|
-
/* 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__);
|
|
138
|
-
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
|
|
139
|
-
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
|
|
140
|
-
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
|
|
141
|
-
/* 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__);
|
|
142
|
-
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
|
|
143
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
|
|
144
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
145
|
-
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
|
|
146
|
-
/* 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__);
|
|
147
|
-
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
|
|
148
|
-
/* 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__);
|
|
149
|
-
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
|
|
150
|
-
/* 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__);
|
|
110
|
+
module.exports = require("stream");
|
|
111
|
+
|
|
112
|
+
/***/ }),
|
|
113
|
+
|
|
114
|
+
/***/ 28354:
|
|
115
|
+
/***/ ((module) => {
|
|
116
|
+
|
|
117
|
+
module.exports = require("util");
|
|
118
|
+
|
|
119
|
+
/***/ }),
|
|
120
|
+
|
|
121
|
+
/***/ 29021:
|
|
122
|
+
/***/ ((module) => {
|
|
151
123
|
|
|
124
|
+
module.exports = require("fs");
|
|
152
125
|
|
|
126
|
+
/***/ }),
|
|
153
127
|
|
|
128
|
+
/***/ 29294:
|
|
129
|
+
/***/ ((module) => {
|
|
154
130
|
|
|
131
|
+
module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
|
|
155
132
|
|
|
133
|
+
/***/ }),
|
|
156
134
|
|
|
135
|
+
/***/ 31421:
|
|
136
|
+
/***/ ((module) => {
|
|
157
137
|
|
|
138
|
+
module.exports = require("node:child_process");
|
|
158
139
|
|
|
140
|
+
/***/ }),
|
|
159
141
|
|
|
142
|
+
/***/ 33873:
|
|
143
|
+
/***/ ((module) => {
|
|
160
144
|
|
|
145
|
+
module.exports = require("path");
|
|
161
146
|
|
|
147
|
+
/***/ }),
|
|
162
148
|
|
|
149
|
+
/***/ 37067:
|
|
150
|
+
/***/ ((module) => {
|
|
163
151
|
|
|
152
|
+
module.exports = require("node:http");
|
|
164
153
|
|
|
154
|
+
/***/ }),
|
|
165
155
|
|
|
156
|
+
/***/ 38522:
|
|
157
|
+
/***/ ((module) => {
|
|
166
158
|
|
|
159
|
+
module.exports = require("node:zlib");
|
|
167
160
|
|
|
161
|
+
/***/ }),
|
|
168
162
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
const nextConfigOutput = "standalone"
|
|
172
|
-
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
173
|
-
definition: {
|
|
174
|
-
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
175
|
-
page: "/api/v1/agents/[id]/thread/route",
|
|
176
|
-
pathname: "/api/v1/agents/[id]/thread",
|
|
177
|
-
filename: "route",
|
|
178
|
-
bundlePath: "app/api/v1/agents/[id]/thread/route"
|
|
179
|
-
},
|
|
180
|
-
distDir: ".next" || 0,
|
|
181
|
-
relativeProjectDir: false || '',
|
|
182
|
-
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/agents/[id]/thread/route.ts",
|
|
183
|
-
nextConfigOutput,
|
|
184
|
-
// The lazy require factory ensures that:
|
|
185
|
-
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
186
|
-
// correctly attributing module load time to application-code rather than
|
|
187
|
-
// framework internals.
|
|
188
|
-
// - In all modes: async modules (route files with top-level await) are
|
|
189
|
-
// handled correctly — require() returns a Promise for such modules, which
|
|
190
|
-
// ensureUserland() awaits before the first request is handled.
|
|
191
|
-
userland: ()=>__webpack_require__(14622),
|
|
192
|
-
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
193
|
-
// server HMR updates are picked up without re-executing the entry chunk.
|
|
194
|
-
// Using require() (synchronous) avoids adding async overhead that would be
|
|
195
|
-
// incorrectly attributed to application-code time in devRequestTiming.
|
|
196
|
-
... false ? 0 : {}
|
|
197
|
-
});
|
|
198
|
-
// Pull out the exports that we need to expose from the module. This should
|
|
199
|
-
// be eliminated when we've moved the other routes to the new format. These
|
|
200
|
-
// are used to hook into the route.
|
|
201
|
-
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
202
|
-
function patchFetch() {
|
|
203
|
-
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
204
|
-
workAsyncStorage,
|
|
205
|
-
workUnitAsyncStorage
|
|
206
|
-
});
|
|
207
|
-
}
|
|
163
|
+
/***/ 41720:
|
|
164
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
208
165
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
166
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
167
|
+
/* harmony export */ BM: () => (/* binding */ upsertAgentConfig),
|
|
168
|
+
/* harmony export */ E1: () => (/* binding */ updateAgentDisplayFilters),
|
|
169
|
+
/* harmony export */ P2: () => (/* binding */ parseCitationStrictness),
|
|
170
|
+
/* harmony export */ S2: () => (/* binding */ getAgentToolCredentials),
|
|
171
|
+
/* harmony export */ SJ: () => (/* binding */ generateAgentId),
|
|
172
|
+
/* harmony export */ TG: () => (/* binding */ getAgentTools),
|
|
173
|
+
/* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
|
|
174
|
+
/* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
|
|
175
|
+
/* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
|
|
176
|
+
/* harmony export */ mJ: () => (/* binding */ getAgentConfig),
|
|
177
|
+
/* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
|
|
178
|
+
/* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
|
|
179
|
+
/* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
|
|
180
|
+
/* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
|
|
181
|
+
/* harmony export */ zb: () => (/* binding */ listAgentConfigs)
|
|
182
|
+
/* harmony export */ });
|
|
183
|
+
/* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
|
184
|
+
/* harmony import */ var _lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99043);
|
|
185
|
+
/* harmony import */ var _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66849);
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
const now = ()=>new Date().toISOString();
|
|
190
|
+
/** Coerce arbitrary input (DB row TEXT, API body, undefined) to the enum.
|
|
191
|
+
* Returns `null` for null/undefined/unknown values so callers can default. */ function parseCitationStrictness(value) {
|
|
192
|
+
if (value === "off" || value === "informational" || value === "standard" || value === "strict") {
|
|
193
|
+
return value;
|
|
212
194
|
}
|
|
213
|
-
|
|
214
|
-
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Parse the JSON-encoded per-agent override of context tier proportions.
|
|
199
|
+
* Returns `null` for NULL, blank, malformed JSON, or any payload that
|
|
200
|
+
* doesn't have three finite non-negative numeric fields. Callers fall
|
|
201
|
+
* back to the model config's value (or built-in defaults) on null.
|
|
202
|
+
*/ function getAgentTierProportions(row) {
|
|
203
|
+
const raw = row.context_tier_proportions;
|
|
204
|
+
if (!raw) return null;
|
|
205
|
+
try {
|
|
206
|
+
const parsed = JSON.parse(raw);
|
|
207
|
+
const hot = Number(parsed.hot);
|
|
208
|
+
const warm = Number(parsed.warm);
|
|
209
|
+
const facts = Number(parsed.facts);
|
|
210
|
+
if (![
|
|
211
|
+
hot,
|
|
212
|
+
warm,
|
|
213
|
+
facts
|
|
214
|
+
].every((n)=>Number.isFinite(n) && n >= 0)) return null;
|
|
215
|
+
if (hot + warm + facts <= 0) return null;
|
|
216
|
+
return {
|
|
217
|
+
hot,
|
|
218
|
+
warm,
|
|
219
|
+
facts
|
|
220
|
+
};
|
|
221
|
+
} catch {
|
|
222
|
+
return null;
|
|
215
223
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
224
|
+
}
|
|
225
|
+
function listAgentConfigs() {
|
|
226
|
+
// Default agent always first; then by the timestamp of each agent's latest message.
|
|
227
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT a.*
|
|
228
|
+
FROM agent_configs a
|
|
229
|
+
LEFT JOIN (
|
|
230
|
+
SELECT t.agent_id, MAX(m.created_at) AS last_message_at
|
|
231
|
+
FROM threads t
|
|
232
|
+
JOIN messages m ON m.thread_id = t.thread_id
|
|
233
|
+
GROUP BY t.agent_id
|
|
234
|
+
) latest ON latest.agent_id = a.id
|
|
235
|
+
ORDER BY a.is_default DESC, COALESCE(latest.last_message_at, a.created_at) DESC, a.id ASC`).all();
|
|
236
|
+
}
|
|
237
|
+
function getDefaultAgentConfig() {
|
|
238
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE is_default=1 LIMIT 1").get() ?? null;
|
|
239
|
+
}
|
|
240
|
+
function getAgentConfig(id) {
|
|
241
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE id=?").get(id) ?? null;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Parse the JSON-encoded delegate whitelist into a deduped string[]. Returns
|
|
245
|
+
* an empty array for NULL, blank, or malformed JSON (delegation is opt-in).
|
|
246
|
+
*/ /**
|
|
247
|
+
* Parse the agent's tool allowlist (`tools` column, stored as a JSON string).
|
|
248
|
+
* Returns an empty array on NULL/blank/malformed JSON — same defensive shape
|
|
249
|
+
* as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
|
|
250
|
+
* inline should switch to this getter so the serialization contract stays
|
|
251
|
+
* owned by this store.
|
|
252
|
+
*/ function getAgentTools(cfg) {
|
|
253
|
+
if (!cfg?.tools) return [];
|
|
254
|
+
try {
|
|
255
|
+
const parsed = JSON.parse(cfg.tools);
|
|
256
|
+
if (!Array.isArray(parsed)) return [];
|
|
257
|
+
return parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
258
|
+
} catch {
|
|
259
|
+
return [];
|
|
223
260
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return
|
|
261
|
+
}
|
|
262
|
+
function parseDelegateTargets(raw) {
|
|
263
|
+
if (!raw) return [];
|
|
264
|
+
try {
|
|
265
|
+
const parsed = JSON.parse(raw);
|
|
266
|
+
if (!Array.isArray(parsed)) return [];
|
|
267
|
+
const ids = parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
268
|
+
return Array.from(new Set(ids));
|
|
269
|
+
} catch {
|
|
270
|
+
return [];
|
|
234
271
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if (isIsr && !isDraftMode) {
|
|
250
|
-
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
251
|
-
if (prerenderInfo) {
|
|
252
|
-
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
253
|
-
if (nextConfig.adapterPath) {
|
|
254
|
-
return await render404();
|
|
255
|
-
}
|
|
256
|
-
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
257
|
-
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Parse the per-agent `{ toolName: credentialId }` override map stored in
|
|
275
|
+
* the `tool_credentials` column. Returns an empty record on NULL / blank /
|
|
276
|
+
* malformed JSON / non-string entries so downstream code can treat the
|
|
277
|
+
* result as a plain lookup without further validation.
|
|
278
|
+
*/ function getAgentToolCredentials(cfg) {
|
|
279
|
+
if (!cfg?.tool_credentials) return {};
|
|
280
|
+
try {
|
|
281
|
+
const parsed = JSON.parse(cfg.tool_credentials);
|
|
282
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
283
|
+
const out = {};
|
|
284
|
+
for (const [k, v] of Object.entries(parsed)){
|
|
285
|
+
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
258
286
|
}
|
|
287
|
+
return out;
|
|
288
|
+
} catch {
|
|
289
|
+
return {};
|
|
259
290
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
291
|
+
}
|
|
292
|
+
function upsertAgentConfig(input) {
|
|
293
|
+
return (0,_lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__/* .withDbTransaction */ .J)(()=>upsertAgentConfigTransaction(input));
|
|
294
|
+
}
|
|
295
|
+
function upsertAgentConfigTransaction(input) {
|
|
296
|
+
const t = now();
|
|
297
|
+
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
298
|
+
const existing = getAgentConfig(input.id);
|
|
299
|
+
const created_at = existing?.created_at ?? t;
|
|
300
|
+
const existingMbti = toMbti(existing?.adaptive_mbti);
|
|
301
|
+
const mbti = input.adaptive_mbti ?? existingMbti ?? "INTJ";
|
|
302
|
+
const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
|
|
303
|
+
// Omitted sliders keep their tuned values; they only fall back to the
|
|
304
|
+
// preset when the type changes or the agent is new. Otherwise every
|
|
305
|
+
// partial update (approved proposals, tool edits) reset them.
|
|
306
|
+
const keepTuned = existing !== null && existing !== undefined && mbti === existingMbti;
|
|
307
|
+
const strength = input.adaptive_persona_strength ?? (keepTuned ? existing.adaptive_persona_strength : preset.strength);
|
|
308
|
+
const empathy = input.adaptive_empathy ?? (keepTuned ? existing.adaptive_empathy : preset.empathy);
|
|
309
|
+
const expressiveness = input.adaptive_expressiveness ?? (keepTuned ? existing.adaptive_expressiveness : preset.expressiveness);
|
|
310
|
+
const verbosity = input.adaptive_verbosity ?? (keepTuned ? existing.adaptive_verbosity : preset.verbosity);
|
|
311
|
+
if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
|
|
312
|
+
// harness_id: explicit `undefined` means "keep existing"; explicit `null`
|
|
313
|
+
// means "use the global default". Empty string is normalised to null too,
|
|
314
|
+
// matching how the AgentEditor sends "" for the inherit option.
|
|
315
|
+
const harnessId = input.harness_id === undefined ? existing?.harness_id ?? null : input.harness_id && input.harness_id.length > 0 ? input.harness_id : null;
|
|
316
|
+
// delegate_targets: undefined = keep existing; explicit empty array clears.
|
|
317
|
+
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))));
|
|
318
|
+
// context_tier_proportions: undefined = keep existing; null = clear and
|
|
319
|
+
// inherit from the model; object = serialise as JSON. Negative values are
|
|
320
|
+
// clamped to 0 so the upsert can't poison the column with bad data.
|
|
321
|
+
const tierProportions = input.context_tier_proportions === undefined ? existing?.context_tier_proportions ?? null : input.context_tier_proportions === null ? null : JSON.stringify({
|
|
322
|
+
hot: Math.max(0, Number(input.context_tier_proportions.hot) || 0),
|
|
323
|
+
warm: Math.max(0, Number(input.context_tier_proportions.warm) || 0),
|
|
324
|
+
facts: Math.max(0, Number(input.context_tier_proportions.facts) || 0)
|
|
325
|
+
});
|
|
326
|
+
// Anti-hallucination override: `undefined` keeps existing; `null` clears
|
|
327
|
+
// the override (inherits env). Empty-string model is normalised to null
|
|
328
|
+
// so the editor can ship "" for the inherit option.
|
|
329
|
+
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;
|
|
330
|
+
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;
|
|
331
|
+
const citationStrictness = input.citation_strictness === undefined ? parseCitationStrictness(existing?.citation_strictness) ?? "off" : parseCitationStrictness(input.citation_strictness) ?? "off";
|
|
332
|
+
const toolCredentials = serialiseToolCredentials(input.tool_credentials, existing?.tool_credentials ?? null);
|
|
333
|
+
const VALID_ROUTER_POLICIES = new Set([
|
|
334
|
+
"cheap",
|
|
335
|
+
"fast",
|
|
336
|
+
"balanced",
|
|
337
|
+
"quality"
|
|
338
|
+
]);
|
|
339
|
+
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;
|
|
340
|
+
const routerEnabled = input.router_enabled === undefined ? existing?.router_enabled ?? null : input.router_enabled === null ? null : input.router_enabled ? 1 : 0;
|
|
341
|
+
const VALID_USAGE_STRATEGIES = new Set([
|
|
342
|
+
"cost_saving",
|
|
343
|
+
"fast",
|
|
344
|
+
"balanced",
|
|
345
|
+
"high_reasoning"
|
|
346
|
+
]);
|
|
347
|
+
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;
|
|
348
|
+
const requestedWarmSummaryLimit = input.warm_summary_limit ?? existing?.warm_summary_limit ?? 50;
|
|
349
|
+
const warmSummaryLimit = Number.isFinite(requestedWarmSummaryLimit) ? Math.max(0, Math.floor(requestedWarmSummaryLimit)) : existing?.warm_summary_limit ?? 50;
|
|
350
|
+
db.prepare(`INSERT OR REPLACE INTO agent_configs
|
|
351
|
+
(id, name, icon, identity, instructions, tools, model_config_name, is_default,
|
|
352
|
+
history_limit, history_window_hours, warm_summary_limit, never_reply,
|
|
353
|
+
hot_turn_limit,
|
|
354
|
+
adaptive_persona_enabled, adaptive_persona_strength, adaptive_empathy, adaptive_expressiveness, adaptive_verbosity, adaptive_mbti,
|
|
355
|
+
voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
|
|
356
|
+
harness_id, delegate_targets, context_tier_proportions,
|
|
357
|
+
anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
|
|
358
|
+
tool_credentials, router_policy, router_enabled, usage_strategy,
|
|
359
|
+
created_at, updated_at)
|
|
360
|
+
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"
|
|
361
|
+
// (important for PATCH-style updates that omit the field).
|
|
362
|
+
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);
|
|
363
|
+
return getAgentConfig(input.id);
|
|
364
|
+
}
|
|
365
|
+
function clampPercent(next, fallback) {
|
|
366
|
+
const n = Number.isFinite(next) ? Number(next) : fallback;
|
|
367
|
+
return Math.max(0, Math.min(100, Math.round(n)));
|
|
368
|
+
}
|
|
369
|
+
function serialiseToolCredentials(input, existing) {
|
|
370
|
+
if (input === undefined) return existing;
|
|
371
|
+
const cleaned = {};
|
|
372
|
+
for (const [k, v] of Object.entries(input)){
|
|
373
|
+
if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
|
|
374
|
+
cleaned[k] = v;
|
|
375
|
+
}
|
|
265
376
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
377
|
+
if (Object.keys(cleaned).length === 0) return null;
|
|
378
|
+
return JSON.stringify(cleaned);
|
|
379
|
+
}
|
|
380
|
+
function toMbti(v) {
|
|
381
|
+
if (!v) return null;
|
|
382
|
+
return v in _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e ? v : null;
|
|
383
|
+
}
|
|
384
|
+
function deleteAgentConfig(id) {
|
|
385
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM agent_configs WHERE id=?").run(id).changes > 0;
|
|
386
|
+
}
|
|
387
|
+
function generateAgentId(name) {
|
|
388
|
+
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
389
|
+
const suffix = Math.random().toString(36).slice(2, 6);
|
|
390
|
+
return slug ? `${slug}-${suffix}` : `agent-${suffix}`;
|
|
391
|
+
}
|
|
392
|
+
// ── ADR-0022: per-agent message-channel display filters ─────────────────
|
|
393
|
+
// Canonical channel keys mirrored in `hooks/useMessageFilters.ts`. Kept
|
|
394
|
+
// in sync there by importing this constant — single source of truth.
|
|
395
|
+
const DISPLAY_FILTER_KEYS = [
|
|
396
|
+
"scheduled_task",
|
|
397
|
+
"watcher",
|
|
398
|
+
"bridge",
|
|
399
|
+
"extension",
|
|
400
|
+
"page_capture",
|
|
401
|
+
"synthetic",
|
|
402
|
+
"tool_use",
|
|
403
|
+
"thinking"
|
|
404
|
+
];
|
|
405
|
+
const DISPLAY_FILTER_DEFAULTS = {
|
|
406
|
+
scheduled_task: true,
|
|
407
|
+
watcher: true,
|
|
408
|
+
bridge: true,
|
|
409
|
+
extension: true,
|
|
410
|
+
page_capture: true,
|
|
411
|
+
synthetic: true,
|
|
412
|
+
tool_use: true,
|
|
413
|
+
thinking: true
|
|
414
|
+
};
|
|
415
|
+
function parseDisplayFilters(raw) {
|
|
416
|
+
if (!raw) return {
|
|
417
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
418
|
+
};
|
|
419
|
+
try {
|
|
420
|
+
const parsed = JSON.parse(raw);
|
|
421
|
+
// Merge over defaults so newly-added channels stay visible on old rows.
|
|
422
|
+
return {
|
|
423
|
+
...DISPLAY_FILTER_DEFAULTS,
|
|
424
|
+
...parsed
|
|
425
|
+
};
|
|
426
|
+
} catch {
|
|
427
|
+
return {
|
|
428
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
429
|
+
};
|
|
275
430
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
cacheLifeProfiles: nextConfig.cacheLife,
|
|
299
|
-
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
300
|
-
waitUntil: ctx.waitUntil,
|
|
301
|
-
onClose: (cb)=>{
|
|
302
|
-
res.on('close', cb);
|
|
303
|
-
},
|
|
304
|
-
onAfterTaskError: undefined
|
|
305
|
-
},
|
|
306
|
-
sharedContext: {
|
|
307
|
-
buildId,
|
|
308
|
-
deploymentId
|
|
309
|
-
}
|
|
431
|
+
}
|
|
432
|
+
function getAgentDisplayFilters(id) {
|
|
433
|
+
const row = getAgentConfig(id);
|
|
434
|
+
if (!row) return null;
|
|
435
|
+
return parseDisplayFilters(row.display_filters);
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Merge a partial filter map into the agent's stored prefs. Pass `null` to
|
|
439
|
+
* reset to defaults (clears the column). Safe against concurrent toggles
|
|
440
|
+
* from multiple browser tabs because the merge happens server-side.
|
|
441
|
+
*/ function updateAgentDisplayFilters(id, patch) {
|
|
442
|
+
const row = getAgentConfig(id);
|
|
443
|
+
if (!row) return null;
|
|
444
|
+
if (patch === null) {
|
|
445
|
+
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=NULL, updated_at=? WHERE id=?").run(now(), id);
|
|
446
|
+
return {
|
|
447
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
const current = parseDisplayFilters(row.display_filters);
|
|
451
|
+
const next = {
|
|
452
|
+
...current
|
|
310
453
|
};
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
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));
|
|
314
|
-
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
315
|
-
try {
|
|
316
|
-
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
317
|
-
res.statusCode = 404;
|
|
318
|
-
// on-demand revalidate always sets this header
|
|
319
|
-
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
320
|
-
res.end('This page could not be found');
|
|
321
|
-
return null;
|
|
322
|
-
}
|
|
323
|
-
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
324
|
-
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
325
|
-
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
326
|
-
// Attempt using provided waitUntil if available
|
|
327
|
-
// if it's not we fallback to sendResponse's handling
|
|
328
|
-
if (pendingWaitUntil) {
|
|
329
|
-
if (ctx.waitUntil) {
|
|
330
|
-
ctx.waitUntil(pendingWaitUntil);
|
|
331
|
-
pendingWaitUntil = undefined;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
const cacheTags = context.renderOpts.collectedTags;
|
|
335
|
-
// If the request is for a static response, we can cache it so long
|
|
336
|
-
// as it's not edge.
|
|
337
|
-
if (isIsr) {
|
|
338
|
-
const blob = await response.blob();
|
|
339
|
-
// Copy the headers from the response.
|
|
340
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
341
|
-
if (cacheTags) {
|
|
342
|
-
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
343
|
-
}
|
|
344
|
-
if (!headers['content-type'] && blob.type) {
|
|
345
|
-
headers['content-type'] = blob.type;
|
|
346
|
-
}
|
|
347
|
-
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
348
|
-
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
|
|
349
|
-
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
350
|
-
// build-time fallback in `build/index.ts` so cache entries
|
|
351
|
-
// and the response Cache-Control header agree on the route's
|
|
352
|
-
// effective expire. Routes that opt out of revalidation
|
|
353
|
-
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
354
|
-
// keep `expire: undefined`.
|
|
355
|
-
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
356
|
-
// Create the cache entry for the response.
|
|
357
|
-
const cacheEntry = {
|
|
358
|
-
value: {
|
|
359
|
-
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
360
|
-
status: response.status,
|
|
361
|
-
body: Buffer.from(await blob.arrayBuffer()),
|
|
362
|
-
headers
|
|
363
|
-
},
|
|
364
|
-
cacheControl: {
|
|
365
|
-
revalidate,
|
|
366
|
-
expire
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
return cacheEntry;
|
|
370
|
-
} else {
|
|
371
|
-
// send response without caching if not ISR
|
|
372
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
373
|
-
return null;
|
|
374
|
-
}
|
|
375
|
-
} catch (err) {
|
|
376
|
-
// if this is a background revalidate we need to report
|
|
377
|
-
// the request error here as it won't be bubbled
|
|
378
|
-
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
379
|
-
const silenceLog = false;
|
|
380
|
-
await routeModule.onRequestError(req, err, {
|
|
381
|
-
routerKind: 'App Router',
|
|
382
|
-
routePath: srcPage,
|
|
383
|
-
routeType: 'route',
|
|
384
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
385
|
-
isStaticGeneration: cacheKey !== null,
|
|
386
|
-
isOnDemandRevalidate
|
|
387
|
-
})
|
|
388
|
-
}, silenceLog, routerServerContext);
|
|
389
|
-
}
|
|
390
|
-
throw err;
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
const handleResponse = async (currentSpan, parentSpan)=>{
|
|
394
|
-
try {
|
|
395
|
-
var _cacheEntry_value;
|
|
396
|
-
const cacheEntry = await routeModule.handleResponse({
|
|
397
|
-
req,
|
|
398
|
-
nextConfig,
|
|
399
|
-
cacheKey,
|
|
400
|
-
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
401
|
-
isFallback: false,
|
|
402
|
-
previewProps,
|
|
403
|
-
prerenderManifest,
|
|
404
|
-
isRoutePPREnabled: false,
|
|
405
|
-
isOnDemandRevalidate,
|
|
406
|
-
revalidateOnlyGenerated,
|
|
407
|
-
responseGenerator,
|
|
408
|
-
waitUntil: ctx.waitUntil,
|
|
409
|
-
isMinimalMode
|
|
410
|
-
});
|
|
411
|
-
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
412
|
-
throw cacheEntry.error;
|
|
413
|
-
}
|
|
414
|
-
// we don't create a cacheEntry for ISR
|
|
415
|
-
if (!isIsr) {
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
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) {
|
|
419
|
-
var _cacheEntry_value1;
|
|
420
|
-
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
421
|
-
}
|
|
422
|
-
if (!isMinimalMode) {
|
|
423
|
-
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
424
|
-
}
|
|
425
|
-
// Draft mode should never be cached
|
|
426
|
-
if (isDraftMode) {
|
|
427
|
-
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
428
|
-
}
|
|
429
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
430
|
-
if (!(isMinimalMode && isIsr)) {
|
|
431
|
-
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
432
|
-
}
|
|
433
|
-
// If cache control is already set on the response we don't
|
|
434
|
-
// override it to allow users to customize it via next.config
|
|
435
|
-
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
436
|
-
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
437
|
-
}
|
|
438
|
-
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'.
|
|
439
|
-
new Response(cacheEntry.value.body, {
|
|
440
|
-
headers,
|
|
441
|
-
status: cacheEntry.value.status || 200
|
|
442
|
-
}));
|
|
443
|
-
return;
|
|
444
|
-
} catch (err) {
|
|
445
|
-
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
446
|
-
const silenceLog = false;
|
|
447
|
-
await routeModule.onRequestError(req, err, {
|
|
448
|
-
routerKind: 'App Router',
|
|
449
|
-
routePath: normalizedSrcPage,
|
|
450
|
-
routeType: 'route',
|
|
451
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
452
|
-
isStaticGeneration: cacheKey !== null,
|
|
453
|
-
isOnDemandRevalidate
|
|
454
|
-
})
|
|
455
|
-
}, silenceLog, routerServerContext);
|
|
456
|
-
}
|
|
457
|
-
// rethrow so that we can handle serving error page
|
|
458
|
-
// If this is during static generation, throw the error again.
|
|
459
|
-
if (isIsr) throw err;
|
|
460
|
-
// Otherwise, send a 500 response unless the original response has
|
|
461
|
-
// already committed. In that case, preserve its status code for
|
|
462
|
-
// telemetry while still recording the failure and terminating a response
|
|
463
|
-
// that the failed pipeline left open.
|
|
464
|
-
if (res.headersSent) {
|
|
465
|
-
if (currentSpan) {
|
|
466
|
-
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
467
|
-
currentSpan.recordException(error);
|
|
468
|
-
currentSpan.setStatus({
|
|
469
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
470
|
-
message: error.message
|
|
471
|
-
});
|
|
472
|
-
currentSpan.setAttribute('error.type', error.name);
|
|
473
|
-
}
|
|
474
|
-
if (!res.writableEnded && !res.destroyed) {
|
|
475
|
-
res.end();
|
|
476
|
-
}
|
|
477
|
-
} else {
|
|
478
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
479
|
-
status: 500
|
|
480
|
-
}));
|
|
481
|
-
}
|
|
482
|
-
return;
|
|
483
|
-
} finally{
|
|
484
|
-
;
|
|
485
|
-
(()=>{
|
|
486
|
-
if (!currentSpan) {
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
let statusCode = res.statusCode;
|
|
490
|
-
currentSpan.setAttributes({
|
|
491
|
-
'http.status_code': statusCode,
|
|
492
|
-
'next.rsc': false
|
|
493
|
-
});
|
|
494
|
-
if (statusCode && statusCode >= 500) {
|
|
495
|
-
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
496
|
-
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
497
|
-
currentSpan.setStatus({
|
|
498
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
499
|
-
});
|
|
500
|
-
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
501
|
-
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
502
|
-
}
|
|
503
|
-
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
504
|
-
// We were unable to get attributes, probably OTEL is not enabled
|
|
505
|
-
if (!rootSpanAttributes) {
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
509
|
-
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
513
|
-
const name = `${method} ${route}`;
|
|
514
|
-
currentSpan.setAttributes({
|
|
515
|
-
'next.route': route,
|
|
516
|
-
'http.route': route,
|
|
517
|
-
'next.span_name': name
|
|
518
|
-
});
|
|
519
|
-
currentSpan.updateName(name);
|
|
520
|
-
// Propagate http.route to the parent span if one exists (e.g.
|
|
521
|
-
// a platform-created HTTP span in adapter deployments).
|
|
522
|
-
if (parentSpan && parentSpan !== currentSpan) {
|
|
523
|
-
parentSpan.setAttribute('http.route', route);
|
|
524
|
-
parentSpan.updateName(name);
|
|
525
|
-
}
|
|
526
|
-
})();
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
// TODO: activeSpan code path is for when wrapped by
|
|
530
|
-
// next-server can be removed when this is no longer used
|
|
531
|
-
if (isWrappedByNextServer && activeSpan) {
|
|
532
|
-
await handleResponse(activeSpan, undefined);
|
|
533
|
-
} else {
|
|
534
|
-
let parentSpan = tracer.getActiveScopeSpan();
|
|
535
|
-
await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
|
|
536
|
-
spanName: `${method} ${srcPage}`,
|
|
537
|
-
kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
|
|
538
|
-
attributes: {
|
|
539
|
-
'http.method': method,
|
|
540
|
-
'http.target': req.url
|
|
541
|
-
}
|
|
542
|
-
}, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
|
|
454
|
+
for (const k of DISPLAY_FILTER_KEYS){
|
|
455
|
+
if (k in patch && typeof patch[k] === "boolean") next[k] = patch[k];
|
|
543
456
|
}
|
|
457
|
+
(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);
|
|
458
|
+
return next;
|
|
544
459
|
}
|
|
545
460
|
|
|
546
|
-
//# sourceMappingURL=app-route.js.map
|
|
547
|
-
|
|
548
461
|
|
|
549
462
|
/***/ }),
|
|
550
463
|
|
|
551
|
-
/***/
|
|
552
|
-
/***/ ((module) => {
|
|
553
|
-
|
|
554
|
-
module.exports = require("stream");
|
|
555
|
-
|
|
556
|
-
/***/ }),
|
|
557
|
-
|
|
558
|
-
/***/ 28354:
|
|
464
|
+
/***/ 44708:
|
|
559
465
|
/***/ ((module) => {
|
|
560
466
|
|
|
561
|
-
module.exports = require("
|
|
467
|
+
module.exports = require("node:https");
|
|
562
468
|
|
|
563
469
|
/***/ }),
|
|
564
470
|
|
|
565
|
-
/***/
|
|
471
|
+
/***/ 44870:
|
|
566
472
|
/***/ ((module) => {
|
|
567
473
|
|
|
568
|
-
module.exports = require("
|
|
474
|
+
module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
|
|
569
475
|
|
|
570
476
|
/***/ }),
|
|
571
477
|
|
|
572
|
-
/***/
|
|
478
|
+
/***/ 48161:
|
|
573
479
|
/***/ ((module) => {
|
|
574
480
|
|
|
575
|
-
module.exports = require("
|
|
481
|
+
module.exports = require("node:os");
|
|
576
482
|
|
|
577
483
|
/***/ }),
|
|
578
484
|
|
|
579
|
-
/***/
|
|
485
|
+
/***/ 51455:
|
|
580
486
|
/***/ ((module) => {
|
|
581
487
|
|
|
582
|
-
module.exports = require("node:
|
|
488
|
+
module.exports = require("node:fs/promises");
|
|
583
489
|
|
|
584
490
|
/***/ }),
|
|
585
491
|
|
|
586
|
-
/***/
|
|
492
|
+
/***/ 55511:
|
|
587
493
|
/***/ ((module) => {
|
|
588
494
|
|
|
589
|
-
module.exports = require("
|
|
495
|
+
module.exports = require("crypto");
|
|
590
496
|
|
|
591
497
|
/***/ }),
|
|
592
498
|
|
|
593
|
-
/***/
|
|
499
|
+
/***/ 55591:
|
|
594
500
|
/***/ ((module) => {
|
|
595
501
|
|
|
596
|
-
module.exports = require("
|
|
502
|
+
module.exports = require("https");
|
|
597
503
|
|
|
598
504
|
/***/ }),
|
|
599
505
|
|
|
600
|
-
/***/
|
|
506
|
+
/***/ 57075:
|
|
601
507
|
/***/ ((module) => {
|
|
602
508
|
|
|
603
|
-
module.exports = require("node:
|
|
509
|
+
module.exports = require("node:stream");
|
|
604
510
|
|
|
605
511
|
/***/ }),
|
|
606
512
|
|
|
607
|
-
/***/
|
|
513
|
+
/***/ 57901:
|
|
608
514
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
609
515
|
|
|
516
|
+
__webpack_require__.r(__webpack_exports__);
|
|
610
517
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
611
|
-
/* harmony export */
|
|
612
|
-
/* harmony export */
|
|
613
|
-
/* harmony export */
|
|
614
|
-
/* harmony export */
|
|
615
|
-
/* harmony export */
|
|
616
|
-
/* harmony export */
|
|
617
|
-
/* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
|
|
618
|
-
/* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
|
|
619
|
-
/* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
|
|
620
|
-
/* harmony export */ mJ: () => (/* binding */ getAgentConfig),
|
|
621
|
-
/* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
|
|
622
|
-
/* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
|
|
623
|
-
/* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
|
|
624
|
-
/* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
|
|
625
|
-
/* harmony export */ zb: () => (/* binding */ listAgentConfigs)
|
|
518
|
+
/* harmony export */ handler: () => (/* binding */ handler),
|
|
519
|
+
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
520
|
+
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
521
|
+
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
522
|
+
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
523
|
+
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
626
524
|
/* harmony export */ });
|
|
627
|
-
/* harmony import */ var
|
|
628
|
-
/* harmony import */ var
|
|
629
|
-
/* harmony import */ var
|
|
525
|
+
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
|
|
526
|
+
/* 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__);
|
|
527
|
+
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
|
|
528
|
+
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
529
|
+
/* 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__);
|
|
530
|
+
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
|
|
531
|
+
/* 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__);
|
|
532
|
+
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
|
|
533
|
+
/* 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__);
|
|
534
|
+
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
|
|
535
|
+
/* 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__);
|
|
536
|
+
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
|
|
537
|
+
/* 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__);
|
|
538
|
+
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
|
|
539
|
+
/* 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__);
|
|
540
|
+
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
|
|
541
|
+
/* 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__);
|
|
542
|
+
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
|
|
543
|
+
/* 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__);
|
|
544
|
+
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
|
|
545
|
+
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
|
|
546
|
+
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
|
|
547
|
+
/* 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__);
|
|
548
|
+
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
|
|
549
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
|
|
550
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
551
|
+
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
|
|
552
|
+
/* 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__);
|
|
553
|
+
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
|
|
554
|
+
/* 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__);
|
|
555
|
+
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
|
|
556
|
+
/* 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__);
|
|
630
557
|
|
|
631
558
|
|
|
632
559
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}
|
|
681
|
-
function
|
|
682
|
-
return (0,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
// We inject the nextConfigOutput here so that we can use them in the route
|
|
576
|
+
// module.
|
|
577
|
+
const nextConfigOutput = "standalone"
|
|
578
|
+
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
579
|
+
definition: {
|
|
580
|
+
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
581
|
+
page: "/api/v1/agents/[id]/thread/route",
|
|
582
|
+
pathname: "/api/v1/agents/[id]/thread",
|
|
583
|
+
filename: "route",
|
|
584
|
+
bundlePath: "app/api/v1/agents/[id]/thread/route"
|
|
585
|
+
},
|
|
586
|
+
distDir: ".next" || 0,
|
|
587
|
+
relativeProjectDir: false || '',
|
|
588
|
+
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/agents/[id]/thread/route.ts",
|
|
589
|
+
nextConfigOutput,
|
|
590
|
+
// The lazy require factory ensures that:
|
|
591
|
+
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
592
|
+
// correctly attributing module load time to application-code rather than
|
|
593
|
+
// framework internals.
|
|
594
|
+
// - In all modes: async modules (route files with top-level await) are
|
|
595
|
+
// handled correctly — require() returns a Promise for such modules, which
|
|
596
|
+
// ensureUserland() awaits before the first request is handled.
|
|
597
|
+
userland: ()=>__webpack_require__(14622),
|
|
598
|
+
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
599
|
+
// server HMR updates are picked up without re-executing the entry chunk.
|
|
600
|
+
// Using require() (synchronous) avoids adding async overhead that would be
|
|
601
|
+
// incorrectly attributed to application-code time in devRequestTiming.
|
|
602
|
+
... false ? 0 : {}
|
|
603
|
+
});
|
|
604
|
+
// Pull out the exports that we need to expose from the module. This should
|
|
605
|
+
// be eliminated when we've moved the other routes to the new format. These
|
|
606
|
+
// are used to hook into the route.
|
|
607
|
+
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
608
|
+
function patchFetch() {
|
|
609
|
+
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
610
|
+
workAsyncStorage,
|
|
611
|
+
workUnitAsyncStorage
|
|
612
|
+
});
|
|
686
613
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
* Parse the agent's tool allowlist (`tools` column, stored as a JSON string).
|
|
692
|
-
* Returns an empty array on NULL/blank/malformed JSON — same defensive shape
|
|
693
|
-
* as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
|
|
694
|
-
* inline should switch to this getter so the serialization contract stays
|
|
695
|
-
* owned by this store.
|
|
696
|
-
*/ function getAgentTools(cfg) {
|
|
697
|
-
if (!cfg?.tools) return [];
|
|
698
|
-
try {
|
|
699
|
-
const parsed = JSON.parse(cfg.tools);
|
|
700
|
-
if (!Array.isArray(parsed)) return [];
|
|
701
|
-
return parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
702
|
-
} catch {
|
|
703
|
-
return [];
|
|
614
|
+
|
|
615
|
+
async function handler(req, res, ctx) {
|
|
616
|
+
if (ctx.requestMeta) {
|
|
617
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
|
|
704
618
|
}
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
if (!raw) return [];
|
|
708
|
-
try {
|
|
709
|
-
const parsed = JSON.parse(raw);
|
|
710
|
-
if (!Array.isArray(parsed)) return [];
|
|
711
|
-
const ids = parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
712
|
-
return Array.from(new Set(ids));
|
|
713
|
-
} catch {
|
|
714
|
-
return [];
|
|
619
|
+
if (routeModule.isDev) {
|
|
620
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
|
715
621
|
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
if (!cfg?.tool_credentials) return {};
|
|
724
|
-
try {
|
|
725
|
-
const parsed = JSON.parse(cfg.tool_credentials);
|
|
726
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
727
|
-
const out = {};
|
|
728
|
-
for (const [k, v] of Object.entries(parsed)){
|
|
729
|
-
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
730
|
-
}
|
|
731
|
-
return out;
|
|
732
|
-
} catch {
|
|
733
|
-
return {};
|
|
622
|
+
let srcPage = "/api/v1/agents/[id]/thread/route";
|
|
623
|
+
// turbopack doesn't normalize `/index` in the page name
|
|
624
|
+
// so we need to to process dynamic routes properly
|
|
625
|
+
// TODO: fix turbopack providing differing value from webpack
|
|
626
|
+
if (false) {} else if (srcPage === '/index') {
|
|
627
|
+
// we always normalize /index specifically
|
|
628
|
+
srcPage = '/';
|
|
734
629
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
function upsertAgentConfigTransaction(input) {
|
|
740
|
-
const t = now();
|
|
741
|
-
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
742
|
-
const existing = getAgentConfig(input.id);
|
|
743
|
-
const created_at = existing?.created_at ?? t;
|
|
744
|
-
const mbti = input.adaptive_mbti ?? toMbti(existing?.adaptive_mbti) ?? "INTJ";
|
|
745
|
-
const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
|
|
746
|
-
const strength = input.adaptive_persona_strength ?? preset.strength;
|
|
747
|
-
const empathy = input.adaptive_empathy ?? preset.empathy;
|
|
748
|
-
const expressiveness = input.adaptive_expressiveness ?? preset.expressiveness;
|
|
749
|
-
const verbosity = input.adaptive_verbosity ?? preset.verbosity;
|
|
750
|
-
if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
|
|
751
|
-
// harness_id: explicit `undefined` means "keep existing"; explicit `null`
|
|
752
|
-
// means "use the global default". Empty string is normalised to null too,
|
|
753
|
-
// matching how the AgentEditor sends "" for the inherit option.
|
|
754
|
-
const harnessId = input.harness_id === undefined ? existing?.harness_id ?? null : input.harness_id && input.harness_id.length > 0 ? input.harness_id : null;
|
|
755
|
-
// delegate_targets: undefined = keep existing; explicit empty array clears.
|
|
756
|
-
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))));
|
|
757
|
-
// context_tier_proportions: undefined = keep existing; null = clear and
|
|
758
|
-
// inherit from the model; object = serialise as JSON. Negative values are
|
|
759
|
-
// clamped to 0 so the upsert can't poison the column with bad data.
|
|
760
|
-
const tierProportions = input.context_tier_proportions === undefined ? existing?.context_tier_proportions ?? null : input.context_tier_proportions === null ? null : JSON.stringify({
|
|
761
|
-
hot: Math.max(0, Number(input.context_tier_proportions.hot) || 0),
|
|
762
|
-
warm: Math.max(0, Number(input.context_tier_proportions.warm) || 0),
|
|
763
|
-
facts: Math.max(0, Number(input.context_tier_proportions.facts) || 0)
|
|
630
|
+
const multiZoneDraftMode = false;
|
|
631
|
+
const prepareResult = await routeModule.prepare(req, res, {
|
|
632
|
+
srcPage,
|
|
633
|
+
multiZoneDraftMode
|
|
764
634
|
});
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
const
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
|
|
795
|
-
harness_id, delegate_targets, context_tier_proportions,
|
|
796
|
-
anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
|
|
797
|
-
tool_credentials, router_policy, router_enabled, usage_strategy,
|
|
798
|
-
created_at, updated_at)
|
|
799
|
-
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"
|
|
800
|
-
// (important for PATCH-style updates that omit the field).
|
|
801
|
-
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);
|
|
802
|
-
return getAgentConfig(input.id);
|
|
803
|
-
}
|
|
804
|
-
function clampPercent(next, fallback) {
|
|
805
|
-
const n = Number.isFinite(next) ? Number(next) : fallback;
|
|
806
|
-
return Math.max(0, Math.min(100, Math.round(n)));
|
|
807
|
-
}
|
|
808
|
-
function serialiseToolCredentials(input, existing) {
|
|
809
|
-
if (input === undefined) return existing;
|
|
810
|
-
const cleaned = {};
|
|
811
|
-
for (const [k, v] of Object.entries(input)){
|
|
812
|
-
if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
|
|
813
|
-
cleaned[k] = v;
|
|
635
|
+
if (!prepareResult) {
|
|
636
|
+
res.statusCode = 400;
|
|
637
|
+
res.end('Bad Request');
|
|
638
|
+
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
|
639
|
+
return null;
|
|
640
|
+
}
|
|
641
|
+
const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
|
|
642
|
+
const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
|
|
643
|
+
// Only this route's prerenders can establish ISR or admit generated params.
|
|
644
|
+
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]));
|
|
645
|
+
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
646
|
+
const render404 = async ()=>{
|
|
647
|
+
// TODO: should route-module itself handle rendering the 404
|
|
648
|
+
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
649
|
+
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
650
|
+
} else {
|
|
651
|
+
res.end('This page could not be found');
|
|
652
|
+
}
|
|
653
|
+
return null;
|
|
654
|
+
};
|
|
655
|
+
if (isIsr && !isDraftMode) {
|
|
656
|
+
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
657
|
+
if (prerenderInfo) {
|
|
658
|
+
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
659
|
+
if (nextConfig.adapterPath) {
|
|
660
|
+
return await render404();
|
|
661
|
+
}
|
|
662
|
+
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
663
|
+
}
|
|
814
664
|
}
|
|
815
665
|
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
666
|
+
let cacheKey = null;
|
|
667
|
+
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
668
|
+
cacheKey = resolvedPathname;
|
|
669
|
+
// ensure /index and / is normalized to one key
|
|
670
|
+
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
671
|
+
}
|
|
672
|
+
// Before rendering (which initializes component tree modules), we have to
|
|
673
|
+
// set the reference manifests to our global store so Server Action's
|
|
674
|
+
// encryption util can access to them at the top level of the page module.
|
|
675
|
+
if (serverActionsManifest && clientReferenceManifest) {
|
|
676
|
+
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
677
|
+
page: srcPage,
|
|
678
|
+
clientReferenceManifest,
|
|
679
|
+
serverActionsManifest
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
const method = req.method || 'GET';
|
|
683
|
+
const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
|
|
684
|
+
const activeSpan = tracer.getActiveScopeSpan();
|
|
685
|
+
const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
|
|
686
|
+
const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
|
|
687
|
+
const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
|
|
688
|
+
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
689
|
+
globalThis.__incrementalCache = incrementalCache;
|
|
690
|
+
const context = {
|
|
691
|
+
params,
|
|
692
|
+
previewProps,
|
|
693
|
+
renderOpts: {
|
|
694
|
+
experimental: {
|
|
695
|
+
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
696
|
+
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
697
|
+
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
698
|
+
},
|
|
699
|
+
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
700
|
+
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
701
|
+
isDraftMode,
|
|
702
|
+
incrementalCache,
|
|
703
|
+
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
704
|
+
cacheLifeProfiles: nextConfig.cacheLife,
|
|
705
|
+
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
706
|
+
waitUntil: ctx.waitUntil,
|
|
707
|
+
onClose: (cb)=>{
|
|
708
|
+
res.on('close', cb);
|
|
709
|
+
},
|
|
710
|
+
onAfterTaskError: undefined
|
|
711
|
+
},
|
|
712
|
+
sharedContext: {
|
|
713
|
+
buildId,
|
|
714
|
+
deploymentId
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
718
|
+
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
719
|
+
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));
|
|
720
|
+
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
721
|
+
try {
|
|
722
|
+
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
723
|
+
res.statusCode = 404;
|
|
724
|
+
// on-demand revalidate always sets this header
|
|
725
|
+
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
726
|
+
res.end('This page could not be found');
|
|
727
|
+
return null;
|
|
728
|
+
}
|
|
729
|
+
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
730
|
+
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
731
|
+
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
732
|
+
// Attempt using provided waitUntil if available
|
|
733
|
+
// if it's not we fallback to sendResponse's handling
|
|
734
|
+
if (pendingWaitUntil) {
|
|
735
|
+
if (ctx.waitUntil) {
|
|
736
|
+
ctx.waitUntil(pendingWaitUntil);
|
|
737
|
+
pendingWaitUntil = undefined;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
const cacheTags = context.renderOpts.collectedTags;
|
|
741
|
+
// If the request is for a static response, we can cache it so long
|
|
742
|
+
// as it's not edge.
|
|
743
|
+
if (isIsr) {
|
|
744
|
+
const blob = await response.blob();
|
|
745
|
+
// Copy the headers from the response.
|
|
746
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
747
|
+
if (cacheTags) {
|
|
748
|
+
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
749
|
+
}
|
|
750
|
+
if (!headers['content-type'] && blob.type) {
|
|
751
|
+
headers['content-type'] = blob.type;
|
|
752
|
+
}
|
|
753
|
+
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
754
|
+
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
|
|
755
|
+
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
756
|
+
// build-time fallback in `build/index.ts` so cache entries
|
|
757
|
+
// and the response Cache-Control header agree on the route's
|
|
758
|
+
// effective expire. Routes that opt out of revalidation
|
|
759
|
+
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
760
|
+
// keep `expire: undefined`.
|
|
761
|
+
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
762
|
+
// Create the cache entry for the response.
|
|
763
|
+
const cacheEntry = {
|
|
764
|
+
value: {
|
|
765
|
+
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
766
|
+
status: response.status,
|
|
767
|
+
body: Buffer.from(await blob.arrayBuffer()),
|
|
768
|
+
headers
|
|
769
|
+
},
|
|
770
|
+
cacheControl: {
|
|
771
|
+
revalidate,
|
|
772
|
+
expire
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
return cacheEntry;
|
|
776
|
+
} else {
|
|
777
|
+
// send response without caching if not ISR
|
|
778
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
779
|
+
return null;
|
|
780
|
+
}
|
|
781
|
+
} catch (err) {
|
|
782
|
+
// if this is a background revalidate we need to report
|
|
783
|
+
// the request error here as it won't be bubbled
|
|
784
|
+
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
785
|
+
const silenceLog = false;
|
|
786
|
+
await routeModule.onRequestError(req, err, {
|
|
787
|
+
routerKind: 'App Router',
|
|
788
|
+
routePath: srcPage,
|
|
789
|
+
routeType: 'route',
|
|
790
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
791
|
+
isStaticGeneration: cacheKey !== null,
|
|
792
|
+
isOnDemandRevalidate
|
|
793
|
+
})
|
|
794
|
+
}, silenceLog, routerServerContext);
|
|
795
|
+
}
|
|
796
|
+
throw err;
|
|
797
|
+
}
|
|
857
798
|
};
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
799
|
+
const handleResponse = async (currentSpan, parentSpan)=>{
|
|
800
|
+
try {
|
|
801
|
+
var _cacheEntry_value;
|
|
802
|
+
const cacheEntry = await routeModule.handleResponse({
|
|
803
|
+
req,
|
|
804
|
+
nextConfig,
|
|
805
|
+
cacheKey,
|
|
806
|
+
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
807
|
+
isFallback: false,
|
|
808
|
+
previewProps,
|
|
809
|
+
prerenderManifest,
|
|
810
|
+
isRoutePPREnabled: false,
|
|
811
|
+
isOnDemandRevalidate,
|
|
812
|
+
revalidateOnlyGenerated,
|
|
813
|
+
responseGenerator,
|
|
814
|
+
waitUntil: ctx.waitUntil,
|
|
815
|
+
isMinimalMode
|
|
816
|
+
});
|
|
817
|
+
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
818
|
+
throw cacheEntry.error;
|
|
819
|
+
}
|
|
820
|
+
// we don't create a cacheEntry for ISR
|
|
821
|
+
if (!isIsr) {
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
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) {
|
|
825
|
+
var _cacheEntry_value1;
|
|
826
|
+
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
827
|
+
}
|
|
828
|
+
if (!isMinimalMode) {
|
|
829
|
+
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
830
|
+
}
|
|
831
|
+
// Draft mode should never be cached
|
|
832
|
+
if (isDraftMode) {
|
|
833
|
+
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
834
|
+
}
|
|
835
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
836
|
+
if (!(isMinimalMode && isIsr)) {
|
|
837
|
+
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
838
|
+
}
|
|
839
|
+
// If cache control is already set on the response we don't
|
|
840
|
+
// override it to allow users to customize it via next.config
|
|
841
|
+
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
842
|
+
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
843
|
+
}
|
|
844
|
+
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'.
|
|
845
|
+
new Response(cacheEntry.value.body, {
|
|
846
|
+
headers,
|
|
847
|
+
status: cacheEntry.value.status || 200
|
|
848
|
+
}));
|
|
849
|
+
return;
|
|
850
|
+
} catch (err) {
|
|
851
|
+
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
852
|
+
const silenceLog = false;
|
|
853
|
+
await routeModule.onRequestError(req, err, {
|
|
854
|
+
routerKind: 'App Router',
|
|
855
|
+
routePath: normalizedSrcPage,
|
|
856
|
+
routeType: 'route',
|
|
857
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
858
|
+
isStaticGeneration: cacheKey !== null,
|
|
859
|
+
isOnDemandRevalidate
|
|
860
|
+
})
|
|
861
|
+
}, silenceLog, routerServerContext);
|
|
862
|
+
}
|
|
863
|
+
// rethrow so that we can handle serving error page
|
|
864
|
+
// If this is during static generation, throw the error again.
|
|
865
|
+
if (isIsr) throw err;
|
|
866
|
+
// Otherwise, send a 500 response unless the original response has
|
|
867
|
+
// already committed. In that case, preserve its status code for
|
|
868
|
+
// telemetry while still recording the failure and terminating a response
|
|
869
|
+
// that the failed pipeline left open.
|
|
870
|
+
if (res.headersSent) {
|
|
871
|
+
if (currentSpan) {
|
|
872
|
+
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
873
|
+
currentSpan.recordException(error);
|
|
874
|
+
currentSpan.setStatus({
|
|
875
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
876
|
+
message: error.message
|
|
877
|
+
});
|
|
878
|
+
currentSpan.setAttribute('error.type', error.name);
|
|
879
|
+
}
|
|
880
|
+
if (!res.writableEnded && !res.destroyed) {
|
|
881
|
+
res.end();
|
|
882
|
+
}
|
|
883
|
+
} else {
|
|
884
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
885
|
+
status: 500
|
|
886
|
+
}));
|
|
887
|
+
}
|
|
888
|
+
return;
|
|
889
|
+
} finally{
|
|
890
|
+
;
|
|
891
|
+
(()=>{
|
|
892
|
+
if (!currentSpan) {
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
let statusCode = res.statusCode;
|
|
896
|
+
currentSpan.setAttributes({
|
|
897
|
+
'http.status_code': statusCode,
|
|
898
|
+
'next.rsc': false
|
|
899
|
+
});
|
|
900
|
+
if (statusCode && statusCode >= 500) {
|
|
901
|
+
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
902
|
+
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
903
|
+
currentSpan.setStatus({
|
|
904
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
905
|
+
});
|
|
906
|
+
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
907
|
+
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
908
|
+
}
|
|
909
|
+
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
910
|
+
// We were unable to get attributes, probably OTEL is not enabled
|
|
911
|
+
if (!rootSpanAttributes) {
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
915
|
+
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
919
|
+
const name = `${method} ${route}`;
|
|
920
|
+
currentSpan.setAttributes({
|
|
921
|
+
'next.route': route,
|
|
922
|
+
'http.route': route,
|
|
923
|
+
'next.span_name': name
|
|
924
|
+
});
|
|
925
|
+
currentSpan.updateName(name);
|
|
926
|
+
// Propagate http.route to the parent span if one exists (e.g.
|
|
927
|
+
// a platform-created HTTP span in adapter deployments).
|
|
928
|
+
if (parentSpan && parentSpan !== currentSpan) {
|
|
929
|
+
parentSpan.setAttribute('http.route', route);
|
|
930
|
+
parentSpan.updateName(name);
|
|
931
|
+
}
|
|
932
|
+
})();
|
|
933
|
+
}
|
|
892
934
|
};
|
|
893
|
-
for
|
|
894
|
-
|
|
935
|
+
// TODO: activeSpan code path is for when wrapped by
|
|
936
|
+
// next-server can be removed when this is no longer used
|
|
937
|
+
if (isWrappedByNextServer && activeSpan) {
|
|
938
|
+
await handleResponse(activeSpan, undefined);
|
|
939
|
+
} else {
|
|
940
|
+
let parentSpan = tracer.getActiveScopeSpan();
|
|
941
|
+
await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
|
|
942
|
+
spanName: `${method} ${srcPage}`,
|
|
943
|
+
kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
|
|
944
|
+
attributes: {
|
|
945
|
+
'http.method': method,
|
|
946
|
+
'http.target': req.url
|
|
947
|
+
}
|
|
948
|
+
}, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
|
|
895
949
|
}
|
|
896
|
-
(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);
|
|
897
|
-
return next;
|
|
898
950
|
}
|
|
899
951
|
|
|
952
|
+
//# sourceMappingURL=app-route.js.map
|
|
900
953
|
|
|
901
|
-
/***/ }),
|
|
902
|
-
|
|
903
|
-
/***/ 44708:
|
|
904
|
-
/***/ ((module) => {
|
|
905
|
-
|
|
906
|
-
module.exports = require("node:https");
|
|
907
|
-
|
|
908
|
-
/***/ }),
|
|
909
|
-
|
|
910
|
-
/***/ 44870:
|
|
911
|
-
/***/ ((module) => {
|
|
912
|
-
|
|
913
|
-
module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
|
|
914
|
-
|
|
915
|
-
/***/ }),
|
|
916
|
-
|
|
917
|
-
/***/ 48161:
|
|
918
|
-
/***/ ((module) => {
|
|
919
|
-
|
|
920
|
-
module.exports = require("node:os");
|
|
921
|
-
|
|
922
|
-
/***/ }),
|
|
923
|
-
|
|
924
|
-
/***/ 51455:
|
|
925
|
-
/***/ ((module) => {
|
|
926
|
-
|
|
927
|
-
module.exports = require("node:fs/promises");
|
|
928
|
-
|
|
929
|
-
/***/ }),
|
|
930
|
-
|
|
931
|
-
/***/ 55511:
|
|
932
|
-
/***/ ((module) => {
|
|
933
|
-
|
|
934
|
-
module.exports = require("crypto");
|
|
935
|
-
|
|
936
|
-
/***/ }),
|
|
937
|
-
|
|
938
|
-
/***/ 55591:
|
|
939
|
-
/***/ ((module) => {
|
|
940
|
-
|
|
941
|
-
module.exports = require("https");
|
|
942
|
-
|
|
943
|
-
/***/ }),
|
|
944
|
-
|
|
945
|
-
/***/ 57075:
|
|
946
|
-
/***/ ((module) => {
|
|
947
|
-
|
|
948
|
-
module.exports = require("node:stream");
|
|
949
954
|
|
|
950
955
|
/***/ }),
|
|
951
956
|
|
|
@@ -984,6 +989,13 @@ module.exports = require("node:path");
|
|
|
984
989
|
|
|
985
990
|
/***/ }),
|
|
986
991
|
|
|
992
|
+
/***/ 77030:
|
|
993
|
+
/***/ ((module) => {
|
|
994
|
+
|
|
995
|
+
module.exports = require("node:net");
|
|
996
|
+
|
|
997
|
+
/***/ }),
|
|
998
|
+
|
|
987
999
|
/***/ 77598:
|
|
988
1000
|
/***/ ((module) => {
|
|
989
1001
|
|
|
@@ -1047,7 +1059,7 @@ module.exports = import("@huggingface/transformers");;
|
|
|
1047
1059
|
var __webpack_require__ = require("../../../../../../webpack-runtime.js");
|
|
1048
1060
|
__webpack_require__.C(exports);
|
|
1049
1061
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
1050
|
-
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46,3042], () => (__webpack_exec__(
|
|
1062
|
+
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46,3042], () => (__webpack_exec__(57901)));
|
|
1051
1063
|
module.exports = __webpack_exports__;
|
|
1052
1064
|
|
|
1053
1065
|
})();
|