veryfront 0.0.84 → 0.0.88
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/README.md +18 -44
- package/esm/deno.d.ts +0 -1
- package/esm/deno.js +8 -9
- package/esm/deps/esm.sh/react-dom@19.1.1/client.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/client.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/client.js +5 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/server.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/server.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.1.1/server.js +5 -0
- package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts +2 -0
- package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts.map +1 -0
- package/esm/deps/esm.sh/react@19.1.1/jsx-runtime.js +3 -0
- package/esm/deps/esm.sh/react@19.1.1.d.ts +2 -0
- package/esm/deps/esm.sh/react@19.1.1.d.ts.map +1 -0
- package/esm/deps/esm.sh/react@19.1.1.js +3 -0
- package/esm/deps/esm.sh/scheduler@^0.26.0.d.ts +2 -0
- package/esm/deps/esm.sh/scheduler@^0.26.0.d.ts.map +1 -0
- package/esm/deps/esm.sh/scheduler@^0.26.0.js +3 -0
- package/esm/proxy/main.d.ts +2 -0
- package/esm/proxy/main.d.ts.map +1 -0
- package/esm/proxy/main.js +400 -0
- package/esm/src/agent/react/use-agent.js +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +1 -1
- 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/cli/app/components/list-select.js +2 -2
- package/esm/src/cli/app/index.d.ts +1 -1
- package/esm/src/cli/app/index.d.ts.map +1 -1
- package/esm/src/cli/app/index.js +26 -33
- package/esm/src/cli/app/state.d.ts +3 -0
- package/esm/src/cli/app/state.d.ts.map +1 -1
- package/esm/src/cli/app/state.js +4 -0
- package/esm/src/cli/app/views/dashboard.d.ts.map +1 -1
- package/esm/src/cli/app/views/dashboard.js +45 -57
- package/esm/src/cli/app/views/startup.d.ts +39 -0
- package/esm/src/cli/app/views/startup.d.ts.map +1 -0
- package/esm/src/cli/app/views/startup.js +103 -0
- package/esm/src/cli/commands/init/config-generator.js +1 -1
- package/esm/src/cli/index/arg-parser.d.ts.map +1 -1
- package/esm/src/cli/index/arg-parser.js +1 -0
- package/esm/src/cli/index/command-router.d.ts.map +1 -1
- package/esm/src/cli/index/command-router.js +54 -39
- package/esm/src/cli/index/types.d.ts +4 -0
- package/esm/src/cli/index/types.d.ts.map +1 -1
- package/esm/src/cli/mcp/advanced-tools.d.ts +2 -2
- package/esm/src/cli/ui/colors.d.ts +8 -0
- package/esm/src/cli/ui/colors.d.ts.map +1 -1
- package/esm/src/cli/ui/colors.js +34 -0
- package/esm/src/cli/ui/dot-matrix.d.ts +8 -0
- package/esm/src/cli/ui/dot-matrix.d.ts.map +1 -1
- package/esm/src/cli/ui/dot-matrix.js +67 -2
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +5 -4
- package/esm/src/html/utils.js +2 -2
- 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/import-map/default-import-map.d.ts +1 -11
- package/esm/src/modules/import-map/default-import-map.d.ts.map +1 -1
- package/esm/src/modules/import-map/default-import-map.js +3 -20
- package/esm/src/modules/import-map/loader.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.js +7 -22
- package/esm/src/modules/import-map/resolver.d.ts.map +1 -1
- package/esm/src/modules/import-map/resolver.js +12 -8
- 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/component-loader.js +2 -0
- 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/loader.d.ts +2 -7
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +68 -38
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts +2 -0
- package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts.map +1 -1
- package/esm/src/modules/react-loader/types.d.ts +3 -1
- package/esm/src/modules/react-loader/types.d.ts.map +1 -1
- package/esm/src/modules/react-loader/unified-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/unified-loader.js +7 -4
- package/esm/src/modules/server/module-batch-handler.d.ts +2 -0
- package/esm/src/modules/server/module-batch-handler.d.ts.map +1 -1
- package/esm/src/modules/server/module-batch-handler.js +3 -1
- package/esm/src/modules/server/module-server.d.ts +2 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +4 -2
- package/esm/src/modules/server/ssr-import-rewriter.d.ts.map +1 -1
- package/esm/src/modules/server/ssr-import-rewriter.js +9 -17
- 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/server-loader.d.ts +5 -5
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/server-loader.js +2 -2
- 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/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 +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/Head.d.ts +1 -1
- package/esm/src/react/components/Head.d.ts.map +1 -1
- package/esm/src/react/components/Head.js +7 -3
- 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/Link.d.ts +1 -1
- package/esm/src/react/components/Link.d.ts.map +1 -1
- package/esm/src/react/components/Link.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 +2 -2
- 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/ai/agent-card.d.ts +2 -2
- package/esm/src/react/components/ai/agent-card.d.ts.map +1 -1
- package/esm/src/react/components/ai/agent-card.js +1 -1
- package/esm/src/react/components/ai/chat/components/animations.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/animations.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/animations.js +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/empty-state.js +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/message-actions.js +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/reasoning.js +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.d.ts +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/tool-ui.js +1 -1
- package/esm/src/react/components/ai/chat/composition/api.d.ts +5 -4
- package/esm/src/react/components/ai/chat/composition/api.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/composition/api.js +1 -1
- package/esm/src/react/components/ai/chat/index.d.ts +8 -3
- package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/index.js +1 -1
- package/esm/src/react/components/ai/error-boundary.d.ts +1 -1
- package/esm/src/react/components/ai/error-boundary.d.ts.map +1 -1
- package/esm/src/react/components/ai/error-boundary.js +1 -1
- package/esm/src/react/components/ai/icons/index.d.ts +1 -1
- package/esm/src/react/components/ai/icons/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/icons/index.js +1 -1
- package/esm/src/react/components/ai/markdown.d.ts +1 -1
- package/esm/src/react/components/ai/markdown.d.ts.map +1 -1
- package/esm/src/react/components/ai/markdown.js +1 -1
- package/esm/src/react/components/ai/message.d.ts +3 -3
- package/esm/src/react/components/ai/message.d.ts.map +1 -1
- package/esm/src/react/components/ai/message.js +1 -1
- 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/context/index.d.ts +1 -1
- package/esm/src/react/context/index.d.ts.map +1 -1
- package/esm/src/react/context/index.js +1 -1
- 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 +7 -3
- 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/router/index.d.ts +1 -1
- package/esm/src/react/router/index.d.ts.map +1 -1
- package/esm/src/react/router/index.js +1 -1
- package/esm/src/rendering/app-reserved.d.ts +1 -1
- package/esm/src/rendering/app-reserved.d.ts.map +1 -1
- package/esm/src/rendering/app-reserved.js +1 -1
- package/esm/src/rendering/client/router.js +1 -1
- package/esm/src/rendering/client/state-bridge.d.ts +1 -1
- package/esm/src/rendering/client/state-bridge.d.ts.map +1 -1
- package/esm/src/rendering/client/state-bridge.js +1 -1
- package/esm/src/rendering/component-handling.d.ts +3 -1
- package/esm/src/rendering/component-handling.d.ts.map +1 -1
- package/esm/src/rendering/component-handling.js +4 -2
- 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/layouts/layout-applicator.d.ts +1 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.js +2 -0
- package/esm/src/rendering/layouts/utils/applicator.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.d.ts +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- 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/layout.d.ts +1 -1
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +3 -0
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +74 -19
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +2 -0
- 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/page-renderer.d.ts +1 -1
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.d.ts +1 -1
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- 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/rsc-renderer.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/tree-processor.js +4 -2
- 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-renderer.d.ts +1 -1
- package/esm/src/rendering/ssr-renderer.d.ts.map +1 -1
- 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/server/handlers/request/ssr/error-page-fallback.js +1 -1
- package/esm/src/server/handlers/request/ssr/not-found-fallback.js +1 -1
- package/esm/src/transforms/esm/http-bundler.d.ts +15 -4
- package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-bundler.js +105 -12
- package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache.js +51 -44
- package/esm/src/transforms/esm/import-rewriter.d.ts.map +1 -1
- package/esm/src/transforms/esm/import-rewriter.js +3 -3
- package/esm/src/transforms/esm/package-registry.d.ts +15 -13
- package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
- package/esm/src/transforms/esm/package-registry.js +45 -32
- package/esm/src/transforms/esm/react-imports.d.ts.map +1 -1
- package/esm/src/transforms/esm/react-imports.js +3 -7
- package/esm/src/transforms/esm/types.d.ts +2 -0
- package/esm/src/transforms/esm/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts +14 -0
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +67 -0
- package/esm/src/transforms/mdx/esm-module-loader/loader.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +4 -0
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.d.ts +1 -1
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +1 -1
- 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/context.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.js +7 -15
- package/esm/src/transforms/pipeline/stages/finalize.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/finalize.js +1 -1
- package/esm/src/types/app.d.ts +1 -1
- package/esm/src/types/app.d.ts.map +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 +1 -1
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/utils/constants/cdn.d.ts.map +1 -1
- package/esm/src/utils/constants/cdn.js +22 -11
- package/esm/src/utils/hash-utils.d.ts +2 -0
- package/esm/src/utils/hash-utils.d.ts.map +1 -1
- package/esm/src/utils/hash-utils.js +4 -0
- 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 +2 -1
- package/src/deno.js +8 -9
- package/src/deps/esm.sh/@types/react-dom@19.1.11/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/client.d.ts +105 -0
- package/src/deps/esm.sh/@types/react-dom@19.1.11/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/server.d.ts +162 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjM/global.d.ts +165 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjM/index.d.ts +4267 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/global.d.ts +165 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/index.d.ts +4267 -0
- package/src/deps/esm.sh/@types/react@19.1.17/X-ZGNzc3R5cGVAMy4yLjMKZXJlYWN0/jsx-runtime.d.ts +36 -0
- package/src/deps/esm.sh/@types/scheduler@0.26.0/index.d.ts +30 -0
- package/src/deps/esm.sh/csstype@3.2.3/index.d.ts +22569 -0
- package/src/deps/esm.sh/react-dom@19.1.1/client.d.ts +105 -0
- package/src/deps/esm.sh/react-dom@19.1.1/client.js +5 -0
- package/src/deps/esm.sh/react-dom@19.1.1/server.d.ts +162 -0
- package/src/deps/esm.sh/react-dom@19.1.1/server.js +5 -0
- package/src/deps/esm.sh/react@19.1.1/jsx-runtime.d.ts +36 -0
- package/src/deps/esm.sh/react@19.1.1/jsx-runtime.js +3 -0
- package/src/deps/esm.sh/react@19.1.1.d.ts +4267 -0
- package/src/deps/esm.sh/react@19.1.1.js +3 -0
- package/src/deps/esm.sh/scheduler@^0.26.0.d.ts +30 -0
- package/src/deps/esm.sh/scheduler@^0.26.0.js +3 -0
- package/src/proxy/main.ts +471 -0
- package/src/src/agent/react/use-agent.ts +1 -1
- package/src/src/agent/react/use-chat/use-chat.ts +1 -1
- package/src/src/agent/react/use-completion.ts +1 -1
- package/src/src/agent/react/use-streaming.ts +1 -1
- package/src/src/agent/react/use-voice-input.ts +1 -1
- package/src/src/cli/app/components/list-select.ts +2 -2
- package/src/src/cli/app/index.ts +34 -35
- package/src/src/cli/app/state.ts +7 -0
- package/src/src/cli/app/views/dashboard.ts +46 -60
- package/src/src/cli/app/views/startup.ts +132 -0
- package/src/src/cli/commands/init/config-generator.ts +1 -1
- package/src/src/cli/index/arg-parser.ts +1 -0
- package/src/src/cli/index/command-router.ts +57 -40
- package/src/src/cli/index/types.ts +5 -0
- package/src/src/cli/ui/colors.ts +37 -0
- package/src/src/cli/ui/dot-matrix.ts +77 -1
- package/src/src/config/loader.ts +5 -4
- package/src/src/html/utils.ts +2 -2
- package/src/src/modules/component-registry/registry.ts +1 -1
- package/src/src/modules/import-map/default-import-map.ts +3 -25
- package/src/src/modules/import-map/loader.ts +7 -23
- package/src/src/modules/import-map/resolver.ts +13 -8
- package/src/src/modules/react-loader/component-loader.ts +3 -1
- package/src/src/modules/react-loader/extract-component.ts +1 -1
- package/src/src/modules/react-loader/ssr-module-loader/loader.ts +95 -68
- package/src/src/modules/react-loader/ssr-module-loader/types.ts +2 -0
- package/src/src/modules/react-loader/types.ts +3 -1
- package/src/src/modules/react-loader/unified-loader.ts +7 -4
- package/src/src/modules/server/module-batch-handler.ts +7 -0
- package/src/src/modules/server/module-server.ts +6 -1
- package/src/src/modules/server/ssr-import-rewriter.ts +9 -17
- package/src/src/react/compat/hooks-adapter.ts +1 -1
- package/src/src/react/compat/ssr-adapter/response-builder.ts +1 -1
- package/src/src/react/compat/ssr-adapter/server-loader.ts +10 -10
- package/src/src/react/compat/ssr-adapter/stream-renderer.ts +2 -2
- package/src/src/react/compat/ssr-adapter/string-renderer.ts +3 -3
- package/src/src/react/compat/version-detector/feature-detector.ts +1 -1
- package/src/src/react/components/AppWrapper.tsx +1 -1
- package/src/src/react/components/Head.tsx +7 -3
- package/src/src/react/components/LayoutComponent.tsx +2 -2
- package/src/src/react/components/Link.tsx +1 -1
- package/src/src/react/components/MDXProvider.tsx +2 -2
- package/src/src/react/components/ProviderComponent.tsx +2 -2
- package/src/src/react/components/ai/agent-card.tsx +1 -1
- package/src/src/react/components/ai/chat/components/animations.tsx +1 -1
- package/src/src/react/components/ai/chat/components/empty-state.tsx +1 -1
- package/src/src/react/components/ai/chat/components/message-actions.tsx +1 -1
- package/src/src/react/components/ai/chat/components/reasoning.tsx +1 -1
- package/src/src/react/components/ai/chat/components/tool-ui.tsx +1 -1
- package/src/src/react/components/ai/chat/composition/api.tsx +1 -1
- package/src/src/react/components/ai/chat/index.tsx +1 -1
- package/src/src/react/components/ai/error-boundary.tsx +1 -1
- package/src/src/react/components/ai/icons/index.ts +1 -1
- package/src/src/react/components/ai/markdown.tsx +1 -1
- package/src/src/react/components/ai/message.tsx +1 -1
- package/src/src/react/components/optimized-image/OptimizedBackgroundImage.tsx +1 -1
- package/src/src/react/components/optimized-image/OptimizedImage.tsx +1 -1
- package/src/src/react/components/optimized-image/SimpleOptimizedImage.tsx +1 -1
- package/src/src/react/components/optimized-image/utils.tsx +1 -1
- package/src/src/react/context/index.ts +1 -1
- package/src/src/react/fonts/index.ts +1 -1
- package/src/src/react/primitives/agent-primitives.tsx +1 -1
- package/src/src/react/primitives/chat-container.tsx +1 -1
- package/src/src/react/primitives/input-box.tsx +5 -3
- package/src/src/react/primitives/message-list.tsx +1 -1
- package/src/src/react/primitives/tool-primitives.tsx +1 -1
- package/src/src/react/router/index.ts +1 -1
- package/src/src/rendering/app-reserved.ts +1 -1
- package/src/src/rendering/client/router.ts +2 -2
- package/src/src/rendering/client/state-bridge.ts +2 -2
- package/src/src/rendering/component-handling.ts +7 -1
- package/src/src/rendering/element-validator/element-inspector.ts +1 -1
- package/src/src/rendering/element-validator/element-normalizer.ts +1 -1
- package/src/src/rendering/element-validator/primitive-checks.ts +1 -1
- package/src/src/rendering/element-validator/validator-core.ts +1 -1
- package/src/src/rendering/layouts/layout-applicator.ts +5 -6
- package/src/src/rendering/layouts/utils/applicator.ts +1 -1
- package/src/src/rendering/layouts/utils/component-loader.ts +1 -1
- package/src/src/rendering/layouts/utils/ensure-valid-child.ts +1 -1
- package/src/src/rendering/orchestrator/layout.ts +1 -1
- package/src/src/rendering/orchestrator/module-loader/index.ts +91 -20
- package/src/src/rendering/orchestrator/pipeline.ts +2 -0
- package/src/src/rendering/orchestrator/ssr-orchestrator.ts +2 -2
- package/src/src/rendering/page-renderer.ts +1 -1
- package/src/src/rendering/page-rendering.ts +1 -1
- package/src/src/rendering/rsc/server-renderer/component-detector.ts +1 -1
- package/src/src/rendering/rsc/server-renderer/rsc-renderer.ts +1 -1
- package/src/src/rendering/rsc/server-renderer/tree-processor.ts +14 -4
- package/src/src/rendering/snippet-renderer.ts +2 -2
- package/src/src/rendering/ssr/component-registry.ts +1 -1
- package/src/src/rendering/ssr-renderer.ts +1 -1
- package/src/src/rendering/utils/react-helpers.ts +1 -1
- package/src/src/server/build-app-route-renderer.ts +2 -2
- package/src/src/server/handlers/request/rsc/handlers/render-handler.ts +1 -1
- package/src/src/server/handlers/request/ssr/error-page-fallback.ts +2 -2
- package/src/src/server/handlers/request/ssr/not-found-fallback.ts +1 -1
- package/src/src/transforms/esm/http-bundler.ts +101 -11
- package/src/src/transforms/esm/http-cache.ts +53 -45
- package/src/src/transforms/esm/import-rewriter.ts +5 -3
- package/src/src/transforms/esm/package-registry.ts +46 -32
- package/src/src/transforms/esm/react-imports.ts +3 -7
- package/src/src/transforms/esm/types.ts +2 -0
- package/src/src/transforms/mdx/esm-module-loader/cache/index.ts +84 -0
- package/src/src/transforms/mdx/esm-module-loader/loader.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/types.ts +4 -0
- package/src/src/transforms/mdx/index.ts +1 -1
- package/src/src/transforms/mdx/mdx-cache-adapter.ts +1 -1
- package/src/src/transforms/mdx/module-loader/types.ts +1 -1
- package/src/src/transforms/mdx/types.ts +2 -2
- package/src/src/transforms/pipeline/context.ts +7 -18
- package/src/src/transforms/pipeline/stages/finalize.ts +6 -1
- package/src/src/transforms/plugins/babel-node-positions.ts +2 -2
- package/src/src/types/app.ts +1 -1
- package/src/src/types/global-guards.ts +1 -1
- package/src/src/types/index.ts +1 -1
- package/src/src/utils/constants/cdn.ts +21 -12
- package/src/src/utils/hash-utils.ts +5 -0
- package/src/src/workflow/react/use-approval.ts +1 -1
- package/src/src/workflow/react/use-workflow-list.ts +1 -1
- package/src/src/workflow/react/use-workflow-start.ts +1 -1
- package/src/src/workflow/react/use-workflow.ts +1 -1
|
@@ -76,6 +76,14 @@ const COMPACT_OPTIONS: Partial<DotMatrixOptions> = {
|
|
|
76
76
|
|
|
77
77
|
const RESET = "\x1b[0m";
|
|
78
78
|
|
|
79
|
+
// Colors for spinning animation - shades of orange
|
|
80
|
+
const SPIN_COLORS = {
|
|
81
|
+
bright: "\x1b[38;2;255;165;120m", // Bright orange (leading edge, toned down)
|
|
82
|
+
orange: "\x1b[38;2;252;143;93m", // Brand orange
|
|
83
|
+
mid: "\x1b[38;2;200;110;70m", // Mid orange (trailing)
|
|
84
|
+
dim: "\x1b[38;2;140;80;50m", // Dim orange/brown
|
|
85
|
+
};
|
|
86
|
+
|
|
79
87
|
function resolveOptions(options: DotMatrixOptions): Required<DotMatrixOptions> {
|
|
80
88
|
if (options.compact) return { ...DEFAULT_OPTIONS, ...COMPACT_OPTIONS, ...options };
|
|
81
89
|
return { ...DEFAULT_OPTIONS, ...options };
|
|
@@ -92,12 +100,65 @@ function renderPattern(pattern: number[][], opts: Required<DotMatrixOptions>): s
|
|
|
92
100
|
});
|
|
93
101
|
}
|
|
94
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Render the pattern with a spinning blade effect
|
|
105
|
+
* The blade sweeps across the lit dots, creating orange → purple gradient
|
|
106
|
+
*/
|
|
107
|
+
function renderSpinningPattern(
|
|
108
|
+
pattern: number[][],
|
|
109
|
+
frame: number,
|
|
110
|
+
opts: Required<DotMatrixOptions>,
|
|
111
|
+
): string[] {
|
|
112
|
+
const centerRow = 3;
|
|
113
|
+
const centerCol = 3;
|
|
114
|
+
const totalFrames = 16; // Full rotation in 16 frames
|
|
115
|
+
const bladeAngle = ((frame % totalFrames) / totalFrames) * Math.PI * 2;
|
|
116
|
+
|
|
117
|
+
return pattern.map((row, rowIdx) => {
|
|
118
|
+
const dots = row.map((dot, colIdx) => {
|
|
119
|
+
if (dot !== 1) {
|
|
120
|
+
return `${opts.offColor}${opts.offChar}${RESET}`;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Calculate angle from center to this dot
|
|
124
|
+
const dy = rowIdx - centerRow;
|
|
125
|
+
const dx = colIdx - centerCol;
|
|
126
|
+
let dotAngle = Math.atan2(dy, dx);
|
|
127
|
+
if (dotAngle < 0) dotAngle += Math.PI * 2;
|
|
128
|
+
|
|
129
|
+
// Calculate angular distance from the blade
|
|
130
|
+
let angleDiff = dotAngle - bladeAngle;
|
|
131
|
+
if (angleDiff < 0) angleDiff += Math.PI * 2;
|
|
132
|
+
if (angleDiff > Math.PI) angleDiff = Math.PI * 2 - angleDiff;
|
|
133
|
+
|
|
134
|
+
// Color based on angular distance from blade
|
|
135
|
+
const normalizedDiff = angleDiff / Math.PI; // 0 = at blade, 1 = opposite
|
|
136
|
+
let color: string;
|
|
137
|
+
if (normalizedDiff < 0.15) {
|
|
138
|
+
color = SPIN_COLORS.bright; // Leading edge - brightest orange
|
|
139
|
+
} else if (normalizedDiff < 0.35) {
|
|
140
|
+
color = SPIN_COLORS.orange; // Near blade - brand orange
|
|
141
|
+
} else if (normalizedDiff < 0.6) {
|
|
142
|
+
color = SPIN_COLORS.mid; // Trailing - mid orange
|
|
143
|
+
} else {
|
|
144
|
+
color = SPIN_COLORS.dim; // Far from blade - dim orange
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return `${color}${opts.litChar}${RESET}`;
|
|
148
|
+
});
|
|
149
|
+
return opts.prefix + dots.join(opts.spacing);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
95
153
|
function renderPatternWithText(
|
|
96
154
|
pattern: number[][],
|
|
97
155
|
textLines: string[],
|
|
98
156
|
opts: Required<DotMatrixOptions>,
|
|
157
|
+
spinFrame?: number,
|
|
99
158
|
): string {
|
|
100
|
-
const faceLines =
|
|
159
|
+
const faceLines = spinFrame !== undefined
|
|
160
|
+
? renderSpinningPattern(pattern, spinFrame, opts)
|
|
161
|
+
: renderPattern(pattern, opts);
|
|
101
162
|
|
|
102
163
|
const faceHeight = faceLines.length;
|
|
103
164
|
const startLine = Math.floor((faceHeight - textLines.length) / 2);
|
|
@@ -164,6 +225,21 @@ export function getAgentFaceWithText(
|
|
|
164
225
|
return renderPatternWithText(AGENT_FACE, textLines, resolveOptions(options));
|
|
165
226
|
}
|
|
166
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Get the agent face with spinning blade animation
|
|
230
|
+
* Orange and purple dots rotate around the logo
|
|
231
|
+
* @param textLines Text to show next to the face
|
|
232
|
+
* @param frame Animation frame (0-15 for full rotation)
|
|
233
|
+
* @param options Dot matrix options
|
|
234
|
+
*/
|
|
235
|
+
export function getSpinningAgentFace(
|
|
236
|
+
textLines: string[],
|
|
237
|
+
frame: number,
|
|
238
|
+
options: DotMatrixOptions = {},
|
|
239
|
+
): string {
|
|
240
|
+
return renderPatternWithText(AGENT_FACE, textLines, resolveOptions(options), frame);
|
|
241
|
+
}
|
|
242
|
+
|
|
167
243
|
/**
|
|
168
244
|
* Animated dot matrix display with spinner support
|
|
169
245
|
*/
|
package/src/src/config/loader.ts
CHANGED
|
@@ -8,7 +8,8 @@ import { isBun } from "../platform/compat/runtime.js";
|
|
|
8
8
|
import { serverLogger } from "../utils/logger/logger.js";
|
|
9
9
|
import { getReactImportMap, REACT_DEFAULT_VERSION } from "../utils/constants/cdn.js";
|
|
10
10
|
import { DEFAULT_CACHE_DIR } from "../utils/constants/server.js";
|
|
11
|
-
|
|
11
|
+
// React version is now passed per-request via TransformOptions.reactVersion
|
|
12
|
+
// No longer using global singleton: import { setReactVersion } from "#veryfront/transforms/esm/package-registry.ts";
|
|
12
13
|
import { buildConfigCacheKey } from "../cache/keys.js";
|
|
13
14
|
import { DEFAULT_PORT } from "./defaults.js";
|
|
14
15
|
import { createFileSystem } from "../platform/compat/fs.js";
|
|
@@ -198,10 +199,10 @@ function validateAndCacheConfig(userConfig: unknown, cacheKey: string): Veryfron
|
|
|
198
199
|
|
|
199
200
|
const merged = mergeConfigs(userConfig as Partial<VeryfrontConfig>);
|
|
200
201
|
|
|
201
|
-
//
|
|
202
|
+
// React version is now passed per-request via TransformOptions.reactVersion
|
|
203
|
+
// Config stores it at merged.react.version, accessed wherever needed
|
|
202
204
|
if (merged.react?.version) {
|
|
203
|
-
|
|
204
|
-
serverLogger.debug("[CONFIG] React version set from config", { version: merged.react.version });
|
|
205
|
+
serverLogger.debug("[CONFIG] React version from config", { version: merged.react.version });
|
|
205
206
|
}
|
|
206
207
|
|
|
207
208
|
configCacheByProject.set(cacheKey, { revision: cacheRevision, config: merged });
|
package/src/src/html/utils.ts
CHANGED
|
@@ -97,8 +97,8 @@ interface CdnUrlTemplates {
|
|
|
97
97
|
const CDN_URL_TEMPLATES: Record<CdnProvider, CdnUrlTemplates> = {
|
|
98
98
|
"esm.sh": {
|
|
99
99
|
react: (v) => `https://esm.sh/react@${v}?target=es2022`,
|
|
100
|
-
reactDom: (v) => `https://esm.sh/react-dom@${v}?target=es2022`,
|
|
101
|
-
reactDomClient: (v) => `https://esm.sh/react-dom@${v}/client?target=es2022`,
|
|
100
|
+
reactDom: (v) => `https://esm.sh/react-dom@${v}?external=react&target=es2022`,
|
|
101
|
+
reactDomClient: (v) => `https://esm.sh/react-dom@${v}/client?external=react&target=es2022`,
|
|
102
102
|
jsxRuntime: (v) => `https://esm.sh/react@${v}/jsx-runtime?target=es2022`,
|
|
103
103
|
jsxDevRuntime: (v) => `https://esm.sh/react@${v}/jsx-dev-runtime?target=es2022`,
|
|
104
104
|
veryfrontAgentReact: (v) =>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { serverLogger as logger } from "../../utils/index.js";
|
|
2
2
|
import { basename, join } from "../../platform/compat/path/index.js";
|
|
3
3
|
import type { RuntimeAdapter } from "../../platform/adapters/base.js";
|
|
4
|
-
import type * as React from "react";
|
|
4
|
+
import type * as React from "../../../deps/esm.sh/react@19.1.1.js";
|
|
5
5
|
import { withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
6
6
|
|
|
7
7
|
export interface ComponentExports {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
2
|
import type { ImportMapConfig } from "./types.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
getDenoNpmReactMap,
|
|
6
|
-
getReactImportMap,
|
|
7
|
-
} from "../../transforms/esm/package-registry.js";
|
|
3
|
+
import { getReactImportMap } from "../../transforms/esm/package-registry.js";
|
|
8
4
|
|
|
9
5
|
function ensureTrailingSlash(path: string): string {
|
|
10
6
|
return path.endsWith("/") ? path : `${path}/`;
|
|
@@ -45,33 +41,15 @@ function getVeryfrontSsrImportMap(): Record<string, string> {
|
|
|
45
41
|
};
|
|
46
42
|
}
|
|
47
43
|
|
|
48
|
-
/**
|
|
49
|
-
* Get React import map for SSR in Deno.
|
|
50
|
-
* Uses npm: specifiers which Deno handles natively with automatic deduplication.
|
|
51
|
-
* See: https://deno.com/blog/not-using-npm-specifiers-doing-it-wrong
|
|
52
|
-
*
|
|
53
|
-
* This replaces the previous shared-*.ts approach which required manual re-exports.
|
|
54
|
-
*/
|
|
55
|
-
export function getDenoReactImportMap(): Record<string, string> {
|
|
56
|
-
return getDenoNpmReactMap();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
44
|
/**
|
|
60
45
|
* Get the default import map for SSR transforms.
|
|
61
|
-
*
|
|
62
|
-
* For Deno SSR: Uses npm: specifiers with automatic deduplication.
|
|
63
|
-
* For other runtimes: Uses esm.sh URLs with external=react.
|
|
46
|
+
* Uses esm.sh URLs consistently (NO npm: specifiers per plan requirements).
|
|
64
47
|
*/
|
|
65
48
|
export function getDefaultImportMap(): ImportMapConfig {
|
|
66
|
-
const reactMap =
|
|
49
|
+
const reactMap = getReactImportMap();
|
|
67
50
|
const veryfrontMap = getVeryfrontSsrImportMap();
|
|
68
51
|
|
|
69
|
-
// For Deno SSR, add scopes so that esm.sh modules with external=react
|
|
70
|
-
// resolve their bare `react` imports to npm: specifiers.
|
|
71
|
-
const scopes = isDeno ? { "https://esm.sh/": getDenoReactImportMap() } : undefined;
|
|
72
|
-
|
|
73
52
|
return {
|
|
74
53
|
imports: { ...veryfrontMap, ...reactMap },
|
|
75
|
-
scopes,
|
|
76
54
|
};
|
|
77
55
|
}
|
|
@@ -3,15 +3,16 @@ import { dirname, join } from "../../platform/compat/path/index.js";
|
|
|
3
3
|
import type { RuntimeAdapter } from "../../platform/adapters/base.js";
|
|
4
4
|
import { getConfig } from "../../config/index.js";
|
|
5
5
|
import type { ImportMapConfig } from "./types.js";
|
|
6
|
-
import { getDefaultImportMap
|
|
6
|
+
import { getDefaultImportMap } from "./default-import-map.js";
|
|
7
7
|
import { mergeImportMaps } from "./merger.js";
|
|
8
8
|
import { withSpan } from "../../observability/tracing/otlp-setup.js";
|
|
9
|
-
import {
|
|
9
|
+
import { getReactImportMap } from "../../transforms/esm/package-registry.js";
|
|
10
10
|
|
|
11
11
|
function normalizeImportMapForRuntime(importMap: ImportMapConfig): ImportMapConfig {
|
|
12
12
|
const normalizeValue = (value: string): string => {
|
|
13
13
|
if (!value.startsWith("npm:")) return value;
|
|
14
14
|
|
|
15
|
+
// Convert npm: specifiers to esm.sh URLs (should not happen with new code)
|
|
15
16
|
const spec = value.slice(4);
|
|
16
17
|
const [base, query] = spec.split("?");
|
|
17
18
|
const url = `https://esm.sh/${base}`;
|
|
@@ -23,7 +24,7 @@ function normalizeImportMapForRuntime(importMap: ImportMapConfig): ImportMapConf
|
|
|
23
24
|
? Object.fromEntries(Object.entries(importMap.imports).map(([k, v]) => [k, normalizeValue(v)]))
|
|
24
25
|
: undefined;
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
const scopes = importMap.scopes
|
|
27
28
|
? Object.fromEntries(
|
|
28
29
|
Object.entries(importMap.scopes).map(([scope, mappings]) => [
|
|
29
30
|
scope,
|
|
@@ -34,31 +35,14 @@ function normalizeImportMapForRuntime(importMap: ImportMapConfig): ImportMapConf
|
|
|
34
35
|
)
|
|
35
36
|
: undefined;
|
|
36
37
|
|
|
37
|
-
// CRITICAL: For Deno SSR, always use shared-*.ts files for React.
|
|
38
|
-
// Project configs may have esm.sh URLs which would create multiple React instances.
|
|
39
38
|
// Override React mappings AFTER all other processing to ensure single instance.
|
|
40
|
-
//
|
|
41
|
-
if (
|
|
42
|
-
const reactMap =
|
|
43
|
-
// Remove any esm.sh "react/" prefix mapping that would break subpath resolution
|
|
39
|
+
// Remove any "react/" prefix match since we have explicit mappings.
|
|
40
|
+
if (imports) {
|
|
41
|
+
const reactMap = getReactImportMap();
|
|
44
42
|
delete imports["react/"];
|
|
45
43
|
imports = { ...imports, ...reactMap };
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
// For Deno SSR, ensure esm.sh scope has React mappings to shared-*.ts files.
|
|
49
|
-
// This is critical because esm.sh modules with external=react have bare `react`
|
|
50
|
-
// imports that need to resolve to our shared React instance.
|
|
51
|
-
if (isDeno) {
|
|
52
|
-
const reactMap = getDenoReactImportMap();
|
|
53
|
-
const esmShScope = scopes?.["https://esm.sh/"] ?? {};
|
|
54
|
-
// Remove any "react/" prefix match from scope as well
|
|
55
|
-
delete esmShScope["react/"];
|
|
56
|
-
scopes = {
|
|
57
|
-
...scopes,
|
|
58
|
-
"https://esm.sh/": { ...esmShScope, ...reactMap },
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
46
|
return { imports, scopes };
|
|
63
47
|
}
|
|
64
48
|
|
|
@@ -60,21 +60,26 @@ export function resolveImport(
|
|
|
60
60
|
if (isEsmShUrl(specifier)) {
|
|
61
61
|
const esmShPackage = extractEsmShPackage(specifier);
|
|
62
62
|
if (esmShPackage) {
|
|
63
|
+
const subpath = extractEsmShSubpath(specifier);
|
|
64
|
+
|
|
65
|
+
// Always check for explicit subpath mapping first (e.g., "react/jsx-runtime")
|
|
66
|
+
// This takes priority over appending subpath to base package mapping
|
|
67
|
+
if (subpath) {
|
|
68
|
+
const fullKey = esmShPackage + subpath; // e.g., "react/jsx-runtime"
|
|
69
|
+
const subpathMapping = scopedImports?.[fullKey] ?? importMap.imports?.[fullKey];
|
|
70
|
+
if (subpathMapping) return subpathMapping;
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
const mapping = scopedImports?.[esmShPackage] ?? importMap.imports?.[esmShPackage];
|
|
64
74
|
if (mapping) {
|
|
65
|
-
const subpath = extractEsmShSubpath(specifier);
|
|
66
75
|
if (!subpath) return mapping;
|
|
67
76
|
|
|
68
|
-
// If mapping target is a file path (not HTTP URL or npm: specifier),
|
|
69
|
-
//
|
|
70
|
-
// npm: specifiers are URL-like and should have subpaths appended
|
|
77
|
+
// If mapping target is a file path (not HTTP URL or npm: specifier),
|
|
78
|
+
// fall back to base mapping since explicit subpath wasn't found above
|
|
71
79
|
const isFilePath = !mapping.startsWith("http://") && !mapping.startsWith("https://") &&
|
|
72
80
|
!mapping.startsWith("npm:");
|
|
73
81
|
if (isFilePath) {
|
|
74
|
-
|
|
75
|
-
const subpathMapping = scopedImports?.[fullKey] ?? importMap.imports?.[fullKey];
|
|
76
|
-
// Use explicit subpath mapping if available, otherwise fall back to base mapping
|
|
77
|
-
return subpathMapping ?? mapping;
|
|
82
|
+
return mapping;
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
return mapping + subpath;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join } from "../../platform/compat/path/index.js";
|
|
2
|
-
import type * as React from "react";
|
|
2
|
+
import type * as React from "../../../deps/esm.sh/react@19.1.1.js";
|
|
3
3
|
import type { RuntimeAdapter } from "../../platform/adapters/base.js";
|
|
4
4
|
import { transformToESM } from "../../transforms/esm/index.js";
|
|
5
5
|
import type { TransformOptions } from "../../transforms/esm/types.js";
|
|
@@ -34,6 +34,7 @@ export function loadComponentFromSource(
|
|
|
34
34
|
adapter,
|
|
35
35
|
dev,
|
|
36
36
|
contentSourceId: options?.contentSourceId,
|
|
37
|
+
reactVersion: options?.reactVersion,
|
|
37
38
|
});
|
|
38
39
|
return loader.loadModule(filePath, source);
|
|
39
40
|
}
|
|
@@ -44,6 +45,7 @@ export function loadComponentFromSource(
|
|
|
44
45
|
moduleServerUrl: options?.moduleServerUrl ?? "/_vf_modules",
|
|
45
46
|
vendorBundleHash: options?.vendorBundleHash,
|
|
46
47
|
ssr: false,
|
|
48
|
+
reactVersion: options?.reactVersion,
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
const transformedCode = await transformToESM(
|
|
@@ -8,13 +8,12 @@
|
|
|
8
8
|
import * as dntShim from "../../../../_dnt.shims.js";
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import type * as React from "react";
|
|
11
|
+
import { join } from "../../../platform/compat/path/index.js";
|
|
12
|
+
import type * as React from "../../../../deps/esm.sh/react@19.1.1.js";
|
|
14
13
|
import { transformToESM } from "../../../transforms/esm/index.js";
|
|
15
14
|
import type { TransformOptions } from "../../../transforms/esm/types.js";
|
|
16
15
|
import { TRANSFORM_CACHE_VERSION } from "../../../transforms/esm/package-registry.js";
|
|
17
|
-
import { buildSSRModuleCacheKey
|
|
16
|
+
import { buildSSRModuleCacheKey } from "../../../cache/keys.js";
|
|
18
17
|
import {
|
|
19
18
|
type CrossProjectImport,
|
|
20
19
|
type MissingImport,
|
|
@@ -23,6 +22,7 @@ import {
|
|
|
23
22
|
import { createFileSystem } from "../../../platform/compat/fs.js";
|
|
24
23
|
import { createError, toError } from "../../../errors/veryfront-error.js";
|
|
25
24
|
import { rendererLogger as logger } from "../../../utils/index.js";
|
|
25
|
+
import { hashCodeHex } from "../../../utils/hash-utils.js";
|
|
26
26
|
import { getApiBaseUrlEnv } from "../../../config/env.js";
|
|
27
27
|
import { injectContext, withSpan } from "../../../observability/tracing/otlp-setup.js";
|
|
28
28
|
import { SpanNames } from "../../../observability/tracing/span-names.js";
|
|
@@ -49,7 +49,8 @@ import {
|
|
|
49
49
|
transformSemaphore,
|
|
50
50
|
} from "./cache/index.js";
|
|
51
51
|
import type { ModuleCacheEntry, SSRModuleLoaderOptions } from "./types.js";
|
|
52
|
-
import {
|
|
52
|
+
import { getHttpBundleCacheDir, getMdxEsmCacheDir } from "../../../utils/cache-dir.js";
|
|
53
|
+
import { lookupMdxEsmCache } from "../../../transforms/mdx/esm-module-loader/cache/index.js";
|
|
53
54
|
import { ensureHttpBundlesExist } from "../../../transforms/esm/http-cache.js";
|
|
54
55
|
import { LRUCache } from "../../../utils/lru-wrapper.js";
|
|
55
56
|
|
|
@@ -143,24 +144,37 @@ export class SSRModuleLoader {
|
|
|
143
144
|
const bundleMatch = errorMsg.match(/veryfront-http-bundle\/http-([a-f0-9]+)\.mjs/);
|
|
144
145
|
if (bundleMatch) {
|
|
145
146
|
const hash = bundleMatch[1]!;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
const cacheDir = getHttpBundleCacheDir();
|
|
148
|
+
|
|
149
|
+
logger.error("[SSR-MODULE-LOADER] Missing HTTP bundle after ensureHttpBundlesExist", {
|
|
150
|
+
file: filePath.slice(-40),
|
|
151
|
+
hash,
|
|
152
|
+
tempPath: cacheEntry.tempPath,
|
|
153
|
+
contentHash: cacheEntry.contentHash,
|
|
154
|
+
cacheDir,
|
|
155
|
+
expectedPath: `${cacheDir}/http-${hash}.mjs`,
|
|
156
|
+
});
|
|
157
|
+
|
|
153
158
|
const { recoverHttpBundleByHash } = await import(
|
|
154
159
|
"../../../transforms/esm/http-cache.js"
|
|
155
160
|
);
|
|
156
|
-
const cacheDir = getHttpBundleCacheDir();
|
|
157
161
|
const recovered = await recoverHttpBundleByHash(hash, cacheDir);
|
|
158
162
|
if (recovered) {
|
|
159
|
-
logger.info("[SSR-MODULE-LOADER] HTTP bundle recovered, retrying import", {
|
|
163
|
+
logger.info("[SSR-MODULE-LOADER] HTTP bundle recovered, retrying import", {
|
|
164
|
+
hash,
|
|
165
|
+
file: filePath.slice(-40),
|
|
166
|
+
});
|
|
160
167
|
mod = await import(
|
|
161
168
|
`file://${cacheEntry.tempPath}?v=${cacheEntry.contentHash}&retry=1`
|
|
162
169
|
) as Record<string, unknown>;
|
|
163
170
|
} else {
|
|
171
|
+
logger.error("[SSR-MODULE-LOADER] HTTP bundle recovery failed", {
|
|
172
|
+
hash,
|
|
173
|
+
file: filePath.slice(-40),
|
|
174
|
+
cacheDir,
|
|
175
|
+
hint:
|
|
176
|
+
"Bundle may have expired from Redis (24h TTL) while transform was still cached",
|
|
177
|
+
});
|
|
164
178
|
throw importError;
|
|
165
179
|
}
|
|
166
180
|
} else {
|
|
@@ -250,10 +264,12 @@ export class SSRModuleLoader {
|
|
|
250
264
|
`Missing contentSourceId for SSR module cache (project: ${this.options.projectId}, file: ${filePath})`,
|
|
251
265
|
);
|
|
252
266
|
}
|
|
267
|
+
// Include reactVersion in cache key to ensure different versions don't share cached modules
|
|
268
|
+
const reactVersion = this.options.reactVersion ?? "default";
|
|
253
269
|
return buildSSRModuleCacheKey(
|
|
254
270
|
TRANSFORM_CACHE_VERSION,
|
|
255
271
|
this.options.projectId,
|
|
256
|
-
`${this.options.contentSourceId}:${filePath}`,
|
|
272
|
+
`${this.options.contentSourceId}:${reactVersion}:${filePath}`,
|
|
257
273
|
);
|
|
258
274
|
}
|
|
259
275
|
|
|
@@ -348,6 +364,7 @@ export class SSRModuleLoader {
|
|
|
348
364
|
dev: this.options.dev,
|
|
349
365
|
ssr: true,
|
|
350
366
|
apiBaseUrl: this.options.apiBaseUrl,
|
|
367
|
+
reactVersion: this.options.reactVersion,
|
|
351
368
|
};
|
|
352
369
|
|
|
353
370
|
const filePathWithExt = syntheticFilePath.endsWith(ext)
|
|
@@ -444,13 +461,13 @@ export class SSRModuleLoader {
|
|
|
444
461
|
const cacheDir = getHttpBundleCacheDir();
|
|
445
462
|
const failed = await ensureHttpBundlesExist(bundlePaths, cacheDir);
|
|
446
463
|
if (failed.length > 0) {
|
|
447
|
-
logger.warn(
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
);
|
|
464
|
+
logger.warn("[SSR-MODULE-LOADER] Unrecoverable HTTP bundles, re-transforming", {
|
|
465
|
+
file: filePath.slice(-40),
|
|
466
|
+
failed,
|
|
467
|
+
totalBundles: bundlePaths.length,
|
|
468
|
+
cacheDir,
|
|
469
|
+
source: "memory-cache",
|
|
470
|
+
});
|
|
454
471
|
globalModuleCache.delete(contentCacheKey);
|
|
455
472
|
globalModuleCache.delete(filePathCacheKey);
|
|
456
473
|
// Fall through to Redis or fresh transform
|
|
@@ -487,13 +504,13 @@ export class SSRModuleLoader {
|
|
|
487
504
|
const cacheDir = getHttpBundleCacheDir();
|
|
488
505
|
const failed = await ensureHttpBundlesExist(bundlePaths, cacheDir);
|
|
489
506
|
if (failed.length > 0) {
|
|
490
|
-
logger.warn(
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
);
|
|
507
|
+
logger.warn("[SSR-MODULE-LOADER] Unrecoverable HTTP bundles, re-transforming", {
|
|
508
|
+
file: filePath.slice(-40),
|
|
509
|
+
failed,
|
|
510
|
+
totalBundles: bundlePaths.length,
|
|
511
|
+
cacheDir,
|
|
512
|
+
source: "redis-cache",
|
|
513
|
+
});
|
|
497
514
|
httpBundlesOk = false;
|
|
498
515
|
}
|
|
499
516
|
}
|
|
@@ -519,6 +536,34 @@ export class SSRModuleLoader {
|
|
|
519
536
|
}
|
|
520
537
|
}
|
|
521
538
|
|
|
539
|
+
// Check MDX-ESM cache to share modules with MDX loader and avoid duplicate React contexts
|
|
540
|
+
if (this.options.projectId && this.options.contentSourceId) {
|
|
541
|
+
const baseCacheDir = getMdxEsmCacheDir();
|
|
542
|
+
const projectKey = hashCodeHex(this.options.projectId);
|
|
543
|
+
const sourceKey = hashCodeHex(this.options.contentSourceId);
|
|
544
|
+
const mdxCacheDir = join(baseCacheDir, projectKey, sourceKey);
|
|
545
|
+
|
|
546
|
+
const mdxCachedPath = await lookupMdxEsmCache(
|
|
547
|
+
filePath,
|
|
548
|
+
mdxCacheDir,
|
|
549
|
+
this.options.projectDir,
|
|
550
|
+
contentHash,
|
|
551
|
+
);
|
|
552
|
+
if (mdxCachedPath) {
|
|
553
|
+
const entry: ModuleCacheEntry = { tempPath: mdxCachedPath, contentHash };
|
|
554
|
+
globalModuleCache.set(contentCacheKey, entry);
|
|
555
|
+
globalModuleCache.set(filePathCacheKey, entry);
|
|
556
|
+
|
|
557
|
+
logger.debug("[SSR-MODULE-LOADER] Reusing MDX-ESM cache", {
|
|
558
|
+
file: filePath.slice(-40),
|
|
559
|
+
cachedPath: mdxCachedPath.slice(-60),
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
await this.ensureDependenciesExist(code, filePath, depth);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
522
567
|
const existingTransform = globalInProgress.get(inProgressKey);
|
|
523
568
|
if (existingTransform) {
|
|
524
569
|
try {
|
|
@@ -613,6 +658,7 @@ export class SSRModuleLoader {
|
|
|
613
658
|
dev: this.options.dev,
|
|
614
659
|
ssr: true,
|
|
615
660
|
apiBaseUrl: this.options.apiBaseUrl,
|
|
661
|
+
reactVersion: this.options.reactVersion,
|
|
616
662
|
};
|
|
617
663
|
|
|
618
664
|
let transformed = await withSpan(
|
|
@@ -642,13 +688,13 @@ export class SSRModuleLoader {
|
|
|
642
688
|
const cacheDir = getHttpBundleCacheDir();
|
|
643
689
|
const failed = await ensureHttpBundlesExist(bundlePaths, cacheDir);
|
|
644
690
|
if (failed.length > 0) {
|
|
645
|
-
logger.warn(
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
);
|
|
691
|
+
logger.warn("[SSR-MODULE-LOADER] Unrecoverable HTTP bundles", {
|
|
692
|
+
file: filePath.slice(-40),
|
|
693
|
+
failed,
|
|
694
|
+
totalBundles: bundlePaths.length,
|
|
695
|
+
cacheDir,
|
|
696
|
+
source: "fresh-transform",
|
|
697
|
+
});
|
|
652
698
|
}
|
|
653
699
|
}
|
|
654
700
|
|
|
@@ -927,26 +973,12 @@ export class SSRModuleLoader {
|
|
|
927
973
|
}
|
|
928
974
|
}
|
|
929
975
|
|
|
930
|
-
/**
|
|
931
|
-
* Fast sync hash for small strings (project IDs, etc.)
|
|
932
|
-
* Use hashContentAsync for large file content.
|
|
933
|
-
*/
|
|
934
|
-
private hashCode(str: string): string {
|
|
935
|
-
let hash = 0;
|
|
936
|
-
for (let i = 0; i < str.length; i++) {
|
|
937
|
-
const char = str.charCodeAt(i);
|
|
938
|
-
hash = (hash << 5) - hash + char;
|
|
939
|
-
hash = hash & hash;
|
|
940
|
-
}
|
|
941
|
-
return Math.abs(hash).toString(16);
|
|
942
|
-
}
|
|
943
|
-
|
|
944
976
|
/**
|
|
945
977
|
* Async hash for large content using Web Crypto API.
|
|
946
|
-
*
|
|
978
|
+
* Falls back to sync hash for small files.
|
|
947
979
|
*/
|
|
948
980
|
private async hashContentAsync(content: string): Promise<string> {
|
|
949
|
-
if (content.length < 10000) return
|
|
981
|
+
if (content.length < 10000) return hashCodeHex(content);
|
|
950
982
|
|
|
951
983
|
try {
|
|
952
984
|
const data = new TextEncoder().encode(content);
|
|
@@ -957,7 +989,7 @@ export class SSRModuleLoader {
|
|
|
957
989
|
.map((b) => b.toString(16).padStart(2, "0"))
|
|
958
990
|
.join("");
|
|
959
991
|
} catch {
|
|
960
|
-
return
|
|
992
|
+
return hashCodeHex(content);
|
|
961
993
|
}
|
|
962
994
|
}
|
|
963
995
|
|
|
@@ -977,33 +1009,28 @@ export class SSRModuleLoader {
|
|
|
977
1009
|
}
|
|
978
1010
|
|
|
979
1011
|
private async ensureTmpDir(): Promise<string> {
|
|
980
|
-
let projectDir = this.options.projectDir;
|
|
981
1012
|
const { projectId, contentSourceId } = this.options;
|
|
982
1013
|
|
|
983
1014
|
if (!projectId) {
|
|
984
|
-
throw new Error(
|
|
1015
|
+
throw new Error(
|
|
1016
|
+
`Missing projectId for SSR temp directory (projectDir: ${this.options.projectDir})`,
|
|
1017
|
+
);
|
|
985
1018
|
}
|
|
986
1019
|
if (!contentSourceId) {
|
|
987
1020
|
throw new Error(`Missing contentSourceId for SSR temp directory (project: ${projectId})`);
|
|
988
1021
|
}
|
|
989
1022
|
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
const
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
const cacheKey = `${baseDir}|${
|
|
998
|
-
buildSSRModuleProjectKey(projectDir, projectId)
|
|
999
|
-
}|${contentSourceId}`;
|
|
1023
|
+
// Use the same cache directory as MDX-ESM loader to share module instances.
|
|
1024
|
+
// This prevents issues like React context being created twice in separate files.
|
|
1025
|
+
const baseCacheDir = getMdxEsmCacheDir();
|
|
1026
|
+
const projectKey = hashCodeHex(projectId);
|
|
1027
|
+
const sourceKey = hashCodeHex(contentSourceId);
|
|
1028
|
+
const cacheKey = `${baseCacheDir}|${projectKey}|${sourceKey}`;
|
|
1000
1029
|
|
|
1001
1030
|
const existingDir = globalTmpDirs.get(cacheKey);
|
|
1002
1031
|
if (existingDir) return existingDir;
|
|
1003
1032
|
|
|
1004
|
-
const
|
|
1005
|
-
const sourceKey = this.hashCode(contentSourceId);
|
|
1006
|
-
const tmpDir = join(baseDir, "veryfront-ssr", projectKey, sourceKey);
|
|
1033
|
+
const tmpDir = join(baseCacheDir, projectKey, sourceKey);
|
|
1007
1034
|
|
|
1008
1035
|
await this.fs.mkdir(tmpDir, { recursive: true });
|
|
1009
1036
|
globalTmpDirs.set(cacheKey, tmpDir);
|
|
@@ -16,6 +16,8 @@ export interface SSRModuleLoaderOptions {
|
|
|
16
16
|
apiBaseUrl?: string;
|
|
17
17
|
/** Content source ID for cache isolation (branch name or release ID) */
|
|
18
18
|
contentSourceId?: string;
|
|
19
|
+
/** React version for transforms (defaults to DEFAULT_REACT_VERSION) */
|
|
20
|
+
reactVersion?: string;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export interface ModuleCacheEntry {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as React from "react";
|
|
1
|
+
import type * as React from "../../../deps/esm.sh/react@19.1.1.js";
|
|
2
2
|
|
|
3
3
|
export interface LoadComponentOptions {
|
|
4
4
|
projectId?: string;
|
|
@@ -9,6 +9,8 @@ export interface LoadComponentOptions {
|
|
|
9
9
|
ssr?: boolean;
|
|
10
10
|
/** Content source ID for cache isolation (branch name or release ID) */
|
|
11
11
|
contentSourceId?: string;
|
|
12
|
+
/** React version for transforms (from project config) */
|
|
13
|
+
reactVersion?: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export interface ComponentSource {
|