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