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
|
@@ -6,31 +6,83 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module server/services/rsc/orchestrators/manifest-handler
|
|
8
8
|
*/
|
|
9
|
-
import { RSC_MANIFEST_CACHE_TTL_MS } from "../../../../utils/index.js";
|
|
9
|
+
import { HASH_SEED_DJB2, RSC_MANIFEST_CACHE_TTL_MS } from "../../../../utils/index.js";
|
|
10
10
|
import { buildClientManifest } from "../../../../rendering/rsc/component-analyzer.js";
|
|
11
|
+
import { appendClientModuleVersion, buildClientModuleUrl, } from "../../../../rendering/rsc/client-module-strategy.js";
|
|
11
12
|
/** TTL in seconds for external cache repository */
|
|
12
13
|
const MANIFEST_CACHE_TTL_SECONDS = Math.floor(RSC_MANIFEST_CACHE_TTL_MS / 1000);
|
|
13
14
|
/** Cache key for manifest data */
|
|
14
|
-
const MANIFEST_CACHE_KEY = "rsc-manifest";
|
|
15
15
|
export class ManifestHandler {
|
|
16
16
|
projectDir;
|
|
17
17
|
cache = null;
|
|
18
|
+
generation = 0;
|
|
19
|
+
inFlightBuild = null;
|
|
20
|
+
cacheMutation = Promise.resolve();
|
|
18
21
|
cacheRepo;
|
|
22
|
+
appDir;
|
|
23
|
+
isLocalProject;
|
|
24
|
+
cacheKey;
|
|
25
|
+
fs;
|
|
19
26
|
constructor(projectDir, options) {
|
|
20
27
|
this.projectDir = projectDir;
|
|
21
28
|
this.cacheRepo = options?.cacheRepo;
|
|
29
|
+
this.appDir = options?.appDir ?? "app";
|
|
30
|
+
this.isLocalProject = options?.isLocalProject ?? true;
|
|
31
|
+
this.fs = options?.fs;
|
|
32
|
+
this.cacheKey = [
|
|
33
|
+
"rsc-manifest",
|
|
34
|
+
this.isLocalProject ? "local" : "remote",
|
|
35
|
+
this.appDir,
|
|
36
|
+
options?.contentSourceId ?? "default",
|
|
37
|
+
].join(":");
|
|
22
38
|
}
|
|
23
39
|
async handle(clientManifest) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
while (true) {
|
|
41
|
+
const generation = this.generation;
|
|
42
|
+
await this.cacheMutation;
|
|
43
|
+
if (generation !== this.generation)
|
|
44
|
+
continue;
|
|
45
|
+
const cachedData = await this.getCachedData();
|
|
46
|
+
if (generation !== this.generation)
|
|
47
|
+
continue;
|
|
48
|
+
if (cachedData)
|
|
49
|
+
return this.createResponse(cachedData);
|
|
50
|
+
const data = await this.getOrStartBuild(clientManifest, generation);
|
|
51
|
+
if (generation !== this.generation)
|
|
52
|
+
continue;
|
|
53
|
+
return this.createResponse(data);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
getOrStartBuild(clientManifest, generation) {
|
|
57
|
+
if (this.inFlightBuild?.generation === generation)
|
|
58
|
+
return this.inFlightBuild.promise;
|
|
59
|
+
const promise = this.buildAndPublish(clientManifest, generation);
|
|
60
|
+
this.inFlightBuild = { generation, promise };
|
|
61
|
+
const clearBuild = () => {
|
|
62
|
+
if (this.inFlightBuild?.promise === promise)
|
|
63
|
+
this.inFlightBuild = null;
|
|
64
|
+
};
|
|
65
|
+
void promise.then(clearBuild, clearBuild);
|
|
66
|
+
return promise;
|
|
67
|
+
}
|
|
68
|
+
async buildAndPublish(clientManifest, generation) {
|
|
27
69
|
const data = await this.buildManifest(clientManifest);
|
|
28
|
-
|
|
29
|
-
|
|
70
|
+
if (generation !== this.generation)
|
|
71
|
+
return data;
|
|
72
|
+
await this.enqueueCacheMutation(async () => {
|
|
73
|
+
if (generation !== this.generation)
|
|
74
|
+
return;
|
|
75
|
+
await this.setCachedData(data);
|
|
76
|
+
if (generation === this.generation)
|
|
77
|
+
return;
|
|
78
|
+
this.cache = null;
|
|
79
|
+
await this.cacheRepo?.delete?.(this.cacheKey);
|
|
80
|
+
});
|
|
81
|
+
return data;
|
|
30
82
|
}
|
|
31
83
|
async getCachedData() {
|
|
32
84
|
if (this.cacheRepo) {
|
|
33
|
-
const cached = await this.cacheRepo.get(
|
|
85
|
+
const cached = await this.cacheRepo.get(this.cacheKey);
|
|
34
86
|
return cached ? JSON.parse(cached) : null;
|
|
35
87
|
}
|
|
36
88
|
if (!this.isCacheValid())
|
|
@@ -39,7 +91,7 @@ export class ManifestHandler {
|
|
|
39
91
|
}
|
|
40
92
|
async setCachedData(data) {
|
|
41
93
|
if (this.cacheRepo) {
|
|
42
|
-
await this.cacheRepo.set(
|
|
94
|
+
await this.cacheRepo.set(this.cacheKey, JSON.stringify(data), MANIFEST_CACHE_TTL_SECONDS);
|
|
43
95
|
return;
|
|
44
96
|
}
|
|
45
97
|
this.cache = { data, timestamp: Date.now() };
|
|
@@ -48,12 +100,53 @@ export class ManifestHandler {
|
|
|
48
100
|
return this.cache !== null && Date.now() - this.cache.timestamp < RSC_MANIFEST_CACHE_TTL_MS;
|
|
49
101
|
}
|
|
50
102
|
async buildManifest(clientManifest) {
|
|
51
|
-
const manifest = clientManifest ??
|
|
103
|
+
const manifest = clientManifest ??
|
|
104
|
+
(await buildClientManifest(this.projectDir, this.appDir, this.fs));
|
|
52
105
|
const components = {};
|
|
53
|
-
|
|
54
|
-
|
|
106
|
+
const modules = [];
|
|
107
|
+
const graphIds = { client: [], server: [] };
|
|
108
|
+
const contentVersions = [];
|
|
109
|
+
for (const [id, meta] of [...manifest].sort(([a], [b]) => a.localeCompare(b))) {
|
|
110
|
+
const rel = meta.rel;
|
|
111
|
+
if (!this.isLocalProject && !rel) {
|
|
112
|
+
throw new Error(`Client component ${id} is missing its project-relative module path`);
|
|
113
|
+
}
|
|
114
|
+
const moduleUrl = this.isLocalProject
|
|
115
|
+
? appendClientModuleVersion(meta.path, meta.contentHash)
|
|
116
|
+
: buildClientModuleUrl({
|
|
117
|
+
strategy: "rsc-module",
|
|
118
|
+
rel: rel,
|
|
119
|
+
version: meta.contentHash,
|
|
120
|
+
});
|
|
121
|
+
if (!moduleUrl) {
|
|
122
|
+
throw new Error(`Client component ${id} has an invalid project-relative module path`);
|
|
123
|
+
}
|
|
124
|
+
const exportName = meta.exports.includes(id)
|
|
125
|
+
? id
|
|
126
|
+
: meta.exports.includes("default")
|
|
127
|
+
? "default"
|
|
128
|
+
: meta.exports[0] ?? "default";
|
|
129
|
+
const graphRel = rel ?? meta.path;
|
|
130
|
+
contentVersions.push(`${id}:${meta.contentHash ?? ""}`);
|
|
131
|
+
components[id] = moduleUrl;
|
|
132
|
+
modules.push({
|
|
133
|
+
id,
|
|
134
|
+
clientRef: `${moduleUrl}#${exportName}`,
|
|
135
|
+
exports: meta.exports,
|
|
136
|
+
});
|
|
137
|
+
graphIds.client.push({
|
|
138
|
+
id,
|
|
139
|
+
path: this.isLocalProject ? (meta.sourcePath ?? meta.path) : graphRel,
|
|
140
|
+
rel: graphRel,
|
|
141
|
+
});
|
|
55
142
|
}
|
|
56
|
-
return {
|
|
143
|
+
return {
|
|
144
|
+
version: 1,
|
|
145
|
+
hash: hashManifest(graphIds.client, modules, contentVersions),
|
|
146
|
+
components,
|
|
147
|
+
modules,
|
|
148
|
+
graphIds,
|
|
149
|
+
};
|
|
57
150
|
}
|
|
58
151
|
createResponse(data) {
|
|
59
152
|
return new Response(JSON.stringify(data), {
|
|
@@ -65,7 +158,24 @@ export class ManifestHandler {
|
|
|
65
158
|
* Useful for testing or forcing rebuild.
|
|
66
159
|
*/
|
|
67
160
|
clearCache() {
|
|
161
|
+
this.generation++;
|
|
162
|
+
this.inFlightBuild = null;
|
|
68
163
|
this.cache = null;
|
|
69
|
-
void this.
|
|
164
|
+
void this.enqueueCacheMutation(async () => {
|
|
165
|
+
this.cache = null;
|
|
166
|
+
await this.cacheRepo?.delete?.(this.cacheKey);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
enqueueCacheMutation(operation) {
|
|
170
|
+
const mutation = this.cacheMutation.then(operation, operation);
|
|
171
|
+
this.cacheMutation = mutation.then(() => undefined, () => undefined);
|
|
172
|
+
return mutation;
|
|
70
173
|
}
|
|
71
174
|
}
|
|
175
|
+
function hashManifest(graphIds, modules, contentVersions) {
|
|
176
|
+
const bytes = new TextEncoder().encode(JSON.stringify({ graphIds, modules, contentVersions }));
|
|
177
|
+
let hash = HASH_SEED_DJB2;
|
|
178
|
+
for (const byte of bytes)
|
|
179
|
+
hash = ((hash << 5) + hash) ^ byte;
|
|
180
|
+
return (hash >>> 0).toString(16);
|
|
181
|
+
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import type { ClientModuleStrategy } from "../../../../rendering/rsc/client-module-strategy.js";
|
|
1
2
|
export declare class PageHandler {
|
|
3
|
+
private readonly isDevelopment;
|
|
4
|
+
private readonly reactVersion?;
|
|
5
|
+
private readonly clientModuleStrategy?;
|
|
6
|
+
constructor(isDevelopment?: boolean, reactVersion?: string | undefined, clientModuleStrategy?: ClientModuleStrategy | undefined);
|
|
2
7
|
handle(pathname: string, searchParams: URLSearchParams, nonce?: string): Response;
|
|
3
8
|
private buildHtml;
|
|
4
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/orchestrators/page-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/orchestrators/page-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAwBhG,qBAAa,WAAW;IAEpB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC;gBAFrB,aAAa,GAAE,OAAe,EAC9B,YAAY,CAAC,EAAE,MAAM,YAAA,EACrB,oBAAoB,CAAC,EAAE,oBAAoB,YAAA;IAG9D,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ;IAQjF,OAAO,CAAC,SAAS;CAwDlB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { buildNonceAttribute } from "../../../../html/html-escape.js";
|
|
2
2
|
import { buildTrustedHtmlValidatorScript } from "../../../../security/client/html-sanitizer.js";
|
|
3
|
+
import { HYDRATION_DATA_ID } from "../../../../rendering/rsc/constants.js";
|
|
3
4
|
/**
|
|
4
5
|
* Serialize a value as a JSON string literal that is safe to embed inside an
|
|
5
6
|
* inline HTML <script>. JSON already escapes quotes, backslashes, and control
|
|
@@ -21,6 +22,14 @@ function jsonForScript(value) {
|
|
|
21
22
|
.replace(/\u2029/g, "\\u2029");
|
|
22
23
|
}
|
|
23
24
|
export class PageHandler {
|
|
25
|
+
isDevelopment;
|
|
26
|
+
reactVersion;
|
|
27
|
+
clientModuleStrategy;
|
|
28
|
+
constructor(isDevelopment = false, reactVersion, clientModuleStrategy) {
|
|
29
|
+
this.isDevelopment = isDevelopment;
|
|
30
|
+
this.reactVersion = reactVersion;
|
|
31
|
+
this.clientModuleStrategy = clientModuleStrategy;
|
|
32
|
+
}
|
|
24
33
|
handle(pathname, searchParams, nonce) {
|
|
25
34
|
const html = this.buildHtml(pathname, searchParams, nonce);
|
|
26
35
|
return new Response(html, {
|
|
@@ -33,13 +42,19 @@ export class PageHandler {
|
|
|
33
42
|
const nonceAttr = buildNonceAttribute(nonce);
|
|
34
43
|
const renderUrlJs = jsonForScript(renderUrl);
|
|
35
44
|
const trustedHtmlValidatorScript = buildTrustedHtmlValidatorScript();
|
|
45
|
+
const hydrationData = jsonForScript({
|
|
46
|
+
clientModuleStrategy: this.clientModuleStrategy,
|
|
47
|
+
dev: this.isDevelopment,
|
|
48
|
+
reactVersion: this.reactVersion,
|
|
49
|
+
});
|
|
36
50
|
return `<!DOCTYPE html>
|
|
37
51
|
<html lang="en">
|
|
38
52
|
<head>
|
|
39
53
|
<meta charset="UTF-8"/>
|
|
40
54
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
41
55
|
<title>Veryfront RSC</title>
|
|
42
|
-
<script${
|
|
56
|
+
<script id="${HYDRATION_DATA_ID}" type="application/json"${nonceAttr}>${hydrationData}</script>
|
|
57
|
+
<script${nonceAttr}>window.__VERYFRONT_DEV__ = ${this.isDevelopment};</script>
|
|
43
58
|
</head>
|
|
44
59
|
<body>
|
|
45
60
|
<div id="rsc-root"></div>
|
|
@@ -61,7 +76,6 @@ export class PageHandler {
|
|
|
61
76
|
const renderUrl = ${renderUrlJs};
|
|
62
77
|
const payload =
|
|
63
78
|
(await fetchPayload(renderUrl)) ??
|
|
64
|
-
(await fetchPayload('/_veryfront/rsc/payload')) ??
|
|
65
79
|
{ html: '<p>RSC unavailable</p>', clientRefs: [] };
|
|
66
80
|
|
|
67
81
|
const safeHtml = validateTrustedHtml(String(payload.html || ''));
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import type { RSCRenderer } from "../../../../rendering/rsc/server-renderer/index.js";
|
|
2
|
+
import type { RuntimeAdapter } from "../../../../platform/adapters/base.js";
|
|
3
|
+
interface RenderHandlerModuleOptions {
|
|
4
|
+
adapter?: RuntimeAdapter;
|
|
5
|
+
projectId?: string;
|
|
6
|
+
projectSlug?: string;
|
|
7
|
+
contentSourceId?: string;
|
|
8
|
+
reactVersion?: Promise<string>;
|
|
9
|
+
}
|
|
2
10
|
export declare class RenderHandler {
|
|
3
11
|
private projectDir;
|
|
4
12
|
private getRenderer;
|
|
5
|
-
private
|
|
6
|
-
|
|
13
|
+
private mode;
|
|
14
|
+
private appDir;
|
|
15
|
+
private moduleOptions;
|
|
16
|
+
constructor(projectDir: string, getRenderer: () => RSCRenderer | null, mode?: "development" | "production", appDir?: string, moduleOptions?: RenderHandlerModuleOptions);
|
|
7
17
|
handle(pathname: string, searchParams: URLSearchParams, request?: Request): Promise<Response>;
|
|
8
18
|
private loadComponent;
|
|
19
|
+
private loadComponentModule;
|
|
9
20
|
private buildProps;
|
|
10
21
|
private renderPayload;
|
|
11
22
|
private createResponse;
|
|
@@ -13,4 +24,5 @@ export declare class RenderHandler {
|
|
|
13
24
|
private buildHeaders;
|
|
14
25
|
private createErrorResponse;
|
|
15
26
|
}
|
|
27
|
+
export {};
|
|
16
28
|
//# sourceMappingURL=render-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/orchestrators/render-handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAC;
|
|
1
|
+
{"version":3,"file":"render-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/orchestrators/render-handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAC;AAQtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAM5E,UAAU,0BAA0B;IAClC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAChC;AASD,qBAAa,aAAa;IAEtB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,aAAa;gBAJb,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,WAAW,GAAG,IAAI,EACrC,IAAI,GAAE,aAAa,GAAG,YAA2B,EACjD,MAAM,GAAE,MAAc,EACtB,aAAa,GAAE,0BAA+B;IAGlD,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,eAAe,EAC7B,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,QAAQ,CAAC;YAWN,aAAa;YA+Bb,mBAAmB;IA2CjC,OAAO,CAAC,UAAU;YAOJ,aAAa;IA2B3B,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,mBAAmB;CA6B5B"}
|
|
@@ -5,15 +5,27 @@ import { COMPONENT_ERROR, PAGE_NOT_FOUND, RENDER_ERROR } from "../../../../error
|
|
|
5
5
|
import { createErrorResponse } from "../../../../errors/http-error.js";
|
|
6
6
|
import { wrapUnknownError } from "../../../../errors/middleware/wrap-unknown.js";
|
|
7
7
|
import { extractParams, resolveComponentPath } from "./component-resolver.js";
|
|
8
|
+
import { createFileSystem } from "../../../../platform/compat/fs.js";
|
|
9
|
+
import { loadModuleFromSource } from "../../../../modules/react-loader/index.js";
|
|
10
|
+
import { compileContent, extractFrontmatter } from "../../../../transforms/mdx/compiler/index.js";
|
|
11
|
+
import { mdxRenderer } from "../../../../transforms/mdx/index.js";
|
|
8
12
|
const logger = serverLogger.component("rsc");
|
|
13
|
+
const fs = createFileSystem();
|
|
14
|
+
function isContentComponent(componentPath) {
|
|
15
|
+
return /\.(?:md|mdx)$/i.test(componentPath);
|
|
16
|
+
}
|
|
9
17
|
export class RenderHandler {
|
|
10
18
|
projectDir;
|
|
11
19
|
getRenderer;
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
mode;
|
|
21
|
+
appDir;
|
|
22
|
+
moduleOptions;
|
|
23
|
+
constructor(projectDir, getRenderer, mode = "production", appDir = "app", moduleOptions = {}) {
|
|
14
24
|
this.projectDir = projectDir;
|
|
15
25
|
this.getRenderer = getRenderer;
|
|
16
|
-
this.
|
|
26
|
+
this.mode = mode;
|
|
27
|
+
this.appDir = appDir;
|
|
28
|
+
this.moduleOptions = moduleOptions;
|
|
17
29
|
}
|
|
18
30
|
async handle(pathname, searchParams, request) {
|
|
19
31
|
try {
|
|
@@ -27,14 +39,14 @@ export class RenderHandler {
|
|
|
27
39
|
}
|
|
28
40
|
}
|
|
29
41
|
async loadComponent(pathname) {
|
|
30
|
-
const componentPath = await resolveComponentPath(pathname, this.projectDir);
|
|
42
|
+
const componentPath = await resolveComponentPath(pathname, this.projectDir, this.moduleOptions.adapter?.fs, this.appDir);
|
|
31
43
|
if (!componentPath) {
|
|
32
44
|
throw toError(createError({
|
|
33
45
|
type: "render",
|
|
34
46
|
message: "Component not found",
|
|
35
47
|
}));
|
|
36
48
|
}
|
|
37
|
-
const module =
|
|
49
|
+
const module = await this.loadComponentModule(componentPath);
|
|
38
50
|
const Component = (module.default ?? module.Page ?? module);
|
|
39
51
|
if (typeof Component !== "function") {
|
|
40
52
|
throw toError(createError({
|
|
@@ -44,6 +56,29 @@ export class RenderHandler {
|
|
|
44
56
|
}
|
|
45
57
|
return Component;
|
|
46
58
|
}
|
|
59
|
+
async loadComponentModule(componentPath) {
|
|
60
|
+
const adapter = this.moduleOptions.adapter;
|
|
61
|
+
if (isContentComponent(componentPath)) {
|
|
62
|
+
const source = adapter
|
|
63
|
+
? await adapter.fs.readFile(componentPath)
|
|
64
|
+
: await fs.readTextFile(componentPath);
|
|
65
|
+
const { body, frontmatter } = extractFrontmatter(source);
|
|
66
|
+
const compiled = await compileContent(this.mode, this.projectDir, body, frontmatter, componentPath, "server");
|
|
67
|
+
return await mdxRenderer.loadModuleESM(compiled.compiledCode, adapter, this.moduleOptions.projectId ?? this.projectDir, this.projectDir, this.moduleOptions.projectSlug, this.moduleOptions.contentSourceId, await this.moduleOptions.reactVersion);
|
|
68
|
+
}
|
|
69
|
+
if (!adapter) {
|
|
70
|
+
return (await import(componentPath));
|
|
71
|
+
}
|
|
72
|
+
const source = await adapter.fs.readFile(componentPath);
|
|
73
|
+
return await loadModuleFromSource(source, componentPath, this.projectDir, adapter, {
|
|
74
|
+
projectId: this.moduleOptions.projectId ?? this.projectDir,
|
|
75
|
+
projectSlug: this.moduleOptions.projectSlug,
|
|
76
|
+
contentSourceId: this.moduleOptions.contentSourceId,
|
|
77
|
+
dev: this.mode === "development",
|
|
78
|
+
mode: this.mode === "development" ? "preview" : "production",
|
|
79
|
+
reactVersion: await this.moduleOptions.reactVersion,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
47
82
|
buildProps(pathname, searchParams) {
|
|
48
83
|
return {
|
|
49
84
|
params: extractParams(pathname),
|
|
@@ -65,7 +100,7 @@ export class RenderHandler {
|
|
|
65
100
|
message: "Failed to render RSC payload",
|
|
66
101
|
}));
|
|
67
102
|
}
|
|
68
|
-
return this.
|
|
103
|
+
return this.mode === "development" ? payload : RSCProductionOptimizer.optimizePayload(payload);
|
|
69
104
|
}
|
|
70
105
|
createResponse(payload, request) {
|
|
71
106
|
const etag = RSCProductionOptimizer.generateETag(payload);
|
|
@@ -80,7 +115,7 @@ export class RenderHandler {
|
|
|
80
115
|
return RSCProductionOptimizer.checkETag(request.headers.get("if-none-match"), etag);
|
|
81
116
|
}
|
|
82
117
|
buildHeaders(etag) {
|
|
83
|
-
const isProd =
|
|
118
|
+
const isProd = this.mode === "production";
|
|
84
119
|
const headers = {
|
|
85
120
|
"content-type": "application/json",
|
|
86
121
|
etag,
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import type { ClientComponentMeta } from "../../../../rendering/rsc/types.js";
|
|
2
2
|
export interface ManifestData {
|
|
3
|
+
version: 1;
|
|
4
|
+
hash: string;
|
|
3
5
|
components: Record<string, string>;
|
|
6
|
+
modules: Array<{
|
|
7
|
+
id: string;
|
|
8
|
+
clientRef: string;
|
|
9
|
+
exports: string[];
|
|
10
|
+
}>;
|
|
11
|
+
graphIds: {
|
|
12
|
+
client: Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
path: string;
|
|
15
|
+
rel: string;
|
|
16
|
+
}>;
|
|
17
|
+
server: Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
path: string;
|
|
20
|
+
rel: string;
|
|
21
|
+
}>;
|
|
22
|
+
};
|
|
4
23
|
}
|
|
5
24
|
export interface ManifestCacheEntry {
|
|
6
25
|
data: ManifestData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/orchestrators/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/services/rsc/orchestrators/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACrE,QAAQ,EAAE;QACR,MAAM,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACzD,MAAM,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC1D,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;CACpC;AAED,MAAM,WAAW,WAAY,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface BrowserModuleBuildCoordinatorOptions {
|
|
2
|
+
maxEntries?: number;
|
|
3
|
+
maxBytes?: number;
|
|
4
|
+
globalLimit?: number;
|
|
5
|
+
perProjectLimit?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface BrowserModuleBuildRequest<T> {
|
|
8
|
+
cacheKey: string;
|
|
9
|
+
projectKey: string;
|
|
10
|
+
build: () => Promise<T>;
|
|
11
|
+
validate: (value: T) => Promise<boolean>;
|
|
12
|
+
sizeOf: (value: T) => number;
|
|
13
|
+
}
|
|
14
|
+
export interface BrowserModuleBuildResult<T> {
|
|
15
|
+
value: T;
|
|
16
|
+
status: "hit" | "miss" | "shared";
|
|
17
|
+
}
|
|
18
|
+
export declare class BrowserModuleCapacityError extends Error {
|
|
19
|
+
readonly name = "BrowserModuleCapacityError";
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Coordinates expensive browser-module builds without an unbounded wait queue.
|
|
24
|
+
* Map insertion order provides deterministic least-recently-used eviction.
|
|
25
|
+
*/
|
|
26
|
+
export declare class BrowserModuleBuildCoordinator<T> {
|
|
27
|
+
#private;
|
|
28
|
+
constructor(options?: BrowserModuleBuildCoordinatorOptions);
|
|
29
|
+
getOrBuild(request: BrowserModuleBuildRequest<T>): Promise<BrowserModuleBuildResult<T>>;
|
|
30
|
+
resetForTesting(): void;
|
|
31
|
+
getStatsForTesting(): {
|
|
32
|
+
cacheEntries: number;
|
|
33
|
+
cacheBytes: number;
|
|
34
|
+
inFlight: number;
|
|
35
|
+
activeGlobal: number;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=browser-module-availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-module-availability.d.ts","sourceRoot":"","sources":["../../../../src/src/server/shared/browser-module-availability.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oCAAoC;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC;IACT,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;CACnC;AAYD,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,SAAkB,IAAI,gCAAgC;;CAKvD;AAED;;;GAGG;AACH,qBAAa,6BAA6B,CAAC,CAAC;;gBAY9B,OAAO,GAAE,oCAAyC;IAUxD,UAAU,CACd,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACpC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IA6EvC,eAAe,IAAI,IAAI;IASvB,kBAAkB,IAAI;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;KACtB;CAgCF"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
const DEFAULT_MAX_ENTRIES = 64;
|
|
2
|
+
const DEFAULT_MAX_BYTES = 8 * 1024 * 1024;
|
|
3
|
+
const DEFAULT_GLOBAL_LIMIT = 8;
|
|
4
|
+
const DEFAULT_PER_PROJECT_LIMIT = 2;
|
|
5
|
+
export class BrowserModuleCapacityError extends Error {
|
|
6
|
+
name = "BrowserModuleCapacityError";
|
|
7
|
+
constructor() {
|
|
8
|
+
super("Browser module build capacity is exhausted");
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Coordinates expensive browser-module builds without an unbounded wait queue.
|
|
13
|
+
* Map insertion order provides deterministic least-recently-used eviction.
|
|
14
|
+
*/
|
|
15
|
+
export class BrowserModuleBuildCoordinator {
|
|
16
|
+
#maxEntries;
|
|
17
|
+
#maxBytes;
|
|
18
|
+
#globalLimit;
|
|
19
|
+
#perProjectLimit;
|
|
20
|
+
#cache = new Map();
|
|
21
|
+
#inFlight = new Map();
|
|
22
|
+
#activeByProject = new Map();
|
|
23
|
+
#cacheBytes = 0;
|
|
24
|
+
#activeGlobal = 0;
|
|
25
|
+
#generation = 0;
|
|
26
|
+
constructor(options = {}) {
|
|
27
|
+
this.#maxEntries = positiveInteger(options.maxEntries, DEFAULT_MAX_ENTRIES);
|
|
28
|
+
this.#maxBytes = positiveInteger(options.maxBytes, DEFAULT_MAX_BYTES);
|
|
29
|
+
this.#globalLimit = positiveInteger(options.globalLimit, DEFAULT_GLOBAL_LIMIT);
|
|
30
|
+
this.#perProjectLimit = positiveInteger(options.perProjectLimit, DEFAULT_PER_PROJECT_LIMIT);
|
|
31
|
+
}
|
|
32
|
+
async getOrBuild(request) {
|
|
33
|
+
const existingOperation = this.#inFlight.get(request.cacheKey);
|
|
34
|
+
if (existingOperation) {
|
|
35
|
+
return { value: (await existingOperation).value, status: "shared" };
|
|
36
|
+
}
|
|
37
|
+
const projectActive = this.#activeByProject.get(request.projectKey) ?? 0;
|
|
38
|
+
if (this.#activeGlobal >= this.#globalLimit ||
|
|
39
|
+
projectActive >= this.#perProjectLimit) {
|
|
40
|
+
throw new BrowserModuleCapacityError();
|
|
41
|
+
}
|
|
42
|
+
this.#activeGlobal++;
|
|
43
|
+
this.#activeByProject.set(request.projectKey, projectActive + 1);
|
|
44
|
+
const generation = this.#generation;
|
|
45
|
+
const operation = this.#validateOrBuild(request, generation);
|
|
46
|
+
this.#inFlight.set(request.cacheKey, operation);
|
|
47
|
+
try {
|
|
48
|
+
return await operation;
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
if (Object.is(this.#inFlight.get(request.cacheKey), operation)) {
|
|
52
|
+
this.#inFlight.delete(request.cacheKey);
|
|
53
|
+
}
|
|
54
|
+
if (generation === this.#generation) {
|
|
55
|
+
this.#activeGlobal = Math.max(0, this.#activeGlobal - 1);
|
|
56
|
+
const remaining = (this.#activeByProject.get(request.projectKey) ?? 1) - 1;
|
|
57
|
+
if (remaining > 0)
|
|
58
|
+
this.#activeByProject.set(request.projectKey, remaining);
|
|
59
|
+
else
|
|
60
|
+
this.#activeByProject.delete(request.projectKey);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async #validateOrBuild(request, generation) {
|
|
65
|
+
while (generation === this.#generation) {
|
|
66
|
+
const cached = this.#cache.get(request.cacheKey);
|
|
67
|
+
if (!cached)
|
|
68
|
+
break;
|
|
69
|
+
let valid = false;
|
|
70
|
+
try {
|
|
71
|
+
valid = await request.validate(cached.value);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
valid = false;
|
|
75
|
+
}
|
|
76
|
+
if (generation !== this.#generation) {
|
|
77
|
+
return this.getOrBuild(request);
|
|
78
|
+
}
|
|
79
|
+
if (this.#cache.get(request.cacheKey) !== cached) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (valid) {
|
|
83
|
+
this.#cache.delete(request.cacheKey);
|
|
84
|
+
this.#cache.set(request.cacheKey, cached);
|
|
85
|
+
return { value: cached.value, status: "hit" };
|
|
86
|
+
}
|
|
87
|
+
this.#removeCached(request.cacheKey);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
if (generation !== this.#generation) {
|
|
91
|
+
return this.getOrBuild(request);
|
|
92
|
+
}
|
|
93
|
+
const value = await request.build();
|
|
94
|
+
if (generation === this.#generation) {
|
|
95
|
+
this.#store(request.cacheKey, value, request.sizeOf(value));
|
|
96
|
+
}
|
|
97
|
+
return { value, status: "miss" };
|
|
98
|
+
}
|
|
99
|
+
resetForTesting() {
|
|
100
|
+
this.#generation++;
|
|
101
|
+
this.#cache.clear();
|
|
102
|
+
this.#inFlight.clear();
|
|
103
|
+
this.#activeByProject.clear();
|
|
104
|
+
this.#cacheBytes = 0;
|
|
105
|
+
this.#activeGlobal = 0;
|
|
106
|
+
}
|
|
107
|
+
getStatsForTesting() {
|
|
108
|
+
return {
|
|
109
|
+
cacheEntries: this.#cache.size,
|
|
110
|
+
cacheBytes: this.#cacheBytes,
|
|
111
|
+
inFlight: this.#inFlight.size,
|
|
112
|
+
activeGlobal: this.#activeGlobal,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
#store(cacheKey, value, rawSize) {
|
|
116
|
+
const size = Number.isFinite(rawSize) ? Math.max(0, Math.ceil(rawSize)) : Infinity;
|
|
117
|
+
this.#removeCached(cacheKey);
|
|
118
|
+
if (size > this.#maxBytes)
|
|
119
|
+
return;
|
|
120
|
+
this.#cache.set(cacheKey, { value, size });
|
|
121
|
+
this.#cacheBytes += size;
|
|
122
|
+
while (this.#cache.size > this.#maxEntries ||
|
|
123
|
+
this.#cacheBytes > this.#maxBytes) {
|
|
124
|
+
const oldestKey = this.#cache.keys().next().value;
|
|
125
|
+
if (oldestKey === undefined)
|
|
126
|
+
break;
|
|
127
|
+
this.#removeCached(oldestKey);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
#removeCached(cacheKey) {
|
|
131
|
+
const existing = this.#cache.get(cacheKey);
|
|
132
|
+
if (!existing)
|
|
133
|
+
return;
|
|
134
|
+
this.#cache.delete(cacheKey);
|
|
135
|
+
this.#cacheBytes = Math.max(0, this.#cacheBytes - existing.size);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function positiveInteger(value, fallback) {
|
|
139
|
+
return Number.isSafeInteger(value) && (value ?? 0) > 0 ? value : fallback;
|
|
140
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type BrowserModuleBoundaryViolation = {
|
|
2
|
+
kind: "conflicting";
|
|
3
|
+
} | {
|
|
4
|
+
kind: "module-server";
|
|
5
|
+
} | {
|
|
6
|
+
kind: "function-server";
|
|
7
|
+
} | {
|
|
8
|
+
kind: "parse-error";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Find server-only boundaries that cannot be emitted in a browser bundle.
|
|
12
|
+
* Function directive semantics belong to the active parser implementation so
|
|
13
|
+
* this check does not depend on one provider's AST shape. Syntax or parser
|
|
14
|
+
* capabilities that cannot be analyzed fail closed.
|
|
15
|
+
*/
|
|
16
|
+
export declare function inspectBrowserModuleBoundary(source: string, path: string): Promise<BrowserModuleBoundaryViolation | null>;
|
|
17
|
+
export declare function describeBrowserModuleBoundaryViolation(violation: BrowserModuleBoundaryViolation): string;
|
|
18
|
+
//# sourceMappingURL=browser-module-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-module-boundary.d.ts","sourceRoot":"","sources":["../../../../src/src/server/shared/browser-module-boundary.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,8BAA8B,GACtC;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,GAC3B;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAE5B;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,8BAA8B,GAAG,IAAI,CAAC,CAsBhD;AAED,wBAAgB,sCAAsC,CACpD,SAAS,EAAE,8BAA8B,GACxC,MAAM,CAWR"}
|