veryfront 0.1.1047 → 0.1.1049
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/auth/login.d.ts +5 -5
- package/esm/cli/auth/login.d.ts.map +1 -1
- package/esm/cli/auth/login.js +28 -28
- package/esm/cli/auth/provider-store.d.ts +5 -4
- package/esm/cli/auth/provider-store.d.ts.map +1 -1
- package/esm/cli/auth/provider-store.js +17 -13
- package/esm/cli/commands/build/command.d.ts +2 -0
- package/esm/cli/commands/build/command.d.ts.map +1 -1
- package/esm/cli/commands/build/command.js +46 -20
- package/esm/cli/commands/build/handler.d.ts +6 -0
- package/esm/cli/commands/build/handler.d.ts.map +1 -1
- package/esm/cli/commands/build/handler.js +9 -5
- package/esm/cli/commands/deploy/command-help.d.ts.map +1 -1
- package/esm/cli/commands/deploy/command-help.js +2 -1
- package/esm/cli/commands/deploy/command.d.ts +83 -14
- package/esm/cli/commands/deploy/command.d.ts.map +1 -1
- package/esm/cli/commands/deploy/command.js +317 -23
- package/esm/cli/commands/deploy/index.d.ts +2 -2
- package/esm/cli/commands/deploy/index.d.ts.map +1 -1
- package/esm/cli/commands/deploy/index.js +1 -1
- package/esm/cli/commands/dev/command.d.ts +1 -0
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +10 -1
- package/esm/cli/commands/dev/handler.d.ts +2 -0
- package/esm/cli/commands/dev/handler.d.ts.map +1 -1
- package/esm/cli/commands/dev/handler.js +6 -1
- package/esm/cli/commands/doctor/command-help.d.ts.map +1 -1
- package/esm/cli/commands/doctor/command-help.js +5 -1
- package/esm/cli/commands/doctor/handler.d.ts +1 -0
- package/esm/cli/commands/doctor/handler.d.ts.map +1 -1
- package/esm/cli/commands/doctor/handler.js +2 -0
- package/esm/cli/commands/doctor/index.d.ts +7 -0
- package/esm/cli/commands/doctor/index.d.ts.map +1 -1
- package/esm/cli/commands/doctor/index.js +67 -15
- package/esm/cli/commands/doctor/server-checks.d.ts +2 -2
- package/esm/cli/commands/doctor/server-checks.d.ts.map +1 -1
- package/esm/cli/commands/doctor/server-checks.js +5 -4
- package/esm/cli/commands/init/init-command.js +4 -4
- package/esm/cli/commands/init/types.d.ts +2 -0
- package/esm/cli/commands/init/types.d.ts.map +1 -1
- package/esm/cli/commands/push/command.d.ts +10 -1
- package/esm/cli/commands/push/command.d.ts.map +1 -1
- package/esm/cli/commands/push/command.js +135 -14
- package/esm/cli/commands/skills/create.d.ts +1 -1
- package/esm/cli/commands/skills/create.d.ts.map +1 -1
- package/esm/cli/commands/skills/create.js +1 -2
- package/esm/cli/mcp/server.d.ts.map +1 -1
- package/esm/cli/mcp/server.js +33 -7
- package/esm/cli/mcp/tools/catalog-tools.d.ts +6 -1
- package/esm/cli/mcp/tools/catalog-tools.d.ts.map +1 -1
- package/esm/cli/mcp/tools/catalog-tools.js +9 -5
- package/esm/cli/mcp/tools/deploy-tool.d.ts +11 -1
- package/esm/cli/mcp/tools/deploy-tool.d.ts.map +1 -1
- package/esm/cli/mcp/tools/deploy-tool.js +55 -10
- package/esm/cli/shared/args.d.ts.map +1 -1
- package/esm/cli/shared/args.js +29 -2
- package/esm/cli/shared/config.d.ts +24 -0
- package/esm/cli/shared/config.d.ts.map +1 -1
- package/esm/cli/shared/config.js +62 -16
- package/esm/cli/shared/deployment-provenance.d.ts +47 -0
- package/esm/cli/shared/deployment-provenance.d.ts.map +1 -0
- package/esm/cli/shared/deployment-provenance.js +214 -0
- package/esm/cli/shared/json-output.d.ts.map +1 -1
- package/esm/cli/shared/json-output.js +16 -0
- package/esm/cli/shared/reserve-slug.d.ts +8 -1
- package/esm/cli/shared/reserve-slug.d.ts.map +1 -1
- package/esm/cli/shared/reserve-slug.js +15 -4
- package/esm/cli/skills/core-skills.d.ts.map +1 -1
- package/esm/cli/skills/core-skills.js +6 -3
- package/esm/cli/templates/manifest.js +3 -3
- package/esm/cli/utils/index.d.ts.map +1 -1
- package/esm/cli/utils/index.js +3 -0
- package/esm/deno.d.ts +3 -0
- package/esm/deno.js +11 -7
- package/esm/src/agent/react/use-agent-metadata.js +1 -1
- package/esm/src/agent/react/use-agent.js +1 -1
- package/esm/src/agent/react/use-agents.js +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +0 -6
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts +5 -0
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +87 -34
- package/esm/src/agent/react/use-completion.js +1 -1
- package/esm/src/agent/react/use-streaming.js +1 -1
- package/esm/src/agent/react/use-voice-input.js +1 -1
- package/esm/src/build/bundler/code-splitter/splitter.d.ts +3 -0
- package/esm/src/build/bundler/code-splitter/splitter.d.ts.map +1 -1
- package/esm/src/build/bundler/code-splitter/splitter.js +21 -2
- package/esm/src/build/embedded/preset.d.ts +3 -2
- package/esm/src/build/embedded/preset.d.ts.map +1 -1
- package/esm/src/build/embedded/preset.js +120 -97
- package/esm/src/build/production-build/build/build-cleanup.d.ts.map +1 -1
- package/esm/src/build/production-build/build/build-cleanup.js +6 -1
- package/esm/src/build/production-build/build/build-orchestrator.d.ts.map +1 -1
- package/esm/src/build/production-build/build/build-orchestrator.js +55 -49
- package/esm/src/build/production-build/build/output-generator.d.ts +2 -0
- package/esm/src/build/production-build/build/output-generator.d.ts.map +1 -1
- package/esm/src/build/production-build/build/output-generator.js +2 -1
- package/esm/src/build/production-build/build/route-collector.d.ts +2 -1
- package/esm/src/build/production-build/build/route-collector.d.ts.map +1 -1
- package/esm/src/build/production-build/build/route-collector.js +3 -3
- package/esm/src/build/production-build/client-runtime.d.ts +4 -0
- package/esm/src/build/production-build/client-runtime.d.ts.map +1 -1
- package/esm/src/build/production-build/client-runtime.js +5 -8
- package/esm/src/build/production-build/local-release-assets.d.ts +2 -0
- package/esm/src/build/production-build/local-release-assets.d.ts.map +1 -1
- package/esm/src/build/production-build/local-release-assets.js +4 -1
- package/esm/src/build/production-build/manifest.d.ts.map +1 -1
- package/esm/src/build/production-build/manifest.js +9 -2
- package/esm/src/build/production-build/static-generation.d.ts.map +1 -1
- package/esm/src/build/production-build/static-generation.js +15 -3
- 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/backends/api.d.ts.map +1 -1
- package/esm/src/cache/backends/api.js +10 -7
- package/esm/src/chat/index.d.ts +8 -15
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +7 -16
- package/esm/src/config/config-files.d.ts +3 -0
- package/esm/src/config/config-files.d.ts.map +1 -0
- package/esm/src/config/config-files.js +6 -0
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +12 -9
- package/esm/src/extensions/parser/code-parser.d.ts +14 -0
- package/esm/src/extensions/parser/code-parser.d.ts.map +1 -1
- package/esm/src/extensions/parser/index.d.ts +1 -1
- package/esm/src/extensions/parser/index.d.ts.map +1 -1
- package/esm/src/html/html-injection.d.ts.map +1 -1
- package/esm/src/html/html-injection.js +2 -2
- package/esm/src/html/html-shell-generator.d.ts.map +1 -1
- package/esm/src/html/html-shell-generator.js +16 -9
- package/esm/src/html/hydration-script-builder/dev-component-manifest.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/dev-component-manifest.js +2 -1
- package/esm/src/html/hydration-script-builder/hydration-data-generator.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/hydration-data-generator.js +15 -4
- package/esm/src/html/hydration-script-builder/prod-hydration.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/prod-hydration.js +4 -2
- package/esm/src/html/hydration-script-builder/templates/renderer.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/renderer.js +37 -7
- package/esm/src/html/hydration-script-builder/templates/router.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/router.js +22 -4
- package/esm/src/html/hydration-script-builder/types.d.ts +4 -0
- package/esm/src/html/hydration-script-builder/types.d.ts.map +1 -1
- package/esm/src/html/schemas/html.schema.d.ts +10 -0
- package/esm/src/html/schemas/html.schema.d.ts.map +1 -1
- package/esm/src/html/schemas/html.schema.js +5 -0
- package/esm/src/html/utils.d.ts.map +1 -1
- package/esm/src/html/utils.js +10 -10
- package/esm/src/modules/component-registry/registry.d.ts +1 -1
- package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
- package/esm/src/modules/react-loader/component-loader.d.ts +1 -1
- package/esm/src/modules/react-loader/component-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/extract-component.d.ts +1 -1
- package/esm/src/modules/react-loader/extract-component.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.js +2 -3
- 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/types.d.ts +1 -1
- package/esm/src/modules/react-loader/types.d.ts.map +1 -1
- package/esm/src/modules/server/module-batch-handler.d.ts.map +1 -1
- package/esm/src/modules/server/module-batch-handler.js +3 -10
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts +1 -0
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.js +4 -0
- package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.d.ts +4 -1
- package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.js +6 -0
- package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts +1 -0
- package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations.js +8 -0
- package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts +4 -0
- package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/request-context.js +1 -0
- package/esm/src/platform/adapters/mock.d.ts.map +1 -1
- package/esm/src/platform/adapters/mock.js +3 -2
- package/esm/src/platform/adapters/veryfront-api-client/client.d.ts +4 -1
- package/esm/src/platform/adapters/veryfront-api-client/client.d.ts.map +1 -1
- package/esm/src/platform/adapters/veryfront-api-client/client.js +8 -4
- package/esm/src/platform/adapters/veryfront-api-client/operations.d.ts +7 -3
- package/esm/src/platform/adapters/veryfront-api-client/operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/veryfront-api-client/operations.js +6 -6
- package/esm/src/platform/adapters/veryfront-api-client/retry-handler.d.ts +2 -0
- package/esm/src/platform/adapters/veryfront-api-client/retry-handler.d.ts.map +1 -1
- package/esm/src/platform/adapters/veryfront-api-client/retry-handler.js +4 -1
- package/esm/src/platform/compat/framework-source-resolver.d.ts +7 -1
- package/esm/src/platform/compat/framework-source-resolver.d.ts.map +1 -1
- package/esm/src/platform/compat/framework-source-resolver.js +32 -13
- package/esm/src/platform/compat/fs.d.ts +4 -0
- package/esm/src/platform/compat/fs.d.ts.map +1 -1
- package/esm/src/platform/compat/fs.js +34 -2
- package/esm/src/platform/compat/http/request-adapter.js +18 -1
- package/esm/src/platform/compat/path/runtime.d.ts.map +1 -1
- package/esm/src/platform/compat/path/runtime.js +1 -1
- package/esm/src/platform/compat/process/command.d.ts +2 -0
- package/esm/src/platform/compat/process/command.d.ts.map +1 -1
- package/esm/src/platform/compat/process/command.js +4 -3
- package/esm/src/platform/compat/runtime.d.ts +1 -1
- package/esm/src/platform/compat/runtime.d.ts.map +1 -1
- package/esm/src/platform/compat/runtime.js +5 -2
- package/esm/src/platform/index.d.ts +1 -1
- package/esm/src/platform/index.d.ts.map +1 -1
- package/esm/src/platform/index.js +1 -1
- package/esm/src/proxy/local-project-resolver.d.ts.map +1 -1
- package/esm/src/proxy/local-project-resolver.js +4 -2
- package/esm/src/proxy/main.js +17 -15
- package/esm/src/proxy/retry.d.ts +18 -0
- package/esm/src/proxy/retry.d.ts.map +1 -1
- package/esm/src/proxy/retry.js +89 -0
- package/esm/src/proxy/websocket-bridge.d.ts +10 -0
- package/esm/src/proxy/websocket-bridge.d.ts.map +1 -1
- package/esm/src/proxy/websocket-bridge.js +4 -0
- package/esm/src/react/compat/hooks-adapter.d.ts +1 -1
- package/esm/src/react/compat/hooks-adapter.d.ts.map +1 -1
- package/esm/src/react/compat/hooks-adapter.js +1 -1
- package/esm/src/react/compat/ssr-adapter/response-builder.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/response-builder.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/response-builder.js +1 -1
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts +10 -7
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/server-loader.js +49 -32
- package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/stream-renderer.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/stream-renderer.js +5 -5
- package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/string-renderer.js +2 -2
- package/esm/src/react/compat/ssr-adapter/types.d.ts +2 -0
- package/esm/src/react/compat/ssr-adapter/types.d.ts.map +1 -1
- package/esm/src/react/compat/version-detector/feature-detector.js +1 -1
- package/esm/src/react/components/AppWrapper.d.ts +1 -1
- package/esm/src/react/components/AppWrapper.d.ts.map +1 -1
- package/esm/src/react/components/AppWrapper.js +1 -1
- package/esm/src/react/components/LayoutComponent.d.ts +1 -1
- package/esm/src/react/components/LayoutComponent.d.ts.map +1 -1
- package/esm/src/react/components/LayoutComponent.js +1 -1
- package/esm/src/react/components/MDXProvider.d.ts +1 -1
- package/esm/src/react/components/MDXProvider.d.ts.map +1 -1
- package/esm/src/react/components/MDXProvider.js +1 -1
- package/esm/src/react/components/ProviderComponent.d.ts +1 -1
- package/esm/src/react/components/ProviderComponent.d.ts.map +1 -1
- package/esm/src/react/components/ProviderComponent.js +1 -1
- package/esm/src/react/components/chat/agent-card.d.ts +15 -7
- package/esm/src/react/components/chat/agent-card.d.ts.map +1 -1
- package/esm/src/react/components/chat/agent-card.js +9 -10
- package/esm/src/react/components/chat/agent-picker-actions.d.ts +20 -0
- package/esm/src/react/components/chat/agent-picker-actions.d.ts.map +1 -0
- package/esm/src/react/components/chat/agent-picker-actions.js +24 -0
- package/esm/src/react/components/chat/agent-picker-context.d.ts +19 -0
- package/esm/src/react/components/chat/agent-picker-context.d.ts.map +1 -0
- package/esm/src/react/components/chat/agent-picker-context.js +13 -0
- package/esm/src/react/components/chat/agent-picker.d.ts +35 -42
- package/esm/src/react/components/chat/agent-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/agent-picker.js +59 -50
- package/esm/src/react/components/chat/chat/app-mode-chat.d.ts +14 -0
- package/esm/src/react/components/chat/chat/app-mode-chat.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/app-mode-chat.js +137 -0
- package/esm/src/react/components/chat/chat/chat-attachments.d.ts +7 -0
- package/esm/src/react/components/chat/chat/chat-attachments.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/chat-attachments.js +16 -0
- package/esm/src/react/components/chat/chat/chat-component.d.ts +21 -0
- package/esm/src/react/components/chat/chat/chat-component.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/chat-component.js +1 -0
- package/esm/src/react/components/chat/chat/chat-props.d.ts +114 -0
- package/esm/src/react/components/chat/chat/chat-props.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/chat-props.js +1 -0
- package/esm/src/react/components/chat/chat/components/animations.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/animations.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/animations.js +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts +18 -18
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.js +11 -15
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +14 -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 +3 -3
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts +44 -14
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/branch-picker.js +55 -12
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.js +1 -1
- package/esm/src/react/components/chat/chat/components/code-block.d.ts +7 -2
- package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/code-block.js +3 -3
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/drop-zone.js +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.js +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.js +1 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts +33 -10
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.js +145 -51
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts +49 -20
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-actions.js +72 -18
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-edit-form.js +1 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts +34 -14
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.js +54 -15
- package/esm/src/react/components/chat/chat/components/quick-actions.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/quick-actions.js +1 -1
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts +14 -6
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/reasoning.js +3 -5
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts +70 -16
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sidebar.js +72 -23
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.js +1 -1
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/skill-tool.js +1 -1
- package/esm/src/react/components/chat/chat/components/sources.d.ts +25 -15
- package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sources.js +7 -7
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts +14 -3
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/step-indicator.js +3 -3
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.js +1 -1
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts +16 -9
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tool-ui.js +10 -14
- package/esm/src/react/components/chat/chat/composition/agent-avatar.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/agent-avatar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/agent-avatar.js +1 -1
- package/esm/src/react/components/chat/chat/composition/api.d.ts +3 -3
- package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/api.js +2 -2
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +72 -29
- 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 +92 -82
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.js +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts +7 -2
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.js +3 -3
- package/esm/src/react/components/chat/chat/composition/chat-if.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-if.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +25 -11
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.js +67 -29
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +7 -3
- 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 +3 -5
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts +7 -2
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.js +3 -3
- package/esm/src/react/components/chat/chat/composition/message.d.ts +85 -34
- package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/message.js +146 -122
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.js +1 -1
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts +1 -1
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/pending-message.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +2 -3
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/chat-context.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts +2 -2
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/composer-context.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +2 -2
- 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 +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.d.ts +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts +15 -2
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/message-context.js +11 -1
- package/esm/src/react/components/chat/chat/controlled-chat.d.ts +15 -0
- package/esm/src/react/components/chat/chat/controlled-chat.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/controlled-chat.js +97 -0
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.js +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-conversation-chat.d.ts +54 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation-chat.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation-chat.js +179 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.js +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-conversations.js +3 -6
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts +8 -5
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.js +6 -6
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.js +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-upload.js +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.js +1 -1
- package/esm/src/react/components/chat/chat/index.d.ts +13 -230
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/index.js +27 -383
- package/esm/src/react/components/chat/chat-actions.d.ts +1 -1
- package/esm/src/react/components/chat/chat-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat-actions.js +1 -1
- package/esm/src/react/components/chat/chat-agent-picker.d.ts +1 -1
- package/esm/src/react/components/chat/chat-agent-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat-agent-picker.js +1 -1
- package/esm/src/react/components/chat/chat-theme-scope.d.ts +1 -1
- package/esm/src/react/components/chat/chat-theme-scope.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat-theme-scope.js +1 -1
- package/esm/src/react/components/chat/chat.d.ts +6 -6
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.js +4 -4
- package/esm/src/react/components/chat/error-boundary.d.ts +1 -1
- package/esm/src/react/components/chat/error-boundary.d.ts.map +1 -1
- package/esm/src/react/components/chat/error-boundary.js +1 -1
- package/esm/src/react/components/chat/markdown.d.ts +3 -4
- package/esm/src/react/components/chat/markdown.d.ts.map +1 -1
- package/esm/src/react/components/chat/markdown.js +8 -74
- package/esm/src/react/components/chat/model-selector.d.ts +21 -27
- package/esm/src/react/components/chat/model-selector.d.ts.map +1 -1
- package/esm/src/react/components/chat/model-selector.js +26 -31
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.js +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.js +1 -1
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts +1 -1
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/utils.d.ts +1 -1
- package/esm/src/react/components/optimized-image/utils.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/utils.js +1 -1
- package/esm/src/react/components/ui/alert.d.ts +1 -1
- package/esm/src/react/components/ui/alert.d.ts.map +1 -1
- package/esm/src/react/components/ui/alert.js +1 -1
- package/esm/src/react/components/ui/app-shell.d.ts +1 -1
- package/esm/src/react/components/ui/app-shell.d.ts.map +1 -1
- package/esm/src/react/components/ui/app-shell.js +1 -1
- package/esm/src/react/components/ui/avatar.d.ts +1 -1
- package/esm/src/react/components/ui/avatar.d.ts.map +1 -1
- package/esm/src/react/components/ui/avatar.js +1 -1
- package/esm/src/react/components/ui/badge.d.ts +1 -1
- package/esm/src/react/components/ui/badge.d.ts.map +1 -1
- package/esm/src/react/components/ui/badge.js +1 -1
- package/esm/src/react/components/ui/button.d.ts +1 -1
- package/esm/src/react/components/ui/button.d.ts.map +1 -1
- package/esm/src/react/components/ui/button.js +1 -1
- package/esm/src/react/components/ui/card.d.ts +1 -1
- package/esm/src/react/components/ui/card.d.ts.map +1 -1
- package/esm/src/react/components/ui/card.js +1 -1
- package/esm/src/react/components/ui/checkbox.d.ts +1 -1
- package/esm/src/react/components/ui/checkbox.d.ts.map +1 -1
- package/esm/src/react/components/ui/checkbox.js +1 -1
- package/esm/src/react/components/ui/code-block.d.ts +1 -1
- package/esm/src/react/components/ui/code-block.d.ts.map +1 -1
- package/esm/src/react/components/ui/code-block.js +1 -1
- package/esm/src/react/components/ui/collapsible.d.ts +1 -1
- package/esm/src/react/components/ui/collapsible.d.ts.map +1 -1
- package/esm/src/react/components/ui/collapsible.js +1 -1
- package/esm/src/react/components/ui/color-mode.d.ts +2 -2
- package/esm/src/react/components/ui/color-mode.d.ts.map +1 -1
- package/esm/src/react/components/ui/color-mode.js +1 -1
- package/esm/src/react/components/ui/command.d.ts +1 -1
- package/esm/src/react/components/ui/command.d.ts.map +1 -1
- package/esm/src/react/components/ui/command.js +1 -1
- package/esm/src/react/components/ui/dialog.d.ts +1 -1
- package/esm/src/react/components/ui/dialog.d.ts.map +1 -1
- package/esm/src/react/components/ui/dialog.js +1 -1
- package/esm/src/react/components/ui/drawer.d.ts +1 -1
- package/esm/src/react/components/ui/drawer.d.ts.map +1 -1
- package/esm/src/react/components/ui/drawer.js +1 -1
- package/esm/src/react/components/ui/dropdown-menu.d.ts +1 -1
- package/esm/src/react/components/ui/dropdown-menu.d.ts.map +1 -1
- package/esm/src/react/components/ui/dropdown-menu.js +1 -1
- package/esm/src/react/components/ui/file-type.d.ts +1 -1
- package/esm/src/react/components/ui/file-type.d.ts.map +1 -1
- package/esm/src/react/components/ui/file-type.js +1 -1
- package/esm/src/react/components/ui/floating.d.ts +1 -1
- package/esm/src/react/components/ui/floating.d.ts.map +1 -1
- package/esm/src/react/components/ui/floating.js +2 -2
- package/esm/src/react/components/ui/icon-button.d.ts +1 -1
- package/esm/src/react/components/ui/icon-button.d.ts.map +1 -1
- package/esm/src/react/components/ui/icon-button.js +1 -1
- package/esm/src/react/components/ui/icons/index.d.ts +1 -1
- package/esm/src/react/components/ui/icons/index.d.ts.map +1 -1
- package/esm/src/react/components/ui/icons/index.js +1 -1
- package/esm/src/react/components/ui/input.d.ts +1 -1
- package/esm/src/react/components/ui/input.d.ts.map +1 -1
- package/esm/src/react/components/ui/input.js +1 -1
- package/esm/src/react/components/ui/label.d.ts +1 -1
- package/esm/src/react/components/ui/label.d.ts.map +1 -1
- package/esm/src/react/components/ui/label.js +1 -1
- package/esm/src/react/components/ui/list.d.ts +1 -1
- package/esm/src/react/components/ui/list.d.ts.map +1 -1
- package/esm/src/react/components/ui/list.js +1 -1
- package/esm/src/react/components/ui/pill.d.ts +1 -1
- package/esm/src/react/components/ui/pill.d.ts.map +1 -1
- package/esm/src/react/components/ui/pill.js +1 -1
- package/esm/src/react/components/ui/popover.d.ts +1 -1
- package/esm/src/react/components/ui/popover.d.ts.map +1 -1
- package/esm/src/react/components/ui/popover.js +1 -1
- package/esm/src/react/components/ui/progress-bar.d.ts +1 -1
- package/esm/src/react/components/ui/progress-bar.d.ts.map +1 -1
- package/esm/src/react/components/ui/progress-bar.js +1 -1
- package/esm/src/react/components/ui/radio.d.ts +1 -1
- package/esm/src/react/components/ui/radio.d.ts.map +1 -1
- package/esm/src/react/components/ui/radio.js +1 -1
- package/esm/src/react/components/ui/scroll-fade.d.ts +1 -1
- package/esm/src/react/components/ui/scroll-fade.d.ts.map +1 -1
- package/esm/src/react/components/ui/scroll-fade.js +1 -1
- package/esm/src/react/components/ui/select.d.ts +1 -1
- package/esm/src/react/components/ui/select.d.ts.map +1 -1
- package/esm/src/react/components/ui/select.js +1 -1
- package/esm/src/react/components/ui/shimmer.d.ts +1 -1
- package/esm/src/react/components/ui/shimmer.d.ts.map +1 -1
- package/esm/src/react/components/ui/shimmer.js +1 -1
- package/esm/src/react/components/ui/skeleton.d.ts +1 -1
- package/esm/src/react/components/ui/skeleton.d.ts.map +1 -1
- package/esm/src/react/components/ui/skeleton.js +1 -1
- package/esm/src/react/components/ui/slot.d.ts +1 -1
- package/esm/src/react/components/ui/slot.d.ts.map +1 -1
- package/esm/src/react/components/ui/slot.js +1 -1
- package/esm/src/react/components/ui/status.d.ts +1 -1
- package/esm/src/react/components/ui/status.d.ts.map +1 -1
- package/esm/src/react/components/ui/status.js +1 -1
- package/esm/src/react/components/ui/switch.d.ts +1 -1
- package/esm/src/react/components/ui/switch.d.ts.map +1 -1
- package/esm/src/react/components/ui/switch.js +1 -1
- package/esm/src/react/components/ui/tabs.d.ts +3 -3
- package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
- package/esm/src/react/components/ui/tabs.js +1 -1
- package/esm/src/react/components/ui/tag.d.ts +1 -1
- package/esm/src/react/components/ui/tag.d.ts.map +1 -1
- package/esm/src/react/components/ui/tag.js +1 -1
- package/esm/src/react/components/ui/textarea.d.ts +1 -1
- package/esm/src/react/components/ui/textarea.d.ts.map +1 -1
- package/esm/src/react/components/ui/textarea.js +1 -1
- package/esm/src/react/components/ui/tokens.d.ts +1 -1
- package/esm/src/react/components/ui/tokens.d.ts.map +1 -1
- package/esm/src/react/components/ui/tokens.js +1 -1
- package/esm/src/react/components/ui/tooltip.d.ts +1 -1
- package/esm/src/react/components/ui/tooltip.d.ts.map +1 -1
- package/esm/src/react/components/ui/tooltip.js +2 -2
- package/esm/src/react/fonts/index.d.ts +1 -1
- package/esm/src/react/fonts/index.d.ts.map +1 -1
- package/esm/src/react/fonts/index.js +1 -1
- package/esm/src/react/primitives/agent-primitives.d.ts +4 -4
- package/esm/src/react/primitives/agent-primitives.d.ts.map +1 -1
- package/esm/src/react/primitives/agent-primitives.js +1 -1
- package/esm/src/react/primitives/chat-container.d.ts +2 -2
- package/esm/src/react/primitives/chat-container.d.ts.map +1 -1
- package/esm/src/react/primitives/chat-container.js +1 -1
- package/esm/src/react/primitives/input-box.d.ts +4 -4
- package/esm/src/react/primitives/input-box.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.js +1 -1
- package/esm/src/react/primitives/message-list.d.ts +5 -5
- package/esm/src/react/primitives/message-list.d.ts.map +1 -1
- package/esm/src/react/primitives/message-list.js +1 -1
- package/esm/src/react/primitives/tool-primitives.d.ts +4 -4
- package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
- package/esm/src/react/primitives/tool-primitives.js +1 -1
- package/esm/src/react/runtime/core.d.ts +1 -1
- package/esm/src/react/runtime/core.d.ts.map +1 -1
- package/esm/src/react/runtime/core.js +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 +3 -2
- package/esm/src/rendering/component-handling.d.ts +1 -1
- package/esm/src/rendering/component-handling.d.ts.map +1 -1
- package/esm/src/rendering/component-handling.js +1 -1
- package/esm/src/rendering/context/render-context.d.ts +2 -0
- package/esm/src/rendering/context/render-context.d.ts.map +1 -1
- package/esm/src/rendering/context/render-context.js +2 -0
- package/esm/src/rendering/element-validator/element-normalizer.d.ts +1 -1
- package/esm/src/rendering/element-validator/element-normalizer.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/element-normalizer.js +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.d.ts +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.js +1 -1
- package/esm/src/rendering/element-validator/validator-core.d.ts +1 -1
- package/esm/src/rendering/element-validator/validator-core.d.ts.map +1 -1
- package/esm/src/rendering/factories/service-factories.js +1 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts +8 -2
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.js +39 -11
- 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 +7 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts +3 -3
- package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/applicator.js +7 -7
- package/esm/src/rendering/layouts/utils/component-loader.d.ts +7 -7
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.js +21 -14
- package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/ensure-valid-child.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html-types.d.ts +2 -0
- package/esm/src/rendering/orchestrator/html-types.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html.js +16 -5
- package/esm/src/rendering/orchestrator/layout.d.ts +6 -2
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/layout.js +16 -4
- package/esm/src/rendering/orchestrator/lifecycle.js +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +2 -2
- package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts +1 -1
- 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 +9 -2
- 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 +9 -2
- package/esm/src/rendering/orchestrator/pipeline-helpers.d.ts +1 -1
- package/esm/src/rendering/orchestrator/pipeline-helpers.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline-helpers.js +3 -2
- package/esm/src/rendering/orchestrator/pipeline.d.ts +21 -0
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +88 -22
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts +1 -1
- package/esm/src/rendering/orchestrator/ssr-orchestrator.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/ssr.d.ts +1 -0
- package/esm/src/rendering/orchestrator/ssr.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/ssr.js +8 -0
- package/esm/src/rendering/orchestrator/types.d.ts +13 -0
- package/esm/src/rendering/orchestrator/types.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.d.ts +3 -1
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-renderer.js +13 -1
- package/esm/src/rendering/page-rendering.d.ts +3 -1
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.js +2 -2
- package/esm/src/rendering/page-resolution/page-resolver.d.ts.map +1 -1
- package/esm/src/rendering/page-resolution/page-resolver.js +4 -3
- package/esm/src/rendering/renderer.d.ts.map +1 -1
- package/esm/src/rendering/renderer.js +6 -0
- package/esm/src/rendering/rsc/client-boot.ts +5 -1
- package/esm/src/rendering/rsc/client-boundary-payload.d.ts +10 -0
- package/esm/src/rendering/rsc/client-boundary-payload.d.ts.map +1 -0
- package/esm/src/rendering/rsc/client-boundary-payload.js +71 -0
- package/esm/src/rendering/rsc/client-module-strategy.d.ts +5 -1
- package/esm/src/rendering/rsc/client-module-strategy.d.ts.map +1 -1
- package/esm/src/rendering/rsc/client-module-strategy.js +9 -3
- package/esm/src/rendering/rsc/component-analyzer.d.ts.map +1 -1
- package/esm/src/rendering/rsc/component-analyzer.js +18 -7
- package/esm/src/rendering/rsc/hydrate-client.ts +133 -26
- package/esm/src/rendering/rsc/page-island.d.ts +32 -0
- package/esm/src/rendering/rsc/page-island.d.ts.map +1 -0
- package/esm/src/rendering/rsc/page-island.js +191 -0
- package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/html-generator.d.ts +2 -2
- package/esm/src/rendering/rsc/server-renderer/html-generator.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/html-generator.js +34 -6
- package/esm/src/rendering/rsc/server-renderer/prop-serializer.d.ts +1 -0
- package/esm/src/rendering/rsc/server-renderer/prop-serializer.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/prop-serializer.js +17 -0
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts +4 -2
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.js +41 -6
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts +4 -4
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.js +65 -14
- package/esm/src/rendering/rsc/types.d.ts +1 -1
- package/esm/src/rendering/rsc/types.d.ts.map +1 -1
- package/esm/src/rendering/snippet-renderer.js +2 -2
- 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 +1 -1
- package/esm/src/rendering/ssr/mdx-renderer.d.ts +1 -1
- package/esm/src/rendering/ssr/mdx-renderer.d.ts.map +1 -1
- package/esm/src/rendering/ssr/mdx-renderer.js +1 -1
- package/esm/src/rendering/ssr/types.d.ts +1 -1
- package/esm/src/rendering/ssr/types.d.ts.map +1 -1
- package/esm/src/rendering/ssr-renderer.d.ts +7 -6
- package/esm/src/rendering/ssr-renderer.d.ts.map +1 -1
- package/esm/src/rendering/ssr-renderer.js +37 -30
- package/esm/src/rendering/utils/react-helpers.d.ts +1 -1
- package/esm/src/rendering/utils/react-helpers.d.ts.map +1 -1
- package/esm/src/rendering/utils/react-helpers.js +1 -1
- package/esm/src/routing/api/api-route-matcher.d.ts.map +1 -1
- package/esm/src/routing/api/api-route-matcher.js +6 -33
- package/esm/src/routing/api/module-loader/esbuild-plugin.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/esbuild-plugin.js +5 -1
- package/esm/src/routing/client/navigation-handlers.d.ts.map +1 -1
- package/esm/src/routing/client/navigation-handlers.js +2 -1
- package/esm/src/routing/client/page-loader.d.ts.map +1 -1
- package/esm/src/routing/client/page-loader.js +8 -3
- package/esm/src/routing/matchers/route-parser.d.ts.map +1 -1
- package/esm/src/routing/matchers/route-parser.js +27 -13
- package/esm/src/security/client/html-sanitizer.d.ts +1 -0
- package/esm/src/security/client/html-sanitizer.d.ts.map +1 -1
- package/esm/src/security/client/html-sanitizer.js +5 -2
- package/esm/src/security/http/base-handler.d.ts +2 -0
- package/esm/src/security/http/base-handler.d.ts.map +1 -1
- package/esm/src/security/http/base-handler.js +1 -0
- package/esm/src/security/http/config.d.ts.map +1 -1
- package/esm/src/security/http/config.js +12 -13
- package/esm/src/server/build-app-route-renderer.d.ts +2 -0
- package/esm/src/server/build-app-route-renderer.d.ts.map +1 -1
- package/esm/src/server/build-app-route-renderer.js +99 -39
- package/esm/src/server/build-routes.d.ts +2 -2
- package/esm/src/server/build-routes.d.ts.map +1 -1
- package/esm/src/server/build-routes.js +45 -54
- package/esm/src/server/dev-server/request-handler.d.ts.map +1 -1
- package/esm/src/server/dev-server/request-handler.js +2 -0
- package/esm/src/server/dev-server/route-discovery.d.ts.map +1 -1
- package/esm/src/server/dev-server/route-discovery.js +16 -11
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts +6 -1
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/esbuild-plugins.js +138 -16
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +845 -599
- package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/agent-stream.handler.js +4 -1
- package/esm/src/server/handlers/request/api/app-router-resolver.js +1 -1
- 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 +17 -2
- package/esm/src/server/handlers/request/rsc/index.d.ts.map +1 -1
- package/esm/src/server/handlers/request/rsc/index.js +9 -0
- package/esm/src/server/handlers/request/ssr/error-page-fallback.d.ts.map +1 -1
- package/esm/src/server/handlers/request/ssr/error-page-fallback.js +23 -15
- package/esm/src/server/handlers/request/ssr/not-found-fallback.d.ts.map +1 -1
- package/esm/src/server/handlers/request/ssr/not-found-fallback.js +10 -5
- package/esm/src/server/runtime-handler/local-project-discovery.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/local-project-discovery.js +13 -2
- package/esm/src/server/services/rsc/endpoints/action-handler.d.ts +11 -1
- package/esm/src/server/services/rsc/endpoints/action-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/action-handler.js +83 -16
- package/esm/src/server/services/rsc/endpoints/endpoint-router.d.ts +9 -1
- package/esm/src/server/services/rsc/endpoints/endpoint-router.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/endpoint-router.js +244 -73
- package/esm/src/server/services/rsc/endpoints/handler-registry.d.ts +4 -1
- package/esm/src/server/services/rsc/endpoints/handler-registry.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/handler-registry.js +33 -3
- 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 +1 -1
- package/esm/src/server/services/rsc/endpoints/script-handlers.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/script-handlers.js +5 -11
- package/esm/src/server/services/rsc/endpoints/types.d.ts +9 -0
- package/esm/src/server/services/rsc/endpoints/types.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/component-resolver.d.ts +1 -1
- package/esm/src/server/services/rsc/orchestrators/component-resolver.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/component-resolver.js +9 -25
- package/esm/src/server/services/rsc/orchestrators/handler.d.ts +25 -3
- package/esm/src/server/services/rsc/orchestrators/handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/handler.js +74 -9
- package/esm/src/server/services/rsc/orchestrators/manifest-handler.d.ts +16 -0
- package/esm/src/server/services/rsc/orchestrators/manifest-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/manifest-handler.js +124 -14
- package/esm/src/server/services/rsc/orchestrators/page-handler.d.ts +5 -0
- package/esm/src/server/services/rsc/orchestrators/page-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/page-handler.js +16 -2
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts +14 -2
- package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/render-handler.js +42 -7
- package/esm/src/server/services/rsc/orchestrators/types.d.ts +19 -0
- package/esm/src/server/services/rsc/orchestrators/types.d.ts.map +1 -1
- package/esm/src/server/shared/browser-module-availability.d.ts +38 -0
- package/esm/src/server/shared/browser-module-availability.d.ts.map +1 -0
- package/esm/src/server/shared/browser-module-availability.js +140 -0
- package/esm/src/server/shared/browser-module-boundary.d.ts +18 -0
- package/esm/src/server/shared/browser-module-boundary.d.ts.map +1 -0
- package/esm/src/server/shared/browser-module-boundary.js +43 -0
- package/esm/src/server/shared/browser-module-bundler.d.ts +19 -0
- package/esm/src/server/shared/browser-module-bundler.d.ts.map +1 -1
- package/esm/src/server/shared/browser-module-bundler.js +123 -8
- package/esm/src/server/utils/domain-lookup.d.ts.map +1 -1
- package/esm/src/testing/bdd.d.ts.map +1 -1
- package/esm/src/testing/bdd.js +43 -10
- package/esm/src/transforms/esm/bundle-deps-validator.js +3 -3
- package/esm/src/transforms/esm/bundle-recovery.d.ts +3 -3
- package/esm/src/transforms/esm/bundle-recovery.d.ts.map +1 -1
- package/esm/src/transforms/esm/bundle-recovery.js +68 -29
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +40 -0
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +143 -0
- package/esm/src/transforms/esm/http-cache-invariants.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-invariants.js +4 -3
- package/esm/src/transforms/esm/http-cache-wrapper.d.ts +4 -1
- package/esm/src/transforms/esm/http-cache-wrapper.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-wrapper.js +111 -3
- package/esm/src/transforms/esm/http-cache.d.ts +4 -4
- package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache.js +24 -19
- package/esm/src/transforms/esm/in-flight-manager.d.ts +3 -3
- package/esm/src/transforms/esm/in-flight-manager.d.ts.map +1 -1
- package/esm/src/transforms/esm/in-flight-manager.js +2 -2
- package/esm/src/transforms/esm/package-registry.d.ts +4 -3
- package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
- package/esm/src/transforms/esm/package-registry.js +12 -6
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +7 -2
- package/esm/src/transforms/mdx/esm-module-loader/components/resolver.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/components/resolver.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/module-writer.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.js +9 -5
- package/esm/src/transforms/mdx/index.d.ts +2 -2
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +3 -2
- package/esm/src/transforms/mdx/mdx-cache-adapter.js +1 -1
- package/esm/src/transforms/mdx/module-loader/types.d.ts +1 -1
- package/esm/src/transforms/mdx/module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/types.d.ts +2 -2
- package/esm/src/transforms/mdx/types.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/constants.d.ts +22 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/constants.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/constants.js +36 -13
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.d.ts +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.js +6 -4
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.d.ts +2 -3
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.js +14 -12
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/transform.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/transform.js +73 -63
- package/esm/src/types/app.d.ts +1 -1
- package/esm/src/types/app.d.ts.map +1 -1
- package/esm/src/types/entities/getEntityInfo.d.ts +1 -1
- package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
- package/esm/src/types/entities/getEntityInfo.js +25 -16
- package/esm/src/types/entities.js +1 -1
- package/esm/src/types/global-guards.d.ts +1 -1
- package/esm/src/types/global-guards.d.ts.map +1 -1
- package/esm/src/types/index.d.ts +2 -2
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/types/rsc.d.ts +16 -0
- package/esm/src/types/rsc.d.ts.map +1 -1
- package/esm/src/utils/id.d.ts +7 -0
- package/esm/src/utils/id.d.ts.map +1 -1
- package/esm/src/utils/id.js +22 -0
- package/esm/src/utils/platform.d.ts.map +1 -1
- package/esm/src/utils/platform.js +2 -11
- package/esm/src/utils/route-path-utils.d.ts +6 -2
- package/esm/src/utils/route-path-utils.d.ts.map +1 -1
- package/esm/src/utils/route-path-utils.js +18 -9
- 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/react/use-claude-code-stream.js +1 -1
- package/esm/src/workflow/claude-code/react/use-claude-code-websocket.js +1 -1
- package/esm/src/workflow/executor/dag/composite-node-execution.d.ts +11 -0
- package/esm/src/workflow/executor/dag/composite-node-execution.d.ts.map +1 -0
- package/esm/src/workflow/executor/dag/composite-node-execution.js +147 -0
- package/esm/src/workflow/executor/dag/graph.js +1 -1
- package/esm/src/workflow/executor/dag/index.d.ts +1 -1
- package/esm/src/workflow/executor/dag/index.d.ts.map +1 -1
- package/esm/src/workflow/executor/dag/index.js +78 -34
- package/esm/src/workflow/executor/dag/loop-node-strategy.d.ts.map +1 -1
- package/esm/src/workflow/executor/dag/loop-node-strategy.js +10 -2
- package/esm/src/workflow/executor/dag/map-node-strategy.d.ts.map +1 -1
- package/esm/src/workflow/executor/dag/map-node-strategy.js +3 -0
- package/esm/src/workflow/executor/dag/node-strategy-types.d.ts +1 -0
- package/esm/src/workflow/executor/dag/node-strategy-types.d.ts.map +1 -1
- package/esm/src/workflow/executor/dag/types.d.ts +2 -0
- package/esm/src/workflow/executor/dag/types.d.ts.map +1 -1
- package/esm/src/workflow/executor/dag/utils.d.ts +1 -1
- package/esm/src/workflow/executor/dag/utils.d.ts.map +1 -1
- package/esm/src/workflow/executor/dag/utils.js +13 -3
- package/esm/src/workflow/executor/step-executor.d.ts +5 -1
- package/esm/src/workflow/executor/step-executor.d.ts.map +1 -1
- package/esm/src/workflow/executor/step-executor.js +71 -16
- package/esm/src/workflow/executor/workflow-executor.d.ts +7 -4
- package/esm/src/workflow/executor/workflow-executor.d.ts.map +1 -1
- package/esm/src/workflow/executor/workflow-executor.js +181 -100
- package/esm/src/workflow/react/use-approval.js +1 -1
- package/esm/src/workflow/react/use-workflow-list.js +1 -1
- package/esm/src/workflow/react/use-workflow-start.js +1 -1
- package/esm/src/workflow/react/use-workflow.js +1 -1
- package/package.json +4 -5
- package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4/client.d.ts.map +0 -1
- package/esm/deps/esm.sh/react-dom@19.2.4/client.js +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4/server.d.ts +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4/server.d.ts.map +0 -1
- package/esm/deps/esm.sh/react-dom@19.2.4/server.js +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts +0 -3
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts.map +0 -1
- package/esm/deps/esm.sh/react-dom@19.2.4.js +0 -3
- package/esm/deps/esm.sh/react@19.2.4/jsx-dev-runtime.d.ts +0 -3
- package/esm/deps/esm.sh/react@19.2.4/jsx-dev-runtime.d.ts.map +0 -1
- package/esm/deps/esm.sh/react@19.2.4/jsx-dev-runtime.js +0 -3
- package/esm/deps/esm.sh/react@19.2.4/jsx-runtime.d.ts +0 -3
- package/esm/deps/esm.sh/react@19.2.4/jsx-runtime.d.ts.map +0 -1
- package/esm/deps/esm.sh/react@19.2.4/jsx-runtime.js +0 -3
- package/esm/deps/esm.sh/react@19.2.4.d.ts +0 -3
- package/esm/deps/esm.sh/react@19.2.4.d.ts.map +0 -1
- package/esm/deps/esm.sh/react@19.2.4.js +0 -3
- package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts +0 -3
- package/esm/deps/esm.sh/scheduler@^0.27.0.d.ts.map +0 -1
- package/esm/deps/esm.sh/scheduler@^0.27.0.js +0 -3
- package/esm/react/jsx-dev-runtime.d.ts +0 -2
- package/esm/react/jsx-dev-runtime.d.ts.map +0 -1
- package/esm/react/jsx-dev-runtime.js +0 -1
- package/esm/react/jsx-runtime.d.ts +0 -2
- package/esm/react/jsx-runtime.d.ts.map +0 -1
- package/esm/react/jsx-runtime.js +0 -1
- package/esm/react/react-dom-client.d.ts +0 -3
- package/esm/react/react-dom-client.d.ts.map +0 -1
- package/esm/react/react-dom-client.js +0 -2
- package/esm/react/react-dom-server.d.ts +0 -3
- package/esm/react/react-dom-server.d.ts.map +0 -1
- package/esm/react/react-dom-server.js +0 -2
- package/esm/react/react-dom.d.ts +0 -3
- package/esm/react/react-dom.d.ts.map +0 -1
- package/esm/react/react-dom.js +0 -2
- package/esm/react/react.d.ts +0 -6
- package/esm/react/react.d.ts.map +0 -1
- package/esm/react/react.js +0 -7
|
@@ -26,8 +26,48 @@ export type CacheOptions = {
|
|
|
26
26
|
/** React version to use for esm.sh URLs (defaults to DEFAULT_REACT_VERSION) */
|
|
27
27
|
reactVersion?: string;
|
|
28
28
|
};
|
|
29
|
+
export type HttpCacheIdentityOptions = Pick<CacheOptions, "importMap" | "reactVersion">;
|
|
30
|
+
export interface HttpCacheIdentityMetadata extends HttpCacheIdentityOptions {
|
|
31
|
+
url: string;
|
|
32
|
+
/** SHA-256 key for the shared distributed-cache import-map record. */
|
|
33
|
+
importMapFingerprint?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface EffectiveHttpCacheRequest<T extends HttpCacheIdentityOptions = HttpCacheIdentityOptions> {
|
|
36
|
+
url: string;
|
|
37
|
+
options: T;
|
|
38
|
+
}
|
|
39
|
+
/** Build an order-independent fingerprint covering imports and scoped imports. */
|
|
40
|
+
export declare function fingerprintImportMap(importMap: ImportMapConfig): Promise<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Snapshot an import-map fingerprint for one top-level immutable request graph.
|
|
43
|
+
* Callers must create a fresh prepared options object for each top-level request.
|
|
44
|
+
*/
|
|
45
|
+
export declare function prepareHttpCacheRequestOptions<T extends CacheOptions>(options: T): T;
|
|
46
|
+
/** Preserve an existing graph snapshot, or create one for an unprepared entry point. */
|
|
47
|
+
export declare function ensurePreparedHttpCacheRequestOptions<T extends CacheOptions>(options: T): T;
|
|
48
|
+
/** Canonical identity shared by normal caching and all recovery paths. */
|
|
49
|
+
export declare function buildHttpCacheIdentity(url: string, options: HttpCacheIdentityOptions): Promise<string>;
|
|
50
|
+
/** Build recoverable metadata while reusing the request graph's import-map fingerprint. */
|
|
51
|
+
export declare function buildHttpCacheIdentityMetadata(url: string, options: HttpCacheIdentityOptions): Promise<HttpCacheIdentityMetadata>;
|
|
52
|
+
/** Build the versioned, collision-resistant filename and distributed-cache hash. */
|
|
53
|
+
export declare function hashHttpCacheIdentity(identity: string): Promise<string>;
|
|
29
54
|
export declare function ensureAbsoluteDir(path: string): string;
|
|
30
55
|
export declare function isHttpUrl(specifier: string): boolean;
|
|
56
|
+
/** Return the exact version for an URL in React's canonical esm.sh graph. */
|
|
57
|
+
export declare function getCanonicalReactEsmVersion(rawUrl: string): string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Align a canonical React URL and its cache options to one project version.
|
|
60
|
+
* The URL version is authoritative when the caller has no resolved version.
|
|
61
|
+
*/
|
|
62
|
+
export declare function getEffectiveHttpCacheRequest<T extends HttpCacheIdentityOptions>(rawUrl: string, options: T): EffectiveHttpCacheRequest<T>;
|
|
63
|
+
/**
|
|
64
|
+
* Return whether an URL belongs to React's canonical esm.sh module graph.
|
|
65
|
+
*
|
|
66
|
+
* React must remain a process-wide singleton for a given version. Unrelated
|
|
67
|
+
* project import maps therefore must not partition these modules into
|
|
68
|
+
* separate local files.
|
|
69
|
+
*/
|
|
70
|
+
export declare function isCanonicalReactEsmUrl(rawUrl: string): boolean;
|
|
31
71
|
export declare function isExternalScheme(specifier: string): boolean;
|
|
32
72
|
export declare function isRelative(specifier: string): boolean;
|
|
33
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-cache-helpers.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache-helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"http-cache-helpers.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache-helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAQzE;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,EAAE,CAAC;IACjC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;IACvB,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;CAC3B;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;IAC3B,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,cAAc,CAAC,CAAC;AAExF,MAAM,WAAW,yBAA0B,SAAQ,wBAAwB;IACzE,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,yBAAyB,CACxC,CAAC,SAAS,wBAAwB,GAAG,wBAAwB;IAE7D,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,CAAC,CAAC;CACZ;AAqBD,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAYhF;AAuBD;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,YAAY,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAGpF;AAED,wFAAwF;AACxF,wBAAgB,qCAAqC,CAAC,CAAC,SAAS,YAAY,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAI3F;AAmBD,0EAA0E;AAC1E,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,2FAA2F;AAC3F,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC,CAQpC;AAED,oFAAoF;AACpF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEpD;AAoCD,6EAA6E;AAC7E,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEzE;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,wBAAwB,EAC7E,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,CAAC,GACT,yBAAyB,CAAC,CAAC,CAAC,CAmB9B;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAM3D;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEvE;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAQzD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAqBhD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA2BpD;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,eAAe,EAC1B,YAAY,GAAE,MAA8B,GAC3C,MAAM,CA4BR;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAkBrF"}
|
|
@@ -10,13 +10,156 @@ import { resolveImport } from "../../modules/import-map/resolver.js";
|
|
|
10
10
|
import { buildEsmShUrl } from "../import-rewriter/url-builder.js";
|
|
11
11
|
import { parseBarePackageSpecifier } from "../shared/package-specifier.js";
|
|
12
12
|
import { DEFAULT_REACT_VERSION, getReactImportMap } from "./package-registry.js";
|
|
13
|
+
import { computeHash } from "../../utils/hash-utils.js";
|
|
13
14
|
const logger = rendererLogger.component("http-cache");
|
|
15
|
+
const HTTP_CACHE_REQUEST_IDENTITY_CONTEXT = Symbol("http-cache-request-identity-context");
|
|
16
|
+
function compareImportMapKeys(left, right) {
|
|
17
|
+
return left[0] < right[0] ? -1 : left[0] > right[0] ? 1 : 0;
|
|
18
|
+
}
|
|
19
|
+
const HTTP_IMPORT_MAP_FINGERPRINT_NAMESPACE = "veryfront:http-import-map:v2";
|
|
20
|
+
const HTTP_CACHE_IDENTITY_NAMESPACE = "veryfront:http-module:v2";
|
|
21
|
+
const HTTP_CACHE_FILE_HASH_NAMESPACE = "veryfront:http-module-file:v2";
|
|
22
|
+
/** Build an order-independent fingerprint covering imports and scoped imports. */
|
|
23
|
+
export function fingerprintImportMap(importMap) {
|
|
24
|
+
const imports = Object.entries(importMap.imports ?? {}).sort(compareImportMapKeys);
|
|
25
|
+
const scopes = Object.entries(importMap.scopes ?? {})
|
|
26
|
+
.sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0)
|
|
27
|
+
.map(([scope, scopedImports]) => [
|
|
28
|
+
scope,
|
|
29
|
+
Object.entries(scopedImports).sort(compareImportMapKeys),
|
|
30
|
+
]);
|
|
31
|
+
return computeHash(`${HTTP_IMPORT_MAP_FINGERPRINT_NAMESPACE}\0${JSON.stringify({ imports, scopes })}`);
|
|
32
|
+
}
|
|
33
|
+
function attachHttpCacheRequestIdentityContext(options, context) {
|
|
34
|
+
Object.defineProperty(options, HTTP_CACHE_REQUEST_IDENTITY_CONTEXT, {
|
|
35
|
+
configurable: false,
|
|
36
|
+
enumerable: false,
|
|
37
|
+
value: context,
|
|
38
|
+
writable: false,
|
|
39
|
+
});
|
|
40
|
+
return options;
|
|
41
|
+
}
|
|
42
|
+
function getHttpCacheRequestIdentityContext(options) {
|
|
43
|
+
return options[HTTP_CACHE_REQUEST_IDENTITY_CONTEXT];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Snapshot an import-map fingerprint for one top-level immutable request graph.
|
|
47
|
+
* Callers must create a fresh prepared options object for each top-level request.
|
|
48
|
+
*/
|
|
49
|
+
export function prepareHttpCacheRequestOptions(options) {
|
|
50
|
+
const prepared = { ...options };
|
|
51
|
+
return attachHttpCacheRequestIdentityContext(prepared, {});
|
|
52
|
+
}
|
|
53
|
+
/** Preserve an existing graph snapshot, or create one for an unprepared entry point. */
|
|
54
|
+
export function ensurePreparedHttpCacheRequestOptions(options) {
|
|
55
|
+
return getHttpCacheRequestIdentityContext(options)
|
|
56
|
+
? options
|
|
57
|
+
: prepareHttpCacheRequestOptions(options);
|
|
58
|
+
}
|
|
59
|
+
function getRequestImportMapFingerprint(rawUrl, effectiveOptions) {
|
|
60
|
+
const context = getHttpCacheRequestIdentityContext(effectiveOptions);
|
|
61
|
+
if (!context)
|
|
62
|
+
return fingerprintImportMap(effectiveOptions.importMap);
|
|
63
|
+
if (!isCanonicalReactEsmUrl(rawUrl)) {
|
|
64
|
+
context.importMapFingerprint ??= fingerprintImportMap(effectiveOptions.importMap);
|
|
65
|
+
return context.importMapFingerprint;
|
|
66
|
+
}
|
|
67
|
+
context.canonicalReactImportMapFingerprint ??= fingerprintImportMap(effectiveOptions.importMap);
|
|
68
|
+
return context.canonicalReactImportMapFingerprint;
|
|
69
|
+
}
|
|
70
|
+
/** Canonical identity shared by normal caching and all recovery paths. */
|
|
71
|
+
export async function buildHttpCacheIdentity(url, options) {
|
|
72
|
+
const effective = getEffectiveHttpCacheRequest(url, options);
|
|
73
|
+
const normalizedUrl = normalizeHttpUrl(effective.url);
|
|
74
|
+
const importMapFingerprint = await getRequestImportMapFingerprint(url, effective.options);
|
|
75
|
+
const components = [
|
|
76
|
+
normalizedUrl,
|
|
77
|
+
effective.options.reactVersion ?? null,
|
|
78
|
+
importMapFingerprint,
|
|
79
|
+
];
|
|
80
|
+
return `${HTTP_CACHE_IDENTITY_NAMESPACE}:${JSON.stringify(components)}`;
|
|
81
|
+
}
|
|
82
|
+
/** Build recoverable metadata while reusing the request graph's import-map fingerprint. */
|
|
83
|
+
export async function buildHttpCacheIdentityMetadata(url, options) {
|
|
84
|
+
const effective = getEffectiveHttpCacheRequest(url, options);
|
|
85
|
+
return {
|
|
86
|
+
url: normalizeHttpUrl(effective.url),
|
|
87
|
+
importMap: effective.options.importMap,
|
|
88
|
+
reactVersion: effective.options.reactVersion,
|
|
89
|
+
importMapFingerprint: await getRequestImportMapFingerprint(url, effective.options),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** Build the versioned, collision-resistant filename and distributed-cache hash. */
|
|
93
|
+
export function hashHttpCacheIdentity(identity) {
|
|
94
|
+
return computeHash(`${HTTP_CACHE_FILE_HASH_NAMESPACE}\0${identity}`);
|
|
95
|
+
}
|
|
14
96
|
export function ensureAbsoluteDir(path) {
|
|
15
97
|
return isAbsolute(path) ? path : join(cwd(), path);
|
|
16
98
|
}
|
|
17
99
|
export function isHttpUrl(specifier) {
|
|
18
100
|
return specifier.startsWith("https://") || specifier.startsWith("http://");
|
|
19
101
|
}
|
|
102
|
+
function parseCanonicalReactEsmPackage(rawUrl) {
|
|
103
|
+
try {
|
|
104
|
+
const url = new URL(rawUrl);
|
|
105
|
+
if (url.hostname !== "esm.sh")
|
|
106
|
+
return null;
|
|
107
|
+
const pathSegments = url.pathname.split("/").filter(Boolean);
|
|
108
|
+
const prefix = pathSegments[0] ?? "";
|
|
109
|
+
const packageIndex = prefix === "stable" || /^v\d+$/.test(prefix) ? 1 : 0;
|
|
110
|
+
const match = /^(react|react-dom)@(\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?)$/.exec(pathSegments[packageIndex] ?? "");
|
|
111
|
+
if (!match?.[1] || !match[2])
|
|
112
|
+
return null;
|
|
113
|
+
return {
|
|
114
|
+
packageName: match[1],
|
|
115
|
+
version: match[2],
|
|
116
|
+
packageIndex,
|
|
117
|
+
url,
|
|
118
|
+
pathSegments,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
catch (_) {
|
|
122
|
+
/* expected: malformed URLs are not canonical React modules */
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/** Return the exact version for an URL in React's canonical esm.sh graph. */
|
|
127
|
+
export function getCanonicalReactEsmVersion(rawUrl) {
|
|
128
|
+
return parseCanonicalReactEsmPackage(rawUrl)?.version ?? null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Align a canonical React URL and its cache options to one project version.
|
|
132
|
+
* The URL version is authoritative when the caller has no resolved version.
|
|
133
|
+
*/
|
|
134
|
+
export function getEffectiveHttpCacheRequest(rawUrl, options) {
|
|
135
|
+
const parsed = parseCanonicalReactEsmPackage(rawUrl);
|
|
136
|
+
if (!parsed)
|
|
137
|
+
return { url: rawUrl, options };
|
|
138
|
+
const version = options.reactVersion ?? parsed.version;
|
|
139
|
+
if (version !== parsed.version) {
|
|
140
|
+
parsed.pathSegments[parsed.packageIndex] = `${parsed.packageName}@${version}`;
|
|
141
|
+
parsed.url.pathname = `/${parsed.pathSegments.join("/")}`;
|
|
142
|
+
}
|
|
143
|
+
const effectiveOptions = {
|
|
144
|
+
...options,
|
|
145
|
+
importMap: { imports: {}, scopes: {} },
|
|
146
|
+
reactVersion: version,
|
|
147
|
+
};
|
|
148
|
+
const context = getHttpCacheRequestIdentityContext(options);
|
|
149
|
+
if (context)
|
|
150
|
+
attachHttpCacheRequestIdentityContext(effectiveOptions, context);
|
|
151
|
+
return { url: parsed.url.toString(), options: effectiveOptions };
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Return whether an URL belongs to React's canonical esm.sh module graph.
|
|
155
|
+
*
|
|
156
|
+
* React must remain a process-wide singleton for a given version. Unrelated
|
|
157
|
+
* project import maps therefore must not partition these modules into
|
|
158
|
+
* separate local files.
|
|
159
|
+
*/
|
|
160
|
+
export function isCanonicalReactEsmUrl(rawUrl) {
|
|
161
|
+
return getCanonicalReactEsmVersion(rawUrl) !== null;
|
|
162
|
+
}
|
|
20
163
|
export function isExternalScheme(specifier) {
|
|
21
164
|
return specifier.startsWith("node:") ||
|
|
22
165
|
specifier.startsWith("data:") ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-cache-invariants.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache-invariants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,sBAAsB,IAAI,0BAA0B,EACrD,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,mCAA6B,CAAC;AAYjE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAa7D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAcvD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"http-cache-invariants.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache-invariants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,sBAAsB,IAAI,0BAA0B,EACrD,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,mCAA6B,CAAC;AAYjE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAa7D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAcvD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAUrD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAQ/D"}
|
|
@@ -80,10 +80,11 @@ export function assertLocal(code) {
|
|
|
80
80
|
* @throws VeryfrontError (cache-invariant-violation) if hash format is invalid
|
|
81
81
|
*/
|
|
82
82
|
export function asBundleHash(hash) {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
const isLegacyDecimal = /^\d+$/.test(hash);
|
|
84
|
+
const isSha256 = /^[a-f0-9]{64}$/.test(hash);
|
|
85
|
+
if (!isLegacyDecimal && !isSha256) {
|
|
85
86
|
throw CACHE_INVARIANT_VIOLATION.create({
|
|
86
|
-
detail: `[CACHE INVARIANT VIOLATION] Invalid bundle hash format: "${hash}" (expected
|
|
87
|
+
detail: `[CACHE INVARIANT VIOLATION] Invalid bundle hash format: "${hash}" (expected legacy decimal or lowercase SHA-256)`,
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
return brand(hash);
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import type { CacheBackend } from "../../cache/types.js";
|
|
14
14
|
import { type BundleHash, type LocalModuleCode, type NormalizedUrl, type PortableModuleCode } from "./http-cache-types.js";
|
|
15
15
|
import { asBundleHash } from "./http-cache-invariants.js";
|
|
16
|
+
import { type HttpCacheIdentityMetadata } from "./http-cache-helpers.js";
|
|
16
17
|
export declare function __setDistributedCacheAccessorForTests(accessor: (() => Promise<CacheBackend | null>) | null): void;
|
|
17
18
|
export declare function initializeHttpModuleDistributedCache(): Promise<boolean>;
|
|
18
19
|
/**
|
|
@@ -75,7 +76,7 @@ declare class HttpBundleCache {
|
|
|
75
76
|
* @param url - Original URL for reverse lookup
|
|
76
77
|
* @param ttl - TTL in seconds (defaults to HTTP_MODULE_DISTRIBUTED_TTL_SEC)
|
|
77
78
|
*/
|
|
78
|
-
setCode(hash: BundleHash | string, code: LocalModuleCode, url: NormalizedUrl | string, ttl?: number): Promise<void>;
|
|
79
|
+
setCode(hash: BundleHash | string, code: LocalModuleCode, url: NormalizedUrl | string, ttl?: number, identityMetadata?: HttpCacheIdentityMetadata): Promise<void>;
|
|
79
80
|
/**
|
|
80
81
|
* Batch get multiple bundle codes from distributed cache.
|
|
81
82
|
* ALWAYS returns LocalModuleCode (detokenized) for each successful fetch.
|
|
@@ -91,6 +92,8 @@ declare class HttpBundleCache {
|
|
|
91
92
|
* @returns Original URL or null
|
|
92
93
|
*/
|
|
93
94
|
getOriginalUrl(hash: BundleHash | string): Promise<string | null>;
|
|
95
|
+
/** Return the full rewrite identity needed to reproduce a bundle by URL. */
|
|
96
|
+
getIdentityMetadata(hash: BundleHash | string): Promise<HttpCacheIdentityMetadata | null>;
|
|
94
97
|
/**
|
|
95
98
|
* Delete a bundle from distributed cache.
|
|
96
99
|
* Removes all keys associated with the hash (code, url, hash mapping).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-cache-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,YAAY,EAKb,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"http-cache-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,YAAY,EAKb,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAwB,KAAK,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAwF/F,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,CAAC,MAAM,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,GACpD,IAAI,CAEN;AAED,wBAAsB,oCAAoC,IAAI,OAAO,CAAC,OAAO,CAAC,CAM7E;AAWD;;;;;;GAMG;AACH,iBAAS,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,kBAAkB,CAoB3D;AAED;;;GAGG;AACH,iBAAS,UAAU,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,GAAG,eAAe,CAMtE;AAmCD;;GAEG;AACH,UAAU,aAAa;IACrB,wEAAwE;IACxE,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IAC7B,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,WAAW,GAAG,oBAAoB,GAAG,cAAc,GAAG,OAAO,CAAC;CAC5E;AAED;;;;;;;;;GASG;AACH,cAAM,eAAe;IACnB;;;;;;OAMG;IACG,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAiDtE;;;;;;OAMG;IACG,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAqCrE;;;;;;;;OAQG;IACG,OAAO,CACX,IAAI,EAAE,UAAU,GAAG,MAAM,EACzB,IAAI,EAAE,eAAe,EACrB,GAAG,EAAE,aAAa,GAAG,MAAM,EAC3B,GAAG,GAAE,MAAwC,EAC7C,gBAAgB,CAAC,EAAE,yBAAyB,GAC3C,OAAO,CAAC,IAAI,CAAC;IAoDhB;;;;;;OAMG;IACG,aAAa,CACjB,MAAM,EAAE,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC,GACjC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IA8CxC;;;;;OAKG;IACG,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAcvE,4EAA4E;IACtE,mBAAmB,CACvB,IAAI,EAAE,UAAU,GAAG,MAAM,GACxB,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC;IA+B5C;;;;;;OAMG;IACG,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAuB7D;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;CAItC;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,iBAAwB,CAAC;AAErD;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -19,6 +19,7 @@ import { HTTP_MODULE_DISTRIBUTED_TTL_SEC } from "../../utils/constants/cache.js"
|
|
|
19
19
|
import { brand, unbrand, } from "./http-cache-types.js";
|
|
20
20
|
import { asBundleHash, assertLocal, assertPortable, CACHE_DIR_TOKEN, VeryfrontError, } from "./http-cache-invariants.js";
|
|
21
21
|
import { looksLikeHtmlContent as looksLikeHtml } from "./html-content.js";
|
|
22
|
+
import { fingerprintImportMap } from "./http-cache-helpers.js";
|
|
22
23
|
const logger = rendererLogger.component("http-cache-wrapper");
|
|
23
24
|
/** Maximum number of keys per batch request to distributed cache API */
|
|
24
25
|
const BATCH_FETCH_CHUNK_SIZE = 100;
|
|
@@ -28,6 +29,68 @@ let testDistributedCacheAccessor = null;
|
|
|
28
29
|
function resolveDistributedCache() {
|
|
29
30
|
return testDistributedCacheAccessor ? testDistributedCacheAccessor() : getDistributedCache();
|
|
30
31
|
}
|
|
32
|
+
function parseStringRecord(value) {
|
|
33
|
+
if (value === undefined)
|
|
34
|
+
return undefined;
|
|
35
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
36
|
+
return undefined;
|
|
37
|
+
const entries = Object.entries(value);
|
|
38
|
+
if (entries.some(([, entry]) => typeof entry !== "string"))
|
|
39
|
+
return undefined;
|
|
40
|
+
return Object.fromEntries(entries);
|
|
41
|
+
}
|
|
42
|
+
function parseImportMap(value) {
|
|
43
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
44
|
+
return null;
|
|
45
|
+
const rawImportMap = value;
|
|
46
|
+
const imports = parseStringRecord(rawImportMap.imports);
|
|
47
|
+
if (rawImportMap.imports !== undefined && imports === undefined)
|
|
48
|
+
return null;
|
|
49
|
+
let scopes;
|
|
50
|
+
if (rawImportMap.scopes !== undefined) {
|
|
51
|
+
if (!rawImportMap.scopes || typeof rawImportMap.scopes !== "object" ||
|
|
52
|
+
Array.isArray(rawImportMap.scopes))
|
|
53
|
+
return null;
|
|
54
|
+
scopes = {};
|
|
55
|
+
for (const [scope, rawScopedImports] of Object.entries(rawImportMap.scopes)) {
|
|
56
|
+
const scopedImports = parseStringRecord(rawScopedImports);
|
|
57
|
+
if (!scopedImports)
|
|
58
|
+
return null;
|
|
59
|
+
scopes[scope] = scopedImports;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return { imports, scopes };
|
|
63
|
+
}
|
|
64
|
+
function parseIdentityMetadata(value) {
|
|
65
|
+
try {
|
|
66
|
+
const parsed = JSON.parse(value);
|
|
67
|
+
if (!parsed || typeof parsed !== "object" || typeof parsed.url !== "string")
|
|
68
|
+
return null;
|
|
69
|
+
if (parsed.reactVersion !== undefined && typeof parsed.reactVersion !== "string")
|
|
70
|
+
return null;
|
|
71
|
+
// Backward compatibility for v2 records written before import maps were shared.
|
|
72
|
+
if (parsed.importMap !== undefined) {
|
|
73
|
+
const importMap = parseImportMap(parsed.importMap);
|
|
74
|
+
return importMap
|
|
75
|
+
? {
|
|
76
|
+
url: parsed.url,
|
|
77
|
+
reactVersion: parsed.reactVersion,
|
|
78
|
+
importMap,
|
|
79
|
+
}
|
|
80
|
+
: null;
|
|
81
|
+
}
|
|
82
|
+
if (typeof parsed.importMapFingerprint !== "string")
|
|
83
|
+
return null;
|
|
84
|
+
return {
|
|
85
|
+
url: parsed.url,
|
|
86
|
+
reactVersion: parsed.reactVersion,
|
|
87
|
+
importMapFingerprint: parsed.importMapFingerprint,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
31
94
|
export function __setDistributedCacheAccessorForTests(accessor) {
|
|
32
95
|
testDistributedCacheAccessor = accessor;
|
|
33
96
|
}
|
|
@@ -214,7 +277,7 @@ class HttpBundleCache {
|
|
|
214
277
|
* @param url - Original URL for reverse lookup
|
|
215
278
|
* @param ttl - TTL in seconds (defaults to HTTP_MODULE_DISTRIBUTED_TTL_SEC)
|
|
216
279
|
*/
|
|
217
|
-
async setCode(hash, code, url, ttl = HTTP_MODULE_DISTRIBUTED_TTL_SEC) {
|
|
280
|
+
async setCode(hash, code, url, ttl = HTTP_MODULE_DISTRIBUTED_TTL_SEC, identityMetadata) {
|
|
218
281
|
const distributed = await resolveDistributedCache();
|
|
219
282
|
if (!distributed)
|
|
220
283
|
return;
|
|
@@ -226,11 +289,21 @@ class HttpBundleCache {
|
|
|
226
289
|
// Validate invariant
|
|
227
290
|
assertPortable(portableCode);
|
|
228
291
|
const portableStr = unbrand(portableCode);
|
|
229
|
-
|
|
292
|
+
const writes = [
|
|
230
293
|
distributed.set(distributedKey("url", hashStr), portableStr, ttl),
|
|
231
294
|
distributed.set(distributedKey("code", hashStr), portableStr, ttl),
|
|
232
295
|
distributed.set(distributedKey("hash", hashStr), urlStr, ttl),
|
|
233
|
-
]
|
|
296
|
+
];
|
|
297
|
+
if (identityMetadata) {
|
|
298
|
+
const importMapFingerprint = identityMetadata.importMapFingerprint ??
|
|
299
|
+
await fingerprintImportMap(identityMetadata.importMap);
|
|
300
|
+
writes.push(distributed.set(distributedKey("import-map", importMapFingerprint), JSON.stringify(identityMetadata.importMap), ttl), distributed.set(distributedKey("identity", hashStr), JSON.stringify({
|
|
301
|
+
url: identityMetadata.url,
|
|
302
|
+
reactVersion: identityMetadata.reactVersion,
|
|
303
|
+
importMapFingerprint,
|
|
304
|
+
}), ttl));
|
|
305
|
+
}
|
|
306
|
+
await Promise.all(writes);
|
|
234
307
|
logger.debug("Stored code in distributed cache", { hash: hashStr });
|
|
235
308
|
}
|
|
236
309
|
catch (error) {
|
|
@@ -305,6 +378,40 @@ class HttpBundleCache {
|
|
|
305
378
|
return null;
|
|
306
379
|
}
|
|
307
380
|
}
|
|
381
|
+
/** Return the full rewrite identity needed to reproduce a bundle by URL. */
|
|
382
|
+
async getIdentityMetadata(hash) {
|
|
383
|
+
const distributed = await resolveDistributedCache();
|
|
384
|
+
if (!distributed)
|
|
385
|
+
return null;
|
|
386
|
+
const hashStr = typeof hash === "string" ? hash : unbrand(hash);
|
|
387
|
+
try {
|
|
388
|
+
const raw = await distributed.get(distributedKey("identity", hashStr));
|
|
389
|
+
if (!raw)
|
|
390
|
+
return null;
|
|
391
|
+
const parsed = parseIdentityMetadata(raw);
|
|
392
|
+
if (!parsed || "importMap" in parsed)
|
|
393
|
+
return parsed;
|
|
394
|
+
const rawImportMap = await distributed.get(distributedKey("import-map", parsed.importMapFingerprint));
|
|
395
|
+
if (!rawImportMap)
|
|
396
|
+
return null;
|
|
397
|
+
let importMapValue;
|
|
398
|
+
try {
|
|
399
|
+
importMapValue = JSON.parse(rawImportMap);
|
|
400
|
+
}
|
|
401
|
+
catch {
|
|
402
|
+
return null;
|
|
403
|
+
}
|
|
404
|
+
const importMap = parseImportMap(importMapValue);
|
|
405
|
+
if (!importMap)
|
|
406
|
+
return null;
|
|
407
|
+
if (await fingerprintImportMap(importMap) !== parsed.importMapFingerprint)
|
|
408
|
+
return null;
|
|
409
|
+
return { ...parsed, importMap };
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
308
415
|
/**
|
|
309
416
|
* Delete a bundle from distributed cache.
|
|
310
417
|
* Removes all keys associated with the hash (code, url, hash mapping).
|
|
@@ -323,6 +430,7 @@ class HttpBundleCache {
|
|
|
323
430
|
distributed.del(distributedKey("url", hashStr)),
|
|
324
431
|
distributed.del(distributedKey("code", hashStr)),
|
|
325
432
|
distributed.del(distributedKey("hash", hashStr)),
|
|
433
|
+
distributed.del(distributedKey("identity", hashStr)),
|
|
326
434
|
]);
|
|
327
435
|
logger.info("Deleted bundle from distributed cache", { hash: hashStr });
|
|
328
436
|
return true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CACHE_DIR_TOKEN, detokenizeAllCachePaths, detokenizeCachePaths, tokenizeAllCachePaths, tokenizeCachePaths } from "../../cache/paths.js";
|
|
2
2
|
import { embedSourceUrl, extractSourceUrl } from "./source-url-embed.js";
|
|
3
|
-
import { type CacheOptions, hasIncompatibleFilePaths, type HttpCacheLike, normalizeHttpUrl, type SetLike } from "./http-cache-helpers.js";
|
|
3
|
+
import { type CacheOptions, hasIncompatibleFilePaths, type HttpCacheIdentityOptions, type HttpCacheLike, normalizeHttpUrl, type SetLike } from "./http-cache-helpers.js";
|
|
4
4
|
import { extractBundleDeps } from "./bundle-deps-validator.js";
|
|
5
5
|
import { __clearInFlightHttpFetches } from "./in-flight-manager.js";
|
|
6
6
|
import { __injectCachesForTests } from "./http-cache-state.js";
|
|
@@ -23,12 +23,12 @@ export declare function cacheHttpImportsToLocal(code: string, options: CacheOpti
|
|
|
23
23
|
/**
|
|
24
24
|
* Cache a specific HTTP module URL and return its local file:// path.
|
|
25
25
|
*/
|
|
26
|
-
export declare function cacheModuleToLocal(url: string, cacheDir: string): Promise<string>;
|
|
26
|
+
export declare function cacheModuleToLocal(url: string, cacheDir: string, reactVersion?: string): Promise<string>;
|
|
27
27
|
/**
|
|
28
28
|
* Recover a missing HTTP bundle by looking up the code directly from the hash.
|
|
29
29
|
* Delegates to bundle-recovery module with cacheHttpModule wired in.
|
|
30
30
|
*/
|
|
31
|
-
export declare function recoverHttpBundleByHash(hash: string, cacheDir: string, parentCode?: string): Promise<boolean>;
|
|
31
|
+
export declare function recoverHttpBundleByHash(hash: string, cacheDir: string, parentCode?: string, identity?: HttpCacheIdentityOptions): Promise<boolean>;
|
|
32
32
|
/**
|
|
33
33
|
* Ensure all HTTP bundles exist locally before import.
|
|
34
34
|
* Delegates to bundle-recovery module with cacheHttpModule wired in.
|
|
@@ -36,7 +36,7 @@ export declare function recoverHttpBundleByHash(hash: string, cacheDir: string,
|
|
|
36
36
|
export declare function ensureHttpBundlesExist(bundlePaths: Array<{
|
|
37
37
|
path: string;
|
|
38
38
|
hash: string;
|
|
39
|
-
}>, cacheDir: string): Promise<string[]>;
|
|
39
|
+
}>, cacheDir: string, identity?: HttpCacheIdentityOptions): Promise<string[]>;
|
|
40
40
|
/**
|
|
41
41
|
* Invalidate a corrupted bundle from both local and distributed cache.
|
|
42
42
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-cache.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/esm/http-cache.ts"],"names":[],"mappings":"AAwBA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAGL,KAAK,YAAY,EAKjB,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAElB,gBAAgB,EAEhB,KAAK,OAAO,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAA2B,MAAM,4BAA4B,CAAC;AACxF,OAAO,EACL,0BAA0B,EAO3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EAKvB,MAAM,uBAAuB,CAAC;AAe/B,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,GACnB,CAAC;AAGF,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAsRlC,wEAAwE;AACxE,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,sBAAsB,CAAC,CAkCjC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,wBAAwB,GAClC,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAClD,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,wBAAwB,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CAEnB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAErF;AAGD,eAAO,MAAM,wBAAwB,0BAAoB,CAAC"}
|
|
@@ -11,7 +11,6 @@ import { createFileSystem, exists } from "../../platform/compat/fs.js";
|
|
|
11
11
|
import { join } from "../../platform/compat/path/index.js";
|
|
12
12
|
import { rendererLogger as logger } from "../../utils/index.js";
|
|
13
13
|
import { BUILD_FAILED, BUNDLE_ERROR, FILE_NOT_FOUND } from "../../errors/index.js";
|
|
14
|
-
import { simpleHash } from "../../utils/hash-utils.js";
|
|
15
14
|
import { withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
16
15
|
import { SpanNames } from "../../observability/tracing/span-names.js";
|
|
17
16
|
import { replaceSpecifiers } from "./lexer.js";
|
|
@@ -25,7 +24,7 @@ import { CACHE_DIR_TOKEN, detokenizeAllCachePaths, detokenizeCachePaths, tokeniz
|
|
|
25
24
|
import { looksLikeHtmlContent as looksLikeHtmlNotJs } from "./html-content.js";
|
|
26
25
|
// Extracted modules
|
|
27
26
|
import { embedSourceUrl, extractSourceUrl } from "./source-url-embed.js";
|
|
28
|
-
import { ensureAbsoluteDir, hasIncompatibleFilePaths, isHttpUrl, normalizeHttpUrl, } from "./http-cache-helpers.js";
|
|
27
|
+
import { buildHttpCacheIdentity, buildHttpCacheIdentityMetadata, ensureAbsoluteDir, ensurePreparedHttpCacheRequestOptions, getEffectiveHttpCacheRequest, hashHttpCacheIdentity, hasIncompatibleFilePaths, isHttpUrl, normalizeHttpUrl, prepareHttpCacheRequestOptions, } from "./http-cache-helpers.js";
|
|
29
28
|
import { extractBundleDeps, validateBundleDepsExist } from "./bundle-deps-validator.js";
|
|
30
29
|
import { __clearInFlightHttpFetches, bundleAccumulatorStorage, inFlightHttpFetches, processingStackStorage, refreshDistributedCacheAsync, trackBundleAccumulator, waitForInFlightFetch, } from "./in-flight-manager.js";
|
|
31
30
|
import { __injectCachesForTests, getCachedPaths, getLastDistributedRefresh, getProcessingStack, hasInjectedProcessingStack, } from "./http-cache-state.js";
|
|
@@ -44,14 +43,16 @@ export { __injectCachesForTests };
|
|
|
44
43
|
async function cacheHttpModuleInternal(url, options) {
|
|
45
44
|
const normalizedUrl = normalizeHttpUrl(url);
|
|
46
45
|
const cacheDir = ensureAbsoluteDir(options.cacheDir);
|
|
47
|
-
const
|
|
46
|
+
const cacheIdentity = await buildHttpCacheIdentity(normalizedUrl, options);
|
|
47
|
+
const identityMetadata = await buildHttpCacheIdentityMetadata(normalizedUrl, options);
|
|
48
|
+
const cacheKey = `${cacheDir}:${cacheIdentity}`;
|
|
48
49
|
const existing = getCachedPaths().get(cacheKey);
|
|
49
50
|
if (existing) {
|
|
50
51
|
if (await exists(existing))
|
|
51
52
|
return existing;
|
|
52
53
|
getCachedPaths().delete(cacheKey);
|
|
53
54
|
}
|
|
54
|
-
const hash =
|
|
55
|
+
const hash = await hashHttpCacheIdentity(cacheIdentity);
|
|
55
56
|
const cachePath = join(cacheDir, `http-${hash}.mjs`);
|
|
56
57
|
const fs = createFileSystem();
|
|
57
58
|
if (await exists(cachePath)) {
|
|
@@ -68,20 +69,20 @@ async function cacheHttpModuleInternal(url, options) {
|
|
|
68
69
|
}
|
|
69
70
|
else {
|
|
70
71
|
getCachedPaths().set(cacheKey, cachePath);
|
|
71
|
-
refreshDistributedCacheAsync(hash, code, cacheDir, normalizedUrl, getLastDistributedRefresh);
|
|
72
|
+
refreshDistributedCacheAsync(hash, code, cacheDir, normalizedUrl, identityMetadata, getLastDistributedRefresh);
|
|
72
73
|
trackBundleAccumulator(hash, normalizedUrl, cachePath);
|
|
73
74
|
return cachePath;
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
else {
|
|
77
78
|
getCachedPaths().set(cacheKey, cachePath);
|
|
78
|
-
refreshDistributedCacheAsync(hash, code, cacheDir, normalizedUrl, getLastDistributedRefresh);
|
|
79
|
+
refreshDistributedCacheAsync(hash, code, cacheDir, normalizedUrl, identityMetadata, getLastDistributedRefresh);
|
|
79
80
|
trackBundleAccumulator(hash, normalizedUrl, cachePath);
|
|
80
81
|
return cachePath;
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
const processingStack = getProcessingStack();
|
|
84
|
-
if (processingStack.has(
|
|
85
|
+
if (processingStack.has(cacheIdentity)) {
|
|
85
86
|
if (await exists(cachePath)) {
|
|
86
87
|
httpCacheLog.debug("Circular dependency detected, file exists", {
|
|
87
88
|
url: normalizedUrl,
|
|
@@ -197,12 +198,12 @@ async function cacheHttpModuleInternal(url, options) {
|
|
|
197
198
|
detail: `Received HTML instead of JavaScript from ${normalizedUrl}. The package may not exist or failed to build on esm.sh.`,
|
|
198
199
|
});
|
|
199
200
|
}
|
|
200
|
-
processingStack.add(
|
|
201
|
+
processingStack.add(cacheIdentity);
|
|
201
202
|
try {
|
|
202
203
|
code = await rewriteModuleImports(code, normalizedUrl, options, cacheHttpModule);
|
|
203
204
|
}
|
|
204
205
|
finally {
|
|
205
|
-
processingStack.delete(
|
|
206
|
+
processingStack.delete(cacheIdentity);
|
|
206
207
|
}
|
|
207
208
|
code = embedSourceUrl(code, normalizedUrl);
|
|
208
209
|
await fs.mkdir(cacheDir, { recursive: true });
|
|
@@ -213,7 +214,7 @@ async function cacheHttpModuleInternal(url, options) {
|
|
|
213
214
|
});
|
|
214
215
|
}
|
|
215
216
|
try {
|
|
216
|
-
await httpBundleCache.setCode(String(hash), asLocalModuleCode(code), normalizedUrl, HTTP_MODULE_DISTRIBUTED_TTL_SEC);
|
|
217
|
+
await httpBundleCache.setCode(String(hash), asLocalModuleCode(code), normalizedUrl, HTTP_MODULE_DISTRIBUTED_TTL_SEC, identityMetadata);
|
|
217
218
|
}
|
|
218
219
|
catch (error) {
|
|
219
220
|
if (error instanceof VeryfrontError && error.slug === "cache-invariant-violation") {
|
|
@@ -241,18 +242,22 @@ async function cacheHttpModuleInternal(url, options) {
|
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
async function cacheHttpModule(url, options) {
|
|
245
|
+
const preparedOptions = ensurePreparedHttpCacheRequestOptions(options);
|
|
246
|
+
const effective = getEffectiveHttpCacheRequest(url, preparedOptions);
|
|
247
|
+
const effectiveOptions = effective.options;
|
|
244
248
|
if (hasInjectedProcessingStack() || processingStackStorage.getStore()) {
|
|
245
|
-
return cacheHttpModuleInternal(url,
|
|
249
|
+
return cacheHttpModuleInternal(effective.url, effectiveOptions);
|
|
246
250
|
}
|
|
247
|
-
return processingStackStorage.run(new Set(), () => cacheHttpModuleInternal(url,
|
|
251
|
+
return processingStackStorage.run(new Set(), () => cacheHttpModuleInternal(effective.url, effectiveOptions));
|
|
248
252
|
}
|
|
249
253
|
/**
|
|
250
254
|
* Rewrite HTTP imports in the provided code to cached local file:// paths.
|
|
251
255
|
* Returns the rewritten code and an optional bundle manifest ID for atomic validation.
|
|
252
256
|
*/
|
|
253
257
|
export function cacheHttpImportsToLocal(code, options) {
|
|
258
|
+
const requestOptions = prepareHttpCacheRequestOptions(options);
|
|
254
259
|
return bundleAccumulatorStorage.run([], async () => {
|
|
255
|
-
const replacements = await buildReplacements(code, undefined,
|
|
260
|
+
const replacements = await buildReplacements(code, undefined, requestOptions, cacheHttpModule);
|
|
256
261
|
if (replacements.size === 0)
|
|
257
262
|
return { code };
|
|
258
263
|
httpCacheLog.debug("Cached HTTP imports", { count: replacements.size });
|
|
@@ -278,26 +283,26 @@ export function cacheHttpImportsToLocal(code, options) {
|
|
|
278
283
|
/**
|
|
279
284
|
* Cache a specific HTTP module URL and return its local file:// path.
|
|
280
285
|
*/
|
|
281
|
-
export async function cacheModuleToLocal(url, cacheDir) {
|
|
286
|
+
export async function cacheModuleToLocal(url, cacheDir, reactVersion) {
|
|
282
287
|
if (!isHttpUrl(url))
|
|
283
288
|
return url;
|
|
284
289
|
const importMap = { imports: {}, scopes: {} };
|
|
285
|
-
const cached = await cacheHttpModule(url, { cacheDir, importMap });
|
|
290
|
+
const cached = await cacheHttpModule(url, { cacheDir, importMap, reactVersion });
|
|
286
291
|
return cached ? `file://${cached}` : url;
|
|
287
292
|
}
|
|
288
293
|
/**
|
|
289
294
|
* Recover a missing HTTP bundle by looking up the code directly from the hash.
|
|
290
295
|
* Delegates to bundle-recovery module with cacheHttpModule wired in.
|
|
291
296
|
*/
|
|
292
|
-
export function recoverHttpBundleByHash(hash, cacheDir, parentCode) {
|
|
293
|
-
return recoverHttpBundleByHashImpl(hash, cacheDir, cacheHttpModule, parentCode);
|
|
297
|
+
export function recoverHttpBundleByHash(hash, cacheDir, parentCode, identity) {
|
|
298
|
+
return recoverHttpBundleByHashImpl(hash, cacheDir, cacheHttpModule, parentCode, identity);
|
|
294
299
|
}
|
|
295
300
|
/**
|
|
296
301
|
* Ensure all HTTP bundles exist locally before import.
|
|
297
302
|
* Delegates to bundle-recovery module with cacheHttpModule wired in.
|
|
298
303
|
*/
|
|
299
|
-
export function ensureHttpBundlesExist(bundlePaths, cacheDir) {
|
|
300
|
-
return ensureHttpBundlesExistImpl(bundlePaths, cacheDir, cacheHttpModule);
|
|
304
|
+
export function ensureHttpBundlesExist(bundlePaths, cacheDir, identity) {
|
|
305
|
+
return ensureHttpBundlesExistImpl(bundlePaths, cacheDir, cacheHttpModule, identity);
|
|
301
306
|
}
|
|
302
307
|
/**
|
|
303
308
|
* Invalidate a corrupted bundle from both local and distributed cache.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import type { BundleEntry } from "./bundle-manifest-types.js";
|
|
3
|
-
import type { HttpCacheLike } from "./http-cache-helpers.js";
|
|
3
|
+
import type { HttpCacheIdentityMetadata, HttpCacheLike } from "./http-cache-helpers.js";
|
|
4
4
|
/** Per-request accumulator for bundle metadata during cacheHttpImportsToLocal. */
|
|
5
5
|
export declare const bundleAccumulatorStorage: AsyncLocalStorage<BundleEntry[]>;
|
|
6
6
|
/** Per-request stack used to detect circular HTTP module dependencies. */
|
|
@@ -21,9 +21,9 @@ export declare function waitForInFlightFetch(promise: Promise<string | null>, ca
|
|
|
21
21
|
* Asynchronously refresh the distributed cache entry for a local bundle.
|
|
22
22
|
* This is fire-and-forget to avoid blocking the hot path.
|
|
23
23
|
*/
|
|
24
|
-
export declare function refreshDistributedCacheAsync(hash:
|
|
24
|
+
export declare function refreshDistributedCacheAsync(hash: string, code: string, _cacheDir: string, normalizedUrl: string, identityMetadata: HttpCacheIdentityMetadata, getLastDistributedRefresh: () => HttpCacheLike<string, number>): void;
|
|
25
25
|
/**
|
|
26
26
|
* Track bundle for manifest accumulation if in accumulation context.
|
|
27
27
|
*/
|
|
28
|
-
export declare function trackBundleAccumulator(hash:
|
|
28
|
+
export declare function trackBundleAccumulator(hash: string, normalizedUrl: string, cachePath: string): void;
|
|
29
29
|
//# sourceMappingURL=in-flight-manager.d.ts.map
|