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