@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
|
@@ -33,1103 +33,1115 @@ module.exports = require("next/dist/server/app-render/after-task-async-storage.e
|
|
|
33
33
|
|
|
34
34
|
/***/ }),
|
|
35
35
|
|
|
36
|
-
/***/
|
|
37
|
-
/***/ ((module) => {
|
|
38
|
-
|
|
39
|
-
module.exports = require("next/dist/server/runtime-reacts.external.js");
|
|
40
|
-
|
|
41
|
-
/***/ }),
|
|
42
|
-
|
|
43
|
-
/***/ 9956:
|
|
44
|
-
/***/ ((module) => {
|
|
45
|
-
|
|
46
|
-
module.exports = require("undici");
|
|
47
|
-
|
|
48
|
-
/***/ }),
|
|
49
|
-
|
|
50
|
-
/***/ 10846:
|
|
51
|
-
/***/ ((module) => {
|
|
52
|
-
|
|
53
|
-
module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");
|
|
54
|
-
|
|
55
|
-
/***/ }),
|
|
56
|
-
|
|
57
|
-
/***/ 16698:
|
|
58
|
-
/***/ ((module) => {
|
|
59
|
-
|
|
60
|
-
module.exports = require("node:async_hooks");
|
|
61
|
-
|
|
62
|
-
/***/ }),
|
|
63
|
-
|
|
64
|
-
/***/ 17127:
|
|
36
|
+
/***/ 6039:
|
|
65
37
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
66
38
|
|
|
67
39
|
__webpack_require__.r(__webpack_exports__);
|
|
68
40
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
69
|
-
/* harmony export */
|
|
41
|
+
/* harmony export */ handler: () => (/* binding */ handler),
|
|
42
|
+
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
43
|
+
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
44
|
+
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
45
|
+
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
46
|
+
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
70
47
|
/* harmony export */ });
|
|
71
|
-
/* harmony import */ var
|
|
72
|
-
/* harmony import */ var
|
|
73
|
-
/* harmony import */ var
|
|
74
|
-
/* harmony import */ var
|
|
75
|
-
/* harmony import */ var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
const apiKey = (0,_lib_voice_gemini__WEBPACK_IMPORTED_MODULE_2__/* .resolveGoogleApiKey */ .DM)();
|
|
105
|
-
if (!apiKey) {
|
|
106
|
-
return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .errorResponse */ .yj)('Google API key not configured. Open Integrations → "Google AI (Gemini + Imagen)".');
|
|
107
|
-
}
|
|
108
|
-
const model = parsed.model?.trim() || agent.voice_model || "gemini-2.5-flash-preview-tts";
|
|
109
|
-
const voiceName = parsed.voice_name?.trim() || agent.voice_name || "Kore";
|
|
110
|
-
try {
|
|
111
|
-
const { wav } = await (0,_lib_voice_gemini__WEBPACK_IMPORTED_MODULE_2__/* .geminiTts */ .R$)({
|
|
112
|
-
apiKey,
|
|
113
|
-
model,
|
|
114
|
-
voiceName,
|
|
115
|
-
text
|
|
116
|
-
});
|
|
117
|
-
return new next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse(new Uint8Array(wav), {
|
|
118
|
-
status: 200,
|
|
119
|
-
headers: {
|
|
120
|
-
"Content-Type": "audio/wav",
|
|
121
|
-
"Content-Length": String(wav.length),
|
|
122
|
-
"Cache-Control": "no-store"
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
} catch (err) {
|
|
126
|
-
return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .errorResponse */ .yj)(String(err instanceof Error ? err.message : err), 502);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
/***/ }),
|
|
132
|
-
|
|
133
|
-
/***/ 19121:
|
|
134
|
-
/***/ ((module) => {
|
|
135
|
-
|
|
136
|
-
module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
|
|
137
|
-
|
|
138
|
-
/***/ }),
|
|
139
|
-
|
|
140
|
-
/***/ 27910:
|
|
141
|
-
/***/ ((module) => {
|
|
142
|
-
|
|
143
|
-
module.exports = require("stream");
|
|
144
|
-
|
|
145
|
-
/***/ }),
|
|
146
|
-
|
|
147
|
-
/***/ 28354:
|
|
148
|
-
/***/ ((module) => {
|
|
149
|
-
|
|
150
|
-
module.exports = require("util");
|
|
151
|
-
|
|
152
|
-
/***/ }),
|
|
153
|
-
|
|
154
|
-
/***/ 29021:
|
|
155
|
-
/***/ ((module) => {
|
|
156
|
-
|
|
157
|
-
module.exports = require("fs");
|
|
158
|
-
|
|
159
|
-
/***/ }),
|
|
48
|
+
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
|
|
49
|
+
/* 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__);
|
|
50
|
+
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
|
|
51
|
+
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
52
|
+
/* 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__);
|
|
53
|
+
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
|
|
54
|
+
/* 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__);
|
|
55
|
+
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
|
|
56
|
+
/* 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__);
|
|
57
|
+
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
|
|
58
|
+
/* 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__);
|
|
59
|
+
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
|
|
60
|
+
/* 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__);
|
|
61
|
+
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
|
|
62
|
+
/* 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__);
|
|
63
|
+
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
|
|
64
|
+
/* 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__);
|
|
65
|
+
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
|
|
66
|
+
/* 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__);
|
|
67
|
+
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
|
|
68
|
+
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
|
|
69
|
+
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
|
|
70
|
+
/* 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__);
|
|
71
|
+
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
|
|
72
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
|
|
73
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
74
|
+
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
|
|
75
|
+
/* 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__);
|
|
76
|
+
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
|
|
77
|
+
/* 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__);
|
|
78
|
+
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
|
|
79
|
+
/* 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__);
|
|
160
80
|
|
|
161
|
-
/***/ 29294:
|
|
162
|
-
/***/ ((module) => {
|
|
163
81
|
|
|
164
|
-
module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
|
|
165
82
|
|
|
166
|
-
/***/ }),
|
|
167
83
|
|
|
168
|
-
/***/ 31421:
|
|
169
|
-
/***/ ((module) => {
|
|
170
84
|
|
|
171
|
-
module.exports = require("node:child_process");
|
|
172
85
|
|
|
173
|
-
/***/ }),
|
|
174
86
|
|
|
175
|
-
/***/ 33873:
|
|
176
|
-
/***/ ((module) => {
|
|
177
87
|
|
|
178
|
-
module.exports = require("path");
|
|
179
88
|
|
|
180
|
-
/***/ }),
|
|
181
89
|
|
|
182
|
-
/***/ 37067:
|
|
183
|
-
/***/ ((module) => {
|
|
184
90
|
|
|
185
|
-
module.exports = require("node:http");
|
|
186
91
|
|
|
187
|
-
/***/ }),
|
|
188
92
|
|
|
189
|
-
/***/ 38522:
|
|
190
|
-
/***/ ((module) => {
|
|
191
93
|
|
|
192
|
-
module.exports = require("node:zlib");
|
|
193
94
|
|
|
194
|
-
/***/ }),
|
|
195
95
|
|
|
196
|
-
/***/ 39947:
|
|
197
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
198
96
|
|
|
199
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
200
|
-
/* harmony export */ Bm: () => (/* binding */ cachedJson),
|
|
201
|
-
/* harmony export */ HN: () => (/* binding */ notFoundResponse),
|
|
202
|
-
/* harmony export */ Jb: () => (/* binding */ validateBody),
|
|
203
|
-
/* harmony export */ K2: () => (/* binding */ createdResponse),
|
|
204
|
-
/* harmony export */ Ng: () => (/* binding */ noStoreJson),
|
|
205
|
-
/* harmony export */ yj: () => (/* binding */ errorResponse)
|
|
206
|
-
/* harmony export */ });
|
|
207
|
-
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
208
|
-
// Shared HTTP response builders for app/api/v1/** route handlers.
|
|
209
|
-
//
|
|
210
|
-
// Goal: every error/success payload across the v1 surface has the same
|
|
211
|
-
// shape. Before this lived inline, response bodies drifted —
|
|
212
|
-
// `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
|
|
213
|
-
// some routes returned Zod's raw issue array, others stringified it.
|
|
214
97
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
98
|
+
// We inject the nextConfigOutput here so that we can use them in the route
|
|
99
|
+
// module.
|
|
100
|
+
const nextConfigOutput = "standalone"
|
|
101
|
+
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
102
|
+
definition: {
|
|
103
|
+
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
104
|
+
page: "/api/v1/voice/tts/route",
|
|
105
|
+
pathname: "/api/v1/voice/tts",
|
|
106
|
+
filename: "route",
|
|
107
|
+
bundlePath: "app/api/v1/voice/tts/route"
|
|
108
|
+
},
|
|
109
|
+
distDir: ".next" || 0,
|
|
110
|
+
relativeProjectDir: false || '',
|
|
111
|
+
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/voice/tts/route.ts",
|
|
112
|
+
nextConfigOutput,
|
|
113
|
+
// The lazy require factory ensures that:
|
|
114
|
+
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
115
|
+
// correctly attributing module load time to application-code rather than
|
|
116
|
+
// framework internals.
|
|
117
|
+
// - In all modes: async modules (route files with top-level await) are
|
|
118
|
+
// handled correctly — require() returns a Promise for such modules, which
|
|
119
|
+
// ensureUserland() awaits before the first request is handled.
|
|
120
|
+
userland: ()=>__webpack_require__(17127),
|
|
121
|
+
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
122
|
+
// server HMR updates are picked up without re-executing the entry chunk.
|
|
123
|
+
// Using require() (synchronous) avoids adding async overhead that would be
|
|
124
|
+
// incorrectly attributed to application-code time in devRequestTiming.
|
|
125
|
+
... false ? 0 : {}
|
|
126
|
+
});
|
|
127
|
+
// Pull out the exports that we need to expose from the module. This should
|
|
128
|
+
// be eliminated when we've moved the other routes to the new format. These
|
|
129
|
+
// are used to hook into the route.
|
|
130
|
+
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
131
|
+
function patchFetch() {
|
|
132
|
+
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
133
|
+
workAsyncStorage,
|
|
134
|
+
workUnitAsyncStorage
|
|
228
135
|
});
|
|
229
136
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
// cache in place — stay observably consistent without an extra roundtrip.
|
|
235
|
-
//
|
|
236
|
-
// swrSeconds (optional): stale-while-revalidate window. When set, the browser
|
|
237
|
-
// serves the cached response immediately and refreshes in the background,
|
|
238
|
-
// making navigation feel instant. Use for data that can tolerate brief
|
|
239
|
-
// staleness (tool list, agent configs, model list). Omit for real-time data
|
|
240
|
-
// (dashboard metrics, credential state).
|
|
241
|
-
function cachedJson(data, maxAgeSeconds, swrSeconds) {
|
|
242
|
-
const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
|
|
243
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
244
|
-
headers: {
|
|
245
|
-
"Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
// Use for endpoints whose response contains live state that must never be
|
|
250
|
-
// served from cache — credentials, connection status, live config values.
|
|
251
|
-
function noStoreJson(data) {
|
|
252
|
-
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
253
|
-
headers: {
|
|
254
|
-
"Cache-Control": "no-store"
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
// Validate a JSON request body against a zod schema.
|
|
259
|
-
// Returns either the parsed data or a 400 NextResponse explaining the issue.
|
|
260
|
-
// Caller pattern:
|
|
261
|
-
// const parsed = await validateBody(req, Schema);
|
|
262
|
-
// if (parsed instanceof NextResponse) return parsed;
|
|
263
|
-
// // use parsed.field
|
|
264
|
-
async function validateBody(req, schema) {
|
|
265
|
-
let raw;
|
|
266
|
-
try {
|
|
267
|
-
raw = await req.json();
|
|
268
|
-
} catch {
|
|
269
|
-
return errorResponse("Request body must be valid JSON", 400);
|
|
137
|
+
|
|
138
|
+
async function handler(req, res, ctx) {
|
|
139
|
+
if (ctx.requestMeta) {
|
|
140
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
|
|
270
141
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
|
|
142
|
+
if (routeModule.isDev) {
|
|
143
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
|
274
144
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
283
|
-
|
|
284
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
285
|
-
/* harmony export */ BM: () => (/* binding */ upsertAgentConfig),
|
|
286
|
-
/* harmony export */ E1: () => (/* binding */ updateAgentDisplayFilters),
|
|
287
|
-
/* harmony export */ P2: () => (/* binding */ parseCitationStrictness),
|
|
288
|
-
/* harmony export */ S2: () => (/* binding */ getAgentToolCredentials),
|
|
289
|
-
/* harmony export */ SJ: () => (/* binding */ generateAgentId),
|
|
290
|
-
/* harmony export */ TG: () => (/* binding */ getAgentTools),
|
|
291
|
-
/* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
|
|
292
|
-
/* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
|
|
293
|
-
/* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
|
|
294
|
-
/* harmony export */ mJ: () => (/* binding */ getAgentConfig),
|
|
295
|
-
/* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
|
|
296
|
-
/* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
|
|
297
|
-
/* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
|
|
298
|
-
/* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
|
|
299
|
-
/* harmony export */ zb: () => (/* binding */ listAgentConfigs)
|
|
300
|
-
/* harmony export */ });
|
|
301
|
-
/* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
|
302
|
-
/* harmony import */ var _lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99043);
|
|
303
|
-
/* harmony import */ var _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66849);
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
const now = ()=>new Date().toISOString();
|
|
308
|
-
/** Coerce arbitrary input (DB row TEXT, API body, undefined) to the enum.
|
|
309
|
-
* Returns `null` for null/undefined/unknown values so callers can default. */ function parseCitationStrictness(value) {
|
|
310
|
-
if (value === "off" || value === "informational" || value === "standard" || value === "strict") {
|
|
311
|
-
return value;
|
|
145
|
+
let srcPage = "/api/v1/voice/tts/route";
|
|
146
|
+
// turbopack doesn't normalize `/index` in the page name
|
|
147
|
+
// so we need to to process dynamic routes properly
|
|
148
|
+
// TODO: fix turbopack providing differing value from webpack
|
|
149
|
+
if (false) {} else if (srcPage === '/index') {
|
|
150
|
+
// we always normalize /index specifically
|
|
151
|
+
srcPage = '/';
|
|
312
152
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if (!raw) return null;
|
|
323
|
-
try {
|
|
324
|
-
const parsed = JSON.parse(raw);
|
|
325
|
-
const hot = Number(parsed.hot);
|
|
326
|
-
const warm = Number(parsed.warm);
|
|
327
|
-
const facts = Number(parsed.facts);
|
|
328
|
-
if (![
|
|
329
|
-
hot,
|
|
330
|
-
warm,
|
|
331
|
-
facts
|
|
332
|
-
].every((n)=>Number.isFinite(n) && n >= 0)) return null;
|
|
333
|
-
if (hot + warm + facts <= 0) return null;
|
|
334
|
-
return {
|
|
335
|
-
hot,
|
|
336
|
-
warm,
|
|
337
|
-
facts
|
|
338
|
-
};
|
|
339
|
-
} catch {
|
|
153
|
+
const multiZoneDraftMode = false;
|
|
154
|
+
const prepareResult = await routeModule.prepare(req, res, {
|
|
155
|
+
srcPage,
|
|
156
|
+
multiZoneDraftMode
|
|
157
|
+
});
|
|
158
|
+
if (!prepareResult) {
|
|
159
|
+
res.statusCode = 400;
|
|
160
|
+
res.end('Bad Request');
|
|
161
|
+
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
|
340
162
|
return null;
|
|
341
163
|
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
//
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
* Returns an empty array on NULL/blank/malformed JSON — same defensive shape
|
|
367
|
-
* as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
|
|
368
|
-
* inline should switch to this getter so the serialization contract stays
|
|
369
|
-
* owned by this store.
|
|
370
|
-
*/ function getAgentTools(cfg) {
|
|
371
|
-
if (!cfg?.tools) return [];
|
|
372
|
-
try {
|
|
373
|
-
const parsed = JSON.parse(cfg.tools);
|
|
374
|
-
if (!Array.isArray(parsed)) return [];
|
|
375
|
-
return parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
376
|
-
} catch {
|
|
377
|
-
return [];
|
|
164
|
+
const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
|
|
165
|
+
const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
|
|
166
|
+
// Only this route's prerenders can establish ISR or admit generated params.
|
|
167
|
+
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]));
|
|
168
|
+
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
169
|
+
const render404 = async ()=>{
|
|
170
|
+
// TODO: should route-module itself handle rendering the 404
|
|
171
|
+
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
172
|
+
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
173
|
+
} else {
|
|
174
|
+
res.end('This page could not be found');
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
};
|
|
178
|
+
if (isIsr && !isDraftMode) {
|
|
179
|
+
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
180
|
+
if (prerenderInfo) {
|
|
181
|
+
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
182
|
+
if (nextConfig.adapterPath) {
|
|
183
|
+
return await render404();
|
|
184
|
+
}
|
|
185
|
+
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
378
188
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
if (!Array.isArray(parsed)) return [];
|
|
385
|
-
const ids = parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
386
|
-
return Array.from(new Set(ids));
|
|
387
|
-
} catch {
|
|
388
|
-
return [];
|
|
189
|
+
let cacheKey = null;
|
|
190
|
+
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
191
|
+
cacheKey = resolvedPathname;
|
|
192
|
+
// ensure /index and / is normalized to one key
|
|
193
|
+
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
389
194
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
const parsed = JSON.parse(cfg.tool_credentials);
|
|
400
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
401
|
-
const out = {};
|
|
402
|
-
for (const [k, v] of Object.entries(parsed)){
|
|
403
|
-
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
404
|
-
}
|
|
405
|
-
return out;
|
|
406
|
-
} catch {
|
|
407
|
-
return {};
|
|
195
|
+
// Before rendering (which initializes component tree modules), we have to
|
|
196
|
+
// set the reference manifests to our global store so Server Action's
|
|
197
|
+
// encryption util can access to them at the top level of the page module.
|
|
198
|
+
if (serverActionsManifest && clientReferenceManifest) {
|
|
199
|
+
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
200
|
+
page: srcPage,
|
|
201
|
+
clientReferenceManifest,
|
|
202
|
+
serverActionsManifest
|
|
203
|
+
});
|
|
408
204
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
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;
|
|
443
|
-
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;
|
|
444
|
-
const citationStrictness = input.citation_strictness === undefined ? parseCitationStrictness(existing?.citation_strictness) ?? "off" : parseCitationStrictness(input.citation_strictness) ?? "off";
|
|
445
|
-
const toolCredentials = serialiseToolCredentials(input.tool_credentials, existing?.tool_credentials ?? null);
|
|
446
|
-
const VALID_ROUTER_POLICIES = new Set([
|
|
447
|
-
"cheap",
|
|
448
|
-
"fast",
|
|
449
|
-
"balanced",
|
|
450
|
-
"quality"
|
|
451
|
-
]);
|
|
452
|
-
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;
|
|
453
|
-
const routerEnabled = input.router_enabled === undefined ? existing?.router_enabled ?? null : input.router_enabled === null ? null : input.router_enabled ? 1 : 0;
|
|
454
|
-
const VALID_USAGE_STRATEGIES = new Set([
|
|
455
|
-
"cost_saving",
|
|
456
|
-
"fast",
|
|
457
|
-
"balanced",
|
|
458
|
-
"high_reasoning"
|
|
459
|
-
]);
|
|
460
|
-
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;
|
|
461
|
-
const requestedWarmSummaryLimit = input.warm_summary_limit ?? existing?.warm_summary_limit ?? 50;
|
|
462
|
-
const warmSummaryLimit = Number.isFinite(requestedWarmSummaryLimit) ? Math.max(0, Math.floor(requestedWarmSummaryLimit)) : existing?.warm_summary_limit ?? 50;
|
|
463
|
-
db.prepare(`INSERT OR REPLACE INTO agent_configs
|
|
464
|
-
(id, name, icon, identity, instructions, tools, model_config_name, is_default,
|
|
465
|
-
history_limit, history_window_hours, warm_summary_limit, never_reply,
|
|
466
|
-
hot_turn_limit,
|
|
467
|
-
adaptive_persona_enabled, adaptive_persona_strength, adaptive_empathy, adaptive_expressiveness, adaptive_verbosity, adaptive_mbti,
|
|
468
|
-
voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
|
|
469
|
-
harness_id, delegate_targets, context_tier_proportions,
|
|
470
|
-
anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
|
|
471
|
-
tool_credentials, router_policy, router_enabled, usage_strategy,
|
|
472
|
-
created_at, updated_at)
|
|
473
|
-
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"
|
|
474
|
-
// (important for PATCH-style updates that omit the field).
|
|
475
|
-
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);
|
|
476
|
-
return getAgentConfig(input.id);
|
|
477
|
-
}
|
|
478
|
-
function clampPercent(next, fallback) {
|
|
479
|
-
const n = Number.isFinite(next) ? Number(next) : fallback;
|
|
480
|
-
return Math.max(0, Math.min(100, Math.round(n)));
|
|
481
|
-
}
|
|
482
|
-
function serialiseToolCredentials(input, existing) {
|
|
483
|
-
if (input === undefined) return existing;
|
|
484
|
-
const cleaned = {};
|
|
485
|
-
for (const [k, v] of Object.entries(input)){
|
|
486
|
-
if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
|
|
487
|
-
cleaned[k] = v;
|
|
205
|
+
const method = req.method || 'GET';
|
|
206
|
+
const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
|
|
207
|
+
const activeSpan = tracer.getActiveScopeSpan();
|
|
208
|
+
const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
|
|
209
|
+
const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
|
|
210
|
+
const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
|
|
211
|
+
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
212
|
+
globalThis.__incrementalCache = incrementalCache;
|
|
213
|
+
const context = {
|
|
214
|
+
params,
|
|
215
|
+
previewProps,
|
|
216
|
+
renderOpts: {
|
|
217
|
+
experimental: {
|
|
218
|
+
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
219
|
+
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
220
|
+
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
221
|
+
},
|
|
222
|
+
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
223
|
+
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
224
|
+
isDraftMode,
|
|
225
|
+
incrementalCache,
|
|
226
|
+
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
227
|
+
cacheLifeProfiles: nextConfig.cacheLife,
|
|
228
|
+
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
229
|
+
waitUntil: ctx.waitUntil,
|
|
230
|
+
onClose: (cb)=>{
|
|
231
|
+
res.on('close', cb);
|
|
232
|
+
},
|
|
233
|
+
onAfterTaskError: undefined
|
|
234
|
+
},
|
|
235
|
+
sharedContext: {
|
|
236
|
+
buildId,
|
|
237
|
+
deploymentId
|
|
488
238
|
}
|
|
489
|
-
}
|
|
490
|
-
if (Object.keys(cleaned).length === 0) return null;
|
|
491
|
-
return JSON.stringify(cleaned);
|
|
492
|
-
}
|
|
493
|
-
function toMbti(v) {
|
|
494
|
-
if (!v) return null;
|
|
495
|
-
return v in _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e ? v : null;
|
|
496
|
-
}
|
|
497
|
-
function deleteAgentConfig(id) {
|
|
498
|
-
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM agent_configs WHERE id=?").run(id).changes > 0;
|
|
499
|
-
}
|
|
500
|
-
function generateAgentId(name) {
|
|
501
|
-
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
502
|
-
const suffix = Math.random().toString(36).slice(2, 6);
|
|
503
|
-
return slug ? `${slug}-${suffix}` : `agent-${suffix}`;
|
|
504
|
-
}
|
|
505
|
-
// ── ADR-0022: per-agent message-channel display filters ─────────────────
|
|
506
|
-
// Canonical channel keys mirrored in `hooks/useMessageFilters.ts`. Kept
|
|
507
|
-
// in sync there by importing this constant — single source of truth.
|
|
508
|
-
const DISPLAY_FILTER_KEYS = [
|
|
509
|
-
"scheduled_task",
|
|
510
|
-
"watcher",
|
|
511
|
-
"bridge",
|
|
512
|
-
"extension",
|
|
513
|
-
"page_capture",
|
|
514
|
-
"synthetic",
|
|
515
|
-
"tool_use",
|
|
516
|
-
"thinking"
|
|
517
|
-
];
|
|
518
|
-
const DISPLAY_FILTER_DEFAULTS = {
|
|
519
|
-
scheduled_task: true,
|
|
520
|
-
watcher: true,
|
|
521
|
-
bridge: true,
|
|
522
|
-
extension: true,
|
|
523
|
-
page_capture: true,
|
|
524
|
-
synthetic: true,
|
|
525
|
-
tool_use: true,
|
|
526
|
-
thinking: true
|
|
527
|
-
};
|
|
528
|
-
function parseDisplayFilters(raw) {
|
|
529
|
-
if (!raw) return {
|
|
530
|
-
...DISPLAY_FILTER_DEFAULTS
|
|
531
239
|
};
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
240
|
+
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
241
|
+
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
242
|
+
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));
|
|
243
|
+
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
244
|
+
try {
|
|
245
|
+
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
246
|
+
res.statusCode = 404;
|
|
247
|
+
// on-demand revalidate always sets this header
|
|
248
|
+
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
249
|
+
res.end('This page could not be found');
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
253
|
+
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
254
|
+
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
255
|
+
// Attempt using provided waitUntil if available
|
|
256
|
+
// if it's not we fallback to sendResponse's handling
|
|
257
|
+
if (pendingWaitUntil) {
|
|
258
|
+
if (ctx.waitUntil) {
|
|
259
|
+
ctx.waitUntil(pendingWaitUntil);
|
|
260
|
+
pendingWaitUntil = undefined;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const cacheTags = context.renderOpts.collectedTags;
|
|
264
|
+
// If the request is for a static response, we can cache it so long
|
|
265
|
+
// as it's not edge.
|
|
266
|
+
if (isIsr) {
|
|
267
|
+
const blob = await response.blob();
|
|
268
|
+
// Copy the headers from the response.
|
|
269
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
270
|
+
if (cacheTags) {
|
|
271
|
+
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
272
|
+
}
|
|
273
|
+
if (!headers['content-type'] && blob.type) {
|
|
274
|
+
headers['content-type'] = blob.type;
|
|
275
|
+
}
|
|
276
|
+
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
277
|
+
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
|
|
278
|
+
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
279
|
+
// build-time fallback in `build/index.ts` so cache entries
|
|
280
|
+
// and the response Cache-Control header agree on the route's
|
|
281
|
+
// effective expire. Routes that opt out of revalidation
|
|
282
|
+
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
283
|
+
// keep `expire: undefined`.
|
|
284
|
+
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
285
|
+
// Create the cache entry for the response.
|
|
286
|
+
const cacheEntry = {
|
|
287
|
+
value: {
|
|
288
|
+
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
289
|
+
status: response.status,
|
|
290
|
+
body: Buffer.from(await blob.arrayBuffer()),
|
|
291
|
+
headers
|
|
292
|
+
},
|
|
293
|
+
cacheControl: {
|
|
294
|
+
revalidate,
|
|
295
|
+
expire
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
return cacheEntry;
|
|
299
|
+
} else {
|
|
300
|
+
// send response without caching if not ISR
|
|
301
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
} catch (err) {
|
|
305
|
+
// if this is a background revalidate we need to report
|
|
306
|
+
// the request error here as it won't be bubbled
|
|
307
|
+
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
308
|
+
const silenceLog = false;
|
|
309
|
+
await routeModule.onRequestError(req, err, {
|
|
310
|
+
routerKind: 'App Router',
|
|
311
|
+
routePath: srcPage,
|
|
312
|
+
routeType: 'route',
|
|
313
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
314
|
+
isStaticGeneration: cacheKey !== null,
|
|
315
|
+
isOnDemandRevalidate
|
|
316
|
+
})
|
|
317
|
+
}, silenceLog, routerServerContext);
|
|
318
|
+
}
|
|
319
|
+
throw err;
|
|
320
|
+
}
|
|
566
321
|
};
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
322
|
+
const handleResponse = async (currentSpan, parentSpan)=>{
|
|
323
|
+
try {
|
|
324
|
+
var _cacheEntry_value;
|
|
325
|
+
const cacheEntry = await routeModule.handleResponse({
|
|
326
|
+
req,
|
|
327
|
+
nextConfig,
|
|
328
|
+
cacheKey,
|
|
329
|
+
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
330
|
+
isFallback: false,
|
|
331
|
+
previewProps,
|
|
332
|
+
prerenderManifest,
|
|
333
|
+
isRoutePPREnabled: false,
|
|
334
|
+
isOnDemandRevalidate,
|
|
335
|
+
revalidateOnlyGenerated,
|
|
336
|
+
responseGenerator,
|
|
337
|
+
waitUntil: ctx.waitUntil,
|
|
338
|
+
isMinimalMode
|
|
339
|
+
});
|
|
340
|
+
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
341
|
+
throw cacheEntry.error;
|
|
342
|
+
}
|
|
343
|
+
// we don't create a cacheEntry for ISR
|
|
344
|
+
if (!isIsr) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
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) {
|
|
348
|
+
var _cacheEntry_value1;
|
|
349
|
+
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
350
|
+
}
|
|
351
|
+
if (!isMinimalMode) {
|
|
352
|
+
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
353
|
+
}
|
|
354
|
+
// Draft mode should never be cached
|
|
355
|
+
if (isDraftMode) {
|
|
356
|
+
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
357
|
+
}
|
|
358
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
359
|
+
if (!(isMinimalMode && isIsr)) {
|
|
360
|
+
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
361
|
+
}
|
|
362
|
+
// If cache control is already set on the response we don't
|
|
363
|
+
// override it to allow users to customize it via next.config
|
|
364
|
+
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
365
|
+
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
366
|
+
}
|
|
367
|
+
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'.
|
|
368
|
+
new Response(cacheEntry.value.body, {
|
|
369
|
+
headers,
|
|
370
|
+
status: cacheEntry.value.status || 200
|
|
371
|
+
}));
|
|
372
|
+
return;
|
|
373
|
+
} catch (err) {
|
|
374
|
+
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
375
|
+
const silenceLog = false;
|
|
376
|
+
await routeModule.onRequestError(req, err, {
|
|
377
|
+
routerKind: 'App Router',
|
|
378
|
+
routePath: normalizedSrcPage,
|
|
379
|
+
routeType: 'route',
|
|
380
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
381
|
+
isStaticGeneration: cacheKey !== null,
|
|
382
|
+
isOnDemandRevalidate
|
|
383
|
+
})
|
|
384
|
+
}, silenceLog, routerServerContext);
|
|
385
|
+
}
|
|
386
|
+
// rethrow so that we can handle serving error page
|
|
387
|
+
// If this is during static generation, throw the error again.
|
|
388
|
+
if (isIsr) throw err;
|
|
389
|
+
// Otherwise, send a 500 response unless the original response has
|
|
390
|
+
// already committed. In that case, preserve its status code for
|
|
391
|
+
// telemetry while still recording the failure and terminating a response
|
|
392
|
+
// that the failed pipeline left open.
|
|
393
|
+
if (res.headersSent) {
|
|
394
|
+
if (currentSpan) {
|
|
395
|
+
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
396
|
+
currentSpan.recordException(error);
|
|
397
|
+
currentSpan.setStatus({
|
|
398
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
399
|
+
message: error.message
|
|
400
|
+
});
|
|
401
|
+
currentSpan.setAttribute('error.type', error.name);
|
|
402
|
+
}
|
|
403
|
+
if (!res.writableEnded && !res.destroyed) {
|
|
404
|
+
res.end();
|
|
405
|
+
}
|
|
406
|
+
} else {
|
|
407
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
408
|
+
status: 500
|
|
409
|
+
}));
|
|
410
|
+
}
|
|
411
|
+
return;
|
|
412
|
+
} finally{
|
|
413
|
+
;
|
|
414
|
+
(()=>{
|
|
415
|
+
if (!currentSpan) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
let statusCode = res.statusCode;
|
|
419
|
+
currentSpan.setAttributes({
|
|
420
|
+
'http.status_code': statusCode,
|
|
421
|
+
'next.rsc': false
|
|
422
|
+
});
|
|
423
|
+
if (statusCode && statusCode >= 500) {
|
|
424
|
+
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
425
|
+
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
426
|
+
currentSpan.setStatus({
|
|
427
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
428
|
+
});
|
|
429
|
+
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
430
|
+
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
431
|
+
}
|
|
432
|
+
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
433
|
+
// We were unable to get attributes, probably OTEL is not enabled
|
|
434
|
+
if (!rootSpanAttributes) {
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
438
|
+
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
442
|
+
const name = `${method} ${route}`;
|
|
443
|
+
currentSpan.setAttributes({
|
|
444
|
+
'next.route': route,
|
|
445
|
+
'http.route': route,
|
|
446
|
+
'next.span_name': name
|
|
447
|
+
});
|
|
448
|
+
currentSpan.updateName(name);
|
|
449
|
+
// Propagate http.route to the parent span if one exists (e.g.
|
|
450
|
+
// a platform-created HTTP span in adapter deployments).
|
|
451
|
+
if (parentSpan && parentSpan !== currentSpan) {
|
|
452
|
+
parentSpan.setAttribute('http.route', route);
|
|
453
|
+
parentSpan.updateName(name);
|
|
454
|
+
}
|
|
455
|
+
})();
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
// TODO: activeSpan code path is for when wrapped by
|
|
459
|
+
// next-server can be removed when this is no longer used
|
|
460
|
+
if (isWrappedByNextServer && activeSpan) {
|
|
461
|
+
await handleResponse(activeSpan, undefined);
|
|
462
|
+
} else {
|
|
463
|
+
let parentSpan = tracer.getActiveScopeSpan();
|
|
464
|
+
await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
|
|
465
|
+
spanName: `${method} ${srcPage}`,
|
|
466
|
+
kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
|
|
467
|
+
attributes: {
|
|
468
|
+
'http.method': method,
|
|
469
|
+
'http.target': req.url
|
|
470
|
+
}
|
|
471
|
+
}, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
604
474
|
|
|
605
|
-
|
|
606
|
-
/***/ ((module) => {
|
|
475
|
+
//# sourceMappingURL=app-route.js.map
|
|
607
476
|
|
|
608
|
-
module.exports = require("crypto");
|
|
609
477
|
|
|
610
478
|
/***/ }),
|
|
611
479
|
|
|
612
|
-
/***/
|
|
480
|
+
/***/ 8128:
|
|
613
481
|
/***/ ((module) => {
|
|
614
482
|
|
|
615
|
-
module.exports = require("
|
|
483
|
+
module.exports = require("next/dist/server/runtime-reacts.external.js");
|
|
616
484
|
|
|
617
485
|
/***/ }),
|
|
618
486
|
|
|
619
|
-
/***/
|
|
487
|
+
/***/ 9956:
|
|
620
488
|
/***/ ((module) => {
|
|
621
489
|
|
|
622
|
-
module.exports = require("
|
|
490
|
+
module.exports = require("undici");
|
|
623
491
|
|
|
624
492
|
/***/ }),
|
|
625
493
|
|
|
626
|
-
/***/
|
|
494
|
+
/***/ 10846:
|
|
627
495
|
/***/ ((module) => {
|
|
628
496
|
|
|
629
|
-
module.exports = require("
|
|
497
|
+
module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");
|
|
630
498
|
|
|
631
499
|
/***/ }),
|
|
632
500
|
|
|
633
|
-
/***/
|
|
501
|
+
/***/ 16698:
|
|
634
502
|
/***/ ((module) => {
|
|
635
503
|
|
|
636
|
-
module.exports = require("
|
|
504
|
+
module.exports = require("node:async_hooks");
|
|
637
505
|
|
|
638
506
|
/***/ }),
|
|
639
507
|
|
|
640
|
-
/***/
|
|
508
|
+
/***/ 17127:
|
|
641
509
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
642
510
|
|
|
511
|
+
__webpack_require__.r(__webpack_exports__);
|
|
643
512
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
644
|
-
/* harmony export */
|
|
645
|
-
/* harmony export */ _: () => (/* binding */ timeoutSignal)
|
|
513
|
+
/* harmony export */ POST: () => (/* binding */ POST)
|
|
646
514
|
/* harmony export */ });
|
|
647
|
-
/* harmony import */ var
|
|
515
|
+
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
516
|
+
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97377);
|
|
517
|
+
/* harmony import */ var _lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41720);
|
|
518
|
+
/* harmony import */ var _lib_voice_gemini__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79766);
|
|
519
|
+
/* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39947);
|
|
520
|
+
// POST /api/v1/voice/tts
|
|
521
|
+
// Body: { agent_id: string, text: string, voice_name?: string, model?: string }
|
|
522
|
+
// Resolves voice config from the agent (must have voice_enabled=1) and
|
|
523
|
+
// synthesizes audio via Gemini. Returns a WAV body — the client plays it
|
|
524
|
+
// with a plain <audio> element. Optional overrides let the assistant try a
|
|
525
|
+
// different voice/model without persisting.
|
|
648
526
|
|
|
649
|
-
function timeoutSignal(ms) {
|
|
650
|
-
const c = new AbortController();
|
|
651
|
-
setTimeout(()=>c.abort(new Error(`timeout after ${ms}ms`)), ms).unref?.();
|
|
652
|
-
return c.signal;
|
|
653
|
-
}
|
|
654
|
-
function resolveGoogleApiKey() {
|
|
655
|
-
const raw = (0,_lib_stores_integrations__WEBPACK_IMPORTED_MODULE_0__/* .getIntegrationRaw */ .$G)("google");
|
|
656
|
-
const fromStore = raw?.api_key?.trim();
|
|
657
|
-
if (fromStore) return fromStore;
|
|
658
|
-
return (process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY || "").trim() || null;
|
|
659
|
-
}
|
|
660
527
|
|
|
661
528
|
|
|
662
|
-
/***/ }),
|
|
663
529
|
|
|
664
|
-
/***/ 73024:
|
|
665
|
-
/***/ ((module) => {
|
|
666
530
|
|
|
667
|
-
|
|
531
|
+
const MAX_TEXT = 5000;
|
|
532
|
+
const BodySchema = zod__WEBPACK_IMPORTED_MODULE_4__/* .object */ .Ikc({
|
|
533
|
+
agent_id: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .YjP().min(1, "agent_id is required"),
|
|
534
|
+
text: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .YjP().min(1, "text is required").max(MAX_TEXT, `text exceeds ${MAX_TEXT} characters`),
|
|
535
|
+
voice_name: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .YjP().optional(),
|
|
536
|
+
model: zod__WEBPACK_IMPORTED_MODULE_4__/* .string */ .YjP().optional()
|
|
537
|
+
});
|
|
538
|
+
async function POST(req) {
|
|
539
|
+
const parsed = await (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .validateBody */ .Jb)(req, BodySchema);
|
|
540
|
+
if (parsed instanceof next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse) return parsed;
|
|
541
|
+
const agentId = parsed.agent_id.trim();
|
|
542
|
+
const text = parsed.text.trim();
|
|
543
|
+
const agent = (0,_lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_1__/* .getAgentConfig */ .mJ)(agentId);
|
|
544
|
+
if (!agent) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .notFoundResponse */ .HN)("agent not found");
|
|
545
|
+
if (!agent.voice_enabled) {
|
|
546
|
+
return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .errorResponse */ .yj)("voice is not enabled for this agent");
|
|
547
|
+
}
|
|
548
|
+
const apiKey = (0,_lib_voice_gemini__WEBPACK_IMPORTED_MODULE_2__/* .resolveGoogleApiKey */ .DM)();
|
|
549
|
+
if (!apiKey) {
|
|
550
|
+
return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .errorResponse */ .yj)('Google API key not configured. Open Integrations → "Google AI (Gemini + Imagen)".');
|
|
551
|
+
}
|
|
552
|
+
const model = parsed.model?.trim() || agent.voice_model || "gemini-2.5-flash-preview-tts";
|
|
553
|
+
const voiceName = parsed.voice_name?.trim() || agent.voice_name || "Kore";
|
|
554
|
+
try {
|
|
555
|
+
const { wav } = await (0,_lib_voice_gemini__WEBPACK_IMPORTED_MODULE_2__/* .geminiTts */ .R$)({
|
|
556
|
+
apiKey,
|
|
557
|
+
model,
|
|
558
|
+
voiceName,
|
|
559
|
+
text
|
|
560
|
+
});
|
|
561
|
+
return new next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse(new Uint8Array(wav), {
|
|
562
|
+
status: 200,
|
|
563
|
+
headers: {
|
|
564
|
+
"Content-Type": "audio/wav",
|
|
565
|
+
"Content-Length": String(wav.length),
|
|
566
|
+
"Cache-Control": "no-store"
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
} catch (err) {
|
|
570
|
+
return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_3__/* .errorResponse */ .yj)(String(err instanceof Error ? err.message : err), 502);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
668
574
|
|
|
669
575
|
/***/ }),
|
|
670
576
|
|
|
671
|
-
/***/
|
|
577
|
+
/***/ 19121:
|
|
672
578
|
/***/ ((module) => {
|
|
673
579
|
|
|
674
|
-
module.exports = require("
|
|
580
|
+
module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
|
|
675
581
|
|
|
676
582
|
/***/ }),
|
|
677
583
|
|
|
678
|
-
/***/
|
|
584
|
+
/***/ 27910:
|
|
679
585
|
/***/ ((module) => {
|
|
680
586
|
|
|
681
|
-
module.exports = require("
|
|
587
|
+
module.exports = require("stream");
|
|
682
588
|
|
|
683
589
|
/***/ }),
|
|
684
590
|
|
|
685
|
-
/***/
|
|
591
|
+
/***/ 28354:
|
|
686
592
|
/***/ ((module) => {
|
|
687
593
|
|
|
688
|
-
module.exports = require("
|
|
594
|
+
module.exports = require("util");
|
|
689
595
|
|
|
690
596
|
/***/ }),
|
|
691
597
|
|
|
692
|
-
/***/
|
|
693
|
-
/***/ ((
|
|
598
|
+
/***/ 29021:
|
|
599
|
+
/***/ ((module) => {
|
|
694
600
|
|
|
695
|
-
|
|
696
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
697
|
-
/* harmony export */ handler: () => (/* binding */ handler),
|
|
698
|
-
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
699
|
-
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
700
|
-
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
701
|
-
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
702
|
-
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
703
|
-
/* harmony export */ });
|
|
704
|
-
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
|
|
705
|
-
/* 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__);
|
|
706
|
-
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
|
|
707
|
-
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
708
|
-
/* 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__);
|
|
709
|
-
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
|
|
710
|
-
/* 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__);
|
|
711
|
-
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
|
|
712
|
-
/* 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__);
|
|
713
|
-
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
|
|
714
|
-
/* 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__);
|
|
715
|
-
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
|
|
716
|
-
/* 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__);
|
|
717
|
-
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
|
|
718
|
-
/* 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__);
|
|
719
|
-
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
|
|
720
|
-
/* 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__);
|
|
721
|
-
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
|
|
722
|
-
/* 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__);
|
|
723
|
-
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
|
|
724
|
-
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
|
|
725
|
-
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
|
|
726
|
-
/* 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__);
|
|
727
|
-
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
|
|
728
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
|
|
729
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
730
|
-
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
|
|
731
|
-
/* 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__);
|
|
732
|
-
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
|
|
733
|
-
/* 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__);
|
|
734
|
-
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
|
|
735
|
-
/* 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__);
|
|
601
|
+
module.exports = require("fs");
|
|
736
602
|
|
|
603
|
+
/***/ }),
|
|
737
604
|
|
|
605
|
+
/***/ 29294:
|
|
606
|
+
/***/ ((module) => {
|
|
738
607
|
|
|
608
|
+
module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
|
|
739
609
|
|
|
610
|
+
/***/ }),
|
|
740
611
|
|
|
612
|
+
/***/ 31421:
|
|
613
|
+
/***/ ((module) => {
|
|
741
614
|
|
|
615
|
+
module.exports = require("node:child_process");
|
|
742
616
|
|
|
617
|
+
/***/ }),
|
|
743
618
|
|
|
619
|
+
/***/ 33873:
|
|
620
|
+
/***/ ((module) => {
|
|
744
621
|
|
|
622
|
+
module.exports = require("path");
|
|
745
623
|
|
|
624
|
+
/***/ }),
|
|
746
625
|
|
|
626
|
+
/***/ 37067:
|
|
627
|
+
/***/ ((module) => {
|
|
747
628
|
|
|
629
|
+
module.exports = require("node:http");
|
|
748
630
|
|
|
631
|
+
/***/ }),
|
|
749
632
|
|
|
633
|
+
/***/ 38522:
|
|
634
|
+
/***/ ((module) => {
|
|
750
635
|
|
|
636
|
+
module.exports = require("node:zlib");
|
|
751
637
|
|
|
638
|
+
/***/ }),
|
|
752
639
|
|
|
640
|
+
/***/ 39947:
|
|
641
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
753
642
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
// ensureUserland() awaits before the first request is handled.
|
|
776
|
-
userland: ()=>__webpack_require__(17127),
|
|
777
|
-
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
778
|
-
// server HMR updates are picked up without re-executing the entry chunk.
|
|
779
|
-
// Using require() (synchronous) avoids adding async overhead that would be
|
|
780
|
-
// incorrectly attributed to application-code time in devRequestTiming.
|
|
781
|
-
... false ? 0 : {}
|
|
782
|
-
});
|
|
783
|
-
// Pull out the exports that we need to expose from the module. This should
|
|
784
|
-
// be eliminated when we've moved the other routes to the new format. These
|
|
785
|
-
// are used to hook into the route.
|
|
786
|
-
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
787
|
-
function patchFetch() {
|
|
788
|
-
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
789
|
-
workAsyncStorage,
|
|
790
|
-
workUnitAsyncStorage
|
|
643
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
644
|
+
/* harmony export */ Bm: () => (/* binding */ cachedJson),
|
|
645
|
+
/* harmony export */ HN: () => (/* binding */ notFoundResponse),
|
|
646
|
+
/* harmony export */ Jb: () => (/* binding */ validateBody),
|
|
647
|
+
/* harmony export */ K2: () => (/* binding */ createdResponse),
|
|
648
|
+
/* harmony export */ Ng: () => (/* binding */ noStoreJson),
|
|
649
|
+
/* harmony export */ yj: () => (/* binding */ errorResponse)
|
|
650
|
+
/* harmony export */ });
|
|
651
|
+
/* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
|
|
652
|
+
// Shared HTTP response builders for app/api/v1/** route handlers.
|
|
653
|
+
//
|
|
654
|
+
// Goal: every error/success payload across the v1 surface has the same
|
|
655
|
+
// shape. Before this lived inline, response bodies drifted —
|
|
656
|
+
// `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
|
|
657
|
+
// some routes returned Zod's raw issue array, others stringified it.
|
|
658
|
+
|
|
659
|
+
function errorResponse(message, status = 400) {
|
|
660
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
|
|
661
|
+
error: message
|
|
662
|
+
}, {
|
|
663
|
+
status
|
|
791
664
|
});
|
|
792
665
|
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
|
800
|
-
}
|
|
801
|
-
let srcPage = "/api/v1/voice/tts/route";
|
|
802
|
-
// turbopack doesn't normalize `/index` in the page name
|
|
803
|
-
// so we need to to process dynamic routes properly
|
|
804
|
-
// TODO: fix turbopack providing differing value from webpack
|
|
805
|
-
if (false) {} else if (srcPage === '/index') {
|
|
806
|
-
// we always normalize /index specifically
|
|
807
|
-
srcPage = '/';
|
|
808
|
-
}
|
|
809
|
-
const multiZoneDraftMode = false;
|
|
810
|
-
const prepareResult = await routeModule.prepare(req, res, {
|
|
811
|
-
srcPage,
|
|
812
|
-
multiZoneDraftMode
|
|
666
|
+
function notFoundResponse(message = "Not found") {
|
|
667
|
+
return errorResponse(message, 404);
|
|
668
|
+
}
|
|
669
|
+
function createdResponse(data) {
|
|
670
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
671
|
+
status: 201
|
|
813
672
|
});
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
673
|
+
}
|
|
674
|
+
// Wrap a 200 JSON response with a private Cache-Control header. Use on safe
|
|
675
|
+
// GET endpoints that serve user-scoped data the client refetches often (panel
|
|
676
|
+
// mounts, navigation back/forward) but mutates rarely. The TTL is short
|
|
677
|
+
// enough that explicit mutations — which patch the client-side ApiClient
|
|
678
|
+
// cache in place — stay observably consistent without an extra roundtrip.
|
|
679
|
+
//
|
|
680
|
+
// swrSeconds (optional): stale-while-revalidate window. When set, the browser
|
|
681
|
+
// serves the cached response immediately and refreshes in the background,
|
|
682
|
+
// making navigation feel instant. Use for data that can tolerate brief
|
|
683
|
+
// staleness (tool list, agent configs, model list). Omit for real-time data
|
|
684
|
+
// (dashboard metrics, credential state).
|
|
685
|
+
function cachedJson(data, maxAgeSeconds, swrSeconds) {
|
|
686
|
+
const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
|
|
687
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
688
|
+
headers: {
|
|
689
|
+
"Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
|
|
831
690
|
}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
}
|
|
841
|
-
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
842
|
-
}
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
// Use for endpoints whose response contains live state that must never be
|
|
694
|
+
// served from cache — credentials, connection status, live config values.
|
|
695
|
+
function noStoreJson(data) {
|
|
696
|
+
return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
|
|
697
|
+
headers: {
|
|
698
|
+
"Cache-Control": "no-store"
|
|
843
699
|
}
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
// Validate a JSON request body against a zod schema.
|
|
703
|
+
// Returns either the parsed data or a 400 NextResponse explaining the issue.
|
|
704
|
+
// Caller pattern:
|
|
705
|
+
// const parsed = await validateBody(req, Schema);
|
|
706
|
+
// if (parsed instanceof NextResponse) return parsed;
|
|
707
|
+
// // use parsed.field
|
|
708
|
+
async function validateBody(req, schema) {
|
|
709
|
+
let raw;
|
|
710
|
+
try {
|
|
711
|
+
raw = await req.json();
|
|
712
|
+
} catch {
|
|
713
|
+
return errorResponse("Request body must be valid JSON", 400);
|
|
844
714
|
}
|
|
845
|
-
|
|
846
|
-
if (
|
|
847
|
-
|
|
848
|
-
// ensure /index and / is normalized to one key
|
|
849
|
-
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
850
|
-
}
|
|
851
|
-
// Before rendering (which initializes component tree modules), we have to
|
|
852
|
-
// set the reference manifests to our global store so Server Action's
|
|
853
|
-
// encryption util can access to them at the top level of the page module.
|
|
854
|
-
if (serverActionsManifest && clientReferenceManifest) {
|
|
855
|
-
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
856
|
-
page: srcPage,
|
|
857
|
-
clientReferenceManifest,
|
|
858
|
-
serverActionsManifest
|
|
859
|
-
});
|
|
715
|
+
const parsed = schema.safeParse(raw);
|
|
716
|
+
if (!parsed.success) {
|
|
717
|
+
return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
|
|
860
718
|
}
|
|
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
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
719
|
+
return parsed.data;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
/***/ }),
|
|
724
|
+
|
|
725
|
+
/***/ 41720:
|
|
726
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
727
|
+
|
|
728
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
729
|
+
/* harmony export */ BM: () => (/* binding */ upsertAgentConfig),
|
|
730
|
+
/* harmony export */ E1: () => (/* binding */ updateAgentDisplayFilters),
|
|
731
|
+
/* harmony export */ P2: () => (/* binding */ parseCitationStrictness),
|
|
732
|
+
/* harmony export */ S2: () => (/* binding */ getAgentToolCredentials),
|
|
733
|
+
/* harmony export */ SJ: () => (/* binding */ generateAgentId),
|
|
734
|
+
/* harmony export */ TG: () => (/* binding */ getAgentTools),
|
|
735
|
+
/* harmony export */ bg: () => (/* binding */ parseDelegateTargets),
|
|
736
|
+
/* harmony export */ d2: () => (/* binding */ DISPLAY_FILTER_KEYS),
|
|
737
|
+
/* harmony export */ fg: () => (/* binding */ getAgentTierProportions),
|
|
738
|
+
/* harmony export */ mJ: () => (/* binding */ getAgentConfig),
|
|
739
|
+
/* harmony export */ nV: () => (/* binding */ getAgentDisplayFilters),
|
|
740
|
+
/* harmony export */ vU: () => (/* binding */ getDefaultAgentConfig),
|
|
741
|
+
/* harmony export */ vi: () => (/* binding */ DISPLAY_FILTER_DEFAULTS),
|
|
742
|
+
/* harmony export */ xi: () => (/* binding */ deleteAgentConfig),
|
|
743
|
+
/* harmony export */ zb: () => (/* binding */ listAgentConfigs)
|
|
744
|
+
/* harmony export */ });
|
|
745
|
+
/* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
|
746
|
+
/* harmony import */ var _lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99043);
|
|
747
|
+
/* harmony import */ var _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(66849);
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
const now = ()=>new Date().toISOString();
|
|
752
|
+
/** Coerce arbitrary input (DB row TEXT, API body, undefined) to the enum.
|
|
753
|
+
* Returns `null` for null/undefined/unknown values so callers can default. */ function parseCitationStrictness(value) {
|
|
754
|
+
if (value === "off" || value === "informational" || value === "standard" || value === "strict") {
|
|
755
|
+
return value;
|
|
756
|
+
}
|
|
757
|
+
return null;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Parse the JSON-encoded per-agent override of context tier proportions.
|
|
761
|
+
* Returns `null` for NULL, blank, malformed JSON, or any payload that
|
|
762
|
+
* doesn't have three finite non-negative numeric fields. Callers fall
|
|
763
|
+
* back to the model config's value (or built-in defaults) on null.
|
|
764
|
+
*/ function getAgentTierProportions(row) {
|
|
765
|
+
const raw = row.context_tier_proportions;
|
|
766
|
+
if (!raw) return null;
|
|
767
|
+
try {
|
|
768
|
+
const parsed = JSON.parse(raw);
|
|
769
|
+
const hot = Number(parsed.hot);
|
|
770
|
+
const warm = Number(parsed.warm);
|
|
771
|
+
const facts = Number(parsed.facts);
|
|
772
|
+
if (![
|
|
773
|
+
hot,
|
|
774
|
+
warm,
|
|
775
|
+
facts
|
|
776
|
+
].every((n)=>Number.isFinite(n) && n >= 0)) return null;
|
|
777
|
+
if (hot + warm + facts <= 0) return null;
|
|
778
|
+
return {
|
|
779
|
+
hot,
|
|
780
|
+
warm,
|
|
781
|
+
facts
|
|
782
|
+
};
|
|
783
|
+
} catch {
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
function listAgentConfigs() {
|
|
788
|
+
// Default agent always first; then by the timestamp of each agent's latest message.
|
|
789
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT a.*
|
|
790
|
+
FROM agent_configs a
|
|
791
|
+
LEFT JOIN (
|
|
792
|
+
SELECT t.agent_id, MAX(m.created_at) AS last_message_at
|
|
793
|
+
FROM threads t
|
|
794
|
+
JOIN messages m ON m.thread_id = t.thread_id
|
|
795
|
+
GROUP BY t.agent_id
|
|
796
|
+
) latest ON latest.agent_id = a.id
|
|
797
|
+
ORDER BY a.is_default DESC, COALESCE(latest.last_message_at, a.created_at) DESC, a.id ASC`).all();
|
|
798
|
+
}
|
|
799
|
+
function getDefaultAgentConfig() {
|
|
800
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE is_default=1 LIMIT 1").get() ?? null;
|
|
801
|
+
}
|
|
802
|
+
function getAgentConfig(id) {
|
|
803
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM agent_configs WHERE id=?").get(id) ?? null;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Parse the JSON-encoded delegate whitelist into a deduped string[]. Returns
|
|
807
|
+
* an empty array for NULL, blank, or malformed JSON (delegation is opt-in).
|
|
808
|
+
*/ /**
|
|
809
|
+
* Parse the agent's tool allowlist (`tools` column, stored as a JSON string).
|
|
810
|
+
* Returns an empty array on NULL/blank/malformed JSON — same defensive shape
|
|
811
|
+
* as parseDelegateTargets. Callers that previously did `JSON.parse(cfg.tools)`
|
|
812
|
+
* inline should switch to this getter so the serialization contract stays
|
|
813
|
+
* owned by this store.
|
|
814
|
+
*/ function getAgentTools(cfg) {
|
|
815
|
+
if (!cfg?.tools) return [];
|
|
816
|
+
try {
|
|
817
|
+
const parsed = JSON.parse(cfg.tools);
|
|
818
|
+
if (!Array.isArray(parsed)) return [];
|
|
819
|
+
return parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
820
|
+
} catch {
|
|
821
|
+
return [];
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
function parseDelegateTargets(raw) {
|
|
825
|
+
if (!raw) return [];
|
|
826
|
+
try {
|
|
827
|
+
const parsed = JSON.parse(raw);
|
|
828
|
+
if (!Array.isArray(parsed)) return [];
|
|
829
|
+
const ids = parsed.filter((x)=>typeof x === "string" && x.length > 0);
|
|
830
|
+
return Array.from(new Set(ids));
|
|
831
|
+
} catch {
|
|
832
|
+
return [];
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Parse the per-agent `{ toolName: credentialId }` override map stored in
|
|
837
|
+
* the `tool_credentials` column. Returns an empty record on NULL / blank /
|
|
838
|
+
* malformed JSON / non-string entries so downstream code can treat the
|
|
839
|
+
* result as a plain lookup without further validation.
|
|
840
|
+
*/ function getAgentToolCredentials(cfg) {
|
|
841
|
+
if (!cfg?.tool_credentials) return {};
|
|
842
|
+
try {
|
|
843
|
+
const parsed = JSON.parse(cfg.tool_credentials);
|
|
844
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
845
|
+
const out = {};
|
|
846
|
+
for (const [k, v] of Object.entries(parsed)){
|
|
847
|
+
if (typeof v === "string" && v.length > 0) out[k] = v;
|
|
976
848
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
}));
|
|
1066
|
-
}
|
|
1067
|
-
return;
|
|
1068
|
-
} finally{
|
|
1069
|
-
;
|
|
1070
|
-
(()=>{
|
|
1071
|
-
if (!currentSpan) {
|
|
1072
|
-
return;
|
|
1073
|
-
}
|
|
1074
|
-
let statusCode = res.statusCode;
|
|
1075
|
-
currentSpan.setAttributes({
|
|
1076
|
-
'http.status_code': statusCode,
|
|
1077
|
-
'next.rsc': false
|
|
1078
|
-
});
|
|
1079
|
-
if (statusCode && statusCode >= 500) {
|
|
1080
|
-
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
1081
|
-
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
1082
|
-
currentSpan.setStatus({
|
|
1083
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
1084
|
-
});
|
|
1085
|
-
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
1086
|
-
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
1087
|
-
}
|
|
1088
|
-
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
1089
|
-
// We were unable to get attributes, probably OTEL is not enabled
|
|
1090
|
-
if (!rootSpanAttributes) {
|
|
1091
|
-
return;
|
|
1092
|
-
}
|
|
1093
|
-
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
1094
|
-
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
1095
|
-
return;
|
|
1096
|
-
}
|
|
1097
|
-
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
1098
|
-
const name = `${method} ${route}`;
|
|
1099
|
-
currentSpan.setAttributes({
|
|
1100
|
-
'next.route': route,
|
|
1101
|
-
'http.route': route,
|
|
1102
|
-
'next.span_name': name
|
|
1103
|
-
});
|
|
1104
|
-
currentSpan.updateName(name);
|
|
1105
|
-
// Propagate http.route to the parent span if one exists (e.g.
|
|
1106
|
-
// a platform-created HTTP span in adapter deployments).
|
|
1107
|
-
if (parentSpan && parentSpan !== currentSpan) {
|
|
1108
|
-
parentSpan.setAttribute('http.route', route);
|
|
1109
|
-
parentSpan.updateName(name);
|
|
1110
|
-
}
|
|
1111
|
-
})();
|
|
849
|
+
return out;
|
|
850
|
+
} catch {
|
|
851
|
+
return {};
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
function upsertAgentConfig(input) {
|
|
855
|
+
return (0,_lib_db_transaction__WEBPACK_IMPORTED_MODULE_1__/* .withDbTransaction */ .J)(()=>upsertAgentConfigTransaction(input));
|
|
856
|
+
}
|
|
857
|
+
function upsertAgentConfigTransaction(input) {
|
|
858
|
+
const t = now();
|
|
859
|
+
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
860
|
+
const existing = getAgentConfig(input.id);
|
|
861
|
+
const created_at = existing?.created_at ?? t;
|
|
862
|
+
const existingMbti = toMbti(existing?.adaptive_mbti);
|
|
863
|
+
const mbti = input.adaptive_mbti ?? existingMbti ?? "INTJ";
|
|
864
|
+
const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
|
|
865
|
+
// Omitted sliders keep their tuned values; they only fall back to the
|
|
866
|
+
// preset when the type changes or the agent is new. Otherwise every
|
|
867
|
+
// partial update (approved proposals, tool edits) reset them.
|
|
868
|
+
const keepTuned = existing !== null && existing !== undefined && mbti === existingMbti;
|
|
869
|
+
const strength = input.adaptive_persona_strength ?? (keepTuned ? existing.adaptive_persona_strength : preset.strength);
|
|
870
|
+
const empathy = input.adaptive_empathy ?? (keepTuned ? existing.adaptive_empathy : preset.empathy);
|
|
871
|
+
const expressiveness = input.adaptive_expressiveness ?? (keepTuned ? existing.adaptive_expressiveness : preset.expressiveness);
|
|
872
|
+
const verbosity = input.adaptive_verbosity ?? (keepTuned ? existing.adaptive_verbosity : preset.verbosity);
|
|
873
|
+
if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
|
|
874
|
+
// harness_id: explicit `undefined` means "keep existing"; explicit `null`
|
|
875
|
+
// means "use the global default". Empty string is normalised to null too,
|
|
876
|
+
// matching how the AgentEditor sends "" for the inherit option.
|
|
877
|
+
const harnessId = input.harness_id === undefined ? existing?.harness_id ?? null : input.harness_id && input.harness_id.length > 0 ? input.harness_id : null;
|
|
878
|
+
// delegate_targets: undefined = keep existing; explicit empty array clears.
|
|
879
|
+
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))));
|
|
880
|
+
// context_tier_proportions: undefined = keep existing; null = clear and
|
|
881
|
+
// inherit from the model; object = serialise as JSON. Negative values are
|
|
882
|
+
// clamped to 0 so the upsert can't poison the column with bad data.
|
|
883
|
+
const tierProportions = input.context_tier_proportions === undefined ? existing?.context_tier_proportions ?? null : input.context_tier_proportions === null ? null : JSON.stringify({
|
|
884
|
+
hot: Math.max(0, Number(input.context_tier_proportions.hot) || 0),
|
|
885
|
+
warm: Math.max(0, Number(input.context_tier_proportions.warm) || 0),
|
|
886
|
+
facts: Math.max(0, Number(input.context_tier_proportions.facts) || 0)
|
|
887
|
+
});
|
|
888
|
+
// Anti-hallucination override: `undefined` keeps existing; `null` clears
|
|
889
|
+
// the override (inherits env). Empty-string model is normalised to null
|
|
890
|
+
// so the editor can ship "" for the inherit option.
|
|
891
|
+
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;
|
|
892
|
+
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;
|
|
893
|
+
const citationStrictness = input.citation_strictness === undefined ? parseCitationStrictness(existing?.citation_strictness) ?? "off" : parseCitationStrictness(input.citation_strictness) ?? "off";
|
|
894
|
+
const toolCredentials = serialiseToolCredentials(input.tool_credentials, existing?.tool_credentials ?? null);
|
|
895
|
+
const VALID_ROUTER_POLICIES = new Set([
|
|
896
|
+
"cheap",
|
|
897
|
+
"fast",
|
|
898
|
+
"balanced",
|
|
899
|
+
"quality"
|
|
900
|
+
]);
|
|
901
|
+
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;
|
|
902
|
+
const routerEnabled = input.router_enabled === undefined ? existing?.router_enabled ?? null : input.router_enabled === null ? null : input.router_enabled ? 1 : 0;
|
|
903
|
+
const VALID_USAGE_STRATEGIES = new Set([
|
|
904
|
+
"cost_saving",
|
|
905
|
+
"fast",
|
|
906
|
+
"balanced",
|
|
907
|
+
"high_reasoning"
|
|
908
|
+
]);
|
|
909
|
+
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;
|
|
910
|
+
const requestedWarmSummaryLimit = input.warm_summary_limit ?? existing?.warm_summary_limit ?? 50;
|
|
911
|
+
const warmSummaryLimit = Number.isFinite(requestedWarmSummaryLimit) ? Math.max(0, Math.floor(requestedWarmSummaryLimit)) : existing?.warm_summary_limit ?? 50;
|
|
912
|
+
db.prepare(`INSERT OR REPLACE INTO agent_configs
|
|
913
|
+
(id, name, icon, identity, instructions, tools, model_config_name, is_default,
|
|
914
|
+
history_limit, history_window_hours, warm_summary_limit, never_reply,
|
|
915
|
+
hot_turn_limit,
|
|
916
|
+
adaptive_persona_enabled, adaptive_persona_strength, adaptive_empathy, adaptive_expressiveness, adaptive_verbosity, adaptive_mbti,
|
|
917
|
+
voice_enabled, voice_model, voice_name, voice_stt_model, voice_auto_speak,
|
|
918
|
+
harness_id, delegate_targets, context_tier_proportions,
|
|
919
|
+
anti_hallucination_mode, anti_hallucination_model_config, citation_strictness,
|
|
920
|
+
tool_credentials, router_policy, router_enabled, usage_strategy,
|
|
921
|
+
created_at, updated_at)
|
|
922
|
+
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"
|
|
923
|
+
// (important for PATCH-style updates that omit the field).
|
|
924
|
+
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);
|
|
925
|
+
return getAgentConfig(input.id);
|
|
926
|
+
}
|
|
927
|
+
function clampPercent(next, fallback) {
|
|
928
|
+
const n = Number.isFinite(next) ? Number(next) : fallback;
|
|
929
|
+
return Math.max(0, Math.min(100, Math.round(n)));
|
|
930
|
+
}
|
|
931
|
+
function serialiseToolCredentials(input, existing) {
|
|
932
|
+
if (input === undefined) return existing;
|
|
933
|
+
const cleaned = {};
|
|
934
|
+
for (const [k, v] of Object.entries(input)){
|
|
935
|
+
if (typeof k === "string" && k.length > 0 && typeof v === "string" && v.length > 0) {
|
|
936
|
+
cleaned[k] = v;
|
|
1112
937
|
}
|
|
938
|
+
}
|
|
939
|
+
if (Object.keys(cleaned).length === 0) return null;
|
|
940
|
+
return JSON.stringify(cleaned);
|
|
941
|
+
}
|
|
942
|
+
function toMbti(v) {
|
|
943
|
+
if (!v) return null;
|
|
944
|
+
return v in _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e ? v : null;
|
|
945
|
+
}
|
|
946
|
+
function deleteAgentConfig(id) {
|
|
947
|
+
return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("DELETE FROM agent_configs WHERE id=?").run(id).changes > 0;
|
|
948
|
+
}
|
|
949
|
+
function generateAgentId(name) {
|
|
950
|
+
const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
|
|
951
|
+
const suffix = Math.random().toString(36).slice(2, 6);
|
|
952
|
+
return slug ? `${slug}-${suffix}` : `agent-${suffix}`;
|
|
953
|
+
}
|
|
954
|
+
// ── ADR-0022: per-agent message-channel display filters ─────────────────
|
|
955
|
+
// Canonical channel keys mirrored in `hooks/useMessageFilters.ts`. Kept
|
|
956
|
+
// in sync there by importing this constant — single source of truth.
|
|
957
|
+
const DISPLAY_FILTER_KEYS = [
|
|
958
|
+
"scheduled_task",
|
|
959
|
+
"watcher",
|
|
960
|
+
"bridge",
|
|
961
|
+
"extension",
|
|
962
|
+
"page_capture",
|
|
963
|
+
"synthetic",
|
|
964
|
+
"tool_use",
|
|
965
|
+
"thinking"
|
|
966
|
+
];
|
|
967
|
+
const DISPLAY_FILTER_DEFAULTS = {
|
|
968
|
+
scheduled_task: true,
|
|
969
|
+
watcher: true,
|
|
970
|
+
bridge: true,
|
|
971
|
+
extension: true,
|
|
972
|
+
page_capture: true,
|
|
973
|
+
synthetic: true,
|
|
974
|
+
tool_use: true,
|
|
975
|
+
thinking: true
|
|
976
|
+
};
|
|
977
|
+
function parseDisplayFilters(raw) {
|
|
978
|
+
if (!raw) return {
|
|
979
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
1113
980
|
};
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
981
|
+
try {
|
|
982
|
+
const parsed = JSON.parse(raw);
|
|
983
|
+
// Merge over defaults so newly-added channels stay visible on old rows.
|
|
984
|
+
return {
|
|
985
|
+
...DISPLAY_FILTER_DEFAULTS,
|
|
986
|
+
...parsed
|
|
987
|
+
};
|
|
988
|
+
} catch {
|
|
989
|
+
return {
|
|
990
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
function getAgentDisplayFilters(id) {
|
|
995
|
+
const row = getAgentConfig(id);
|
|
996
|
+
if (!row) return null;
|
|
997
|
+
return parseDisplayFilters(row.display_filters);
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* Merge a partial filter map into the agent's stored prefs. Pass `null` to
|
|
1001
|
+
* reset to defaults (clears the column). Safe against concurrent toggles
|
|
1002
|
+
* from multiple browser tabs because the merge happens server-side.
|
|
1003
|
+
*/ function updateAgentDisplayFilters(id, patch) {
|
|
1004
|
+
const row = getAgentConfig(id);
|
|
1005
|
+
if (!row) return null;
|
|
1006
|
+
if (patch === null) {
|
|
1007
|
+
(0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("UPDATE agent_configs SET display_filters=NULL, updated_at=? WHERE id=?").run(now(), id);
|
|
1008
|
+
return {
|
|
1009
|
+
...DISPLAY_FILTER_DEFAULTS
|
|
1010
|
+
};
|
|
1011
|
+
}
|
|
1012
|
+
const current = parseDisplayFilters(row.display_filters);
|
|
1013
|
+
const next = {
|
|
1014
|
+
...current
|
|
1015
|
+
};
|
|
1016
|
+
for (const k of DISPLAY_FILTER_KEYS){
|
|
1017
|
+
if (k in patch && typeof patch[k] === "boolean") next[k] = patch[k];
|
|
1128
1018
|
}
|
|
1019
|
+
(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);
|
|
1020
|
+
return next;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
/***/ }),
|
|
1025
|
+
|
|
1026
|
+
/***/ 44708:
|
|
1027
|
+
/***/ ((module) => {
|
|
1028
|
+
|
|
1029
|
+
module.exports = require("node:https");
|
|
1030
|
+
|
|
1031
|
+
/***/ }),
|
|
1032
|
+
|
|
1033
|
+
/***/ 44870:
|
|
1034
|
+
/***/ ((module) => {
|
|
1035
|
+
|
|
1036
|
+
module.exports = require("next/dist/compiled/next-server/app-route.runtime.prod.js");
|
|
1037
|
+
|
|
1038
|
+
/***/ }),
|
|
1039
|
+
|
|
1040
|
+
/***/ 48161:
|
|
1041
|
+
/***/ ((module) => {
|
|
1042
|
+
|
|
1043
|
+
module.exports = require("node:os");
|
|
1044
|
+
|
|
1045
|
+
/***/ }),
|
|
1046
|
+
|
|
1047
|
+
/***/ 51455:
|
|
1048
|
+
/***/ ((module) => {
|
|
1049
|
+
|
|
1050
|
+
module.exports = require("node:fs/promises");
|
|
1051
|
+
|
|
1052
|
+
/***/ }),
|
|
1053
|
+
|
|
1054
|
+
/***/ 55511:
|
|
1055
|
+
/***/ ((module) => {
|
|
1056
|
+
|
|
1057
|
+
module.exports = require("crypto");
|
|
1058
|
+
|
|
1059
|
+
/***/ }),
|
|
1060
|
+
|
|
1061
|
+
/***/ 55591:
|
|
1062
|
+
/***/ ((module) => {
|
|
1063
|
+
|
|
1064
|
+
module.exports = require("https");
|
|
1065
|
+
|
|
1066
|
+
/***/ }),
|
|
1067
|
+
|
|
1068
|
+
/***/ 57075:
|
|
1069
|
+
/***/ ((module) => {
|
|
1070
|
+
|
|
1071
|
+
module.exports = require("node:stream");
|
|
1072
|
+
|
|
1073
|
+
/***/ }),
|
|
1074
|
+
|
|
1075
|
+
/***/ 57975:
|
|
1076
|
+
/***/ ((module) => {
|
|
1077
|
+
|
|
1078
|
+
module.exports = require("node:util");
|
|
1079
|
+
|
|
1080
|
+
/***/ }),
|
|
1081
|
+
|
|
1082
|
+
/***/ 63033:
|
|
1083
|
+
/***/ ((module) => {
|
|
1084
|
+
|
|
1085
|
+
module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
|
|
1086
|
+
|
|
1087
|
+
/***/ }),
|
|
1088
|
+
|
|
1089
|
+
/***/ 67118:
|
|
1090
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1091
|
+
|
|
1092
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1093
|
+
/* harmony export */ D: () => (/* binding */ resolveGoogleApiKey),
|
|
1094
|
+
/* harmony export */ _: () => (/* binding */ timeoutSignal)
|
|
1095
|
+
/* harmony export */ });
|
|
1096
|
+
/* harmony import */ var _lib_stores_integrations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78228);
|
|
1097
|
+
|
|
1098
|
+
function timeoutSignal(ms) {
|
|
1099
|
+
const c = new AbortController();
|
|
1100
|
+
setTimeout(()=>c.abort(new Error(`timeout after ${ms}ms`)), ms).unref?.();
|
|
1101
|
+
return c.signal;
|
|
1102
|
+
}
|
|
1103
|
+
function resolveGoogleApiKey() {
|
|
1104
|
+
const raw = (0,_lib_stores_integrations__WEBPACK_IMPORTED_MODULE_0__/* .getIntegrationRaw */ .$G)("google");
|
|
1105
|
+
const fromStore = raw?.api_key?.trim();
|
|
1106
|
+
if (fromStore) return fromStore;
|
|
1107
|
+
return (process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY || "").trim() || null;
|
|
1129
1108
|
}
|
|
1130
1109
|
|
|
1131
|
-
//# sourceMappingURL=app-route.js.map
|
|
1132
1110
|
|
|
1111
|
+
/***/ }),
|
|
1112
|
+
|
|
1113
|
+
/***/ 73024:
|
|
1114
|
+
/***/ ((module) => {
|
|
1115
|
+
|
|
1116
|
+
module.exports = require("node:fs");
|
|
1117
|
+
|
|
1118
|
+
/***/ }),
|
|
1119
|
+
|
|
1120
|
+
/***/ 75919:
|
|
1121
|
+
/***/ ((module) => {
|
|
1122
|
+
|
|
1123
|
+
module.exports = require("node:worker_threads");
|
|
1124
|
+
|
|
1125
|
+
/***/ }),
|
|
1126
|
+
|
|
1127
|
+
/***/ 76760:
|
|
1128
|
+
/***/ ((module) => {
|
|
1129
|
+
|
|
1130
|
+
module.exports = require("node:path");
|
|
1131
|
+
|
|
1132
|
+
/***/ }),
|
|
1133
|
+
|
|
1134
|
+
/***/ 77030:
|
|
1135
|
+
/***/ ((module) => {
|
|
1136
|
+
|
|
1137
|
+
module.exports = require("node:net");
|
|
1138
|
+
|
|
1139
|
+
/***/ }),
|
|
1140
|
+
|
|
1141
|
+
/***/ 77598:
|
|
1142
|
+
/***/ ((module) => {
|
|
1143
|
+
|
|
1144
|
+
module.exports = require("node:crypto");
|
|
1133
1145
|
|
|
1134
1146
|
/***/ }),
|
|
1135
1147
|
|
|
@@ -1369,7 +1381,7 @@ module.exports = import("@huggingface/transformers");;
|
|
|
1369
1381
|
var __webpack_require__ = require("../../../../../webpack-runtime.js");
|
|
1370
1382
|
__webpack_require__.C(exports);
|
|
1371
1383
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
1372
|
-
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46], () => (__webpack_exec__(
|
|
1384
|
+
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46], () => (__webpack_exec__(6039)));
|
|
1373
1385
|
module.exports = __webpack_exports__;
|
|
1374
1386
|
|
|
1375
1387
|
})();
|