failproofai 1.0.10 → 1.0.11-beta.1
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/build-manifest.json +6 -6
- package/.next/standalone/.next/prerender-manifest.json +4 -4
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js +4 -4
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- 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.meta +8 -0
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +6 -6
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +4 -4
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.meta +8 -0
- package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js +4 -4
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js +4 -4
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js +2 -2
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +4 -4
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js +3 -3
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js +3 -3
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js +4 -4
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.meta +8 -0
- package/.next/standalone/.next/server/app/index.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +4 -4
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js +8 -8
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js +5 -5
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +5 -5
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +5 -5
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/settings/page.js +9 -9
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__0qxhecv._.js → [externals]__0d7i9ea._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[externals]__0sg9-3p._.js → [externals]__0hjaw70._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[externals]__1_9ze9b._.js +3 -0
- package/.next/standalone/.next/server/chunks/[externals]__1oenfmn._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08dchfu._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ga9hs7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l3yhx4._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0moxohc._.js +22 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o07qi9._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z2ll-a._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1adacul._.js +11 -11
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1autwno._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1v25n-6._.js +3 -0
- package/.next/standalone/.next/server/chunks/_09dz7xv._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0tovk6q._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3yc._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1ek68ln._.js +2 -2
- package/.next/standalone/.next/server/chunks/_1fz8m31._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1jrv3hg._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1nx8fim._.js +3 -0
- package/.next/standalone/.next/server/chunks/_1ogwigf._.js +1 -1
- package/.next/standalone/.next/server/chunks/{_1q5i8mb._.js → _1q27azx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/lib_telemetry_ts_0dctyyw._.js +1 -1
- package/.next/standalone/.next/server/chunks/{node_modules_posthog-node_dist_entrypoints_index_node_mjs_0el6rg8._.js → node_modules_posthog-node_dist_entrypoints_index_node_mjs_0ol5pa3._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{node_modules_posthog-node_dist_entrypoints_index_node_mjs_04op_ou._.js → node_modules_posthog-node_dist_entrypoints_index_node_mjs_1rqmk27._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{node_modules_posthog-node_dist_entrypoints_index_node_mjs_0dr20uz._.js → node_modules_posthog-node_dist_entrypoints_index_node_mjs_1w7tiq4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0oqrl71._.js → [root-of-the-server]__042u-jn._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04usis8._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1-bm5zf._.js → [root-of-the-server]__0502lat._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0_gn5iz._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0f765xr._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__01bmjsj._.js → [root-of-the-server]__0h38gzz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hoaz1g._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1ouobn4._.js → [root-of-the-server]__0mxmwtx._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__19evfi8._.js → [root-of-the-server]__0uescqv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13d-wb6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1484zv2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1mf3zp6._.js → [root-of-the-server]__19dutr7._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1u6sn69._.js → [root-of-the-server]__1ab4ifb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1fbrk56._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1pprgri._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1um4yxn._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1wb4yt2._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1y3n3cn._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_08x1r5t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0bqoto4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0yq5_3a._.js → _1ffxwxz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1gb0ifp._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_042cgl1._.js → _1o95rf0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_1zopuov._.js → _1thr5rf._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_16pa9ht._.js → _1v1o2ya._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo.js +12 -14
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9sni._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_1hl81y4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_0nkkbfv._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-config_ts_04t589g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_fp-home_ts_0je3xkv._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +6 -6
- package/.next/standalone/.next/server/middleware.js +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
- package/.next/standalone/.next/static/chunks/08tmc_7n-rba1.js +1 -0
- package/.next/standalone/.next/static/chunks/{3mjfvng11xnoo.js → 09tlrmucn6oq3.js} +1 -1
- package/.next/standalone/.next/static/chunks/{078dofaxvjgpd.js → 0i69k917myh7b.js} +1 -1
- package/.next/standalone/.next/static/chunks/{03h3b-uomi7_d.js → 0u_nhsujkactp.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2j92xul6y24_v.js → 0zp51hzx62i-u.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3u1s8dsqiean5.js → 1fz7q0gtnmeod.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3ob2161ap37ul.js → 1j75le8wln-26.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2kj826h1w9r47.js → 1z4km7tw0_50h.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1fqukzzowjflt.js → 239ay_80-xr8z.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3nkc2jlgyygda.js → 2c9pc5xco6rnu.js} +1 -1
- package/.next/standalone/.next/static/chunks/{3i8rg2fv9nd6e.js → 3n46e45atic-m.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0542cuk_va8g1.js → 3sg07wnn969xq.js} +1 -1
- package/.next/standalone/.next/static/chunks/{turbopack-11dn2pegmg9_9.js → turbopack-1opxka4dtjbc5.js} +1 -1
- package/.next/standalone/app/actions/install-hooks-web.ts +10 -2
- package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/hash.js/sha256/256.js +1 -0
- package/.next/standalone/node_modules/next/dist/compiled/hash.js/sha256/package.json +1 -0
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +17 -17
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +18 -18
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +3 -3
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +13 -13
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/base-server.js +1 -2
- package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/image-optimizer.js +265 -53
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +177 -19
- package/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/index.js +36 -17
- package/.next/standalone/node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js +14 -6
- package/.next/standalone/node_modules/next/dist/server/lib/match-next-data-pathname.js +3 -1
- package/.next/standalone/node_modules/next/dist/server/lib/node-fs-methods.js +14 -0
- package/.next/standalone/node_modules/next/dist/server/lib/route-cache-key.js +77 -0
- package/.next/standalone/node_modules/next/dist/server/lib/router-utils/block-cross-site-dev.js +9 -11
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/mcp/get-mcp-middleware.js +4 -2
- package/.next/standalone/node_modules/next/dist/server/next-server.js +7 -3
- package/.next/standalone/node_modules/next/dist/server/response-cache/index.js +32 -16
- package/.next/standalone/node_modules/next/dist/server/route-matcher-providers/app-page-route-matcher-provider.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/route-modules/pages/pages-handler.js +6 -1
- package/.next/standalone/node_modules/next/dist/server/route-modules/route-module.js +9 -2
- package/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +30 -29
- package/.next/standalone/node_modules/next/dist/shared/lib/router/utils/app-paths.js +18 -1
- package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/.next/standalone/node_modules/next/package.json +10 -10
- package/.next/standalone/package.json +14 -11
- package/.next/standalone/sdk/python/README.md +41 -0
- package/.next/standalone/sdk/python/docs/README.md +1 -0
- package/.next/standalone/sdk/python/docs/otel/README.md +36 -0
- package/.next/standalone/sdk/python/docs/otel/examples/agent_trace.py +30 -0
- package/.next/standalone/sdk/python/docs/otel/examples/quickstart.py +22 -0
- package/.next/standalone/sdk/python/failproofai_sdk/__init__.py +8 -0
- package/.next/standalone/sdk/python/failproofai_sdk/integrations/__init__.py +3 -0
- package/.next/standalone/sdk/python/failproofai_sdk/integrations/otel.py +189 -0
- package/.next/standalone/sdk/python/pyproject.toml +2 -1
- package/.next/standalone/sdk/python/tests/test_docs.py +16 -3
- package/.next/standalone/sdk/python/tests/test_integrations.py +1 -1
- package/.next/standalone/sdk/python/tests/test_otel.py +147 -0
- package/.next/standalone/sdk/python/tests/test_zero_dependencies.py +4 -1
- package/.next/standalone/sdk/python/uv.lock +258 -147
- package/.next/standalone/sdk/typescript/README.md +43 -0
- package/.next/standalone/sdk/typescript/integration/ai.test.ts +9 -2
- package/.next/standalone/sdk/typescript/package-lock.json +57 -5
- package/.next/standalone/sdk/typescript/package.json +2 -0
- package/.next/standalone/sdk/typescript/src/edge/index.ts +9 -0
- package/.next/standalone/sdk/typescript/src/index.ts +2 -0
- package/.next/standalone/sdk/typescript/src/integrations/index.ts +4 -1
- package/.next/standalone/sdk/typescript/src/integrations/otel.ts +204 -0
- package/.next/standalone/sdk/typescript/test/integrations.test.ts +1 -1
- package/.next/standalone/sdk/typescript/test/otel.test.ts +125 -0
- package/.next/standalone/server.js +1 -1
- package/bin/failproofai.mjs +653 -1077
- package/dist/cli.mjs +8174 -3930
- package/dist/worker.mjs +170 -62
- package/hermes-plugin/plugin.yaml +1 -1
- package/package.json +14 -11
- package/scripts/launch-facts.ts +157 -0
- package/scripts/launch-ready.ts +228 -0
- package/scripts/launch-screen.ts +202 -0
- package/scripts/launch.ts +106 -49
- package/scripts/skew-log-filter.ts +42 -0
- package/src/audit/cli-login.ts +39 -59
- package/src/audit/cli.ts +308 -228
- package/src/audit/index.ts +45 -2
- package/src/audit/schedule-cli.ts +83 -120
- package/src/audit/types.ts +31 -0
- package/src/hooks/agent-selection.ts +155 -0
- package/src/hooks/backfill-cli.ts +151 -137
- package/src/hooks/backfill-request.ts +149 -0
- package/src/hooks/cloud-connection.ts +1 -1
- package/src/hooks/cloud-enrollment-cli.ts +78 -28
- package/src/hooks/cloud-introspect.ts +3 -0
- package/src/hooks/collector-config.ts +10 -1
- package/src/hooks/config-status.ts +606 -0
- package/src/hooks/configure-wizard.ts +915 -989
- package/src/hooks/daemon-service.ts +16 -6
- package/src/hooks/did-you-mean.ts +185 -0
- package/src/hooks/flush-cli.ts +33 -7
- package/src/hooks/fp-config.ts +96 -0
- package/src/hooks/fp-home.ts +11 -0
- package/src/hooks/fp-reset.ts +102 -95
- package/src/hooks/handler.ts +4 -0
- package/src/hooks/harness-cli.ts +87 -138
- package/src/hooks/install-prompt.ts +38 -477
- package/src/hooks/integrations.ts +1 -1
- package/src/hooks/jev-cli.ts +183 -196
- package/src/hooks/manager.ts +554 -358
- package/src/hooks/onboarding-attempt.ts +11 -9
- package/src/hooks/otel-cli.ts +344 -0
- package/src/hooks/otel-output.ts +24 -0
- package/src/hooks/otel-writers.ts +225 -0
- package/src/hooks/pack-cli.ts +219 -204
- package/src/hooks/report-body.ts +50 -0
- package/src/hooks/safe-config-write.ts +4 -2
- package/src/hooks/session-pause-cli.ts +93 -73
- package/src/hooks/tui.ts +849 -389
- package/src/hooks/uninstall-cli.ts +136 -149
- package/src/hooks/untraced-note.ts +52 -0
- package/.next/standalone/.next/server/chunks/[externals]__19_pzeq._.js +0 -3
- package/.next/standalone/.next/server/chunks/[externals]__20kzpkf._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01eqny5._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05ja_05._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0igxt32._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zyc_nm._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ttrwnd._.js +0 -22
- package/.next/standalone/.next/server/chunks/_0bs-v8p._.js +0 -3
- package/.next/standalone/.next/server/chunks/_185gyk9._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__056wjo4._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n0xg95._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rwtwpm._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yrsbd_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11mayhe._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15578wp._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1m_svbe._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1q4p5b8._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1n3w9lb._.js +0 -6
- package/.next/standalone/.next/static/chunks/1lyg_puttohbc.js +0 -1
- /package/.next/standalone/.next/static/{ECs8__hcNabYV58WfDh-3 → UZKCiP4Q2TeU8zOB-h9Xj}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{ECs8__hcNabYV58WfDh-3 → UZKCiP4Q2TeU8zOB-h9Xj}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{ECs8__hcNabYV58WfDh-3 → UZKCiP4Q2TeU8zOB-h9Xj}/_ssgManifest.js +0 -0
|
@@ -72,7 +72,7 @@ async function fetchPkgInfo(pkg) {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
const data = await res.json();
|
|
75
|
-
const versionData = data.versions["16.3.
|
|
75
|
+
const versionData = data.versions["16.3.8"];
|
|
76
76
|
return {
|
|
77
77
|
os: versionData.os,
|
|
78
78
|
cpu: versionData.cpu,
|
|
@@ -100,7 +100,7 @@ async function patchIncorrectLockfile(dir) {
|
|
|
100
100
|
const expectedSwcPkgs = Object.keys(_packagejson.optionalDependencies || {}).filter((pkg)=>pkg.startsWith('@next/swc-'));
|
|
101
101
|
const patchDependency = (pkg, pkgData)=>{
|
|
102
102
|
lockfileParsed.dependencies[pkg] = {
|
|
103
|
-
version: "16.3.
|
|
103
|
+
version: "16.3.8",
|
|
104
104
|
resolved: pkgData.tarball,
|
|
105
105
|
integrity: pkgData.integrity,
|
|
106
106
|
optional: true
|
|
@@ -108,7 +108,7 @@ async function patchIncorrectLockfile(dir) {
|
|
|
108
108
|
};
|
|
109
109
|
const patchPackage = (pkg, pkgData)=>{
|
|
110
110
|
lockfileParsed.packages[pkg] = {
|
|
111
|
-
version: "16.3.
|
|
111
|
+
version: "16.3.8",
|
|
112
112
|
resolved: pkgData.tarball,
|
|
113
113
|
integrity: pkgData.integrity,
|
|
114
114
|
cpu: pkgData.cpu,
|
|
@@ -1569,8 +1569,7 @@ class Server {
|
|
|
1569
1569
|
const isAppPath = Array.isArray(appPaths);
|
|
1570
1570
|
let page = pathname;
|
|
1571
1571
|
if (isAppPath) {
|
|
1572
|
-
|
|
1573
|
-
page = appPaths[appPaths.length - 1];
|
|
1572
|
+
page = (0, _apppaths.selectAppPageEntry)(pathname, appPaths);
|
|
1574
1573
|
}
|
|
1575
1574
|
const result = await this.findPageComponents({
|
|
1576
1575
|
locale: (0, _requestmeta.getRequestMeta)(ctx.req, 'locale'),
|
|
@@ -302,7 +302,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
|
302
302
|
}
|
|
303
303
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
|
304
304
|
const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
305
|
-
version: "16.3.
|
|
305
|
+
version: "16.3.8"
|
|
306
306
|
});
|
|
307
307
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
308
308
|
// of the current `next dev` invocation.
|
|
@@ -362,7 +362,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir, resetFetc
|
|
|
362
362
|
writeRoutesHashesManifest: false,
|
|
363
363
|
currentNodeJsVersion,
|
|
364
364
|
isPersistentCachingEnabled: (0, _utils2.isFileSystemCacheEnabledForDev)(opts.nextConfig),
|
|
365
|
-
nextVersion: "16.3.
|
|
365
|
+
nextVersion: "16.3.8",
|
|
366
366
|
serverHmr: serverFastRefresh
|
|
367
367
|
}, {
|
|
368
368
|
turbopackMemoryEviction: opts.nextConfig.experimental.turbopackMemoryEvictionMode,
|
|
@@ -234,7 +234,7 @@ class HotReloaderWebpack {
|
|
|
234
234
|
this.previewProps = previewProps;
|
|
235
235
|
this.rewrites = rewrites;
|
|
236
236
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
237
|
-
version: "16.3.
|
|
237
|
+
version: "16.3.8"
|
|
238
238
|
});
|
|
239
239
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
240
240
|
// of the current `next dev` invocation.
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
0 && (module.exports = {
|
|
6
6
|
ImageError: null,
|
|
7
7
|
ImageOptimizerCache: null,
|
|
8
|
+
createPinnedLookup: null,
|
|
8
9
|
detectContentType: null,
|
|
9
10
|
extractEtag: null,
|
|
10
11
|
fetchExternalImage: null,
|
|
@@ -32,6 +33,9 @@ _export(exports, {
|
|
|
32
33
|
ImageOptimizerCache: function() {
|
|
33
34
|
return ImageOptimizerCache;
|
|
34
35
|
},
|
|
36
|
+
createPinnedLookup: function() {
|
|
37
|
+
return createPinnedLookup;
|
|
38
|
+
},
|
|
35
39
|
detectContentType: function() {
|
|
36
40
|
return detectContentType;
|
|
37
41
|
},
|
|
@@ -74,6 +78,8 @@ _export(exports, {
|
|
|
74
78
|
});
|
|
75
79
|
const _crypto = require("crypto");
|
|
76
80
|
const _fs = require("fs");
|
|
81
|
+
const _http = require("http");
|
|
82
|
+
const _https = require("https");
|
|
77
83
|
const _accept = require("next/dist/compiled/@hapi/accept");
|
|
78
84
|
const _contentdisposition = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/content-disposition"));
|
|
79
85
|
const _imagesize = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/image-size"));
|
|
@@ -96,6 +102,8 @@ const _invarianterror = require("../shared/lib/invariant-error");
|
|
|
96
102
|
const _promises = require("dns/promises");
|
|
97
103
|
const _net = require("net");
|
|
98
104
|
const _dns = require("dns");
|
|
105
|
+
const _stream = require("stream");
|
|
106
|
+
const _zlib = require("zlib");
|
|
99
107
|
function _interop_require_default(obj) {
|
|
100
108
|
return obj && obj.__esModule ? obj : {
|
|
101
109
|
default: obj
|
|
@@ -796,6 +804,7 @@ class ImageOptimizerCache {
|
|
|
796
804
|
revalidate: effectiveRevalidate
|
|
797
805
|
};
|
|
798
806
|
await this.cacheHandler.set(cacheKey, valueWithRevalidate, {
|
|
807
|
+
kind: _responsecache.IncrementalCacheKind.IMAGE,
|
|
799
808
|
cacheControl: {
|
|
800
809
|
revalidate: effectiveRevalidate,
|
|
801
810
|
expire: cacheControl == null ? void 0 : cacheControl.expire
|
|
@@ -932,25 +941,210 @@ function isRedirect(statusCode) {
|
|
|
932
941
|
308
|
|
933
942
|
].includes(statusCode);
|
|
934
943
|
}
|
|
944
|
+
function upstreamTimedOut(href) {
|
|
945
|
+
_log.error('upstream image response timed out for', href);
|
|
946
|
+
return Object.defineProperty(new ImageError(504, '"url" parameter is valid but upstream response timed out'), "__NEXT_ERROR_CODE", {
|
|
947
|
+
value: "E394",
|
|
948
|
+
enumerable: false,
|
|
949
|
+
configurable: true
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
const agentOptions = {
|
|
953
|
+
keepAlive: true,
|
|
954
|
+
timeout: 7000
|
|
955
|
+
};
|
|
956
|
+
const getHttpAgentName = _http.Agent.prototype.getName;
|
|
957
|
+
const getHttpsAgentName = _https.Agent.prototype.getName;
|
|
958
|
+
class ImageHttpAgent extends _http.Agent {
|
|
959
|
+
getName(options = {}) {
|
|
960
|
+
return `${getHttpAgentName.call(this, options)}:${options.imageLookupKey ?? ''}`;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
class ImageHttpsAgent extends _https.Agent {
|
|
964
|
+
getName(options = {}) {
|
|
965
|
+
return `${getHttpsAgentName.call(this, options)}:${options.imageLookupKey ?? ''}`;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
let protectedHttpAgent;
|
|
969
|
+
let protectedHttpsAgent;
|
|
970
|
+
let permissiveHttpAgent;
|
|
971
|
+
let permissiveHttpsAgent;
|
|
972
|
+
function getImageAgent(dangerouslyAllowLocalIP, isHttps) {
|
|
973
|
+
if (isHttps) {
|
|
974
|
+
if (dangerouslyAllowLocalIP) {
|
|
975
|
+
return permissiveHttpsAgent ??= new ImageHttpsAgent(agentOptions);
|
|
976
|
+
}
|
|
977
|
+
return protectedHttpsAgent ??= new ImageHttpsAgent(agentOptions);
|
|
978
|
+
}
|
|
979
|
+
if (dangerouslyAllowLocalIP) {
|
|
980
|
+
return permissiveHttpAgent ??= new ImageHttpAgent(agentOptions);
|
|
981
|
+
}
|
|
982
|
+
return protectedHttpAgent ??= new ImageHttpAgent(agentOptions);
|
|
983
|
+
}
|
|
984
|
+
const BASE_REQ_HEADERS = {
|
|
985
|
+
accept: '*/*',
|
|
986
|
+
'accept-language': '*',
|
|
987
|
+
'sec-fetch-mode': 'cors',
|
|
988
|
+
'user-agent': 'node'
|
|
989
|
+
};
|
|
990
|
+
const HTTP_FETCH_HEADERS = {
|
|
991
|
+
...BASE_REQ_HEADERS,
|
|
992
|
+
'accept-encoding': 'gzip, deflate'
|
|
993
|
+
};
|
|
994
|
+
const HTTPS_FETCH_HEADERS = {
|
|
995
|
+
...BASE_REQ_HEADERS,
|
|
996
|
+
'accept-encoding': 'br, gzip, deflate'
|
|
997
|
+
};
|
|
998
|
+
/**
|
|
999
|
+
* Resolves `hostname` with the DNS options the socket itself would have used,
|
|
1000
|
+
* so the addresses checked below are the exact set the connection can reach.
|
|
1001
|
+
* Mirrors `lookupAndConnect()` in Node's `lib/net.js`.
|
|
1002
|
+
*/ function lookupAsSocketWould(hostname) {
|
|
1003
|
+
return (0, _promises.lookup)(hostname, {
|
|
1004
|
+
all: true,
|
|
1005
|
+
// Node applies ADDRCONFIG whenever no address family is requested,
|
|
1006
|
+
// on every platform except Windows.
|
|
1007
|
+
hints: process.platform === 'win32' ? 0 : _dns.ADDRCONFIG
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
function createPinnedLookup(hostname, addresses) {
|
|
1011
|
+
return (lookupHostname, options, callback)=>{
|
|
1012
|
+
if (lookupHostname !== hostname) {
|
|
1013
|
+
callback(new _invarianterror.InvariantError(`Image lookup hostname "${lookupHostname}" does not match request hostname "${hostname}"`), []);
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
const family = typeof options.family === 'number' ? options.family : 0;
|
|
1017
|
+
const matched = family ? addresses.filter((address)=>address.family === family) : addresses;
|
|
1018
|
+
if (matched.length === 0) {
|
|
1019
|
+
// Reporting this as an error rather than an empty list is not optional:
|
|
1020
|
+
// Node destructures the first address, so the resulting TypeError is
|
|
1021
|
+
// thrown inside the socket and escapes the request entirely.
|
|
1022
|
+
const err = new Error(`No IPv${family} address available for ${hostname}`);
|
|
1023
|
+
err.code = 'ENODATA';
|
|
1024
|
+
callback(err, []);
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
if (options.all) {
|
|
1028
|
+
callback(null, matched);
|
|
1029
|
+
} else {
|
|
1030
|
+
callback(null, matched[0].address, matched[0].family);
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
function requestUpstreamImage(url, pinnedLookup, imageLookupKey, dangerouslyAllowLocalIP, signal) {
|
|
1035
|
+
return new Promise((resolve, reject)=>{
|
|
1036
|
+
const isHttps = url.protocol === 'https:';
|
|
1037
|
+
const request = isHttps ? _https.request : _http.request;
|
|
1038
|
+
const options = {
|
|
1039
|
+
agent: getImageAgent(dangerouslyAllowLocalIP, isHttps),
|
|
1040
|
+
headers: isHttps ? HTTPS_FETCH_HEADERS : HTTP_FETCH_HEADERS,
|
|
1041
|
+
imageLookupKey,
|
|
1042
|
+
lookup: pinnedLookup,
|
|
1043
|
+
signal
|
|
1044
|
+
};
|
|
1045
|
+
const req = request(url, options, resolve);
|
|
1046
|
+
req.on('error', reject);
|
|
1047
|
+
req.end();
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
class DeflateDecoder extends _stream.Transform {
|
|
1051
|
+
constructor(){
|
|
1052
|
+
super();
|
|
1053
|
+
this.decoder = undefined;
|
|
1054
|
+
}
|
|
1055
|
+
_transform(chunk, encoding, callback) {
|
|
1056
|
+
if (!this.decoder) {
|
|
1057
|
+
if (chunk.length === 0) {
|
|
1058
|
+
callback();
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
const options = {
|
|
1062
|
+
flush: _zlib.constants.Z_SYNC_FLUSH,
|
|
1063
|
+
finishFlush: _zlib.constants.Z_SYNC_FLUSH
|
|
1064
|
+
};
|
|
1065
|
+
this.decoder = (chunk[0] & 0x0f) === 0x08 ? (0, _zlib.createInflate)(options) : (0, _zlib.createInflateRaw)(options);
|
|
1066
|
+
this.decoder.on('data', (data)=>this.push(data));
|
|
1067
|
+
this.decoder.on('end', ()=>this.push(null));
|
|
1068
|
+
this.decoder.on('error', (err)=>this.destroy(err));
|
|
1069
|
+
}
|
|
1070
|
+
this.decoder.write(chunk, encoding, callback);
|
|
1071
|
+
}
|
|
1072
|
+
_final(callback) {
|
|
1073
|
+
var _this_decoder;
|
|
1074
|
+
(_this_decoder = this.decoder) == null ? void 0 : _this_decoder.end();
|
|
1075
|
+
this.decoder = undefined;
|
|
1076
|
+
callback();
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
// Matches the chain limit of native fetch (undici), so an upstream cannot
|
|
1080
|
+
// force unbounded decoder allocations with the header alone.
|
|
1081
|
+
const MAX_CONTENT_ENCODINGS = 5;
|
|
1082
|
+
function decodeResponseBody(res, href) {
|
|
1083
|
+
const contentEncoding = res.headers['content-encoding'];
|
|
1084
|
+
if (!contentEncoding) {
|
|
1085
|
+
return res;
|
|
1086
|
+
}
|
|
1087
|
+
const codings = contentEncoding.toLowerCase().split(',');
|
|
1088
|
+
if (codings.length > MAX_CONTENT_ENCODINGS) {
|
|
1089
|
+
_log.error('upstream image response had too many content encodings for', href);
|
|
1090
|
+
throw Object.defineProperty(new ImageError(400, '"url" parameter is valid but upstream response is invalid'), "__NEXT_ERROR_CODE", {
|
|
1091
|
+
value: "E394",
|
|
1092
|
+
enumerable: false,
|
|
1093
|
+
configurable: true
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
const decoders = [];
|
|
1097
|
+
for(let i = codings.length - 1; i >= 0; i--){
|
|
1098
|
+
switch(codings[i].trim()){
|
|
1099
|
+
case 'x-gzip':
|
|
1100
|
+
case 'gzip':
|
|
1101
|
+
decoders.push((0, _zlib.createGunzip)({
|
|
1102
|
+
flush: _zlib.constants.Z_SYNC_FLUSH,
|
|
1103
|
+
finishFlush: _zlib.constants.Z_SYNC_FLUSH
|
|
1104
|
+
}));
|
|
1105
|
+
break;
|
|
1106
|
+
case 'deflate':
|
|
1107
|
+
decoders.push(new DeflateDecoder());
|
|
1108
|
+
break;
|
|
1109
|
+
case 'br':
|
|
1110
|
+
decoders.push((0, _zlib.createBrotliDecompress)({
|
|
1111
|
+
flush: _zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
1112
|
+
finishFlush: _zlib.constants.BROTLI_OPERATION_FLUSH
|
|
1113
|
+
}));
|
|
1114
|
+
break;
|
|
1115
|
+
default:
|
|
1116
|
+
return res;
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
(0, _stream.pipeline)([
|
|
1120
|
+
res,
|
|
1121
|
+
...decoders
|
|
1122
|
+
], ()=>{});
|
|
1123
|
+
return decoders[decoders.length - 1];
|
|
1124
|
+
}
|
|
935
1125
|
async function fetchExternalImage(href, dangerouslyAllowLocalIP, maximumResponseBody, count = 3) {
|
|
1126
|
+
const url = new URL(href);
|
|
1127
|
+
// `URL.hostname` keeps the brackets around an IPv6 literal, the socket does not
|
|
1128
|
+
const hostname = url.hostname.replace(/^\[|\]$/g, '');
|
|
1129
|
+
let pinnedLookup;
|
|
1130
|
+
let imageLookupKey;
|
|
936
1131
|
if (!dangerouslyAllowLocalIP) {
|
|
937
|
-
const
|
|
938
|
-
let
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
]);
|
|
951
|
-
ips = records.map((record)=>record.address);
|
|
1132
|
+
const literalFamily = (0, _net.isIP)(hostname);
|
|
1133
|
+
let addresses;
|
|
1134
|
+
if (literalFamily > 0) {
|
|
1135
|
+
// A literal address is connected to as-is, without any DNS resolution
|
|
1136
|
+
addresses = [
|
|
1137
|
+
{
|
|
1138
|
+
address: hostname,
|
|
1139
|
+
family: literalFamily
|
|
1140
|
+
}
|
|
1141
|
+
];
|
|
1142
|
+
} else {
|
|
1143
|
+
addresses = await lookupAsSocketWould(hostname);
|
|
1144
|
+
pinnedLookup = createPinnedLookup(hostname, addresses);
|
|
952
1145
|
}
|
|
953
|
-
|
|
1146
|
+
imageLookupKey = addresses.map((address)=>`${address.family}:${address.address}`).join(',');
|
|
1147
|
+
const privateIps = addresses.map((record)=>record.address).filter((ip)=>(0, _isprivateip.isPrivateIp)(ip));
|
|
954
1148
|
if (privateIps.length > 0) {
|
|
955
1149
|
_log.error('upstream image', href, 'hostname resolved to private IP', JSON.stringify(privateIps), 'If this is expected and you understand SSRF risk, use images.dangerouslyAllowLocalIP = true to continue.');
|
|
956
1150
|
throw Object.defineProperty(new ImageError(400, '"url" parameter is not allowed'), "__NEXT_ERROR_CODE", {
|
|
@@ -960,24 +1154,31 @@ async function fetchExternalImage(href, dangerouslyAllowLocalIP, maximumResponse
|
|
|
960
1154
|
});
|
|
961
1155
|
}
|
|
962
1156
|
}
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
configurable: true
|
|
975
|
-
});
|
|
1157
|
+
// The signal is owned here rather than by `requestUpstreamImage()` because it
|
|
1158
|
+
// has to stay readable while the body streams. Node reports an abort during
|
|
1159
|
+
// the body as a plain `ECONNRESET` on the response, so the signal is the only
|
|
1160
|
+
// way to tell a timeout apart from the upstream resetting the connection.
|
|
1161
|
+
const signal = AbortSignal.timeout(agentOptions.timeout);
|
|
1162
|
+
let res;
|
|
1163
|
+
try {
|
|
1164
|
+
res = await requestUpstreamImage(url, pinnedLookup, imageLookupKey, dangerouslyAllowLocalIP, signal);
|
|
1165
|
+
} catch (err) {
|
|
1166
|
+
if (signal.aborted) {
|
|
1167
|
+
throw upstreamTimedOut(href);
|
|
976
1168
|
}
|
|
977
1169
|
throw err;
|
|
978
1170
|
}
|
|
979
|
-
const
|
|
980
|
-
if (
|
|
1171
|
+
const statusCode = res.statusCode;
|
|
1172
|
+
if (statusCode === undefined) {
|
|
1173
|
+
res.destroy();
|
|
1174
|
+
throw new _invarianterror.InvariantError('Expected statusCode on upstream image response');
|
|
1175
|
+
}
|
|
1176
|
+
const locationHeader = res.headers.location;
|
|
1177
|
+
if (isRedirect(statusCode) && locationHeader && URL.canParse(locationHeader, href)) {
|
|
1178
|
+
// Discard the body rather than draining it. A redirect body is never used,
|
|
1179
|
+
// and draining one would download unlimited bytes from the upstream because
|
|
1180
|
+
// `maximumResponseBody` is only enforced on the final response.
|
|
1181
|
+
res.destroy();
|
|
981
1182
|
if (count === 0) {
|
|
982
1183
|
_log.error('upstream image response had too many redirects', href);
|
|
983
1184
|
throw Object.defineProperty(new ImageError(508, '"url" parameter is valid but upstream response is invalid'), "__NEXT_ERROR_CODE", {
|
|
@@ -989,15 +1190,41 @@ async function fetchExternalImage(href, dangerouslyAllowLocalIP, maximumResponse
|
|
|
989
1190
|
const redirect = new URL(locationHeader, href).href;
|
|
990
1191
|
return fetchExternalImage(redirect, dangerouslyAllowLocalIP, maximumResponseBody, count - 1);
|
|
991
1192
|
}
|
|
992
|
-
if (
|
|
993
|
-
|
|
994
|
-
|
|
1193
|
+
if (statusCode < 200 || statusCode > 299) {
|
|
1194
|
+
res.destroy();
|
|
1195
|
+
_log.error('upstream image response failed for', href, statusCode);
|
|
1196
|
+
throw Object.defineProperty(new ImageError(statusCode, '"url" parameter is valid but upstream response is invalid'), "__NEXT_ERROR_CODE", {
|
|
995
1197
|
value: "E394",
|
|
996
1198
|
enumerable: false,
|
|
997
1199
|
configurable: true
|
|
998
1200
|
});
|
|
999
1201
|
}
|
|
1000
|
-
|
|
1202
|
+
const chunks = [];
|
|
1203
|
+
let totalSize = 0;
|
|
1204
|
+
try {
|
|
1205
|
+
const body = decodeResponseBody(res, href);
|
|
1206
|
+
// Throwing out of this loop destroys the response, so an oversized or
|
|
1207
|
+
// timed out download stops instead of running to completion.
|
|
1208
|
+
for await (const chunk of body){
|
|
1209
|
+
totalSize += chunk.byteLength;
|
|
1210
|
+
if (totalSize > maximumResponseBody) {
|
|
1211
|
+
_log.error('upstream image response exceeded maximum size for', href, totalSize);
|
|
1212
|
+
throw Object.defineProperty(new ImageError(413, '"url" parameter is valid but upstream response is invalid'), "__NEXT_ERROR_CODE", {
|
|
1213
|
+
value: "E394",
|
|
1214
|
+
enumerable: false,
|
|
1215
|
+
configurable: true
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
chunks.push(chunk);
|
|
1219
|
+
}
|
|
1220
|
+
} catch (err) {
|
|
1221
|
+
res.destroy();
|
|
1222
|
+
if (signal.aborted) {
|
|
1223
|
+
throw upstreamTimedOut(href);
|
|
1224
|
+
}
|
|
1225
|
+
throw err;
|
|
1226
|
+
}
|
|
1227
|
+
if (totalSize === 0) {
|
|
1001
1228
|
_log.error('upstream image response is empty for', href);
|
|
1002
1229
|
throw Object.defineProperty(new ImageError(400, '"url" parameter is valid but upstream response is invalid'), "__NEXT_ERROR_CODE", {
|
|
1003
1230
|
value: "E394",
|
|
@@ -1005,25 +1232,10 @@ async function fetchExternalImage(href, dangerouslyAllowLocalIP, maximumResponse
|
|
|
1005
1232
|
configurable: true
|
|
1006
1233
|
});
|
|
1007
1234
|
}
|
|
1008
|
-
const chunks = [];
|
|
1009
|
-
let totalSize = 0;
|
|
1010
|
-
for await (const c of res.body){
|
|
1011
|
-
const chunk = Buffer.from(c);
|
|
1012
|
-
totalSize += chunk.byteLength;
|
|
1013
|
-
if (totalSize > maximumResponseBody) {
|
|
1014
|
-
_log.error('upstream image response exceeded maximum size for', href, totalSize);
|
|
1015
|
-
throw Object.defineProperty(new ImageError(413, '"url" parameter is valid but upstream response is invalid'), "__NEXT_ERROR_CODE", {
|
|
1016
|
-
value: "E394",
|
|
1017
|
-
enumerable: false,
|
|
1018
|
-
configurable: true
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
|
-
chunks.push(chunk);
|
|
1022
|
-
}
|
|
1023
1235
|
const buffer = Buffer.concat(chunks);
|
|
1024
|
-
const contentType = res.headers
|
|
1025
|
-
const cacheControl = res.headers
|
|
1026
|
-
const etag = extractEtag(res.headers.
|
|
1236
|
+
const contentType = res.headers['content-type'];
|
|
1237
|
+
const cacheControl = res.headers['cache-control'];
|
|
1238
|
+
const etag = extractEtag(res.headers.etag, buffer);
|
|
1027
1239
|
return {
|
|
1028
1240
|
buffer,
|
|
1029
1241
|
contentType,
|
|
@@ -79,7 +79,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
79
79
|
}
|
|
80
80
|
function logStartInfo({ networkUrl, appUrl, envInfo, logBundler }) {
|
|
81
81
|
const versionSuffix = logBundler ? ` (${(0, _bundler.bundlerName)((0, _bundler.getBundlerFromEnv)())})` : '';
|
|
82
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.
|
|
82
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.3.8"}`))}${versionSuffix}`);
|
|
83
83
|
if (appUrl) {
|
|
84
84
|
_log.bootstrap(`- Local: ${appUrl}`);
|
|
85
85
|
}
|