veryfront 0.1.1239 → 0.1.1241
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/esm/cli/commands/build/command-help.d.ts.map +1 -1
- package/esm/cli/commands/build/command-help.js +4 -0
- package/esm/cli/commands/build/command.d.ts +3 -1
- package/esm/cli/commands/build/command.d.ts.map +1 -1
- package/esm/cli/commands/build/command.js +13 -5
- package/esm/cli/commands/build/handler.d.ts +17 -0
- package/esm/cli/commands/build/handler.d.ts.map +1 -1
- package/esm/cli/commands/build/handler.js +188 -9
- package/esm/cli/commands/generate/command.d.ts.map +1 -1
- package/esm/cli/commands/generate/command.js +40 -0
- package/esm/cli/commands/push/command.d.ts.map +1 -1
- package/esm/cli/commands/push/command.js +24 -16
- package/esm/cli/shared/ensure-content-processor.d.ts +16 -1
- package/esm/cli/shared/ensure-content-processor.d.ts.map +1 -1
- package/esm/cli/shared/ensure-content-processor.js +39 -5
- package/esm/cli/shared/project-creation.d.ts.map +1 -1
- package/esm/cli/shared/project-creation.js +29 -1
- package/esm/deno.d.ts +14 -5
- package/esm/deno.js +23 -7
- package/esm/extensions/ext-llm-openai/src/openai-chat-stream.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-chat-stream.js +16 -6
- package/esm/extensions/ext-llm-openai/src/openai-provider.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-provider.js +11 -2
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts +2 -14
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.js +1 -72
- package/esm/extensions/ext-schema-zod/src/adapter.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/browser-aliases.d.ts +164 -0
- package/esm/src/agent/ag-ui/browser-aliases.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/browser-aliases.js +68 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-encoder.d.ts +35 -0
- package/esm/src/agent/ag-ui/chat-ui-chunk-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{chat-ui-chunk-browser-encoder.js → chat-ui-chunk-encoder.js} +11 -11
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts +8 -6
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/chunk-encoder-bridge.js +5 -4
- package/esm/src/agent/ag-ui/chunk-encoder.d.ts +26 -0
- package/esm/src/agent/ag-ui/chunk-encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-chunk-encoder.js → chunk-encoder.js} +3 -2
- package/esm/src/agent/ag-ui/{browser-encoder.d.ts → encoder.d.ts} +33 -19
- package/esm/src/agent/ag-ui/encoder.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-encoder.js → encoder.js} +81 -27
- package/esm/src/agent/ag-ui/finalize-tracker.d.ts +15 -0
- package/esm/src/agent/ag-ui/finalize-tracker.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-finalize-tracker.js → finalize-tracker.js} +4 -4
- package/esm/src/agent/ag-ui/response-stream.d.ts +36 -0
- package/esm/src/agent/ag-ui/response-stream.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{browser-response-stream.js → response-stream.js} +6 -3
- package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts +1 -1
- package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts +7 -7
- package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/runtime-event-encoder.js +4 -4
- package/esm/src/agent/ag-ui/runtime-response.d.ts +20 -0
- package/esm/src/agent/ag-ui/runtime-response.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/runtime-response.js +16 -0
- package/esm/src/agent/ag-ui/sse-parser.d.ts +1 -1
- package/esm/src/agent/ag-ui/sse-parser.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/sse-parser.js +3 -3
- package/esm/src/agent/ag-ui/tracked-response.d.ts +11 -0
- package/esm/src/agent/ag-ui/tracked-response.d.ts.map +1 -0
- package/esm/src/agent/ag-ui/{tracked-browser-response.js → tracked-response.js} +6 -4
- package/esm/src/agent/conversation/hosted-lifecycle.d.ts.map +1 -1
- package/esm/src/agent/conversation/hosted-lifecycle.js +2 -1
- package/esm/src/agent/conversation/lifecycle-run-event-adapter.d.ts.map +1 -1
- package/esm/src/agent/conversation/lifecycle-run-event-adapter.js +2 -0
- package/esm/src/agent/conversation/private-run-event.d.ts.map +1 -1
- package/esm/src/agent/conversation/private-run-event.js +174 -3
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts +2 -0
- package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-chunk-mirror.js +13 -6
- package/esm/src/agent/conversation/run-events.d.ts +8 -0
- package/esm/src/agent/conversation/run-events.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-events.js +54 -4
- package/esm/src/agent/conversation/run-stream-mirror.d.ts.map +1 -1
- package/esm/src/agent/conversation/run-stream-mirror.js +5 -2
- package/esm/src/agent/hosted/durable-run-event-sink.d.ts +2 -1
- package/esm/src/agent/hosted/durable-run-event-sink.d.ts.map +1 -1
- package/esm/src/agent/hosted/durable-run-event-sink.js +9 -7
- package/esm/src/agent/hosted/prepared-chat-execution.js +2 -2
- package/esm/src/agent/index.d.ts +9 -8
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +9 -8
- package/esm/src/agent/memory/memory.d.ts.map +1 -1
- package/esm/src/agent/memory/memory.js +7 -6
- package/esm/src/agent/react/use-chat/types.d.ts +2 -0
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +3 -2
- package/esm/src/agent/runtime/ag-ui-contract.d.ts +2 -2
- package/esm/src/agent/runtime/ag-ui-contract.d.ts.map +1 -1
- package/esm/src/agent/runtime/ag-ui-contract.js +2 -2
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.js +34 -4
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +15 -6
- package/esm/src/agent/streaming/data-stream.d.ts +1 -1
- package/esm/src/agent/streaming/data-stream.d.ts.map +1 -1
- package/esm/src/agent/streaming/fork-runtime-part-mapper.d.ts +1 -1
- package/esm/src/agent/streaming/fork-runtime-part-mapper.d.ts.map +1 -1
- package/esm/src/agent/streaming/lifecycle/live-adapter.d.ts.map +1 -1
- package/esm/src/agent/streaming/lifecycle/live-adapter.js +2 -0
- package/esm/src/agent/streaming/lifecycle/reducer.d.ts.map +1 -1
- package/esm/src/agent/streaming/lifecycle/reducer.js +7 -0
- package/esm/src/agent/streaming/lifecycle/runtime-provider-adapter.js +4 -0
- package/esm/src/build/production-build/templates.d.ts.map +1 -1
- package/esm/src/build/production-build/templates.js +1 -1
- package/esm/src/cache/request-cache-batcher.d.ts +1 -0
- package/esm/src/cache/request-cache-batcher.d.ts.map +1 -1
- package/esm/src/cache/request-cache-batcher.js +21 -7
- package/esm/src/chat/ag-ui.d.ts +1 -1
- package/esm/src/chat/index.d.ts +2 -2
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +1 -1
- package/esm/src/config/config-shim.d.ts +1 -1
- package/esm/src/config/config-shim.d.ts.map +1 -1
- package/esm/src/config/config-shim.js +1 -1
- package/esm/src/config/declarative-evaluator-worker-protocol.d.ts.map +1 -1
- package/esm/src/config/env.js +1 -1
- package/esm/src/config/environment-config.js +1 -1
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +4 -4
- package/esm/src/config/schemas/config.schema.d.ts +20 -0
- package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.js +27 -0
- package/esm/src/config/server-external-packages.d.ts +11 -0
- package/esm/src/config/server-external-packages.d.ts.map +1 -0
- package/esm/src/config/server-external-packages.js +53 -0
- package/esm/src/data/data-fetcher.d.ts.map +1 -1
- package/esm/src/data/data-fetcher.js +9 -4
- package/esm/src/data/data-result-validation.d.ts +5 -0
- package/esm/src/data/data-result-validation.d.ts.map +1 -0
- package/esm/src/data/data-result-validation.js +56 -0
- package/esm/src/data/helpers.d.ts +5 -5
- package/esm/src/data/helpers.d.ts.map +1 -1
- package/esm/src/data/helpers.js +22 -68
- package/esm/src/data/index.d.ts +1 -1
- package/esm/src/data/index.d.ts.map +1 -1
- package/esm/src/data/response-metadata.d.ts +23 -0
- package/esm/src/data/response-metadata.d.ts.map +1 -0
- package/esm/src/data/response-metadata.js +311 -0
- package/esm/src/data/schemas/data.schema.d.ts +95 -6
- package/esm/src/data/schemas/data.schema.d.ts.map +1 -1
- package/esm/src/data/schemas/data.schema.js +57 -3
- package/esm/src/data/schemas/index.d.ts +1 -1
- package/esm/src/data/schemas/index.d.ts.map +1 -1
- package/esm/src/data/schemas/index.js +1 -1
- package/esm/src/data/server-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/server-data-fetcher.js +5 -5
- package/esm/src/data/static-data-fetcher.d.ts +2 -2
- package/esm/src/data/static-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/static-data-fetcher.js +6 -3
- package/esm/src/data/types.d.ts +1 -1
- package/esm/src/data/types.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.js +81 -26
- package/esm/src/discovery/handlers/task-handler.d.ts +1 -1
- package/esm/src/discovery/handlers/task-handler.d.ts.map +1 -1
- package/esm/src/discovery/handlers/task-handler.js +6 -3
- package/esm/src/discovery/types.d.ts +6 -4
- package/esm/src/discovery/types.d.ts.map +1 -1
- package/esm/src/errors/error-registry/runtime.d.ts +2 -0
- package/esm/src/errors/error-registry/runtime.d.ts.map +1 -1
- package/esm/src/errors/error-registry/runtime.js +8 -0
- package/esm/src/errors/error-registry.d.ts +1 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/index.d.ts +1 -1
- package/esm/src/errors/index.d.ts.map +1 -1
- package/esm/src/errors/index.js +1 -1
- package/esm/src/errors/user-friendly/error-wrapper.js +1 -1
- package/esm/src/errors/veryfront-error.d.ts.map +1 -1
- package/esm/src/extensions/index.d.ts +2 -0
- package/esm/src/extensions/index.d.ts.map +1 -1
- package/esm/src/extensions/index.js +1 -0
- package/esm/src/extensions/parser/code-parser.d.ts +9 -0
- package/esm/src/extensions/parser/code-parser.d.ts.map +1 -1
- package/esm/src/extensions/parser/defaults.d.ts +5 -0
- package/esm/src/extensions/parser/defaults.d.ts.map +1 -1
- package/esm/src/extensions/parser/defaults.js +23 -11
- package/esm/src/fs/index.d.ts +50 -1
- package/esm/src/fs/index.d.ts.map +1 -1
- package/esm/src/fs/index.js +50 -1
- package/esm/src/html/html-injection.d.ts +2 -0
- package/esm/src/html/html-injection.d.ts.map +1 -1
- package/esm/src/html/html-injection.js +4 -1
- package/esm/src/html/html-shell-generator.d.ts.map +1 -1
- package/esm/src/html/html-shell-generator.js +11 -3
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/html/hydration-script-builder/prod-runtime-selection.d.ts +23 -0
- package/esm/src/html/hydration-script-builder/prod-runtime-selection.d.ts.map +1 -0
- package/esm/src/html/hydration-script-builder/prod-runtime-selection.js +55 -0
- package/esm/src/html/hydration-script-builder/prod-scripts.d.ts +2 -0
- package/esm/src/html/hydration-script-builder/prod-scripts.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/prod-scripts.js +12 -3
- package/esm/src/html/schemas/html.schema.d.ts +2 -0
- package/esm/src/html/schemas/html.schema.d.ts.map +1 -1
- package/esm/src/html/schemas/html.schema.js +2 -0
- package/esm/src/html/styles-builder/css-hash-cache.d.ts +1 -1
- package/esm/src/html/styles-builder/css-hash-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/css-hash-cache.js +1 -1
- package/esm/src/index.client.d.ts +2 -2
- package/esm/src/index.client.d.ts.map +1 -1
- package/esm/src/index.client.js +3 -1
- package/esm/src/index.d.ts +1 -1
- package/esm/src/index.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.d.ts +7 -7
- package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.js +17 -9
- package/esm/src/internal-agents/control-plane-auth.js +1 -1
- package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
- package/esm/src/internal-agents/run-stream.js +15 -9
- package/esm/src/modules/import-map/loader.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.js +2 -2
- package/esm/src/modules/import-map/merger.js +2 -2
- package/esm/src/modules/import-map/preloader.js +2 -2
- package/esm/src/modules/react-loader/component-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/component-loader.js +2 -0
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +3 -2
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.js +7 -1
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts +2 -0
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts.map +1 -1
- package/esm/src/modules/react-loader/transformed-module-coordinator.d.ts.map +1 -1
- package/esm/src/modules/react-loader/transformed-module-coordinator.js +2 -1
- package/esm/src/modules/react-loader/types.d.ts +2 -0
- package/esm/src/modules/react-loader/types.d.ts.map +1 -1
- package/esm/src/modules/server/module-response-cache.d.ts +1 -0
- package/esm/src/modules/server/module-response-cache.d.ts.map +1 -1
- package/esm/src/modules/server/module-response-cache.js +5 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +4 -0
- package/esm/src/modules/server/module-transform.d.ts.map +1 -1
- package/esm/src/modules/server/module-transform.js +2 -0
- package/esm/src/observability/metrics/config.js +1 -1
- package/esm/src/observability/request-profiler.js +1 -1
- package/esm/src/observability/telemetry-error.js +2 -2
- package/esm/src/observability/tracing/telemetry-env.js +1 -1
- package/esm/src/platform/adapters/fs/cache/file-cache.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/cache/file-cache.js +5 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts +39 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.js +209 -40
- package/esm/src/platform/adapters/fs/veryfront/file-list-index.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/file-list-index.js +0 -14
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts +0 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.js +0 -3
- package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations.js +1 -4
- package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/request-context.js +4 -0
- package/esm/src/platform/adapters/fs/veryfront/stat-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/stat-operations.js +9 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.js +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts +2 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.js +97 -66
- package/esm/src/platform/compat/dns.d.ts +10 -0
- package/esm/src/platform/compat/dns.d.ts.map +1 -1
- package/esm/src/platform/compat/dns.js +50 -0
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/platform/compat/process/lifecycle.d.ts +10 -0
- package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -1
- package/esm/src/platform/compat/process/lifecycle.js +23 -0
- package/esm/src/platform/compat/process.d.ts +1 -1
- package/esm/src/platform/compat/process.d.ts.map +1 -1
- package/esm/src/platform/compat/process.js +1 -1
- package/esm/src/platform/compat/proxy-topology.js +1 -1
- package/esm/src/platform/request-context-access.d.ts +24 -0
- package/esm/src/platform/request-context-access.d.ts.map +1 -0
- package/esm/src/platform/request-context-access.js +26 -0
- package/esm/src/provider/shared/openai-reasoning.d.ts +16 -0
- package/esm/src/provider/shared/openai-reasoning.d.ts.map +1 -0
- package/esm/src/provider/shared/openai-reasoning.js +73 -0
- package/esm/src/provider/types.d.ts +2 -0
- package/esm/src/provider/types.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -1
- package/esm/src/provider/veryfront-cloud/provider.js +45 -18
- package/esm/src/proxy/handler.d.ts +1 -0
- package/esm/src/proxy/handler.d.ts.map +1 -1
- package/esm/src/proxy/handler.js +17 -4
- package/esm/src/proxy/proxy-error-context.d.ts +1 -0
- package/esm/src/proxy/proxy-error-context.d.ts.map +1 -1
- package/esm/src/proxy/proxy-error-context.js +1 -0
- package/esm/src/proxy/request-host.d.ts +3 -0
- package/esm/src/proxy/request-host.d.ts.map +1 -1
- package/esm/src/proxy/request-host.js +28 -8
- package/esm/src/proxy/routing-invalidation-redis.d.ts.map +1 -1
- package/esm/src/proxy/routing-invalidation-redis.js +38 -4
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +27 -3
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachments-panel.js +29 -7
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts +15 -6
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sidebar.js +37 -4
- package/esm/src/react/components/chat/chat/components/sidebar.types.d.ts +12 -1
- package/esm/src/react/components/chat/chat/components/sidebar.types.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +3 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +17 -6
- package/esm/src/react/components/chat/chat/composition/chat-composer.types.d.ts +12 -5
- package/esm/src/react/components/chat/chat/composition/chat-composer.types.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +18 -5
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.js +65 -1
- package/esm/src/react/components/chat/chat/composition/use-composer-value.d.ts +6 -3
- package/esm/src/react/components/chat/chat/composition/use-composer-value.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/use-composer-value.js +56 -5
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +7 -1
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +14 -4
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.js +10 -1
- package/esm/src/react/components/chat/chat/index.d.ts +1 -1
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/persistence/conversation-codec.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.d.ts +1 -1
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/server-render-context.d.ts.map +1 -1
- package/esm/src/release-assets/dependency-artifact-builder.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.d.ts +2 -2
- package/esm/src/rendering/app-reserved.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.js +4 -3
- package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-coordinator.js +1 -0
- package/esm/src/rendering/cache/cache-payload.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-payload.js +44 -0
- package/esm/src/rendering/component-handling.d.ts +4 -1
- package/esm/src/rendering/component-handling.d.ts.map +1 -1
- package/esm/src/rendering/component-handling.js +13 -6
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.js +3 -1
- package/esm/src/rendering/layouts/layout-collector.d.ts +1 -0
- package/esm/src/rendering/layouts/layout-collector.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-collector.js +201 -4
- package/esm/src/rendering/layouts/utils/applicator.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/applicator.js +3 -3
- package/esm/src/rendering/layouts/utils/component-loader.d.ts +2 -2
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.js +12 -4
- package/esm/src/rendering/orchestrator/file-resolver/index.d.ts +3 -1
- package/esm/src/rendering/orchestrator/file-resolver/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/file-resolver/index.js +13 -5
- package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html.js +26 -10
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/layout.js +2 -2
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +20 -2
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -0
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +6 -3
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts +3 -2
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.js +6 -6
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +1 -0
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +2 -2
- package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts +2 -0
- package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.js +7 -1
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +58 -10
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts +3 -0
- package/esm/src/rendering/orchestrator/render-result-assembly.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/render-result-assembly.js +3 -1
- package/esm/src/rendering/page-renderer.d.ts +2 -0
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.js +4 -1
- package/esm/src/rendering/page-rendering.d.ts +2 -0
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.js +1 -0
- package/esm/src/rendering/renderer.d.ts.map +1 -1
- package/esm/src/rendering/renderer.js +31 -1
- package/esm/src/rendering/script-page-handling.d.ts +2 -0
- package/esm/src/rendering/script-page-handling.d.ts.map +1 -1
- package/esm/src/rendering/script-page-handling.js +17 -1
- package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.js +3 -0
- package/esm/src/rendering/snippet-renderer.d.ts +10 -0
- package/esm/src/rendering/snippet-renderer.d.ts.map +1 -1
- package/esm/src/rendering/snippet-renderer.js +40 -18
- package/esm/src/rendering/ssr/component-registry.d.ts +1 -1
- package/esm/src/rendering/ssr/component-registry.d.ts.map +1 -1
- package/esm/src/rendering/ssr/component-registry.js +13 -6
- package/esm/src/rendering/ssr-outcome.d.ts +4 -3
- package/esm/src/rendering/ssr-outcome.d.ts.map +1 -1
- package/esm/src/rendering/ssr-outcome.js +25 -8
- package/esm/src/routing/api/handler.d.ts +1 -1
- package/esm/src/routing/api/handler.d.ts.map +1 -1
- package/esm/src/routing/api/handler.js +6 -1
- package/esm/src/runtime/model-call-context.d.ts +37 -2
- package/esm/src/runtime/model-call-context.d.ts.map +1 -1
- package/esm/src/runtime/model-call-context.js +42 -1
- package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
- package/esm/src/runtime/runtime-bridge.js +108 -8
- package/esm/src/sandbox/shell-tools.d.ts.map +1 -1
- package/esm/src/sandbox/shell-tools.js +16 -6
- package/esm/src/schedule/validation.d.ts +9 -1
- package/esm/src/schedule/validation.d.ts.map +1 -1
- package/esm/src/schedule/validation.js +167 -80
- package/esm/src/schemas/json-value.d.ts.map +1 -1
- package/esm/src/schemas/json-value.js +81 -37
- package/esm/src/security/http/base-handler.js +1 -1
- package/esm/src/security/sandbox/project-worker.d.ts +1 -0
- package/esm/src/security/sandbox/project-worker.d.ts.map +1 -1
- package/esm/src/security/sandbox/project-worker.js +6 -0
- package/esm/src/security/sandbox/worker-read-scope.d.ts +20 -0
- package/esm/src/security/sandbox/worker-read-scope.d.ts.map +1 -0
- package/esm/src/security/sandbox/worker-read-scope.js +127 -0
- package/esm/src/security/sandbox/worker-types.d.ts +12 -0
- package/esm/src/security/sandbox/worker-types.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/api.js +70 -3
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts +5 -0
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/esbuild-plugins.js +61 -3
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +227 -29
- package/esm/src/server/handlers/request/api/pages-api-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/api/pages-api-handler.js +20 -2
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +32 -15
- package/esm/src/server/handlers/request/prod-hydration-module.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/prod-hydration-module.handler.js +10 -3
- package/esm/src/server/handlers/request/project-run-execute.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/project-run-execute.handler.js +1 -0
- package/esm/src/server/handlers/request/snippet.handler.d.ts +6 -0
- package/esm/src/server/handlers/request/snippet.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/snippet.handler.js +8 -1
- package/esm/src/server/handlers/request/ssr/error-page-fallback.js +1 -0
- package/esm/src/server/handlers/request/ssr/ssr-response-builder.d.ts.map +1 -1
- package/esm/src/server/handlers/request/ssr/ssr-response-builder.js +10 -6
- package/esm/src/server/handlers/request/ssr/ssr.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/ssr/ssr.handler.js +22 -10
- package/esm/src/server/handlers/request/static.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/static.handler.js +1 -0
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts +2 -0
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/handler-context-builder.js +1 -0
- package/esm/src/server/runtime-handler/project-runtime-context.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/project-runtime-context.js +6 -2
- package/esm/src/server/runtime-handler/request-tracker.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-tracker.js +10 -3
- package/esm/src/server/services/rendering/ssr.service.d.ts +5 -0
- package/esm/src/server/services/rendering/ssr.service.d.ts.map +1 -1
- package/esm/src/server/services/rendering/ssr.service.js +71 -16
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
- package/esm/src/server/services/rsc/orchestrators/handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/handler.js +1 -0
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts +1 -0
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/render-handler.js +2 -0
- package/esm/src/server/services/static/static-file.service.d.ts +4 -1
- package/esm/src/server/services/static/static-file.service.d.ts.map +1 -1
- package/esm/src/server/services/static/static-file.service.js +48 -22
- package/esm/src/server/shared/browser-module-bundler.d.ts.map +1 -1
- package/esm/src/server/shared/browser-module-bundler.js +10 -0
- package/esm/src/server/utils/request-host.d.ts +6 -0
- package/esm/src/server/utils/request-host.d.ts.map +1 -1
- package/esm/src/server/utils/request-host.js +42 -1
- package/esm/src/skill/tools.d.ts.map +1 -1
- package/esm/src/task/definition-snapshot.d.ts +8 -0
- package/esm/src/task/definition-snapshot.d.ts.map +1 -0
- package/esm/src/task/definition-snapshot.js +154 -0
- package/esm/src/task/discovery.d.ts.map +1 -1
- package/esm/src/task/discovery.js +47 -21
- package/esm/src/task/types.d.ts +3 -0
- package/esm/src/task/types.d.ts.map +1 -1
- package/esm/src/task/types.js +7 -16
- package/esm/src/tool/remote-mcp.d.ts.map +1 -1
- package/esm/src/tool/remote-mcp.js +86 -5
- package/esm/src/transforms/esm/bundle-recovery.d.ts.map +1 -1
- package/esm/src/transforms/esm/bundle-recovery.js +1 -0
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +3 -1
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +18 -2
- package/esm/src/transforms/esm/http-cache-wrapper.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-wrapper.js +23 -0
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +2 -1
- package/esm/src/transforms/esm/types.d.ts +2 -0
- package/esm/src/transforms/esm/types.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/commonjs-policy.d.ts +22 -0
- package/esm/src/transforms/import-rewriter/commonjs-policy.d.ts.map +1 -0
- package/esm/src/transforms/import-rewriter/commonjs-policy.js +75 -0
- package/esm/src/transforms/import-rewriter/core.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/core.js +29 -1
- package/esm/src/transforms/import-rewriter/ssr-adapter.d.ts +2 -0
- package/esm/src/transforms/import-rewriter/ssr-adapter.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/ssr-adapter.js +79 -10
- package/esm/src/transforms/import-rewriter/strategies/bare-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/bare-strategy.js +14 -4
- package/esm/src/transforms/import-rewriter/types.d.ts +2 -0
- package/esm/src/transforms/import-rewriter/types.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/url-builder.d.ts +2 -19
- package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/url-builder.js +2 -67
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts +3 -2
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.js +39 -8
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts +3 -3
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.js +14 -6
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.js +2 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +6 -3
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.js +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.js +2 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.js +15 -7
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.d.ts +1 -0
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +2 -1
- package/esm/src/transforms/pipeline/cache-identity.d.ts +1 -0
- package/esm/src/transforms/pipeline/cache-identity.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/cache-identity.js +15 -0
- package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.js +2 -0
- package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/index.js +1 -0
- package/esm/src/transforms/pipeline/stages/resolve-imports.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/resolve-imports.js +1 -0
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.js +1 -0
- package/esm/src/transforms/pipeline/types.d.ts +4 -0
- package/esm/src/transforms/pipeline/types.d.ts.map +1 -1
- package/esm/src/transforms/shared/esm-sh-specifier.d.ts +18 -0
- package/esm/src/transforms/shared/esm-sh-specifier.d.ts.map +1 -0
- package/esm/src/transforms/shared/esm-sh-specifier.js +253 -0
- package/esm/src/transforms/shared/package-specifier.d.ts.map +1 -1
- package/esm/src/transforms/shared/package-specifier.js +9 -2
- package/esm/src/transforms/shared/server-only-packages.d.ts +25 -1
- package/esm/src/transforms/shared/server-only-packages.d.ts.map +1 -1
- package/esm/src/transforms/shared/server-only-packages.js +176 -4
- package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
- package/esm/src/types/index.d.ts +5 -0
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/types/server.d.ts +6 -0
- package/esm/src/types/server.d.ts.map +1 -1
- package/esm/src/utils/env-loader.d.ts.map +1 -1
- package/esm/src/utils/env-loader.js +2 -1
- package/esm/src/utils/feature-flags.js +1 -1
- package/esm/src/utils/lru-wrapper.js +2 -2
- package/esm/src/utils/memory/profiler.d.ts +20 -0
- package/esm/src/utils/memory/profiler.d.ts.map +1 -1
- package/esm/src/utils/memory/profiler.js +43 -5
- package/esm/src/utils/perf-timer.js +1 -1
- package/esm/src/utils/redirect-policy.d.ts +18 -0
- package/esm/src/utils/redirect-policy.d.ts.map +1 -0
- package/esm/src/utils/redirect-policy.js +92 -0
- package/esm/src/utils/redis-client.d.ts.map +1 -1
- package/esm/src/utils/redis-client.js +6 -3
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/claude-code/tool.d.ts +27 -27
- package/esm/src/workflow/claude-code/tool.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/wire-protocol.d.ts.map +1 -1
- package/esm/src/workflow/dsl/workflow.d.ts +3 -0
- package/esm/src/workflow/dsl/workflow.d.ts.map +1 -1
- package/esm/src/workflow/dsl/workflow.js +2 -1
- package/esm/src/workflow/executor/workflow-definition-snapshot.d.ts.map +1 -1
- package/esm/src/workflow/executor/workflow-definition-snapshot.js +88 -39
- package/esm/src/workflow/registry.d.ts +4 -1
- package/esm/src/workflow/registry.d.ts.map +1 -1
- package/esm/src/workflow/registry.js +10 -8
- package/esm/src/workflow/types.d.ts +3 -0
- package/esm/src/workflow/types.d.ts.map +1 -1
- package/esm/templates/index.d.ts.map +1 -1
- package/esm/templates/index.js +7 -0
- package/esm/templates/manifest.generated.d.ts.map +1 -1
- package/esm/templates/manifest.generated.js +1 -1
- package/package.json +16 -9
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts +0 -24
- package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/browser-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts +0 -15
- package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/browser-response-stream.d.ts +0 -33
- package/esm/src/agent/ag-ui/browser-response-stream.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts +0 -35
- package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/runtime-browser-response.d.ts +0 -20
- package/esm/src/agent/ag-ui/runtime-browser-response.d.ts.map +0 -1
- package/esm/src/agent/ag-ui/runtime-browser-response.js +0 -16
- package/esm/src/agent/ag-ui/tracked-browser-response.d.ts +0 -11
- package/esm/src/agent/ag-ui/tracked-browser-response.d.ts.map +0 -1
|
@@ -12,6 +12,22 @@ const JSON_VALUE_MAX_SERIALIZED_BYTES = 4 * 1024 * 1024;
|
|
|
12
12
|
const JSON_VALUE_MAX_STRING_BYTES = 1024 * 1024;
|
|
13
13
|
const JSON_VALUE_MAX_KEY_BYTES = 16 * 1024;
|
|
14
14
|
const JSON_UTF8_ENCODER = new TextEncoder();
|
|
15
|
+
const NativeSet = Set;
|
|
16
|
+
const OBJECT_PROTOTYPE = Object.prototype;
|
|
17
|
+
const arrayIsArray = Array.isArray;
|
|
18
|
+
const jsonStringify = JSON.stringify;
|
|
19
|
+
const numberIsFinite = Number.isFinite;
|
|
20
|
+
const numberIsSafeInteger = Number.isSafeInteger;
|
|
21
|
+
const objectDefineProperty = Object.defineProperty;
|
|
22
|
+
const reflectApply = Reflect.apply;
|
|
23
|
+
const reflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor;
|
|
24
|
+
const reflectGetPrototypeOf = Reflect.getPrototypeOf;
|
|
25
|
+
const reflectOwnKeys = Reflect.ownKeys;
|
|
26
|
+
const setAdd = Set.prototype.add;
|
|
27
|
+
const setDelete = Set.prototype.delete;
|
|
28
|
+
const setHas = Set.prototype.has;
|
|
29
|
+
const textEncoderEncode = TextEncoder.prototype.encode;
|
|
30
|
+
const typedArrayByteLengthGetter = reflectGetOwnPropertyDescriptor(reflectGetPrototypeOf(Uint8Array.prototype), "byteLength").get;
|
|
15
31
|
function appendSnapshotPath(parent, segment) {
|
|
16
32
|
return { parent, segment };
|
|
17
33
|
}
|
|
@@ -19,22 +35,32 @@ function invalidSnapshotPath(path) {
|
|
|
19
35
|
return { path };
|
|
20
36
|
}
|
|
21
37
|
function invalidJsonSnapshot(path) {
|
|
38
|
+
let segmentCount = 0;
|
|
39
|
+
for (let current = path; current !== undefined; current = current.parent) {
|
|
40
|
+
segmentCount += 1;
|
|
41
|
+
}
|
|
22
42
|
const segments = [];
|
|
43
|
+
segments.length = segmentCount;
|
|
44
|
+
let index = segmentCount - 1;
|
|
23
45
|
for (let current = path; current !== undefined; current = current.parent) {
|
|
24
|
-
segments
|
|
46
|
+
defineOwnDataProperty(segments, index, current.segment);
|
|
47
|
+
index -= 1;
|
|
25
48
|
}
|
|
26
|
-
segments.reverse();
|
|
27
49
|
return { success: false, path: segments };
|
|
28
50
|
}
|
|
29
51
|
function utf8LengthWithin(value, limit) {
|
|
30
52
|
if (value.length > limit)
|
|
31
53
|
return undefined;
|
|
32
|
-
const byteLength =
|
|
54
|
+
const byteLength = encodedByteLength(value);
|
|
33
55
|
return byteLength <= limit ? byteLength : undefined;
|
|
34
56
|
}
|
|
35
57
|
function serializedByteLength(value) {
|
|
36
|
-
const serialized =
|
|
37
|
-
return serialized === undefined ? undefined :
|
|
58
|
+
const serialized = jsonStringify(value);
|
|
59
|
+
return serialized === undefined ? undefined : encodedByteLength(serialized);
|
|
60
|
+
}
|
|
61
|
+
function encodedByteLength(value) {
|
|
62
|
+
const encoded = reflectApply(textEncoderEncode, JSON_UTF8_ENCODER, [value]);
|
|
63
|
+
return reflectApply(typedArrayByteLengthGetter, encoded, []);
|
|
38
64
|
}
|
|
39
65
|
/**
|
|
40
66
|
* Creates a bounded, data-only snapshot of an unknown JSON value.
|
|
@@ -51,7 +77,7 @@ function serializedByteLength(value) {
|
|
|
51
77
|
export function snapshotBoundedJsonValue(value) {
|
|
52
78
|
let activePath;
|
|
53
79
|
try {
|
|
54
|
-
const activeAncestors = new
|
|
80
|
+
const activeAncestors = new NativeSet();
|
|
55
81
|
const stack = [{
|
|
56
82
|
kind: "visit",
|
|
57
83
|
value,
|
|
@@ -72,18 +98,19 @@ export function snapshotBoundedJsonValue(value) {
|
|
|
72
98
|
rootAssigned = true;
|
|
73
99
|
return;
|
|
74
100
|
}
|
|
75
|
-
if (
|
|
76
|
-
frame.parent
|
|
101
|
+
if (arrayIsArray(frame.parent)) {
|
|
102
|
+
defineOwnDataProperty(frame.parent, frame.key, canonical);
|
|
77
103
|
return;
|
|
78
104
|
}
|
|
79
105
|
defineOwnDataProperty(frame.parent, frame.key, canonical);
|
|
80
106
|
};
|
|
81
107
|
while (stack.length > 0) {
|
|
82
|
-
const frame = stack.
|
|
108
|
+
const frame = stack.length === 0 ? undefined : stack[stack.length - 1];
|
|
83
109
|
if (!frame)
|
|
84
110
|
break;
|
|
111
|
+
stack.length -= 1;
|
|
85
112
|
if (frame.kind === "exit") {
|
|
86
|
-
activeAncestors
|
|
113
|
+
reflectApply(setDelete, activeAncestors, [frame.value]);
|
|
87
114
|
continue;
|
|
88
115
|
}
|
|
89
116
|
activePath = frame.path;
|
|
@@ -111,7 +138,7 @@ export function snapshotBoundedJsonValue(value) {
|
|
|
111
138
|
continue;
|
|
112
139
|
}
|
|
113
140
|
if (typeof current === "number") {
|
|
114
|
-
if (!
|
|
141
|
+
if (!numberIsFinite(current))
|
|
115
142
|
return invalidJsonSnapshot(frame.path);
|
|
116
143
|
const bytes = serializedByteLength(current);
|
|
117
144
|
if (bytes === undefined || !addSerializedBytes(bytes)) {
|
|
@@ -120,10 +147,11 @@ export function snapshotBoundedJsonValue(value) {
|
|
|
120
147
|
assign(frame, current);
|
|
121
148
|
continue;
|
|
122
149
|
}
|
|
123
|
-
if (typeof current !== "object" ||
|
|
150
|
+
if (typeof current !== "object" ||
|
|
151
|
+
reflectApply(setHas, activeAncestors, [current])) {
|
|
124
152
|
return invalidJsonSnapshot(frame.path);
|
|
125
153
|
}
|
|
126
|
-
if (
|
|
154
|
+
if (arrayIsArray(current)) {
|
|
127
155
|
const invalidPath = snapshotArray(current, frame, stack, activeAncestors, addSerializedBytes, assign);
|
|
128
156
|
if (invalidPath !== null)
|
|
129
157
|
return invalidJsonSnapshot(invalidPath.path);
|
|
@@ -144,35 +172,36 @@ export function snapshotBoundedJsonValue(value) {
|
|
|
144
172
|
}
|
|
145
173
|
}
|
|
146
174
|
function snapshotArray(value, frame, stack, activeAncestors, addSerializedBytes, assign) {
|
|
147
|
-
const ownKeys =
|
|
148
|
-
const lengthDescriptor =
|
|
175
|
+
const ownKeys = reflectOwnKeys(value);
|
|
176
|
+
const lengthDescriptor = reflectGetOwnPropertyDescriptor(value, "length");
|
|
149
177
|
const length = lengthDescriptor && "value" in lengthDescriptor
|
|
150
178
|
? lengthDescriptor.value
|
|
151
179
|
: undefined;
|
|
152
180
|
if (typeof length !== "number" ||
|
|
153
|
-
!
|
|
181
|
+
!numberIsSafeInteger(length) ||
|
|
154
182
|
length < 0 ||
|
|
155
183
|
length > JSON_VALUE_MAX_NODES ||
|
|
156
|
-
ownKeys
|
|
184
|
+
hasSymbolKey(ownKeys) ||
|
|
157
185
|
ownKeys.length !== length + 1 ||
|
|
158
|
-
!ownKeys
|
|
159
|
-
!addSerializedBytes(2 +
|
|
186
|
+
!hasStringKey(ownKeys, "length") ||
|
|
187
|
+
!addSerializedBytes(2 + (length > 0 ? length - 1 : 0))) {
|
|
160
188
|
return invalidSnapshotPath(frame.path);
|
|
161
189
|
}
|
|
162
190
|
const values = [];
|
|
163
191
|
for (let index = 0; index < length; index++) {
|
|
164
|
-
const descriptor =
|
|
192
|
+
const descriptor = reflectGetOwnPropertyDescriptor(value, `${index}`);
|
|
165
193
|
if (!descriptor || !("value" in descriptor) || descriptor.enumerable !== true) {
|
|
166
194
|
return invalidSnapshotPath(appendSnapshotPath(frame.path, index));
|
|
167
195
|
}
|
|
168
|
-
values.
|
|
196
|
+
defineOwnDataProperty(values, values.length, descriptor.value);
|
|
169
197
|
}
|
|
170
|
-
const canonical =
|
|
198
|
+
const canonical = [];
|
|
199
|
+
canonical.length = length;
|
|
171
200
|
assign(frame, canonical);
|
|
172
|
-
activeAncestors
|
|
173
|
-
stack.
|
|
201
|
+
reflectApply(setAdd, activeAncestors, [value]);
|
|
202
|
+
defineOwnDataProperty(stack, stack.length, { kind: "exit", value });
|
|
174
203
|
for (let index = values.length - 1; index >= 0; index--) {
|
|
175
|
-
stack.
|
|
204
|
+
defineOwnDataProperty(stack, stack.length, {
|
|
176
205
|
kind: "visit",
|
|
177
206
|
value: values[index],
|
|
178
207
|
depth: frame.depth + 1,
|
|
@@ -184,18 +213,19 @@ function snapshotArray(value, frame, stack, activeAncestors, addSerializedBytes,
|
|
|
184
213
|
return null;
|
|
185
214
|
}
|
|
186
215
|
function snapshotObject(value, frame, stack, activeAncestors, addSerializedBytes, assign) {
|
|
187
|
-
const prototype =
|
|
188
|
-
if (prototype !==
|
|
216
|
+
const prototype = reflectGetPrototypeOf(value);
|
|
217
|
+
if (prototype !== OBJECT_PROTOTYPE && prototype !== null) {
|
|
189
218
|
return invalidSnapshotPath(frame.path);
|
|
190
219
|
}
|
|
191
|
-
const ownKeys =
|
|
220
|
+
const ownKeys = reflectOwnKeys(value);
|
|
192
221
|
if (ownKeys.length > JSON_VALUE_MAX_NODES ||
|
|
193
|
-
ownKeys
|
|
194
|
-
!addSerializedBytes(2 +
|
|
222
|
+
hasSymbolKey(ownKeys) ||
|
|
223
|
+
!addSerializedBytes(2 + (ownKeys.length > 0 ? ownKeys.length - 1 : 0))) {
|
|
195
224
|
return invalidSnapshotPath(frame.path);
|
|
196
225
|
}
|
|
197
226
|
const values = [];
|
|
198
|
-
for (
|
|
227
|
+
for (let index = 0; index < ownKeys.length; index++) {
|
|
228
|
+
const key = ownKeys[index];
|
|
199
229
|
const childPath = appendSnapshotPath(frame.path, key);
|
|
200
230
|
if (utf8LengthWithin(key, JSON_VALUE_MAX_KEY_BYTES) === undefined) {
|
|
201
231
|
return invalidSnapshotPath(childPath);
|
|
@@ -204,18 +234,18 @@ function snapshotObject(value, frame, stack, activeAncestors, addSerializedBytes
|
|
|
204
234
|
if (keyBytes === undefined || !addSerializedBytes(keyBytes + 1)) {
|
|
205
235
|
return invalidSnapshotPath(childPath);
|
|
206
236
|
}
|
|
207
|
-
const descriptor =
|
|
237
|
+
const descriptor = reflectGetOwnPropertyDescriptor(value, key);
|
|
208
238
|
if (!descriptor || !("value" in descriptor) || descriptor.enumerable !== true) {
|
|
209
239
|
return invalidSnapshotPath(childPath);
|
|
210
240
|
}
|
|
211
|
-
values.
|
|
241
|
+
defineOwnDataProperty(values, values.length, descriptor.value);
|
|
212
242
|
}
|
|
213
243
|
const canonical = {};
|
|
214
244
|
assign(frame, canonical);
|
|
215
|
-
activeAncestors
|
|
216
|
-
stack.
|
|
245
|
+
reflectApply(setAdd, activeAncestors, [value]);
|
|
246
|
+
defineOwnDataProperty(stack, stack.length, { kind: "exit", value });
|
|
217
247
|
for (let index = values.length - 1; index >= 0; index--) {
|
|
218
|
-
stack.
|
|
248
|
+
defineOwnDataProperty(stack, stack.length, {
|
|
219
249
|
kind: "visit",
|
|
220
250
|
value: values[index],
|
|
221
251
|
depth: frame.depth + 1,
|
|
@@ -226,8 +256,22 @@ function snapshotObject(value, frame, stack, activeAncestors, addSerializedBytes
|
|
|
226
256
|
}
|
|
227
257
|
return null;
|
|
228
258
|
}
|
|
259
|
+
function hasSymbolKey(keys) {
|
|
260
|
+
for (let index = 0; index < keys.length; index++) {
|
|
261
|
+
if (typeof keys[index] === "symbol")
|
|
262
|
+
return true;
|
|
263
|
+
}
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
function hasStringKey(keys, expected) {
|
|
267
|
+
for (let index = 0; index < keys.length; index++) {
|
|
268
|
+
if (keys[index] === expected)
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
229
273
|
function defineOwnDataProperty(target, key, value) {
|
|
230
|
-
|
|
274
|
+
objectDefineProperty(target, key, {
|
|
231
275
|
value,
|
|
232
276
|
enumerable: true,
|
|
233
277
|
configurable: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { runWithCacheBatching } from "../../cache/request-cache-batcher.js";
|
|
2
2
|
import { runWithVerifiedCacheApiCredential } from "../../cache/verified-api-credential-context.js";
|
|
3
|
-
import { getHostEnv } from "../../platform/compat/process.js";
|
|
3
|
+
import { getHostEnv } from "../../platform/compat/process/env.js";
|
|
4
4
|
import { getErrorMessage as formatErrorMessage } from "../../errors/veryfront-error.js";
|
|
5
5
|
import { AUTHENTICATION_REQUIRED } from "../../errors/index.js";
|
|
6
6
|
import { serverLogger } from "../../utils/index.js";
|
|
@@ -28,6 +28,7 @@ export declare class ProjectWorker {
|
|
|
28
28
|
private suppressIdleNotifications;
|
|
29
29
|
private requestTimeoutMs;
|
|
30
30
|
private readonly permissions;
|
|
31
|
+
private readonly assertReadScopeGenerationConfined;
|
|
31
32
|
private workerScriptUrl?;
|
|
32
33
|
private readonly isolatedSsrRendererModuleUrl?;
|
|
33
34
|
private egressResolveHost?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-worker.d.ts","sourceRoot":"","sources":["../../../../src/src/security/sandbox/project-worker.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"project-worker.d.ts","sourceRoot":"","sources":["../../../../src/src/security/sandbox/project-worker.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,KAAK,EAEV,aAAa,EACb,cAAc,EAQf,MAAM,mBAAmB,CAAC;AAmP3B,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,W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AM,CAE3B;IAED,IAAI,kBAAkB,IAAI,OAAO,CAEhC;IAED,8EAA8E;IAC9E,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAUxC;;OAEG;IACH,KAAK,IAAI,IAAI;IAyGb;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAqExD;;;;;;OAMG;IACH,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CAAC,UAAU,CAAC;IAwMjE;;OAEG;IACG,SAAS,CAAC,SAAS,SAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAuCpD;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAQxB;;OAEG;IACH,SAAS,IAAI,IAAI;IAKjB;;;;;;OAMG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAQzB,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,aAAa;IA2DrB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,aAAa;IAoErB,OAAO,CAAC,oBAAoB;IA8I5B,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,gBAAgB;CAazB"}
|
|
@@ -14,6 +14,7 @@ import { validateIsolatedSsrRendererModuleUrl } from "../../extensions/rendering
|
|
|
14
14
|
import { INVALID_ARGUMENT, SSR_OUTPUT_LIMIT_EXCEEDED, TIMEOUT_ERROR, UNKNOWN_ERROR, } from "../../errors/index.js";
|
|
15
15
|
import { MAX_TIMER_DELAY_MS } from "../../utils/timer.js";
|
|
16
16
|
import { startWorkerEgressBroker, } from "./worker-egress-guard.js";
|
|
17
|
+
import { createWorkerReadScopeGenerationAudit } from "./worker-read-scope.js";
|
|
17
18
|
import { deserializeWorkerError } from "./worker-error-boundary.js";
|
|
18
19
|
import { MAX_WORKER_REQUEST_ID_CHARS, MAX_WORKER_SSR_CHUNK_BYTES, MAX_WORKER_SSR_OUTPUT_BYTES, MAX_WORKER_SSR_OUTPUT_CHUNKS, } from "./worker-types.js";
|
|
19
20
|
const logger = serverLogger.component("project-worker");
|
|
@@ -319,6 +320,7 @@ export class ProjectWorker {
|
|
|
319
320
|
suppressIdleNotifications = false;
|
|
320
321
|
requestTimeoutMs;
|
|
321
322
|
permissions;
|
|
323
|
+
assertReadScopeGenerationConfined;
|
|
322
324
|
workerScriptUrl;
|
|
323
325
|
isolatedSsrRendererModuleUrl;
|
|
324
326
|
egressResolveHost;
|
|
@@ -331,6 +333,7 @@ export class ProjectWorker {
|
|
|
331
333
|
constructor(options) {
|
|
332
334
|
this.projectId = options.projectId;
|
|
333
335
|
this.permissions = snapshotWorkerPermissions(options.permissions);
|
|
336
|
+
this.assertReadScopeGenerationConfined = createWorkerReadScopeGenerationAudit(this.permissions.read);
|
|
334
337
|
this.requestTimeoutMs = requireRequestTimeoutMs(options.requestTimeoutMs);
|
|
335
338
|
this.workerScriptUrl = options.workerScriptUrl;
|
|
336
339
|
this.isolatedSsrRendererModuleUrl = options.isolatedSsrRendererModuleUrl === undefined
|
|
@@ -381,6 +384,7 @@ export class ProjectWorker {
|
|
|
381
384
|
message: "Custom project worker scripts cannot use unrestricted network permissions",
|
|
382
385
|
});
|
|
383
386
|
}
|
|
387
|
+
this.assertReadScopeGenerationConfined();
|
|
384
388
|
const allowInternalEgress = this.allowInternalEgress;
|
|
385
389
|
let workerPermissions = this.permissions;
|
|
386
390
|
if (this.permissions.net === true) {
|
|
@@ -482,6 +486,7 @@ export class ProjectWorker {
|
|
|
482
486
|
if (!this.worker || this._status === "crashed" || this._status === "terminated") {
|
|
483
487
|
return Promise.reject(UNKNOWN_ERROR.create({ detail: `Worker not available (status: ${this._status})` }));
|
|
484
488
|
}
|
|
489
|
+
this.assertReadScopeGenerationConfined();
|
|
485
490
|
if (this.pending.has(requestId)) {
|
|
486
491
|
return Promise.reject(UNKNOWN_ERROR.create({ detail: "Duplicate worker request id" }));
|
|
487
492
|
}
|
|
@@ -546,6 +551,7 @@ export class ProjectWorker {
|
|
|
546
551
|
if (!this.worker || this._status === "crashed" || this._status === "terminated") {
|
|
547
552
|
throw UNKNOWN_ERROR.create({ detail: `Worker not available (status: ${this._status})` });
|
|
548
553
|
}
|
|
554
|
+
this.assertReadScopeGenerationConfined();
|
|
549
555
|
if (this.pending.has(requestId) || this.streamHandlers.has(requestId)) {
|
|
550
556
|
throw UNKNOWN_ERROR.create({ detail: "Duplicate worker request id" });
|
|
551
557
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reject scoped worker roots that contain a symlink escape.
|
|
3
|
+
*
|
|
4
|
+
* Deno authorizes reads using the symlink location rather than its resolved
|
|
5
|
+
* target. Project workers cannot create new symlinks because write access is
|
|
6
|
+
* denied. Use {@link createWorkerReadScopeGenerationAudit} for pooled workers
|
|
7
|
+
* so this full-tree scan runs once per immutable source generation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertWorkerReadScopeConfined(readScope: readonly string[] | boolean): void;
|
|
10
|
+
/**
|
|
11
|
+
* Create a successful-once read-scope audit for one immutable worker source
|
|
12
|
+
* generation.
|
|
13
|
+
*
|
|
14
|
+
* Host source changes must rotate the worker generation identity or evict its
|
|
15
|
+
* pool scope. The replacement worker receives a new audit and scans the new
|
|
16
|
+
* tree before startup. Reusing this closure across mutable source generations
|
|
17
|
+
* would violate that host-owned lifecycle contract.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createWorkerReadScopeGenerationAudit(readScope: readonly string[] | boolean): () => void;
|
|
20
|
+
//# sourceMappingURL=worker-read-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-read-scope.d.ts","sourceRoot":"","sources":["../../../../src/src/security/sandbox/worker-read-scope.ts"],"names":[],"mappings":"AAsDA;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,GACrC,IAAI,CAoDN;AAED;;;;;;;;GAQG;AACH,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,GACrC,MAAM,IAAI,CAQZ"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
+
import { dirname, join, relative } from "../../platform/compat/path/index.js";
|
|
3
|
+
import { SECURITY_VIOLATION } from "../../errors/index.js";
|
|
4
|
+
import { isNotFoundError } from "../../platform/compat/fs.js";
|
|
5
|
+
import { isWithinDirectory } from "../path-validation.js";
|
|
6
|
+
function rejectUnconfinedReadScope() {
|
|
7
|
+
throw SECURITY_VIOLATION.create({
|
|
8
|
+
detail: "Worker read scope contains a symlink outside its allowed roots",
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function directorySymlinkCanEscape(linkPath, targetPath, physicalRoots) {
|
|
12
|
+
for (const sourceRoot of physicalRoots) {
|
|
13
|
+
if (!isWithinDirectory(sourceRoot, linkPath))
|
|
14
|
+
continue;
|
|
15
|
+
const sourceRelativePath = relative(sourceRoot, linkPath);
|
|
16
|
+
const parentSteps = sourceRelativePath === "."
|
|
17
|
+
? 0
|
|
18
|
+
: sourceRelativePath.split("/").filter(Boolean).length;
|
|
19
|
+
let targetAncestor = targetPath;
|
|
20
|
+
for (let index = 0; index < parentSteps; index += 1) {
|
|
21
|
+
targetAncestor = dirname(targetAncestor);
|
|
22
|
+
}
|
|
23
|
+
if (!physicalRoots.some((root) => isWithinDirectory(root, targetAncestor))) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
function assertSymlinkConfined(linkPath, physicalRoots) {
|
|
30
|
+
let target;
|
|
31
|
+
let targetMetadata;
|
|
32
|
+
try {
|
|
33
|
+
target = dntShim.Deno.realPathSync(linkPath);
|
|
34
|
+
targetMetadata = dntShim.Deno.statSync(target);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
rejectUnconfinedReadScope();
|
|
38
|
+
}
|
|
39
|
+
if (!physicalRoots.some((root) => isWithinDirectory(root, target)) ||
|
|
40
|
+
(targetMetadata.isDirectory && directorySymlinkCanEscape(linkPath, target, physicalRoots))) {
|
|
41
|
+
rejectUnconfinedReadScope();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Reject scoped worker roots that contain a symlink escape.
|
|
46
|
+
*
|
|
47
|
+
* Deno authorizes reads using the symlink location rather than its resolved
|
|
48
|
+
* target. Project workers cannot create new symlinks because write access is
|
|
49
|
+
* denied. Use {@link createWorkerReadScopeGenerationAudit} for pooled workers
|
|
50
|
+
* so this full-tree scan runs once per immutable source generation.
|
|
51
|
+
*/
|
|
52
|
+
export function assertWorkerReadScopeConfined(readScope) {
|
|
53
|
+
if (!Array.isArray(readScope) || readScope.length === 0)
|
|
54
|
+
return;
|
|
55
|
+
const physicalRoots = [];
|
|
56
|
+
for (const root of readScope) {
|
|
57
|
+
try {
|
|
58
|
+
if (dntShim.Deno.lstatSync(root).isSymlink) {
|
|
59
|
+
rejectUnconfinedReadScope();
|
|
60
|
+
}
|
|
61
|
+
physicalRoots.push(dntShim.Deno.realPathSync(root));
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
// A missing optional support path grants nothing at startup. Project
|
|
65
|
+
// workers cannot create it because their write permission is denied.
|
|
66
|
+
if (isNotFoundError(error))
|
|
67
|
+
continue;
|
|
68
|
+
rejectUnconfinedReadScope();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const pending = [...new Set(physicalRoots)];
|
|
72
|
+
const visitedDirectories = new Set();
|
|
73
|
+
while (pending.length > 0) {
|
|
74
|
+
const current = pending.pop();
|
|
75
|
+
if (!current)
|
|
76
|
+
continue;
|
|
77
|
+
let metadata;
|
|
78
|
+
try {
|
|
79
|
+
metadata = dntShim.Deno.lstatSync(current);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
rejectUnconfinedReadScope();
|
|
83
|
+
}
|
|
84
|
+
if (metadata.isSymlink) {
|
|
85
|
+
assertSymlinkConfined(current, physicalRoots);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (!metadata.isDirectory)
|
|
89
|
+
continue;
|
|
90
|
+
if (visitedDirectories.has(current))
|
|
91
|
+
continue;
|
|
92
|
+
visitedDirectories.add(current);
|
|
93
|
+
try {
|
|
94
|
+
for (const entry of dntShim.Deno.readDirSync(current)) {
|
|
95
|
+
const entryPath = join(current, entry.name);
|
|
96
|
+
if (entry.isSymlink) {
|
|
97
|
+
assertSymlinkConfined(entryPath, physicalRoots);
|
|
98
|
+
}
|
|
99
|
+
else if (entry.isDirectory) {
|
|
100
|
+
pending.push(entryPath);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
rejectUnconfinedReadScope();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Create a successful-once read-scope audit for one immutable worker source
|
|
111
|
+
* generation.
|
|
112
|
+
*
|
|
113
|
+
* Host source changes must rotate the worker generation identity or evict its
|
|
114
|
+
* pool scope. The replacement worker receives a new audit and scans the new
|
|
115
|
+
* tree before startup. Reusing this closure across mutable source generations
|
|
116
|
+
* would violate that host-owned lifecycle contract.
|
|
117
|
+
*/
|
|
118
|
+
export function createWorkerReadScopeGenerationAudit(readScope) {
|
|
119
|
+
const generationReadScope = Array.isArray(readScope) ? [...readScope] : readScope;
|
|
120
|
+
let complete = false;
|
|
121
|
+
return () => {
|
|
122
|
+
if (complete)
|
|
123
|
+
return;
|
|
124
|
+
assertWorkerReadScopeConfined(generationReadScope);
|
|
125
|
+
complete = true;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -81,6 +81,18 @@ export interface SerializedDataResult {
|
|
|
81
81
|
};
|
|
82
82
|
notFound?: boolean;
|
|
83
83
|
revalidate?: number | false;
|
|
84
|
+
headers?: Record<string, string>;
|
|
85
|
+
cookies?: Array<{
|
|
86
|
+
name: string;
|
|
87
|
+
value: string;
|
|
88
|
+
domain?: string;
|
|
89
|
+
path?: string;
|
|
90
|
+
expires?: string;
|
|
91
|
+
maxAge?: number;
|
|
92
|
+
httpOnly?: boolean;
|
|
93
|
+
secure?: boolean;
|
|
94
|
+
sameSite?: "lax" | "strict" | "none";
|
|
95
|
+
}>;
|
|
84
96
|
}
|
|
85
97
|
/**
|
|
86
98
|
* Immutable, host-prepared JavaScript sent across the worker boundary.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-types.d.ts","sourceRoot":"","sources":["../../../../src/src/security/sandbox/worker-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAC5B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAC5B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC1C,OAAO,EAAE,M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F,cAAc,EAAE,MAAM,CAAC;IACvB,6EAA6E;IAC7E,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB,QAAmB,CAAC;AAEtD,sEAAsE;AACtE,eAAO,MAAM,2BAA2B,QAAmB,CAAC;AAE5D,kEAAkE;AAClE,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,QAAc,CAAC;AAEtD,6EAA6E;AAC7E,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,mEAAmE;AACnE,eAAO,MAAM,8BAA8B,QAAkB,CAAC;AAE9D,mFAAmF;AACnF,eAAO,MAAM,uCAAuC,QAAmB,CAAC;AAExE,oFAAoF;AACpF,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAQ1E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/dev/dashboard/api.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/dev/dashboard/api.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA4GrD,KAAK,kBAAkB,GAAG,KAAK,GAAG,MAAM,CAAC;AA2CzC,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAG9E;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,QAAQ,GAAG,IAAI,CAQ5C"}
|
|
@@ -55,6 +55,63 @@ const TEXT_EXTENSIONS = new Set([
|
|
|
55
55
|
"gitignore",
|
|
56
56
|
"dockerignore",
|
|
57
57
|
]);
|
|
58
|
+
const SENSITIVE_DASHBOARD_FILE_NAMES = new Set([
|
|
59
|
+
".envrc",
|
|
60
|
+
".netrc",
|
|
61
|
+
".npmrc",
|
|
62
|
+
".pypirc",
|
|
63
|
+
"application_default_credentials.json",
|
|
64
|
+
"credentials.json",
|
|
65
|
+
"env",
|
|
66
|
+
"id_ed25519",
|
|
67
|
+
"id_rsa",
|
|
68
|
+
"secrets.json",
|
|
69
|
+
"service-account.json",
|
|
70
|
+
]);
|
|
71
|
+
const SENSITIVE_DASHBOARD_FILE_EXTENSIONS = new Set([
|
|
72
|
+
"env",
|
|
73
|
+
"key",
|
|
74
|
+
"p12",
|
|
75
|
+
"pem",
|
|
76
|
+
"pfx",
|
|
77
|
+
]);
|
|
78
|
+
const SENSITIVE_DASHBOARD_DIRECTORY_NAMES = new Set([
|
|
79
|
+
".aws",
|
|
80
|
+
".docker",
|
|
81
|
+
".git",
|
|
82
|
+
".gnupg",
|
|
83
|
+
".kube",
|
|
84
|
+
".ssh",
|
|
85
|
+
]);
|
|
86
|
+
const SAFE_ENV_TEMPLATE_NAMES = new Set([
|
|
87
|
+
".env.example",
|
|
88
|
+
".env.sample",
|
|
89
|
+
".env.template",
|
|
90
|
+
]);
|
|
91
|
+
const UNAVAILABLE_FILE_MESSAGE = "File content is not available";
|
|
92
|
+
function isSensitiveDashboardPath(path, kind) {
|
|
93
|
+
const segments = path.replaceAll("\\", "/").split("/").filter(Boolean).map((segment) => segment.toLowerCase().replace(/[ .]+$/g, ""));
|
|
94
|
+
// A colon addresses an alternate data stream on NTFS. Treat stream paths as
|
|
95
|
+
// unavailable so a sensitive file cannot be reached through an alias such as
|
|
96
|
+
// `.env::$DATA`.
|
|
97
|
+
if (segments.some((segment) => segment.includes(":")))
|
|
98
|
+
return true;
|
|
99
|
+
if (segments.some((segment) => SENSITIVE_DASHBOARD_DIRECTORY_NAMES.has(segment)))
|
|
100
|
+
return true;
|
|
101
|
+
if (kind === "directory")
|
|
102
|
+
return false;
|
|
103
|
+
const fileName = segments.at(-1);
|
|
104
|
+
if (!fileName)
|
|
105
|
+
return false;
|
|
106
|
+
if (SAFE_ENV_TEMPLATE_NAMES.has(fileName))
|
|
107
|
+
return false;
|
|
108
|
+
if (fileName === ".env" || fileName.startsWith(".env."))
|
|
109
|
+
return true;
|
|
110
|
+
if (SENSITIVE_DASHBOARD_FILE_NAMES.has(fileName))
|
|
111
|
+
return true;
|
|
112
|
+
const extension = fileName.includes(".") ? fileName.slice(fileName.lastIndexOf(".") + 1) : "";
|
|
113
|
+
return SENSITIVE_DASHBOARD_FILE_EXTENSIONS.has(extension);
|
|
114
|
+
}
|
|
58
115
|
const GET_DASHBOARD_API_ROUTES = {
|
|
59
116
|
"/_dev/api/stats": () => handleStats(),
|
|
60
117
|
"/_dev/api/tools": () => handleListTools(),
|
|
@@ -348,15 +405,21 @@ async function handleListFiles(req, ctx) {
|
|
|
348
405
|
const canonical = await validateRelativePath(relativePath, projectDir, adapter);
|
|
349
406
|
if (canonical === null)
|
|
350
407
|
return errorResponse("Invalid path", 400);
|
|
408
|
+
if (isSensitiveDashboardPath(relativePath, "directory")) {
|
|
409
|
+
return errorResponse(UNAVAILABLE_FILE_MESSAGE, 403);
|
|
410
|
+
}
|
|
351
411
|
fullPath = canonical;
|
|
352
412
|
}
|
|
353
413
|
try {
|
|
354
414
|
const files = [];
|
|
355
415
|
for await (const entry of adapter.fs.readDir(fullPath)) {
|
|
416
|
+
const entryPath = relativePath ? `${relativePath}/${entry.name}` : entry.name;
|
|
417
|
+
if (isSensitiveDashboardPath(entryPath, entry.isDirectory ? "directory" : "file"))
|
|
418
|
+
continue;
|
|
356
419
|
files.push({
|
|
357
420
|
name: entry.name,
|
|
358
421
|
type: entry.isDirectory ? "directory" : "file",
|
|
359
|
-
path:
|
|
422
|
+
path: entryPath,
|
|
360
423
|
});
|
|
361
424
|
}
|
|
362
425
|
files.sort((a, b) => a.type !== b.type ? (a.type === "directory" ? -1 : 1) : a.name.localeCompare(b.name));
|
|
@@ -383,10 +446,14 @@ async function handleReadFileContent(req, ctx) {
|
|
|
383
446
|
const canonical = await validateRelativePath(relativePath, projectDir, adapter);
|
|
384
447
|
if (canonical === null)
|
|
385
448
|
return errorResponse("Invalid path", 400);
|
|
449
|
+
if (isSensitiveDashboardPath(relativePath, "file")) {
|
|
450
|
+
return errorResponse(UNAVAILABLE_FILE_MESSAGE, 403);
|
|
451
|
+
}
|
|
386
452
|
try {
|
|
387
453
|
const content = await adapter.fs.readFile(canonical);
|
|
388
|
-
const
|
|
389
|
-
|
|
454
|
+
const fileName = relativePath.replaceAll("\\", "/").split("/").at(-1)?.toLowerCase() ?? "";
|
|
455
|
+
const extension = fileName.split(".").pop() ?? "";
|
|
456
|
+
if (!TEXT_EXTENSIONS.has(extension) && !SAFE_ENV_TEMPLATE_NAMES.has(fileName)) {
|
|
390
457
|
return jsonResponse({
|
|
391
458
|
path: relativePath,
|
|
392
459
|
extension,
|
|
@@ -4,6 +4,7 @@ import { type LockfileManager } from "../../../../utils/import-lockfile.js";
|
|
|
4
4
|
import { type DependencyPinningSourceInput } from "../../../../transforms/esm/package-registry.js";
|
|
5
5
|
export interface RelativeFsPluginOptions {
|
|
6
6
|
enforceBrowserBoundaries?: boolean;
|
|
7
|
+
serverExternalPackages?: readonly string[];
|
|
7
8
|
/**
|
|
8
9
|
* Root-bound, symlink-safe, bounded read authority for browser builds. When
|
|
9
10
|
* supplied, the read itself replaces mutable directory-walk admission.
|
|
@@ -24,12 +25,16 @@ interface BareExternalPluginOptions {
|
|
|
24
25
|
dependencyPinningSource?: DependencyPinningSourceInput;
|
|
25
26
|
strict?: boolean;
|
|
26
27
|
importMapImports?: Record<string, string>;
|
|
28
|
+
/** Bare npm package roots explicitly declared as server-only by the project. */
|
|
29
|
+
serverExternalPackages?: readonly string[];
|
|
27
30
|
}
|
|
28
31
|
/** Create bare module external plugin that rewrites npm imports to esm.sh URLs */
|
|
29
32
|
export declare function createBareExternalPlugin(options?: BareExternalPluginOptions | boolean): Plugin;
|
|
30
33
|
interface HttpExternalPluginOptions {
|
|
31
34
|
moduleServerOrigin?: string;
|
|
32
35
|
dependencyPinningCacheKey?: string;
|
|
36
|
+
projectDir?: string;
|
|
37
|
+
serverExternalPackages?: readonly string[];
|
|
33
38
|
}
|
|
34
39
|
export declare function createHttpExternalPlugin(options?: HttpExternalPluginOptions): Plugin;
|
|
35
40
|
export {};
|