@circuitwall/jarela 2.7.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +2 -1
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_global-error/page.js +68 -68
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +58 -58
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +127 -127
- package/.next/standalone/.next/server/app/api/v1/access/route.js +372 -372
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +79 -79
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +641 -641
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/duplicate/route.js +723 -723
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +100 -100
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/agents/recent-replies/route.js +227 -227
- package/.next/standalone/.next/server/app/api/v1/agents/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +384 -384
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +203 -203
- package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +17 -17
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +760 -760
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +699 -699
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +30 -30
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +480 -480
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +675 -675
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +559 -559
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js +1269 -1269
- package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +199 -199
- package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/config/route.js +99 -99
- package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/credentials/route.js +169 -169
- package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +515 -515
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +380 -380
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +256 -256
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +80 -97
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +677 -677
- package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/recall-policy/route.js +856 -0
- package/.next/standalone/.next/server/app/api/v1/documents/recall-policy/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/documents/recall-policy/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +299 -247
- package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +486 -486
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +18 -11
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +666 -666
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +128 -100
- package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/env/route.js +207 -207
- package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +128 -128
- package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/events/route.js +154 -154
- package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/events/test/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +97 -97
- package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +188 -188
- package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +93 -93
- package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +93 -93
- package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +69 -69
- package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +69 -69
- package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +223 -223
- package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +93 -93
- package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/route.js +722 -722
- package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +481 -481
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +378 -378
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +510 -510
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +17 -17
- package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +33 -33
- package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +397 -397
- package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +129 -129
- package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +757 -757
- package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/health/route.js +228 -228
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +198 -198
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +845 -845
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +106 -106
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +747 -747
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/integrations/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +420 -420
- package/.next/standalone/.next/server/app/api/v1/local-file/route.js +34 -34
- package/.next/standalone/.next/server/app/api/v1/logs/route.js +819 -819
- package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +217 -217
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +1034 -1034
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +58 -58
- package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +150 -150
- package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/memory/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +16 -16
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +87 -538
- package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/models/route.js +273 -722
- package/.next/standalone/.next/server/app/api/v1/models/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +73 -73
- package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +248 -239
- package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +128 -128
- package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +81 -81
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +34 -25
- package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/route.js +48 -39
- package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +51 -51
- package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +863 -863
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +230 -230
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +138 -138
- package/.next/standalone/.next/server/app/api/v1/profile/route.js +51 -51
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +853 -680
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +171 -171
- package/.next/standalone/.next/server/app/api/v1/providers/route.js +96 -96
- package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +157 -157
- package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +47 -47
- package/.next/standalone/.next/server/app/api/v1/redaction/route.js +206 -206
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +140 -140
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +166 -166
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +52 -52
- package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +722 -722
- package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/security/state/route.js +243 -243
- package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +518 -518
- package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +25 -25
- package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +609 -609
- package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +129 -129
- package/.next/standalone/.next/server/app/api/v1/skills/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +112 -112
- package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +86 -86
- package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +83 -83
- package/.next/standalone/.next/server/app/api/v1/tasks/route.js +23 -23
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +121 -121
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +139 -139
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/messages/[message_id]/route.js +51 -51
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +58 -58
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +1182 -1182
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/route.js +158 -158
- package/.next/standalone/.next/server/app/api/v1/tools/route.js +137 -137
- package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +73 -73
- package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/update/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +30 -30
- package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +79 -79
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +45 -45
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/watchers/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/icon.svg/route.js +55 -55
- package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +18 -18
- package/.next/standalone/.next/server/app/page.js +2112 -1235
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup/page.js +91 -91
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
- package/.next/standalone/.next/server/chunks/1244.js +136 -4
- package/.next/standalone/.next/server/chunks/1387.js +733 -57
- package/.next/standalone/.next/server/chunks/1433.js +1 -1
- package/.next/standalone/.next/server/chunks/210.js +3 -3
- package/.next/standalone/.next/server/chunks/2175.js +874 -0
- package/.next/standalone/.next/server/chunks/3042.js +34 -32
- package/.next/standalone/.next/server/chunks/309.js +21 -40
- package/.next/standalone/.next/server/chunks/3272.js +21 -40
- package/.next/standalone/.next/server/chunks/{540.js → 3326.js} +189 -61
- package/.next/standalone/.next/server/chunks/{6142.js → 3479.js} +170 -159
- package/.next/standalone/.next/server/chunks/3566.js +1 -1
- package/.next/standalone/.next/server/chunks/{5323.js → 3692.js} +31 -3
- package/.next/standalone/.next/server/chunks/4189.js +14 -2
- package/.next/standalone/.next/server/chunks/4377.js +2 -2
- package/.next/standalone/.next/server/chunks/4596.js +18 -9
- package/.next/standalone/.next/server/chunks/{639.js → 4728.js} +23676 -22755
- package/.next/standalone/.next/server/chunks/4955.js +81 -14
- package/.next/standalone/.next/server/chunks/5290.js +136 -5
- package/.next/standalone/.next/server/chunks/{2267.js → 6408.js} +990 -926
- package/.next/standalone/.next/server/chunks/{9667.js → 6911.js} +31 -3
- package/.next/standalone/.next/server/chunks/7033.js +7 -4
- package/.next/standalone/.next/server/chunks/7377.js +7 -4
- package/.next/standalone/.next/server/chunks/8461.js +31 -29
- package/.next/standalone/.next/server/chunks/9032.js +3 -3
- package/.next/standalone/.next/server/chunks/9174.js +18 -9
- package/.next/standalone/.next/server/chunks/9408.js +37 -15
- package/.next/standalone/.next/server/chunks/9824.js +2288 -2288
- package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
- package/.next/standalone/.next/server/middleware.js +104638 -104532
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/2BAUJZ7x8eXCYpuZ-Kp7h/_buildManifest.js +1 -0
- package/.next/standalone/.next/static/chunks/{877-145c9df8aa0aee63.js → 877-367eb49b20edd3d6.js} +38 -16
- package/.next/standalone/.next/static/chunks/app/_global-error/page-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/access/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/duplicate/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/recent-replies/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/recall-policy/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/messages/[message_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/app/{page-64585ef79400f17f.js → page-a584dfa806a1afdb.js} +1082 -205
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6cda89771c3f8ea4.js +17 -0
- package/.next/standalone/.next/static/css/19e1cd815490b47c.css +5 -0
- package/.next/standalone/docs/adoption/changesets.json +148 -0
- package/.next/standalone/package.json +5 -4
- package/CHANGELOG.md +51 -0
- package/README.md +115 -1
- package/api/client.startup.test.ts +29 -0
- package/api/client.ts +9 -2
- package/api/types.ts +20 -1
- package/app/api/v1/dashboard/pricing-task/route.ts +3 -1
- package/app/api/v1/documents/recall-policy/route.test.ts +59 -0
- package/app/api/v1/documents/recall-policy/route.ts +20 -0
- package/app/api/v1/documents/search/route.test.ts +36 -0
- package/app/api/v1/documents/search/route.ts +17 -5
- package/app/api/v1/documents/sources/[id]/reindex/route.test.ts +44 -0
- package/app/api/v1/documents/sources/[id]/reindex/route.ts +4 -1
- package/app/api/v1/documents/sources/route.test.ts +67 -0
- package/app/api/v1/documents/sources/route.ts +20 -2
- package/app/api/v1/models/[name]/route.ts +2 -0
- package/app/api/v1/models/route.ts +4 -0
- package/app/api/v1/providers/[provider]/models/route.test.ts +28 -0
- package/app/api/v1/providers/[provider]/models/route.ts +16 -2
- package/app/globals.css +51 -4
- package/components/agents/AgentsPanel.tsx +2 -2
- package/components/agents/agent-editor/AdvancedSection.tsx +1 -1
- package/components/agents/agent-editor/ModelSection.tsx +2 -2
- package/components/bridges/BridgeEditor.tsx +1 -1
- package/components/bridges/BridgesPanel.tsx +1 -1
- package/components/chat/InputBar.tsx +1 -1
- package/components/chat/MessageList.tsx +3 -3
- package/components/chat/useUserProfileAndAgent.test.tsx +43 -1
- package/components/chat/useUserProfileAndAgent.ts +16 -5
- package/components/credentials/CredentialsPanel.tsx +1 -1
- package/components/dashboard/CostBreakdown.test.tsx +34 -0
- package/components/dashboard/CostBreakdown.tsx +21 -0
- package/components/dashboard/DashboardPanel.test.tsx +9 -0
- package/components/dashboard/DashboardPanel.tsx +3 -3
- package/components/dashboard/Donuts.tsx +5 -2
- package/components/dashboard/ModelPricingSection.test.tsx +42 -0
- package/components/dashboard/ModelPricingSection.tsx +23 -21
- package/components/dashboard/Series.test.tsx +1 -0
- package/components/dashboard/Series.tsx +5 -0
- package/components/dashboard/SummaryCards.tsx +39 -27
- package/components/dashboard/VendorModelReportSection.tsx +2 -0
- package/components/documents/AddSourceFields.tsx +52 -15
- package/components/documents/AddSourceForm.tsx +61 -19
- package/components/documents/DocumentsPanel.tsx +22 -2
- package/components/documents/RecallExclusions.tsx +73 -0
- package/components/documents/SearchProbe.tsx +42 -5
- package/components/documents/helpers.ts +17 -3
- package/components/documents/indexing-controls.test.tsx +137 -0
- package/components/documents/useDocumentsPanel.test.tsx +87 -0
- package/components/documents/useDocumentsPanel.ts +47 -6
- package/components/env/EnvVarsPanel.tsx +1 -1
- package/components/harness/HarnessPanel.tsx +2 -2
- package/components/integrations/NetworkPanel.tsx +1 -1
- package/components/layout/AgentCardControls.test.tsx +162 -0
- package/components/layout/AgentCardControls.tsx +126 -0
- package/components/layout/AgentSwitcher.test.tsx +37 -0
- package/components/layout/AgentSwitcher.tsx +28 -3
- package/components/layout/AppShell.tsx +16 -9
- package/components/layout/MenuPanel.test.tsx +125 -2
- package/components/layout/MenuPanel.tsx +96 -2
- package/components/logs/LogsPanel.tsx +1 -1
- package/components/mcp/MCPPanel.tsx +1 -1
- package/components/memory/UnifiedMemoryPanel.tsx +4 -4
- package/components/models/CapBadges.tsx +1 -1
- package/components/models/EmbeddingModelSection.test.tsx +41 -0
- package/components/models/EmbeddingModelSection.tsx +5 -0
- package/components/models/ModelFeatureGuide.tsx +16 -8
- package/components/models/ModelsPanel.tsx +8 -3
- package/components/models/model-editor/ModelEditorBody.tsx +1 -0
- package/components/models/model-editor/ModelIdSection.tsx +5 -0
- package/components/profile/ProfileEditor.test.tsx +70 -0
- package/components/profile/ProfileEditor.tsx +6 -2
- package/components/profile/ProfilePanel.test.tsx +6 -0
- package/components/profile/ProfilePanel.tsx +1 -1
- package/components/scheduled-tasks/ScheduledTasksPanel.tsx +1 -1
- package/components/settings/AppearancePanel.tsx +1 -1
- package/components/settings/SettingsPanel.test.tsx +23 -0
- package/components/settings/SettingsPanel.tsx +2 -2
- package/components/skills/SkillsPanel.tsx +1 -1
- package/components/tools/BrowserPanel.tsx +1 -1
- package/components/tools/PackagesPanel.tsx +1 -1
- package/components/tools/UnifiedPackageList.tsx +1 -1
- package/components/ui/PanelHeader.tsx +1 -1
- package/components/ui/SubTabBar.tsx +1 -1
- package/docs/INSTALL.md +7 -5
- package/hooks/useAgents.ts +2 -2
- package/lib/agents/prepare/system-prompt.test.ts +65 -0
- package/lib/agents/prepare/system-prompt.ts +27 -20
- package/lib/agents/prompt-registry.test.ts +42 -0
- package/lib/agents/prompt-registry.ts +21 -0
- package/lib/bridges/whatsapp.inbound.test.ts +38 -1
- package/lib/bridges/whatsapp.ts +10 -33
- package/lib/db/index.ts +2 -0
- package/lib/db/migrations.test.ts +10 -0
- package/lib/db/migrations.ts +10 -0
- package/lib/db/statement-cache.test.ts +77 -0
- package/lib/db/statement-cache.ts +31 -0
- package/lib/documents/indexer.test.ts +16 -1
- package/lib/documents/indexer.ts +8 -7
- package/lib/documents/mail-source-config.ts +31 -0
- package/lib/documents/recall-policy.ts +24 -0
- package/lib/documents/remote/icloud.ts +56 -0
- package/lib/documents/remote/index.ts +4 -1
- package/lib/documents/remote/mail.test.ts +232 -0
- package/lib/documents/remote/mail.ts +48 -40
- package/lib/documents/search.test.ts +81 -2
- package/lib/documents/search.ts +47 -7
- package/lib/embeddings/cache.test.ts +16 -2
- package/lib/embeddings/index.test.ts +7 -0
- package/lib/embeddings/index.ts +12 -1
- package/lib/integrations/deepseek-web/manifest.ts +68 -0
- package/lib/integrations/gmail/manifest.ts +2 -3
- package/lib/integrations/icloud/manifest.ts +19 -5
- package/lib/integrations/registry.test.ts +8 -0
- package/lib/integrations/registry.ts +2 -0
- package/lib/lifecycle/changeset-build.test.ts +3 -0
- package/lib/lifecycle/changeset-build.ts +6 -0
- package/lib/lifecycle/changesets.ts +9 -0
- package/lib/pricing/llm-extract.ts +1 -1
- package/lib/pricing/maintenance-task.ts +19 -3
- package/lib/pricing/model-updates.test.ts +192 -0
- package/lib/pricing/model-updates.ts +205 -0
- package/lib/stores/app-settings.ts +17 -1
- package/lib/stores/dashboard-metrics-cache.test.ts +44 -0
- package/lib/stores/dashboard-metrics.test.ts +47 -4
- package/lib/stores/dashboard-metrics.ts +73 -8
- package/lib/stores/document-sources.ts +1 -0
- package/lib/stores/integrations.test.ts +20 -0
- package/lib/stores/integrations.ts +15 -4
- package/lib/stores/langgraph-store.test.ts +53 -0
- package/lib/stores/langgraph-store.ts +9 -21
- package/lib/stores/model-metadata.ts +89 -0
- package/lib/stores/threads.test.ts +34 -0
- package/lib/stores/threads.ts +17 -20
- package/lib/stores/tool-stats.test.ts +31 -0
- package/lib/stores/tool-stats.ts +16 -0
- package/lib/stores/version-adoption.test.ts +8 -0
- package/lib/stores/version-adoption.ts +5 -2
- package/lib/tools/general/documents.test.ts +5 -0
- package/lib/tools/general/pricing-maintenance.test.ts +5 -0
- package/lib/tools/general/pricing-maintenance.ts +4 -1
- package/lib/tools/packages/default-packages/icloud.test.ts +49 -0
- package/lib/tools/packages/default-packages/icloud.ts +8 -6
- package/lib/tools/packages/default-packages.test.ts +16 -0
- package/lib/tools/packages/langchain-packages.ts +2 -2
- package/lib/tools/runtime/category-filter.test.ts +22 -0
- package/lib/tools/web/deepseek.test.ts +76 -0
- package/lib/tools/web/deepseek.ts +68 -0
- package/lib/tools/web/fetch.test.ts +130 -2
- package/lib/tools/web/fetch.ts +48 -1
- package/lib/tools/web/search.test.ts +139 -2
- package/lib/tools/web/search.ts +48 -1
- package/lib/triggers/handlers/scheduled-task.test.ts +18 -0
- package/lib/triggers/handlers/scheduled-task.ts +6 -0
- package/lib/ui/feature-readiness.test.ts +7 -0
- package/lib/ui/feature-readiness.ts +2 -1
- package/package.json +5 -4
- package/scripts/check-npm-package.mjs +1 -0
- package/scripts/jarela-bin.mjs +3 -0
- package/scripts/runtime-version.mjs +19 -0
- package/scripts/start-prod.mjs +3 -0
- package/.next/standalone/.next/static/6qLnqWdsfBTJOAJApUYXy/_buildManifest.js +0 -1
- package/.next/standalone/.next/static/chunks/app/_global-error/page-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/access/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/duplicate/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/recent-replies/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/messages/[message_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-f6b126e5c5b11551.js +0 -17
- package/.next/standalone/.next/static/css/c4a8bed1da2c748f.css +0 -5
- /package/.next/standalone/.next/static/{6qLnqWdsfBTJOAJApUYXy → 2BAUJZ7x8eXCYpuZ-Kp7h}/_ssgManifest.js +0 -0
|
@@ -54,61 +54,48 @@ module.exports = require("node:stream");
|
|
|
54
54
|
|
|
55
55
|
/***/ }),
|
|
56
56
|
|
|
57
|
-
/***/
|
|
58
|
-
/***/ ((
|
|
59
|
-
|
|
60
|
-
__webpack_require__.r(__webpack_exports__);
|
|
61
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
62
|
-
/* harmony export */ handler: () => (/* binding */ handler),
|
|
63
|
-
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
64
|
-
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
65
|
-
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
66
|
-
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
67
|
-
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
68
|
-
/* harmony export */ });
|
|
69
|
-
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319225);
|
|
70
|
-
/* 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__);
|
|
71
|
-
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(684006);
|
|
72
|
-
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
73
|
-
/* 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__);
|
|
74
|
-
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(799373);
|
|
75
|
-
/* 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__);
|
|
76
|
-
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(434775);
|
|
77
|
-
/* 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__);
|
|
78
|
-
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(524235);
|
|
79
|
-
/* 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__);
|
|
80
|
-
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(200261);
|
|
81
|
-
/* 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__);
|
|
82
|
-
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(754365);
|
|
83
|
-
/* 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__);
|
|
84
|
-
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(590771);
|
|
85
|
-
/* 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__);
|
|
86
|
-
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(473461);
|
|
87
|
-
/* 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__);
|
|
88
|
-
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(767798);
|
|
89
|
-
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(192280);
|
|
90
|
-
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(662018);
|
|
91
|
-
/* 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__);
|
|
92
|
-
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(445696);
|
|
93
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(347929);
|
|
94
|
-
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
95
|
-
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(986439);
|
|
96
|
-
/* 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__);
|
|
97
|
-
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(710246);
|
|
98
|
-
/* 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__);
|
|
99
|
-
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(137527);
|
|
100
|
-
/* 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__);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
57
|
+
/***/ 176760:
|
|
58
|
+
/***/ ((module) => {
|
|
108
59
|
|
|
60
|
+
module.exports = require("node:path");
|
|
109
61
|
|
|
62
|
+
/***/ }),
|
|
110
63
|
|
|
64
|
+
/***/ 187246:
|
|
65
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
111
66
|
|
|
67
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68
|
+
/* harmony export */ Ah: () => (/* binding */ updateFlow),
|
|
69
|
+
/* harmony export */ Dd: () => (/* binding */ exchangeCode),
|
|
70
|
+
/* harmony export */ F8: () => (/* binding */ createFlow),
|
|
71
|
+
/* harmony export */ QH: () => (/* binding */ getDefaultGoogleClient),
|
|
72
|
+
/* harmony export */ XG: () => (/* binding */ generatePkce),
|
|
73
|
+
/* harmony export */ iZ: () => (/* binding */ isDefaultGoogleClient),
|
|
74
|
+
/* harmony export */ lv: () => (/* binding */ getFlow),
|
|
75
|
+
/* harmony export */ sI: () => (/* binding */ googleFetch),
|
|
76
|
+
/* harmony export */ wJ: () => (/* binding */ resolveGoogleTokenEndpoint),
|
|
77
|
+
/* harmony export */ wq: () => (/* binding */ resolveGoogleAuth),
|
|
78
|
+
/* harmony export */ xj: () => (/* binding */ buildAuthorizeUrl)
|
|
79
|
+
/* harmony export */ });
|
|
80
|
+
/* unused harmony exports GMAIL_SCOPES, getGoogleAccessToken */
|
|
81
|
+
/* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(977598);
|
|
82
|
+
/* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_crypto__WEBPACK_IMPORTED_MODULE_0__);
|
|
83
|
+
/* harmony import */ var _lib_stores_integrations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(478228);
|
|
84
|
+
/* harmony import */ var _lib_utils_oauth_flow_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(956362);
|
|
85
|
+
/* harmony import */ var _lib_utils_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(253638);
|
|
86
|
+
/* harmony import */ var _lib_utils_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(922032);
|
|
87
|
+
/* harmony import */ var _lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(522632);
|
|
88
|
+
/* harmony import */ var _lib_utils_http_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(312199);
|
|
89
|
+
// Ephemeral state store for the in-app Gmail OAuth flow.
|
|
90
|
+
//
|
|
91
|
+
// The user types client_id + client_secret in the Integrations panel and clicks
|
|
92
|
+
// "Connect Gmail". We POST those to /oauth/start, which stashes them here keyed
|
|
93
|
+
// by a random `state` token and returns the Google authorize URL. The browser
|
|
94
|
+
// opens that URL; Google bounces back to /oauth/callback with `?code&state`,
|
|
95
|
+
// which exchanges the code for a refresh_token and persists the integration.
|
|
96
|
+
// Meanwhile the panel polls /oauth/status to know when to refresh.
|
|
97
|
+
//
|
|
98
|
+
// Pinned to globalThis so HMR in dev doesn't lose pending flows.
|
|
112
99
|
|
|
113
100
|
|
|
114
101
|
|
|
@@ -116,845 +103,406 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
116
103
|
|
|
117
104
|
|
|
118
105
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const nextConfigOutput = "standalone"
|
|
122
|
-
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
123
|
-
definition: {
|
|
124
|
-
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
125
|
-
page: "/api/v1/integrations/gmail/oauth/start/route",
|
|
126
|
-
pathname: "/api/v1/integrations/gmail/oauth/start",
|
|
127
|
-
filename: "route",
|
|
128
|
-
bundlePath: "app/api/v1/integrations/gmail/oauth/start/route"
|
|
129
|
-
},
|
|
130
|
-
distDir: ".next" || 0,
|
|
131
|
-
relativeProjectDir: false || '',
|
|
132
|
-
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/integrations/gmail/oauth/start/route.ts",
|
|
133
|
-
nextConfigOutput,
|
|
134
|
-
// The lazy require factory ensures that:
|
|
135
|
-
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
136
|
-
// correctly attributing module load time to application-code rather than
|
|
137
|
-
// framework internals.
|
|
138
|
-
// - In all modes: async modules (route files with top-level await) are
|
|
139
|
-
// handled correctly — require() returns a Promise for such modules, which
|
|
140
|
-
// ensureUserland() awaits before the first request is handled.
|
|
141
|
-
userland: ()=>__webpack_require__(722158),
|
|
142
|
-
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
143
|
-
// server HMR updates are picked up without re-executing the entry chunk.
|
|
144
|
-
// Using require() (synchronous) avoids adding async overhead that would be
|
|
145
|
-
// incorrectly attributed to application-code time in devRequestTiming.
|
|
146
|
-
... false ? 0 : {}
|
|
106
|
+
const flowStore = (0,_lib_utils_oauth_flow_store__WEBPACK_IMPORTED_MODULE_2__/* .createOAuthFlowStore */ .R)({
|
|
107
|
+
globalKey: "__ggOauthFlows"
|
|
147
108
|
});
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
109
|
+
const createFlow = flowStore.create;
|
|
110
|
+
const getFlow = flowStore.get;
|
|
111
|
+
const updateFlow = flowStore.update;
|
|
112
|
+
const GMAIL_SCOPES = [
|
|
113
|
+
"https://www.googleapis.com/auth/gmail.modify",
|
|
114
|
+
"https://www.googleapis.com/auth/gmail.compose",
|
|
115
|
+
// Calendar: read/write events on the user's existing calendars. Narrow
|
|
116
|
+
// scope on purpose — doesn't grant create/delete of entire calendars
|
|
117
|
+
// (matches the principle-of-least-privilege the Gmail scopes follow).
|
|
118
|
+
"https://www.googleapis.com/auth/calendar.events",
|
|
119
|
+
// Read-only metadata of the user's calendar list. Required for the
|
|
120
|
+
// calendarList.list endpoint that powers calendarListCalendarsTool —
|
|
121
|
+
// calendar.events alone returns 403 there.
|
|
122
|
+
"https://www.googleapis.com/auth/calendar.readonly"
|
|
123
|
+
];
|
|
124
|
+
// ---------------------------------------------------------------------------
|
|
125
|
+
// Bundled Jarela-owned OAuth client (Desktop type)
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
//
|
|
128
|
+
// Google's `oauth2.googleapis.com/token` endpoint requires `client_secret` on
|
|
129
|
+
// every code-exchange and refresh call, even for Desktop clients using PKCE.
|
|
130
|
+
// (Google's "Optional" wording in the OAuth-for-native-apps doc reflects the
|
|
131
|
+
// RFC spec, not the production endpoint's actual behaviour.) Shipping the
|
|
132
|
+
// secret in this repo would attract CVSS-7.5 reports the moment the source
|
|
133
|
+
// hits GitHub, so we keep it server-side: requests for the bundled client_id
|
|
134
|
+
// are routed through `functions/google-oauth-proxy/`, which injects the secret
|
|
135
|
+
// from Secret Manager before forwarding to Google.
|
|
136
|
+
//
|
|
137
|
+
// Forks/self-hosters override the bundled client_id via JARELA_GMAIL_CLIENT_ID
|
|
138
|
+
// and the proxy URL via JARELA_GOOGLE_TOKEN_PROXY. The legacy BYO Advanced
|
|
139
|
+
// fields still accept a full client_id + client_secret pair for users who'd
|
|
140
|
+
// rather use their own GCP project (bypasses the proxy entirely).
|
|
141
|
+
const DEFAULT_DESKTOP_CLIENT_ID = process.env.JARELA_GMAIL_CLIENT_ID?.trim() || "134669812881-for5e5bjirjt9s2f53cvc3lcj5q257c7.apps.googleusercontent.com";
|
|
142
|
+
function getDefaultGoogleClient() {
|
|
143
|
+
return {
|
|
144
|
+
client_id: DEFAULT_DESKTOP_CLIENT_ID
|
|
145
|
+
};
|
|
157
146
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
147
|
+
// True when the resolved client_id is the bundled Jarela one (NOT a BYO
|
|
148
|
+
// from env or the Advanced credentials panel). Used by the callback to
|
|
149
|
+
// avoid persisting a redundant client_id row — `resolveGoogleAuth` reads
|
|
150
|
+
// it back from the bundle on demand instead.
|
|
151
|
+
function isDefaultGoogleClient(id) {
|
|
152
|
+
return id === getDefaultGoogleClient().client_id;
|
|
153
|
+
}
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
155
|
+
// Token endpoint resolution: bundled-client traffic goes through Jarela's
|
|
156
|
+
// hosted proxy which injects `client_secret` from Secret Manager. BYO traffic
|
|
157
|
+
// goes direct to Google — the user supplied their own secret and the proxy
|
|
158
|
+
// neither has nor wants it. Self-hosters override the proxy URL via
|
|
159
|
+
// JARELA_GOOGLE_TOKEN_PROXY.
|
|
160
|
+
// ---------------------------------------------------------------------------
|
|
161
|
+
const GOOGLE_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token";
|
|
162
|
+
const JARELA_TOKEN_PROXY = process.env.JARELA_GOOGLE_TOKEN_PROXY?.trim() || "https://jarela-oauth-proxy-134669812881.europe-west1.run.app";
|
|
163
|
+
function selectTokenEndpoint(clientId, hasClientSecret) {
|
|
164
|
+
if (isDefaultGoogleClient(clientId) && !hasClientSecret) return JARELA_TOKEN_PROXY;
|
|
165
|
+
return GOOGLE_TOKEN_ENDPOINT;
|
|
166
|
+
}
|
|
167
|
+
// Public re-export for callers that need to mirror the routing decision
|
|
168
|
+
// without going through `getGoogleAccessToken` (e.g. the Gmail health
|
|
169
|
+
// probe, which needs precise HTTP-status-aware error mapping).
|
|
170
|
+
const resolveGoogleTokenEndpoint = selectTokenEndpoint;
|
|
171
|
+
function generatePkce() {
|
|
172
|
+
// 32 random bytes → 43-char base64url string (well within the 43-128 spec).
|
|
173
|
+
const verifier = (0,node_crypto__WEBPACK_IMPORTED_MODULE_0__.randomBytes)(32).toString("base64url");
|
|
174
|
+
const challenge = (0,node_crypto__WEBPACK_IMPORTED_MODULE_0__.createHash)("sha256").update(verifier).digest("base64url");
|
|
175
|
+
return {
|
|
176
|
+
verifier,
|
|
177
|
+
challenge
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function buildAuthorizeUrl(opts) {
|
|
181
|
+
const p = new URLSearchParams({
|
|
182
|
+
client_id: opts.clientId,
|
|
183
|
+
redirect_uri: opts.redirectUri,
|
|
184
|
+
response_type: "code",
|
|
185
|
+
scope: GMAIL_SCOPES.join(" "),
|
|
186
|
+
access_type: "offline",
|
|
187
|
+
prompt: "consent",
|
|
188
|
+
include_granted_scopes: "true",
|
|
189
|
+
state: opts.state,
|
|
190
|
+
code_challenge: opts.codeChallenge,
|
|
191
|
+
code_challenge_method: "S256"
|
|
182
192
|
});
|
|
183
|
-
return
|
|
184
|
-
tracer: (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)(),
|
|
185
|
-
spanName: `${req.method || 'GET'} ${srcPage}`,
|
|
186
|
-
httpTarget: req.url,
|
|
187
|
-
instrumentation
|
|
188
|
-
}, (requestSpan, requestRootSpan)=>handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan));
|
|
193
|
+
return `https://accounts.google.com/o/oauth2/v2/auth?${p.toString()}`;
|
|
189
194
|
}
|
|
190
|
-
async function
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
195
|
+
async function exchangeCode(opts) {
|
|
196
|
+
const clientId = (0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeOAuthInput */ .d)(opts.clientId) ?? "";
|
|
197
|
+
const clientSecret = opts.clientSecret ? (0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeOAuthInput */ .d)(opts.clientSecret) ?? "" : "";
|
|
198
|
+
const body = new URLSearchParams({
|
|
199
|
+
code: opts.code,
|
|
200
|
+
client_id: clientId,
|
|
201
|
+
redirect_uri: opts.redirectUri,
|
|
202
|
+
grant_type: "authorization_code",
|
|
203
|
+
code_verifier: opts.codeVerifier
|
|
194
204
|
});
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
205
|
+
if (clientSecret) body.set("client_secret", clientSecret);
|
|
206
|
+
const endpoint = selectTokenEndpoint(clientId, Boolean(clientSecret));
|
|
207
|
+
const res = await fetch(endpoint, {
|
|
208
|
+
method: "POST",
|
|
209
|
+
headers: {
|
|
210
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
211
|
+
},
|
|
212
|
+
body: body.toString(),
|
|
213
|
+
signal: AbortSignal.timeout(30000)
|
|
214
|
+
});
|
|
215
|
+
const text = await res.text();
|
|
216
|
+
const parsed = (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_4__/* .parseJsonSafe */ .p)(text, {});
|
|
217
|
+
if (!res.ok) {
|
|
218
|
+
const err = parsed["error_description"] || parsed["error"] || text || `HTTP ${res.status}`;
|
|
219
|
+
console.error(`[gmail-oauth] token exchange rejected (${res.status}): ${err} | client_id ${(0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_3__/* .secretFingerprint */ .n)(clientId)} | client_secret ${(0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_3__/* .secretFingerprint */ .n)(clientSecret)}`);
|
|
220
|
+
throw new Error(err);
|
|
200
221
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
222
|
+
return parsed;
|
|
223
|
+
}
|
|
224
|
+
function resolveGoogleAuth() {
|
|
225
|
+
const envId = process.env.GMAIL_CLIENT_ID;
|
|
226
|
+
const envSecret = process.env.GMAIL_CLIENT_SECRET;
|
|
227
|
+
const envRefresh = process.env.GMAIL_REFRESH_TOKEN;
|
|
228
|
+
if (envId && envSecret && envRefresh) {
|
|
229
|
+
return {
|
|
230
|
+
client_id: envId,
|
|
231
|
+
client_secret: envSecret,
|
|
232
|
+
refresh_token: envRefresh
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
const saved = (0,_lib_stores_integrations__WEBPACK_IMPORTED_MODULE_1__/* .getIntegrationRaw */ .$G)("gmail");
|
|
236
|
+
if (saved?.refresh_token) {
|
|
237
|
+
// Stored client_id wins when present (BYO path); otherwise fall back to
|
|
238
|
+
// the bundled Jarela client_id. client_secret is only set on the BYO
|
|
239
|
+
// path — the bundled client's secret is injected server-side by the proxy.
|
|
240
|
+
if (saved.client_id && saved.client_secret) {
|
|
241
|
+
return {
|
|
242
|
+
client_id: saved.client_id,
|
|
243
|
+
client_secret: saved.client_secret,
|
|
244
|
+
refresh_token: saved.refresh_token
|
|
245
|
+
};
|
|
212
246
|
}
|
|
213
|
-
return
|
|
247
|
+
return {
|
|
248
|
+
client_id: saved.client_id || getDefaultGoogleClient().client_id,
|
|
249
|
+
refresh_token: saved.refresh_token
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
error: "Google account not connected. Open the gear menu → Integrations tab → " + "Gmail card and click Connect Gmail to authorize Gmail + Calendar access."
|
|
214
254
|
};
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
255
|
+
}
|
|
256
|
+
const accessTokenCache = new Map();
|
|
257
|
+
async function getGoogleAccessToken(auth) {
|
|
258
|
+
const key = auth.refresh_token.slice(0, 20);
|
|
259
|
+
const cached = accessTokenCache.get(key);
|
|
260
|
+
if (cached && cached.expires_at > Date.now() + 60000) return cached.token;
|
|
261
|
+
const body = new URLSearchParams({
|
|
262
|
+
client_id: auth.client_id,
|
|
263
|
+
refresh_token: auth.refresh_token,
|
|
264
|
+
grant_type: "refresh_token"
|
|
265
|
+
});
|
|
266
|
+
if (auth.client_secret) body.set("client_secret", auth.client_secret);
|
|
267
|
+
const endpoint = selectTokenEndpoint(auth.client_id, Boolean(auth.client_secret));
|
|
268
|
+
try {
|
|
269
|
+
const res = await fetch(endpoint, {
|
|
270
|
+
method: "POST",
|
|
271
|
+
headers: {
|
|
272
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
273
|
+
},
|
|
274
|
+
body: body.toString(),
|
|
275
|
+
signal: AbortSignal.timeout(30000)
|
|
276
|
+
});
|
|
277
|
+
const text = await (0,_lib_utils_http_json__WEBPACK_IMPORTED_MODULE_5__/* .readResponseText */ .BQ)(res);
|
|
278
|
+
if (!res.ok) {
|
|
279
|
+
// Drop any stale cached token so a reconnected (broader-scope) refresh
|
|
280
|
+
// re-exchanges cleanly on the next call.
|
|
281
|
+
accessTokenCache.delete(key);
|
|
282
|
+
return {
|
|
283
|
+
error: `OAuth token refresh failed (${res.status}): ${text.slice(0, 300)}`
|
|
284
|
+
};
|
|
224
285
|
}
|
|
286
|
+
const parsed = JSON.parse(text);
|
|
287
|
+
if (!parsed.access_token) return {
|
|
288
|
+
error: "OAuth response missing access_token"
|
|
289
|
+
};
|
|
290
|
+
const expires_at = Date.now() + (parsed.expires_in ?? 3000) * 1000;
|
|
291
|
+
accessTokenCache.set(key, {
|
|
292
|
+
token: parsed.access_token,
|
|
293
|
+
expires_at
|
|
294
|
+
});
|
|
295
|
+
return parsed.access_token;
|
|
296
|
+
} catch (err) {
|
|
297
|
+
return {
|
|
298
|
+
error: `OAuth token refresh threw: ${(0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_6__/* .errorMessage */ .g)(err)}`
|
|
299
|
+
};
|
|
225
300
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Shared bearer-auth fetch for Google REST APIs (Gmail, Calendar, ...).
|
|
304
|
+
*
|
|
305
|
+
* Behaviour:
|
|
306
|
+
* - Resolves access token from `auth`; if that fails, the error object is
|
|
307
|
+
* surfaced unchanged so callers can pass it back to the agent.
|
|
308
|
+
* - 204 No Content → `{ ok: true }` (used by DELETE endpoints).
|
|
309
|
+
* - Non-2xx response → `{ error: "<service> <status>: <body slice>", url }`.
|
|
310
|
+
* - 2xx with body → parsed JSON if possible, raw text otherwise.
|
|
311
|
+
* - Fetch throws (DNS, abort, timeout) → `{ error: "<service> fetch threw: ..." }`.
|
|
312
|
+
*
|
|
313
|
+
* @param service Short tag used in error messages, e.g. "Gmail" or "Calendar".
|
|
314
|
+
* @param baseUrl Base for relative `path` (e.g. `https://gmail.googleapis.com/gmail/v1/users/me`).
|
|
315
|
+
* @param path Either a full URL (starts with `http`) or path appended to baseUrl.
|
|
316
|
+
*/ async function googleFetch(auth, service, baseUrl, path, init) {
|
|
317
|
+
let target;
|
|
318
|
+
try {
|
|
319
|
+
target = path.startsWith("http") ? new URL(path) : new URL(`${baseUrl}${path}`);
|
|
320
|
+
} catch {
|
|
321
|
+
return {
|
|
322
|
+
error: `${service} request URL is invalid.`
|
|
323
|
+
};
|
|
231
324
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
serverActionsManifest
|
|
240
|
-
});
|
|
325
|
+
let base;
|
|
326
|
+
try {
|
|
327
|
+
base = new URL(baseUrl);
|
|
328
|
+
} catch {
|
|
329
|
+
return {
|
|
330
|
+
error: `${service} API base URL is invalid.`
|
|
331
|
+
};
|
|
241
332
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
259
|
-
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
260
|
-
isDraftMode,
|
|
261
|
-
incrementalCache,
|
|
262
|
-
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
263
|
-
cacheLifeProfiles: nextConfig.cacheLife,
|
|
264
|
-
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
265
|
-
waitUntil: ctx.waitUntil,
|
|
266
|
-
onClose: (cb)=>{
|
|
267
|
-
res.on('close', cb);
|
|
333
|
+
if (target.origin !== base.origin || target.username || target.password) {
|
|
334
|
+
return {
|
|
335
|
+
error: `${service} requests must target ${base.hostname}; refusing to forward credentials.`
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
const url = target.toString();
|
|
339
|
+
const token = await getGoogleAccessToken(auth);
|
|
340
|
+
if (typeof token !== "string") return token;
|
|
341
|
+
try {
|
|
342
|
+
const res = await fetch(url, {
|
|
343
|
+
...init,
|
|
344
|
+
headers: {
|
|
345
|
+
Authorization: `Bearer ${token}`,
|
|
346
|
+
Accept: "application/json",
|
|
347
|
+
"Content-Type": "application/json",
|
|
348
|
+
...init?.headers ?? {}
|
|
268
349
|
},
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
350
|
+
signal: AbortSignal.timeout(30000)
|
|
351
|
+
});
|
|
352
|
+
if (res.status === 204) return {
|
|
353
|
+
ok: true
|
|
354
|
+
};
|
|
355
|
+
const text = await (0,_lib_utils_http_json__WEBPACK_IMPORTED_MODULE_5__/* .readResponseText */ .BQ)(res);
|
|
356
|
+
if (!res.ok) {
|
|
357
|
+
return {
|
|
358
|
+
error: `${service} ${res.status}: ${text.slice(0, 500)}`,
|
|
359
|
+
url
|
|
360
|
+
};
|
|
274
361
|
}
|
|
275
|
-
};
|
|
276
|
-
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
277
|
-
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
278
|
-
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));
|
|
279
|
-
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
280
362
|
try {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
285
|
-
res.end('This page could not be found');
|
|
286
|
-
return null;
|
|
287
|
-
}
|
|
288
|
-
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
289
|
-
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
290
|
-
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
291
|
-
// Attempt using provided waitUntil if available
|
|
292
|
-
// if it's not we fallback to sendResponse's handling
|
|
293
|
-
if (pendingWaitUntil) {
|
|
294
|
-
if (ctx.waitUntil) {
|
|
295
|
-
ctx.waitUntil(pendingWaitUntil);
|
|
296
|
-
pendingWaitUntil = undefined;
|
|
297
|
-
}
|
|
363
|
+
const parsed = JSON.parse(text);
|
|
364
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
365
|
+
return parsed;
|
|
298
366
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
if (isIsr) {
|
|
303
|
-
const blob = await response.blob();
|
|
304
|
-
// Copy the headers from the response.
|
|
305
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
306
|
-
if (cacheTags) {
|
|
307
|
-
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
308
|
-
}
|
|
309
|
-
if (!headers['content-type'] && blob.type) {
|
|
310
|
-
headers['content-type'] = blob.type;
|
|
311
|
-
}
|
|
312
|
-
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
313
|
-
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
|
|
314
|
-
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
315
|
-
// build-time fallback in `build/index.ts` so cache entries
|
|
316
|
-
// and the response Cache-Control header agree on the route's
|
|
317
|
-
// effective expire. Routes that opt out of revalidation
|
|
318
|
-
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
319
|
-
// keep `expire: undefined`.
|
|
320
|
-
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
321
|
-
// Create the cache entry for the response.
|
|
322
|
-
const cacheEntry = {
|
|
323
|
-
value: {
|
|
324
|
-
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
325
|
-
status: response.status,
|
|
326
|
-
body: Buffer.from(await blob.arrayBuffer()),
|
|
327
|
-
headers
|
|
328
|
-
},
|
|
329
|
-
cacheControl: {
|
|
330
|
-
revalidate,
|
|
331
|
-
expire
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
return cacheEntry;
|
|
335
|
-
} else {
|
|
336
|
-
// send response without caching if not ISR
|
|
337
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
338
|
-
return null;
|
|
339
|
-
}
|
|
340
|
-
} catch (err) {
|
|
341
|
-
// if this is a background revalidate we need to report
|
|
342
|
-
// the request error here as it won't be bubbled
|
|
343
|
-
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
344
|
-
const silenceLog = false;
|
|
345
|
-
await routeModule.onRequestError(req, err, {
|
|
346
|
-
routerKind: 'App Router',
|
|
347
|
-
routePath: srcPage,
|
|
348
|
-
routeType: 'route',
|
|
349
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
350
|
-
isStaticGeneration: cacheKey !== null,
|
|
351
|
-
isOnDemandRevalidate
|
|
352
|
-
})
|
|
353
|
-
}, silenceLog, routerServerContext);
|
|
354
|
-
}
|
|
355
|
-
throw err;
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
const handleResponse = async (currentSpan)=>{
|
|
359
|
-
try {
|
|
360
|
-
var _cacheEntry_value;
|
|
361
|
-
const cacheEntry = await routeModule.handleResponse({
|
|
362
|
-
req,
|
|
363
|
-
nextConfig,
|
|
364
|
-
cacheKey,
|
|
365
|
-
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
366
|
-
isFallback: false,
|
|
367
|
-
previewProps,
|
|
368
|
-
prerenderManifest,
|
|
369
|
-
isRoutePPREnabled: false,
|
|
370
|
-
isOnDemandRevalidate,
|
|
371
|
-
revalidateOnlyGenerated,
|
|
372
|
-
responseGenerator,
|
|
373
|
-
waitUntil: ctx.waitUntil,
|
|
374
|
-
isMinimalMode
|
|
375
|
-
});
|
|
376
|
-
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
377
|
-
throw cacheEntry.error;
|
|
378
|
-
}
|
|
379
|
-
// we don't create a cacheEntry for ISR
|
|
380
|
-
if (!isIsr) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
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) {
|
|
384
|
-
var _cacheEntry_value1;
|
|
385
|
-
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
386
|
-
}
|
|
387
|
-
if (!isMinimalMode) {
|
|
388
|
-
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
389
|
-
}
|
|
390
|
-
// Draft mode should never be cached
|
|
391
|
-
if (isDraftMode) {
|
|
392
|
-
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
393
|
-
}
|
|
394
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
395
|
-
if (!(isMinimalMode && isIsr)) {
|
|
396
|
-
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
397
|
-
}
|
|
398
|
-
// If cache control is already set on the response we don't
|
|
399
|
-
// override it to allow users to customize it via next.config
|
|
400
|
-
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
401
|
-
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
402
|
-
}
|
|
403
|
-
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'.
|
|
404
|
-
new Response(cacheEntry.value.body, {
|
|
405
|
-
headers,
|
|
406
|
-
status: cacheEntry.value.status || 200
|
|
407
|
-
}));
|
|
408
|
-
return;
|
|
409
|
-
} catch (err) {
|
|
410
|
-
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
411
|
-
const silenceLog = false;
|
|
412
|
-
await routeModule.onRequestError(req, err, {
|
|
413
|
-
routerKind: 'App Router',
|
|
414
|
-
routePath: normalizedSrcPage,
|
|
415
|
-
routeType: 'route',
|
|
416
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
417
|
-
isStaticGeneration: cacheKey !== null,
|
|
418
|
-
isOnDemandRevalidate
|
|
419
|
-
})
|
|
420
|
-
}, silenceLog, routerServerContext);
|
|
421
|
-
}
|
|
422
|
-
// rethrow so that we can handle serving error page
|
|
423
|
-
// If this is during static generation, throw the error again.
|
|
424
|
-
if (isIsr) throw err;
|
|
425
|
-
// Otherwise, send a 500 response unless the original response has
|
|
426
|
-
// already committed. In that case, preserve its status code for
|
|
427
|
-
// telemetry while still recording the failure and terminating a response
|
|
428
|
-
// that the failed pipeline left open.
|
|
429
|
-
if (res.headersSent) {
|
|
430
|
-
if (currentSpan) {
|
|
431
|
-
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
432
|
-
currentSpan.recordException(error);
|
|
433
|
-
currentSpan.setStatus({
|
|
434
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
435
|
-
message: error.message
|
|
436
|
-
});
|
|
437
|
-
currentSpan.setAttribute('error.type', error.name);
|
|
438
|
-
}
|
|
439
|
-
if (!res.writableEnded && !res.destroyed) {
|
|
440
|
-
res.end();
|
|
441
|
-
}
|
|
442
|
-
} else {
|
|
443
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
444
|
-
status: 500
|
|
445
|
-
}));
|
|
446
|
-
}
|
|
447
|
-
return;
|
|
448
|
-
} finally{
|
|
449
|
-
;
|
|
450
|
-
(()=>{
|
|
451
|
-
if (!currentSpan) {
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
let statusCode = res.statusCode;
|
|
455
|
-
currentSpan.setAttributes({
|
|
456
|
-
'http.status_code': statusCode,
|
|
457
|
-
'next.rsc': false
|
|
458
|
-
});
|
|
459
|
-
if (statusCode && statusCode >= 500) {
|
|
460
|
-
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
461
|
-
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
462
|
-
currentSpan.setStatus({
|
|
463
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
464
|
-
});
|
|
465
|
-
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
466
|
-
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
467
|
-
}
|
|
468
|
-
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
469
|
-
// We were unable to get attributes, probably OTEL is not enabled
|
|
470
|
-
if (!rootSpanAttributes) {
|
|
471
|
-
return;
|
|
472
|
-
}
|
|
473
|
-
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
474
|
-
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
478
|
-
const name = `${method} ${route}`;
|
|
479
|
-
currentSpan.setAttributes({
|
|
480
|
-
'next.route': route,
|
|
481
|
-
'http.route': route,
|
|
482
|
-
'next.span_name': name
|
|
483
|
-
});
|
|
484
|
-
currentSpan.updateName(name);
|
|
485
|
-
// Propagate http.route to the request's root span if it isn't the
|
|
486
|
-
// request span (e.g. a platform-created HTTP span in adapter
|
|
487
|
-
// deployments).
|
|
488
|
-
if (requestRootSpan && requestRootSpan !== currentSpan) {
|
|
489
|
-
requestRootSpan.setAttribute('http.route', route);
|
|
490
|
-
requestRootSpan.updateName(name);
|
|
491
|
-
}
|
|
492
|
-
})();
|
|
367
|
+
} catch {
|
|
368
|
+
// Google REST endpoints used here return JSON objects. Do not pass raw
|
|
369
|
+
// text or binary payloads to callers that expect an object response.
|
|
493
370
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
371
|
+
const magic = Buffer.from(text.slice(0, 4), "latin1").toString("hex");
|
|
372
|
+
const detail = `content-type=${res.headers.get("content-type")}, content-encoding=${res.headers.get("content-encoding")}, length=${text.length}, first-bytes=${magic}`;
|
|
373
|
+
return {
|
|
374
|
+
error: `${service} ${res.status}: expected a JSON object response (${detail})`,
|
|
375
|
+
url
|
|
376
|
+
};
|
|
377
|
+
} catch (err) {
|
|
378
|
+
return {
|
|
379
|
+
error: `${service} fetch threw: ${(0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_6__/* .errorMessage */ .g)(err)}`
|
|
380
|
+
};
|
|
500
381
|
}
|
|
501
|
-
await handleResponse(requestSpan);
|
|
502
382
|
}
|
|
503
383
|
|
|
504
|
-
//# sourceMappingURL=app-route.js.map
|
|
505
|
-
|
|
506
384
|
|
|
507
385
|
/***/ }),
|
|
508
386
|
|
|
509
|
-
/***/
|
|
387
|
+
/***/ 200261:
|
|
510
388
|
/***/ ((module) => {
|
|
511
389
|
|
|
512
|
-
module.exports = require("
|
|
390
|
+
module.exports = require("next/dist/shared/lib/router/utils/app-paths");
|
|
513
391
|
|
|
514
392
|
/***/ }),
|
|
515
393
|
|
|
516
|
-
/***/
|
|
394
|
+
/***/ 253638:
|
|
517
395
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
518
396
|
|
|
519
397
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
520
|
-
/* harmony export */
|
|
521
|
-
/* harmony export */ Dd: () => (/* binding */ exchangeCode),
|
|
522
|
-
/* harmony export */ F8: () => (/* binding */ createFlow),
|
|
523
|
-
/* harmony export */ QH: () => (/* binding */ getDefaultGoogleClient),
|
|
524
|
-
/* harmony export */ XG: () => (/* binding */ generatePkce),
|
|
525
|
-
/* harmony export */ iZ: () => (/* binding */ isDefaultGoogleClient),
|
|
526
|
-
/* harmony export */ lv: () => (/* binding */ getFlow),
|
|
527
|
-
/* harmony export */ sI: () => (/* binding */ googleFetch),
|
|
528
|
-
/* harmony export */ wJ: () => (/* binding */ resolveGoogleTokenEndpoint),
|
|
529
|
-
/* harmony export */ wq: () => (/* binding */ resolveGoogleAuth),
|
|
530
|
-
/* harmony export */ xj: () => (/* binding */ buildAuthorizeUrl)
|
|
398
|
+
/* harmony export */ p: () => (/* binding */ parseJsonSafe)
|
|
531
399
|
/* harmony export */ });
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
//
|
|
543
|
-
// The user types client_id + client_secret in the Integrations panel and clicks
|
|
544
|
-
// "Connect Gmail". We POST those to /oauth/start, which stashes them here keyed
|
|
545
|
-
// by a random `state` token and returns the Google authorize URL. The browser
|
|
546
|
-
// opens that URL; Google bounces back to /oauth/callback with `?code&state`,
|
|
547
|
-
// which exchanges the code for a refresh_token and persists the integration.
|
|
548
|
-
// Meanwhile the panel polls /oauth/status to know when to refresh.
|
|
549
|
-
//
|
|
550
|
-
// Pinned to globalThis so HMR in dev doesn't lose pending flows.
|
|
400
|
+
// JSON.parse with a fallback value when the input is malformed (or empty).
|
|
401
|
+
// Used everywhere we read responses from external APIs — they're contractually
|
|
402
|
+
// JSON but a transient 502 / proxy interstitial occasionally returns HTML.
|
|
403
|
+
function parseJsonSafe(text, fallback) {
|
|
404
|
+
try {
|
|
405
|
+
return JSON.parse(text);
|
|
406
|
+
} catch {
|
|
407
|
+
return fallback;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
551
410
|
|
|
552
411
|
|
|
412
|
+
/***/ }),
|
|
553
413
|
|
|
414
|
+
/***/ 257975:
|
|
415
|
+
/***/ ((module) => {
|
|
554
416
|
|
|
417
|
+
module.exports = require("node:util");
|
|
555
418
|
|
|
419
|
+
/***/ }),
|
|
556
420
|
|
|
421
|
+
/***/ 309956:
|
|
422
|
+
/***/ ((module) => {
|
|
557
423
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
})
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
// ---------------------------------------------------------------------------
|
|
577
|
-
// Bundled Jarela-owned OAuth client (Desktop type)
|
|
578
|
-
// ---------------------------------------------------------------------------
|
|
579
|
-
//
|
|
580
|
-
// Google's `oauth2.googleapis.com/token` endpoint requires `client_secret` on
|
|
581
|
-
// every code-exchange and refresh call, even for Desktop clients using PKCE.
|
|
582
|
-
// (Google's "Optional" wording in the OAuth-for-native-apps doc reflects the
|
|
583
|
-
// RFC spec, not the production endpoint's actual behaviour.) Shipping the
|
|
584
|
-
// secret in this repo would attract CVSS-7.5 reports the moment the source
|
|
585
|
-
// hits GitHub, so we keep it server-side: requests for the bundled client_id
|
|
586
|
-
// are routed through `functions/google-oauth-proxy/`, which injects the secret
|
|
587
|
-
// from Secret Manager before forwarding to Google.
|
|
588
|
-
//
|
|
589
|
-
// Forks/self-hosters override the bundled client_id via JARELA_GMAIL_CLIENT_ID
|
|
590
|
-
// and the proxy URL via JARELA_GOOGLE_TOKEN_PROXY. The legacy BYO Advanced
|
|
591
|
-
// fields still accept a full client_id + client_secret pair for users who'd
|
|
592
|
-
// rather use their own GCP project (bypasses the proxy entirely).
|
|
593
|
-
const DEFAULT_DESKTOP_CLIENT_ID = process.env.JARELA_GMAIL_CLIENT_ID?.trim() || "134669812881-for5e5bjirjt9s2f53cvc3lcj5q257c7.apps.googleusercontent.com";
|
|
594
|
-
function getDefaultGoogleClient() {
|
|
595
|
-
return {
|
|
596
|
-
client_id: DEFAULT_DESKTOP_CLIENT_ID
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
// True when the resolved client_id is the bundled Jarela one (NOT a BYO
|
|
600
|
-
// from env or the Advanced credentials panel). Used by the callback to
|
|
601
|
-
// avoid persisting a redundant client_id row — `resolveGoogleAuth` reads
|
|
602
|
-
// it back from the bundle on demand instead.
|
|
603
|
-
function isDefaultGoogleClient(id) {
|
|
604
|
-
return id === getDefaultGoogleClient().client_id;
|
|
605
|
-
}
|
|
606
|
-
// ---------------------------------------------------------------------------
|
|
607
|
-
// Token endpoint resolution: bundled-client traffic goes through Jarela's
|
|
608
|
-
// hosted proxy which injects `client_secret` from Secret Manager. BYO traffic
|
|
609
|
-
// goes direct to Google — the user supplied their own secret and the proxy
|
|
610
|
-
// neither has nor wants it. Self-hosters override the proxy URL via
|
|
611
|
-
// JARELA_GOOGLE_TOKEN_PROXY.
|
|
612
|
-
// ---------------------------------------------------------------------------
|
|
613
|
-
const GOOGLE_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token";
|
|
614
|
-
const JARELA_TOKEN_PROXY = process.env.JARELA_GOOGLE_TOKEN_PROXY?.trim() || "https://jarela-oauth-proxy-134669812881.europe-west1.run.app";
|
|
615
|
-
function selectTokenEndpoint(clientId, hasClientSecret) {
|
|
616
|
-
if (isDefaultGoogleClient(clientId) && !hasClientSecret) return JARELA_TOKEN_PROXY;
|
|
617
|
-
return GOOGLE_TOKEN_ENDPOINT;
|
|
618
|
-
}
|
|
619
|
-
// Public re-export for callers that need to mirror the routing decision
|
|
620
|
-
// without going through `getGoogleAccessToken` (e.g. the Gmail health
|
|
621
|
-
// probe, which needs precise HTTP-status-aware error mapping).
|
|
622
|
-
const resolveGoogleTokenEndpoint = selectTokenEndpoint;
|
|
623
|
-
function generatePkce() {
|
|
624
|
-
// 32 random bytes → 43-char base64url string (well within the 43-128 spec).
|
|
625
|
-
const verifier = (0,node_crypto__WEBPACK_IMPORTED_MODULE_0__.randomBytes)(32).toString("base64url");
|
|
626
|
-
const challenge = (0,node_crypto__WEBPACK_IMPORTED_MODULE_0__.createHash)("sha256").update(verifier).digest("base64url");
|
|
627
|
-
return {
|
|
628
|
-
verifier,
|
|
629
|
-
challenge
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
function buildAuthorizeUrl(opts) {
|
|
633
|
-
const p = new URLSearchParams({
|
|
634
|
-
client_id: opts.clientId,
|
|
635
|
-
redirect_uri: opts.redirectUri,
|
|
636
|
-
response_type: "code",
|
|
637
|
-
scope: GMAIL_SCOPES.join(" "),
|
|
638
|
-
access_type: "offline",
|
|
639
|
-
prompt: "consent",
|
|
640
|
-
include_granted_scopes: "true",
|
|
641
|
-
state: opts.state,
|
|
642
|
-
code_challenge: opts.codeChallenge,
|
|
643
|
-
code_challenge_method: "S256"
|
|
644
|
-
});
|
|
645
|
-
return `https://accounts.google.com/o/oauth2/v2/auth?${p.toString()}`;
|
|
646
|
-
}
|
|
647
|
-
async function exchangeCode(opts) {
|
|
648
|
-
const clientId = (0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeOAuthInput */ .d)(opts.clientId) ?? "";
|
|
649
|
-
const clientSecret = opts.clientSecret ? (0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_3__/* .sanitizeOAuthInput */ .d)(opts.clientSecret) ?? "" : "";
|
|
650
|
-
const body = new URLSearchParams({
|
|
651
|
-
code: opts.code,
|
|
652
|
-
client_id: clientId,
|
|
653
|
-
redirect_uri: opts.redirectUri,
|
|
654
|
-
grant_type: "authorization_code",
|
|
655
|
-
code_verifier: opts.codeVerifier
|
|
656
|
-
});
|
|
657
|
-
if (clientSecret) body.set("client_secret", clientSecret);
|
|
658
|
-
const endpoint = selectTokenEndpoint(clientId, Boolean(clientSecret));
|
|
659
|
-
const res = await fetch(endpoint, {
|
|
660
|
-
method: "POST",
|
|
661
|
-
headers: {
|
|
662
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
663
|
-
},
|
|
664
|
-
body: body.toString(),
|
|
665
|
-
signal: AbortSignal.timeout(30000)
|
|
666
|
-
});
|
|
667
|
-
const text = await res.text();
|
|
668
|
-
const parsed = (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_4__/* .parseJsonSafe */ .p)(text, {});
|
|
669
|
-
if (!res.ok) {
|
|
670
|
-
const err = parsed["error_description"] || parsed["error"] || text || `HTTP ${res.status}`;
|
|
671
|
-
console.error(`[gmail-oauth] token exchange rejected (${res.status}): ${err} | client_id ${(0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_3__/* .secretFingerprint */ .n)(clientId)} | client_secret ${(0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_3__/* .secretFingerprint */ .n)(clientSecret)}`);
|
|
672
|
-
throw new Error(err);
|
|
673
|
-
}
|
|
674
|
-
return parsed;
|
|
675
|
-
}
|
|
676
|
-
function resolveGoogleAuth() {
|
|
677
|
-
const envId = process.env.GMAIL_CLIENT_ID;
|
|
678
|
-
const envSecret = process.env.GMAIL_CLIENT_SECRET;
|
|
679
|
-
const envRefresh = process.env.GMAIL_REFRESH_TOKEN;
|
|
680
|
-
if (envId && envSecret && envRefresh) {
|
|
424
|
+
module.exports = require("undici");
|
|
425
|
+
|
|
426
|
+
/***/ }),
|
|
427
|
+
|
|
428
|
+
/***/ 312199:
|
|
429
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
430
|
+
|
|
431
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
432
|
+
/* harmony export */ BQ: () => (/* binding */ readResponseText),
|
|
433
|
+
/* harmony export */ WO: () => (/* binding */ readJsonResponse),
|
|
434
|
+
/* harmony export */ Yn: () => (/* binding */ readResponseTextCapped)
|
|
435
|
+
/* harmony export */ });
|
|
436
|
+
// Node's fetch decodes correctly labelled gzip responses. Some upstreams
|
|
437
|
+
// omit Content-Encoding, so detect and decode raw gzip bodies as a fallback.
|
|
438
|
+
async function readResponseTextCapped(res, maxBytes) {
|
|
439
|
+
if (!res.body) {
|
|
440
|
+
const text = await res.text();
|
|
441
|
+
const bytes = new TextEncoder().encode(text);
|
|
681
442
|
return {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
443
|
+
text: new TextDecoder().decode(bytes.subarray(0, maxBytes)),
|
|
444
|
+
bytesRead: Math.min(bytes.length, maxBytes),
|
|
445
|
+
truncated: bytes.length > maxBytes
|
|
685
446
|
};
|
|
686
447
|
}
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
refresh_token: saved.refresh_token
|
|
697
|
-
};
|
|
448
|
+
const sourceReader = res.body.getReader();
|
|
449
|
+
const prefix = [];
|
|
450
|
+
let prefixBytes = 0;
|
|
451
|
+
let sourceDone = false;
|
|
452
|
+
while(prefixBytes < 2){
|
|
453
|
+
const next = await sourceReader.read();
|
|
454
|
+
if (next.done) {
|
|
455
|
+
sourceDone = true;
|
|
456
|
+
break;
|
|
698
457
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
};
|
|
458
|
+
if (next.value.byteLength === 0) continue;
|
|
459
|
+
prefix.push(next.value);
|
|
460
|
+
prefixBytes += next.value.byteLength;
|
|
703
461
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
const
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
462
|
+
const signature = new Uint8Array(2);
|
|
463
|
+
let signatureBytes = 0;
|
|
464
|
+
for (const chunk of prefix){
|
|
465
|
+
const take = Math.min(signature.length - signatureBytes, chunk.byteLength);
|
|
466
|
+
signature.set(chunk.subarray(0, take), signatureBytes);
|
|
467
|
+
signatureBytes += take;
|
|
468
|
+
if (signatureBytes === signature.length) break;
|
|
469
|
+
}
|
|
470
|
+
const isGzip = signatureBytes === 2 && signature[0] === 0x1f && signature[1] === 0x8b;
|
|
471
|
+
const source = new ReadableStream({
|
|
472
|
+
start (controller) {
|
|
473
|
+
for (const chunk of prefix)controller.enqueue(chunk);
|
|
474
|
+
if (sourceDone) controller.close();
|
|
475
|
+
},
|
|
476
|
+
async pull (controller) {
|
|
477
|
+
const next = await sourceReader.read();
|
|
478
|
+
if (next.done) controller.close();
|
|
479
|
+
else if (next.value) controller.enqueue(next.value);
|
|
480
|
+
},
|
|
481
|
+
cancel (reason) {
|
|
482
|
+
return sourceReader.cancel(reason);
|
|
483
|
+
}
|
|
717
484
|
});
|
|
718
|
-
|
|
719
|
-
const
|
|
485
|
+
const gunzip = new DecompressionStream("gzip");
|
|
486
|
+
const decoded = isGzip ? source.pipeThrough(gunzip) : source;
|
|
487
|
+
const reader = decoded.getReader();
|
|
488
|
+
const limit = Math.max(0, Math.floor(maxBytes));
|
|
489
|
+
const chunks = [];
|
|
490
|
+
let bytesRead = 0;
|
|
491
|
+
let truncated = false;
|
|
720
492
|
try {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
return {
|
|
735
|
-
error: `OAuth token refresh failed (${res.status}): ${text.slice(0, 300)}`
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
const parsed = JSON.parse(text);
|
|
739
|
-
if (!parsed.access_token) return {
|
|
740
|
-
error: "OAuth response missing access_token"
|
|
741
|
-
};
|
|
742
|
-
const expires_at = Date.now() + (parsed.expires_in ?? 3000) * 1000;
|
|
743
|
-
accessTokenCache.set(key, {
|
|
744
|
-
token: parsed.access_token,
|
|
745
|
-
expires_at
|
|
746
|
-
});
|
|
747
|
-
return parsed.access_token;
|
|
748
|
-
} catch (err) {
|
|
749
|
-
return {
|
|
750
|
-
error: `OAuth token refresh threw: ${(0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_6__/* .errorMessage */ .g)(err)}`
|
|
751
|
-
};
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Shared bearer-auth fetch for Google REST APIs (Gmail, Calendar, ...).
|
|
756
|
-
*
|
|
757
|
-
* Behaviour:
|
|
758
|
-
* - Resolves access token from `auth`; if that fails, the error object is
|
|
759
|
-
* surfaced unchanged so callers can pass it back to the agent.
|
|
760
|
-
* - 204 No Content → `{ ok: true }` (used by DELETE endpoints).
|
|
761
|
-
* - Non-2xx response → `{ error: "<service> <status>: <body slice>", url }`.
|
|
762
|
-
* - 2xx with body → parsed JSON if possible, raw text otherwise.
|
|
763
|
-
* - Fetch throws (DNS, abort, timeout) → `{ error: "<service> fetch threw: ..." }`.
|
|
764
|
-
*
|
|
765
|
-
* @param service Short tag used in error messages, e.g. "Gmail" or "Calendar".
|
|
766
|
-
* @param baseUrl Base for relative `path` (e.g. `https://gmail.googleapis.com/gmail/v1/users/me`).
|
|
767
|
-
* @param path Either a full URL (starts with `http`) or path appended to baseUrl.
|
|
768
|
-
*/ async function googleFetch(auth, service, baseUrl, path, init) {
|
|
769
|
-
let target;
|
|
770
|
-
try {
|
|
771
|
-
target = path.startsWith("http") ? new URL(path) : new URL(`${baseUrl}${path}`);
|
|
772
|
-
} catch {
|
|
773
|
-
return {
|
|
774
|
-
error: `${service} request URL is invalid.`
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
let base;
|
|
778
|
-
try {
|
|
779
|
-
base = new URL(baseUrl);
|
|
780
|
-
} catch {
|
|
781
|
-
return {
|
|
782
|
-
error: `${service} API base URL is invalid.`
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
if (target.origin !== base.origin || target.username || target.password) {
|
|
786
|
-
return {
|
|
787
|
-
error: `${service} requests must target ${base.hostname}; refusing to forward credentials.`
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
const url = target.toString();
|
|
791
|
-
const token = await getGoogleAccessToken(auth);
|
|
792
|
-
if (typeof token !== "string") return token;
|
|
793
|
-
try {
|
|
794
|
-
const res = await fetch(url, {
|
|
795
|
-
...init,
|
|
796
|
-
headers: {
|
|
797
|
-
Authorization: `Bearer ${token}`,
|
|
798
|
-
Accept: "application/json",
|
|
799
|
-
"Content-Type": "application/json",
|
|
800
|
-
...init?.headers ?? {}
|
|
801
|
-
},
|
|
802
|
-
signal: AbortSignal.timeout(30000)
|
|
803
|
-
});
|
|
804
|
-
if (res.status === 204) return {
|
|
805
|
-
ok: true
|
|
806
|
-
};
|
|
807
|
-
const text = await (0,_lib_utils_http_json__WEBPACK_IMPORTED_MODULE_5__/* .readResponseText */ .BQ)(res);
|
|
808
|
-
if (!res.ok) {
|
|
809
|
-
return {
|
|
810
|
-
error: `${service} ${res.status}: ${text.slice(0, 500)}`,
|
|
811
|
-
url
|
|
812
|
-
};
|
|
813
|
-
}
|
|
814
|
-
try {
|
|
815
|
-
const parsed = JSON.parse(text);
|
|
816
|
-
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
817
|
-
return parsed;
|
|
818
|
-
}
|
|
819
|
-
} catch {
|
|
820
|
-
// Google REST endpoints used here return JSON objects. Do not pass raw
|
|
821
|
-
// text or binary payloads to callers that expect an object response.
|
|
822
|
-
}
|
|
823
|
-
const magic = Buffer.from(text.slice(0, 4), "latin1").toString("hex");
|
|
824
|
-
const detail = `content-type=${res.headers.get("content-type")}, content-encoding=${res.headers.get("content-encoding")}, length=${text.length}, first-bytes=${magic}`;
|
|
825
|
-
return {
|
|
826
|
-
error: `${service} ${res.status}: expected a JSON object response (${detail})`,
|
|
827
|
-
url
|
|
828
|
-
};
|
|
829
|
-
} catch (err) {
|
|
830
|
-
return {
|
|
831
|
-
error: `${service} fetch threw: ${(0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_6__/* .errorMessage */ .g)(err)}`
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
/***/ }),
|
|
838
|
-
|
|
839
|
-
/***/ 200261:
|
|
840
|
-
/***/ ((module) => {
|
|
841
|
-
|
|
842
|
-
module.exports = require("next/dist/shared/lib/router/utils/app-paths");
|
|
843
|
-
|
|
844
|
-
/***/ }),
|
|
845
|
-
|
|
846
|
-
/***/ 253638:
|
|
847
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
848
|
-
|
|
849
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
850
|
-
/* harmony export */ p: () => (/* binding */ parseJsonSafe)
|
|
851
|
-
/* harmony export */ });
|
|
852
|
-
// JSON.parse with a fallback value when the input is malformed (or empty).
|
|
853
|
-
// Used everywhere we read responses from external APIs — they're contractually
|
|
854
|
-
// JSON but a transient 502 / proxy interstitial occasionally returns HTML.
|
|
855
|
-
function parseJsonSafe(text, fallback) {
|
|
856
|
-
try {
|
|
857
|
-
return JSON.parse(text);
|
|
858
|
-
} catch {
|
|
859
|
-
return fallback;
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
/***/ }),
|
|
865
|
-
|
|
866
|
-
/***/ 257975:
|
|
867
|
-
/***/ ((module) => {
|
|
868
|
-
|
|
869
|
-
module.exports = require("node:util");
|
|
870
|
-
|
|
871
|
-
/***/ }),
|
|
872
|
-
|
|
873
|
-
/***/ 309956:
|
|
874
|
-
/***/ ((module) => {
|
|
875
|
-
|
|
876
|
-
module.exports = require("undici");
|
|
877
|
-
|
|
878
|
-
/***/ }),
|
|
879
|
-
|
|
880
|
-
/***/ 312199:
|
|
881
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
882
|
-
|
|
883
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
884
|
-
/* harmony export */ BQ: () => (/* binding */ readResponseText),
|
|
885
|
-
/* harmony export */ WO: () => (/* binding */ readJsonResponse),
|
|
886
|
-
/* harmony export */ Yn: () => (/* binding */ readResponseTextCapped)
|
|
887
|
-
/* harmony export */ });
|
|
888
|
-
// Node's fetch decodes correctly labelled gzip responses. Some upstreams
|
|
889
|
-
// omit Content-Encoding, so detect and decode raw gzip bodies as a fallback.
|
|
890
|
-
async function readResponseTextCapped(res, maxBytes) {
|
|
891
|
-
if (!res.body) {
|
|
892
|
-
const text = await res.text();
|
|
893
|
-
const bytes = new TextEncoder().encode(text);
|
|
894
|
-
return {
|
|
895
|
-
text: new TextDecoder().decode(bytes.subarray(0, maxBytes)),
|
|
896
|
-
bytesRead: Math.min(bytes.length, maxBytes),
|
|
897
|
-
truncated: bytes.length > maxBytes
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
const sourceReader = res.body.getReader();
|
|
901
|
-
const prefix = [];
|
|
902
|
-
let prefixBytes = 0;
|
|
903
|
-
let sourceDone = false;
|
|
904
|
-
while(prefixBytes < 2){
|
|
905
|
-
const next = await sourceReader.read();
|
|
906
|
-
if (next.done) {
|
|
907
|
-
sourceDone = true;
|
|
908
|
-
break;
|
|
909
|
-
}
|
|
910
|
-
if (next.value.byteLength === 0) continue;
|
|
911
|
-
prefix.push(next.value);
|
|
912
|
-
prefixBytes += next.value.byteLength;
|
|
913
|
-
}
|
|
914
|
-
const signature = new Uint8Array(2);
|
|
915
|
-
let signatureBytes = 0;
|
|
916
|
-
for (const chunk of prefix){
|
|
917
|
-
const take = Math.min(signature.length - signatureBytes, chunk.byteLength);
|
|
918
|
-
signature.set(chunk.subarray(0, take), signatureBytes);
|
|
919
|
-
signatureBytes += take;
|
|
920
|
-
if (signatureBytes === signature.length) break;
|
|
921
|
-
}
|
|
922
|
-
const isGzip = signatureBytes === 2 && signature[0] === 0x1f && signature[1] === 0x8b;
|
|
923
|
-
const source = new ReadableStream({
|
|
924
|
-
start (controller) {
|
|
925
|
-
for (const chunk of prefix)controller.enqueue(chunk);
|
|
926
|
-
if (sourceDone) controller.close();
|
|
927
|
-
},
|
|
928
|
-
async pull (controller) {
|
|
929
|
-
const next = await sourceReader.read();
|
|
930
|
-
if (next.done) controller.close();
|
|
931
|
-
else if (next.value) controller.enqueue(next.value);
|
|
932
|
-
},
|
|
933
|
-
cancel (reason) {
|
|
934
|
-
return sourceReader.cancel(reason);
|
|
935
|
-
}
|
|
936
|
-
});
|
|
937
|
-
const gunzip = new DecompressionStream("gzip");
|
|
938
|
-
const decoded = isGzip ? source.pipeThrough(gunzip) : source;
|
|
939
|
-
const reader = decoded.getReader();
|
|
940
|
-
const limit = Math.max(0, Math.floor(maxBytes));
|
|
941
|
-
const chunks = [];
|
|
942
|
-
let bytesRead = 0;
|
|
943
|
-
let truncated = false;
|
|
944
|
-
try {
|
|
945
|
-
while(true){
|
|
946
|
-
const next = await reader.read();
|
|
947
|
-
if (next.done) break;
|
|
948
|
-
if (!next.value.byteLength) continue;
|
|
949
|
-
const remaining = limit - bytesRead;
|
|
950
|
-
const kept = Math.min(remaining, next.value.byteLength);
|
|
951
|
-
if (kept > 0) chunks.push(next.value.subarray(0, kept));
|
|
952
|
-
bytesRead += kept;
|
|
953
|
-
if (kept < next.value.byteLength) {
|
|
954
|
-
truncated = true;
|
|
955
|
-
await reader.cancel();
|
|
956
|
-
break;
|
|
957
|
-
}
|
|
493
|
+
while(true){
|
|
494
|
+
const next = await reader.read();
|
|
495
|
+
if (next.done) break;
|
|
496
|
+
if (!next.value.byteLength) continue;
|
|
497
|
+
const remaining = limit - bytesRead;
|
|
498
|
+
const kept = Math.min(remaining, next.value.byteLength);
|
|
499
|
+
if (kept > 0) chunks.push(next.value.subarray(0, kept));
|
|
500
|
+
bytesRead += kept;
|
|
501
|
+
if (kept < next.value.byteLength) {
|
|
502
|
+
truncated = true;
|
|
503
|
+
await reader.cancel();
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
958
506
|
}
|
|
959
507
|
} catch (error) {
|
|
960
508
|
if (isGzip) throw new Error("Gzip response could not be decompressed.", {
|
|
@@ -1297,6 +845,458 @@ module.exports = require("node:net");
|
|
|
1297
845
|
|
|
1298
846
|
module.exports = require("http");
|
|
1299
847
|
|
|
848
|
+
/***/ }),
|
|
849
|
+
|
|
850
|
+
/***/ 804576:
|
|
851
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
852
|
+
|
|
853
|
+
__webpack_require__.r(__webpack_exports__);
|
|
854
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
855
|
+
/* harmony export */ handler: () => (/* binding */ handler),
|
|
856
|
+
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
857
|
+
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
858
|
+
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
859
|
+
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
860
|
+
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
861
|
+
/* harmony export */ });
|
|
862
|
+
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319225);
|
|
863
|
+
/* 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__);
|
|
864
|
+
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(684006);
|
|
865
|
+
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
866
|
+
/* 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__);
|
|
867
|
+
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(799373);
|
|
868
|
+
/* 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__);
|
|
869
|
+
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(434775);
|
|
870
|
+
/* 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__);
|
|
871
|
+
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(524235);
|
|
872
|
+
/* 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__);
|
|
873
|
+
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(200261);
|
|
874
|
+
/* 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__);
|
|
875
|
+
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(754365);
|
|
876
|
+
/* 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__);
|
|
877
|
+
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(590771);
|
|
878
|
+
/* 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__);
|
|
879
|
+
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(473461);
|
|
880
|
+
/* 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__);
|
|
881
|
+
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(767798);
|
|
882
|
+
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(192280);
|
|
883
|
+
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(662018);
|
|
884
|
+
/* 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__);
|
|
885
|
+
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(445696);
|
|
886
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(347929);
|
|
887
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
888
|
+
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(986439);
|
|
889
|
+
/* 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__);
|
|
890
|
+
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(710246);
|
|
891
|
+
/* 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__);
|
|
892
|
+
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(137527);
|
|
893
|
+
/* 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__);
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
// We inject the nextConfigOutput here so that we can use them in the route
|
|
913
|
+
// module.
|
|
914
|
+
const nextConfigOutput = "standalone"
|
|
915
|
+
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
916
|
+
definition: {
|
|
917
|
+
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
918
|
+
page: "/api/v1/integrations/gmail/oauth/start/route",
|
|
919
|
+
pathname: "/api/v1/integrations/gmail/oauth/start",
|
|
920
|
+
filename: "route",
|
|
921
|
+
bundlePath: "app/api/v1/integrations/gmail/oauth/start/route"
|
|
922
|
+
},
|
|
923
|
+
distDir: ".next" || 0,
|
|
924
|
+
relativeProjectDir: false || '',
|
|
925
|
+
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/integrations/gmail/oauth/start/route.ts",
|
|
926
|
+
nextConfigOutput,
|
|
927
|
+
// The lazy require factory ensures that:
|
|
928
|
+
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
929
|
+
// correctly attributing module load time to application-code rather than
|
|
930
|
+
// framework internals.
|
|
931
|
+
// - In all modes: async modules (route files with top-level await) are
|
|
932
|
+
// handled correctly — require() returns a Promise for such modules, which
|
|
933
|
+
// ensureUserland() awaits before the first request is handled.
|
|
934
|
+
userland: ()=>__webpack_require__(722158),
|
|
935
|
+
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
936
|
+
// server HMR updates are picked up without re-executing the entry chunk.
|
|
937
|
+
// Using require() (synchronous) avoids adding async overhead that would be
|
|
938
|
+
// incorrectly attributed to application-code time in devRequestTiming.
|
|
939
|
+
... false ? 0 : {}
|
|
940
|
+
});
|
|
941
|
+
// Pull out the exports that we need to expose from the module. This should
|
|
942
|
+
// be eliminated when we've moved the other routes to the new format. These
|
|
943
|
+
// are used to hook into the route.
|
|
944
|
+
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
945
|
+
function patchFetch() {
|
|
946
|
+
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
947
|
+
workAsyncStorage,
|
|
948
|
+
workUnitAsyncStorage
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
async function handler(req, res, ctx) {
|
|
953
|
+
if (ctx.requestMeta) {
|
|
954
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
|
|
955
|
+
}
|
|
956
|
+
if (routeModule.isDev) {
|
|
957
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
|
958
|
+
}
|
|
959
|
+
let srcPage = "/api/v1/integrations/gmail/oauth/start/route";
|
|
960
|
+
// turbopack doesn't normalize `/index` in the page name
|
|
961
|
+
// so we need to to process dynamic routes properly
|
|
962
|
+
// TODO: fix turbopack providing differing value from webpack
|
|
963
|
+
if (false) {} else if (srcPage === '/index') {
|
|
964
|
+
// we always normalize /index specifically
|
|
965
|
+
srcPage = '/';
|
|
966
|
+
}
|
|
967
|
+
const multiZoneDraftMode = false;
|
|
968
|
+
// Registering `instrumentation.ts` usually installs the tracer provider, so
|
|
969
|
+
// do it before starting the request span. The span is started before
|
|
970
|
+
// `prepare`, so route module preparation is part of the request's trace.
|
|
971
|
+
// When this request triggers registration, the lifecycle spans of
|
|
972
|
+
// `instrumentation.ts` are emitted inside the request span.
|
|
973
|
+
const { instrumentation } = await routeModule.ensureInstrumentation(req, {
|
|
974
|
+
deferSpans: true
|
|
975
|
+
});
|
|
976
|
+
return routeModule.traceRequest(req, {
|
|
977
|
+
tracer: (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)(),
|
|
978
|
+
spanName: `${req.method || 'GET'} ${srcPage}`,
|
|
979
|
+
httpTarget: req.url,
|
|
980
|
+
instrumentation
|
|
981
|
+
}, (requestSpan, requestRootSpan)=>handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan));
|
|
982
|
+
}
|
|
983
|
+
async function handleRequest(req, res, ctx, srcPage, multiZoneDraftMode, requestSpan, requestRootSpan) {
|
|
984
|
+
const prepareResult = await routeModule.prepare(req, res, {
|
|
985
|
+
srcPage,
|
|
986
|
+
multiZoneDraftMode
|
|
987
|
+
});
|
|
988
|
+
if (!prepareResult) {
|
|
989
|
+
res.statusCode = 400;
|
|
990
|
+
res.end('Bad Request');
|
|
991
|
+
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
|
992
|
+
return null;
|
|
993
|
+
}
|
|
994
|
+
const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
|
|
995
|
+
const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
|
|
996
|
+
// Only this route's prerenders can establish ISR or admit generated params.
|
|
997
|
+
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]));
|
|
998
|
+
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
999
|
+
const render404 = async ()=>{
|
|
1000
|
+
// TODO: should route-module itself handle rendering the 404
|
|
1001
|
+
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
1002
|
+
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
1003
|
+
} else {
|
|
1004
|
+
res.end('This page could not be found');
|
|
1005
|
+
}
|
|
1006
|
+
return null;
|
|
1007
|
+
};
|
|
1008
|
+
if (isIsr && !isDraftMode) {
|
|
1009
|
+
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
1010
|
+
if (prerenderInfo) {
|
|
1011
|
+
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
1012
|
+
if (nextConfig.adapterPath) {
|
|
1013
|
+
return await render404();
|
|
1014
|
+
}
|
|
1015
|
+
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
let cacheKey = null;
|
|
1020
|
+
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
1021
|
+
cacheKey = resolvedPathname;
|
|
1022
|
+
// ensure /index and / is normalized to one key
|
|
1023
|
+
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
1024
|
+
}
|
|
1025
|
+
// Before rendering (which initializes component tree modules), we have to
|
|
1026
|
+
// set the reference manifests to our global store so Server Action's
|
|
1027
|
+
// encryption util can access to them at the top level of the page module.
|
|
1028
|
+
if (serverActionsManifest && clientReferenceManifest) {
|
|
1029
|
+
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
1030
|
+
page: srcPage,
|
|
1031
|
+
clientReferenceManifest,
|
|
1032
|
+
serverActionsManifest
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
const method = req.method || 'GET';
|
|
1036
|
+
const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
|
|
1037
|
+
const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
|
|
1038
|
+
const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
|
|
1039
|
+
const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
|
|
1040
|
+
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
1041
|
+
globalThis.__incrementalCache = incrementalCache;
|
|
1042
|
+
const context = {
|
|
1043
|
+
params,
|
|
1044
|
+
previewProps,
|
|
1045
|
+
renderOpts: {
|
|
1046
|
+
experimental: {
|
|
1047
|
+
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
1048
|
+
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
1049
|
+
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
1050
|
+
},
|
|
1051
|
+
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
1052
|
+
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
1053
|
+
isDraftMode,
|
|
1054
|
+
incrementalCache,
|
|
1055
|
+
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
1056
|
+
cacheLifeProfiles: nextConfig.cacheLife,
|
|
1057
|
+
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
1058
|
+
waitUntil: ctx.waitUntil,
|
|
1059
|
+
onClose: (cb)=>{
|
|
1060
|
+
res.on('close', cb);
|
|
1061
|
+
},
|
|
1062
|
+
onAfterTaskError: undefined
|
|
1063
|
+
},
|
|
1064
|
+
sharedContext: {
|
|
1065
|
+
buildId,
|
|
1066
|
+
deploymentId
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
1070
|
+
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
1071
|
+
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));
|
|
1072
|
+
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
1073
|
+
try {
|
|
1074
|
+
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
1075
|
+
res.statusCode = 404;
|
|
1076
|
+
// on-demand revalidate always sets this header
|
|
1077
|
+
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
1078
|
+
res.end('This page could not be found');
|
|
1079
|
+
return null;
|
|
1080
|
+
}
|
|
1081
|
+
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
1082
|
+
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
1083
|
+
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
1084
|
+
// Attempt using provided waitUntil if available
|
|
1085
|
+
// if it's not we fallback to sendResponse's handling
|
|
1086
|
+
if (pendingWaitUntil) {
|
|
1087
|
+
if (ctx.waitUntil) {
|
|
1088
|
+
ctx.waitUntil(pendingWaitUntil);
|
|
1089
|
+
pendingWaitUntil = undefined;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
const cacheTags = context.renderOpts.collectedTags;
|
|
1093
|
+
// If the request is for a static response, we can cache it so long
|
|
1094
|
+
// as it's not edge.
|
|
1095
|
+
if (isIsr) {
|
|
1096
|
+
const blob = await response.blob();
|
|
1097
|
+
// Copy the headers from the response.
|
|
1098
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
1099
|
+
if (cacheTags) {
|
|
1100
|
+
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
1101
|
+
}
|
|
1102
|
+
if (!headers['content-type'] && blob.type) {
|
|
1103
|
+
headers['content-type'] = blob.type;
|
|
1104
|
+
}
|
|
1105
|
+
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
1106
|
+
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
|
|
1107
|
+
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
1108
|
+
// build-time fallback in `build/index.ts` so cache entries
|
|
1109
|
+
// and the response Cache-Control header agree on the route's
|
|
1110
|
+
// effective expire. Routes that opt out of revalidation
|
|
1111
|
+
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
1112
|
+
// keep `expire: undefined`.
|
|
1113
|
+
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
1114
|
+
// Create the cache entry for the response.
|
|
1115
|
+
const cacheEntry = {
|
|
1116
|
+
value: {
|
|
1117
|
+
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
1118
|
+
status: response.status,
|
|
1119
|
+
body: Buffer.from(await blob.arrayBuffer()),
|
|
1120
|
+
headers
|
|
1121
|
+
},
|
|
1122
|
+
cacheControl: {
|
|
1123
|
+
revalidate,
|
|
1124
|
+
expire
|
|
1125
|
+
}
|
|
1126
|
+
};
|
|
1127
|
+
return cacheEntry;
|
|
1128
|
+
} else {
|
|
1129
|
+
// send response without caching if not ISR
|
|
1130
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
1131
|
+
return null;
|
|
1132
|
+
}
|
|
1133
|
+
} catch (err) {
|
|
1134
|
+
// if this is a background revalidate we need to report
|
|
1135
|
+
// the request error here as it won't be bubbled
|
|
1136
|
+
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
1137
|
+
const silenceLog = false;
|
|
1138
|
+
await routeModule.onRequestError(req, err, {
|
|
1139
|
+
routerKind: 'App Router',
|
|
1140
|
+
routePath: srcPage,
|
|
1141
|
+
routeType: 'route',
|
|
1142
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1143
|
+
isStaticGeneration: cacheKey !== null,
|
|
1144
|
+
isOnDemandRevalidate
|
|
1145
|
+
})
|
|
1146
|
+
}, silenceLog, routerServerContext);
|
|
1147
|
+
}
|
|
1148
|
+
throw err;
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
const handleResponse = async (currentSpan)=>{
|
|
1152
|
+
try {
|
|
1153
|
+
var _cacheEntry_value;
|
|
1154
|
+
const cacheEntry = await routeModule.handleResponse({
|
|
1155
|
+
req,
|
|
1156
|
+
nextConfig,
|
|
1157
|
+
cacheKey,
|
|
1158
|
+
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
1159
|
+
isFallback: false,
|
|
1160
|
+
previewProps,
|
|
1161
|
+
prerenderManifest,
|
|
1162
|
+
isRoutePPREnabled: false,
|
|
1163
|
+
isOnDemandRevalidate,
|
|
1164
|
+
revalidateOnlyGenerated,
|
|
1165
|
+
responseGenerator,
|
|
1166
|
+
waitUntil: ctx.waitUntil,
|
|
1167
|
+
isMinimalMode
|
|
1168
|
+
});
|
|
1169
|
+
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
1170
|
+
throw cacheEntry.error;
|
|
1171
|
+
}
|
|
1172
|
+
// we don't create a cacheEntry for ISR
|
|
1173
|
+
if (!isIsr) {
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
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) {
|
|
1177
|
+
var _cacheEntry_value1;
|
|
1178
|
+
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
1179
|
+
}
|
|
1180
|
+
if (!isMinimalMode) {
|
|
1181
|
+
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
1182
|
+
}
|
|
1183
|
+
// Draft mode should never be cached
|
|
1184
|
+
if (isDraftMode) {
|
|
1185
|
+
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
1186
|
+
}
|
|
1187
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
1188
|
+
if (!(isMinimalMode && isIsr)) {
|
|
1189
|
+
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
1190
|
+
}
|
|
1191
|
+
// If cache control is already set on the response we don't
|
|
1192
|
+
// override it to allow users to customize it via next.config
|
|
1193
|
+
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
1194
|
+
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
1195
|
+
}
|
|
1196
|
+
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'.
|
|
1197
|
+
new Response(cacheEntry.value.body, {
|
|
1198
|
+
headers,
|
|
1199
|
+
status: cacheEntry.value.status || 200
|
|
1200
|
+
}));
|
|
1201
|
+
return;
|
|
1202
|
+
} catch (err) {
|
|
1203
|
+
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
1204
|
+
const silenceLog = false;
|
|
1205
|
+
await routeModule.onRequestError(req, err, {
|
|
1206
|
+
routerKind: 'App Router',
|
|
1207
|
+
routePath: normalizedSrcPage,
|
|
1208
|
+
routeType: 'route',
|
|
1209
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1210
|
+
isStaticGeneration: cacheKey !== null,
|
|
1211
|
+
isOnDemandRevalidate
|
|
1212
|
+
})
|
|
1213
|
+
}, silenceLog, routerServerContext);
|
|
1214
|
+
}
|
|
1215
|
+
// rethrow so that we can handle serving error page
|
|
1216
|
+
// If this is during static generation, throw the error again.
|
|
1217
|
+
if (isIsr) throw err;
|
|
1218
|
+
// Otherwise, send a 500 response unless the original response has
|
|
1219
|
+
// already committed. In that case, preserve its status code for
|
|
1220
|
+
// telemetry while still recording the failure and terminating a response
|
|
1221
|
+
// that the failed pipeline left open.
|
|
1222
|
+
if (res.headersSent) {
|
|
1223
|
+
if (currentSpan) {
|
|
1224
|
+
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
1225
|
+
currentSpan.recordException(error);
|
|
1226
|
+
currentSpan.setStatus({
|
|
1227
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
1228
|
+
message: error.message
|
|
1229
|
+
});
|
|
1230
|
+
currentSpan.setAttribute('error.type', error.name);
|
|
1231
|
+
}
|
|
1232
|
+
if (!res.writableEnded && !res.destroyed) {
|
|
1233
|
+
res.end();
|
|
1234
|
+
}
|
|
1235
|
+
} else {
|
|
1236
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
1237
|
+
status: 500
|
|
1238
|
+
}));
|
|
1239
|
+
}
|
|
1240
|
+
return;
|
|
1241
|
+
} finally{
|
|
1242
|
+
;
|
|
1243
|
+
(()=>{
|
|
1244
|
+
if (!currentSpan) {
|
|
1245
|
+
return;
|
|
1246
|
+
}
|
|
1247
|
+
let statusCode = res.statusCode;
|
|
1248
|
+
currentSpan.setAttributes({
|
|
1249
|
+
'http.status_code': statusCode,
|
|
1250
|
+
'next.rsc': false
|
|
1251
|
+
});
|
|
1252
|
+
if (statusCode && statusCode >= 500) {
|
|
1253
|
+
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
1254
|
+
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
1255
|
+
currentSpan.setStatus({
|
|
1256
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
1257
|
+
});
|
|
1258
|
+
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
1259
|
+
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
1260
|
+
}
|
|
1261
|
+
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
1262
|
+
// We were unable to get attributes, probably OTEL is not enabled
|
|
1263
|
+
if (!rootSpanAttributes) {
|
|
1264
|
+
return;
|
|
1265
|
+
}
|
|
1266
|
+
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
1267
|
+
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
1268
|
+
return;
|
|
1269
|
+
}
|
|
1270
|
+
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
1271
|
+
const name = `${method} ${route}`;
|
|
1272
|
+
currentSpan.setAttributes({
|
|
1273
|
+
'next.route': route,
|
|
1274
|
+
'http.route': route,
|
|
1275
|
+
'next.span_name': name
|
|
1276
|
+
});
|
|
1277
|
+
currentSpan.updateName(name);
|
|
1278
|
+
// Propagate http.route to the request's root span if it isn't the
|
|
1279
|
+
// request span (e.g. a platform-created HTTP span in adapter
|
|
1280
|
+
// deployments).
|
|
1281
|
+
if (requestRootSpan && requestRootSpan !== currentSpan) {
|
|
1282
|
+
requestRootSpan.setAttribute('http.route', route);
|
|
1283
|
+
requestRootSpan.updateName(name);
|
|
1284
|
+
}
|
|
1285
|
+
})();
|
|
1286
|
+
}
|
|
1287
|
+
};
|
|
1288
|
+
// When invoked directly, the request span was started before `prepare`;
|
|
1289
|
+
// record the request target as normalized by it. next-server's request span
|
|
1290
|
+
// already has it.
|
|
1291
|
+
if (!isWrappedByNextServer && req.url !== undefined) {
|
|
1292
|
+
requestSpan == null ? void 0 : requestSpan.setAttribute('http.target', req.url);
|
|
1293
|
+
}
|
|
1294
|
+
await handleResponse(requestSpan);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
//# sourceMappingURL=app-route.js.map
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
1300
|
/***/ }),
|
|
1301
1301
|
|
|
1302
1302
|
/***/ 848161:
|
|
@@ -1436,7 +1436,7 @@ module.exports = require("next/dist/shared/lib/no-fallback-error.external");
|
|
|
1436
1436
|
var __webpack_require__ = require("../../../../../../../webpack-runtime.js");
|
|
1437
1437
|
__webpack_require__.C(exports);
|
|
1438
1438
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
1439
|
-
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,4891,4992,1244], () => (__webpack_exec__(
|
|
1439
|
+
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,4891,4992,1244], () => (__webpack_exec__(804576)));
|
|
1440
1440
|
module.exports = __webpack_exports__;
|
|
1441
1441
|
|
|
1442
1442
|
})();
|