@circuitwall/jarela 2.2.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +2 -1
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +8 -0
- package/.next/standalone/.next/server/app/_global-error/page.js +68 -68
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +76 -76
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +100 -93
- package/.next/standalone/.next/server/app/api/v1/access/route.js +176 -169
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +89 -56
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +139 -127
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +107 -100
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +765 -753
- package/.next/standalone/.next/server/app/api/v1/agents/route.js +72 -65
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +371 -364
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +809 -802
- package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +9 -2
- package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +49 -49
- package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +910 -910
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +583 -16
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +41 -30
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +48 -37
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +697 -130
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +703 -136
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +796 -229
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +762 -746
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +1050 -1034
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +673 -106
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +811 -804
- package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js +718 -706
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/config/route.js +85 -85
- package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +709 -709
- package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/credentials/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +10 -10
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +796 -784
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +30 -23
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +86 -86
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +57 -57
- package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +385 -378
- package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +65 -65
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +122 -122
- package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/env/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +375 -368
- package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/events/route.js +745 -178
- package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/events/test/route.js +77 -77
- package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +763 -763
- package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +16 -9
- package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +72 -65
- package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +41 -34
- package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +211 -204
- package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +140 -133
- package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +113 -106
- package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +121 -114
- package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +141 -134
- package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +690 -690
- package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +93 -93
- package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/route.js +185 -185
- package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +171 -171
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +396 -396
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +212 -212
- package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +235 -235
- package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +26 -26
- package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +228 -221
- package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +65 -58
- package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +79 -72
- package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/health/route.js +783 -771
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +140 -133
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +370 -363
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +240 -233
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +689 -682
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +886 -879
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +115 -108
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +955 -948
- package/.next/standalone/.next/server/app/api/v1/integrations/route.js +223 -216
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +876 -847
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/local-file/route.js +26 -26
- package/.next/standalone/.next/server/app/api/v1/logs/route.js +70 -70
- package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +79 -72
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +991 -979
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +196 -196
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +19 -7
- package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +539 -532
- package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +86 -79
- package/.next/standalone/.next/server/app/api/v1/memory/route.js +58 -51
- package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +138 -131
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +381 -369
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +150 -143
- package/.next/standalone/.next/server/app/api/v1/models/route.js +634 -627
- package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +445 -445
- package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +120 -120
- package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +234 -234
- package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +407 -407
- package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +37 -37
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +107 -107
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +228 -228
- package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +9 -9
- package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/packages/route.js +148 -148
- package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +787 -787
- package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +529 -514
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +181 -181
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +258 -258
- package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +37 -30
- package/.next/standalone/.next/server/app/api/v1/profile/route.js +171 -164
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +51 -44
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +15 -8
- package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +171 -164
- package/.next/standalone/.next/server/app/api/v1/providers/route.js +101 -94
- package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +457 -450
- package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +44 -37
- package/.next/standalone/.next/server/app/api/v1/redaction/route.js +65 -58
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +617 -605
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +44 -44
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +739 -732
- package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +329 -322
- package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +204 -197
- package/.next/standalone/.next/server/app/api/v1/security/state/route.js +58 -51
- package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +183 -176
- package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +194 -187
- package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +26 -26
- package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +776 -769
- package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +122 -115
- package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +334 -327
- package/.next/standalone/.next/server/app/api/v1/skills/route.js +873 -866
- package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +838 -808
- package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +177 -177
- package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +164 -164
- package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +122 -115
- package/.next/standalone/.next/server/app/api/v1/tasks/route.js +30 -23
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +1436 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +638 -631
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +60 -439
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +172 -173
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/threads/route.js +925 -913
- package/.next/standalone/.next/server/app/api/v1/tools/route.js +2 -2
- package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +17 -17
- package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/update/route.js +570 -570
- package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +241 -229
- package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +989 -977
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +40 -28
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +72 -72
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +128 -128
- package/.next/standalone/.next/server/app/api/v1/watchers/route.js +164 -164
- package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/icon.svg/route.js +62 -62
- package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +436 -436
- package/.next/standalone/.next/server/app/page.js +1179 -743
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup/page.js +99 -91
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +2 -1
- package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +441 -1022
- package/.next/standalone/.next/server/chunks/1433.js +1 -1
- package/.next/standalone/.next/server/chunks/1638.js +1 -2
- package/.next/standalone/.next/server/chunks/1738.js +1 -1
- package/.next/standalone/.next/server/chunks/2068.js +47 -10
- package/.next/standalone/.next/server/chunks/210.js +3 -3
- package/.next/standalone/.next/server/chunks/2151.js +31 -1
- package/.next/standalone/.next/server/chunks/2207.js +1 -0
- package/.next/standalone/.next/server/chunks/2447.js +10 -5
- package/.next/standalone/.next/server/chunks/2471.js +45 -45
- package/.next/standalone/.next/server/chunks/2504.js +1 -1
- package/.next/standalone/.next/server/chunks/2695.js +17 -17
- package/.next/standalone/.next/server/chunks/3042.js +24 -16
- package/.next/standalone/.next/server/chunks/{4540.js → 309.js} +104 -38
- package/.next/standalone/.next/server/chunks/{2350.js → 3272.js} +104 -37
- package/.next/standalone/.next/server/chunks/3399.js +526 -526
- package/.next/standalone/.next/server/chunks/3524.js +150 -67
- package/.next/standalone/.next/server/chunks/3566.js +1 -1
- package/.next/standalone/.next/server/chunks/4189.js +946 -0
- package/.next/standalone/.next/server/chunks/4433.js +146 -146
- package/.next/standalone/.next/server/chunks/4508.js +3 -3
- package/.next/standalone/.next/server/chunks/4588.js +1 -0
- package/.next/standalone/.next/server/chunks/46.js +78 -28
- package/.next/standalone/.next/server/chunks/466.js +12 -0
- package/.next/standalone/.next/server/chunks/4868.js +206 -206
- package/.next/standalone/.next/server/chunks/4992.js +13 -0
- package/.next/standalone/.next/server/chunks/5120.js +963 -0
- package/.next/standalone/.next/server/chunks/5701.js +1 -1
- package/.next/standalone/.next/server/chunks/5900.js +1 -1
- package/.next/standalone/.next/server/chunks/5908.js +63 -42
- package/.next/standalone/.next/server/chunks/6142.js +10 -2
- package/.next/standalone/.next/server/chunks/6210.js +1 -0
- package/.next/standalone/.next/server/chunks/6213.js +1 -1
- package/.next/standalone/.next/server/chunks/6649.js +3 -3
- package/.next/standalone/.next/server/chunks/6703.js +3 -3
- package/.next/standalone/.next/server/chunks/7445.js +1 -0
- package/.next/standalone/.next/server/chunks/8067.js +12 -0
- package/.next/standalone/.next/server/chunks/8461.js +24 -17
- package/.next/standalone/.next/server/chunks/8558.js +1 -1
- package/.next/standalone/.next/server/chunks/8724.js +1 -1
- package/.next/standalone/.next/server/chunks/8849.js +91 -91
- package/.next/standalone/.next/server/chunks/9032.js +4 -3
- package/.next/standalone/.next/server/chunks/{2563.js → 9164.js} +33389 -31418
- package/.next/standalone/.next/server/chunks/9237.js +396 -396
- package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1672 -575
- package/.next/standalone/.next/server/chunks/9406.js +1 -1
- package/.next/standalone/.next/server/chunks/9590.js +68 -18
- package/.next/standalone/.next/server/chunks/9824.js +98 -98
- package/.next/standalone/.next/server/chunks/9826.js +1 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
- package/.next/standalone/.next/server/middleware.js +486 -415
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{1395-a340fb0a345382a4.js → 1395-e4a99912b8f83044.js} +13 -1
- package/.next/standalone/.next/static/chunks/app/_global-error/{page-36cb8b428b38b26a.js → page-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/access/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/{page-7017f07f8a7a083c.js → page-04748847c6ff866f.js} +1013 -585
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/css/{d80058f0b9b41c09.css → 2669e8744cc8c212.css} +2 -2
- package/.next/standalone/docs/adoption/changesets.json +358 -0
- package/.next/standalone/lib/skills/builtins/memory-organization/SKILL.md +16 -0
- package/.next/standalone/package.json +3 -3
- package/CHANGELOG.md +44 -0
- package/api/client.ts +9 -0
- package/api/types.ts +29 -0
- package/app/api/v1/lifecycle/adoption/route.ts +14 -2
- package/app/api/v1/models/[name]/compact-threads/route.ts +14 -11
- package/app/api/v1/threads/[thread_id]/activity/route.ts +19 -0
- package/app/api/v1/threads/[thread_id]/context-pin/route.test.ts +1 -0
- package/app/api/v1/threads/[thread_id]/context-pin/route.ts +2 -1
- package/app/api/v1/threads/[thread_id]/route.ts +5 -1
- package/app/api/v1/threads/[thread_id]/run/route.ts +0 -1
- package/components/chat/ChatView.tsx +52 -11
- package/components/chat/ContextBoundary.test.tsx +68 -1
- package/components/chat/ContextBoundary.tsx +92 -13
- package/components/chat/MessageBubble.tsx +12 -0
- package/components/chat/MessageList.test.tsx +31 -0
- package/components/chat/MessageList.tsx +49 -28
- package/components/chat/ToolList.test.tsx +92 -16
- package/components/chat/ToolList.tsx +59 -4
- package/components/chat/chat-helpers.test.tsx +24 -1
- package/components/chat/chat-helpers.ts +47 -4
- package/components/chat/useThreadActivity.test.tsx +113 -0
- package/components/chat/useThreadActivity.ts +94 -0
- package/components/chat/useThreadData.ts +16 -16
- package/components/chat/workflow-step-retry.ts +25 -0
- package/components/integrations/NetworkSection.tsx +2 -2
- package/components/ui/BootScreen.tsx +17 -0
- package/components/ui/WorkflowChecklist.tsx +71 -33
- package/hooks/useSSE.ts +28 -3
- package/lib/agents/citation-checker.test.ts +40 -2
- package/lib/agents/citation-checker.ts +56 -11
- package/lib/agents/compaction-pipeline.test.ts +202 -0
- package/lib/agents/compaction-pipeline.ts +483 -0
- package/lib/agents/context-boundary.ts +5 -6
- package/lib/agents/conversation-summary.ts +37 -21
- package/lib/agents/instruction-edits.test.ts +120 -0
- package/lib/agents/instruction-edits.ts +65 -42
- package/lib/agents/prepare/history-window.test.ts +18 -0
- package/lib/agents/prepare/history-window.ts +11 -2
- package/lib/agents/prepare/request.ts +4 -2
- package/lib/agents/prepare/system-prompt.test.ts +49 -0
- package/lib/agents/prepare/system-prompt.ts +16 -5
- package/lib/agents/prompt-registry.test.ts +5 -140
- package/lib/agents/prompt-registry.ts +45 -1
- package/lib/agents/prompt-variants.ts +146 -0
- package/lib/agents/proposals.test.ts +76 -0
- package/lib/agents/proposals.ts +13 -5
- package/lib/agents/run-registry.test.ts +22 -0
- package/lib/agents/run-registry.ts +29 -0
- package/lib/agents/run-thread.auto-boundary.test.ts +125 -5
- package/lib/agents/run-thread.retry.test.ts +67 -1
- package/lib/agents/run-thread.ts +110 -10
- package/lib/agents/sqlite-checkpoint-saver.test.ts +91 -0
- package/lib/agents/thread-activity.test.ts +31 -0
- package/lib/agents/thread-activity.ts +27 -0
- package/lib/agents/thread-compaction-state.test.ts +82 -0
- package/lib/agents/thread-compaction-state.ts +121 -0
- package/lib/agents/thread-compaction.test.ts +83 -4
- package/lib/agents/thread-compaction.ts +34 -11
- package/lib/agents/warm-summary-background.test.ts +219 -5
- package/lib/agents/warm-summary-background.ts +346 -143
- package/lib/agents/warm-topics.test.ts +191 -0
- package/lib/agents/warm-topics.ts +317 -0
- package/lib/agents/workflow-step-retry.test.ts +96 -0
- package/lib/agents/workflow-step-retry.ts +216 -0
- package/lib/api/browser-control.ts +0 -3
- package/lib/bridges/dispatcher.ts +1 -0
- package/lib/bridges/message-role.test.ts +81 -0
- package/lib/bridges/message-role.ts +23 -10
- package/lib/bridges/types.ts +6 -0
- package/lib/bridges/whatsapp-link.test.ts +32 -0
- package/lib/bridges/whatsapp-link.ts +21 -0
- package/lib/bridges/whatsapp.inbound.test.ts +239 -0
- package/lib/bridges/whatsapp.sender.test.ts +80 -1
- package/lib/bridges/whatsapp.ts +76 -38
- package/lib/db/migrations.ts +5 -0
- package/lib/env/config.ts +2 -0
- package/lib/env/schema.ts +12 -0
- package/lib/lifecycle/changeset-build.test.ts +93 -0
- package/lib/lifecycle/changeset-build.ts +210 -0
- package/lib/lifecycle/changesets.test.ts +101 -0
- package/lib/lifecycle/changesets.ts +166 -0
- package/lib/lifecycle/surface-collect.test.ts +88 -0
- package/lib/lifecycle/surface-collect.ts +64 -0
- package/lib/lifecycle/surface-snapshot.test.ts +104 -0
- package/lib/lifecycle/surface-snapshot.ts +210 -0
- package/lib/memory/record.ts +0 -2
- package/lib/pricing/snapshot.test.ts +70 -0
- package/lib/pricing/snapshot.ts +10 -2
- package/lib/providers/external.ts +0 -2
- package/lib/proxy/dispatcher.test.ts +119 -1
- package/lib/proxy/dispatcher.ts +22 -9
- package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
- package/lib/stores/agent-configs.ts +10 -5
- package/lib/stores/bridges.test.ts +81 -0
- package/lib/stores/bridges.ts +9 -8
- package/lib/stores/proxy-config.test.ts +120 -0
- package/lib/stores/proxy-config.ts +22 -4
- package/lib/stores/threads.test.ts +9 -0
- package/lib/stores/threads.ts +33 -19
- package/lib/stores/version-adoption.test.ts +96 -0
- package/lib/stores/version-adoption.ts +239 -26
- package/lib/stores/workflow-progress.ts +3 -0
- package/lib/tools/communications/calendar.test.ts +43 -2
- package/lib/tools/communications/calendar.ts +2 -0
- package/lib/tools/communications/gmail.test.ts +51 -1
- package/lib/tools/communications/gmail.ts +44 -2
- package/lib/tools/communications/ms-todo.ts +0 -7
- package/lib/tools/communications/outlook-calendar.ts +2 -0
- package/lib/tools/communications/outlook.test.ts +33 -2
- package/lib/tools/communications/outlook.ts +2 -0
- package/lib/tools/filesystem/edit-match.test.ts +133 -0
- package/lib/tools/filesystem/edit-match.ts +7 -2
- package/lib/tools/general/memory.ts +1 -1
- package/lib/tools/general/workflow-progress.ts +2 -0
- package/lib/tools/runtime/catalog.ts +1 -25
- package/lib/tools/support/result-refs.test.ts +131 -0
- package/lib/tools/support/result-refs.ts +41 -9
- package/lib/triggers/registry.ts +0 -4
- package/lib/utils/source-link.test.ts +51 -0
- package/lib/utils/source-link.ts +45 -0
- package/package.json +3 -3
- package/scripts/install-to-system.ps1 +39 -11
- package/scripts/install-to-system.sh +37 -3
- package/.next/standalone/.next/server/chunks/3979.js +0 -581
- package/.next/standalone/.next/server/chunks/5936.js +0 -594
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-36cb8b428b38b26a.js +0 -17
- package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-36cb8b428b38b26a.js +0 -17
- /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → hwujW4hR1b-r3k5WdMxZO}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → hwujW4hR1b-r3k5WdMxZO}/_ssgManifest.js +0 -0
package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js
CHANGED
|
@@ -378,6 +378,13 @@ module.exports = require("node:path");
|
|
|
378
378
|
|
|
379
379
|
/***/ }),
|
|
380
380
|
|
|
381
|
+
/***/ 77030:
|
|
382
|
+
/***/ ((module) => {
|
|
383
|
+
|
|
384
|
+
module.exports = require("node:net");
|
|
385
|
+
|
|
386
|
+
/***/ }),
|
|
387
|
+
|
|
381
388
|
/***/ 77598:
|
|
382
389
|
/***/ ((module) => {
|
|
383
390
|
|
|
@@ -413,953 +420,953 @@ module.exports = require("http");
|
|
|
413
420
|
|
|
414
421
|
/***/ }),
|
|
415
422
|
|
|
416
|
-
/***/
|
|
417
|
-
/***/ ((module) => {
|
|
418
|
-
|
|
419
|
-
module.exports = require("next/dist/shared/lib/no-fallback-error.external");
|
|
420
|
-
|
|
421
|
-
/***/ }),
|
|
422
|
-
|
|
423
|
-
/***/ 89052:
|
|
423
|
+
/***/ 82637:
|
|
424
424
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
425
425
|
|
|
426
426
|
__webpack_require__.r(__webpack_exports__);
|
|
427
427
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
428
|
-
/* harmony export */
|
|
428
|
+
/* harmony export */ handler: () => (/* binding */ handler),
|
|
429
|
+
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
430
|
+
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
431
|
+
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
432
|
+
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
433
|
+
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
429
434
|
/* harmony export */ });
|
|
430
|
-
/* harmony import */ var
|
|
431
|
-
/* harmony import */ var
|
|
432
|
-
/* harmony import */ var
|
|
433
|
-
/* harmony import */ var
|
|
434
|
-
/* harmony import */ var
|
|
435
|
+
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
|
|
436
|
+
/* 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__);
|
|
437
|
+
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
|
|
438
|
+
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
439
|
+
/* 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__);
|
|
440
|
+
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
|
|
441
|
+
/* 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__);
|
|
442
|
+
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
|
|
443
|
+
/* 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__);
|
|
444
|
+
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
|
|
445
|
+
/* 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__);
|
|
446
|
+
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
|
|
447
|
+
/* 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__);
|
|
448
|
+
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
|
|
449
|
+
/* 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__);
|
|
450
|
+
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
|
|
451
|
+
/* 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__);
|
|
452
|
+
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
|
|
453
|
+
/* 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__);
|
|
454
|
+
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
|
|
455
|
+
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
|
|
456
|
+
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
|
|
457
|
+
/* 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__);
|
|
458
|
+
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
|
|
459
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
|
|
460
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
461
|
+
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
|
|
462
|
+
/* 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__);
|
|
463
|
+
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
|
|
464
|
+
/* 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__);
|
|
465
|
+
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
|
|
466
|
+
/* 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__);
|
|
435
467
|
|
|
436
468
|
|
|
437
469
|
|
|
438
470
|
|
|
439
471
|
|
|
440
|
-
// GET /api/v1/integrations/outlook/oauth/callback?code=…&state=…
|
|
441
|
-
//
|
|
442
|
-
// Microsoft redirects the user's browser here after consent. We look up the
|
|
443
|
-
// pending flow by `state`, exchange the auth code for a refresh_token,
|
|
444
|
-
// persist the integration, and return a small HTML page telling the user
|
|
445
|
-
// they can close the tab. The Integrations panel polls /oauth/status.
|
|
446
|
-
async function GET(req) {
|
|
447
|
-
const url = req.nextUrl;
|
|
448
|
-
const state = url.searchParams.get("state") ?? "";
|
|
449
|
-
const code = url.searchParams.get("code") ?? "";
|
|
450
|
-
const errParam = url.searchParams.get("error");
|
|
451
|
-
const errDesc = url.searchParams.get("error_description");
|
|
452
|
-
const flow = state ? (0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .getFlow */ .lv)(state) : undefined;
|
|
453
|
-
if (!flow) {
|
|
454
|
-
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)("Authorization session not found or expired. Please retry from Jarela.", true);
|
|
455
|
-
}
|
|
456
|
-
if (errParam) {
|
|
457
|
-
const msg = errDesc ? `${errParam}: ${errDesc}` : errParam;
|
|
458
|
-
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
459
|
-
status: "error",
|
|
460
|
-
error: msg
|
|
461
|
-
});
|
|
462
|
-
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)(`Microsoft reported an error: ${(0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .escapeHtml */ .Z)(msg)}. You can close this tab.`, true);
|
|
463
|
-
}
|
|
464
|
-
if (!code) {
|
|
465
|
-
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
466
|
-
status: "error",
|
|
467
|
-
error: "no code returned"
|
|
468
|
-
});
|
|
469
|
-
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)("Microsoft did not return an authorization code.", true);
|
|
470
|
-
}
|
|
471
|
-
try {
|
|
472
|
-
const tok = await (0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .exchangeCode */ .Dd)({
|
|
473
|
-
code,
|
|
474
|
-
clientId: flow.clientId,
|
|
475
|
-
clientSecret: flow.clientSecret,
|
|
476
|
-
redirectUri: flow.redirectUri
|
|
477
|
-
});
|
|
478
|
-
if (!tok.refresh_token) {
|
|
479
|
-
const msg = "Microsoft did not return a refresh_token. Make sure your Azure app " + "registration includes the offline_access scope and that the consent " + "screen approves it.";
|
|
480
|
-
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
481
|
-
status: "error",
|
|
482
|
-
error: msg
|
|
483
|
-
});
|
|
484
|
-
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)(msg, true);
|
|
485
|
-
}
|
|
486
|
-
const saved = persistRefreshToken({
|
|
487
|
-
credentialId: flow.credentialId,
|
|
488
|
-
clientId: flow.clientId,
|
|
489
|
-
clientSecret: flow.clientSecret,
|
|
490
|
-
refreshToken: tok.refresh_token
|
|
491
|
-
});
|
|
492
|
-
if ("error" in saved) {
|
|
493
|
-
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
494
|
-
status: "error",
|
|
495
|
-
error: saved.error
|
|
496
|
-
});
|
|
497
|
-
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)(`Failed to save: ${(0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .escapeHtml */ .Z)(saved.error)}`, true);
|
|
498
|
-
}
|
|
499
|
-
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
500
|
-
status: "done"
|
|
501
|
-
});
|
|
502
|
-
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)("Outlook connected. You can close this tab and return to Jarela.", false);
|
|
503
|
-
} catch (e) {
|
|
504
|
-
const msg = (0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_4__/* .errorMessage */ .g)(e);
|
|
505
|
-
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
506
|
-
status: "error",
|
|
507
|
-
error: msg
|
|
508
|
-
});
|
|
509
|
-
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)(`Token exchange failed: ${(0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .escapeHtml */ .Z)(msg)}`, true);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
function persistRefreshToken(input) {
|
|
513
|
-
if (input.credentialId) {
|
|
514
|
-
const cred = (0,_lib_stores_credentials__WEBPACK_IMPORTED_MODULE_2__/* .getCredential */ .w_)(input.credentialId);
|
|
515
|
-
if (!cred || cred.provider !== "outlook") {
|
|
516
|
-
return {
|
|
517
|
-
error: "credential not found"
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
const merged = {
|
|
521
|
-
...(0,_lib_stores_credentials__WEBPACK_IMPORTED_MODULE_2__/* .getCredentialParams */ .WY)(cred),
|
|
522
|
-
client_id: input.clientId,
|
|
523
|
-
client_secret: input.clientSecret,
|
|
524
|
-
refresh_token: input.refreshToken
|
|
525
|
-
};
|
|
526
|
-
(0,_lib_stores_credentials__WEBPACK_IMPORTED_MODULE_2__/* .updateCredential */ .nZ)(input.credentialId, {
|
|
527
|
-
auth_method: "oauth",
|
|
528
|
-
params: merged
|
|
529
|
-
});
|
|
530
|
-
return {
|
|
531
|
-
ok: true
|
|
532
|
-
};
|
|
533
|
-
}
|
|
534
|
-
const saved = (0,_lib_stores_integrations__WEBPACK_IMPORTED_MODULE_1__/* .saveIntegration */ .oO)("outlook", {
|
|
535
|
-
client_id: input.clientId,
|
|
536
|
-
client_secret: input.clientSecret,
|
|
537
|
-
refresh_token: input.refreshToken
|
|
538
|
-
});
|
|
539
|
-
if ("error" in saved) return saved;
|
|
540
|
-
return {
|
|
541
|
-
ok: true
|
|
542
|
-
};
|
|
543
|
-
}
|
|
544
472
|
|
|
545
473
|
|
|
546
|
-
/***/ }),
|
|
547
474
|
|
|
548
|
-
/***/ 89080:
|
|
549
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
550
475
|
|
|
551
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
552
|
-
/* harmony export */ Ah: () => (/* binding */ updateFlow),
|
|
553
|
-
/* harmony export */ Dd: () => (/* binding */ exchangeCode),
|
|
554
|
-
/* harmony export */ F8: () => (/* binding */ createFlow),
|
|
555
|
-
/* harmony export */ i8: () => (/* binding */ getMicrosoftAccessToken),
|
|
556
|
-
/* harmony export */ jG: () => (/* binding */ resolveMicrosoftAuth),
|
|
557
|
-
/* harmony export */ lv: () => (/* binding */ getFlow),
|
|
558
|
-
/* harmony export */ op: () => (/* binding */ graphPaged),
|
|
559
|
-
/* harmony export */ xj: () => (/* binding */ buildAuthorizeUrl),
|
|
560
|
-
/* harmony export */ z$: () => (/* binding */ graphFetch)
|
|
561
|
-
/* harmony export */ });
|
|
562
|
-
/* unused harmony export MICROSOFT_SCOPES */
|
|
563
|
-
/* harmony import */ var _lib_stores_integrations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78228);
|
|
564
|
-
/* harmony import */ var _lib_utils_oauth_flow_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56362);
|
|
565
|
-
/* harmony import */ var _lib_utils_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53638);
|
|
566
|
-
/* harmony import */ var _lib_utils_error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22032);
|
|
567
|
-
/* harmony import */ var _lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22632);
|
|
568
|
-
// Ephemeral state store + shared auth helpers for the in-app Microsoft OAuth
|
|
569
|
-
// flow. Mirrors lib/integrations/gmail-oauth.ts but targets the Microsoft
|
|
570
|
-
// identity platform (v2.0 endpoint, common tenant by default) and Microsoft
|
|
571
|
-
// Graph as the downstream API surface (Outlook Mail + Calendar in v1).
|
|
572
|
-
//
|
|
573
|
-
// The user types client_id + client_secret in the Integrations panel and
|
|
574
|
-
// clicks "Connect Outlook". We POST those to /oauth/start, which stashes
|
|
575
|
-
// them here keyed by a random `state` token and returns the Microsoft
|
|
576
|
-
// authorize URL. The browser opens that URL; MS bounces back to
|
|
577
|
-
// /oauth/callback with `?code&state`, which exchanges the code for a
|
|
578
|
-
// refresh_token (granted because we asked for `offline_access`) and
|
|
579
|
-
// persists the integration. The panel polls /oauth/status separately.
|
|
580
|
-
//
|
|
581
|
-
// Pinned to globalThis so HMR in dev doesn't lose pending flows.
|
|
582
476
|
|
|
583
477
|
|
|
584
478
|
|
|
585
479
|
|
|
586
480
|
|
|
587
|
-
|
|
588
|
-
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
// We inject the nextConfigOutput here so that we can use them in the route
|
|
486
|
+
// module.
|
|
487
|
+
const nextConfigOutput = "standalone"
|
|
488
|
+
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
489
|
+
definition: {
|
|
490
|
+
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
491
|
+
page: "/api/v1/integrations/outlook/oauth/callback/route",
|
|
492
|
+
pathname: "/api/v1/integrations/outlook/oauth/callback",
|
|
493
|
+
filename: "route",
|
|
494
|
+
bundlePath: "app/api/v1/integrations/outlook/oauth/callback/route"
|
|
495
|
+
},
|
|
496
|
+
distDir: ".next" || 0,
|
|
497
|
+
relativeProjectDir: false || '',
|
|
498
|
+
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/integrations/outlook/oauth/callback/route.ts",
|
|
499
|
+
nextConfigOutput,
|
|
500
|
+
// The lazy require factory ensures that:
|
|
501
|
+
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
502
|
+
// correctly attributing module load time to application-code rather than
|
|
503
|
+
// framework internals.
|
|
504
|
+
// - In all modes: async modules (route files with top-level await) are
|
|
505
|
+
// handled correctly — require() returns a Promise for such modules, which
|
|
506
|
+
// ensureUserland() awaits before the first request is handled.
|
|
507
|
+
userland: ()=>__webpack_require__(89052),
|
|
508
|
+
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
509
|
+
// server HMR updates are picked up without re-executing the entry chunk.
|
|
510
|
+
// Using require() (synchronous) avoids adding async overhead that would be
|
|
511
|
+
// incorrectly attributed to application-code time in devRequestTiming.
|
|
512
|
+
... false ? 0 : {}
|
|
589
513
|
});
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
const TENANT = process.env.OUTLOOK_TENANT?.trim() || "common";
|
|
599
|
-
// Delegated Graph scopes the agent needs. Keep narrow:
|
|
600
|
-
// - offline_access → required for a refresh_token (MS counterpart of
|
|
601
|
-
// Google's access_type=offline).
|
|
602
|
-
// - User.Read → used by the test endpoint to call /me.
|
|
603
|
-
// - Mail.ReadWrite → search/read mail, create drafts, mark read,
|
|
604
|
-
// move to folders (incl. DeletedItems).
|
|
605
|
-
// - Mail.Send → send mail when the user explicitly asks for it.
|
|
606
|
-
// - Calendars.ReadWrite → list/get/create/update/delete events on the
|
|
607
|
-
// user's existing calendars.
|
|
608
|
-
// - Tasks.ReadWrite → list/get/create/update/complete/delete Microsoft
|
|
609
|
-
// To Do tasks and lists (ms_todo_* tools).
|
|
610
|
-
// - People.Read → resolve "who is X" / frequent contacts via
|
|
611
|
-
// /me/people (ms_people_resolve tool).
|
|
612
|
-
const MICROSOFT_SCOPES = [
|
|
613
|
-
"offline_access",
|
|
614
|
-
"User.Read",
|
|
615
|
-
"Mail.ReadWrite",
|
|
616
|
-
"Mail.Send",
|
|
617
|
-
"Calendars.ReadWrite",
|
|
618
|
-
"Tasks.ReadWrite",
|
|
619
|
-
"People.Read"
|
|
620
|
-
];
|
|
621
|
-
function buildAuthorizeUrl(opts) {
|
|
622
|
-
const p = new URLSearchParams({
|
|
623
|
-
client_id: opts.clientId,
|
|
624
|
-
redirect_uri: opts.redirectUri,
|
|
625
|
-
response_type: "code",
|
|
626
|
-
response_mode: "query",
|
|
627
|
-
scope: MICROSOFT_SCOPES.join(" "),
|
|
628
|
-
// Force consent so a returning user actually re-grants any newly-added
|
|
629
|
-
// scope (otherwise MS silently reuses the prior grant minus the new bit).
|
|
630
|
-
prompt: "consent",
|
|
631
|
-
state: opts.state
|
|
514
|
+
// Pull out the exports that we need to expose from the module. This should
|
|
515
|
+
// be eliminated when we've moved the other routes to the new format. These
|
|
516
|
+
// are used to hook into the route.
|
|
517
|
+
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
518
|
+
function patchFetch() {
|
|
519
|
+
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
520
|
+
workAsyncStorage,
|
|
521
|
+
workUnitAsyncStorage
|
|
632
522
|
});
|
|
633
|
-
return `https://login.microsoftonline.com/${TENANT}/oauth2/v2.0/authorize?${p.toString()}`;
|
|
634
523
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
async function exchangeCode(opts) {
|
|
640
|
-
const clientId = (0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__/* .sanitizeOAuthInput */ .d)(opts.clientId) ?? "";
|
|
641
|
-
const clientSecret = (0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__/* .sanitizeOAuthInput */ .d)(opts.clientSecret) ?? "";
|
|
642
|
-
const body = new URLSearchParams({
|
|
643
|
-
code: opts.code,
|
|
644
|
-
client_id: clientId,
|
|
645
|
-
client_secret: clientSecret,
|
|
646
|
-
redirect_uri: opts.redirectUri,
|
|
647
|
-
grant_type: "authorization_code",
|
|
648
|
-
scope: MICROSOFT_SCOPES.join(" ")
|
|
649
|
-
});
|
|
650
|
-
const res = await fetch(`https://login.microsoftonline.com/${TENANT}/oauth2/v2.0/token`, {
|
|
651
|
-
method: "POST",
|
|
652
|
-
headers: {
|
|
653
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
654
|
-
},
|
|
655
|
-
body: body.toString(),
|
|
656
|
-
signal: AbortSignal.timeout(30000)
|
|
657
|
-
});
|
|
658
|
-
const text = await res.text();
|
|
659
|
-
const parsed = (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_3__/* .parseJsonSafe */ .p)(text, {});
|
|
660
|
-
if (!res.ok) {
|
|
661
|
-
const err = parsed["error_description"] || parsed["error"] || text || `HTTP ${res.status}`;
|
|
662
|
-
console.error(`[microsoft-oauth] token exchange rejected (${res.status}): ${err} | client_id ${(0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__/* .secretFingerprint */ .n)(clientId)} | client_secret ${(0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__/* .secretFingerprint */ .n)(clientSecret)}`);
|
|
663
|
-
throw new Error(err);
|
|
524
|
+
|
|
525
|
+
async function handler(req, res, ctx) {
|
|
526
|
+
if (ctx.requestMeta) {
|
|
527
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
|
|
664
528
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
function resolveMicrosoftAuth() {
|
|
668
|
-
const envId = process.env.OUTLOOK_CLIENT_ID;
|
|
669
|
-
const envSecret = process.env.OUTLOOK_CLIENT_SECRET;
|
|
670
|
-
const envRefresh = process.env.OUTLOOK_REFRESH_TOKEN;
|
|
671
|
-
if (envId && envSecret && envRefresh) {
|
|
672
|
-
return {
|
|
673
|
-
client_id: envId,
|
|
674
|
-
client_secret: envSecret,
|
|
675
|
-
refresh_token: envRefresh
|
|
676
|
-
};
|
|
529
|
+
if (routeModule.isDev) {
|
|
530
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
|
677
531
|
}
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
532
|
+
let srcPage = "/api/v1/integrations/outlook/oauth/callback/route";
|
|
533
|
+
// turbopack doesn't normalize `/index` in the page name
|
|
534
|
+
// so we need to to process dynamic routes properly
|
|
535
|
+
// TODO: fix turbopack providing differing value from webpack
|
|
536
|
+
if (false) {} else if (srcPage === '/index') {
|
|
537
|
+
// we always normalize /index specifically
|
|
538
|
+
srcPage = '/';
|
|
685
539
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
const accessTokenCache = new Map();
|
|
691
|
-
function cacheKey(auth) {
|
|
692
|
-
return auth.refresh_token.slice(0, 20);
|
|
693
|
-
}
|
|
694
|
-
// Force-evict a cached access token (e.g. after a 401). The next call to
|
|
695
|
-
// getMicrosoftAccessToken will refresh against the v2 token endpoint.
|
|
696
|
-
function bustAccessToken(auth) {
|
|
697
|
-
accessTokenCache.delete(cacheKey(auth));
|
|
698
|
-
}
|
|
699
|
-
async function getMicrosoftAccessToken(auth) {
|
|
700
|
-
const key = cacheKey(auth);
|
|
701
|
-
const cached = accessTokenCache.get(key);
|
|
702
|
-
if (cached && cached.expires_at > Date.now() + 60000) return cached.token;
|
|
703
|
-
const body = new URLSearchParams({
|
|
704
|
-
client_id: auth.client_id,
|
|
705
|
-
client_secret: auth.client_secret,
|
|
706
|
-
refresh_token: auth.refresh_token,
|
|
707
|
-
grant_type: "refresh_token",
|
|
708
|
-
// Required on the v2 endpoint even for refresh_token grants.
|
|
709
|
-
scope: MICROSOFT_SCOPES.join(" ")
|
|
540
|
+
const multiZoneDraftMode = false;
|
|
541
|
+
const prepareResult = await routeModule.prepare(req, res, {
|
|
542
|
+
srcPage,
|
|
543
|
+
multiZoneDraftMode
|
|
710
544
|
});
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
545
|
+
if (!prepareResult) {
|
|
546
|
+
res.statusCode = 400;
|
|
547
|
+
res.end('Bad Request');
|
|
548
|
+
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
|
|
552
|
+
const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
|
|
553
|
+
// Only this route's prerenders can establish ISR or admit generated params.
|
|
554
|
+
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]));
|
|
555
|
+
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
556
|
+
const render404 = async ()=>{
|
|
557
|
+
// TODO: should route-module itself handle rendering the 404
|
|
558
|
+
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
559
|
+
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
560
|
+
} else {
|
|
561
|
+
res.end('This page could not be found');
|
|
562
|
+
}
|
|
563
|
+
return null;
|
|
564
|
+
};
|
|
565
|
+
if (isIsr && !isDraftMode) {
|
|
566
|
+
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
567
|
+
if (prerenderInfo) {
|
|
568
|
+
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
569
|
+
if (nextConfig.adapterPath) {
|
|
570
|
+
return await render404();
|
|
571
|
+
}
|
|
572
|
+
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
573
|
+
}
|
|
726
574
|
}
|
|
727
|
-
const parsed = JSON.parse(text);
|
|
728
|
-
if (!parsed.access_token) return {
|
|
729
|
-
error: "OAuth response missing access_token"
|
|
730
|
-
};
|
|
731
|
-
const expires_at = Date.now() + (parsed.expires_in ?? 3000) * 1000;
|
|
732
|
-
accessTokenCache.set(key, {
|
|
733
|
-
token: parsed.access_token,
|
|
734
|
-
expires_at
|
|
735
|
-
});
|
|
736
|
-
return parsed.access_token;
|
|
737
|
-
} catch (err) {
|
|
738
|
-
return {
|
|
739
|
-
error: `Microsoft OAuth refresh threw: ${(0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_4__/* .errorMessage */ .g)(err)}`
|
|
740
|
-
};
|
|
741
575
|
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
prefix: "/me/messages",
|
|
748
|
-
scope: "Mail.ReadWrite"
|
|
749
|
-
},
|
|
750
|
-
{
|
|
751
|
-
prefix: "/me/mailFolders",
|
|
752
|
-
scope: "Mail.ReadWrite"
|
|
753
|
-
},
|
|
754
|
-
{
|
|
755
|
-
prefix: "/me/sendMail",
|
|
756
|
-
scope: "Mail.Send"
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
prefix: "/me/events",
|
|
760
|
-
scope: "Calendars.ReadWrite"
|
|
761
|
-
},
|
|
762
|
-
{
|
|
763
|
-
prefix: "/me/calendar",
|
|
764
|
-
scope: "Calendars.ReadWrite"
|
|
765
|
-
},
|
|
766
|
-
{
|
|
767
|
-
prefix: "/me/calendars",
|
|
768
|
-
scope: "Calendars.ReadWrite"
|
|
769
|
-
},
|
|
770
|
-
{
|
|
771
|
-
prefix: "/me/todo",
|
|
772
|
-
scope: "Tasks.ReadWrite"
|
|
773
|
-
},
|
|
774
|
-
{
|
|
775
|
-
prefix: "/me/people",
|
|
776
|
-
scope: "People.Read"
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
prefix: "/me/contacts",
|
|
780
|
-
scope: "Contacts.Read"
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
prefix: "/me/drive",
|
|
784
|
-
scope: "Files.Read"
|
|
785
|
-
},
|
|
786
|
-
{
|
|
787
|
-
prefix: "/me/insights",
|
|
788
|
-
scope: "Sites.Read.All"
|
|
789
|
-
},
|
|
790
|
-
{
|
|
791
|
-
prefix: "/search/query",
|
|
792
|
-
scope: "Mail.Read Files.Read.All"
|
|
793
|
-
},
|
|
794
|
-
{
|
|
795
|
-
prefix: "/me",
|
|
796
|
-
scope: "User.Read"
|
|
576
|
+
let cacheKey = null;
|
|
577
|
+
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
578
|
+
cacheKey = resolvedPathname;
|
|
579
|
+
// ensure /index and / is normalized to one key
|
|
580
|
+
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
797
581
|
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
582
|
+
// Before rendering (which initializes component tree modules), we have to
|
|
583
|
+
// set the reference manifests to our global store so Server Action's
|
|
584
|
+
// encryption util can access to them at the top level of the page module.
|
|
585
|
+
if (serverActionsManifest && clientReferenceManifest) {
|
|
586
|
+
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
587
|
+
page: srcPage,
|
|
588
|
+
clientReferenceManifest,
|
|
589
|
+
serverActionsManifest
|
|
590
|
+
});
|
|
803
591
|
}
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
const
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
try {
|
|
838
|
-
res = await fetch(url, {
|
|
839
|
-
...init,
|
|
840
|
-
headers: {
|
|
841
|
-
Authorization: `Bearer ${token}`,
|
|
842
|
-
Accept: "application/json",
|
|
843
|
-
"Content-Type": "application/json",
|
|
844
|
-
...init?.headers ?? {}
|
|
845
|
-
},
|
|
846
|
-
signal: AbortSignal.timeout(30000)
|
|
847
|
-
});
|
|
848
|
-
} catch (err) {
|
|
849
|
-
return {
|
|
850
|
-
error: `Graph fetch threw: ${(0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_4__/* .errorMessage */ .g)(err)}`,
|
|
851
|
-
url
|
|
852
|
-
};
|
|
853
|
-
}
|
|
854
|
-
if (res.status === 204) return {
|
|
855
|
-
ok: true
|
|
856
|
-
};
|
|
857
|
-
if (res.status === 401 && !triedReauth) {
|
|
858
|
-
triedReauth = true;
|
|
859
|
-
bustAccessToken(auth);
|
|
860
|
-
continue;
|
|
861
|
-
}
|
|
862
|
-
if ((res.status === 429 || res.status === 503) && attempt < 3) {
|
|
863
|
-
const waitMs = parseRetryAfter(res.headers.get("Retry-After")) ?? backoffFor(attempt);
|
|
864
|
-
attempt += 1;
|
|
865
|
-
await new Promise((r)=>setTimeout(r, waitMs));
|
|
866
|
-
continue;
|
|
592
|
+
const method = req.method || 'GET';
|
|
593
|
+
const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
|
|
594
|
+
const activeSpan = tracer.getActiveScopeSpan();
|
|
595
|
+
const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
|
|
596
|
+
const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
|
|
597
|
+
const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
|
|
598
|
+
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
599
|
+
globalThis.__incrementalCache = incrementalCache;
|
|
600
|
+
const context = {
|
|
601
|
+
params,
|
|
602
|
+
previewProps,
|
|
603
|
+
renderOpts: {
|
|
604
|
+
experimental: {
|
|
605
|
+
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
606
|
+
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
607
|
+
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
608
|
+
},
|
|
609
|
+
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
610
|
+
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
611
|
+
isDraftMode,
|
|
612
|
+
incrementalCache,
|
|
613
|
+
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
614
|
+
cacheLifeProfiles: nextConfig.cacheLife,
|
|
615
|
+
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
616
|
+
waitUntil: ctx.waitUntil,
|
|
617
|
+
onClose: (cb)=>{
|
|
618
|
+
res.on('close', cb);
|
|
619
|
+
},
|
|
620
|
+
onAfterTaskError: undefined
|
|
621
|
+
},
|
|
622
|
+
sharedContext: {
|
|
623
|
+
buildId,
|
|
624
|
+
deploymentId
|
|
867
625
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
626
|
+
};
|
|
627
|
+
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
628
|
+
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
629
|
+
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));
|
|
630
|
+
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
631
|
+
try {
|
|
632
|
+
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
633
|
+
res.statusCode = 404;
|
|
634
|
+
// on-demand revalidate always sets this header
|
|
635
|
+
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
636
|
+
res.end('This page could not be found');
|
|
637
|
+
return null;
|
|
638
|
+
}
|
|
639
|
+
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
640
|
+
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
641
|
+
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
642
|
+
// Attempt using provided waitUntil if available
|
|
643
|
+
// if it's not we fallback to sendResponse's handling
|
|
644
|
+
if (pendingWaitUntil) {
|
|
645
|
+
if (ctx.waitUntil) {
|
|
646
|
+
ctx.waitUntil(pendingWaitUntil);
|
|
647
|
+
pendingWaitUntil = undefined;
|
|
875
648
|
}
|
|
876
649
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
650
|
+
const cacheTags = context.renderOpts.collectedTags;
|
|
651
|
+
// If the request is for a static response, we can cache it so long
|
|
652
|
+
// as it's not edge.
|
|
653
|
+
if (isIsr) {
|
|
654
|
+
const blob = await response.blob();
|
|
655
|
+
// Copy the headers from the response.
|
|
656
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
657
|
+
if (cacheTags) {
|
|
658
|
+
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
659
|
+
}
|
|
660
|
+
if (!headers['content-type'] && blob.type) {
|
|
661
|
+
headers['content-type'] = blob.type;
|
|
662
|
+
}
|
|
663
|
+
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
664
|
+
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
|
|
665
|
+
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
666
|
+
// build-time fallback in `build/index.ts` so cache entries
|
|
667
|
+
// and the response Cache-Control header agree on the route's
|
|
668
|
+
// effective expire. Routes that opt out of revalidation
|
|
669
|
+
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
670
|
+
// keep `expire: undefined`.
|
|
671
|
+
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
672
|
+
// Create the cache entry for the response.
|
|
673
|
+
const cacheEntry = {
|
|
674
|
+
value: {
|
|
675
|
+
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
676
|
+
status: response.status,
|
|
677
|
+
body: Buffer.from(await blob.arrayBuffer()),
|
|
678
|
+
headers
|
|
679
|
+
},
|
|
680
|
+
cacheControl: {
|
|
681
|
+
revalidate,
|
|
682
|
+
expire
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
return cacheEntry;
|
|
686
|
+
} else {
|
|
687
|
+
// send response without caching if not ISR
|
|
688
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
689
|
+
return null;
|
|
690
|
+
}
|
|
691
|
+
} catch (err) {
|
|
692
|
+
// if this is a background revalidate we need to report
|
|
693
|
+
// the request error here as it won't be bubbled
|
|
694
|
+
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
695
|
+
const silenceLog = false;
|
|
696
|
+
await routeModule.onRequestError(req, err, {
|
|
697
|
+
routerKind: 'App Router',
|
|
698
|
+
routePath: srcPage,
|
|
699
|
+
routeType: 'route',
|
|
700
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
701
|
+
isStaticGeneration: cacheKey !== null,
|
|
702
|
+
isOnDemandRevalidate
|
|
703
|
+
})
|
|
704
|
+
}, silenceLog, routerServerContext);
|
|
705
|
+
}
|
|
706
|
+
throw err;
|
|
886
707
|
}
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
// Follow @odata.nextLink across pages and concatenate `value` arrays.
|
|
890
|
-
// Stops at `maxPages` (default 5) to bound context cost. Returns the same
|
|
891
|
-
// shape as graphFetch (object with `.value`) but with the merged array, or
|
|
892
|
-
// the original error shape if any page errored.
|
|
893
|
-
async function graphPaged(auth, path, opts) {
|
|
894
|
-
const maxPages = opts?.maxPages ?? 5;
|
|
895
|
-
let current = path;
|
|
896
|
-
const merged = [];
|
|
897
|
-
let pages = 0;
|
|
898
|
-
while(current && pages < maxPages){
|
|
899
|
-
const page = await graphFetch(auth, current, opts?.init);
|
|
900
|
-
if (page && typeof page === "object" && "error" in page) return page;
|
|
901
|
-
const body = page;
|
|
902
|
-
if (Array.isArray(body.value)) merged.push(...body.value);
|
|
903
|
-
current = typeof body["@odata.nextLink"] === "string" ? body["@odata.nextLink"] : null;
|
|
904
|
-
pages += 1;
|
|
905
|
-
}
|
|
906
|
-
return {
|
|
907
|
-
value: merged,
|
|
908
|
-
pages
|
|
909
708
|
};
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
/*
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
709
|
+
const handleResponse = async (currentSpan, parentSpan)=>{
|
|
710
|
+
try {
|
|
711
|
+
var _cacheEntry_value;
|
|
712
|
+
const cacheEntry = await routeModule.handleResponse({
|
|
713
|
+
req,
|
|
714
|
+
nextConfig,
|
|
715
|
+
cacheKey,
|
|
716
|
+
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
717
|
+
isFallback: false,
|
|
718
|
+
previewProps,
|
|
719
|
+
prerenderManifest,
|
|
720
|
+
isRoutePPREnabled: false,
|
|
721
|
+
isOnDemandRevalidate,
|
|
722
|
+
revalidateOnlyGenerated,
|
|
723
|
+
responseGenerator,
|
|
724
|
+
waitUntil: ctx.waitUntil,
|
|
725
|
+
isMinimalMode
|
|
726
|
+
});
|
|
727
|
+
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
728
|
+
throw cacheEntry.error;
|
|
729
|
+
}
|
|
730
|
+
// we don't create a cacheEntry for ISR
|
|
731
|
+
if (!isIsr) {
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
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) {
|
|
735
|
+
var _cacheEntry_value1;
|
|
736
|
+
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
737
|
+
}
|
|
738
|
+
if (!isMinimalMode) {
|
|
739
|
+
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
740
|
+
}
|
|
741
|
+
// Draft mode should never be cached
|
|
742
|
+
if (isDraftMode) {
|
|
743
|
+
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
744
|
+
}
|
|
745
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
746
|
+
if (!(isMinimalMode && isIsr)) {
|
|
747
|
+
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
748
|
+
}
|
|
749
|
+
// If cache control is already set on the response we don't
|
|
750
|
+
// override it to allow users to customize it via next.config
|
|
751
|
+
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
752
|
+
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
753
|
+
}
|
|
754
|
+
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'.
|
|
755
|
+
new Response(cacheEntry.value.body, {
|
|
756
|
+
headers,
|
|
757
|
+
status: cacheEntry.value.status || 200
|
|
758
|
+
}));
|
|
759
|
+
return;
|
|
760
|
+
} catch (err) {
|
|
761
|
+
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
762
|
+
const silenceLog = false;
|
|
763
|
+
await routeModule.onRequestError(req, err, {
|
|
764
|
+
routerKind: 'App Router',
|
|
765
|
+
routePath: normalizedSrcPage,
|
|
766
|
+
routeType: 'route',
|
|
767
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
768
|
+
isStaticGeneration: cacheKey !== null,
|
|
769
|
+
isOnDemandRevalidate
|
|
770
|
+
})
|
|
771
|
+
}, silenceLog, routerServerContext);
|
|
772
|
+
}
|
|
773
|
+
// rethrow so that we can handle serving error page
|
|
774
|
+
// If this is during static generation, throw the error again.
|
|
775
|
+
if (isIsr) throw err;
|
|
776
|
+
// Otherwise, send a 500 response unless the original response has
|
|
777
|
+
// already committed. In that case, preserve its status code for
|
|
778
|
+
// telemetry while still recording the failure and terminating a response
|
|
779
|
+
// that the failed pipeline left open.
|
|
780
|
+
if (res.headersSent) {
|
|
781
|
+
if (currentSpan) {
|
|
782
|
+
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
783
|
+
currentSpan.recordException(error);
|
|
784
|
+
currentSpan.setStatus({
|
|
785
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
786
|
+
message: error.message
|
|
787
|
+
});
|
|
788
|
+
currentSpan.setAttribute('error.type', error.name);
|
|
789
|
+
}
|
|
790
|
+
if (!res.writableEnded && !res.destroyed) {
|
|
791
|
+
res.end();
|
|
792
|
+
}
|
|
793
|
+
} else {
|
|
794
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
795
|
+
status: 500
|
|
796
|
+
}));
|
|
797
|
+
}
|
|
798
|
+
return;
|
|
799
|
+
} finally{
|
|
800
|
+
;
|
|
801
|
+
(()=>{
|
|
802
|
+
if (!currentSpan) {
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
let statusCode = res.statusCode;
|
|
806
|
+
currentSpan.setAttributes({
|
|
807
|
+
'http.status_code': statusCode,
|
|
808
|
+
'next.rsc': false
|
|
809
|
+
});
|
|
810
|
+
if (statusCode && statusCode >= 500) {
|
|
811
|
+
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
812
|
+
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
813
|
+
currentSpan.setStatus({
|
|
814
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
815
|
+
});
|
|
816
|
+
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
817
|
+
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
818
|
+
}
|
|
819
|
+
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
820
|
+
// We were unable to get attributes, probably OTEL is not enabled
|
|
821
|
+
if (!rootSpanAttributes) {
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
825
|
+
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
829
|
+
const name = `${method} ${route}`;
|
|
830
|
+
currentSpan.setAttributes({
|
|
831
|
+
'next.route': route,
|
|
832
|
+
'http.route': route,
|
|
833
|
+
'next.span_name': name
|
|
834
|
+
});
|
|
835
|
+
currentSpan.updateName(name);
|
|
836
|
+
// Propagate http.route to the parent span if one exists (e.g.
|
|
837
|
+
// a platform-created HTTP span in adapter deployments).
|
|
838
|
+
if (parentSpan && parentSpan !== currentSpan) {
|
|
839
|
+
parentSpan.setAttribute('http.route', route);
|
|
840
|
+
parentSpan.updateName(name);
|
|
841
|
+
}
|
|
842
|
+
})();
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
// TODO: activeSpan code path is for when wrapped by
|
|
846
|
+
// next-server can be removed when this is no longer used
|
|
847
|
+
if (isWrappedByNextServer && activeSpan) {
|
|
848
|
+
await handleResponse(activeSpan, undefined);
|
|
849
|
+
} else {
|
|
850
|
+
let parentSpan = tracer.getActiveScopeSpan();
|
|
851
|
+
await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
|
|
852
|
+
spanName: `${method} ${srcPage}`,
|
|
853
|
+
kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
|
|
854
|
+
attributes: {
|
|
855
|
+
'http.method': method,
|
|
856
|
+
'http.target': req.url
|
|
857
|
+
}
|
|
858
|
+
}, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
972
861
|
|
|
862
|
+
//# sourceMappingURL=app-route.js.map
|
|
973
863
|
|
|
974
864
|
|
|
865
|
+
/***/ }),
|
|
975
866
|
|
|
867
|
+
/***/ 86439:
|
|
868
|
+
/***/ ((module) => {
|
|
976
869
|
|
|
870
|
+
module.exports = require("next/dist/shared/lib/no-fallback-error.external");
|
|
977
871
|
|
|
872
|
+
/***/ }),
|
|
978
873
|
|
|
874
|
+
/***/ 89052:
|
|
875
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
979
876
|
|
|
877
|
+
__webpack_require__.r(__webpack_exports__);
|
|
878
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
879
|
+
/* harmony export */ GET: () => (/* binding */ GET)
|
|
880
|
+
/* harmony export */ });
|
|
881
|
+
/* harmony import */ var _lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89080);
|
|
882
|
+
/* harmony import */ var _lib_stores_integrations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(78228);
|
|
883
|
+
/* harmony import */ var _lib_stores_credentials__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67637);
|
|
884
|
+
/* harmony import */ var _app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41044);
|
|
885
|
+
/* harmony import */ var _lib_utils_error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22032);
|
|
980
886
|
|
|
981
887
|
|
|
982
888
|
|
|
983
889
|
|
|
984
|
-
// We inject the nextConfigOutput here so that we can use them in the route
|
|
985
|
-
// module.
|
|
986
|
-
const nextConfigOutput = "standalone"
|
|
987
|
-
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
988
|
-
definition: {
|
|
989
|
-
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
990
|
-
page: "/api/v1/integrations/outlook/oauth/callback/route",
|
|
991
|
-
pathname: "/api/v1/integrations/outlook/oauth/callback",
|
|
992
|
-
filename: "route",
|
|
993
|
-
bundlePath: "app/api/v1/integrations/outlook/oauth/callback/route"
|
|
994
|
-
},
|
|
995
|
-
distDir: ".next" || 0,
|
|
996
|
-
relativeProjectDir: false || '',
|
|
997
|
-
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/integrations/outlook/oauth/callback/route.ts",
|
|
998
|
-
nextConfigOutput,
|
|
999
|
-
// The lazy require factory ensures that:
|
|
1000
|
-
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
1001
|
-
// correctly attributing module load time to application-code rather than
|
|
1002
|
-
// framework internals.
|
|
1003
|
-
// - In all modes: async modules (route files with top-level await) are
|
|
1004
|
-
// handled correctly — require() returns a Promise for such modules, which
|
|
1005
|
-
// ensureUserland() awaits before the first request is handled.
|
|
1006
|
-
userland: ()=>__webpack_require__(89052),
|
|
1007
|
-
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
1008
|
-
// server HMR updates are picked up without re-executing the entry chunk.
|
|
1009
|
-
// Using require() (synchronous) avoids adding async overhead that would be
|
|
1010
|
-
// incorrectly attributed to application-code time in devRequestTiming.
|
|
1011
|
-
... false ? 0 : {}
|
|
1012
|
-
});
|
|
1013
|
-
// Pull out the exports that we need to expose from the module. This should
|
|
1014
|
-
// be eliminated when we've moved the other routes to the new format. These
|
|
1015
|
-
// are used to hook into the route.
|
|
1016
|
-
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
1017
|
-
function patchFetch() {
|
|
1018
|
-
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
1019
|
-
workAsyncStorage,
|
|
1020
|
-
workUnitAsyncStorage
|
|
1021
|
-
});
|
|
1022
|
-
}
|
|
1023
890
|
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
891
|
+
// GET /api/v1/integrations/outlook/oauth/callback?code=…&state=…
|
|
892
|
+
//
|
|
893
|
+
// Microsoft redirects the user's browser here after consent. We look up the
|
|
894
|
+
// pending flow by `state`, exchange the auth code for a refresh_token,
|
|
895
|
+
// persist the integration, and return a small HTML page telling the user
|
|
896
|
+
// they can close the tab. The Integrations panel polls /oauth/status.
|
|
897
|
+
async function GET(req) {
|
|
898
|
+
const url = req.nextUrl;
|
|
899
|
+
const state = url.searchParams.get("state") ?? "";
|
|
900
|
+
const code = url.searchParams.get("code") ?? "";
|
|
901
|
+
const errParam = url.searchParams.get("error");
|
|
902
|
+
const errDesc = url.searchParams.get("error_description");
|
|
903
|
+
const flow = state ? (0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .getFlow */ .lv)(state) : undefined;
|
|
904
|
+
if (!flow) {
|
|
905
|
+
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)("Authorization session not found or expired. Please retry from Jarela.", true);
|
|
1027
906
|
}
|
|
1028
|
-
if (
|
|
1029
|
-
|
|
907
|
+
if (errParam) {
|
|
908
|
+
const msg = errDesc ? `${errParam}: ${errDesc}` : errParam;
|
|
909
|
+
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
910
|
+
status: "error",
|
|
911
|
+
error: msg
|
|
912
|
+
});
|
|
913
|
+
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)(`Microsoft reported an error: ${(0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .escapeHtml */ .Z)(msg)}. You can close this tab.`, true);
|
|
1030
914
|
}
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
srcPage = '/';
|
|
915
|
+
if (!code) {
|
|
916
|
+
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
917
|
+
status: "error",
|
|
918
|
+
error: "no code returned"
|
|
919
|
+
});
|
|
920
|
+
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)("Microsoft did not return an authorization code.", true);
|
|
1038
921
|
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
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]));
|
|
1054
|
-
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
1055
|
-
const render404 = async ()=>{
|
|
1056
|
-
// TODO: should route-module itself handle rendering the 404
|
|
1057
|
-
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
1058
|
-
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
1059
|
-
} else {
|
|
1060
|
-
res.end('This page could not be found');
|
|
922
|
+
try {
|
|
923
|
+
const tok = await (0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .exchangeCode */ .Dd)({
|
|
924
|
+
code,
|
|
925
|
+
clientId: flow.clientId,
|
|
926
|
+
clientSecret: flow.clientSecret,
|
|
927
|
+
redirectUri: flow.redirectUri
|
|
928
|
+
});
|
|
929
|
+
if (!tok.refresh_token) {
|
|
930
|
+
const msg = "Microsoft did not return a refresh_token. Make sure your Azure app " + "registration includes the offline_access scope and that the consent " + "screen approves it.";
|
|
931
|
+
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
932
|
+
status: "error",
|
|
933
|
+
error: msg
|
|
934
|
+
});
|
|
935
|
+
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)(msg, true);
|
|
1061
936
|
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
}
|
|
937
|
+
const saved = persistRefreshToken({
|
|
938
|
+
credentialId: flow.credentialId,
|
|
939
|
+
clientId: flow.clientId,
|
|
940
|
+
clientSecret: flow.clientSecret,
|
|
941
|
+
refreshToken: tok.refresh_token
|
|
942
|
+
});
|
|
943
|
+
if ("error" in saved) {
|
|
944
|
+
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
945
|
+
status: "error",
|
|
946
|
+
error: saved.error
|
|
947
|
+
});
|
|
948
|
+
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)(`Failed to save: ${(0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .escapeHtml */ .Z)(saved.error)}`, true);
|
|
1073
949
|
}
|
|
950
|
+
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
951
|
+
status: "done"
|
|
952
|
+
});
|
|
953
|
+
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)("Outlook connected. You can close this tab and return to Jarela.", false);
|
|
954
|
+
} catch (e) {
|
|
955
|
+
const msg = (0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_4__/* .errorMessage */ .g)(e);
|
|
956
|
+
(0,_lib_integrations_microsoft_oauth__WEBPACK_IMPORTED_MODULE_0__/* .updateFlow */ .Ah)(state, {
|
|
957
|
+
status: "error",
|
|
958
|
+
error: msg
|
|
959
|
+
});
|
|
960
|
+
return (0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .oauthHtmlResponse */ .m)(`Token exchange failed: ${(0,_app_api_v1_integrations_oauth_callback__WEBPACK_IMPORTED_MODULE_3__/* .escapeHtml */ .Z)(msg)}`, true);
|
|
1074
961
|
}
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
962
|
+
}
|
|
963
|
+
function persistRefreshToken(input) {
|
|
964
|
+
if (input.credentialId) {
|
|
965
|
+
const cred = (0,_lib_stores_credentials__WEBPACK_IMPORTED_MODULE_2__/* .getCredential */ .w_)(input.credentialId);
|
|
966
|
+
if (!cred || cred.provider !== "outlook") {
|
|
967
|
+
return {
|
|
968
|
+
error: "credential not found"
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
const merged = {
|
|
972
|
+
...(0,_lib_stores_credentials__WEBPACK_IMPORTED_MODULE_2__/* .getCredentialParams */ .WY)(cred),
|
|
973
|
+
client_id: input.clientId,
|
|
974
|
+
client_secret: input.clientSecret,
|
|
975
|
+
refresh_token: input.refreshToken
|
|
976
|
+
};
|
|
977
|
+
(0,_lib_stores_credentials__WEBPACK_IMPORTED_MODULE_2__/* .updateCredential */ .nZ)(input.credentialId, {
|
|
978
|
+
auth_method: "oauth",
|
|
979
|
+
params: merged
|
|
1089
980
|
});
|
|
981
|
+
return {
|
|
982
|
+
ok: true
|
|
983
|
+
};
|
|
1090
984
|
}
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
985
|
+
const saved = (0,_lib_stores_integrations__WEBPACK_IMPORTED_MODULE_1__/* .saveIntegration */ .oO)("outlook", {
|
|
986
|
+
client_id: input.clientId,
|
|
987
|
+
client_secret: input.clientSecret,
|
|
988
|
+
refresh_token: input.refreshToken
|
|
989
|
+
});
|
|
990
|
+
if ("error" in saved) return saved;
|
|
991
|
+
return {
|
|
992
|
+
ok: true
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
/***/ }),
|
|
998
|
+
|
|
999
|
+
/***/ 89080:
|
|
1000
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1001
|
+
|
|
1002
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1003
|
+
/* harmony export */ Ah: () => (/* binding */ updateFlow),
|
|
1004
|
+
/* harmony export */ Dd: () => (/* binding */ exchangeCode),
|
|
1005
|
+
/* harmony export */ F8: () => (/* binding */ createFlow),
|
|
1006
|
+
/* harmony export */ i8: () => (/* binding */ getMicrosoftAccessToken),
|
|
1007
|
+
/* harmony export */ jG: () => (/* binding */ resolveMicrosoftAuth),
|
|
1008
|
+
/* harmony export */ lv: () => (/* binding */ getFlow),
|
|
1009
|
+
/* harmony export */ op: () => (/* binding */ graphPaged),
|
|
1010
|
+
/* harmony export */ xj: () => (/* binding */ buildAuthorizeUrl),
|
|
1011
|
+
/* harmony export */ z$: () => (/* binding */ graphFetch)
|
|
1012
|
+
/* harmony export */ });
|
|
1013
|
+
/* unused harmony export MICROSOFT_SCOPES */
|
|
1014
|
+
/* harmony import */ var _lib_stores_integrations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78228);
|
|
1015
|
+
/* harmony import */ var _lib_utils_oauth_flow_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56362);
|
|
1016
|
+
/* harmony import */ var _lib_utils_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53638);
|
|
1017
|
+
/* harmony import */ var _lib_utils_error__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22032);
|
|
1018
|
+
/* harmony import */ var _lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22632);
|
|
1019
|
+
// Ephemeral state store + shared auth helpers for the in-app Microsoft OAuth
|
|
1020
|
+
// flow. Mirrors lib/integrations/gmail-oauth.ts but targets the Microsoft
|
|
1021
|
+
// identity platform (v2.0 endpoint, common tenant by default) and Microsoft
|
|
1022
|
+
// Graph as the downstream API surface (Outlook Mail + Calendar in v1).
|
|
1023
|
+
//
|
|
1024
|
+
// The user types client_id + client_secret in the Integrations panel and
|
|
1025
|
+
// clicks "Connect Outlook". We POST those to /oauth/start, which stashes
|
|
1026
|
+
// them here keyed by a random `state` token and returns the Microsoft
|
|
1027
|
+
// authorize URL. The browser opens that URL; MS bounces back to
|
|
1028
|
+
// /oauth/callback with `?code&state`, which exchanges the code for a
|
|
1029
|
+
// refresh_token (granted because we asked for `offline_access`) and
|
|
1030
|
+
// persists the integration. The panel polls /oauth/status separately.
|
|
1031
|
+
//
|
|
1032
|
+
// Pinned to globalThis so HMR in dev doesn't lose pending flows.
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
const flowStore = (0,_lib_utils_oauth_flow_store__WEBPACK_IMPORTED_MODULE_1__/* .createOAuthFlowStore */ .R)({
|
|
1039
|
+
globalKey: "__msOauthFlows"
|
|
1040
|
+
});
|
|
1041
|
+
const createFlow = flowStore.create;
|
|
1042
|
+
const getFlow = flowStore.get;
|
|
1043
|
+
const updateFlow = flowStore.update;
|
|
1044
|
+
// Tenant selector. `common` accepts both personal Microsoft accounts
|
|
1045
|
+
// (@outlook.com, @hotmail.com, @live.com) and work/school M365 accounts.
|
|
1046
|
+
// Switch to `consumers` to lock to personal only, or `organizations` for
|
|
1047
|
+
// work/school only. We expose this as an env override for power users but
|
|
1048
|
+
// don't surface it in the UI yet.
|
|
1049
|
+
const TENANT = process.env.OUTLOOK_TENANT?.trim() || "common";
|
|
1050
|
+
// Delegated Graph scopes the agent needs. Keep narrow:
|
|
1051
|
+
// - offline_access → required for a refresh_token (MS counterpart of
|
|
1052
|
+
// Google's access_type=offline).
|
|
1053
|
+
// - User.Read → used by the test endpoint to call /me.
|
|
1054
|
+
// - Mail.ReadWrite → search/read mail, create drafts, mark read,
|
|
1055
|
+
// move to folders (incl. DeletedItems).
|
|
1056
|
+
// - Mail.Send → send mail when the user explicitly asks for it.
|
|
1057
|
+
// - Calendars.ReadWrite → list/get/create/update/delete events on the
|
|
1058
|
+
// user's existing calendars.
|
|
1059
|
+
// - Tasks.ReadWrite → list/get/create/update/complete/delete Microsoft
|
|
1060
|
+
// To Do tasks and lists (ms_todo_* tools).
|
|
1061
|
+
// - People.Read → resolve "who is X" / frequent contacts via
|
|
1062
|
+
// /me/people (ms_people_resolve tool).
|
|
1063
|
+
const MICROSOFT_SCOPES = [
|
|
1064
|
+
"offline_access",
|
|
1065
|
+
"User.Read",
|
|
1066
|
+
"Mail.ReadWrite",
|
|
1067
|
+
"Mail.Send",
|
|
1068
|
+
"Calendars.ReadWrite",
|
|
1069
|
+
"Tasks.ReadWrite",
|
|
1070
|
+
"People.Read"
|
|
1071
|
+
];
|
|
1072
|
+
function buildAuthorizeUrl(opts) {
|
|
1073
|
+
const p = new URLSearchParams({
|
|
1074
|
+
client_id: opts.clientId,
|
|
1075
|
+
redirect_uri: opts.redirectUri,
|
|
1076
|
+
response_type: "code",
|
|
1077
|
+
response_mode: "query",
|
|
1078
|
+
scope: MICROSOFT_SCOPES.join(" "),
|
|
1079
|
+
// Force consent so a returning user actually re-grants any newly-added
|
|
1080
|
+
// scope (otherwise MS silently reuses the prior grant minus the new bit).
|
|
1081
|
+
prompt: "consent",
|
|
1082
|
+
state: opts.state
|
|
1083
|
+
});
|
|
1084
|
+
return `https://login.microsoftonline.com/${TENANT}/oauth2/v2.0/authorize?${p.toString()}`;
|
|
1085
|
+
}
|
|
1086
|
+
// NOTE: Unlike Google, MS v2 endpoint **requires** the `scope` parameter on
|
|
1087
|
+
// every grant_type call (both authorization_code and refresh_token). Leaving
|
|
1088
|
+
// it out yields `AADSTS900144: The request body must contain the following
|
|
1089
|
+
// parameter: 'scope'.`. We always pass the full scope set.
|
|
1090
|
+
async function exchangeCode(opts) {
|
|
1091
|
+
const clientId = (0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__/* .sanitizeOAuthInput */ .d)(opts.clientId) ?? "";
|
|
1092
|
+
const clientSecret = (0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__/* .sanitizeOAuthInput */ .d)(opts.clientSecret) ?? "";
|
|
1093
|
+
const body = new URLSearchParams({
|
|
1094
|
+
code: opts.code,
|
|
1095
|
+
client_id: clientId,
|
|
1096
|
+
client_secret: clientSecret,
|
|
1097
|
+
redirect_uri: opts.redirectUri,
|
|
1098
|
+
grant_type: "authorization_code",
|
|
1099
|
+
scope: MICROSOFT_SCOPES.join(" ")
|
|
1100
|
+
});
|
|
1101
|
+
const res = await fetch(`https://login.microsoftonline.com/${TENANT}/oauth2/v2.0/token`, {
|
|
1102
|
+
method: "POST",
|
|
1103
|
+
headers: {
|
|
1104
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
1120
1105
|
},
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1106
|
+
body: body.toString(),
|
|
1107
|
+
signal: AbortSignal.timeout(30000)
|
|
1108
|
+
});
|
|
1109
|
+
const text = await res.text();
|
|
1110
|
+
const parsed = (0,_lib_utils_json__WEBPACK_IMPORTED_MODULE_3__/* .parseJsonSafe */ .p)(text, {});
|
|
1111
|
+
if (!res.ok) {
|
|
1112
|
+
const err = parsed["error_description"] || parsed["error"] || text || `HTTP ${res.status}`;
|
|
1113
|
+
console.error(`[microsoft-oauth] token exchange rejected (${res.status}): ${err} | client_id ${(0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__/* .secretFingerprint */ .n)(clientId)} | client_secret ${(0,_lib_utils_oauth_input__WEBPACK_IMPORTED_MODULE_2__/* .secretFingerprint */ .n)(clientSecret)}`);
|
|
1114
|
+
throw new Error(err);
|
|
1115
|
+
}
|
|
1116
|
+
return parsed;
|
|
1117
|
+
}
|
|
1118
|
+
function resolveMicrosoftAuth() {
|
|
1119
|
+
const envId = process.env.OUTLOOK_CLIENT_ID;
|
|
1120
|
+
const envSecret = process.env.OUTLOOK_CLIENT_SECRET;
|
|
1121
|
+
const envRefresh = process.env.OUTLOOK_REFRESH_TOKEN;
|
|
1122
|
+
if (envId && envSecret && envRefresh) {
|
|
1123
|
+
return {
|
|
1124
|
+
client_id: envId,
|
|
1125
|
+
client_secret: envSecret,
|
|
1126
|
+
refresh_token: envRefresh
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
const saved = (0,_lib_stores_integrations__WEBPACK_IMPORTED_MODULE_0__/* .getIntegrationRaw */ .$G)("outlook");
|
|
1130
|
+
if (saved?.client_id && saved.client_secret && saved.refresh_token) {
|
|
1131
|
+
return {
|
|
1132
|
+
client_id: saved.client_id,
|
|
1133
|
+
client_secret: saved.client_secret,
|
|
1134
|
+
refresh_token: saved.refresh_token
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
return {
|
|
1138
|
+
error: "Microsoft account not connected. Open the gear menu → Integrations tab → " + "Outlook card and click Connect Outlook to authorize Mail, Mail.Send, Calendar, Tasks, and People access."
|
|
1125
1139
|
};
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
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
|
|
1164
|
-
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
1165
|
-
// build-time fallback in `build/index.ts` so cache entries
|
|
1166
|
-
// and the response Cache-Control header agree on the route's
|
|
1167
|
-
// effective expire. Routes that opt out of revalidation
|
|
1168
|
-
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
1169
|
-
// keep `expire: undefined`.
|
|
1170
|
-
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
1171
|
-
// Create the cache entry for the response.
|
|
1172
|
-
const cacheEntry = {
|
|
1173
|
-
value: {
|
|
1174
|
-
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
1175
|
-
status: response.status,
|
|
1176
|
-
body: Buffer.from(await blob.arrayBuffer()),
|
|
1177
|
-
headers
|
|
1178
|
-
},
|
|
1179
|
-
cacheControl: {
|
|
1180
|
-
revalidate,
|
|
1181
|
-
expire
|
|
1182
|
-
}
|
|
1183
|
-
};
|
|
1184
|
-
return cacheEntry;
|
|
1185
|
-
} else {
|
|
1186
|
-
// send response without caching if not ISR
|
|
1187
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
1188
|
-
return null;
|
|
1189
|
-
}
|
|
1190
|
-
} catch (err) {
|
|
1191
|
-
// if this is a background revalidate we need to report
|
|
1192
|
-
// the request error here as it won't be bubbled
|
|
1193
|
-
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
1194
|
-
const silenceLog = false;
|
|
1195
|
-
await routeModule.onRequestError(req, err, {
|
|
1196
|
-
routerKind: 'App Router',
|
|
1197
|
-
routePath: srcPage,
|
|
1198
|
-
routeType: 'route',
|
|
1199
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1200
|
-
isStaticGeneration: cacheKey !== null,
|
|
1201
|
-
isOnDemandRevalidate
|
|
1202
|
-
})
|
|
1203
|
-
}, silenceLog, routerServerContext);
|
|
1204
|
-
}
|
|
1205
|
-
throw err;
|
|
1140
|
+
}
|
|
1141
|
+
const accessTokenCache = new Map();
|
|
1142
|
+
function cacheKey(auth) {
|
|
1143
|
+
return auth.refresh_token.slice(0, 20);
|
|
1144
|
+
}
|
|
1145
|
+
// Force-evict a cached access token (e.g. after a 401). The next call to
|
|
1146
|
+
// getMicrosoftAccessToken will refresh against the v2 token endpoint.
|
|
1147
|
+
function bustAccessToken(auth) {
|
|
1148
|
+
accessTokenCache.delete(cacheKey(auth));
|
|
1149
|
+
}
|
|
1150
|
+
async function getMicrosoftAccessToken(auth) {
|
|
1151
|
+
const key = cacheKey(auth);
|
|
1152
|
+
const cached = accessTokenCache.get(key);
|
|
1153
|
+
if (cached && cached.expires_at > Date.now() + 60000) return cached.token;
|
|
1154
|
+
const body = new URLSearchParams({
|
|
1155
|
+
client_id: auth.client_id,
|
|
1156
|
+
client_secret: auth.client_secret,
|
|
1157
|
+
refresh_token: auth.refresh_token,
|
|
1158
|
+
grant_type: "refresh_token",
|
|
1159
|
+
// Required on the v2 endpoint even for refresh_token grants.
|
|
1160
|
+
scope: MICROSOFT_SCOPES.join(" ")
|
|
1161
|
+
});
|
|
1162
|
+
try {
|
|
1163
|
+
const res = await fetch(`https://login.microsoftonline.com/${TENANT}/oauth2/v2.0/token`, {
|
|
1164
|
+
method: "POST",
|
|
1165
|
+
headers: {
|
|
1166
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
1167
|
+
},
|
|
1168
|
+
body: body.toString(),
|
|
1169
|
+
signal: AbortSignal.timeout(30000)
|
|
1170
|
+
});
|
|
1171
|
+
const text = await res.text();
|
|
1172
|
+
if (!res.ok) {
|
|
1173
|
+
accessTokenCache.delete(key);
|
|
1174
|
+
return {
|
|
1175
|
+
error: `Microsoft OAuth refresh failed (${res.status}): ${text.slice(0, 300)}`
|
|
1176
|
+
};
|
|
1206
1177
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1178
|
+
const parsed = JSON.parse(text);
|
|
1179
|
+
if (!parsed.access_token) return {
|
|
1180
|
+
error: "OAuth response missing access_token"
|
|
1181
|
+
};
|
|
1182
|
+
const expires_at = Date.now() + (parsed.expires_in ?? 3000) * 1000;
|
|
1183
|
+
accessTokenCache.set(key, {
|
|
1184
|
+
token: parsed.access_token,
|
|
1185
|
+
expires_at
|
|
1186
|
+
});
|
|
1187
|
+
return parsed.access_token;
|
|
1188
|
+
} catch (err) {
|
|
1189
|
+
return {
|
|
1190
|
+
error: `Microsoft OAuth refresh threw: ${(0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_4__/* .errorMessage */ .g)(err)}`
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
// Path-prefix → required Graph scope. Used to render helpful 403 messages
|
|
1195
|
+
// pointing the user at the exact scope they need to reconnect with.
|
|
1196
|
+
const SCOPE_HINTS = [
|
|
1197
|
+
{
|
|
1198
|
+
prefix: "/me/messages",
|
|
1199
|
+
scope: "Mail.ReadWrite"
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
prefix: "/me/mailFolders",
|
|
1203
|
+
scope: "Mail.ReadWrite"
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
prefix: "/me/sendMail",
|
|
1207
|
+
scope: "Mail.Send"
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
prefix: "/me/events",
|
|
1211
|
+
scope: "Calendars.ReadWrite"
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
prefix: "/me/calendar",
|
|
1215
|
+
scope: "Calendars.ReadWrite"
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
prefix: "/me/calendars",
|
|
1219
|
+
scope: "Calendars.ReadWrite"
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
prefix: "/me/todo",
|
|
1223
|
+
scope: "Tasks.ReadWrite"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
prefix: "/me/people",
|
|
1227
|
+
scope: "People.Read"
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
prefix: "/me/contacts",
|
|
1231
|
+
scope: "Contacts.Read"
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
prefix: "/me/drive",
|
|
1235
|
+
scope: "Files.Read"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
prefix: "/me/insights",
|
|
1239
|
+
scope: "Sites.Read.All"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
prefix: "/search/query",
|
|
1243
|
+
scope: "Mail.Read Files.Read.All"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
prefix: "/me",
|
|
1247
|
+
scope: "User.Read"
|
|
1248
|
+
}
|
|
1249
|
+
];
|
|
1250
|
+
function scopeHintFor(path) {
|
|
1251
|
+
const p = path.startsWith("http") ? new URL(path).pathname.replace(/^\/v1\.0/, "") : path;
|
|
1252
|
+
for (const { prefix, scope } of SCOPE_HINTS){
|
|
1253
|
+
if (p.startsWith(prefix)) return scope;
|
|
1254
|
+
}
|
|
1255
|
+
return null;
|
|
1256
|
+
}
|
|
1257
|
+
function parseRetryAfter(headerVal) {
|
|
1258
|
+
if (!headerVal) return 0;
|
|
1259
|
+
const secs = Number.parseInt(headerVal, 10);
|
|
1260
|
+
if (Number.isFinite(secs) && secs >= 0) return Math.min(secs, 30) * 1000;
|
|
1261
|
+
const ts = Date.parse(headerVal);
|
|
1262
|
+
if (!Number.isNaN(ts)) return Math.max(0, Math.min(ts - Date.now(), 30000));
|
|
1263
|
+
return 0;
|
|
1264
|
+
}
|
|
1265
|
+
function backoffFor(attempt) {
|
|
1266
|
+
return Math.min(500 * 2 ** attempt, 4000);
|
|
1267
|
+
}
|
|
1268
|
+
// Shared Graph fetch helper. Used by lib/tools/outlook.ts,
|
|
1269
|
+
// lib/tools/outlook-calendar.ts, lib/tools/ms-todo.ts, lib/tools/ms-graph.ts.
|
|
1270
|
+
// Returns parsed JSON or { error: string, url? }. 204 No Content returns
|
|
1271
|
+
// { ok: true }.
|
|
1272
|
+
//
|
|
1273
|
+
// Built-in resilience:
|
|
1274
|
+
// - 401 Unauthorized → drop the cached access token and retry once with a
|
|
1275
|
+
// freshly refreshed one (covers token-revoked-mid-cache edge cases).
|
|
1276
|
+
// - 429 / 503 → honour the `Retry-After` header (capped at 30s) or fall
|
|
1277
|
+
// back to exponential backoff. Retries up to 3 times.
|
|
1278
|
+
// - 403 Forbidden → surface a scope hint ("reconnect with X") so the
|
|
1279
|
+
// operator knows what to grant.
|
|
1280
|
+
async function graphFetch(auth, path, init) {
|
|
1281
|
+
const url = path.startsWith("http") ? path : `https://graph.microsoft.com/v1.0${path}`;
|
|
1282
|
+
let attempt = 0;
|
|
1283
|
+
let triedReauth = false;
|
|
1284
|
+
while(true){
|
|
1285
|
+
const token = await getMicrosoftAccessToken(auth);
|
|
1286
|
+
if (typeof token !== "string") return token;
|
|
1287
|
+
let res;
|
|
1209
1288
|
try {
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
isRoutePPREnabled: false,
|
|
1220
|
-
isOnDemandRevalidate,
|
|
1221
|
-
revalidateOnlyGenerated,
|
|
1222
|
-
responseGenerator,
|
|
1223
|
-
waitUntil: ctx.waitUntil,
|
|
1224
|
-
isMinimalMode
|
|
1289
|
+
res = await fetch(url, {
|
|
1290
|
+
...init,
|
|
1291
|
+
headers: {
|
|
1292
|
+
Authorization: `Bearer ${token}`,
|
|
1293
|
+
Accept: "application/json",
|
|
1294
|
+
"Content-Type": "application/json",
|
|
1295
|
+
...init?.headers ?? {}
|
|
1296
|
+
},
|
|
1297
|
+
signal: AbortSignal.timeout(30000)
|
|
1225
1298
|
});
|
|
1226
|
-
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
1227
|
-
throw cacheEntry.error;
|
|
1228
|
-
}
|
|
1229
|
-
// we don't create a cacheEntry for ISR
|
|
1230
|
-
if (!isIsr) {
|
|
1231
|
-
return;
|
|
1232
|
-
}
|
|
1233
|
-
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) {
|
|
1234
|
-
var _cacheEntry_value1;
|
|
1235
|
-
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
1236
|
-
}
|
|
1237
|
-
if (!isMinimalMode) {
|
|
1238
|
-
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
1239
|
-
}
|
|
1240
|
-
// Draft mode should never be cached
|
|
1241
|
-
if (isDraftMode) {
|
|
1242
|
-
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
1243
|
-
}
|
|
1244
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
1245
|
-
if (!(isMinimalMode && isIsr)) {
|
|
1246
|
-
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
1247
|
-
}
|
|
1248
|
-
// If cache control is already set on the response we don't
|
|
1249
|
-
// override it to allow users to customize it via next.config
|
|
1250
|
-
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
1251
|
-
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
1252
|
-
}
|
|
1253
|
-
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'.
|
|
1254
|
-
new Response(cacheEntry.value.body, {
|
|
1255
|
-
headers,
|
|
1256
|
-
status: cacheEntry.value.status || 200
|
|
1257
|
-
}));
|
|
1258
|
-
return;
|
|
1259
1299
|
} catch (err) {
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
});
|
|
1287
|
-
currentSpan.setAttribute('error.type', error.name);
|
|
1288
|
-
}
|
|
1289
|
-
if (!res.writableEnded && !res.destroyed) {
|
|
1290
|
-
res.end();
|
|
1300
|
+
return {
|
|
1301
|
+
error: `Graph fetch threw: ${(0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_4__/* .errorMessage */ .g)(err)}`,
|
|
1302
|
+
url
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
if (res.status === 204) return {
|
|
1306
|
+
ok: true
|
|
1307
|
+
};
|
|
1308
|
+
if (res.status === 401 && !triedReauth) {
|
|
1309
|
+
triedReauth = true;
|
|
1310
|
+
bustAccessToken(auth);
|
|
1311
|
+
continue;
|
|
1312
|
+
}
|
|
1313
|
+
if ((res.status === 429 || res.status === 503) && attempt < 3) {
|
|
1314
|
+
const waitMs = parseRetryAfter(res.headers.get("Retry-After")) ?? backoffFor(attempt);
|
|
1315
|
+
attempt += 1;
|
|
1316
|
+
await new Promise((r)=>setTimeout(r, waitMs));
|
|
1317
|
+
continue;
|
|
1318
|
+
}
|
|
1319
|
+
const text = await res.text();
|
|
1320
|
+
if (!res.ok) {
|
|
1321
|
+
let msg = `Graph ${res.status}: ${text.slice(0, 500)}`;
|
|
1322
|
+
if (res.status === 403) {
|
|
1323
|
+
const hint = scopeHintFor(path);
|
|
1324
|
+
if (hint) {
|
|
1325
|
+
msg += ` — reconnect the Microsoft integration with scope: ${hint}`;
|
|
1291
1326
|
}
|
|
1292
|
-
} else {
|
|
1293
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
1294
|
-
status: 500
|
|
1295
|
-
}));
|
|
1296
1327
|
}
|
|
1297
|
-
return
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
if (!currentSpan) {
|
|
1302
|
-
return;
|
|
1303
|
-
}
|
|
1304
|
-
let statusCode = res.statusCode;
|
|
1305
|
-
currentSpan.setAttributes({
|
|
1306
|
-
'http.status_code': statusCode,
|
|
1307
|
-
'next.rsc': false
|
|
1308
|
-
});
|
|
1309
|
-
if (statusCode && statusCode >= 500) {
|
|
1310
|
-
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
1311
|
-
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
1312
|
-
currentSpan.setStatus({
|
|
1313
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
1314
|
-
});
|
|
1315
|
-
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
1316
|
-
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
1317
|
-
}
|
|
1318
|
-
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
1319
|
-
// We were unable to get attributes, probably OTEL is not enabled
|
|
1320
|
-
if (!rootSpanAttributes) {
|
|
1321
|
-
return;
|
|
1322
|
-
}
|
|
1323
|
-
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
1324
|
-
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
1325
|
-
return;
|
|
1326
|
-
}
|
|
1327
|
-
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
1328
|
-
const name = `${method} ${route}`;
|
|
1329
|
-
currentSpan.setAttributes({
|
|
1330
|
-
'next.route': route,
|
|
1331
|
-
'http.route': route,
|
|
1332
|
-
'next.span_name': name
|
|
1333
|
-
});
|
|
1334
|
-
currentSpan.updateName(name);
|
|
1335
|
-
// Propagate http.route to the parent span if one exists (e.g.
|
|
1336
|
-
// a platform-created HTTP span in adapter deployments).
|
|
1337
|
-
if (parentSpan && parentSpan !== currentSpan) {
|
|
1338
|
-
parentSpan.setAttribute('http.route', route);
|
|
1339
|
-
parentSpan.updateName(name);
|
|
1340
|
-
}
|
|
1341
|
-
})();
|
|
1328
|
+
return {
|
|
1329
|
+
error: msg,
|
|
1330
|
+
url
|
|
1331
|
+
};
|
|
1342
1332
|
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1333
|
+
try {
|
|
1334
|
+
return JSON.parse(text);
|
|
1335
|
+
} catch {
|
|
1336
|
+
return text;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
// Follow @odata.nextLink across pages and concatenate `value` arrays.
|
|
1341
|
+
// Stops at `maxPages` (default 5) to bound context cost. Returns the same
|
|
1342
|
+
// shape as graphFetch (object with `.value`) but with the merged array, or
|
|
1343
|
+
// the original error shape if any page errored.
|
|
1344
|
+
async function graphPaged(auth, path, opts) {
|
|
1345
|
+
const maxPages = opts?.maxPages ?? 5;
|
|
1346
|
+
let current = path;
|
|
1347
|
+
const merged = [];
|
|
1348
|
+
let pages = 0;
|
|
1349
|
+
while(current && pages < maxPages){
|
|
1350
|
+
const page = await graphFetch(auth, current, opts?.init);
|
|
1351
|
+
if (page && typeof page === "object" && "error" in page) return page;
|
|
1352
|
+
const body = page;
|
|
1353
|
+
if (Array.isArray(body.value)) merged.push(...body.value);
|
|
1354
|
+
current = typeof body["@odata.nextLink"] === "string" ? body["@odata.nextLink"] : null;
|
|
1355
|
+
pages += 1;
|
|
1358
1356
|
}
|
|
1357
|
+
return {
|
|
1358
|
+
value: merged,
|
|
1359
|
+
pages
|
|
1360
|
+
};
|
|
1359
1361
|
}
|
|
1360
1362
|
|
|
1361
|
-
//# sourceMappingURL=app-route.js.map
|
|
1362
1363
|
|
|
1364
|
+
/***/ }),
|
|
1365
|
+
|
|
1366
|
+
/***/ 94735:
|
|
1367
|
+
/***/ ((module) => {
|
|
1368
|
+
|
|
1369
|
+
module.exports = require("events");
|
|
1363
1370
|
|
|
1364
1371
|
/***/ }),
|
|
1365
1372
|
|
|
@@ -1377,7 +1384,7 @@ module.exports = import("@huggingface/transformers");;
|
|
|
1377
1384
|
var __webpack_require__ = require("../../../../../../../webpack-runtime.js");
|
|
1378
1385
|
__webpack_require__.C(exports);
|
|
1379
1386
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
1380
|
-
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46], () => (__webpack_exec__(
|
|
1387
|
+
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,4992,46], () => (__webpack_exec__(82637)));
|
|
1381
1388
|
module.exports = __webpack_exports__;
|
|
1382
1389
|
|
|
1383
1390
|
})();
|