@circuitwall/jarela 2.2.1 → 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 +6 -5
- 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 +143 -143
- package/.next/standalone/.next/server/app/api/v1/models/route.js +543 -543
- 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 +44 -44
- 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 +1243 -854
- 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 +6 -5
- package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +335 -986
- 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 +28 -28
- 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 +1 -1
- 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} +8 -3
- package/.next/standalone/.next/server/chunks/4433.js +146 -146
- package/.next/standalone/.next/server/chunks/4508.js +1 -1
- package/.next/standalone/.next/server/chunks/4588.js +1 -0
- package/.next/standalone/.next/server/chunks/46.js +5 -0
- package/.next/standalone/.next/server/chunks/466.js +12 -0
- package/.next/standalone/.next/server/chunks/4868.js +206 -206
- package/.next/standalone/.next/server/chunks/4992.js +13 -0
- package/.next/standalone/.next/server/chunks/5120.js +963 -0
- package/.next/standalone/.next/server/chunks/5701.js +1 -1
- package/.next/standalone/.next/server/chunks/5900.js +1 -1
- package/.next/standalone/.next/server/chunks/6210.js +1 -0
- package/.next/standalone/.next/server/chunks/6213.js +1 -1
- package/.next/standalone/.next/server/chunks/6649.js +2 -2
- 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} +33173 -31461
- package/.next/standalone/.next/server/chunks/9237.js +396 -396
- package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1628 -570
- 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 +415 -397
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{1395-a340fb0a345382a4.js → 1395-e4a99912b8f83044.js} +13 -1
- package/.next/standalone/.next/static/chunks/app/_global-error/{page-36cb8b428b38b26a.js → page-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/access/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6fc5f8e744c81802.js +17 -0
- package/.next/standalone/.next/static/chunks/app/{page-7017f07f8a7a083c.js → page-213a623b37226452.js} +1041 -652
- 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 +25 -0
- package/api/client.ts +9 -0
- package/api/types.ts +29 -0
- package/app/api/v1/lifecycle/adoption/route.ts +14 -2
- package/app/api/v1/models/[name]/compact-threads/route.ts +14 -11
- package/app/api/v1/threads/[thread_id]/activity/route.ts +19 -0
- package/app/api/v1/threads/[thread_id]/context-pin/route.test.ts +1 -0
- package/app/api/v1/threads/[thread_id]/context-pin/route.ts +2 -1
- package/app/api/v1/threads/[thread_id]/route.ts +5 -1
- package/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/ui/BootScreen.tsx +17 -0
- package/components/ui/WorkflowChecklist.tsx +71 -33
- 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/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 +86 -1
- package/lib/agents/thread-activity.test.ts +31 -0
- package/lib/agents/thread-activity.ts +27 -0
- package/lib/agents/thread-compaction-state.test.ts +82 -0
- package/lib/agents/thread-compaction-state.ts +121 -0
- package/lib/agents/thread-compaction.test.ts +83 -4
- package/lib/agents/thread-compaction.ts +34 -11
- package/lib/agents/warm-summary-background.test.ts +219 -5
- package/lib/agents/warm-summary-background.ts +325 -142
- 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 +5 -0
- package/lib/env/config.ts +2 -0
- package/lib/env/schema.ts +12 -0
- package/lib/lifecycle/changeset-build.test.ts +93 -0
- package/lib/lifecycle/changeset-build.ts +210 -0
- package/lib/lifecycle/changesets.test.ts +101 -0
- package/lib/lifecycle/changesets.ts +166 -0
- package/lib/lifecycle/surface-collect.test.ts +88 -0
- package/lib/lifecycle/surface-collect.ts +64 -0
- package/lib/lifecycle/surface-snapshot.test.ts +104 -0
- package/lib/lifecycle/surface-snapshot.ts +210 -0
- package/lib/memory/record.ts +0 -2
- package/lib/providers/external.ts +0 -2
- package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
- 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/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_ssgManifest.js +0 -0
|
@@ -407,962 +407,962 @@ function isLifecycleManaged(file, policy) {
|
|
|
407
407
|
|
|
408
408
|
/***/ }),
|
|
409
409
|
|
|
410
|
-
/***/
|
|
411
|
-
/***/ ((module) => {
|
|
412
|
-
|
|
413
|
-
"use strict";
|
|
414
|
-
module.exports = require("crypto");
|
|
415
|
-
|
|
416
|
-
/***/ }),
|
|
417
|
-
|
|
418
|
-
/***/ 57477:
|
|
410
|
+
/***/ 53805:
|
|
419
411
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
420
412
|
|
|
421
413
|
"use strict";
|
|
414
|
+
__webpack_require__.r(__webpack_exports__);
|
|
422
415
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
423
|
-
/* harmony export */
|
|
416
|
+
/* harmony export */ handler: () => (/* binding */ handler),
|
|
417
|
+
/* harmony export */ patchFetch: () => (/* binding */ patchFetch),
|
|
418
|
+
/* harmony export */ routeModule: () => (/* binding */ routeModule),
|
|
419
|
+
/* harmony export */ serverHooks: () => (/* binding */ serverHooks),
|
|
420
|
+
/* harmony export */ workAsyncStorage: () => (/* binding */ workAsyncStorage),
|
|
421
|
+
/* harmony export */ workUnitAsyncStorage: () => (/* binding */ workUnitAsyncStorage)
|
|
424
422
|
/* harmony export */ });
|
|
425
|
-
/* harmony import */ var
|
|
426
|
-
/* harmony import */ var
|
|
427
|
-
/* harmony import */ var
|
|
428
|
-
/* harmony import */ var
|
|
429
|
-
/* harmony import */ var
|
|
430
|
-
/* harmony import */ var
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
423
|
+
/* harmony import */ var next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19225);
|
|
424
|
+
/* 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__);
|
|
425
|
+
/* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84006);
|
|
426
|
+
/* harmony import */ var next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8317);
|
|
427
|
+
/* 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__);
|
|
428
|
+
/* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(99373);
|
|
429
|
+
/* 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__);
|
|
430
|
+
/* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34775);
|
|
431
|
+
/* 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__);
|
|
432
|
+
/* harmony import */ var next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24235);
|
|
433
|
+
/* 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__);
|
|
434
|
+
/* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(261);
|
|
435
|
+
/* 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__);
|
|
436
|
+
/* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54365);
|
|
437
|
+
/* 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__);
|
|
438
|
+
/* harmony import */ var next_dist_server_web_spec_extension_adapters_next_request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(90771);
|
|
439
|
+
/* 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__);
|
|
440
|
+
/* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73461);
|
|
441
|
+
/* 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__);
|
|
442
|
+
/* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67798);
|
|
443
|
+
/* harmony import */ var next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(92280);
|
|
444
|
+
/* harmony import */ var next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(62018);
|
|
445
|
+
/* 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__);
|
|
446
|
+
/* harmony import */ var next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(45696);
|
|
447
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47929);
|
|
448
|
+
/* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__);
|
|
449
|
+
/* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(86439);
|
|
450
|
+
/* 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__);
|
|
451
|
+
/* harmony import */ var next_dist_server_lib_route_cache_key__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10246);
|
|
452
|
+
/* 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__);
|
|
453
|
+
/* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(37527);
|
|
454
|
+
/* 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__);
|
|
439
455
|
|
|
440
456
|
|
|
441
457
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
// We inject the nextConfigOutput here so that we can use them in the route
|
|
474
|
+
// module.
|
|
475
|
+
const nextConfigOutput = "standalone"
|
|
476
|
+
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
477
|
+
definition: {
|
|
478
|
+
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
479
|
+
page: "/api/v1/attachments/images/route",
|
|
480
|
+
pathname: "/api/v1/attachments/images",
|
|
481
|
+
filename: "route",
|
|
482
|
+
bundlePath: "app/api/v1/attachments/images/route"
|
|
483
|
+
},
|
|
484
|
+
distDir: ".next" || 0,
|
|
485
|
+
relativeProjectDir: false || '',
|
|
486
|
+
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/attachments/images/route.ts",
|
|
487
|
+
nextConfigOutput,
|
|
488
|
+
// The lazy require factory ensures that:
|
|
489
|
+
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
490
|
+
// correctly attributing module load time to application-code rather than
|
|
491
|
+
// framework internals.
|
|
492
|
+
// - In all modes: async modules (route files with top-level await) are
|
|
493
|
+
// handled correctly — require() returns a Promise for such modules, which
|
|
494
|
+
// ensureUserland() awaits before the first request is handled.
|
|
495
|
+
userland: ()=>__webpack_require__(28586),
|
|
496
|
+
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
497
|
+
// server HMR updates are picked up without re-executing the entry chunk.
|
|
498
|
+
// Using require() (synchronous) avoids adding async overhead that would be
|
|
499
|
+
// incorrectly attributed to application-code time in devRequestTiming.
|
|
500
|
+
... false ? 0 : {}
|
|
501
|
+
});
|
|
502
|
+
// Pull out the exports that we need to expose from the module. This should
|
|
503
|
+
// be eliminated when we've moved the other routes to the new format. These
|
|
504
|
+
// are used to hook into the route.
|
|
505
|
+
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
506
|
+
function patchFetch() {
|
|
507
|
+
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
508
|
+
workAsyncStorage,
|
|
509
|
+
workUnitAsyncStorage
|
|
464
510
|
});
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
entries = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync)(legacyDir);
|
|
471
|
-
} catch {
|
|
472
|
-
entries = [];
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
async function handler(req, res, ctx) {
|
|
514
|
+
if (ctx.requestMeta) {
|
|
515
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.setRequestMeta)(req, ctx.requestMeta);
|
|
473
516
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
const from = (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)(legacyDir, name);
|
|
477
|
-
const to = (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)(newDir, name);
|
|
478
|
-
if ((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(to)) continue;
|
|
479
|
-
try {
|
|
480
|
-
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.renameSync)(from, to);
|
|
481
|
-
moved++;
|
|
482
|
-
} catch (err) {
|
|
483
|
-
// EXDEV: cross-volume rename. EPERM/EBUSY: locked by another
|
|
484
|
-
// process. Non-fatal: skip this item and continue with the rest.
|
|
485
|
-
console.warn(`[jarela] could not move ${from} -> ${to}: ${err.message}`);
|
|
486
|
-
}
|
|
517
|
+
if (routeModule.isDev) {
|
|
518
|
+
(0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
|
487
519
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
|
|
520
|
+
let srcPage = "/api/v1/attachments/images/route";
|
|
521
|
+
// turbopack doesn't normalize `/index` in the page name
|
|
522
|
+
// so we need to to process dynamic routes properly
|
|
523
|
+
// TODO: fix turbopack providing differing value from webpack
|
|
524
|
+
if (false) {} else if (srcPage === '/index') {
|
|
525
|
+
// we always normalize /index specifically
|
|
526
|
+
srcPage = '/';
|
|
494
527
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
528
|
+
const multiZoneDraftMode = false;
|
|
529
|
+
const prepareResult = await routeModule.prepare(req, res, {
|
|
530
|
+
srcPage,
|
|
531
|
+
multiZoneDraftMode
|
|
532
|
+
});
|
|
533
|
+
if (!prepareResult) {
|
|
534
|
+
res.statusCode = 400;
|
|
535
|
+
res.end('Bad Request');
|
|
536
|
+
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
|
537
|
+
return null;
|
|
504
538
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
539
|
+
const { buildId, deploymentId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest, previewProps } = prepareResult;
|
|
540
|
+
const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_6__.normalizeAppPath)(srcPage);
|
|
541
|
+
// Only this route's prerenders can establish ISR or admit generated params.
|
|
542
|
+
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]));
|
|
543
|
+
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || isPrerendered);
|
|
544
|
+
const render404 = async ()=>{
|
|
545
|
+
// TODO: should route-module itself handle rendering the 404
|
|
546
|
+
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
|
547
|
+
await routerServerContext.render404(req, res, parsedUrl, false);
|
|
548
|
+
} else {
|
|
549
|
+
res.end('This page could not be found');
|
|
550
|
+
}
|
|
551
|
+
return null;
|
|
552
|
+
};
|
|
553
|
+
if (isIsr && !isDraftMode) {
|
|
554
|
+
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
555
|
+
if (prerenderInfo) {
|
|
556
|
+
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
557
|
+
if (nextConfig.adapterPath) {
|
|
558
|
+
return await render404();
|
|
559
|
+
}
|
|
560
|
+
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
561
|
+
}
|
|
510
562
|
}
|
|
511
|
-
} catch {}
|
|
512
|
-
if (moved > 0) {
|
|
513
|
-
console.info(`[jarela] migrated ${moved} entries from ${legacyDir} -> ${newDir}`);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
function getDataDir() {
|
|
517
|
-
if (cached) return cached;
|
|
518
|
-
const envDir = process.env.JARELA_DB_DIR;
|
|
519
|
-
const newDir = envDir ? expandHome(envDir) : defaultDataDir();
|
|
520
|
-
// Only run the old LangGUI rebrand migration for the default location; if
|
|
521
|
-
// the user customized JARELA_DB_DIR they're explicitly opting out.
|
|
522
|
-
if (!envDir) {
|
|
523
|
-
migrateLegacyDir((0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_1__.homedir)(), ".langgui"), newDir);
|
|
524
563
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
function defaultDataDir() {
|
|
532
|
-
if (process.platform === "win32") {
|
|
533
|
-
const local = process.env.LOCALAPPDATA ?? (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_1__.homedir)(), "AppData", "Local");
|
|
534
|
-
return (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)(local, "Jarela");
|
|
564
|
+
let cacheKey = null;
|
|
565
|
+
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
|
566
|
+
cacheKey = resolvedPathname;
|
|
567
|
+
// ensure /index and / is normalized to one key
|
|
568
|
+
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
|
535
569
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
"use strict";
|
|
546
|
-
|
|
547
|
-
// EXPORTS
|
|
548
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
549
|
-
kx: () => (/* binding */ readFileRef),
|
|
550
|
-
vw: () => (/* binding */ readImageRef),
|
|
551
|
-
fX: () => (/* binding */ spillAttachments),
|
|
552
|
-
spillFileBuffer: () => (/* binding */ spillFileBuffer),
|
|
553
|
-
ui: () => (/* binding */ spillImageBuffer),
|
|
554
|
-
Jb: () => (/* binding */ spillImagePart)
|
|
555
|
-
});
|
|
556
|
-
|
|
557
|
-
// EXTERNAL MODULE: external "node:fs"
|
|
558
|
-
var external_node_fs_ = __webpack_require__(73024);
|
|
559
|
-
// EXTERNAL MODULE: external "node:path"
|
|
560
|
-
var external_node_path_ = __webpack_require__(76760);
|
|
561
|
-
// EXTERNAL MODULE: external "node:crypto"
|
|
562
|
-
var external_node_crypto_ = __webpack_require__(77598);
|
|
563
|
-
// EXTERNAL MODULE: ./lib/files.ts
|
|
564
|
-
var files = __webpack_require__(52907);
|
|
565
|
-
;// ./lib/attachments/shrink.ts
|
|
566
|
-
// Image shrink helper for the attachment spill pipeline.
|
|
567
|
-
//
|
|
568
|
-
// The vision APIs of every provider we speak to today accept an image
|
|
569
|
-
// as a base64 blob in the request body, but they don't need a 4032×3024
|
|
570
|
-
// iPhone photo to answer "who's in this picture?" — the model's vision
|
|
571
|
-
// encoder downsamples to a fixed grid anyway (Anthropic ~1568px, OpenAI
|
|
572
|
-
// ~2048px, Gemini ~3072px). Shipping the original is pure waste: it
|
|
573
|
-
// costs upload latency, tokens (image tokens scale with pixels on some
|
|
574
|
-
// providers), and disk space post-spill.
|
|
575
|
-
//
|
|
576
|
-
// Runs at ingest inside `spillImagePart` so every ref on disk starts
|
|
577
|
-
// already resized. See ADR-0065 (spill) and ADR-0066 (this).
|
|
578
|
-
// Providers reject or misrender these — always transcode to JPEG.
|
|
579
|
-
const FORCE_TO_JPEG = new Set([
|
|
580
|
-
"image/heic",
|
|
581
|
-
"image/heif",
|
|
582
|
-
"image/bmp",
|
|
583
|
-
"image/tiff"
|
|
584
|
-
]);
|
|
585
|
-
// Formats where we always keep the source bytes as-is: vector or animated.
|
|
586
|
-
const ALWAYS_PASSTHROUGH = new Set([
|
|
587
|
-
"image/svg+xml",
|
|
588
|
-
"image/gif"
|
|
589
|
-
]);
|
|
590
|
-
/**
|
|
591
|
-
* Resize and re-encode an image if doing so shrinks the payload without
|
|
592
|
-
* losing meaningful information. Preserves alpha (stays PNG), converts
|
|
593
|
-
* HEIC/BMP/TIFF to JPEG, leaves SVG/GIF untouched.
|
|
594
|
-
*
|
|
595
|
-
* Never throws — a decode failure returns the input unchanged so the
|
|
596
|
-
* caller can still spill something rather than lose the attachment.
|
|
597
|
-
*/ async function shrinkImage(input, mediaType, opts = {}) {
|
|
598
|
-
const maxEdge = opts.maxEdge ?? 1600;
|
|
599
|
-
const jpegQuality = opts.jpegQuality ?? 85;
|
|
600
|
-
const minBytesToTouch = opts.minBytesToTouch ?? 64 * 1024;
|
|
601
|
-
const mt = mediaType.toLowerCase();
|
|
602
|
-
if (ALWAYS_PASSTHROUGH.has(mt)) {
|
|
603
|
-
return {
|
|
604
|
-
buf: input,
|
|
605
|
-
media_type: mediaType,
|
|
606
|
-
width: 0,
|
|
607
|
-
height: 0,
|
|
608
|
-
passthrough: true
|
|
609
|
-
};
|
|
610
|
-
}
|
|
611
|
-
// Dynamic import: sharp loads a native binary, don't pay that cost on
|
|
612
|
-
// installs that never see an image ingest. Not in tsconfig paths so
|
|
613
|
-
// it resolves relative to node_modules at runtime.
|
|
614
|
-
let sharpFn;
|
|
615
|
-
try {
|
|
616
|
-
const mod = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 42482));
|
|
617
|
-
sharpFn = mod.default;
|
|
618
|
-
} catch (err) {
|
|
619
|
-
console.warn("[shrink] sharp unavailable, passing image through:", err.message);
|
|
620
|
-
return {
|
|
621
|
-
buf: input,
|
|
622
|
-
media_type: mediaType,
|
|
623
|
-
width: 0,
|
|
624
|
-
height: 0,
|
|
625
|
-
passthrough: true
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
let meta;
|
|
629
|
-
try {
|
|
630
|
-
meta = await sharpFn(input, {
|
|
631
|
-
failOn: "none"
|
|
632
|
-
}).metadata();
|
|
633
|
-
} catch (err) {
|
|
634
|
-
console.warn("[shrink] decode failed, passing through:", err.message);
|
|
635
|
-
return {
|
|
636
|
-
buf: input,
|
|
637
|
-
media_type: mediaType,
|
|
638
|
-
width: 0,
|
|
639
|
-
height: 0,
|
|
640
|
-
passthrough: true
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
const width = meta.width ?? 0;
|
|
644
|
-
const height = meta.height ?? 0;
|
|
645
|
-
const longestEdge = Math.max(width, height);
|
|
646
|
-
const forceJpeg = FORCE_TO_JPEG.has(mt);
|
|
647
|
-
const wantResize = longestEdge > maxEdge;
|
|
648
|
-
// Early bail-out: tiny file, in-bounds, and no forced transcode.
|
|
649
|
-
if (!forceJpeg && !wantResize && input.length <= minBytesToTouch) {
|
|
650
|
-
return {
|
|
651
|
-
buf: input,
|
|
652
|
-
media_type: mediaType,
|
|
653
|
-
width,
|
|
654
|
-
height,
|
|
655
|
-
passthrough: true
|
|
656
|
-
};
|
|
657
|
-
}
|
|
658
|
-
// Preserve alpha by keeping PNG when the source has it — dropping to
|
|
659
|
-
// JPEG would flatten transparent regions to black.
|
|
660
|
-
const keepPng = !forceJpeg && (meta.hasAlpha ?? false) && mt === "image/png";
|
|
661
|
-
const outMediaType = keepPng ? "image/png" : "image/jpeg";
|
|
662
|
-
try {
|
|
663
|
-
let pipeline = sharpFn(input, {
|
|
664
|
-
failOn: "none"
|
|
570
|
+
// Before rendering (which initializes component tree modules), we have to
|
|
571
|
+
// set the reference manifests to our global store so Server Action's
|
|
572
|
+
// encryption util can access to them at the top level of the page module.
|
|
573
|
+
if (serverActionsManifest && clientReferenceManifest) {
|
|
574
|
+
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
575
|
+
page: srcPage,
|
|
576
|
+
clientReferenceManifest,
|
|
577
|
+
serverActionsManifest
|
|
665
578
|
});
|
|
666
|
-
if (wantResize) {
|
|
667
|
-
pipeline = pipeline.resize({
|
|
668
|
-
width: maxEdge,
|
|
669
|
-
height: maxEdge,
|
|
670
|
-
fit: "inside",
|
|
671
|
-
withoutEnlargement: true
|
|
672
|
-
});
|
|
673
|
-
}
|
|
674
|
-
// Strip EXIF (may contain location) and re-encode.
|
|
675
|
-
pipeline = pipeline.rotate(); // apply EXIF orientation before stripping metadata
|
|
676
|
-
const outBuf = keepPng ? await pipeline.png({
|
|
677
|
-
compressionLevel: 9,
|
|
678
|
-
adaptiveFiltering: true
|
|
679
|
-
}).toBuffer() : await pipeline.jpeg({
|
|
680
|
-
quality: jpegQuality,
|
|
681
|
-
mozjpeg: true
|
|
682
|
-
}).toBuffer();
|
|
683
|
-
// If the "shrink" made the file BIGGER (already-optimised small JPEG
|
|
684
|
-
// running through mozjpeg can occasionally grow) and no format change
|
|
685
|
-
// was forced, fall back to the original.
|
|
686
|
-
if (!forceJpeg && !wantResize && outBuf.length >= input.length) {
|
|
687
|
-
return {
|
|
688
|
-
buf: input,
|
|
689
|
-
media_type: mediaType,
|
|
690
|
-
width,
|
|
691
|
-
height,
|
|
692
|
-
passthrough: true
|
|
693
|
-
};
|
|
694
|
-
}
|
|
695
|
-
// Re-read metadata for the exact output dimensions.
|
|
696
|
-
const outMeta = await sharpFn(outBuf, {
|
|
697
|
-
failOn: "none"
|
|
698
|
-
}).metadata().catch(()=>meta);
|
|
699
|
-
return {
|
|
700
|
-
buf: outBuf,
|
|
701
|
-
media_type: outMediaType,
|
|
702
|
-
width: outMeta.width ?? width,
|
|
703
|
-
height: outMeta.height ?? height,
|
|
704
|
-
passthrough: false
|
|
705
|
-
};
|
|
706
|
-
} catch (err) {
|
|
707
|
-
console.warn("[shrink] encode failed, passing through:", err.message);
|
|
708
|
-
return {
|
|
709
|
-
buf: input,
|
|
710
|
-
media_type: mediaType,
|
|
711
|
-
width,
|
|
712
|
-
height,
|
|
713
|
-
passthrough: true
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
;// ./lib/attachments/spill.ts
|
|
719
|
-
// Attachment spill store.
|
|
720
|
-
//
|
|
721
|
-
// Turns inline `image`/`file` ContentParts (base64 or text blob in the
|
|
722
|
-
// message row) into `image_ref`/`file_ref` parts that point at a file under
|
|
723
|
-
// `<dataDir>/files/`. The message row shrinks from ~400 KB per image to
|
|
724
|
-
// ~200 B; `toBaseMessages` in lib/agents/llm.ts reads the file back only
|
|
725
|
-
// when it needs to (see ADR-0090), so the bytes never enter the checkpoint
|
|
726
|
-
// store or the warm summariser.
|
|
727
|
-
//
|
|
728
|
-
// Content-addressed: the on-disk file name is `<sha256>.<ext>` so an image
|
|
729
|
-
// forwarded / retried / re-ingested twice collapses to one file. This is
|
|
730
|
-
// the primitive the previous "delete-checkpoints-per-turn" hack was
|
|
731
|
-
// compensating for — see ADR-0065.
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
const MIME_EXT = {
|
|
738
|
-
"image/png": "png",
|
|
739
|
-
"image/jpeg": "jpg",
|
|
740
|
-
"image/jpg": "jpg",
|
|
741
|
-
"image/webp": "webp",
|
|
742
|
-
"image/gif": "gif",
|
|
743
|
-
"image/svg+xml": "svg",
|
|
744
|
-
"image/heic": "heic",
|
|
745
|
-
"image/heif": "heif",
|
|
746
|
-
"image/bmp": "bmp",
|
|
747
|
-
"image/tiff": "tiff",
|
|
748
|
-
"application/pdf": "pdf",
|
|
749
|
-
"application/json": "json",
|
|
750
|
-
"text/plain": "txt"
|
|
751
|
-
};
|
|
752
|
-
function extForMime(media_type) {
|
|
753
|
-
return MIME_EXT[media_type.toLowerCase()] ?? "bin";
|
|
754
|
-
}
|
|
755
|
-
function isTextMediaType(media_type) {
|
|
756
|
-
return media_type.startsWith("text/") || media_type === "application/json";
|
|
757
|
-
}
|
|
758
|
-
function safeDisplayName(name) {
|
|
759
|
-
const trimmed = name.trim();
|
|
760
|
-
return trimmed.length > 0 ? trimmed.replace(/[\r\n\t]/g, " ").slice(0, 240) : "attachment";
|
|
761
|
-
}
|
|
762
|
-
function extForFile(media_type, filename) {
|
|
763
|
-
const fromMime = extForMime(media_type);
|
|
764
|
-
if (fromMime !== "bin") return fromMime;
|
|
765
|
-
const ext = filename ? (0,external_node_path_.extname)(filename).slice(1).toLowerCase() : "";
|
|
766
|
-
return /^[a-z0-9]{1,12}$/.test(ext) ? ext : "bin";
|
|
767
|
-
}
|
|
768
|
-
async function writeContentAddressedFile(buf, ext) {
|
|
769
|
-
const sha256 = (0,external_node_crypto_.createHash)("sha256").update(buf).digest("hex");
|
|
770
|
-
const name = `${sha256}.${ext}`;
|
|
771
|
-
if (!(0,files/* isSafeFileName */.Dh)(name)) throw new Error(`spill: unsafe file name ${name}`);
|
|
772
|
-
const abs = (0,external_node_path_.join)(files/* FILES_DIR */.qM, name);
|
|
773
|
-
let exists = false;
|
|
774
|
-
try {
|
|
775
|
-
const s = (0,external_node_fs_.statSync)(abs);
|
|
776
|
-
exists = s.isFile() && s.size === buf.length;
|
|
777
|
-
} catch {
|
|
778
|
-
exists = false;
|
|
779
|
-
}
|
|
780
|
-
if (!exists) {
|
|
781
|
-
await external_node_fs_.promises.writeFile(abs, buf);
|
|
782
579
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
580
|
+
const method = req.method || 'GET';
|
|
581
|
+
const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.getTracer)();
|
|
582
|
+
const activeSpan = tracer.getActiveScopeSpan();
|
|
583
|
+
const isWrappedByNextServer = Boolean(routerServerContext == null ? void 0 : routerServerContext.isWrappedByNextServer);
|
|
584
|
+
const isMinimalMode = Boolean((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'minimalMode'));
|
|
585
|
+
const incrementalCache = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'incrementalCache') || await routeModule.getIncrementalCache(req, nextConfig, previewProps, prerenderManifest, isMinimalMode);
|
|
586
|
+
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
587
|
+
globalThis.__incrementalCache = incrementalCache;
|
|
588
|
+
const context = {
|
|
589
|
+
params,
|
|
590
|
+
previewProps,
|
|
591
|
+
renderOpts: {
|
|
592
|
+
experimental: {
|
|
593
|
+
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
594
|
+
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
595
|
+
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
596
|
+
},
|
|
597
|
+
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
598
|
+
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
599
|
+
isDraftMode,
|
|
600
|
+
incrementalCache,
|
|
601
|
+
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
602
|
+
cacheLifeProfiles: nextConfig.cacheLife,
|
|
603
|
+
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
604
|
+
waitUntil: ctx.waitUntil,
|
|
605
|
+
onClose: (cb)=>{
|
|
606
|
+
res.on('close', cb);
|
|
607
|
+
},
|
|
608
|
+
onAfterTaskError: undefined
|
|
609
|
+
},
|
|
610
|
+
sharedContext: {
|
|
611
|
+
buildId,
|
|
612
|
+
deploymentId
|
|
613
|
+
}
|
|
808
614
|
};
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
615
|
+
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
616
|
+
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
617
|
+
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));
|
|
618
|
+
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
619
|
+
try {
|
|
620
|
+
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
|
621
|
+
res.statusCode = 404;
|
|
622
|
+
// on-demand revalidate always sets this header
|
|
623
|
+
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
|
624
|
+
res.end('This page could not be found');
|
|
625
|
+
return null;
|
|
626
|
+
}
|
|
627
|
+
const response = cacheKey === null ? await routeModule.handle(nextReq, context) : await routeModule.prerender(nextReq, context);
|
|
628
|
+
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
629
|
+
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
630
|
+
// Attempt using provided waitUntil if available
|
|
631
|
+
// if it's not we fallback to sendResponse's handling
|
|
632
|
+
if (pendingWaitUntil) {
|
|
633
|
+
if (ctx.waitUntil) {
|
|
634
|
+
ctx.waitUntil(pendingWaitUntil);
|
|
635
|
+
pendingWaitUntil = undefined;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
const cacheTags = context.renderOpts.collectedTags;
|
|
639
|
+
// If the request is for a static response, we can cache it so long
|
|
640
|
+
// as it's not edge.
|
|
641
|
+
if (isIsr) {
|
|
642
|
+
const blob = await response.blob();
|
|
643
|
+
// Copy the headers from the response.
|
|
644
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
645
|
+
if (cacheTags) {
|
|
646
|
+
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
647
|
+
}
|
|
648
|
+
if (!headers['content-type'] && blob.type) {
|
|
649
|
+
headers['content-type'] = blob.type;
|
|
650
|
+
}
|
|
651
|
+
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
652
|
+
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
|
|
653
|
+
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
654
|
+
// build-time fallback in `build/index.ts` so cache entries
|
|
655
|
+
// and the response Cache-Control header agree on the route's
|
|
656
|
+
// effective expire. Routes that opt out of revalidation
|
|
657
|
+
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
658
|
+
// keep `expire: undefined`.
|
|
659
|
+
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
660
|
+
// Create the cache entry for the response.
|
|
661
|
+
const cacheEntry = {
|
|
662
|
+
value: {
|
|
663
|
+
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
664
|
+
status: response.status,
|
|
665
|
+
body: Buffer.from(await blob.arrayBuffer()),
|
|
666
|
+
headers
|
|
667
|
+
},
|
|
668
|
+
cacheControl: {
|
|
669
|
+
revalidate,
|
|
670
|
+
expire
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
return cacheEntry;
|
|
674
|
+
} else {
|
|
675
|
+
// send response without caching if not ISR
|
|
676
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
677
|
+
return null;
|
|
678
|
+
}
|
|
679
|
+
} catch (err) {
|
|
680
|
+
// if this is a background revalidate we need to report
|
|
681
|
+
// the request error here as it won't be bubbled
|
|
682
|
+
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
683
|
+
const silenceLog = false;
|
|
684
|
+
await routeModule.onRequestError(req, err, {
|
|
685
|
+
routerKind: 'App Router',
|
|
686
|
+
routePath: srcPage,
|
|
687
|
+
routeType: 'route',
|
|
688
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
689
|
+
isStaticGeneration: cacheKey !== null,
|
|
690
|
+
isOnDemandRevalidate
|
|
691
|
+
})
|
|
692
|
+
}, silenceLog, routerServerContext);
|
|
693
|
+
}
|
|
694
|
+
throw err;
|
|
695
|
+
}
|
|
826
696
|
};
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
697
|
+
const handleResponse = async (currentSpan, parentSpan)=>{
|
|
698
|
+
try {
|
|
699
|
+
var _cacheEntry_value;
|
|
700
|
+
const cacheEntry = await routeModule.handleResponse({
|
|
701
|
+
req,
|
|
702
|
+
nextConfig,
|
|
703
|
+
cacheKey,
|
|
704
|
+
routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
705
|
+
isFallback: false,
|
|
706
|
+
previewProps,
|
|
707
|
+
prerenderManifest,
|
|
708
|
+
isRoutePPREnabled: false,
|
|
709
|
+
isOnDemandRevalidate,
|
|
710
|
+
revalidateOnlyGenerated,
|
|
711
|
+
responseGenerator,
|
|
712
|
+
waitUntil: ctx.waitUntil,
|
|
713
|
+
isMinimalMode
|
|
714
|
+
});
|
|
715
|
+
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
716
|
+
throw cacheEntry.error;
|
|
717
|
+
}
|
|
718
|
+
// we don't create a cacheEntry for ISR
|
|
719
|
+
if (!isIsr) {
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
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) {
|
|
723
|
+
var _cacheEntry_value1;
|
|
724
|
+
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
725
|
+
}
|
|
726
|
+
if (!isMinimalMode) {
|
|
727
|
+
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
728
|
+
}
|
|
729
|
+
// Draft mode should never be cached
|
|
730
|
+
if (isDraftMode) {
|
|
731
|
+
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
732
|
+
}
|
|
733
|
+
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
734
|
+
if (!(isMinimalMode && isIsr)) {
|
|
735
|
+
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
736
|
+
}
|
|
737
|
+
// If cache control is already set on the response we don't
|
|
738
|
+
// override it to allow users to customize it via next.config
|
|
739
|
+
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
740
|
+
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
741
|
+
}
|
|
742
|
+
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'.
|
|
743
|
+
new Response(cacheEntry.value.body, {
|
|
744
|
+
headers,
|
|
745
|
+
status: cacheEntry.value.status || 200
|
|
746
|
+
}));
|
|
747
|
+
return;
|
|
748
|
+
} catch (err) {
|
|
749
|
+
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
750
|
+
const silenceLog = false;
|
|
751
|
+
await routeModule.onRequestError(req, err, {
|
|
752
|
+
routerKind: 'App Router',
|
|
753
|
+
routePath: normalizedSrcPage,
|
|
754
|
+
routeType: 'route',
|
|
755
|
+
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
756
|
+
isStaticGeneration: cacheKey !== null,
|
|
757
|
+
isOnDemandRevalidate
|
|
758
|
+
})
|
|
759
|
+
}, silenceLog, routerServerContext);
|
|
760
|
+
}
|
|
761
|
+
// rethrow so that we can handle serving error page
|
|
762
|
+
// If this is during static generation, throw the error again.
|
|
763
|
+
if (isIsr) throw err;
|
|
764
|
+
// Otherwise, send a 500 response unless the original response has
|
|
765
|
+
// already committed. In that case, preserve its status code for
|
|
766
|
+
// telemetry while still recording the failure and terminating a response
|
|
767
|
+
// that the failed pipeline left open.
|
|
768
|
+
if (res.headersSent) {
|
|
769
|
+
if (currentSpan) {
|
|
770
|
+
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
771
|
+
currentSpan.recordException(error);
|
|
772
|
+
currentSpan.setStatus({
|
|
773
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
774
|
+
message: error.message
|
|
775
|
+
});
|
|
776
|
+
currentSpan.setAttribute('error.type', error.name);
|
|
777
|
+
}
|
|
778
|
+
if (!res.writableEnded && !res.destroyed) {
|
|
779
|
+
res.end();
|
|
780
|
+
}
|
|
781
|
+
} else {
|
|
782
|
+
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
783
|
+
status: 500
|
|
784
|
+
}));
|
|
785
|
+
}
|
|
786
|
+
return;
|
|
787
|
+
} finally{
|
|
788
|
+
;
|
|
789
|
+
(()=>{
|
|
790
|
+
if (!currentSpan) {
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
let statusCode = res.statusCode;
|
|
794
|
+
currentSpan.setAttributes({
|
|
795
|
+
'http.status_code': statusCode,
|
|
796
|
+
'next.rsc': false
|
|
797
|
+
});
|
|
798
|
+
if (statusCode && statusCode >= 500) {
|
|
799
|
+
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
800
|
+
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
801
|
+
currentSpan.setStatus({
|
|
802
|
+
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
803
|
+
});
|
|
804
|
+
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
805
|
+
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
806
|
+
}
|
|
807
|
+
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
808
|
+
// We were unable to get attributes, probably OTEL is not enabled
|
|
809
|
+
if (!rootSpanAttributes) {
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
813
|
+
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
817
|
+
const name = `${method} ${route}`;
|
|
818
|
+
currentSpan.setAttributes({
|
|
819
|
+
'next.route': route,
|
|
820
|
+
'http.route': route,
|
|
821
|
+
'next.span_name': name
|
|
822
|
+
});
|
|
823
|
+
currentSpan.updateName(name);
|
|
824
|
+
// Propagate http.route to the parent span if one exists (e.g.
|
|
825
|
+
// a platform-created HTTP span in adapter deployments).
|
|
826
|
+
if (parentSpan && parentSpan !== currentSpan) {
|
|
827
|
+
parentSpan.setAttribute('http.route', route);
|
|
828
|
+
parentSpan.updateName(name);
|
|
829
|
+
}
|
|
830
|
+
})();
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
// TODO: activeSpan code path is for when wrapped by
|
|
834
|
+
// next-server can be removed when this is no longer used
|
|
835
|
+
if (isWrappedByNextServer && activeSpan) {
|
|
836
|
+
await handleResponse(activeSpan, undefined);
|
|
837
|
+
} else {
|
|
838
|
+
let parentSpan = tracer.getActiveScopeSpan();
|
|
839
|
+
await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest, {
|
|
840
|
+
spanName: `${method} ${srcPage}`,
|
|
841
|
+
kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanKind.SERVER,
|
|
842
|
+
attributes: {
|
|
843
|
+
'http.method': method,
|
|
844
|
+
'http.target': req.url
|
|
845
|
+
}
|
|
846
|
+
}, (span)=>handleResponse(span, parentSpan)), undefined, !isWrappedByNextServer);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
976
849
|
|
|
850
|
+
//# sourceMappingURL=app-route.js.map
|
|
977
851
|
|
|
978
852
|
|
|
853
|
+
/***/ }),
|
|
979
854
|
|
|
855
|
+
/***/ 55511:
|
|
856
|
+
/***/ ((module) => {
|
|
980
857
|
|
|
858
|
+
"use strict";
|
|
859
|
+
module.exports = require("crypto");
|
|
981
860
|
|
|
861
|
+
/***/ }),
|
|
982
862
|
|
|
863
|
+
/***/ 57477:
|
|
864
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
983
865
|
|
|
866
|
+
"use strict";
|
|
867
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
868
|
+
/* harmony export */ o: () => (/* binding */ getDataDir)
|
|
869
|
+
/* harmony export */ });
|
|
870
|
+
/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73024);
|
|
871
|
+
/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
872
|
+
/* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48161);
|
|
873
|
+
/* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(node_os__WEBPACK_IMPORTED_MODULE_1__);
|
|
874
|
+
/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76760);
|
|
875
|
+
/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(node_path__WEBPACK_IMPORTED_MODULE_2__);
|
|
876
|
+
// Resolves the Jarela data directory and performs one-time migrations:
|
|
877
|
+
//
|
|
878
|
+
// 1. Legacy LangGUI layout (~/.langgui with langgui.db) — rebrand
|
|
879
|
+
// migration: rename the dir + the DB files.
|
|
880
|
+
// 2. On Windows, the default is %LOCALAPPDATA%\Jarela (ADR-0006) to escape
|
|
881
|
+
// OneDrive-synced user-profile paths.
|
|
882
|
+
//
|
|
883
|
+
// Legacy data migration is intentionally limited to the old LangGUI name.
|
|
984
884
|
|
|
985
885
|
|
|
986
886
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
const routeModule = new next_dist_server_route_modules_app_route_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppRouteRouteModule({
|
|
991
|
-
definition: {
|
|
992
|
-
kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_ROUTE,
|
|
993
|
-
page: "/api/v1/attachments/images/route",
|
|
994
|
-
pathname: "/api/v1/attachments/images",
|
|
995
|
-
filename: "route",
|
|
996
|
-
bundlePath: "app/api/v1/attachments/images/route"
|
|
997
|
-
},
|
|
998
|
-
distDir: ".next" || 0,
|
|
999
|
-
relativeProjectDir: false || '',
|
|
1000
|
-
resolvedPagePath: "/home/runner/work/jarela/jarela/app/api/v1/attachments/images/route.ts",
|
|
1001
|
-
nextConfigOutput,
|
|
1002
|
-
// The lazy require factory ensures that:
|
|
1003
|
-
// - In dev: devRequestTimingInternalsEnd is set before userland executes,
|
|
1004
|
-
// correctly attributing module load time to application-code rather than
|
|
1005
|
-
// framework internals.
|
|
1006
|
-
// - In all modes: async modules (route files with top-level await) are
|
|
1007
|
-
// handled correctly — require() returns a Promise for such modules, which
|
|
1008
|
-
// ensureUserland() awaits before the first request is handled.
|
|
1009
|
-
userland: ()=>__webpack_require__(28586),
|
|
1010
|
-
// In Turbopack dev mode, also provide a synchronous per-request getter so
|
|
1011
|
-
// server HMR updates are picked up without re-executing the entry chunk.
|
|
1012
|
-
// Using require() (synchronous) avoids adding async overhead that would be
|
|
1013
|
-
// incorrectly attributed to application-code time in devRequestTiming.
|
|
1014
|
-
... false ? 0 : {}
|
|
1015
|
-
});
|
|
1016
|
-
// Pull out the exports that we need to expose from the module. This should
|
|
1017
|
-
// be eliminated when we've moved the other routes to the new format. These
|
|
1018
|
-
// are used to hook into the route.
|
|
1019
|
-
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
|
|
1020
|
-
function patchFetch() {
|
|
1021
|
-
return (0,next_dist_server_lib_patch_fetch__WEBPACK_IMPORTED_MODULE_2__.patchFetch)({
|
|
1022
|
-
workAsyncStorage,
|
|
1023
|
-
workUnitAsyncStorage
|
|
1024
|
-
});
|
|
887
|
+
let cached = null;
|
|
888
|
+
function expandHome(p) {
|
|
889
|
+
return p.startsWith("~") ? p.replace(/^~/, (0,node_os__WEBPACK_IMPORTED_MODULE_1__.homedir)()) : p;
|
|
1025
890
|
}
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
// TODO: fix turbopack providing differing value from webpack
|
|
1038
|
-
if (false) {} else if (srcPage === '/index') {
|
|
1039
|
-
// we always normalize /index specifically
|
|
1040
|
-
srcPage = '/';
|
|
891
|
+
// A dir "has DB" iff it contains jarela.db OR langgui.db. We treat the
|
|
892
|
+
// presence of a DB as the signal that the dir holds real user state;
|
|
893
|
+
// otherwise it may just be a vestigial launcher working dir
|
|
894
|
+
// (e.g. %LOCALAPPDATA%\Jarela created by installed-launcher.vbs with
|
|
895
|
+
// only files/ and logs/ inside).
|
|
896
|
+
function hasDb(dir) {
|
|
897
|
+
if (!(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(dir)) return false;
|
|
898
|
+
try {
|
|
899
|
+
return (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync)(dir).some((n)=>n === "jarela.db" || n === "langgui.db");
|
|
900
|
+
} catch {
|
|
901
|
+
return false;
|
|
1041
902
|
}
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
903
|
+
}
|
|
904
|
+
function migrateLegacyDir(legacyDir, newDir) {
|
|
905
|
+
if (!(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(legacyDir)) return;
|
|
906
|
+
if (hasDb(newDir)) return; // new dir already has user state — never overwrite.
|
|
907
|
+
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync)(newDir, {
|
|
908
|
+
recursive: true
|
|
1046
909
|
});
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
910
|
+
// Move contents item-by-item so we can merge into a partially-existing
|
|
911
|
+
// newDir (e.g. one containing only logs/ from a prior launcher run).
|
|
912
|
+
// Skips items that already exist on the destination side.
|
|
913
|
+
let entries = [];
|
|
914
|
+
try {
|
|
915
|
+
entries = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync)(legacyDir);
|
|
916
|
+
} catch {
|
|
917
|
+
entries = [];
|
|
1052
918
|
}
|
|
1053
|
-
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
return null;
|
|
1066
|
-
};
|
|
1067
|
-
if (isIsr && !isDraftMode) {
|
|
1068
|
-
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
|
1069
|
-
if (prerenderInfo) {
|
|
1070
|
-
if (prerenderInfo.fallback === false && !isPrerendered) {
|
|
1071
|
-
if (nextConfig.adapterPath) {
|
|
1072
|
-
return await render404();
|
|
1073
|
-
}
|
|
1074
|
-
throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError();
|
|
1075
|
-
}
|
|
919
|
+
let moved = 0;
|
|
920
|
+
for (const name of entries){
|
|
921
|
+
const from = (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)(legacyDir, name);
|
|
922
|
+
const to = (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)(newDir, name);
|
|
923
|
+
if ((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(to)) continue;
|
|
924
|
+
try {
|
|
925
|
+
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.renameSync)(from, to);
|
|
926
|
+
moved++;
|
|
927
|
+
} catch (err) {
|
|
928
|
+
// EXDEV: cross-volume rename. EPERM/EBUSY: locked by another
|
|
929
|
+
// process. Non-fatal: skip this item and continue with the rest.
|
|
930
|
+
console.warn(`[jarela] could not move ${from} -> ${to}: ${err.message}`);
|
|
1076
931
|
}
|
|
1077
932
|
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
// Before rendering (which initializes component tree modules), we have to
|
|
1085
|
-
// set the reference manifests to our global store so Server Action's
|
|
1086
|
-
// encryption util can access to them at the top level of the page module.
|
|
1087
|
-
if (serverActionsManifest && clientReferenceManifest) {
|
|
1088
|
-
(0,next_dist_server_app_render_manifests_singleton__WEBPACK_IMPORTED_MODULE_5__.setManifestsSingleton)({
|
|
1089
|
-
page: srcPage,
|
|
1090
|
-
clientReferenceManifest,
|
|
1091
|
-
serverActionsManifest
|
|
1092
|
-
});
|
|
933
|
+
// Rename DB files: langgui.db -> jarela.db (and any -wal / -shm sidecars).
|
|
934
|
+
let postEntries = [];
|
|
935
|
+
try {
|
|
936
|
+
postEntries = (0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync)(newDir);
|
|
937
|
+
} catch {
|
|
938
|
+
postEntries = [];
|
|
1093
939
|
}
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();
|
|
1101
|
-
globalThis.__incrementalCache = incrementalCache;
|
|
1102
|
-
const context = {
|
|
1103
|
-
params,
|
|
1104
|
-
previewProps,
|
|
1105
|
-
renderOpts: {
|
|
1106
|
-
experimental: {
|
|
1107
|
-
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
|
1108
|
-
useCacheTimeout: nextConfig.experimental.useCacheTimeout,
|
|
1109
|
-
durableUseCacheEntries: Boolean(nextConfig.experimental.durableUseCacheEntries)
|
|
1110
|
-
},
|
|
1111
|
-
cacheComponents: Boolean(nextConfig.cacheComponents),
|
|
1112
|
-
validationLevel: nextConfig.experimental.instantInsights.validationLevel,
|
|
1113
|
-
isDraftMode,
|
|
1114
|
-
incrementalCache,
|
|
1115
|
-
hmrRefreshHash: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_3__.getRequestMeta)(req, 'hmrRefreshHash'),
|
|
1116
|
-
cacheLifeProfiles: nextConfig.cacheLife,
|
|
1117
|
-
staticPageGenerationTimeout: nextConfig.staticPageGenerationTimeout,
|
|
1118
|
-
waitUntil: ctx.waitUntil,
|
|
1119
|
-
onClose: (cb)=>{
|
|
1120
|
-
res.on('close', cb);
|
|
1121
|
-
},
|
|
1122
|
-
onAfterTaskError: undefined
|
|
1123
|
-
},
|
|
1124
|
-
sharedContext: {
|
|
1125
|
-
buildId,
|
|
1126
|
-
deploymentId
|
|
1127
|
-
}
|
|
1128
|
-
};
|
|
1129
|
-
const nodeNextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextRequest(req);
|
|
1130
|
-
const nodeNextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_7__.NodeNextResponse(res);
|
|
1131
|
-
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));
|
|
1132
|
-
const responseGenerator = async ({ previousCacheEntry })=>{
|
|
940
|
+
for (const name of postEntries){
|
|
941
|
+
if (!name.startsWith("langgui.db")) continue;
|
|
942
|
+
const suffix = name.slice("langgui.db".length); // "", "-wal", "-shm", "-journal"
|
|
943
|
+
const from = (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)(newDir, name);
|
|
944
|
+
const to = (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)(newDir, `jarela.db${suffix}`);
|
|
945
|
+
if ((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)(to)) continue;
|
|
1133
946
|
try {
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
|
1143
|
-
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
|
1144
|
-
// Attempt using provided waitUntil if available
|
|
1145
|
-
// if it's not we fallback to sendResponse's handling
|
|
1146
|
-
if (pendingWaitUntil) {
|
|
1147
|
-
if (ctx.waitUntil) {
|
|
1148
|
-
ctx.waitUntil(pendingWaitUntil);
|
|
1149
|
-
pendingWaitUntil = undefined;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
const cacheTags = context.renderOpts.collectedTags;
|
|
1153
|
-
// If the request is for a static response, we can cache it so long
|
|
1154
|
-
// as it's not edge.
|
|
1155
|
-
if (isIsr) {
|
|
1156
|
-
const blob = await response.blob();
|
|
1157
|
-
// Copy the headers from the response.
|
|
1158
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.toNodeOutgoingHttpHeaders)(response.headers);
|
|
1159
|
-
if (cacheTags) {
|
|
1160
|
-
headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
|
1161
|
-
}
|
|
1162
|
-
if (!headers['content-type'] && blob.type) {
|
|
1163
|
-
headers['content-type'] = blob.type;
|
|
1164
|
-
}
|
|
1165
|
-
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
|
1166
|
-
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
|
|
1167
|
-
// explicit `expire` (e.g. via `cacheLife`). This mirrors the
|
|
1168
|
-
// build-time fallback in `build/index.ts` so cache entries
|
|
1169
|
-
// and the response Cache-Control header agree on the route's
|
|
1170
|
-
// effective expire. Routes that opt out of revalidation
|
|
1171
|
-
// (`revalidate: false`) or that are dynamic (`revalidate: 0`)
|
|
1172
|
-
// keep `expire: undefined`.
|
|
1173
|
-
revalidate !== false && revalidate > 0 ? nextConfig.expireTime : undefined : context.renderOpts.collectedExpire;
|
|
1174
|
-
// Create the cache entry for the response.
|
|
1175
|
-
const cacheEntry = {
|
|
1176
|
-
value: {
|
|
1177
|
-
kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_17__.CachedRouteKind.APP_ROUTE,
|
|
1178
|
-
status: response.status,
|
|
1179
|
-
body: Buffer.from(await blob.arrayBuffer()),
|
|
1180
|
-
headers
|
|
1181
|
-
},
|
|
1182
|
-
cacheControl: {
|
|
1183
|
-
revalidate,
|
|
1184
|
-
expire
|
|
1185
|
-
}
|
|
1186
|
-
};
|
|
1187
|
-
return cacheEntry;
|
|
1188
|
-
} else {
|
|
1189
|
-
// send response without caching if not ISR
|
|
1190
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, response, pendingWaitUntil);
|
|
1191
|
-
return null;
|
|
1192
|
-
}
|
|
1193
|
-
} catch (err) {
|
|
1194
|
-
// if this is a background revalidate we need to report
|
|
1195
|
-
// the request error here as it won't be bubbled
|
|
1196
|
-
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
|
1197
|
-
const silenceLog = false;
|
|
1198
|
-
await routeModule.onRequestError(req, err, {
|
|
1199
|
-
routerKind: 'App Router',
|
|
1200
|
-
routePath: srcPage,
|
|
1201
|
-
routeType: 'route',
|
|
1202
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1203
|
-
isStaticGeneration: cacheKey !== null,
|
|
1204
|
-
isOnDemandRevalidate
|
|
1205
|
-
})
|
|
1206
|
-
}, silenceLog, routerServerContext);
|
|
1207
|
-
}
|
|
1208
|
-
throw err;
|
|
947
|
+
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.renameSync)(from, to);
|
|
948
|
+
} catch {}
|
|
949
|
+
}
|
|
950
|
+
// Best-effort cleanup of an emptied legacy dir. If anything remained
|
|
951
|
+
// (locked files, dotfiles we declined to move) leave the dir in place.
|
|
952
|
+
try {
|
|
953
|
+
if ((0,node_fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync)(legacyDir).length === 0) {
|
|
954
|
+
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.rmdirSync)(legacyDir);
|
|
1209
955
|
}
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
956
|
+
} catch {}
|
|
957
|
+
if (moved > 0) {
|
|
958
|
+
console.info(`[jarela] migrated ${moved} entries from ${legacyDir} -> ${newDir}`);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
function getDataDir() {
|
|
962
|
+
if (cached) return cached;
|
|
963
|
+
const envDir = process.env.JARELA_DB_DIR;
|
|
964
|
+
const newDir = envDir ? expandHome(envDir) : defaultDataDir();
|
|
965
|
+
// Only run the old LangGUI rebrand migration for the default location; if
|
|
966
|
+
// the user customized JARELA_DB_DIR they're explicitly opting out.
|
|
967
|
+
if (!envDir) {
|
|
968
|
+
migrateLegacyDir((0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_1__.homedir)(), ".langgui"), newDir);
|
|
969
|
+
}
|
|
970
|
+
(0,node_fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync)(newDir, {
|
|
971
|
+
recursive: true
|
|
972
|
+
});
|
|
973
|
+
cached = newDir;
|
|
974
|
+
return newDir;
|
|
975
|
+
}
|
|
976
|
+
function defaultDataDir() {
|
|
977
|
+
if (process.platform === "win32") {
|
|
978
|
+
const local = process.env.LOCALAPPDATA ?? (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_1__.homedir)(), "AppData", "Local");
|
|
979
|
+
return (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)(local, "Jarela");
|
|
980
|
+
}
|
|
981
|
+
return (0,node_path__WEBPACK_IMPORTED_MODULE_2__.join)((0,node_os__WEBPACK_IMPORTED_MODULE_1__.homedir)(), ".jarela");
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
/***/ }),
|
|
986
|
+
|
|
987
|
+
/***/ 58154:
|
|
988
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
989
|
+
|
|
990
|
+
"use strict";
|
|
991
|
+
|
|
992
|
+
// EXPORTS
|
|
993
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
994
|
+
kx: () => (/* binding */ readFileRef),
|
|
995
|
+
vw: () => (/* binding */ readImageRef),
|
|
996
|
+
fX: () => (/* binding */ spillAttachments),
|
|
997
|
+
spillFileBuffer: () => (/* binding */ spillFileBuffer),
|
|
998
|
+
ui: () => (/* binding */ spillImageBuffer),
|
|
999
|
+
Jb: () => (/* binding */ spillImagePart)
|
|
1000
|
+
});
|
|
1001
|
+
|
|
1002
|
+
// EXTERNAL MODULE: external "node:fs"
|
|
1003
|
+
var external_node_fs_ = __webpack_require__(73024);
|
|
1004
|
+
// EXTERNAL MODULE: external "node:path"
|
|
1005
|
+
var external_node_path_ = __webpack_require__(76760);
|
|
1006
|
+
// EXTERNAL MODULE: external "node:crypto"
|
|
1007
|
+
var external_node_crypto_ = __webpack_require__(77598);
|
|
1008
|
+
// EXTERNAL MODULE: ./lib/files.ts
|
|
1009
|
+
var files = __webpack_require__(52907);
|
|
1010
|
+
;// ./lib/attachments/shrink.ts
|
|
1011
|
+
// Image shrink helper for the attachment spill pipeline.
|
|
1012
|
+
//
|
|
1013
|
+
// The vision APIs of every provider we speak to today accept an image
|
|
1014
|
+
// as a base64 blob in the request body, but they don't need a 4032×3024
|
|
1015
|
+
// iPhone photo to answer "who's in this picture?" — the model's vision
|
|
1016
|
+
// encoder downsamples to a fixed grid anyway (Anthropic ~1568px, OpenAI
|
|
1017
|
+
// ~2048px, Gemini ~3072px). Shipping the original is pure waste: it
|
|
1018
|
+
// costs upload latency, tokens (image tokens scale with pixels on some
|
|
1019
|
+
// providers), and disk space post-spill.
|
|
1020
|
+
//
|
|
1021
|
+
// Runs at ingest inside `spillImagePart` so every ref on disk starts
|
|
1022
|
+
// already resized. See ADR-0065 (spill) and ADR-0066 (this).
|
|
1023
|
+
// Providers reject or misrender these — always transcode to JPEG.
|
|
1024
|
+
const FORCE_TO_JPEG = new Set([
|
|
1025
|
+
"image/heic",
|
|
1026
|
+
"image/heif",
|
|
1027
|
+
"image/bmp",
|
|
1028
|
+
"image/tiff"
|
|
1029
|
+
]);
|
|
1030
|
+
// Formats where we always keep the source bytes as-is: vector or animated.
|
|
1031
|
+
const ALWAYS_PASSTHROUGH = new Set([
|
|
1032
|
+
"image/svg+xml",
|
|
1033
|
+
"image/gif"
|
|
1034
|
+
]);
|
|
1035
|
+
/**
|
|
1036
|
+
* Resize and re-encode an image if doing so shrinks the payload without
|
|
1037
|
+
* losing meaningful information. Preserves alpha (stays PNG), converts
|
|
1038
|
+
* HEIC/BMP/TIFF to JPEG, leaves SVG/GIF untouched.
|
|
1039
|
+
*
|
|
1040
|
+
* Never throws — a decode failure returns the input unchanged so the
|
|
1041
|
+
* caller can still spill something rather than lose the attachment.
|
|
1042
|
+
*/ async function shrinkImage(input, mediaType, opts = {}) {
|
|
1043
|
+
const maxEdge = opts.maxEdge ?? 1600;
|
|
1044
|
+
const jpegQuality = opts.jpegQuality ?? 85;
|
|
1045
|
+
const minBytesToTouch = opts.minBytesToTouch ?? 64 * 1024;
|
|
1046
|
+
const mt = mediaType.toLowerCase();
|
|
1047
|
+
if (ALWAYS_PASSTHROUGH.has(mt)) {
|
|
1048
|
+
return {
|
|
1049
|
+
buf: input,
|
|
1050
|
+
media_type: mediaType,
|
|
1051
|
+
width: 0,
|
|
1052
|
+
height: 0,
|
|
1053
|
+
passthrough: true
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
// Dynamic import: sharp loads a native binary, don't pay that cost on
|
|
1057
|
+
// installs that never see an image ingest. Not in tsconfig paths so
|
|
1058
|
+
// it resolves relative to node_modules at runtime.
|
|
1059
|
+
let sharpFn;
|
|
1060
|
+
try {
|
|
1061
|
+
const mod = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 42482));
|
|
1062
|
+
sharpFn = mod.default;
|
|
1063
|
+
} catch (err) {
|
|
1064
|
+
console.warn("[shrink] sharp unavailable, passing image through:", err.message);
|
|
1065
|
+
return {
|
|
1066
|
+
buf: input,
|
|
1067
|
+
media_type: mediaType,
|
|
1068
|
+
width: 0,
|
|
1069
|
+
height: 0,
|
|
1070
|
+
passthrough: true
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
let meta;
|
|
1074
|
+
try {
|
|
1075
|
+
meta = await sharpFn(input, {
|
|
1076
|
+
failOn: "none"
|
|
1077
|
+
}).metadata();
|
|
1078
|
+
} catch (err) {
|
|
1079
|
+
console.warn("[shrink] decode failed, passing through:", err.message);
|
|
1080
|
+
return {
|
|
1081
|
+
buf: input,
|
|
1082
|
+
media_type: mediaType,
|
|
1083
|
+
width: 0,
|
|
1084
|
+
height: 0,
|
|
1085
|
+
passthrough: true
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
const width = meta.width ?? 0;
|
|
1089
|
+
const height = meta.height ?? 0;
|
|
1090
|
+
const longestEdge = Math.max(width, height);
|
|
1091
|
+
const forceJpeg = FORCE_TO_JPEG.has(mt);
|
|
1092
|
+
const wantResize = longestEdge > maxEdge;
|
|
1093
|
+
// Early bail-out: tiny file, in-bounds, and no forced transcode.
|
|
1094
|
+
if (!forceJpeg && !wantResize && input.length <= minBytesToTouch) {
|
|
1095
|
+
return {
|
|
1096
|
+
buf: input,
|
|
1097
|
+
media_type: mediaType,
|
|
1098
|
+
width,
|
|
1099
|
+
height,
|
|
1100
|
+
passthrough: true
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
// Preserve alpha by keeping PNG when the source has it — dropping to
|
|
1104
|
+
// JPEG would flatten transparent regions to black.
|
|
1105
|
+
const keepPng = !forceJpeg && (meta.hasAlpha ?? false) && mt === "image/png";
|
|
1106
|
+
const outMediaType = keepPng ? "image/png" : "image/jpeg";
|
|
1107
|
+
try {
|
|
1108
|
+
let pipeline = sharpFn(input, {
|
|
1109
|
+
failOn: "none"
|
|
1110
|
+
});
|
|
1111
|
+
if (wantResize) {
|
|
1112
|
+
pipeline = pipeline.resize({
|
|
1113
|
+
width: maxEdge,
|
|
1114
|
+
height: maxEdge,
|
|
1115
|
+
fit: "inside",
|
|
1116
|
+
withoutEnlargement: true
|
|
1228
1117
|
});
|
|
1229
|
-
if (cacheEntry !== null && 'error' in cacheEntry) {
|
|
1230
|
-
throw cacheEntry.error;
|
|
1231
|
-
}
|
|
1232
|
-
// we don't create a cacheEntry for ISR
|
|
1233
|
-
if (!isIsr) {
|
|
1234
|
-
return;
|
|
1235
|
-
}
|
|
1236
|
-
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) {
|
|
1237
|
-
var _cacheEntry_value1;
|
|
1238
|
-
throw new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`);
|
|
1239
|
-
}
|
|
1240
|
-
if (!isMinimalMode) {
|
|
1241
|
-
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
|
1242
|
-
}
|
|
1243
|
-
// Draft mode should never be cached
|
|
1244
|
-
if (isDraftMode) {
|
|
1245
|
-
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
|
1246
|
-
}
|
|
1247
|
-
const headers = (0,next_dist_server_web_utils__WEBPACK_IMPORTED_MODULE_12__.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
|
1248
|
-
if (!(isMinimalMode && isIsr)) {
|
|
1249
|
-
headers.delete(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_14__.NEXT_CACHE_TAGS_HEADER);
|
|
1250
|
-
}
|
|
1251
|
-
// If cache control is already set on the response we don't
|
|
1252
|
-
// override it to allow users to customize it via next.config
|
|
1253
|
-
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
|
1254
|
-
headers.set('Cache-Control', (0,next_dist_server_lib_cache_control__WEBPACK_IMPORTED_MODULE_13__.getCacheControlHeader)(cacheEntry.cacheControl));
|
|
1255
|
-
}
|
|
1256
|
-
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'.
|
|
1257
|
-
new Response(cacheEntry.value.body, {
|
|
1258
|
-
headers,
|
|
1259
|
-
status: cacheEntry.value.status || 200
|
|
1260
|
-
}));
|
|
1261
|
-
return;
|
|
1262
|
-
} catch (err) {
|
|
1263
|
-
if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_15__.NoFallbackError)) {
|
|
1264
|
-
const silenceLog = false;
|
|
1265
|
-
await routeModule.onRequestError(req, err, {
|
|
1266
|
-
routerKind: 'App Router',
|
|
1267
|
-
routePath: normalizedSrcPage,
|
|
1268
|
-
routeType: 'route',
|
|
1269
|
-
revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_10__.getRevalidateReason)({
|
|
1270
|
-
isStaticGeneration: cacheKey !== null,
|
|
1271
|
-
isOnDemandRevalidate
|
|
1272
|
-
})
|
|
1273
|
-
}, silenceLog, routerServerContext);
|
|
1274
|
-
}
|
|
1275
|
-
// rethrow so that we can handle serving error page
|
|
1276
|
-
// If this is during static generation, throw the error again.
|
|
1277
|
-
if (isIsr) throw err;
|
|
1278
|
-
// Otherwise, send a 500 response unless the original response has
|
|
1279
|
-
// already committed. In that case, preserve its status code for
|
|
1280
|
-
// telemetry while still recording the failure and terminating a response
|
|
1281
|
-
// that the failed pipeline left open.
|
|
1282
|
-
if (res.headersSent) {
|
|
1283
|
-
if (currentSpan) {
|
|
1284
|
-
const error = err instanceof Error ? err : new Error('Unknown app route error');
|
|
1285
|
-
currentSpan.recordException(error);
|
|
1286
|
-
currentSpan.setStatus({
|
|
1287
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR,
|
|
1288
|
-
message: error.message
|
|
1289
|
-
});
|
|
1290
|
-
currentSpan.setAttribute('error.type', error.name);
|
|
1291
|
-
}
|
|
1292
|
-
if (!res.writableEnded && !res.destroyed) {
|
|
1293
|
-
res.end();
|
|
1294
|
-
}
|
|
1295
|
-
} else {
|
|
1296
|
-
await (0,next_dist_server_send_response__WEBPACK_IMPORTED_MODULE_11__/* .sendResponse */ .I)(nodeNextReq, nodeNextRes, new Response(null, {
|
|
1297
|
-
status: 500
|
|
1298
|
-
}));
|
|
1299
|
-
}
|
|
1300
|
-
return;
|
|
1301
|
-
} finally{
|
|
1302
|
-
;
|
|
1303
|
-
(()=>{
|
|
1304
|
-
if (!currentSpan) {
|
|
1305
|
-
return;
|
|
1306
|
-
}
|
|
1307
|
-
let statusCode = res.statusCode;
|
|
1308
|
-
currentSpan.setAttributes({
|
|
1309
|
-
'http.status_code': statusCode,
|
|
1310
|
-
'next.rsc': false
|
|
1311
|
-
});
|
|
1312
|
-
if (statusCode && statusCode >= 500) {
|
|
1313
|
-
// For 5xx status codes: SHOULD be set to 'Error' span status.
|
|
1314
|
-
// x-ref: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
|
|
1315
|
-
currentSpan.setStatus({
|
|
1316
|
-
code: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_4__.SpanStatusCode.ERROR
|
|
1317
|
-
});
|
|
1318
|
-
// For span status 'Error', SHOULD set 'error.type' attribute.
|
|
1319
|
-
currentSpan.setAttribute('error.type', statusCode.toString());
|
|
1320
|
-
}
|
|
1321
|
-
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
|
1322
|
-
// We were unable to get attributes, probably OTEL is not enabled
|
|
1323
|
-
if (!rootSpanAttributes) {
|
|
1324
|
-
return;
|
|
1325
|
-
}
|
|
1326
|
-
if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_9__.BaseServerSpan.handleRequest) {
|
|
1327
|
-
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
|
1328
|
-
return;
|
|
1329
|
-
}
|
|
1330
|
-
const route = rootSpanAttributes.get('next.route') || normalizedSrcPage;
|
|
1331
|
-
const name = `${method} ${route}`;
|
|
1332
|
-
currentSpan.setAttributes({
|
|
1333
|
-
'next.route': route,
|
|
1334
|
-
'http.route': route,
|
|
1335
|
-
'next.span_name': name
|
|
1336
|
-
});
|
|
1337
|
-
currentSpan.updateName(name);
|
|
1338
|
-
// Propagate http.route to the parent span if one exists (e.g.
|
|
1339
|
-
// a platform-created HTTP span in adapter deployments).
|
|
1340
|
-
if (parentSpan && parentSpan !== currentSpan) {
|
|
1341
|
-
parentSpan.setAttribute('http.route', route);
|
|
1342
|
-
parentSpan.updateName(name);
|
|
1343
|
-
}
|
|
1344
|
-
})();
|
|
1345
1118
|
}
|
|
1119
|
+
// Strip EXIF (may contain location) and re-encode.
|
|
1120
|
+
pipeline = pipeline.rotate(); // apply EXIF orientation before stripping metadata
|
|
1121
|
+
const outBuf = keepPng ? await pipeline.png({
|
|
1122
|
+
compressionLevel: 9,
|
|
1123
|
+
adaptiveFiltering: true
|
|
1124
|
+
}).toBuffer() : await pipeline.jpeg({
|
|
1125
|
+
quality: jpegQuality,
|
|
1126
|
+
mozjpeg: true
|
|
1127
|
+
}).toBuffer();
|
|
1128
|
+
// If the "shrink" made the file BIGGER (already-optimised small JPEG
|
|
1129
|
+
// running through mozjpeg can occasionally grow) and no format change
|
|
1130
|
+
// was forced, fall back to the original.
|
|
1131
|
+
if (!forceJpeg && !wantResize && outBuf.length >= input.length) {
|
|
1132
|
+
return {
|
|
1133
|
+
buf: input,
|
|
1134
|
+
media_type: mediaType,
|
|
1135
|
+
width,
|
|
1136
|
+
height,
|
|
1137
|
+
passthrough: true
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
// Re-read metadata for the exact output dimensions.
|
|
1141
|
+
const outMeta = await sharpFn(outBuf, {
|
|
1142
|
+
failOn: "none"
|
|
1143
|
+
}).metadata().catch(()=>meta);
|
|
1144
|
+
return {
|
|
1145
|
+
buf: outBuf,
|
|
1146
|
+
media_type: outMediaType,
|
|
1147
|
+
width: outMeta.width ?? width,
|
|
1148
|
+
height: outMeta.height ?? height,
|
|
1149
|
+
passthrough: false
|
|
1150
|
+
};
|
|
1151
|
+
} catch (err) {
|
|
1152
|
+
console.warn("[shrink] encode failed, passing through:", err.message);
|
|
1153
|
+
return {
|
|
1154
|
+
buf: input,
|
|
1155
|
+
media_type: mediaType,
|
|
1156
|
+
width,
|
|
1157
|
+
height,
|
|
1158
|
+
passthrough: true
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
;// ./lib/attachments/spill.ts
|
|
1164
|
+
// Attachment spill store.
|
|
1165
|
+
//
|
|
1166
|
+
// Turns inline `image`/`file` ContentParts (base64 or text blob in the
|
|
1167
|
+
// message row) into `image_ref`/`file_ref` parts that point at a file under
|
|
1168
|
+
// `<dataDir>/files/`. The message row shrinks from ~400 KB per image to
|
|
1169
|
+
// ~200 B; `toBaseMessages` in lib/agents/llm.ts reads the file back only
|
|
1170
|
+
// when it needs to (see ADR-0090), so the bytes never enter the checkpoint
|
|
1171
|
+
// store or the warm summariser.
|
|
1172
|
+
//
|
|
1173
|
+
// Content-addressed: the on-disk file name is `<sha256>.<ext>` so an image
|
|
1174
|
+
// forwarded / retried / re-ingested twice collapses to one file. This is
|
|
1175
|
+
// the primitive the previous "delete-checkpoints-per-turn" hack was
|
|
1176
|
+
// compensating for — see ADR-0065.
|
|
1177
|
+
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
const MIME_EXT = {
|
|
1183
|
+
"image/png": "png",
|
|
1184
|
+
"image/jpeg": "jpg",
|
|
1185
|
+
"image/jpg": "jpg",
|
|
1186
|
+
"image/webp": "webp",
|
|
1187
|
+
"image/gif": "gif",
|
|
1188
|
+
"image/svg+xml": "svg",
|
|
1189
|
+
"image/heic": "heic",
|
|
1190
|
+
"image/heif": "heif",
|
|
1191
|
+
"image/bmp": "bmp",
|
|
1192
|
+
"image/tiff": "tiff",
|
|
1193
|
+
"application/pdf": "pdf",
|
|
1194
|
+
"application/json": "json",
|
|
1195
|
+
"text/plain": "txt"
|
|
1196
|
+
};
|
|
1197
|
+
function extForMime(media_type) {
|
|
1198
|
+
return MIME_EXT[media_type.toLowerCase()] ?? "bin";
|
|
1199
|
+
}
|
|
1200
|
+
function isTextMediaType(media_type) {
|
|
1201
|
+
return media_type.startsWith("text/") || media_type === "application/json";
|
|
1202
|
+
}
|
|
1203
|
+
function safeDisplayName(name) {
|
|
1204
|
+
const trimmed = name.trim();
|
|
1205
|
+
return trimmed.length > 0 ? trimmed.replace(/[\r\n\t]/g, " ").slice(0, 240) : "attachment";
|
|
1206
|
+
}
|
|
1207
|
+
function extForFile(media_type, filename) {
|
|
1208
|
+
const fromMime = extForMime(media_type);
|
|
1209
|
+
if (fromMime !== "bin") return fromMime;
|
|
1210
|
+
const ext = filename ? (0,external_node_path_.extname)(filename).slice(1).toLowerCase() : "";
|
|
1211
|
+
return /^[a-z0-9]{1,12}$/.test(ext) ? ext : "bin";
|
|
1212
|
+
}
|
|
1213
|
+
async function writeContentAddressedFile(buf, ext) {
|
|
1214
|
+
const sha256 = (0,external_node_crypto_.createHash)("sha256").update(buf).digest("hex");
|
|
1215
|
+
const name = `${sha256}.${ext}`;
|
|
1216
|
+
if (!(0,files/* isSafeFileName */.Dh)(name)) throw new Error(`spill: unsafe file name ${name}`);
|
|
1217
|
+
const abs = (0,external_node_path_.join)(files/* FILES_DIR */.qM, name);
|
|
1218
|
+
let exists = false;
|
|
1219
|
+
try {
|
|
1220
|
+
const s = (0,external_node_fs_.statSync)(abs);
|
|
1221
|
+
exists = s.isFile() && s.size === buf.length;
|
|
1222
|
+
} catch {
|
|
1223
|
+
exists = false;
|
|
1224
|
+
}
|
|
1225
|
+
if (!exists) {
|
|
1226
|
+
await external_node_fs_.promises.writeFile(abs, buf);
|
|
1227
|
+
}
|
|
1228
|
+
return {
|
|
1229
|
+
name,
|
|
1230
|
+
sha256
|
|
1346
1231
|
};
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* Persist one base64-encoded image blob to the files dir, keyed by its
|
|
1235
|
+
* content hash. Idempotent: re-writing the same bytes is a no-op.
|
|
1236
|
+
* Returns the `image_ref` variant the caller should store instead.
|
|
1237
|
+
*
|
|
1238
|
+
* The blob is run through `shrinkImage` first (ADR-0066) so what lands
|
|
1239
|
+
* on disk is already resized to a vision-friendly 1600px max-edge and
|
|
1240
|
+
* transcoded off HEIC/BMP/TIFF. Pass `shrink: { maxEdge: 0 }`-style
|
|
1241
|
+
* opts through if you need to override defaults.
|
|
1242
|
+
*/ async function spillImageBuffer(raw, media_type, opts) {
|
|
1243
|
+
const shrunk = await shrinkImage(raw, media_type, opts?.shrink);
|
|
1244
|
+
const buf = shrunk.buf;
|
|
1245
|
+
const storedMediaType = shrunk.media_type;
|
|
1246
|
+
const { name, sha256 } = await writeContentAddressedFile(buf, extForMime(storedMediaType));
|
|
1247
|
+
const ref = {
|
|
1248
|
+
type: "image_ref",
|
|
1249
|
+
media_type: storedMediaType,
|
|
1250
|
+
name,
|
|
1251
|
+
sha256,
|
|
1252
|
+
size: buf.length
|
|
1253
|
+
};
|
|
1254
|
+
if (opts?.filename) ref.filename = safeDisplayName(opts.filename);
|
|
1255
|
+
if (shrunk.width) ref.width = shrunk.width;
|
|
1256
|
+
if (shrunk.height) ref.height = shrunk.height;
|
|
1257
|
+
return ref;
|
|
1258
|
+
}
|
|
1259
|
+
async function spillImagePart(part, opts) {
|
|
1260
|
+
return spillImageBuffer(Buffer.from(part.data, "base64"), part.media_type, opts);
|
|
1261
|
+
}
|
|
1262
|
+
async function spillFileBuffer(raw, media_type, filename) {
|
|
1263
|
+
const { name, sha256 } = await writeContentAddressedFile(raw, extForFile(media_type, filename));
|
|
1264
|
+
return {
|
|
1265
|
+
type: "file_ref",
|
|
1266
|
+
media_type,
|
|
1267
|
+
name,
|
|
1268
|
+
filename: safeDisplayName(filename),
|
|
1269
|
+
sha256,
|
|
1270
|
+
size: raw.length
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Walk a ContentPart[] and replace every inline `image`/`file` part with an
|
|
1275
|
+
* `image_ref`/`file_ref`. Leaves other part types untouched. Safe to call on
|
|
1276
|
+
* already-refactored parts — the ref variants are passed through.
|
|
1277
|
+
* Returns a new array (does not mutate the input).
|
|
1278
|
+
*
|
|
1279
|
+
* `file.data` is plain UTF-8 text for text/json attachments (the InputBar
|
|
1280
|
+
* client reads text/code files with `readAsText`, never base64) and base64
|
|
1281
|
+
* otherwise, mirroring the decode convention already used to render `file`
|
|
1282
|
+
* parts in lib/agents/llm.ts and the provider adapters.
|
|
1283
|
+
*/ async function spillAttachments(parts, opts) {
|
|
1284
|
+
const out = [];
|
|
1285
|
+
for (const p of parts){
|
|
1286
|
+
if (p.type === "image") out.push(await spillImagePart(p, opts));
|
|
1287
|
+
else if (p.type === "file") {
|
|
1288
|
+
const buf = isTextMediaType(p.media_type) ? Buffer.from(p.data, "utf8") : Buffer.from(p.data, "base64");
|
|
1289
|
+
out.push(await spillFileBuffer(buf, p.media_type, p.name));
|
|
1290
|
+
} else out.push(p);
|
|
1291
|
+
}
|
|
1292
|
+
return out;
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Read an `image_ref` back off disk as raw bytes. Used at LLM invocation
|
|
1296
|
+
* time (see `toBaseMessages` in `lib/agents/llm.ts`) — the base64
|
|
1297
|
+
* re-encoding lives on the provider block only, never in state.
|
|
1298
|
+
* Throws when the file is missing so the caller can surface a clear error
|
|
1299
|
+
* to the user instead of the provider returning a puzzling 400.
|
|
1300
|
+
*/ async function readImageRef(ref) {
|
|
1301
|
+
if (!(0,files/* isSafeFileName */.Dh)(ref.name)) {
|
|
1302
|
+
throw new Error(`readImageRef: unsafe file name ${ref.name}`);
|
|
1303
|
+
}
|
|
1304
|
+
const abs = (0,external_node_path_.join)(files/* FILES_DIR */.qM, ref.name);
|
|
1305
|
+
return external_node_fs_.promises.readFile(abs);
|
|
1306
|
+
}
|
|
1307
|
+
/**
|
|
1308
|
+
* Read a `file_ref` back off disk as raw bytes. Same shape as
|
|
1309
|
+
* `readImageRef` — used both for the newest turn's full readout and for
|
|
1310
|
+
* the `view_attachment` tool's on-demand re-read (ADR-0090).
|
|
1311
|
+
*/ async function readFileRef(ref) {
|
|
1312
|
+
if (!(0,files/* isSafeFileName */.Dh)(ref.name)) {
|
|
1313
|
+
throw new Error(`readFileRef: unsafe file name ${ref.name}`);
|
|
1361
1314
|
}
|
|
1315
|
+
const abs = (0,external_node_path_.join)(files/* FILES_DIR */.qM, ref.name);
|
|
1316
|
+
return external_node_fs_.promises.readFile(abs);
|
|
1362
1317
|
}
|
|
1363
1318
|
|
|
1364
|
-
//# sourceMappingURL=app-route.js.map
|
|
1365
1319
|
|
|
1320
|
+
/***/ }),
|
|
1321
|
+
|
|
1322
|
+
/***/ 63033:
|
|
1323
|
+
/***/ ((module) => {
|
|
1324
|
+
|
|
1325
|
+
"use strict";
|
|
1326
|
+
module.exports = require("next/dist/server/app-render/work-unit-async-storage.external.js");
|
|
1327
|
+
|
|
1328
|
+
/***/ }),
|
|
1329
|
+
|
|
1330
|
+
/***/ 73024:
|
|
1331
|
+
/***/ ((module) => {
|
|
1332
|
+
|
|
1333
|
+
"use strict";
|
|
1334
|
+
module.exports = require("node:fs");
|
|
1335
|
+
|
|
1336
|
+
/***/ }),
|
|
1337
|
+
|
|
1338
|
+
/***/ 76760:
|
|
1339
|
+
/***/ ((module) => {
|
|
1340
|
+
|
|
1341
|
+
"use strict";
|
|
1342
|
+
module.exports = require("node:path");
|
|
1343
|
+
|
|
1344
|
+
/***/ }),
|
|
1345
|
+
|
|
1346
|
+
/***/ 77598:
|
|
1347
|
+
/***/ ((module) => {
|
|
1348
|
+
|
|
1349
|
+
"use strict";
|
|
1350
|
+
module.exports = require("node:crypto");
|
|
1351
|
+
|
|
1352
|
+
/***/ }),
|
|
1353
|
+
|
|
1354
|
+
/***/ 78335:
|
|
1355
|
+
/***/ (() => {
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
/***/ }),
|
|
1360
|
+
|
|
1361
|
+
/***/ 86439:
|
|
1362
|
+
/***/ ((module) => {
|
|
1363
|
+
|
|
1364
|
+
"use strict";
|
|
1365
|
+
module.exports = require("next/dist/shared/lib/no-fallback-error.external");
|
|
1366
1366
|
|
|
1367
1367
|
/***/ }),
|
|
1368
1368
|
|
|
@@ -1380,7 +1380,7 @@ async function handler(req, res, ctx) {
|
|
|
1380
1380
|
var __webpack_require__ = require("../../../../../webpack-runtime.js");
|
|
1381
1381
|
__webpack_require__.C(exports);
|
|
1382
1382
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
1383
|
-
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813], () => (__webpack_exec__(
|
|
1383
|
+
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813], () => (__webpack_exec__(53805)));
|
|
1384
1384
|
module.exports = __webpack_exports__;
|
|
1385
1385
|
|
|
1386
1386
|
})();
|