veryfront 0.1.49 → 0.1.51
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/_dnt.polyfills.d.ts +8 -7
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +121 -109
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +0 -1
- package/esm/cli/commands/generate/integration-generator.d.ts +8 -0
- package/esm/cli/commands/generate/integration-generator.d.ts.map +1 -1
- package/esm/cli/commands/generate/integration-generator.js +322 -34
- package/esm/cli/commands/install/types.d.ts +2 -2
- package/esm/cli/commands/serve/handler.d.ts +1 -1
- package/esm/cli/commands/start/command.d.ts.map +1 -1
- package/esm/cli/commands/start/command.js +0 -1
- package/esm/cli/commands/studio/handler.d.ts +1 -1
- package/esm/cli/mcp/remote-file-tools.d.ts +6 -6
- package/esm/cli/mcp/server.d.ts.map +1 -1
- package/esm/cli/mcp/server.js +0 -2
- package/esm/cli/mcp/tools.d.ts +2 -2
- package/esm/cli/shared/server-startup.d.ts +0 -1
- package/esm/cli/shared/server-startup.d.ts.map +1 -1
- package/esm/cli/shared/server-startup.js +0 -1
- package/esm/cli/templates/index.d.ts.map +1 -1
- package/esm/cli/templates/index.js +1 -16
- package/esm/cli/templates/manifest.js +12 -12
- package/esm/cli/ui/ansi.js +1 -1
- package/esm/deno.js +1 -1
- package/esm/src/agent/ai-defaults.d.ts +0 -95
- package/esm/src/agent/ai-defaults.d.ts.map +1 -1
- package/esm/src/agent/ai-defaults.js +4 -56
- package/esm/src/agent/chat-handler.d.ts +1 -1
- package/esm/src/agent/chat-handler.d.ts.map +1 -1
- package/esm/src/agent/chat-handler.js +30 -14
- package/esm/src/agent/factory.d.ts.map +1 -1
- package/esm/src/agent/factory.js +13 -5
- package/esm/src/agent/index.d.ts +3 -10
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +2 -7
- package/esm/src/agent/memory/redis.d.ts.map +1 -1
- package/esm/src/agent/memory/redis.js +3 -2
- package/esm/src/agent/react/use-agent.d.ts +2 -2
- package/esm/src/agent/react/use-agent.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts +2 -1
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.js +9 -1
- package/esm/src/agent/react/use-chat/browser-inference/types.d.ts +7 -6
- package/esm/src/agent/react/use-chat/browser-inference/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts +2 -1
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/streaming/handler.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/streaming/handler.js +11 -5
- package/esm/src/agent/react/use-chat/types.d.ts +3 -2
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +4 -4
- package/esm/src/agent/react/use-voice-input.js +2 -2
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +16 -10
- package/esm/src/agent/runtime/input-utils.d.ts.map +1 -1
- package/esm/src/agent/runtime/input-utils.js +2 -1
- package/esm/src/agent/runtime/model-resolution.d.ts +4 -0
- package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -0
- package/esm/src/agent/runtime/model-resolution.js +10 -0
- package/esm/src/agent/runtime/tool-helpers.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-helpers.js +3 -1
- package/esm/src/agent/types.d.ts +12 -2
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/agent/types.js +4 -1
- package/esm/src/build/bundler/code-splitter/entry-points.d.ts +2 -1
- package/esm/src/build/bundler/code-splitter/entry-points.d.ts.map +1 -1
- package/esm/src/build/bundler/code-splitter/index.d.ts.map +1 -1
- package/esm/src/build/bundler/code-splitter/index.js +4 -2
- package/esm/src/build/compiler/mdx-compiler/directory-compiler.d.ts +0 -1
- package/esm/src/build/compiler/mdx-compiler/directory-compiler.d.ts.map +1 -1
- package/esm/src/build/compiler/mdx-compiler/directory-compiler.js +1 -1
- package/esm/src/build/compiler/mdx-compiler/frontmatter-parser.d.ts +2 -1
- package/esm/src/build/compiler/mdx-compiler/frontmatter-parser.d.ts.map +1 -1
- package/esm/src/build/compiler/mdx-compiler/frontmatter-parser.js +4 -2
- package/esm/src/build/compiler/mdx-compiler/mdx-processor.d.ts +2 -1
- package/esm/src/build/compiler/mdx-compiler/mdx-processor.d.ts.map +1 -1
- package/esm/src/build/compiler/mdx-compiler/types.d.ts +2 -1
- package/esm/src/build/compiler/mdx-compiler/types.d.ts.map +1 -1
- package/esm/src/build/compiler/mdx-compiler/validator.d.ts.map +1 -1
- package/esm/src/build/compiler/mdx-compiler/validator.js +4 -3
- package/esm/src/build/compiler/mdx-compiler/watcher.js +2 -1
- package/esm/src/build/compiler/mdx-to-js.d.ts +2 -1
- package/esm/src/build/compiler/mdx-to-js.d.ts.map +1 -1
- package/esm/src/build/config/environment.d.ts.map +1 -1
- package/esm/src/build/config/environment.js +8 -2
- package/esm/src/build/embedded/preset.d.ts +2 -1
- package/esm/src/build/embedded/preset.d.ts.map +1 -1
- package/esm/src/build/embedded/preset.js +6 -6
- package/esm/src/build/production-build/asset-generation.js +2 -2
- package/esm/src/build/production-build/build/build-cleanup.d.ts.map +1 -1
- package/esm/src/build/production-build/build/build-cleanup.js +2 -9
- package/esm/src/build/production-build/client-runtime.d.ts.map +1 -1
- package/esm/src/build/production-build/client-runtime.js +6 -4
- package/esm/src/build/production-build/templates.d.ts.map +1 -1
- package/esm/src/build/production-build/templates.js +2 -2
- package/esm/src/cache/backends/api.d.ts.map +1 -1
- package/esm/src/cache/backends/api.js +13 -5
- package/esm/src/cache/backends/disk.d.ts.map +1 -1
- package/esm/src/cache/backends/disk.js +2 -1
- package/esm/src/cache/backends/factory.d.ts.map +1 -1
- package/esm/src/cache/backends/factory.js +2 -1
- package/esm/src/cache/backends/memory.d.ts.map +1 -1
- package/esm/src/cache/backends/memory.js +5 -3
- package/esm/src/cache/cache-key-builder.d.ts.map +1 -1
- package/esm/src/cache/cache-key-builder.js +7 -3
- package/esm/src/cache/config-hash.d.ts +2 -1
- package/esm/src/cache/config-hash.d.ts.map +1 -1
- package/esm/src/cache/dependency-graph.js +2 -1
- package/esm/src/cache/distributed-cache-init.d.ts +2 -1
- package/esm/src/cache/distributed-cache-init.d.ts.map +1 -1
- package/esm/src/cache/keys/builders/file.d.ts.map +1 -1
- package/esm/src/cache/keys/builders/file.js +4 -1
- package/esm/src/cache/keys/builders/render.d.ts.map +1 -1
- package/esm/src/cache/keys/builders/render.js +7 -2
- package/esm/src/cache/registry.d.ts.map +1 -1
- package/esm/src/cache/registry.js +7 -2
- package/esm/src/config/environment-config.d.ts.map +1 -1
- package/esm/src/config/environment-config.js +10 -2
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +20 -4
- package/esm/src/config/runtime-config.d.ts.map +1 -1
- package/esm/src/config/runtime-config.js +3 -1
- package/esm/src/data/data-fetcher.d.ts +1 -1
- package/esm/src/data/data-fetcher.d.ts.map +1 -1
- package/esm/src/data/data-fetcher.js +1 -2
- package/esm/src/data/static-data-fetcher.js +2 -2
- package/esm/src/discovery/file-discovery.d.ts +0 -9
- package/esm/src/discovery/file-discovery.d.ts.map +1 -1
- package/esm/src/discovery/file-discovery.js +3 -2
- package/esm/src/discovery/handlers/skill-handler.d.ts +3 -2
- package/esm/src/discovery/handlers/skill-handler.d.ts.map +1 -1
- package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
- package/esm/src/discovery/import-rewriter.js +8 -5
- package/esm/src/discovery/transpiler.d.ts.map +1 -1
- package/esm/src/discovery/transpiler.js +8 -2
- package/esm/src/embedding/chunk.d.ts.map +1 -1
- package/esm/src/embedding/chunk.js +6 -2
- package/esm/src/embedding/embedding.d.ts +0 -1
- package/esm/src/embedding/embedding.d.ts.map +1 -1
- package/esm/src/embedding/embedding.js +4 -3
- package/esm/src/embedding/index.d.ts +4 -4
- package/esm/src/embedding/index.d.ts.map +1 -1
- package/esm/src/embedding/index.js +3 -3
- package/esm/src/embedding/model-resolution.d.ts +4 -0
- package/esm/src/embedding/model-resolution.d.ts.map +1 -0
- package/esm/src/embedding/model-resolution.js +16 -0
- package/esm/src/embedding/rag-store.d.ts +27 -0
- package/esm/src/embedding/rag-store.d.ts.map +1 -0
- package/esm/src/embedding/{upload-store.js → rag-store.js} +153 -48
- package/esm/src/embedding/react/use-uploads.d.ts +2 -2
- package/esm/src/embedding/react/use-uploads.d.ts.map +1 -1
- package/esm/src/embedding/react/use-uploads.js +6 -3
- package/esm/src/embedding/resolve.d.ts +2 -1
- package/esm/src/embedding/resolve.d.ts.map +1 -1
- package/esm/src/embedding/resolve.js +4 -0
- package/esm/src/embedding/types.d.ts +27 -16
- package/esm/src/embedding/types.d.ts.map +1 -1
- package/esm/src/embedding/upload-handler.d.ts +6 -4
- package/esm/src/embedding/upload-handler.d.ts.map +1 -1
- package/esm/src/embedding/upload-handler.js +81 -7
- package/esm/src/embedding/upload-loader.js +1 -1
- package/esm/src/embedding/veryfront-cloud/provider.d.ts +3 -0
- package/esm/src/embedding/veryfront-cloud/provider.d.ts.map +1 -0
- package/esm/src/embedding/veryfront-cloud/provider.js +30 -0
- package/esm/src/embedding/veryfront-cloud/rag-store.d.ts +7 -0
- package/esm/src/embedding/veryfront-cloud/rag-store.d.ts.map +1 -0
- package/esm/src/embedding/veryfront-cloud/rag-store.js +360 -0
- package/esm/src/errors/catalog/general-errors.d.ts.map +1 -1
- package/esm/src/errors/catalog/general-errors.js +5 -0
- package/esm/src/errors/error-context.d.ts.map +1 -1
- package/esm/src/errors/error-context.js +3 -0
- package/esm/src/errors/error-handlers.d.ts.map +1 -1
- package/esm/src/errors/error-handlers.js +3 -2
- package/esm/src/errors/error-registry.d.ts +2 -0
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/error-registry.js +8 -0
- package/esm/src/errors/index.d.ts +1 -1
- package/esm/src/errors/index.d.ts.map +1 -1
- package/esm/src/errors/index.js +1 -1
- package/esm/src/errors/logging.d.ts.map +1 -1
- package/esm/src/errors/logging.js +8 -6
- package/esm/src/errors/types.d.ts +2 -0
- package/esm/src/errors/types.d.ts.map +1 -1
- package/esm/src/errors/types.js +1 -1
- package/esm/src/errors/veryfront-error.d.ts +2 -6
- package/esm/src/errors/veryfront-error.d.ts.map +1 -1
- package/esm/src/errors/veryfront-error.js +0 -1
- package/esm/src/html/dev-scripts.d.ts +2 -1
- package/esm/src/html/dev-scripts.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/dev-error-logger.js +1 -1
- package/esm/src/html/hydration-script-builder/dev-scripts.d.ts +2 -1
- package/esm/src/html/hydration-script-builder/dev-scripts.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/renderer.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/renderer.js +4 -3
- package/esm/src/html/hydration-script-builder/templates/router.d.ts.map +1 -1
- package/esm/src/html/hydration-script-builder/templates/router.js +5 -4
- package/esm/src/html/schemas/html.schema.d.ts +2 -2
- package/esm/src/html/styles-builder/css-hash-cache.d.ts +2 -1
- package/esm/src/html/styles-builder/css-hash-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/css-hash-cache.js +16 -14
- package/esm/src/html/styles-builder/css-pregeneration.d.ts +2 -1
- package/esm/src/html/styles-builder/css-pregeneration.d.ts.map +1 -1
- package/esm/src/html/styles-builder/index.d.ts +1 -1
- package/esm/src/html/styles-builder/index.d.ts.map +1 -1
- package/esm/src/html/styles-builder/index.js +1 -1
- package/esm/src/html/styles-builder/plugin-loader.d.ts +1 -1
- package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
- package/esm/src/html/styles-builder/plugin-loader.js +35 -27
- package/esm/src/html/styles-builder/project-css-cache.d.ts +4 -3
- package/esm/src/html/styles-builder/project-css-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/tailwind-compiler-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/tailwind-compiler-cache.js +10 -4
- package/esm/src/html/styles-builder/tailwind-compiler-utils.d.ts +5 -4
- package/esm/src/html/styles-builder/tailwind-compiler-utils.d.ts.map +1 -1
- package/esm/src/html/styles-builder/tailwind-compiler-utils.js +4 -2
- package/esm/src/html/styles-builder/tailwind-compiler.d.ts +0 -2
- package/esm/src/html/styles-builder/tailwind-compiler.d.ts.map +1 -1
- package/esm/src/html/styles-builder/tailwind-compiler.js +5 -8
- package/esm/src/html/utils.d.ts +2 -1
- package/esm/src/html/utils.d.ts.map +1 -1
- package/esm/src/html/utils.js +2 -2
- package/esm/src/integrations/endpoint-executor.d.ts.map +1 -1
- package/esm/src/integrations/endpoint-executor.js +5 -2
- package/esm/src/integrations/schema.d.ts +2 -2
- package/esm/src/integrations/types.d.ts +2 -1
- package/esm/src/integrations/types.d.ts.map +1 -1
- package/esm/src/issues/core.d.ts.map +1 -1
- package/esm/src/issues/core.js +8 -5
- package/esm/src/issues/schemas/issue.schema.d.ts +14 -14
- package/esm/src/mcp/server.d.ts.map +1 -1
- package/esm/src/mcp/server.js +4 -3
- package/esm/src/mcp/types.d.ts.map +1 -1
- package/esm/src/middleware/builtin/security/redis-rate-limit.d.ts.map +1 -1
- package/esm/src/middleware/builtin/security/redis-rate-limit.js +2 -1
- package/esm/src/middleware/builtin/timeout.js +1 -1
- package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
- package/esm/src/modules/component-registry/registry.js +5 -3
- package/esm/src/modules/import-map/default-import-map.js +1 -1
- package/esm/src/modules/import-map/loader.js +6 -6
- package/esm/src/modules/import-map/preloader.d.ts +3 -3
- package/esm/src/modules/import-map/preloader.d.ts.map +1 -1
- package/esm/src/modules/import-map/preloader.js +12 -10
- package/esm/src/modules/import-map/resolver.d.ts.map +1 -1
- package/esm/src/modules/import-map/resolver.js +2 -1
- package/esm/src/modules/react-loader/ssr-module-loader/cache/memory.js +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.js +3 -1
- package/esm/src/modules/react-loader/ssr-module-loader/cross-project-import-loader.d.ts +3 -2
- package/esm/src/modules/react-loader/ssr-module-loader/cross-project-import-loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/cross-project-import-loader.js +7 -2
- package/esm/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.d.ts +0 -5
- 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 +8 -4
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/preflight-imports.d.ts +2 -1
- package/esm/src/modules/react-loader/ssr-module-loader/preflight-imports.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/preflight-imports.js +2 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.js +19 -7
- package/esm/src/modules/react-loader/ssr-module-loader/vf-module-resolver.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/vf-module-resolver.js +12 -2
- package/esm/src/modules/react-loader/unified-loader.js +2 -2
- package/esm/src/modules/server/module-batch-handler.d.ts.map +1 -1
- package/esm/src/modules/server/module-batch-handler.js +10 -6
- package/esm/src/modules/server/module-server.d.ts +0 -7
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +12 -36
- package/esm/src/modules/server/ssr-import-rewriter.d.ts +2 -1
- package/esm/src/modules/server/ssr-import-rewriter.d.ts.map +1 -1
- package/esm/src/modules/server/websocket-handler.js +1 -1
- package/esm/src/oauth/providers/base.d.ts.map +1 -1
- package/esm/src/oauth/providers/base.js +44 -16
- package/esm/src/oauth/token-store/memory.d.ts +0 -2
- package/esm/src/oauth/token-store/memory.d.ts.map +1 -1
- package/esm/src/oauth/token-store/memory.js +4 -4
- package/esm/src/observability/auto-instrument/http-instrumentation.js +2 -2
- package/esm/src/observability/auto-instrument/types.d.ts +3 -8
- package/esm/src/observability/auto-instrument/types.d.ts.map +1 -1
- package/esm/src/observability/error-collector.d.ts.map +1 -1
- package/esm/src/observability/error-collector.js +6 -3
- package/esm/src/observability/log-buffer.d.ts.map +1 -1
- package/esm/src/observability/log-buffer.js +4 -3
- package/esm/src/observability/metrics/config.d.ts.map +1 -1
- package/esm/src/observability/metrics/config.js +4 -3
- package/esm/src/observability/simple-metrics/metrics-recorder.d.ts.map +1 -1
- package/esm/src/observability/simple-metrics/metrics-recorder.js +9 -5
- package/esm/src/observability/simple-metrics/otel-instruments.js +2 -2
- package/esm/src/observability/tracing/config.js +2 -2
- package/esm/src/platform/adapters/detect.d.ts +0 -1
- package/esm/src/platform/adapters/detect.d.ts.map +1 -1
- package/esm/src/platform/adapters/detect.js +0 -2
- package/esm/src/platform/adapters/fs/factory.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/factory.js +2 -4
- package/esm/src/platform/adapters/fs/github/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/github/adapter.js +2 -1
- package/esm/src/platform/adapters/fs/github/github-api-client.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/github/github-api-client.js +5 -2
- package/esm/src/platform/adapters/fs/github/stat-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/github/stat-operations.js +2 -1
- package/esm/src/platform/adapters/fs/github/types.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/github/types.js +12 -6
- package/esm/src/platform/adapters/fs/veryfront/adapter-content-context.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter-content-context.js +7 -2
- package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/adapter.js +12 -6
- package/esm/src/platform/adapters/fs/veryfront/api-search-circuit-breaker.d.ts +2 -1
- package/esm/src/platform/adapters/fs/veryfront/api-search-circuit-breaker.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/content-metrics.d.ts +1 -1
- package/esm/src/platform/adapters/fs/veryfront/content-metrics.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/file-list-index.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/file-list-index.js +2 -1
- package/esm/src/platform/adapters/fs/veryfront/in-flight-dedupe.d.ts +4 -3
- package/esm/src/platform/adapters/fs/veryfront/in-flight-dedupe.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/multi-project-adapter.d.ts +1 -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 +15 -7
- package/esm/src/platform/adapters/fs/veryfront/proxy-manager.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/proxy-manager.js +23 -16
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts +2 -2
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.js +5 -2
- 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 -4
- package/esm/src/platform/adapters/fs/veryfront/retry.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/retry.js +1 -0
- package/esm/src/platform/adapters/fs/veryfront/stat-operations-helpers.d.ts +2 -1
- package/esm/src/platform/adapters/fs/veryfront/stat-operations-helpers.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/stat-operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/stat-operations.js +6 -3
- package/esm/src/platform/adapters/fs/veryfront/types.d.ts +1 -4
- package/esm/src/platform/adapters/fs/veryfront/types.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts +2 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/websocket-manager.js +33 -20
- package/esm/src/platform/adapters/redis/modules.d.ts.map +1 -1
- package/esm/src/platform/adapters/redis/modules.js +9 -2
- package/esm/src/platform/adapters/registry.d.ts.map +1 -1
- package/esm/src/platform/adapters/registry.js +23 -10
- package/esm/src/platform/adapters/runtime/bun/filesystem-adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/bun/filesystem-adapter.js +5 -3
- package/esm/src/platform/adapters/runtime/deno/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/deno/adapter.js +23 -12
- package/esm/src/platform/adapters/runtime/node/filesystem-adapter.js +2 -2
- package/esm/src/platform/adapters/runtime/node/http-server.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/node/http-server.js +14 -4
- package/esm/src/platform/adapters/runtime/node/websocket-adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/node/websocket-adapter.js +10 -6
- package/esm/src/platform/adapters/runtime/shared/server-lifecycle.d.ts +0 -1
- package/esm/src/platform/adapters/runtime/shared/server-lifecycle.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/server-lifecycle.js +1 -1
- package/esm/src/platform/adapters/runtime/shared/shared-watcher.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/shared/shared-watcher.js +8 -4
- package/esm/src/platform/adapters/veryfront-api-client/client.d.ts +6 -6
- package/esm/src/platform/adapters/veryfront-api-client/client.d.ts.map +1 -1
- package/esm/src/platform/adapters/veryfront-api-client/client.js +11 -6
- package/esm/src/platform/adapters/veryfront-api-client/operations.d.ts.map +1 -1
- package/esm/src/platform/adapters/veryfront-api-client/operations.js +13 -4
- 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 +1 -0
- package/esm/src/platform/adapters/veryfront-api-client/schemas/api.schema.d.ts +34 -34
- package/esm/src/platform/cloud/resolver.d.ts +17 -0
- package/esm/src/platform/cloud/resolver.d.ts.map +1 -0
- package/esm/src/platform/cloud/resolver.js +67 -0
- package/esm/src/platform/compat/console/index.d.ts.map +1 -1
- package/esm/src/platform/compat/console/index.js +2 -1
- package/esm/src/platform/compat/dynamic-import.d.ts +1 -1
- package/esm/src/platform/compat/dynamic-import.d.ts.map +1 -1
- package/esm/src/platform/compat/dynamic-import.js +0 -1
- package/esm/src/platform/compat/esbuild-init.js +7 -6
- package/esm/src/platform/compat/esbuild.d.ts +0 -1
- package/esm/src/platform/compat/esbuild.d.ts.map +1 -1
- package/esm/src/platform/compat/esbuild.js +15 -13
- package/esm/src/platform/compat/fs.d.ts.map +1 -1
- package/esm/src/platform/compat/fs.js +29 -14
- package/esm/src/platform/compat/http/node-server.d.ts.map +1 -1
- package/esm/src/platform/compat/http/node-server.js +5 -3
- package/esm/src/platform/compat/http/responses.d.ts.map +1 -1
- package/esm/src/platform/compat/http/responses.js +4 -2
- package/esm/src/platform/compat/http/websocket.d.ts.map +1 -1
- package/esm/src/platform/compat/http/websocket.js +5 -2
- package/esm/src/platform/compat/opaque-deps.d.ts +0 -16
- package/esm/src/platform/compat/opaque-deps.d.ts.map +1 -1
- package/esm/src/platform/compat/opaque-deps.js +5 -0
- package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -1
- package/esm/src/platform/compat/path/basic-operations.js +4 -7
- package/esm/src/platform/compat/path/parse-format.js +3 -3
- package/esm/src/platform/compat/path/resolution.d.ts.map +1 -1
- package/esm/src/platform/compat/path/resolution.js +5 -8
- package/esm/src/platform/compat/path/runtime.js +2 -2
- package/esm/src/platform/compat/path/url-conversion.d.ts.map +1 -1
- package/esm/src/platform/compat/path/url-conversion.js +2 -1
- package/esm/src/platform/compat/process.d.ts +12 -0
- package/esm/src/platform/compat/process.d.ts.map +1 -1
- package/esm/src/platform/compat/process.js +86 -63
- package/esm/src/platform/compat/react-paths.js +2 -2
- package/esm/src/platform/compat/runtime.d.ts.map +1 -1
- package/esm/src/platform/compat/runtime.js +2 -1
- package/esm/src/platform/compat/stdin.d.ts.map +1 -1
- package/esm/src/platform/compat/stdin.js +12 -7
- package/esm/src/platform/core-platform.d.ts +3 -2
- package/esm/src/platform/core-platform.d.ts.map +1 -1
- package/esm/src/platform/core-platform.js +25 -8
- package/esm/src/prompt/schemas/prompt.schema.d.ts +2 -2
- package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +1 -1
- package/esm/src/provider/local/ai-sdk-adapter.js +3 -1
- package/esm/src/provider/local/env.d.ts +1 -1
- package/esm/src/provider/local/env.d.ts.map +1 -1
- package/esm/src/provider/local/env.js +4 -4
- package/esm/src/provider/local/local-embedding-engine.d.ts.map +1 -1
- package/esm/src/provider/local/local-embedding-engine.js +2 -2
- package/esm/src/provider/local/local-engine.d.ts +16 -1
- package/esm/src/provider/local/local-engine.d.ts.map +1 -1
- package/esm/src/provider/local/local-engine.js +38 -36
- package/esm/src/provider/model-registry.d.ts.map +1 -1
- package/esm/src/provider/model-registry.js +28 -4
- package/esm/src/provider/veryfront-cloud/provider.d.ts +3 -0
- package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -0
- package/esm/src/provider/veryfront-cloud/provider.js +48 -0
- package/esm/src/provider/veryfront-cloud/shared.d.ts +25 -0
- package/esm/src/provider/veryfront-cloud/shared.d.ts.map +1 -0
- package/esm/src/provider/veryfront-cloud/shared.js +89 -0
- package/esm/src/proxy/cache/memory-cache.d.ts.map +1 -1
- package/esm/src/proxy/cache/memory-cache.js +3 -2
- package/esm/src/proxy/cache/redis-cache.d.ts +1 -0
- package/esm/src/proxy/cache/redis-cache.d.ts.map +1 -1
- package/esm/src/proxy/cache/redis-cache.js +26 -19
- package/esm/src/proxy/cache/resilient-cache.d.ts.map +1 -1
- package/esm/src/proxy/cache/resilient-cache.js +11 -1
- package/esm/src/proxy/handler.d.ts.map +1 -1
- package/esm/src/proxy/handler.js +6 -4
- package/esm/src/proxy/logger.d.ts +1 -5
- package/esm/src/proxy/logger.d.ts.map +1 -1
- package/esm/src/proxy/logger.js +5 -4
- package/esm/src/proxy/main.js +9 -6
- package/esm/src/proxy/oauth-client.d.ts +2 -1
- package/esm/src/proxy/oauth-client.d.ts.map +1 -1
- package/esm/src/proxy/oauth-client.js +8 -3
- package/esm/src/proxy/renderer-router.js +1 -1
- package/esm/src/proxy/token-manager.d.ts +2 -1
- package/esm/src/proxy/token-manager.d.ts.map +1 -1
- package/esm/src/proxy/token-manager.js +12 -9
- package/esm/src/proxy/tracing.d.ts.map +1 -1
- package/esm/src/proxy/tracing.js +6 -5
- package/esm/src/react/compat/config-generator.d.ts +2 -1
- package/esm/src/react/compat/config-generator.d.ts.map +1 -1
- package/esm/src/react/compat/hooks-adapter.d.ts +4 -5
- package/esm/src/react/compat/hooks-adapter.d.ts.map +1 -1
- package/esm/src/react/compat/hooks-adapter.js +30 -21
- package/esm/src/react/compat/ssr-adapter/server-loader.d.ts.map +1 -1
- package/esm/src/react/compat/ssr-adapter/server-loader.js +7 -2
- package/esm/src/react/compat/version-detector/feature-detector.js +1 -1
- package/esm/src/react/compat/version-detector/version-cache.d.ts +2 -2
- package/esm/src/react/compat/version-detector/version-cache.d.ts.map +1 -1
- package/esm/src/react/compat/version-detector/version-cache.js +6 -5
- 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/ProviderComponent.d.ts +2 -1
- package/esm/src/react/components/ProviderComponent.d.ts.map +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/code-block.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/code-block.js +2 -1
- package/esm/src/react/components/ai/chat/components/message-actions.js +2 -2
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts +0 -5
- package/esm/src/react/components/ai/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/upgrade-cta.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/upgrade-cta.js +4 -3
- package/esm/src/react/components/ai/chat/components/uploads-panel.d.ts +1 -0
- package/esm/src/react/components/ai/chat/components/uploads-panel.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/components/uploads-panel.js +3 -1
- package/esm/src/react/components/ai/chat/composition/message.d.ts +0 -9
- package/esm/src/react/components/ai/chat/composition/message.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/composition/message.js +2 -1
- package/esm/src/react/components/ai/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/contexts/chat-context.js +4 -1
- package/esm/src/react/components/ai/chat/contexts/composer-context.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/contexts/composer-context.js +4 -1
- package/esm/src/react/components/ai/chat/contexts/message-context.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/contexts/message-context.js +4 -1
- package/esm/src/react/components/ai/chat/contexts/thread-list-context.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/contexts/thread-list-context.js +4 -1
- package/esm/src/react/components/ai/chat/hooks/use-threads.js +2 -2
- package/esm/src/react/components/ai/theme.d.ts +0 -69
- package/esm/src/react/components/ai/theme.d.ts.map +1 -1
- package/esm/src/react/components/ai/theme.js +2 -2
- package/esm/src/react/head-collector.d.ts +2 -1
- package/esm/src/react/head-collector.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.js +2 -6
- package/esm/src/rendering/app-reserved.js +2 -2
- package/esm/src/rendering/app-route-resolver.js +10 -9
- package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
- package/esm/src/rendering/cache/cache-coordinator.js +3 -1
- package/esm/src/rendering/cache/stores/api-store.d.ts.map +1 -1
- package/esm/src/rendering/cache/stores/api-store.js +33 -23
- package/esm/src/rendering/cache/stores/filesystem-store.d.ts.map +1 -1
- package/esm/src/rendering/cache/stores/filesystem-store.js +10 -8
- package/esm/src/rendering/cache/stores/memory-store.d.ts +2 -1
- package/esm/src/rendering/cache/stores/memory-store.d.ts.map +1 -1
- package/esm/src/rendering/cache/stores/redis-store.d.ts.map +1 -1
- package/esm/src/rendering/cache/stores/redis-store.js +15 -7
- package/esm/src/rendering/component-handling.d.ts +2 -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.map +1 -1
- package/esm/src/rendering/context/render-context.js +15 -9
- package/esm/src/rendering/element-validator/primitive-checks.d.ts.map +1 -1
- package/esm/src/rendering/element-validator/primitive-checks.js +2 -1
- package/esm/src/rendering/factories/service-factories.d.ts.map +1 -1
- package/esm/src/rendering/factories/service-factories.js +3 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.js +3 -3
- package/esm/src/rendering/layouts/layout-collector.d.ts +2 -8
- package/esm/src/rendering/layouts/layout-collector.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-collector.js +11 -4
- package/esm/src/rendering/layouts/utils/app-resolver.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/app-resolver.js +7 -2
- package/esm/src/rendering/layouts/utils/component-loader.js +1 -1
- package/esm/src/rendering/layouts/utils/hash-calculator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/hash-calculator.js +10 -7
- package/esm/src/rendering/orchestrator/css-cache.d.ts +0 -2
- package/esm/src/rendering/orchestrator/css-cache.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/css-cache.js +2 -2
- package/esm/src/rendering/orchestrator/css-candidate-manifest.js +1 -1
- package/esm/src/rendering/orchestrator/file-resolver/candidates.js +2 -2
- package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/html.js +9 -5
- package/esm/src/rendering/orchestrator/layout.d.ts +2 -7
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/layout.js +52 -42
- package/esm/src/rendering/orchestrator/lifecycle.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/lifecycle.js +9 -2
- package/esm/src/rendering/orchestrator/module-collection.d.ts +1 -1
- package/esm/src/rendering/orchestrator/module-collection.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-collection.js +1 -1
- package/esm/src/rendering/orchestrator/module-loader/esm-rewriter.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/esm-rewriter.js +4 -2
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/module-loader/index.js +7 -7
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/pipeline.js +135 -119
- package/esm/src/rendering/page-renderer.d.ts +3 -2
- package/esm/src/rendering/page-renderer.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.d.ts +2 -1
- package/esm/src/rendering/page-rendering.d.ts.map +1 -1
- package/esm/src/rendering/page-rendering.js +3 -1
- package/esm/src/rendering/page-resolution/page-resolver.d.ts +2 -0
- package/esm/src/rendering/page-resolution/page-resolver.d.ts.map +1 -1
- package/esm/src/rendering/page-resolution/page-resolver.js +4 -2
- package/esm/src/rendering/renderer-concurrency.d.ts +0 -11
- package/esm/src/rendering/renderer-concurrency.d.ts.map +1 -1
- package/esm/src/rendering/renderer-concurrency.js +6 -5
- package/esm/src/rendering/renderer.d.ts +0 -12
- package/esm/src/rendering/renderer.d.ts.map +1 -1
- package/esm/src/rendering/renderer.js +16 -28
- package/esm/src/rendering/router-detection.d.ts +12 -3
- package/esm/src/rendering/router-detection.d.ts.map +1 -1
- package/esm/src/rendering/router-detection.js +28 -10
- package/esm/src/rendering/rsc/client-boot.ts +1 -1
- package/esm/src/rendering/rsc/client-dom.ts +9 -11
- package/esm/src/rendering/rsc/client-hydrator.ts +11 -8
- package/esm/src/rendering/rsc/hydrate-client.ts +3 -2
- package/esm/src/rendering/rsc/server-renderer/component-detector.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/prop-serializer.js +2 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.d.ts.map +1 -1
- package/esm/src/rendering/rsc/server-renderer/rsc-renderer.js +3 -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 +3 -1
- package/esm/src/rendering/script-page-handling.js +3 -2
- package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.js +6 -2
- package/esm/src/rendering/shared/shared-services.d.ts.map +1 -1
- package/esm/src/rendering/shared/shared-services.js +4 -1
- package/esm/src/rendering/snippet-renderer.d.ts.map +1 -1
- package/esm/src/rendering/snippet-renderer.js +53 -39
- package/esm/src/rendering/ssr-globals/dom-stubs.d.ts.map +1 -1
- package/esm/src/rendering/ssr-globals/dom-stubs.js +9 -4
- package/esm/src/rendering/ssr-globals/fetch-interceptor.d.ts.map +1 -1
- package/esm/src/rendering/ssr-globals/fetch-interceptor.js +6 -4
- package/esm/src/rendering/ssr-globals/index.d.ts.map +1 -1
- package/esm/src/rendering/ssr-globals/index.js +2 -1
- package/esm/src/rendering/ssr-renderer.d.ts +2 -1
- package/esm/src/rendering/ssr-renderer.d.ts.map +1 -1
- package/esm/src/rendering/ssr-renderer.js +4 -2
- package/esm/src/rendering/utils/stream-utils.js +2 -2
- package/esm/src/routing/api/api-route-matcher.d.ts +0 -2
- package/esm/src/routing/api/api-route-matcher.d.ts.map +1 -1
- package/esm/src/routing/api/api-route-matcher.js +8 -5
- package/esm/src/routing/api/handler.d.ts +1 -1
- package/esm/src/routing/api/handler.d.ts.map +1 -1
- package/esm/src/routing/api/handler.js +5 -3
- package/esm/src/routing/api/index.d.ts +1 -1
- package/esm/src/routing/api/index.d.ts.map +1 -1
- package/esm/src/routing/api/index.js +1 -1
- package/esm/src/routing/api/module-loader/esbuild-plugin.d.ts +2 -1
- package/esm/src/routing/api/module-loader/esbuild-plugin.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/esbuild-plugin.js +3 -2
- package/esm/src/routing/api/module-loader/http-validator.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/http-validator.js +2 -1
- package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/loader.js +16 -15
- package/esm/src/routing/api/openapi/path-utils.d.ts +2 -1
- package/esm/src/routing/api/openapi/path-utils.d.ts.map +1 -1
- package/esm/src/routing/api/openapi/spec-generator.d.ts +5 -4
- package/esm/src/routing/api/openapi/spec-generator.d.ts.map +1 -1
- package/esm/src/routing/api/openapi/spec-generator.js +5 -5
- package/esm/src/routing/api/openapi/types.d.ts +6 -5
- package/esm/src/routing/api/openapi/types.d.ts.map +1 -1
- package/esm/src/routing/api/route-discovery.d.ts +3 -3
- package/esm/src/routing/api/route-discovery.d.ts.map +1 -1
- package/esm/src/routing/index.d.ts +1 -1
- package/esm/src/routing/index.d.ts.map +1 -1
- package/esm/src/routing/index.js +1 -1
- package/esm/src/routing/matchers/index.d.ts +1 -1
- package/esm/src/routing/matchers/index.d.ts.map +1 -1
- package/esm/src/routing/matchers/index.js +1 -1
- package/esm/src/routing/matchers/pattern-route-matcher.d.ts +0 -2
- package/esm/src/routing/matchers/pattern-route-matcher.d.ts.map +1 -1
- package/esm/src/routing/matchers/pattern-route-matcher.js +0 -2
- package/esm/src/sandbox/index.d.ts +1 -1
- package/esm/src/sandbox/index.js +1 -1
- package/esm/src/sandbox/sandbox.d.ts +6 -12
- package/esm/src/sandbox/sandbox.d.ts.map +1 -1
- package/esm/src/sandbox/sandbox.js +42 -19
- package/esm/src/security/client/html-sanitizer.d.ts +1 -9
- package/esm/src/security/client/html-sanitizer.d.ts.map +1 -1
- package/esm/src/security/client/html-sanitizer.js +4 -14
- package/esm/src/security/csrf/helpers.js +4 -4
- package/esm/src/security/http/auth.js +3 -3
- package/esm/src/security/http/base-handler.js +2 -2
- package/esm/src/security/http/middleware/config-loader.d.ts.map +1 -1
- package/esm/src/security/http/middleware/config-loader.js +2 -1
- package/esm/src/security/http/response/fluent-methods.d.ts.map +1 -1
- package/esm/src/security/http/response/fluent-methods.js +4 -3
- package/esm/src/security/http/response/security-handler.d.ts.map +1 -1
- package/esm/src/security/http/response/security-handler.js +6 -2
- package/esm/src/security/path-validation/canonical.d.ts.map +1 -1
- package/esm/src/security/path-validation/canonical.js +2 -1
- package/esm/src/security/path-validation/index.d.ts.map +1 -1
- package/esm/src/security/path-validation/index.js +2 -1
- package/esm/src/security/path-validation/rules.d.ts.map +1 -1
- package/esm/src/security/path-validation/rules.js +1 -2
- package/esm/src/security/secure-fs.d.ts +1 -1
- package/esm/src/security/secure-fs.d.ts.map +1 -1
- package/esm/src/security/secure-fs.js +7 -1
- package/esm/src/server/bootstrap.d.ts.map +1 -1
- package/esm/src/server/bootstrap.js +5 -3
- package/esm/src/server/build-app-route-renderer.d.ts.map +1 -1
- package/esm/src/server/build-app-route-renderer.js +3 -2
- package/esm/src/server/build-routes.js +2 -2
- package/esm/src/server/build-service-worker.d.ts.map +1 -1
- package/esm/src/server/build-service-worker.js +2 -1
- package/esm/src/server/context/cache-invalidation.d.ts +2 -1
- package/esm/src/server/context/cache-invalidation.d.ts.map +1 -1
- package/esm/src/server/context/cache-invalidation.js +8 -3
- package/esm/src/server/context/enriched-context.d.ts +4 -3
- package/esm/src/server/context/enriched-context.d.ts.map +1 -1
- package/esm/src/server/context/enriched-context.js +2 -1
- package/esm/src/server/dev-server/error-overlay/html-template.d.ts.map +1 -1
- package/esm/src/server/dev-server/error-overlay/html-template.js +8 -2
- package/esm/src/server/dev-server/file-watch-setup.d.ts +5 -0
- package/esm/src/server/dev-server/file-watch-setup.d.ts.map +1 -1
- package/esm/src/server/dev-server/file-watch-setup.js +19 -4
- package/esm/src/server/dev-server/middleware.d.ts +0 -6
- package/esm/src/server/dev-server/middleware.d.ts.map +1 -1
- package/esm/src/server/dev-server/middleware.js +11 -9
- package/esm/src/server/dev-server/request-handler.d.ts.map +1 -1
- package/esm/src/server/dev-server/request-handler.js +12 -7
- package/esm/src/server/dev-server/route-discovery.d.ts +2 -2
- package/esm/src/server/dev-server/route-discovery.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.js +11 -11
- package/esm/src/server/dev-server/types.d.ts +0 -2
- package/esm/src/server/dev-server/types.d.ts.map +1 -1
- package/esm/src/server/dev-ui/manifest.js +10 -10
- package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/api.js +26 -7
- package/esm/src/server/handlers/dev/dashboard/ui-handler.js +6 -6
- package/esm/src/server/handlers/dev/debug-context.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/debug-context.handler.js +4 -2
- package/esm/src/server/handlers/dev/endpoints.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/endpoints.handler.js +2 -1
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts +2 -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 +9 -5
- package/esm/src/server/handlers/dev/files/path-validator.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/path-validator.js +2 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +13 -6
- package/esm/src/server/handlers/dev/projects/ui-handler.js +6 -6
- package/esm/src/server/handlers/dev/scripts/hmr-scripts.d.ts +0 -6
- package/esm/src/server/handlers/dev/scripts/hmr-scripts.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/scripts/hmr-scripts.js +12 -12
- package/esm/src/server/handlers/dev/shared/ui-module-transform.d.ts +2 -1
- package/esm/src/server/handlers/dev/shared/ui-module-transform.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/styles-candidate-scanner.js +4 -3
- package/esm/src/server/handlers/dev/styles-css.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/styles-css.handler.js +2 -1
- package/esm/src/server/handlers/monitoring/client-log.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/monitoring/client-log.handler.js +6 -2
- package/esm/src/server/handlers/monitoring/health.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/monitoring/health.handler.js +4 -2
- package/esm/src/server/handlers/monitoring/memory.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/monitoring/memory.handler.js +7 -1
- package/esm/src/server/handlers/monitoring/metrics.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/monitoring/metrics.handler.js +3 -0
- package/esm/src/server/handlers/preview/hmr-client-manager.d.ts +2 -3
- package/esm/src/server/handlers/preview/hmr-client-manager.d.ts.map +1 -1
- package/esm/src/server/handlers/preview/hmr-client-manager.js +2 -11
- package/esm/src/server/handlers/preview/hmr-message-router.d.ts +2 -3
- package/esm/src/server/handlers/preview/hmr-message-router.d.ts.map +1 -1
- package/esm/src/server/handlers/preview/hmr-message-router.js +2 -2
- package/esm/src/server/handlers/preview/hmr-ping-keepalive.js +3 -3
- package/esm/src/server/handlers/preview/hmr.handler.js +8 -8
- package/esm/src/server/handlers/preview/markdown-html-generator.d.ts +2 -1
- package/esm/src/server/handlers/preview/markdown-html-generator.d.ts.map +1 -1
- package/esm/src/server/handlers/preview/markdown-html-generator.js +2 -2
- package/esm/src/server/handlers/preview/markdown-preview.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/preview/markdown-preview.handler.js +6 -5
- package/esm/src/server/handlers/request/api/app-router-resolver.d.ts.map +1 -1
- package/esm/src/server/handlers/request/api/app-router-resolver.js +94 -50
- package/esm/src/server/handlers/request/api/pages-api-handler.js +2 -2
- package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +1 -1
- package/esm/src/server/handlers/request/openapi-docs.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/openapi-docs.handler.js +3 -1
- package/esm/src/server/handlers/request/openapi.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/openapi.handler.js +7 -5
- package/esm/src/server/handlers/request/rsc/index.d.ts.map +1 -1
- package/esm/src/server/handlers/request/rsc/index.js +1 -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 +8 -6
- 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 +8 -5
- package/esm/src/server/handlers/request/ssr/ssr.handler.js +2 -2
- package/esm/src/server/handlers/response/cors.d.ts +0 -2
- package/esm/src/server/handlers/response/cors.d.ts.map +1 -1
- package/esm/src/server/handlers/response/cors.js +2 -74
- package/esm/src/server/handlers/studio/bridge-modules.handler.d.ts +0 -5
- package/esm/src/server/handlers/studio/bridge-modules.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/studio/bridge-modules.handler.js +3 -8
- package/esm/src/server/index.d.ts +0 -2
- package/esm/src/server/index.d.ts.map +1 -1
- package/esm/src/server/index.js +19 -19
- package/esm/src/server/production-server.d.ts.map +1 -1
- package/esm/src/server/production-server.js +14 -5
- package/esm/src/server/project-env/cache.js +2 -2
- package/esm/src/server/project-env/fetcher.d.ts.map +1 -1
- package/esm/src/server/project-env/fetcher.js +2 -1
- package/esm/src/server/reload-notifier.d.ts +1 -1
- package/esm/src/server/reload-notifier.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/adapter-factory.d.ts +3 -2
- package/esm/src/server/runtime-handler/adapter-factory.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/environment-resolution.d.ts +3 -2
- package/esm/src/server/runtime-handler/environment-resolution.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts +3 -2
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +15 -13
- package/esm/src/server/runtime-handler/isolation.d.ts +1 -1
- package/esm/src/server/runtime-handler/isolation.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/local-project-discovery.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/local-project-discovery.js +14 -4
- package/esm/src/server/runtime-handler/project-isolation.d.ts +2 -1
- package/esm/src/server/runtime-handler/project-isolation.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/project-resolution.d.ts +4 -4
- package/esm/src/server/runtime-handler/project-resolution.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-lifecycle.d.ts +1 -1
- package/esm/src/server/runtime-handler/request-lifecycle.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-tracker.d.ts +1 -1
- package/esm/src/server/runtime-handler/request-tracker.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-tracker.js +6 -2
- package/esm/src/server/runtime-handler/request-utils.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-utils.js +1 -1
- package/esm/src/server/runtime-handler/tracing.d.ts +1 -1
- package/esm/src/server/runtime-handler/tracing.d.ts.map +1 -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 +2 -1
- package/esm/src/server/services/rsc/endpoints/endpoint-router.d.ts +1 -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 +11 -4
- package/esm/src/server/services/rsc/endpoints/handler-registry.d.ts +1 -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 +6 -4
- package/esm/src/server/services/rsc/endpoints/script-handlers.d.ts +0 -2
- package/esm/src/server/services/rsc/endpoints/script-handlers.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/script-handlers.js +2 -2
- package/esm/src/server/services/rsc/endpoints/types.d.ts +1 -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.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/component-resolver.js +2 -1
- package/esm/src/server/services/rsc/orchestrators/manifest-handler.js +1 -1
- package/esm/src/server/services/rsc/orchestrators/page-handler.d.ts.map +1 -1
- package/esm/src/server/services/rsc/orchestrators/page-handler.js +2 -1
- package/esm/src/server/services/rsc/orchestrators/stream-handler.js +1 -1
- package/esm/src/server/services/static/static-file.service.d.ts +1 -1
- package/esm/src/server/services/static/static-file.service.d.ts.map +1 -1
- package/esm/src/server/services/static/static-file.service.js +6 -3
- package/esm/src/server/shared/renderer/adapter.d.ts.map +1 -1
- package/esm/src/server/shared/renderer/adapter.js +7 -4
- package/esm/src/server/utils/domain-lookup.d.ts +2 -1
- package/esm/src/server/utils/domain-lookup.d.ts.map +1 -1
- package/esm/src/server/utils/error-html.d.ts +2 -1
- package/esm/src/server/utils/error-html.d.ts.map +1 -1
- package/esm/src/skill/allowed-tools.d.ts +2 -1
- package/esm/src/skill/allowed-tools.d.ts.map +1 -1
- package/esm/src/skill/executor.d.ts +2 -9
- package/esm/src/skill/executor.d.ts.map +1 -1
- package/esm/src/skill/executor.js +19 -21
- package/esm/src/skill/parser.d.ts +2 -1
- package/esm/src/skill/parser.d.ts.map +1 -1
- package/esm/src/skill/parser.js +4 -4
- package/esm/src/skill/path-safety.d.ts.map +1 -1
- package/esm/src/skill/path-safety.js +8 -1
- package/esm/src/skill/tools.d.ts.map +1 -1
- package/esm/src/skill/tools.js +4 -2
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.js +1 -1
- package/esm/src/task/discovery.d.ts +1 -5
- package/esm/src/task/discovery.d.ts.map +1 -1
- package/esm/src/task/discovery.js +72 -7
- package/esm/src/tool/factory.d.ts.map +1 -1
- package/esm/src/tool/factory.js +1 -3
- package/esm/src/tool/schema/zod-json-schema.d.ts.map +1 -1
- package/esm/src/tool/schema/zod-json-schema.js +2 -1
- package/esm/src/tool/types.d.ts +2 -14
- package/esm/src/tool/types.d.ts.map +1 -1
- package/esm/src/transforms/esm/bundle-deps-validator.d.ts.map +1 -1
- package/esm/src/transforms/esm/bundle-deps-validator.js +15 -7
- package/esm/src/transforms/esm/bundle-manifest.d.ts +3 -6
- package/esm/src/transforms/esm/bundle-manifest.d.ts.map +1 -1
- package/esm/src/transforms/esm/bundle-manifest.js +9 -4
- package/esm/src/transforms/esm/bundle-recovery.d.ts.map +1 -1
- package/esm/src/transforms/esm/bundle-recovery.js +20 -15
- package/esm/src/transforms/esm/http-bundler.d.ts +0 -4
- package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-bundler.js +6 -15
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +2 -1
- package/esm/src/transforms/esm/http-cache-invariants.d.ts +0 -24
- package/esm/src/transforms/esm/http-cache-invariants.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-invariants.js +1 -27
- package/esm/src/transforms/esm/http-cache-types.d.ts +0 -15
- package/esm/src/transforms/esm/http-cache-types.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-wrapper.d.ts +2 -2
- package/esm/src/transforms/esm/http-cache-wrapper.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-wrapper.js +5 -3
- package/esm/src/transforms/esm/http-cache.d.ts +1 -3
- package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache.js +19 -8
- package/esm/src/transforms/esm/import-parser.d.ts +2 -1
- package/esm/src/transforms/esm/import-parser.d.ts.map +1 -1
- package/esm/src/transforms/esm/import-parser.js +10 -5
- package/esm/src/transforms/esm/in-flight-manager.d.ts +0 -5
- package/esm/src/transforms/esm/in-flight-manager.d.ts.map +1 -1
- package/esm/src/transforms/esm/in-flight-manager.js +16 -12
- package/esm/src/transforms/esm/package-registry.d.ts +0 -8
- package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
- package/esm/src/transforms/esm/package-registry.js +2 -17
- package/esm/src/transforms/esm/source-url-embed.d.ts +0 -3
- package/esm/src/transforms/esm/source-url-embed.d.ts.map +1 -1
- package/esm/src/transforms/esm/source-url-embed.js +2 -2
- package/esm/src/transforms/esm/specifier-resolver.d.ts +0 -7
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +1 -1
- package/esm/src/transforms/esm/transform-cache.d.ts +5 -29
- package/esm/src/transforms/esm/transform-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/transform-cache.js +1 -104
- package/esm/src/transforms/import-rewriter/strategies/import-map-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/import-map-strategy.js +4 -2
- package/esm/src/transforms/md/utils.d.ts +0 -5
- package/esm/src/transforms/md/utils.d.ts.map +1 -1
- package/esm/src/transforms/md/utils.js +1 -1
- package/esm/src/transforms/mdx/compiler/import-rewriter.d.ts.map +1 -1
- package/esm/src/transforms/mdx/compiler/import-rewriter.js +2 -1
- 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 +21 -12
- package/esm/src/transforms/mdx/esm-module-loader/constants.d.ts +0 -1
- package/esm/src/transforms/mdx/esm-module-loader/constants.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/constants.js +0 -1
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/import-transformer.js +13 -5
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.js +3 -4
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +17 -6
- package/esm/src/transforms/mdx/esm-module-loader/metadata/string-parser.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/metadata/string-parser.js +2 -1
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/missing-module.js +4 -3
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.js +14 -10
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.d.ts +0 -5
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.js +9 -7
- 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 +2 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.js +2 -2
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.d.ts +0 -14
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts +0 -14
- 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 +22 -9
- package/esm/src/transforms/mdx/esm-module-loader/resolution/file-finder.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/resolution/file-finder.js +4 -3
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +0 -13
- package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.js +2 -2
- package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/index.js +3 -2
- package/esm/src/transforms/pipeline/stages/compile.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/compile.js +5 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.js +18 -18
- 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 +9 -4
- package/esm/src/transforms/plugins/babel-node-positions.d.ts.map +1 -1
- package/esm/src/transforms/plugins/babel-node-positions.js +2 -1
- package/esm/src/transforms/plugins/plugin-loader.d.ts +0 -3
- package/esm/src/transforms/plugins/plugin-loader.d.ts.map +1 -1
- package/esm/src/transforms/plugins/rehype-node-positions.d.ts +2 -1
- package/esm/src/transforms/plugins/rehype-node-positions.d.ts.map +1 -1
- package/esm/src/transforms/shared/cross-project-import.d.ts +2 -1
- package/esm/src/transforms/shared/cross-project-import.d.ts.map +1 -1
- package/esm/src/transforms/veryfront-module-urls.d.ts +0 -1
- package/esm/src/transforms/veryfront-module-urls.d.ts.map +1 -1
- package/esm/src/transforms/veryfront-module-urls.js +0 -3
- package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
- package/esm/src/types/entities/getEntityInfo.js +16 -12
- package/esm/src/types/entities.d.ts +0 -5
- package/esm/src/types/entities.d.ts.map +1 -1
- package/esm/src/types/entities.js +0 -32
- package/esm/src/utils/box.js +1 -1
- package/esm/src/utils/bundle-manifest-init.d.ts +0 -2
- package/esm/src/utils/bundle-manifest-init.d.ts.map +1 -1
- package/esm/src/utils/bundle-manifest-init.js +0 -19
- package/esm/src/utils/bundle-manifest-kv.d.ts +2 -1
- package/esm/src/utils/bundle-manifest-kv.d.ts.map +1 -1
- package/esm/src/utils/bundle-manifest-redis.d.ts +2 -1
- package/esm/src/utils/bundle-manifest-redis.d.ts.map +1 -1
- package/esm/src/utils/cache-dir.d.ts.map +1 -1
- package/esm/src/utils/cache-dir.js +4 -5
- package/esm/src/utils/cache-file-ops.d.ts.map +1 -1
- package/esm/src/utils/cache-file-ops.js +2 -1
- package/esm/src/utils/circuit-breaker.d.ts +3 -9
- package/esm/src/utils/circuit-breaker.d.ts.map +1 -1
- package/esm/src/utils/circuit-breaker.js +13 -21
- package/esm/src/utils/constants/cache.js +2 -2
- package/esm/src/utils/env-loader.d.ts.map +1 -1
- package/esm/src/utils/env-loader.js +2 -1
- package/esm/src/utils/file-discovery.d.ts +3 -2
- package/esm/src/utils/file-discovery.d.ts.map +1 -1
- package/esm/src/utils/file-discovery.js +4 -4
- package/esm/src/utils/hash-utils.d.ts.map +1 -1
- package/esm/src/utils/hash-utils.js +5 -2
- package/esm/src/utils/import-lockfile.d.ts.map +1 -1
- package/esm/src/utils/import-lockfile.js +10 -4
- package/esm/src/utils/logger/core.d.ts.map +1 -1
- package/esm/src/utils/logger/core.js +2 -1
- package/esm/src/utils/logger/logger.d.ts +5 -5
- package/esm/src/utils/logger/logger.d.ts.map +1 -1
- package/esm/src/utils/logger/logger.js +12 -2
- package/esm/src/utils/lru-wrapper.d.ts +2 -1
- package/esm/src/utils/lru-wrapper.d.ts.map +1 -1
- package/esm/src/utils/lru-wrapper.js +3 -1
- package/esm/src/utils/memoize.d.ts.map +1 -1
- package/esm/src/utils/memoize.js +2 -2
- package/esm/src/utils/memory/profiler.d.ts.map +1 -1
- package/esm/src/utils/memory/profiler.js +15 -7
- package/esm/src/utils/parallel.d.ts.map +1 -1
- package/esm/src/utils/parallel.js +4 -1
- package/esm/src/utils/path-utils.d.ts.map +1 -1
- package/esm/src/utils/path-utils.js +13 -7
- package/esm/src/utils/platform.d.ts.map +1 -1
- package/esm/src/utils/platform.js +2 -1
- package/esm/src/utils/redis-client.d.ts +2 -4
- package/esm/src/utils/redis-client.d.ts.map +1 -1
- package/esm/src/utils/redis-client.js +9 -27
- package/esm/src/utils/route-path-utils.d.ts +3 -4
- package/esm/src/utils/route-path-utils.d.ts.map +1 -1
- package/esm/src/utils/route-path-utils.js +1 -1
- package/esm/src/workflow/api.d.ts +22 -2
- package/esm/src/workflow/api.d.ts.map +1 -1
- package/esm/src/workflow/api.js +14 -9
- package/esm/src/workflow/backends/memory.d.ts +2 -1
- package/esm/src/workflow/backends/memory.d.ts.map +1 -1
- package/esm/src/workflow/backends/memory.js +12 -7
- package/esm/src/workflow/backends/redis/index.d.ts.map +1 -1
- package/esm/src/workflow/backends/redis/index.js +35 -19
- package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts +41 -0
- package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts.map +1 -0
- package/esm/src/workflow/blob/veryfront-cloud-storage.js +348 -0
- package/esm/src/workflow/claude-code/agent.d.ts +15 -0
- package/esm/src/workflow/claude-code/agent.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/agent.js +20 -7
- package/esm/src/workflow/claude-code/event-publisher.d.ts +2 -0
- package/esm/src/workflow/claude-code/event-publisher.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/event-publisher.js +31 -10
- package/esm/src/workflow/claude-code/react/use-claude-code-stream.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/react/use-claude-code-stream.js +11 -3
- package/esm/src/workflow/claude-code/react/use-claude-code-websocket.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/react/use-claude-code-websocket.js +12 -4
- package/esm/src/workflow/claude-code/tool.d.ts +7 -7
- package/esm/src/workflow/claude-code/tool.js +3 -3
- package/esm/src/workflow/claude-code/types.d.ts +7 -6
- package/esm/src/workflow/claude-code/types.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/websocket-publisher.d.ts +0 -15
- package/esm/src/workflow/claude-code/websocket-publisher.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/websocket-publisher.js +28 -16
- package/esm/src/workflow/claude-code/workspace-sync.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/workspace-sync.js +27 -16
- package/esm/src/workflow/dsl/branch.d.ts.map +1 -1
- package/esm/src/workflow/dsl/branch.js +7 -4
- package/esm/src/workflow/dsl/loop.d.ts.map +1 -1
- package/esm/src/workflow/dsl/loop.js +16 -7
- package/esm/src/workflow/dsl/map.d.ts.map +1 -1
- package/esm/src/workflow/dsl/map.js +9 -4
- package/esm/src/workflow/dsl/parallel.d.ts.map +1 -1
- package/esm/src/workflow/dsl/parallel.js +7 -2
- package/esm/src/workflow/dsl/step.d.ts.map +1 -1
- package/esm/src/workflow/dsl/step.js +5 -2
- package/esm/src/workflow/dsl/sub-workflow.d.ts.map +1 -1
- package/esm/src/workflow/dsl/sub-workflow.js +4 -1
- package/esm/src/workflow/dsl/validation.d.ts.map +1 -1
- package/esm/src/workflow/dsl/validation.js +2 -1
- package/esm/src/workflow/dsl/wait.d.ts.map +1 -1
- package/esm/src/workflow/dsl/wait.js +2 -1
- package/esm/src/workflow/dsl/workflow.d.ts.map +1 -1
- package/esm/src/workflow/dsl/workflow.js +6 -4
- package/esm/src/workflow/executor/dag/graph.d.ts +2 -2
- package/esm/src/workflow/executor/dag/graph.d.ts.map +1 -1
- package/esm/src/workflow/executor/dag/graph.js +5 -2
- package/esm/src/workflow/executor/dag/index.d.ts.map +1 -1
- package/esm/src/workflow/executor/dag/index.js +9 -4
- package/esm/src/workflow/executor/dag/utils.d.ts.map +1 -1
- package/esm/src/workflow/executor/dag/utils.js +1 -0
- package/esm/src/workflow/executor/step-executor.d.ts.map +1 -1
- package/esm/src/workflow/executor/step-executor.js +24 -11
- package/esm/src/workflow/executor/workflow-executor.d.ts.map +1 -1
- package/esm/src/workflow/executor/workflow-executor.js +67 -34
- package/esm/src/workflow/react/use-approval.d.ts.map +1 -1
- package/esm/src/workflow/react/use-approval.js +9 -2
- package/esm/src/workflow/react/use-workflow-list.d.ts.map +1 -1
- package/esm/src/workflow/react/use-workflow-list.js +10 -3
- package/esm/src/workflow/react/use-workflow-start.d.ts.map +1 -1
- package/esm/src/workflow/react/use-workflow-start.js +5 -1
- package/esm/src/workflow/react/use-workflow.d.ts.map +1 -1
- package/esm/src/workflow/react/use-workflow.js +17 -5
- package/esm/src/workflow/registry.js +2 -2
- package/esm/src/workflow/runtime/approval-manager.d.ts.map +1 -1
- package/esm/src/workflow/runtime/approval-manager.js +9 -6
- package/esm/src/workflow/types.d.ts +0 -1
- package/esm/src/workflow/types.d.ts.map +1 -1
- package/esm/src/workflow/types.js +20 -11
- package/esm/src/workflow/worker/dynamic-job-entrypoint.d.ts +26 -0
- package/esm/src/workflow/worker/dynamic-job-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/dynamic-job-entrypoint.js +8 -8
- package/esm/src/workflow/worker/executors/k8s.d.ts.map +1 -1
- package/esm/src/workflow/worker/executors/k8s.js +5 -2
- package/esm/src/workflow/worker/executors/process.d.ts.map +1 -1
- package/esm/src/workflow/worker/executors/process.js +41 -30
- package/esm/src/workflow/worker/job-entrypoint.d.ts +21 -0
- package/esm/src/workflow/worker/job-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/job-entrypoint.js +7 -7
- package/esm/src/workflow/worker/job-manager.d.ts.map +1 -1
- package/esm/src/workflow/worker/job-manager.js +11 -4
- package/esm/src/workflow/worker/workflow-worker.d.ts.map +1 -1
- package/esm/src/workflow/worker/workflow-worker.js +15 -7
- package/package.json +1 -1
- package/src/_dnt.polyfills.ts +147 -147
- package/src/cli/commands/dev/command.ts +0 -1
- package/src/cli/commands/generate/integration-generator.ts +369 -34
- package/src/cli/commands/start/command.ts +0 -1
- package/src/cli/mcp/server.ts +18 -5
- package/src/cli/shared/server-startup.ts +0 -2
- package/src/cli/templates/index.ts +1 -17
- package/src/cli/templates/manifest.js +12 -12
- package/src/cli/ui/ansi.ts +1 -1
- package/src/deno.js +1 -1
- package/src/src/agent/ai-defaults.ts +4 -64
- package/src/src/agent/chat-handler.ts +39 -21
- package/src/src/agent/factory.ts +22 -6
- package/src/src/agent/index.ts +3 -9
- package/src/src/agent/memory/redis.ts +3 -2
- package/src/src/agent/react/use-agent.ts +4 -4
- package/src/src/agent/react/use-chat/browser-inference/browser-engine.ts +11 -2
- package/src/src/agent/react/use-chat/browser-inference/types.ts +6 -6
- package/src/src/agent/react/use-chat/browser-inference/worker-client.ts +1 -1
- package/src/src/agent/react/use-chat/streaming/handler.ts +10 -5
- package/src/src/agent/react/use-chat/types.ts +2 -2
- package/src/src/agent/react/use-chat/use-chat.ts +4 -4
- package/src/src/agent/react/use-voice-input.ts +2 -2
- package/src/src/agent/runtime/index.ts +16 -9
- package/src/src/agent/runtime/input-utils.ts +2 -1
- package/src/src/agent/runtime/model-resolution.ts +13 -0
- package/src/src/agent/runtime/tool-helpers.ts +2 -1
- package/src/src/agent/types.ts +16 -5
- package/src/src/build/bundler/code-splitter/entry-points.ts +1 -1
- package/src/src/build/bundler/code-splitter/index.ts +4 -2
- package/src/src/build/compiler/mdx-compiler/directory-compiler.ts +1 -1
- package/src/src/build/compiler/mdx-compiler/frontmatter-parser.ts +5 -3
- package/src/src/build/compiler/mdx-compiler/mdx-processor.ts +1 -1
- package/src/src/build/compiler/mdx-compiler/types.ts +1 -1
- package/src/src/build/compiler/mdx-compiler/validator.ts +4 -3
- package/src/src/build/compiler/mdx-compiler/watcher.ts +2 -1
- package/src/src/build/compiler/mdx-to-js.ts +1 -1
- package/src/src/build/config/environment.ts +9 -2
- package/src/src/build/embedded/preset.ts +7 -7
- package/src/src/build/production-build/asset-generation.ts +2 -2
- package/src/src/build/production-build/build/build-cleanup.ts +2 -9
- package/src/src/build/production-build/client-runtime.ts +6 -4
- package/src/src/build/production-build/templates.ts +2 -2
- package/src/src/cache/backends/api.ts +14 -5
- package/src/src/cache/backends/disk.ts +2 -1
- package/src/src/cache/backends/factory.ts +3 -1
- package/src/src/cache/backends/memory.ts +6 -3
- package/src/src/cache/cache-key-builder.ts +6 -4
- package/src/src/cache/config-hash.ts +1 -1
- package/src/src/cache/dependency-graph.ts +2 -1
- package/src/src/cache/distributed-cache-init.ts +1 -1
- package/src/src/cache/keys/builders/file.ts +4 -3
- package/src/src/cache/keys/builders/render.ts +7 -2
- package/src/src/cache/registry.ts +8 -2
- package/src/src/config/environment-config.ts +11 -2
- package/src/src/config/loader.ts +21 -4
- package/src/src/config/runtime-config.ts +4 -1
- package/src/src/data/data-fetcher.ts +1 -2
- package/src/src/data/static-data-fetcher.ts +2 -2
- package/src/src/discovery/file-discovery.ts +3 -2
- package/src/src/discovery/handlers/skill-handler.ts +2 -2
- package/src/src/discovery/import-rewriter.ts +8 -5
- package/src/src/discovery/transpiler.ts +8 -4
- package/src/src/embedding/chunk.ts +8 -2
- package/src/src/embedding/embedding.ts +4 -3
- package/src/src/embedding/index.ts +11 -10
- package/src/src/embedding/model-resolution.ts +23 -0
- package/src/src/embedding/rag-store.ts +431 -0
- package/src/src/embedding/react/use-uploads.ts +9 -6
- package/src/src/embedding/resolve.ts +6 -1
- package/src/src/embedding/types.ts +29 -17
- package/src/src/embedding/upload-handler.ts +94 -9
- package/src/src/embedding/upload-loader.ts +1 -1
- package/src/src/embedding/veryfront-cloud/provider.ts +42 -0
- package/src/src/embedding/veryfront-cloud/rag-store.ts +599 -0
- package/src/src/errors/catalog/general-errors.ts +11 -0
- package/src/src/errors/error-context.ts +3 -0
- package/src/src/errors/error-handlers.ts +3 -2
- package/src/src/errors/error-registry.ts +9 -0
- package/src/src/errors/index.ts +1 -0
- package/src/src/errors/logging.ts +8 -6
- package/src/src/errors/types.ts +3 -1
- package/src/src/errors/veryfront-error.ts +1 -2
- package/src/src/html/dev-scripts.ts +1 -1
- package/src/src/html/hydration-script-builder/dev-error-logger.ts +1 -1
- package/src/src/html/hydration-script-builder/dev-scripts.ts +1 -1
- package/src/src/html/hydration-script-builder/templates/renderer.ts +4 -3
- package/src/src/html/hydration-script-builder/templates/router.ts +5 -4
- package/src/src/html/styles-builder/css-hash-cache.ts +9 -8
- package/src/src/html/styles-builder/css-pregeneration.ts +1 -1
- package/src/src/html/styles-builder/index.ts +0 -1
- package/src/src/html/styles-builder/plugin-loader.ts +48 -28
- package/src/src/html/styles-builder/project-css-cache.ts +3 -3
- package/src/src/html/styles-builder/tailwind-compiler-cache.ts +12 -5
- package/src/src/html/styles-builder/tailwind-compiler-utils.ts +8 -6
- package/src/src/html/styles-builder/tailwind-compiler.ts +6 -11
- package/src/src/html/utils.ts +3 -3
- package/src/src/integrations/endpoint-executor.ts +5 -2
- package/src/src/integrations/types.ts +1 -1
- package/src/src/issues/core.ts +8 -5
- package/src/src/mcp/server.ts +4 -3
- package/src/src/mcp/types.ts +2 -3
- package/src/src/middleware/builtin/security/redis-rate-limit.ts +2 -1
- package/src/src/middleware/builtin/timeout.ts +1 -1
- package/src/src/modules/component-registry/registry.ts +5 -3
- package/src/src/modules/import-map/default-import-map.ts +1 -1
- package/src/src/modules/import-map/loader.ts +6 -6
- package/src/src/modules/import-map/preloader.ts +12 -9
- package/src/src/modules/import-map/resolver.ts +2 -1
- package/src/src/modules/react-loader/ssr-module-loader/cache/memory.ts +1 -1
- package/src/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.ts +5 -1
- package/src/src/modules/react-loader/ssr-module-loader/cross-project-import-loader.ts +9 -6
- package/src/src/modules/react-loader/ssr-module-loader/http-bundle-helpers.ts +9 -4
- package/src/src/modules/react-loader/ssr-module-loader/loader.ts +1 -1
- package/src/src/modules/react-loader/ssr-module-loader/preflight-imports.ts +3 -2
- package/src/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.ts +21 -11
- package/src/src/modules/react-loader/ssr-module-loader/vf-module-resolver.ts +11 -2
- package/src/src/modules/react-loader/unified-loader.ts +2 -2
- package/src/src/modules/server/module-batch-handler.ts +12 -6
- package/src/src/modules/server/module-server.ts +12 -44
- package/src/src/modules/server/ssr-import-rewriter.ts +1 -1
- package/src/src/modules/server/websocket-handler.ts +1 -1
- package/src/src/oauth/providers/base.ts +49 -15
- package/src/src/oauth/token-store/memory.ts +5 -5
- package/src/src/observability/auto-instrument/http-instrumentation.ts +2 -2
- package/src/src/observability/auto-instrument/types.ts +3 -3
- package/src/src/observability/error-collector.ts +7 -5
- package/src/src/observability/log-buffer.ts +4 -3
- package/src/src/observability/metrics/config.ts +4 -3
- package/src/src/observability/simple-metrics/metrics-recorder.ts +7 -4
- package/src/src/observability/simple-metrics/otel-instruments.ts +2 -2
- package/src/src/observability/tracing/config.ts +2 -2
- package/src/src/platform/adapters/detect.ts +0 -3
- package/src/src/platform/adapters/fs/factory.ts +2 -10
- package/src/src/platform/adapters/fs/github/adapter.ts +2 -1
- package/src/src/platform/adapters/fs/github/github-api-client.ts +6 -2
- package/src/src/platform/adapters/fs/github/stat-operations.ts +2 -1
- package/src/src/platform/adapters/fs/github/types.ts +13 -6
- package/src/src/platform/adapters/fs/veryfront/adapter-content-context.ts +7 -4
- package/src/src/platform/adapters/fs/veryfront/adapter.ts +13 -6
- package/src/src/platform/adapters/fs/veryfront/api-search-circuit-breaker.ts +1 -1
- package/src/src/platform/adapters/fs/veryfront/content-metrics.ts +1 -1
- package/src/src/platform/adapters/fs/veryfront/file-list-index.ts +2 -1
- package/src/src/platform/adapters/fs/veryfront/in-flight-dedupe.ts +3 -3
- package/src/src/platform/adapters/fs/veryfront/multi-project-adapter.ts +16 -9
- package/src/src/platform/adapters/fs/veryfront/proxy-manager.ts +18 -21
- package/src/src/platform/adapters/fs/veryfront/read-operations-helpers.ts +6 -5
- package/src/src/platform/adapters/fs/veryfront/read-operations.ts +9 -7
- package/src/src/platform/adapters/fs/veryfront/retry.ts +1 -0
- package/src/src/platform/adapters/fs/veryfront/stat-operations-helpers.ts +1 -1
- package/src/src/platform/adapters/fs/veryfront/stat-operations.ts +7 -3
- package/src/src/platform/adapters/fs/veryfront/types.ts +1 -4
- package/src/src/platform/adapters/fs/veryfront/websocket-manager.ts +37 -19
- package/src/src/platform/adapters/redis/modules.ts +10 -4
- package/src/src/platform/adapters/registry.ts +21 -18
- package/src/src/platform/adapters/runtime/bun/filesystem-adapter.ts +5 -3
- package/src/src/platform/adapters/runtime/deno/adapter.ts +23 -12
- package/src/src/platform/adapters/runtime/node/filesystem-adapter.ts +2 -2
- package/src/src/platform/adapters/runtime/node/http-server.ts +15 -5
- package/src/src/platform/adapters/runtime/node/websocket-adapter.ts +8 -5
- package/src/src/platform/adapters/runtime/shared/server-lifecycle.ts +1 -1
- package/src/src/platform/adapters/runtime/shared/shared-watcher.ts +7 -4
- package/src/src/platform/adapters/veryfront-api-client/client.ts +12 -6
- package/src/src/platform/adapters/veryfront-api-client/operations.ts +15 -4
- package/src/src/platform/adapters/veryfront-api-client/retry-handler.ts +1 -0
- package/src/src/platform/cloud/resolver.ts +104 -0
- package/src/src/platform/compat/console/index.ts +2 -1
- package/src/src/platform/compat/dynamic-import.ts +3 -2
- package/src/src/platform/compat/esbuild-init.ts +7 -6
- package/src/src/platform/compat/esbuild.ts +12 -13
- package/src/src/platform/compat/fs.ts +30 -15
- package/src/src/platform/compat/http/node-server.ts +5 -3
- package/src/src/platform/compat/http/responses.ts +4 -2
- package/src/src/platform/compat/http/websocket.ts +4 -3
- package/src/src/platform/compat/opaque-deps.ts +6 -1
- package/src/src/platform/compat/path/basic-operations.ts +5 -9
- package/src/src/platform/compat/path/parse-format.ts +5 -5
- package/src/src/platform/compat/path/resolution.ts +6 -10
- package/src/src/platform/compat/path/runtime.ts +2 -2
- package/src/src/platform/compat/path/url-conversion.ts +2 -1
- package/src/src/platform/compat/process.ts +78 -49
- package/src/src/platform/compat/react-paths.ts +2 -2
- package/src/src/platform/compat/runtime.ts +2 -1
- package/src/src/platform/compat/stdin.ts +10 -8
- package/src/src/platform/core-platform.ts +33 -10
- package/src/src/provider/local/ai-sdk-adapter.ts +7 -5
- package/src/src/provider/local/env.ts +6 -4
- package/src/src/provider/local/local-embedding-engine.ts +10 -5
- package/src/src/provider/local/local-engine.ts +76 -41
- package/src/src/provider/model-registry.ts +36 -5
- package/src/src/provider/veryfront-cloud/provider.ts +62 -0
- package/src/src/provider/veryfront-cloud/shared.ts +136 -0
- package/src/src/proxy/cache/memory-cache.ts +3 -2
- package/src/src/proxy/cache/redis-cache.ts +28 -19
- package/src/src/proxy/cache/resilient-cache.ts +11 -1
- package/src/src/proxy/handler.ts +6 -4
- package/src/src/proxy/logger.ts +6 -5
- package/src/src/proxy/main.ts +11 -6
- package/src/src/proxy/oauth-client.ts +9 -6
- package/src/src/proxy/renderer-router.ts +1 -1
- package/src/src/proxy/token-manager.ts +13 -10
- package/src/src/proxy/tracing.ts +6 -5
- package/src/src/react/compat/config-generator.ts +1 -1
- package/src/src/react/compat/hooks-adapter.ts +44 -23
- package/src/src/react/compat/ssr-adapter/server-loader.ts +7 -2
- package/src/src/react/compat/version-detector/feature-detector.ts +1 -1
- package/src/src/react/compat/version-detector/version-cache.ts +9 -5
- package/src/src/react/components/LayoutComponent.tsx +1 -1
- package/src/src/react/components/ProviderComponent.tsx +1 -1
- package/src/src/react/components/ai/agent-card.tsx +3 -3
- package/src/src/react/components/ai/chat/components/code-block.tsx +2 -1
- package/src/src/react/components/ai/chat/components/message-actions.tsx +2 -2
- package/src/src/react/components/ai/chat/components/reasoning.tsx +1 -1
- package/src/src/react/components/ai/chat/components/upgrade-cta.tsx +4 -3
- package/src/src/react/components/ai/chat/components/uploads-panel.tsx +17 -3
- package/src/src/react/components/ai/chat/composition/message.tsx +5 -4
- package/src/src/react/components/ai/chat/contexts/chat-context.tsx +4 -1
- package/src/src/react/components/ai/chat/contexts/composer-context.tsx +4 -1
- package/src/src/react/components/ai/chat/contexts/message-context.tsx +4 -1
- package/src/src/react/components/ai/chat/contexts/thread-list-context.tsx +4 -1
- package/src/src/react/components/ai/chat/hooks/use-threads.ts +2 -2
- package/src/src/react/components/ai/theme.ts +2 -2
- package/src/src/react/head-collector.ts +1 -1
- package/src/src/react/primitives/input-box.tsx +2 -4
- package/src/src/rendering/app-reserved.ts +2 -2
- package/src/src/rendering/app-route-resolver.ts +10 -9
- package/src/src/rendering/cache/cache-coordinator.ts +4 -1
- package/src/src/rendering/cache/stores/api-store.ts +23 -14
- package/src/src/rendering/cache/stores/filesystem-store.ts +10 -8
- package/src/src/rendering/cache/stores/memory-store.ts +1 -1
- package/src/src/rendering/cache/stores/redis-store.ts +15 -7
- package/src/src/rendering/component-handling.ts +2 -2
- package/src/src/rendering/context/render-context.ts +15 -6
- package/src/src/rendering/element-validator/primitive-checks.ts +3 -2
- package/src/src/rendering/factories/service-factories.ts +3 -1
- package/src/src/rendering/layouts/layout-applicator.ts +8 -5
- package/src/src/rendering/layouts/layout-collector.ts +14 -7
- package/src/src/rendering/layouts/utils/app-resolver.ts +9 -6
- package/src/src/rendering/layouts/utils/component-loader.ts +1 -1
- package/src/src/rendering/layouts/utils/hash-calculator.ts +7 -5
- package/src/src/rendering/orchestrator/css-cache.ts +2 -2
- package/src/src/rendering/orchestrator/css-candidate-manifest.ts +1 -1
- package/src/src/rendering/orchestrator/file-resolver/candidates.ts +2 -2
- package/src/src/rendering/orchestrator/html.ts +9 -5
- package/src/src/rendering/orchestrator/layout.ts +42 -31
- package/src/src/rendering/orchestrator/lifecycle.ts +10 -2
- package/src/src/rendering/orchestrator/module-collection.ts +2 -3
- package/src/src/rendering/orchestrator/module-loader/esm-rewriter.ts +4 -1
- package/src/src/rendering/orchestrator/module-loader/index.ts +11 -8
- package/src/src/rendering/orchestrator/pipeline.ts +36 -25
- package/src/src/rendering/page-renderer.ts +2 -2
- package/src/src/rendering/page-rendering.ts +4 -2
- package/src/src/rendering/page-resolution/page-resolver.ts +5 -0
- package/src/src/rendering/renderer-concurrency.ts +6 -5
- package/src/src/rendering/renderer.ts +16 -31
- package/src/src/rendering/router-detection.ts +40 -9
- package/src/src/rendering/rsc/server-renderer/component-detector.ts +1 -0
- package/src/src/rendering/rsc/server-renderer/prop-serializer.ts +2 -1
- package/src/src/rendering/rsc/server-renderer/rsc-renderer.ts +1 -0
- package/src/src/rendering/rsc/server-renderer/tree-processor.ts +1 -0
- package/src/src/rendering/script-page-handling.ts +3 -2
- package/src/src/rendering/shared/context-aware-cache.ts +7 -2
- package/src/src/rendering/shared/shared-services.ts +4 -1
- package/src/src/rendering/snippet-renderer.ts +46 -37
- package/src/src/rendering/ssr-globals/dom-stubs.ts +10 -4
- package/src/src/rendering/ssr-globals/fetch-interceptor.ts +6 -4
- package/src/src/rendering/ssr-globals/index.ts +2 -1
- package/src/src/rendering/ssr-renderer.ts +9 -2
- package/src/src/rendering/utils/stream-utils.ts +2 -2
- package/src/src/routing/api/api-route-matcher.ts +10 -6
- package/src/src/routing/api/handler.ts +7 -4
- package/src/src/routing/api/index.ts +1 -1
- package/src/src/routing/api/module-loader/esbuild-plugin.ts +4 -3
- package/src/src/routing/api/module-loader/http-validator.ts +2 -1
- package/src/src/routing/api/module-loader/loader.ts +15 -14
- package/src/src/routing/api/openapi/path-utils.ts +1 -1
- package/src/src/routing/api/openapi/spec-generator.ts +9 -8
- package/src/src/routing/api/openapi/types.ts +5 -5
- package/src/src/routing/api/route-discovery.ts +3 -3
- package/src/src/routing/index.ts +1 -1
- package/src/src/routing/matchers/index.ts +1 -1
- package/src/src/routing/matchers/pattern-route-matcher.ts +0 -3
- package/src/src/sandbox/index.ts +1 -1
- package/src/src/sandbox/sandbox.ts +58 -23
- package/src/src/security/client/html-sanitizer.ts +5 -16
- package/src/src/security/csrf/helpers.ts +4 -4
- package/src/src/security/http/auth.ts +3 -3
- package/src/src/security/http/base-handler.ts +2 -2
- package/src/src/security/http/middleware/config-loader.ts +2 -1
- package/src/src/security/http/response/fluent-methods.ts +7 -3
- package/src/src/security/http/response/security-handler.ts +8 -2
- package/src/src/security/path-validation/canonical.ts +2 -1
- package/src/src/security/path-validation/index.ts +2 -1
- package/src/src/security/path-validation/rules.ts +1 -2
- package/src/src/security/secure-fs.ts +8 -2
- package/src/src/server/bootstrap.ts +5 -5
- package/src/src/server/build-app-route-renderer.ts +3 -2
- package/src/src/server/build-routes.ts +2 -2
- package/src/src/server/build-service-worker.ts +2 -1
- package/src/src/server/context/cache-invalidation.ts +11 -4
- package/src/src/server/context/enriched-context.ts +5 -4
- package/src/src/server/dev-server/error-overlay/html-template.ts +11 -2
- package/src/src/server/dev-server/file-watch-setup.ts +23 -4
- package/src/src/server/dev-server/middleware.ts +11 -8
- package/src/src/server/dev-server/request-handler.ts +11 -7
- package/src/src/server/dev-server/route-discovery.ts +2 -2
- package/src/src/server/dev-server/server.ts +12 -15
- package/src/src/server/dev-server/types.ts +0 -2
- package/src/src/server/dev-ui/manifest.js +10 -10
- package/src/src/server/handlers/dev/dashboard/api.ts +28 -9
- package/src/src/server/handlers/dev/dashboard/ui-handler.ts +6 -6
- package/src/src/server/handlers/dev/debug-context.handler.ts +4 -2
- package/src/src/server/handlers/dev/endpoints.handler.ts +3 -1
- package/src/src/server/handlers/dev/files/esbuild-plugins.ts +10 -5
- package/src/src/server/handlers/dev/files/path-validator.ts +2 -1
- package/src/src/server/handlers/dev/framework-candidates.generated.ts +13 -6
- package/src/src/server/handlers/dev/projects/ui-handler.ts +6 -6
- package/src/src/server/handlers/dev/scripts/hmr-scripts.ts +13 -13
- package/src/src/server/handlers/dev/shared/ui-module-transform.ts +1 -1
- package/src/src/server/handlers/dev/styles-candidate-scanner.ts +4 -3
- package/src/src/server/handlers/dev/styles-css.handler.ts +2 -1
- package/src/src/server/handlers/monitoring/client-log.handler.ts +9 -3
- package/src/src/server/handlers/monitoring/health.handler.ts +4 -2
- package/src/src/server/handlers/monitoring/memory.handler.ts +9 -1
- package/src/src/server/handlers/monitoring/metrics.handler.ts +3 -0
- package/src/src/server/handlers/preview/hmr-client-manager.ts +3 -12
- package/src/src/server/handlers/preview/hmr-message-router.ts +3 -3
- package/src/src/server/handlers/preview/hmr-ping-keepalive.ts +3 -3
- package/src/src/server/handlers/preview/hmr.handler.ts +8 -8
- package/src/src/server/handlers/preview/markdown-html-generator.ts +3 -3
- package/src/src/server/handlers/preview/markdown-preview.handler.ts +6 -5
- package/src/src/server/handlers/request/api/app-router-resolver.ts +130 -51
- package/src/src/server/handlers/request/api/pages-api-handler.ts +2 -2
- package/src/src/server/handlers/request/module/page-data-endpoint-handler.ts +1 -1
- package/src/src/server/handlers/request/openapi-docs.handler.ts +4 -1
- package/src/src/server/handlers/request/openapi.handler.ts +8 -5
- package/src/src/server/handlers/request/rsc/index.ts +1 -0
- package/src/src/server/handlers/request/ssr/error-page-fallback.ts +8 -6
- package/src/src/server/handlers/request/ssr/not-found-fallback.ts +8 -5
- package/src/src/server/handlers/request/ssr/ssr.handler.ts +2 -2
- package/src/src/server/handlers/response/cors.ts +2 -82
- package/src/src/server/handlers/studio/bridge-modules.handler.ts +4 -9
- package/src/src/server/index.ts +20 -26
- package/src/src/server/production-server.ts +22 -5
- package/src/src/server/project-env/cache.ts +2 -2
- package/src/src/server/project-env/fetcher.ts +2 -1
- package/src/src/server/reload-notifier.ts +1 -1
- package/src/src/server/runtime-handler/adapter-factory.ts +2 -2
- package/src/src/server/runtime-handler/environment-resolution.ts +2 -2
- package/src/src/server/runtime-handler/handler-context-builder.ts +2 -2
- package/src/src/server/runtime-handler/index.ts +16 -16
- package/src/src/server/runtime-handler/isolation.ts +1 -1
- package/src/src/server/runtime-handler/local-project-discovery.ts +14 -4
- package/src/src/server/runtime-handler/project-isolation.ts +1 -1
- package/src/src/server/runtime-handler/project-resolution.ts +4 -4
- package/src/src/server/runtime-handler/request-lifecycle.ts +1 -1
- package/src/src/server/runtime-handler/request-tracker.ts +9 -3
- package/src/src/server/runtime-handler/request-utils.ts +1 -1
- package/src/src/server/runtime-handler/tracing.ts +1 -1
- package/src/src/server/services/rsc/endpoints/action-handler.ts +2 -1
- package/src/src/server/services/rsc/endpoints/endpoint-router.ts +12 -4
- package/src/src/server/services/rsc/endpoints/handler-registry.ts +9 -4
- package/src/src/server/services/rsc/endpoints/script-handlers.ts +2 -2
- package/src/src/server/services/rsc/endpoints/types.ts +1 -0
- package/src/src/server/services/rsc/orchestrators/component-resolver.ts +2 -1
- package/src/src/server/services/rsc/orchestrators/manifest-handler.ts +1 -1
- package/src/src/server/services/rsc/orchestrators/page-handler.ts +2 -1
- package/src/src/server/services/rsc/orchestrators/render-handler.ts +3 -3
- package/src/src/server/services/rsc/orchestrators/stream-handler.ts +1 -1
- package/src/src/server/services/static/static-file.service.ts +7 -4
- package/src/src/server/shared/renderer/adapter.ts +9 -4
- package/src/src/server/utils/domain-lookup.ts +1 -1
- package/src/src/server/utils/error-html.ts +1 -1
- package/src/src/skill/allowed-tools.ts +1 -1
- package/src/src/skill/executor.ts +21 -23
- package/src/src/skill/parser.ts +5 -5
- package/src/src/skill/path-safety.ts +11 -2
- package/src/src/skill/tools.ts +5 -2
- package/src/src/studio/bridge/bridge-bundle.generated.ts +1 -1
- package/src/src/task/discovery.ts +81 -7
- package/src/src/tool/factory.ts +1 -2
- package/src/src/tool/schema/zod-json-schema.ts +14 -8
- package/src/src/tool/types.ts +4 -4
- package/src/src/transforms/esm/bundle-deps-validator.ts +14 -7
- package/src/src/transforms/esm/bundle-manifest.ts +9 -5
- package/src/src/transforms/esm/bundle-recovery.ts +19 -15
- package/src/src/transforms/esm/http-bundler.ts +6 -20
- package/src/src/transforms/esm/http-cache-helpers.ts +2 -1
- package/src/src/transforms/esm/http-cache-invariants.ts +1 -30
- package/src/src/transforms/esm/http-cache-types.ts +2 -2
- package/src/src/transforms/esm/http-cache-wrapper.ts +6 -4
- package/src/src/transforms/esm/http-cache.ts +25 -17
- package/src/src/transforms/esm/import-parser.ts +11 -6
- package/src/src/transforms/esm/in-flight-manager.ts +15 -12
- package/src/src/transforms/esm/package-registry.ts +2 -22
- package/src/src/transforms/esm/source-url-embed.ts +2 -2
- package/src/src/transforms/esm/specifier-resolver.ts +1 -1
- package/src/src/transforms/esm/transform-cache.ts +5 -154
- package/src/src/transforms/import-rewriter/strategies/import-map-strategy.ts +4 -2
- package/src/src/transforms/md/utils.ts +1 -1
- package/src/src/transforms/mdx/compiler/import-rewriter.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/cache/index.ts +22 -12
- package/src/src/transforms/mdx/esm-module-loader/constants.ts +0 -1
- package/src/src/transforms/mdx/esm-module-loader/import-transformer.ts +13 -5
- package/src/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.ts +5 -6
- package/src/src/transforms/mdx/esm-module-loader/loader-helpers.ts +18 -14
- package/src/src/transforms/mdx/esm-module-loader/metadata/string-parser.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/missing-module.ts +4 -3
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.ts +18 -15
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/framework-validator.ts +9 -7
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts +2 -1
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.ts +2 -2
- package/src/src/transforms/mdx/esm-module-loader/module-fetcher/render-sessions.ts +1 -1
- package/src/src/transforms/mdx/esm-module-loader/module-writer.ts +30 -21
- package/src/src/transforms/mdx/esm-module-loader/resolution/file-finder.ts +4 -3
- package/src/src/transforms/mdx/esm-module-loader/types.ts +3 -3
- package/src/src/transforms/mdx/esm-module-loader/utils/stub-module.ts +2 -2
- package/src/src/transforms/pipeline/index.ts +3 -2
- package/src/src/transforms/pipeline/stages/compile.ts +5 -1
- package/src/src/transforms/pipeline/stages/ssr-vf-modules/path-resolver.ts +18 -18
- package/src/src/transforms/pipeline/stages/ssr-vf-modules/transform.ts +9 -6
- package/src/src/transforms/plugins/babel-node-positions.ts +2 -2
- package/src/src/transforms/plugins/plugin-loader.ts +1 -1
- package/src/src/transforms/plugins/rehype-node-positions.ts +1 -1
- package/src/src/transforms/shared/cross-project-import.ts +1 -1
- package/src/src/transforms/veryfront-module-urls.ts +0 -4
- package/src/src/types/entities/getEntityInfo.ts +22 -16
- package/src/src/types/entities.ts +0 -45
- package/src/src/utils/box.ts +1 -1
- package/src/src/utils/bundle-manifest-init.ts +0 -25
- package/src/src/utils/bundle-manifest-kv.ts +1 -1
- package/src/src/utils/bundle-manifest-redis.ts +1 -1
- package/src/src/utils/cache-dir.ts +4 -5
- package/src/src/utils/cache-file-ops.ts +2 -1
- package/src/src/utils/circuit-breaker.ts +19 -28
- package/src/src/utils/constants/cache.ts +2 -2
- package/src/src/utils/env-loader.ts +2 -1
- package/src/src/utils/file-discovery.ts +6 -6
- package/src/src/utils/hash-utils.ts +6 -2
- package/src/src/utils/import-lockfile.ts +12 -8
- package/src/src/utils/logger/core.ts +2 -1
- package/src/src/utils/logger/logger.ts +17 -7
- package/src/src/utils/lru-wrapper.ts +5 -2
- package/src/src/utils/memoize.ts +2 -3
- package/src/src/utils/memory/profiler.ts +18 -7
- package/src/src/utils/parallel.ts +5 -3
- package/src/src/utils/path-utils.ts +11 -9
- package/src/src/utils/platform.ts +2 -1
- package/src/src/utils/redis-client.ts +11 -33
- package/src/src/utils/route-path-utils.ts +3 -3
- package/src/src/workflow/api.ts +9 -9
- package/src/src/workflow/backends/memory.ts +13 -6
- package/src/src/workflow/backends/redis/index.ts +32 -16
- package/src/src/workflow/blob/veryfront-cloud-storage.ts +520 -0
- package/src/src/workflow/claude-code/agent.ts +35 -8
- package/src/src/workflow/claude-code/event-publisher.ts +33 -10
- package/src/src/workflow/claude-code/react/use-claude-code-stream.ts +13 -4
- package/src/src/workflow/claude-code/react/use-claude-code-websocket.ts +14 -5
- package/src/src/workflow/claude-code/tool.ts +3 -3
- package/src/src/workflow/claude-code/types.ts +5 -6
- package/src/src/workflow/claude-code/websocket-publisher.ts +32 -17
- package/src/src/workflow/claude-code/workspace-sync.ts +29 -18
- package/src/src/workflow/dsl/branch.ts +7 -2
- package/src/src/workflow/dsl/loop.ts +18 -8
- package/src/src/workflow/dsl/map.ts +9 -2
- package/src/src/workflow/dsl/parallel.ts +7 -4
- package/src/src/workflow/dsl/step.ts +5 -2
- package/src/src/workflow/dsl/sub-workflow.ts +4 -1
- package/src/src/workflow/dsl/validation.ts +3 -1
- package/src/src/workflow/dsl/wait.ts +2 -1
- package/src/src/workflow/dsl/workflow.ts +6 -3
- package/src/src/workflow/executor/dag/graph.ts +6 -3
- package/src/src/workflow/executor/dag/index.ts +10 -7
- package/src/src/workflow/executor/dag/utils.ts +1 -0
- package/src/src/workflow/executor/step-executor.ts +33 -12
- package/src/src/workflow/executor/workflow-executor.ts +73 -33
- package/src/src/workflow/react/use-approval.ts +9 -2
- package/src/src/workflow/react/use-workflow-list.ts +11 -2
- package/src/src/workflow/react/use-workflow-start.ts +5 -3
- package/src/src/workflow/react/use-workflow.ts +18 -5
- package/src/src/workflow/registry.ts +2 -2
- package/src/src/workflow/runtime/approval-manager.ts +10 -6
- package/src/src/workflow/types.ts +24 -12
- package/src/src/workflow/worker/dynamic-job-entrypoint.ts +10 -10
- package/src/src/workflow/worker/executors/k8s.ts +6 -2
- package/src/src/workflow/worker/executors/process.ts +41 -32
- package/src/src/workflow/worker/job-entrypoint.ts +7 -8
- package/src/src/workflow/worker/job-manager.ts +14 -4
- package/src/src/workflow/worker/workflow-worker.ts +14 -6
- package/esm/src/build/vendor-bundle.d.ts +0 -32
- package/esm/src/build/vendor-bundle.d.ts.map +0 -1
- package/esm/src/build/vendor-bundle.js +0 -110
- package/esm/src/build/vendor-cache.d.ts +0 -18
- package/esm/src/build/vendor-cache.d.ts.map +0 -1
- package/esm/src/build/vendor-cache.js +0 -76
- package/esm/src/embedding/upload-store.d.ts +0 -27
- package/esm/src/embedding/upload-store.d.ts.map +0 -1
- package/src/src/build/vendor-bundle.ts +0 -154
- package/src/src/build/vendor-cache.ts +0 -111
- package/src/src/embedding/upload-store.ts +0 -299
|
@@ -11,7 +11,7 @@ export const CLIENT_STYLES =
|
|
|
11
11
|
".error-container {\n max-width: 600px;\n margin: 2rem auto;\n padding: 2rem;\n background: #fee;\n border: 1px solid #fcc;\n border-radius: 8px;\n color: #c00;\n}";
|
|
12
12
|
|
|
13
13
|
export const CLIENT_ROUTER_BUNDLE: string | undefined =
|
|
14
|
-
'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\n return value;\n};\n\n// src/rendering/client/router.ts\nimport { rendererLogger } from "#veryfront/utils";\nimport ReactDOM from "react-dom/client";\nimport {\n extractPageDataFromScript,\n NavigationHandlers,\n PageLoader,\n PageTransition,\n ViewportPrefetch\n} from "#veryfront/routing";\nvar logger = rendererLogger.component("veryfront");\nvar VeryfrontRouter = class {\n constructor(options = {}) {\n __publicField(this, "baseUrl");\n __publicField(this, "currentPath");\n __publicField(this, "root", null);\n __publicField(this, "options");\n __publicField(this, "spaMode");\n __publicField(this, "spaNavigationHandler", null);\n __publicField(this, "pageLoader");\n __publicField(this, "navigationHandlers");\n __publicField(this, "pageTransition");\n __publicField(this, "viewportPrefetch");\n __publicField(this, "handleClick");\n __publicField(this, "handlePopState");\n __publicField(this, "handleMouseOver");\n const globalOptions = this.loadGlobalOptions();\n this.options = { ...globalOptions, ...options };\n this.baseUrl = this.options.baseUrl || globalThis.location.origin;\n this.currentPath = globalThis.location.pathname;\n this.spaMode = this.options.spaMode ?? globalThis.__VERYFRONT_SPA_MODE__ ?? false;\n this.pageLoader = new PageLoader();\n this.navigationHandlers = new NavigationHandlers(\n this.options.prefetchDelay,\n this.options.prefetch\n );\n this.pageTransition = new PageTransition((root) => this.viewportPrefetch.setup(root));\n this.viewportPrefetch = new ViewportPrefetch(\n (path) => this.prefetch(path),\n this.options.prefetch\n );\n this.handleClick = this.navigationHandlers.createClickHandler({\n onNavigate: (url) => this.navigate(url),\n onPrefetch: (url) => this.prefetch(url)\n });\n this.handlePopState = this.navigationHandlers.createPopStateHandler({\n onNavigate: (url) => this.navigate(url, false),\n onPrefetch: (url) => this.prefetch(url)\n });\n this.handleMouseOver = this.navigationHandlers.createMouseOverHandler({\n onNavigate: (url) => this.navigate(url),\n onPrefetch: (url) => this.prefetch(url)\n });\n }\n registerNavigationHandler(handler) {\n logger.debug("Registering SPA navigation handler");\n this.spaNavigationHandler = handler;\n this.spaMode = true;\n }\n loadGlobalOptions() {\n try {\n const options = globalThis.__VERYFRONT_ROUTER_OPTS__;\n if (!options) {\n logger.debug("No global options configured");\n return {};\n }\n return options;\n } catch (error) {\n logger.error("Failed to read global options:", error);\n return {};\n }\n }\n init() {\n logger.debug("Initializing client-side router");\n const rootElement = document.getElementById("root");\n if (!rootElement) {\n logger.error("Root element not found");\n return;\n }\n const ReactDOMToUse = globalThis.ReactDOM ?? ReactDOM;\n this.root = ReactDOMToUse.createRoot(rootElement);\n document.addEventListener("click", this.handleClick);\n globalThis.addEventListener("popstate", this.handlePopState);\n document.addEventListener("mouseover", this.handleMouseOver);\n this.viewportPrefetch.setup(document);\n this.cacheCurrentPage();\n }\n cacheCurrentPage() {\n const pageData = extractPageDataFromScript();\n if (pageData)\n this.pageLoader.setCache(this.currentPath, pageData);\n }\n async navigate(url, pushState = true) {\n logger.debug(`Navigating to ${url} (SPA mode: ${this.spaMode})`);\n this.navigationHandlers.saveScrollPosition(this.currentPath);\n this.options.onStart?.(url);\n if (pushState)\n globalThis.history.pushState({}, "", url);\n if (this.spaMode && this.spaNavigationHandler) {\n await this.loadSpaPage(url);\n } else {\n await this.loadPage(url);\n }\n this.options.onNavigate?.(url);\n }\n async loadSpaPage(path) {\n logger.debug(`Loading SPA page: ${path}`);\n try {\n const spaData = await this.pageLoader.loadSpaPageData(path);\n await this.spaNavigationHandler?.(spaData);\n this.currentPath = path;\n this.handleScrollAfterNavigation();\n this.options.onComplete?.(path);\n } catch (error) {\n const normalizedError = error instanceof Error ? error : new Error(String(error));\n logger.error(`Failed to load SPA page ${path}`, normalizedError);\n this.options.onError?.(normalizedError);\n this.pageTransition.showError(normalizedError);\n }\n }\n handleScrollAfterNavigation() {\n const isPopState = this.navigationHandlers.isPopState();\n const scrollY = this.navigationHandlers.getScrollPosition(this.currentPath);\n try {\n globalThis.scrollTo(0, isPopState ? scrollY : 0);\n } catch (error) {\n logger.warn("scroll handling failed", error);\n }\n this.navigationHandlers.clearPopStateFlag();\n }\n async loadPage(path, updateUI = true) {\n if (this.pageLoader.isCached(path)) {\n logger.debug(`Loading ${path} from cache`);\n const data = this.pageLoader.getCached(path);\n if (data) {\n if (updateUI)\n this.updatePage(data);\n return;\n }\n logger.warn(`Cache entry for ${path} was unexpectedly null, fetching fresh data`);\n }\n this.pageTransition.setLoadingState(true);\n try {\n const data = await this.pageLoader.loadPage(path);\n if (updateUI)\n this.updatePage(data);\n this.currentPath = path;\n this.options.onComplete?.(path);\n } catch (error) {\n const normalizedError = error instanceof Error ? error : new Error(String(error));\n logger.error(`Failed to load ${path}`, normalizedError);\n this.options.onError?.(normalizedError);\n this.pageTransition.showError(normalizedError);\n } finally {\n this.pageTransition.setLoadingState(false);\n }\n }\n async prefetch(path) {\n if (this.spaMode) {\n await this.pageLoader.prefetchSpaPageData(path);\n return;\n }\n await this.pageLoader.prefetch(path);\n }\n updatePage(data) {\n if (!this.root)\n return;\n const isPopState = this.navigationHandlers.isPopState();\n const scrollY = this.navigationHandlers.getScrollPosition(this.currentPath);\n this.pageTransition.updatePage(data, isPopState, scrollY);\n this.navigationHandlers.clearPopStateFlag();\n }\n destroy() {\n document.removeEventListener("click", this.handleClick);\n globalThis.removeEventListener("popstate", this.handlePopState);\n document.removeEventListener("mouseover", this.handleMouseOver);\n this.viewportPrefetch.disconnect();\n this.pageLoader.clearCache();\n this.navigationHandlers.clear();\n this.pageTransition.destroy();\n }\n};\nif (typeof window !== "undefined" && globalThis.document) {\n const router = new VeryfrontRouter();\n if (document.readyState === "loading") {\n document.addEventListener("DOMContentLoaded", () => router.init());\n } else {\n router.init();\n }\n globalThis.veryFrontRouter = router;\n}\nexport {\n VeryfrontRouter\n};\n';
|
|
14
|
+
'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\n return value;\n};\n\n// src/rendering/client/router.ts\nimport { rendererLogger } from "#veryfront/utils";\nimport ReactDOM from "react-dom/client";\nimport {\n extractPageDataFromScript,\n NavigationHandlers,\n PageLoader,\n PageTransition,\n ViewportPrefetch\n} from "#veryfront/routing";\nvar logger = rendererLogger.component("veryfront");\nvar VeryfrontRouter = class {\n constructor(options = {}) {\n __publicField(this, "baseUrl");\n __publicField(this, "currentPath");\n __publicField(this, "root", null);\n __publicField(this, "options");\n __publicField(this, "spaMode");\n __publicField(this, "spaNavigationHandler", null);\n __publicField(this, "pageLoader");\n __publicField(this, "navigationHandlers");\n __publicField(this, "pageTransition");\n __publicField(this, "viewportPrefetch");\n __publicField(this, "handleClick");\n __publicField(this, "handlePopState");\n __publicField(this, "handleMouseOver");\n const globalOptions = this.loadGlobalOptions();\n this.options = { ...globalOptions, ...options };\n this.baseUrl = this.options.baseUrl || globalThis.location.origin;\n this.currentPath = globalThis.location.pathname;\n this.spaMode = this.options.spaMode ?? globalThis.__VERYFRONT_SPA_MODE__ ?? false;\n this.pageLoader = new PageLoader();\n this.navigationHandlers = new NavigationHandlers(\n this.options.prefetchDelay,\n this.options.prefetch\n );\n this.pageTransition = new PageTransition((root) => this.viewportPrefetch.setup(root));\n this.viewportPrefetch = new ViewportPrefetch(\n (path) => this.prefetch(path),\n this.options.prefetch\n );\n this.handleClick = this.navigationHandlers.createClickHandler({\n onNavigate: (url) => this.navigate(url),\n onPrefetch: (url) => this.prefetch(url)\n });\n this.handlePopState = this.navigationHandlers.createPopStateHandler({\n onNavigate: (url) => this.navigate(url, false),\n onPrefetch: (url) => this.prefetch(url)\n });\n this.handleMouseOver = this.navigationHandlers.createMouseOverHandler({\n onNavigate: (url) => this.navigate(url),\n onPrefetch: (url) => this.prefetch(url)\n });\n }\n registerNavigationHandler(handler) {\n logger.debug("Registering SPA navigation handler");\n this.spaNavigationHandler = handler;\n this.spaMode = true;\n }\n loadGlobalOptions() {\n try {\n const options = globalThis.__VERYFRONT_ROUTER_OPTS__;\n if (!options) {\n logger.debug("No global options configured");\n return {};\n }\n return options;\n } catch (error) {\n logger.error("Failed to read global options:", error);\n return {};\n }\n }\n init() {\n logger.debug("Initializing client-side router");\n const rootElement = document.getElementById("root");\n if (!rootElement) {\n logger.error("Root element not found");\n return;\n }\n const ReactDOMToUse = globalThis.ReactDOM ?? ReactDOM;\n this.root = ReactDOMToUse.createRoot(rootElement);\n document.addEventListener("click", this.handleClick);\n globalThis.addEventListener("popstate", this.handlePopState);\n document.addEventListener("mouseover", this.handleMouseOver);\n this.viewportPrefetch.setup(document);\n this.cacheCurrentPage();\n }\n cacheCurrentPage() {\n const pageData = extractPageDataFromScript();\n if (pageData)\n this.pageLoader.setCache(this.currentPath, pageData);\n }\n async navigate(url, pushState = true) {\n logger.debug(`Navigating to ${url} (SPA mode: ${this.spaMode})`);\n this.navigationHandlers.saveScrollPosition(this.currentPath);\n this.options.onStart?.(url);\n if (pushState)\n globalThis.history.pushState({}, "", url);\n if (this.spaMode && this.spaNavigationHandler) {\n await this.loadSpaPage(url);\n } else {\n await this.loadPage(url);\n }\n this.options.onNavigate?.(url);\n }\n async loadSpaPage(path) {\n logger.debug(`Loading SPA page: ${path}`);\n try {\n const spaData = await this.pageLoader.loadSpaPageData(path);\n await this.spaNavigationHandler?.(spaData);\n this.currentPath = path;\n this.handleScrollAfterNavigation();\n this.options.onComplete?.(path);\n } catch (error) {\n const normalizedError = error instanceof Error ? error : new Error(String(error));\n logger.error(`Failed to load SPA page ${path}`, normalizedError);\n this.options.onError?.(normalizedError);\n this.pageTransition.showError(normalizedError);\n }\n }\n handleScrollAfterNavigation() {\n const isPopState = this.navigationHandlers.isPopState();\n const scrollY = this.navigationHandlers.getScrollPosition(this.currentPath);\n try {\n globalThis.scrollTo(0, isPopState ? scrollY : 0);\n } catch (error) {\n logger.warn("scroll handling failed", error);\n }\n this.navigationHandlers.clearPopStateFlag();\n }\n async loadPage(path, updateUI = true) {\n if (this.pageLoader.isCached(path)) {\n logger.debug(`Loading ${path} from cache`);\n const data = this.pageLoader.getCached(path);\n if (data) {\n if (updateUI)\n this.updatePage(data);\n return;\n }\n logger.warn(`Cache entry for ${path} was unexpectedly null, fetching fresh data`);\n }\n this.pageTransition.setLoadingState(true);\n try {\n const data = await this.pageLoader.loadPage(path);\n if (updateUI)\n this.updatePage(data);\n this.currentPath = path;\n this.options.onComplete?.(path);\n } catch (error) {\n const normalizedError = error instanceof Error ? error : new Error(String(error));\n logger.error(`Failed to load ${path}`, normalizedError);\n this.options.onError?.(normalizedError);\n this.pageTransition.showError(normalizedError);\n } finally {\n this.pageTransition.setLoadingState(false);\n }\n }\n async prefetch(path) {\n if (this.spaMode) {\n await this.pageLoader.prefetchSpaPageData(path);\n return;\n }\n await this.pageLoader.prefetch(path);\n }\n updatePage(data) {\n if (!this.root)\n return;\n const isPopState = this.navigationHandlers.isPopState();\n const scrollY = this.navigationHandlers.getScrollPosition(this.currentPath);\n this.pageTransition.updatePage(data, isPopState, scrollY);\n this.navigationHandlers.clearPopStateFlag();\n }\n destroy() {\n document.removeEventListener("click", this.handleClick);\n globalThis.removeEventListener("popstate", this.handlePopState);\n document.removeEventListener("mouseover", this.handleMouseOver);\n this.viewportPrefetch.disconnect();\n this.pageLoader.clearCache();\n this.navigationHandlers.clear();\n this.pageTransition.destroy();\n }\n};\nif (typeof window !== "undefined" && globalThis.document) {\n const router = new VeryfrontRouter();\n if (document.readyState === "loading") {\n document.addEventListener("DOMContentLoaded", () => router.init(), { once: true });\n } else {\n router.init();\n }\n globalThis.veryFrontRouter = router;\n}\nexport {\n VeryfrontRouter\n};\n';
|
|
15
15
|
|
|
16
16
|
export const CLIENT_PREFETCH_BUNDLE: string | undefined =
|
|
17
|
-
'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\n return value;\n};\n\n// src/rendering/client/browser-logger.ts\nvar ConditionalBrowserLogger = class {\n constructor(prefix, level) {\n this.prefix = prefix;\n this.level = level;\n }\n log(minLevel, fn, message, ...args) {\n if (this.level > minLevel)\n return;\n fn?.(message, ...args);\n }\n debug(message, ...args) {\n this.log(\n 0 /* DEBUG */,\n console.debug,\n `[${this.prefix}] DEBUG: ${message}`,\n ...args\n );\n }\n info(message, ...args) {\n this.log(1 /* INFO */, console.log, `[${this.prefix}] ${message}`, ...args);\n }\n warn(message, ...args) {\n this.log(\n 2 /* WARN */,\n console.warn,\n `[${this.prefix}] WARN: ${message}`,\n ...args\n );\n }\n error(message, ...args) {\n this.log(\n 3 /* ERROR */,\n console.error,\n `[${this.prefix}] ERROR: ${message}`,\n ...args\n );\n }\n};\nfunction getBrowserLogLevel() {\n if (typeof window === "undefined")\n return 2 /* WARN */;\n const g = globalThis;\n const isDevelopment = g.__VERYFRONT_DEV__ || g.__RSC_DEV__;\n if (!isDevelopment)\n return 2 /* WARN */;\n const isDebugEnabled = g.__VERYFRONT_DEBUG__ || g.__RSC_DEBUG__;\n return isDebugEnabled ? 0 /* DEBUG */ : 1 /* INFO */;\n}\nvar defaultLevel = getBrowserLogLevel();\nvar rscLogger = new ConditionalBrowserLogger("RSC", defaultLevel);\nvar prefetchLogger = new ConditionalBrowserLogger("PREFETCH", defaultLevel);\nvar hydrateLogger = new ConditionalBrowserLogger("HYDRATE", defaultLevel);\nvar browserLogger = new ConditionalBrowserLogger("VERYFRONT", defaultLevel);\n\n// src/rendering/client/prefetch/link-observer.ts\nfunction isAnchorElement(element) {\n return typeof HTMLAnchorElement !== "undefined" ? element instanceof HTMLAnchorElement : element.tagName === "A";\n}\nvar LinkObserver = class {\n constructor(options, prefetchedUrls) {\n __publicField(this, "options");\n __publicField(this, "intersectionObserver", null);\n __publicField(this, "mutationObserver", null);\n __publicField(this, "prefetchedUrls");\n __publicField(this, "pendingTimeouts", /* @__PURE__ */ new Map());\n __publicField(this, "elementTimeoutMap", /* @__PURE__ */ new WeakMap());\n __publicField(this, "timeoutCounter", 0);\n this.options = options;\n this.prefetchedUrls = prefetchedUrls;\n }\n init() {\n this.createIntersectionObserver();\n this.observeLinks();\n this.setupMutationObserver();\n }\n createIntersectionObserver() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => this.handleIntersection(entries),\n { rootMargin: this.options.rootMargin }\n );\n }\n handleIntersection(entries) {\n for (const entry of entries) {\n if (!entry.isIntersecting)\n continue;\n if (!isAnchorElement(entry.target))\n continue;\n const link = entry.target;\n if (this.timeoutCounter > 1e6)\n this.timeoutCounter = 0;\n const timeoutKey = this.timeoutCounter++;\n const timeoutId = setTimeout(() => {\n this.pendingTimeouts.delete(timeoutKey);\n this.elementTimeoutMap.delete(link);\n this.options.onLinkVisible(link);\n }, this.options.delay);\n this.pendingTimeouts.set(timeoutKey, timeoutId);\n this.elementTimeoutMap.set(link, timeoutKey);\n }\n }\n observeLinks() {\n this.observeAnchors(document.querySelectorAll(\'a[href^="/"], a[href^="./"]\'));\n }\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type !== "childList")\n continue;\n for (const node of mutation.addedNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n this.observeElement(node);\n }\n for (const node of mutation.removedNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n this.clearElementTimeouts(node);\n }\n }\n });\n this.mutationObserver.observe(document.body, { childList: true, subtree: true });\n }\n clearTimeoutForElement(element) {\n const timeoutKey = this.elementTimeoutMap.get(element);\n if (timeoutKey === void 0)\n return;\n const timeoutId = this.pendingTimeouts.get(timeoutKey);\n if (timeoutId !== void 0) {\n clearTimeout(timeoutId);\n this.pendingTimeouts.delete(timeoutKey);\n }\n this.elementTimeoutMap.delete(element);\n }\n clearElementTimeouts(element) {\n if (isAnchorElement(element))\n this.clearTimeoutForElement(element);\n for (const link of element.querySelectorAll("a")) {\n this.clearTimeoutForElement(link);\n }\n }\n observeElement(element) {\n if (isAnchorElement(element) && this.isValidLink(element)) {\n this.intersectionObserver?.observe(element);\n }\n this.observeAnchors(element.querySelectorAll(\'a[href^="/"], a[href^="./"]\'));\n }\n observeAnchors(links) {\n for (const link of links) {\n if (!isAnchorElement(link))\n continue;\n if (!this.isValidLink(link))\n continue;\n this.intersectionObserver?.observe(link);\n }\n }\n isValidLink(link) {\n if (link.hostname !== globalThis.location.hostname)\n return false;\n if (link.hasAttribute("download"))\n return false;\n if (link.target === "_blank")\n return false;\n const url = link.href;\n if (this.prefetchedUrls.has(url))\n return false;\n if (url === globalThis.location.href)\n return false;\n if (link.hash && link.pathname === globalThis.location.pathname)\n return false;\n if (link.dataset.noPrefetch)\n return false;\n return true;\n }\n destroy() {\n for (const timeoutId of this.pendingTimeouts.values()) {\n clearTimeout(timeoutId);\n }\n this.pendingTimeouts.clear();\n this.timeoutCounter = 0;\n this.intersectionObserver?.disconnect();\n this.intersectionObserver = null;\n this.mutationObserver?.disconnect();\n this.mutationObserver = null;\n }\n};\n\n// src/rendering/client/prefetch/network-utils.ts\nvar NetworkUtils = class {\n constructor(allowedNetworks = ["4g", "wifi", "ethernet"]) {\n __publicField(this, "networkInfo");\n __publicField(this, "allowedNetworks");\n this.allowedNetworks = allowedNetworks;\n this.networkInfo = this.getNetworkConnection();\n }\n getNavigatorWithConnection() {\n if (typeof globalThis.navigator === "undefined")\n return null;\n return globalThis.navigator;\n }\n getNetworkConnection() {\n const nav = this.getNavigatorWithConnection();\n return nav?.connection ?? nav?.mozConnection ?? nav?.webkitConnection ?? null;\n }\n shouldPrefetch() {\n if (this.networkInfo?.saveData)\n return false;\n const effectiveType = this.networkInfo?.effectiveType;\n if (effectiveType != null && !this.allowedNetworks.includes(effectiveType))\n return false;\n return true;\n }\n onNetworkChange(callback) {\n this.networkInfo?.addEventListener?.("change", callback);\n }\n getNetworkInfo() {\n return this.networkInfo;\n }\n};\n\n// src/rendering/client/prefetch/prefetch-queue.ts\nimport { PREFETCH_QUEUE_MAX_SIZE_BYTES } from "#veryfront/utils/constants/index.ts";\nvar DEFAULT_OPTIONS = {\n maxConcurrent: 4,\n maxSize: PREFETCH_QUEUE_MAX_SIZE_BYTES,\n timeout: 5e3\n};\nfunction isAbortError(error) {\n if (typeof error !== "object" || error === null)\n return false;\n if (!("name" in error))\n return false;\n return error.name === "AbortError";\n}\nvar PrefetchQueue = class {\n constructor(options = {}, prefetchedUrls) {\n __publicField(this, "options");\n __publicField(this, "controllers", /* @__PURE__ */ new Map());\n __publicField(this, "prefetchedUrls");\n __publicField(this, "concurrent", 0);\n __publicField(this, "stopped", false);\n __publicField(this, "onResourcesFetched");\n this.options = { ...DEFAULT_OPTIONS, ...options };\n this.prefetchedUrls = prefetchedUrls ?? /* @__PURE__ */ new Set();\n }\n setResourceCallback(callback) {\n this.onResourcesFetched = callback;\n }\n enqueue(url) {\n void this.prefetch(url);\n }\n has(url) {\n return this.prefetchedUrls.has(url) || this.controllers.has(url);\n }\n get size() {\n return this.controllers.size;\n }\n clear() {\n this.stopAll();\n this.prefetchedUrls.clear();\n }\n start() {\n this.stopped = false;\n }\n stop() {\n this.stopped = true;\n this.stopAll();\n }\n getQueueSize() {\n return this.controllers.size;\n }\n getConcurrentCount() {\n return this.concurrent;\n }\n async prefetchLink(link) {\n if (this.stopped)\n return;\n const url = link.href;\n if (!url || this.controllers.has(url) || this.prefetchedUrls.has(url))\n return;\n if (this.concurrent >= this.options.maxConcurrent) {\n prefetchLogger.debug?.(`Prefetch queue full, skipping ${url}`);\n return;\n }\n let parsedUrl;\n try {\n parsedUrl = new URL(url);\n } catch {\n prefetchLogger.debug?.(`Invalid prefetch URL ${url}`);\n return;\n }\n const controller = new AbortController();\n this.controllers.set(url, controller);\n this.concurrent += 1;\n const timeoutId = this.options.timeout > 0 ? setTimeout(() => controller.abort(), this.options.timeout) : void 0;\n try {\n const response = await fetch(parsedUrl.toString(), {\n method: "GET",\n signal: controller.signal,\n headers: { "X-Veryfront-Prefetch": "1" }\n });\n if (!response.ok)\n return;\n if (this.isResponseTooLarge(response)) {\n prefetchLogger.debug?.(`Prefetch too large, skipping ${url}`);\n return;\n }\n this.prefetchedUrls.add(url);\n if (!this.onResourcesFetched)\n return;\n try {\n await this.onResourcesFetched(response, url);\n } catch (callbackError) {\n prefetchLogger.error?.(`Prefetch callback failed for ${url}`, callbackError);\n }\n } catch (error) {\n if (!isAbortError(error)) {\n prefetchLogger.error?.(`Failed to prefetch ${url}`, error);\n }\n } finally {\n if (timeoutId !== void 0)\n clearTimeout(timeoutId);\n this.controllers.delete(url);\n this.concurrent = Math.max(0, this.concurrent - 1);\n }\n }\n async prefetch(url) {\n const link = typeof document !== "undefined" ? document.createElement("a") : { href: url };\n link.href = url;\n await this.prefetchLink(link);\n }\n stopAll() {\n for (const controller of this.controllers.values()) {\n controller.abort();\n }\n this.controllers.clear();\n this.concurrent = 0;\n }\n isResponseTooLarge(response) {\n const rawLength = response.headers.get("content-length");\n if (rawLength === null)\n return false;\n const size = Number.parseInt(rawLength, 10);\n if (!Number.isFinite(size))\n return false;\n return size > this.options.maxSize;\n }\n};\nvar prefetchQueue = new PrefetchQueue();\n\n// src/rendering/client/prefetch/resource-hints.ts\nvar ResourceHintsManager = class {\n constructor() {\n __publicField(this, "appliedHints", /* @__PURE__ */ new Set());\n }\n applyResourceHints(hints) {\n for (const hint of hints) {\n const key = `${hint.type}:${hint.href}`;\n if (this.appliedHints.has(key))\n continue;\n const existing = document.querySelector(\n `link[rel="${hint.type}"][href="${hint.href}"]`\n );\n if (existing) {\n this.appliedHints.add(key);\n continue;\n }\n this.createAndAppendHint(hint);\n this.appliedHints.add(key);\n prefetchLogger.debug(`Added resource hint: ${hint.type} ${hint.href}`);\n }\n }\n createAndAppendHint(hint) {\n if (!document.head) {\n prefetchLogger.warn("document.head is not available, skipping resource hint");\n return;\n }\n const link = document.createElement("link");\n link.rel = hint.type;\n link.href = hint.href;\n if (hint.as)\n link.setAttribute("as", hint.as);\n if (hint.crossOrigin)\n link.setAttribute("crossorigin", hint.crossOrigin);\n if (hint.media)\n link.setAttribute("media", hint.media);\n document.head.appendChild(link);\n }\n extractResourceHints(html, prefetchedUrls) {\n try {\n const doc = new DOMParser().parseFromString(html, "text/html");\n const hints = [];\n this.extractPreloadLinks(doc, prefetchedUrls, hints);\n this.extractScripts(doc, prefetchedUrls, hints);\n this.extractStylesheets(doc, prefetchedUrls, hints);\n return hints;\n } catch (error) {\n prefetchLogger.error("Failed to parse prefetched page", error);\n return [];\n }\n }\n isValidResourceHintType(rel) {\n switch (rel) {\n case "prefetch":\n case "preload":\n case "preconnect":\n case "dns-prefetch":\n return true;\n default:\n return false;\n }\n }\n extractPreloadLinks(doc, prefetchedUrls, hints) {\n const links = doc.querySelectorAll(\n \'link[rel="preload"], link[rel="prefetch"]\'\n );\n for (const link of links) {\n const href = link.href;\n if (!href)\n continue;\n if (prefetchedUrls.has(href))\n continue;\n if (!this.isValidResourceHintType(link.rel))\n continue;\n hints.push({\n type: link.rel,\n href,\n as: link.getAttribute("as") ?? void 0\n });\n }\n }\n extractScripts(doc, prefetchedUrls, hints) {\n for (const script of doc.querySelectorAll("script[src]")) {\n const src = script.src;\n if (!src || prefetchedUrls.has(src))\n continue;\n hints.push({ type: "prefetch", href: src, as: "script" });\n }\n }\n extractStylesheets(doc, prefetchedUrls, hints) {\n for (const link of doc.querySelectorAll(\'link[rel="stylesheet"]\')) {\n const href = link.href;\n if (!href || prefetchedUrls.has(href))\n continue;\n hints.push({ type: "prefetch", href, as: "style" });\n }\n }\n static generateResourceHints(_route, assets) {\n const hints = [\n \'<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">\',\n \'<link rel="dns-prefetch" href="https://esm.sh">\',\n \'<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>\'\n ];\n for (const asset of assets) {\n if (asset.endsWith(".js")) {\n hints.push(`<link rel="modulepreload" href="${asset}">`);\n continue;\n }\n if (asset.endsWith(".css")) {\n hints.push(`<link rel="preload" as="style" href="${asset}">`);\n continue;\n }\n if (/\\.(woff2?|ttf|otf)$/.test(asset)) {\n hints.push(`<link rel="preload" as="font" href="${asset}" crossorigin>`);\n }\n }\n return hints.join("\\n");\n }\n};\n\n// src/rendering/client/prefetch.ts\nimport {\n PREFETCH_DEFAULT_DELAY_MS,\n PREFETCH_DEFAULT_TIMEOUT_MS,\n PREFETCH_MAX_SIZE_BYTES\n} from "#veryfront/utils";\nvar PrefetchManager = class {\n constructor(options = {}) {\n __publicField(this, "options");\n __publicField(this, "prefetchedUrls", /* @__PURE__ */ new Set());\n __publicField(this, "networkUtils");\n __publicField(this, "linkObserver", null);\n __publicField(this, "resourceHintsManager");\n __publicField(this, "prefetchQueue");\n this.options = {\n rootMargin: options.rootMargin ?? "50px",\n delay: options.delay ?? PREFETCH_DEFAULT_DELAY_MS,\n maxConcurrent: options.maxConcurrent ?? 2,\n allowedNetworks: options.allowedNetworks ?? ["4g", "wifi", "ethernet"],\n maxSize: options.maxSize ?? PREFETCH_MAX_SIZE_BYTES,\n timeout: options.timeout ?? PREFETCH_DEFAULT_TIMEOUT_MS\n };\n this.networkUtils = new NetworkUtils(this.options.allowedNetworks);\n this.resourceHintsManager = new ResourceHintsManager();\n this.prefetchQueue = new PrefetchQueue(\n {\n maxConcurrent: this.options.maxConcurrent,\n maxSize: this.options.maxSize,\n timeout: this.options.timeout\n },\n this.prefetchedUrls\n );\n this.prefetchQueue.setResourceCallback(\n (response, url) => this.prefetchPageResources(response, url)\n );\n }\n init() {\n prefetchLogger.info("Initializing prefetch manager");\n if (!this.networkUtils.shouldPrefetch()) {\n prefetchLogger.info("Prefetching disabled due to network conditions");\n return;\n }\n this.linkObserver = new LinkObserver(\n {\n rootMargin: this.options.rootMargin,\n delay: this.options.delay,\n onLinkVisible: (link) => this.prefetchQueue.prefetchLink(link)\n },\n this.prefetchedUrls\n );\n this.linkObserver.init();\n this.networkUtils.onNetworkChange(() => {\n if (!this.networkUtils.shouldPrefetch())\n this.prefetchQueue.stopAll();\n });\n }\n async prefetchPageResources(response, _pageUrl) {\n const html = await response.text();\n const hints = this.resourceHintsManager.extractResourceHints(html, this.prefetchedUrls);\n this.resourceHintsManager.applyResourceHints(hints);\n }\n applyResourceHints(hints) {\n this.resourceHintsManager.applyResourceHints(hints);\n }\n async prefetch(url) {\n await this.prefetchQueue.prefetch(url);\n }\n static generateResourceHints(route, assets) {\n return ResourceHintsManager.generateResourceHints(route, assets);\n }\n destroy() {\n this.linkObserver?.destroy();\n this.prefetchQueue.stopAll();\n this.prefetchedUrls.clear();\n }\n};\nfunction initPrefetch(options) {\n const prefetchManager = new PrefetchManager(options);\n if (document.readyState === "loading") {\n document.addEventListener("DOMContentLoaded", () => prefetchManager.init());\n } else {\n prefetchManager.init();\n }\n globalThis.veryFrontPrefetch = prefetchManager;\n return prefetchManager;\n}\nfunction resolveAutoInitOptions() {\n const setting = globalThis.__VERYFRONT_PREFETCH__;\n if (!setting)\n return null;\n if (setting === true)\n return {};\n if (typeof setting === "object")\n return setting;\n return null;\n}\nfunction shouldAutoInitPrefetch(options) {\n if (!options)\n return false;\n if (typeof window === "undefined" || typeof document === "undefined")\n return false;\n const win = window;\n const doc = document;\n if (win.__veryfrontSSRStub || doc.__veryfrontSSRStub)\n return false;\n if (typeof IntersectionObserver === "undefined")\n return false;\n if (typeof MutationObserver === "undefined")\n return false;\n return true;\n}\nvar autoInitOptions = resolveAutoInitOptions();\nif (shouldAutoInitPrefetch(autoInitOptions))\n initPrefetch(autoInitOptions);\nexport {\n PrefetchManager,\n initPrefetch\n};\n';
|
|
17
|
+
'var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);\n return value;\n};\n\n// src/rendering/client/browser-logger.ts\nvar ConditionalBrowserLogger = class {\n constructor(prefix, level) {\n this.prefix = prefix;\n this.level = level;\n }\n log(minLevel, fn, message, ...args) {\n if (this.level > minLevel)\n return;\n fn?.(message, ...args);\n }\n debug(message, ...args) {\n this.log(\n 0 /* DEBUG */,\n console.debug,\n `[${this.prefix}] DEBUG: ${message}`,\n ...args\n );\n }\n info(message, ...args) {\n this.log(1 /* INFO */, console.log, `[${this.prefix}] ${message}`, ...args);\n }\n warn(message, ...args) {\n this.log(\n 2 /* WARN */,\n console.warn,\n `[${this.prefix}] WARN: ${message}`,\n ...args\n );\n }\n error(message, ...args) {\n this.log(\n 3 /* ERROR */,\n console.error,\n `[${this.prefix}] ERROR: ${message}`,\n ...args\n );\n }\n};\nfunction getBrowserLogLevel() {\n if (typeof window === "undefined")\n return 2 /* WARN */;\n const g = globalThis;\n const isDevelopment = g.__VERYFRONT_DEV__ || g.__RSC_DEV__;\n if (!isDevelopment)\n return 2 /* WARN */;\n const isDebugEnabled = g.__VERYFRONT_DEBUG__ || g.__RSC_DEBUG__;\n return isDebugEnabled ? 0 /* DEBUG */ : 1 /* INFO */;\n}\nvar defaultLevel = getBrowserLogLevel();\nvar rscLogger = new ConditionalBrowserLogger("RSC", defaultLevel);\nvar prefetchLogger = new ConditionalBrowserLogger("PREFETCH", defaultLevel);\nvar hydrateLogger = new ConditionalBrowserLogger("HYDRATE", defaultLevel);\nvar browserLogger = new ConditionalBrowserLogger("VERYFRONT", defaultLevel);\n\n// src/rendering/client/prefetch/link-observer.ts\nfunction isAnchorElement(element) {\n return typeof HTMLAnchorElement !== "undefined" ? element instanceof HTMLAnchorElement : element.tagName === "A";\n}\nvar LinkObserver = class {\n constructor(options, prefetchedUrls) {\n __publicField(this, "options");\n __publicField(this, "intersectionObserver", null);\n __publicField(this, "mutationObserver", null);\n __publicField(this, "prefetchedUrls");\n __publicField(this, "pendingTimeouts", /* @__PURE__ */ new Map());\n __publicField(this, "elementTimeoutMap", /* @__PURE__ */ new WeakMap());\n __publicField(this, "timeoutCounter", 0);\n this.options = options;\n this.prefetchedUrls = prefetchedUrls;\n }\n init() {\n this.createIntersectionObserver();\n this.observeLinks();\n this.setupMutationObserver();\n }\n createIntersectionObserver() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => this.handleIntersection(entries),\n { rootMargin: this.options.rootMargin }\n );\n }\n handleIntersection(entries) {\n for (const entry of entries) {\n if (!entry.isIntersecting)\n continue;\n if (!isAnchorElement(entry.target))\n continue;\n const link = entry.target;\n if (this.timeoutCounter > 1e6)\n this.timeoutCounter = 0;\n const timeoutKey = this.timeoutCounter++;\n const timeoutId = setTimeout(() => {\n this.pendingTimeouts.delete(timeoutKey);\n this.elementTimeoutMap.delete(link);\n this.options.onLinkVisible(link);\n }, this.options.delay);\n this.pendingTimeouts.set(timeoutKey, timeoutId);\n this.elementTimeoutMap.set(link, timeoutKey);\n }\n }\n observeLinks() {\n this.observeAnchors(document.querySelectorAll(\'a[href^="/"], a[href^="./"]\'));\n }\n setupMutationObserver() {\n this.mutationObserver = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type !== "childList")\n continue;\n for (const node of mutation.addedNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n this.observeElement(node);\n }\n for (const node of mutation.removedNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n this.clearElementTimeouts(node);\n }\n }\n });\n this.mutationObserver.observe(document.body, { childList: true, subtree: true });\n }\n clearTimeoutForElement(element) {\n const timeoutKey = this.elementTimeoutMap.get(element);\n if (timeoutKey === void 0)\n return;\n const timeoutId = this.pendingTimeouts.get(timeoutKey);\n if (timeoutId !== void 0) {\n clearTimeout(timeoutId);\n this.pendingTimeouts.delete(timeoutKey);\n }\n this.elementTimeoutMap.delete(element);\n }\n clearElementTimeouts(element) {\n if (isAnchorElement(element))\n this.clearTimeoutForElement(element);\n for (const link of element.querySelectorAll("a")) {\n this.clearTimeoutForElement(link);\n }\n }\n observeElement(element) {\n if (isAnchorElement(element) && this.isValidLink(element)) {\n this.intersectionObserver?.observe(element);\n }\n this.observeAnchors(element.querySelectorAll(\'a[href^="/"], a[href^="./"]\'));\n }\n observeAnchors(links) {\n for (const link of links) {\n if (!isAnchorElement(link))\n continue;\n if (!this.isValidLink(link))\n continue;\n this.intersectionObserver?.observe(link);\n }\n }\n isValidLink(link) {\n if (link.hostname !== globalThis.location.hostname)\n return false;\n if (link.hasAttribute("download"))\n return false;\n if (link.target === "_blank")\n return false;\n const url = link.href;\n if (this.prefetchedUrls.has(url))\n return false;\n if (url === globalThis.location.href)\n return false;\n if (link.hash && link.pathname === globalThis.location.pathname)\n return false;\n if (link.dataset.noPrefetch)\n return false;\n return true;\n }\n destroy() {\n for (const timeoutId of this.pendingTimeouts.values()) {\n clearTimeout(timeoutId);\n }\n this.pendingTimeouts.clear();\n this.timeoutCounter = 0;\n this.intersectionObserver?.disconnect();\n this.intersectionObserver = null;\n this.mutationObserver?.disconnect();\n this.mutationObserver = null;\n }\n};\n\n// src/rendering/client/prefetch/network-utils.ts\nvar NetworkUtils = class {\n constructor(allowedNetworks = ["4g", "wifi", "ethernet"]) {\n __publicField(this, "networkInfo");\n __publicField(this, "allowedNetworks");\n this.allowedNetworks = allowedNetworks;\n this.networkInfo = this.getNetworkConnection();\n }\n getNavigatorWithConnection() {\n if (typeof globalThis.navigator === "undefined")\n return null;\n return globalThis.navigator;\n }\n getNetworkConnection() {\n const nav = this.getNavigatorWithConnection();\n return nav?.connection ?? nav?.mozConnection ?? nav?.webkitConnection ?? null;\n }\n shouldPrefetch() {\n if (this.networkInfo?.saveData)\n return false;\n const effectiveType = this.networkInfo?.effectiveType;\n if (effectiveType != null && !this.allowedNetworks.includes(effectiveType))\n return false;\n return true;\n }\n onNetworkChange(callback) {\n this.networkInfo?.addEventListener?.("change", callback);\n }\n getNetworkInfo() {\n return this.networkInfo;\n }\n};\n\n// src/rendering/client/prefetch/prefetch-queue.ts\nimport { PREFETCH_QUEUE_MAX_SIZE_BYTES } from "#veryfront/utils/constants/index.ts";\nvar DEFAULT_OPTIONS = {\n maxConcurrent: 4,\n maxSize: PREFETCH_QUEUE_MAX_SIZE_BYTES,\n timeout: 5e3\n};\nfunction isAbortError(error) {\n if (typeof error !== "object" || error === null)\n return false;\n if (!("name" in error))\n return false;\n return error.name === "AbortError";\n}\nvar PrefetchQueue = class {\n constructor(options = {}, prefetchedUrls) {\n __publicField(this, "options");\n __publicField(this, "controllers", /* @__PURE__ */ new Map());\n __publicField(this, "prefetchedUrls");\n __publicField(this, "concurrent", 0);\n __publicField(this, "stopped", false);\n __publicField(this, "onResourcesFetched");\n this.options = { ...DEFAULT_OPTIONS, ...options };\n this.prefetchedUrls = prefetchedUrls ?? /* @__PURE__ */ new Set();\n }\n setResourceCallback(callback) {\n this.onResourcesFetched = callback;\n }\n enqueue(url) {\n void this.prefetch(url);\n }\n has(url) {\n return this.prefetchedUrls.has(url) || this.controllers.has(url);\n }\n get size() {\n return this.controllers.size;\n }\n clear() {\n this.stopAll();\n this.prefetchedUrls.clear();\n }\n start() {\n this.stopped = false;\n }\n stop() {\n this.stopped = true;\n this.stopAll();\n }\n getQueueSize() {\n return this.controllers.size;\n }\n getConcurrentCount() {\n return this.concurrent;\n }\n async prefetchLink(link) {\n if (this.stopped)\n return;\n const url = link.href;\n if (!url || this.controllers.has(url) || this.prefetchedUrls.has(url))\n return;\n if (this.concurrent >= this.options.maxConcurrent) {\n prefetchLogger.debug?.(`Prefetch queue full, skipping ${url}`);\n return;\n }\n let parsedUrl;\n try {\n parsedUrl = new URL(url);\n } catch (_) {\n prefetchLogger.debug?.(`Invalid prefetch URL ${url}`);\n return;\n }\n const controller = new AbortController();\n this.controllers.set(url, controller);\n this.concurrent += 1;\n const timeoutId = this.options.timeout > 0 ? setTimeout(() => controller.abort(), this.options.timeout) : void 0;\n try {\n const response = await fetch(parsedUrl.toString(), {\n method: "GET",\n signal: controller.signal,\n headers: { "X-Veryfront-Prefetch": "1" }\n });\n if (!response.ok)\n return;\n if (this.isResponseTooLarge(response)) {\n prefetchLogger.debug?.(`Prefetch too large, skipping ${url}`);\n return;\n }\n this.prefetchedUrls.add(url);\n if (!this.onResourcesFetched)\n return;\n try {\n await this.onResourcesFetched(response, url);\n } catch (callbackError) {\n prefetchLogger.error?.(`Prefetch callback failed for ${url}`, callbackError);\n }\n } catch (error) {\n if (!isAbortError(error)) {\n prefetchLogger.error?.(`Failed to prefetch ${url}`, error);\n }\n } finally {\n if (timeoutId !== void 0)\n clearTimeout(timeoutId);\n this.controllers.delete(url);\n this.concurrent = Math.max(0, this.concurrent - 1);\n }\n }\n async prefetch(url) {\n const link = typeof document !== "undefined" ? document.createElement("a") : { href: url };\n link.href = url;\n await this.prefetchLink(link);\n }\n stopAll() {\n for (const controller of this.controllers.values()) {\n controller.abort();\n }\n this.controllers.clear();\n this.concurrent = 0;\n }\n isResponseTooLarge(response) {\n const rawLength = response.headers.get("content-length");\n if (rawLength === null)\n return false;\n const size = Number.parseInt(rawLength, 10);\n if (!Number.isFinite(size))\n return false;\n return size > this.options.maxSize;\n }\n};\nvar prefetchQueue = new PrefetchQueue();\n\n// src/rendering/client/prefetch/resource-hints.ts\nvar ResourceHintsManager = class {\n constructor() {\n __publicField(this, "appliedHints", /* @__PURE__ */ new Set());\n }\n applyResourceHints(hints) {\n for (const hint of hints) {\n const key = `${hint.type}:${hint.href}`;\n if (this.appliedHints.has(key))\n continue;\n const existing = document.querySelector(\n `link[rel="${hint.type}"][href="${hint.href}"]`\n );\n if (existing) {\n this.appliedHints.add(key);\n continue;\n }\n this.createAndAppendHint(hint);\n this.appliedHints.add(key);\n prefetchLogger.debug(`Added resource hint: ${hint.type} ${hint.href}`);\n }\n }\n createAndAppendHint(hint) {\n if (!document.head) {\n prefetchLogger.warn("document.head is not available, skipping resource hint");\n return;\n }\n const link = document.createElement("link");\n link.rel = hint.type;\n link.href = hint.href;\n if (hint.as)\n link.setAttribute("as", hint.as);\n if (hint.crossOrigin)\n link.setAttribute("crossorigin", hint.crossOrigin);\n if (hint.media)\n link.setAttribute("media", hint.media);\n document.head.appendChild(link);\n }\n extractResourceHints(html, prefetchedUrls) {\n try {\n const doc = new DOMParser().parseFromString(html, "text/html");\n const hints = [];\n this.extractPreloadLinks(doc, prefetchedUrls, hints);\n this.extractScripts(doc, prefetchedUrls, hints);\n this.extractStylesheets(doc, prefetchedUrls, hints);\n return hints;\n } catch (error) {\n prefetchLogger.error("Failed to parse prefetched page", error);\n return [];\n }\n }\n isValidResourceHintType(rel) {\n switch (rel) {\n case "prefetch":\n case "preload":\n case "preconnect":\n case "dns-prefetch":\n return true;\n default:\n return false;\n }\n }\n extractPreloadLinks(doc, prefetchedUrls, hints) {\n const links = doc.querySelectorAll(\n \'link[rel="preload"], link[rel="prefetch"]\'\n );\n for (const link of links) {\n const href = link.href;\n if (!href)\n continue;\n if (prefetchedUrls.has(href))\n continue;\n if (!this.isValidResourceHintType(link.rel))\n continue;\n hints.push({\n type: link.rel,\n href,\n as: link.getAttribute("as") ?? void 0\n });\n }\n }\n extractScripts(doc, prefetchedUrls, hints) {\n for (const script of doc.querySelectorAll("script[src]")) {\n const src = script.src;\n if (!src || prefetchedUrls.has(src))\n continue;\n hints.push({ type: "prefetch", href: src, as: "script" });\n }\n }\n extractStylesheets(doc, prefetchedUrls, hints) {\n for (const link of doc.querySelectorAll(\'link[rel="stylesheet"]\')) {\n const href = link.href;\n if (!href || prefetchedUrls.has(href))\n continue;\n hints.push({ type: "prefetch", href, as: "style" });\n }\n }\n static generateResourceHints(_route, assets) {\n const hints = [\n \'<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">\',\n \'<link rel="dns-prefetch" href="https://esm.sh">\',\n \'<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>\'\n ];\n for (const asset of assets) {\n if (asset.endsWith(".js")) {\n hints.push(`<link rel="modulepreload" href="${asset}">`);\n continue;\n }\n if (asset.endsWith(".css")) {\n hints.push(`<link rel="preload" as="style" href="${asset}">`);\n continue;\n }\n if (/\\.(woff2?|ttf|otf)$/.test(asset)) {\n hints.push(`<link rel="preload" as="font" href="${asset}" crossorigin>`);\n }\n }\n return hints.join("\\n");\n }\n};\n\n// src/rendering/client/prefetch.ts\nimport {\n PREFETCH_DEFAULT_DELAY_MS,\n PREFETCH_DEFAULT_TIMEOUT_MS,\n PREFETCH_MAX_SIZE_BYTES\n} from "#veryfront/utils";\nvar PrefetchManager = class {\n constructor(options = {}) {\n __publicField(this, "options");\n __publicField(this, "prefetchedUrls", /* @__PURE__ */ new Set());\n __publicField(this, "networkUtils");\n __publicField(this, "linkObserver", null);\n __publicField(this, "resourceHintsManager");\n __publicField(this, "prefetchQueue");\n this.options = {\n rootMargin: options.rootMargin ?? "50px",\n delay: options.delay ?? PREFETCH_DEFAULT_DELAY_MS,\n maxConcurrent: options.maxConcurrent ?? 2,\n allowedNetworks: options.allowedNetworks ?? ["4g", "wifi", "ethernet"],\n maxSize: options.maxSize ?? PREFETCH_MAX_SIZE_BYTES,\n timeout: options.timeout ?? PREFETCH_DEFAULT_TIMEOUT_MS\n };\n this.networkUtils = new NetworkUtils(this.options.allowedNetworks);\n this.resourceHintsManager = new ResourceHintsManager();\n this.prefetchQueue = new PrefetchQueue(\n {\n maxConcurrent: this.options.maxConcurrent,\n maxSize: this.options.maxSize,\n timeout: this.options.timeout\n },\n this.prefetchedUrls\n );\n this.prefetchQueue.setResourceCallback(\n (response, url) => this.prefetchPageResources(response, url)\n );\n }\n init() {\n prefetchLogger.info("Initializing prefetch manager");\n if (!this.networkUtils.shouldPrefetch()) {\n prefetchLogger.info("Prefetching disabled due to network conditions");\n return;\n }\n this.linkObserver = new LinkObserver(\n {\n rootMargin: this.options.rootMargin,\n delay: this.options.delay,\n onLinkVisible: (link) => this.prefetchQueue.prefetchLink(link)\n },\n this.prefetchedUrls\n );\n this.linkObserver.init();\n this.networkUtils.onNetworkChange(() => {\n if (!this.networkUtils.shouldPrefetch())\n this.prefetchQueue.stopAll();\n });\n }\n async prefetchPageResources(response, _pageUrl) {\n const html = await response.text();\n const hints = this.resourceHintsManager.extractResourceHints(html, this.prefetchedUrls);\n this.resourceHintsManager.applyResourceHints(hints);\n }\n applyResourceHints(hints) {\n this.resourceHintsManager.applyResourceHints(hints);\n }\n async prefetch(url) {\n await this.prefetchQueue.prefetch(url);\n }\n static generateResourceHints(route, assets) {\n return ResourceHintsManager.generateResourceHints(route, assets);\n }\n destroy() {\n this.linkObserver?.destroy();\n this.prefetchQueue.stopAll();\n this.prefetchedUrls.clear();\n }\n};\nfunction initPrefetch(options) {\n const prefetchManager = new PrefetchManager(options);\n if (document.readyState === "loading") {\n document.addEventListener("DOMContentLoaded", () => prefetchManager.init(), { once: true });\n } else {\n prefetchManager.init();\n }\n globalThis.veryFrontPrefetch = prefetchManager;\n return prefetchManager;\n}\nfunction resolveAutoInitOptions() {\n const setting = globalThis.__VERYFRONT_PREFETCH__;\n if (!setting)\n return null;\n if (setting === true)\n return {};\n if (typeof setting === "object")\n return setting;\n return null;\n}\nfunction shouldAutoInitPrefetch(options) {\n if (!options)\n return false;\n if (typeof window === "undefined" || typeof document === "undefined")\n return false;\n const win = window;\n const doc = document;\n if (win.__veryfrontSSRStub || doc.__veryfrontSSRStub)\n return false;\n if (typeof IntersectionObserver === "undefined")\n return false;\n if (typeof MutationObserver === "undefined")\n return false;\n return true;\n}\nvar autoInitOptions = resolveAutoInitOptions();\nif (shouldAutoInitPrefetch(autoInitOptions))\n initPrefetch(autoInitOptions);\nexport {\n PrefetchManager,\n initPrefetch\n};\n';
|
|
@@ -6,9 +6,16 @@ import { tryGetCacheKeyContext } from "../cache-key-builder.js";
|
|
|
6
6
|
import { CircuitBreakerOpen, getCircuitBreaker } from "../../utils/circuit-breaker.js";
|
|
7
7
|
import type { CacheBackend } from "../types.js";
|
|
8
8
|
import { getEnvValue } from "./helpers.js";
|
|
9
|
+
import { REQUEST_ERROR } from "../../errors/index.js";
|
|
9
10
|
|
|
10
11
|
const logger = baseLogger.component("api-cache-backend");
|
|
11
12
|
|
|
13
|
+
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
14
|
+
const CIRCUIT_BREAKER_RESET_TIMEOUT_MS = 15_000;
|
|
15
|
+
const CIRCUIT_BREAKER_FAILURE_THRESHOLD = 10;
|
|
16
|
+
const CIRCUIT_BREAKER_SUCCESS_THRESHOLD = 2;
|
|
17
|
+
const ERROR_BODY_MAX_LENGTH = 500;
|
|
18
|
+
|
|
12
19
|
type CacheRequestContext = {
|
|
13
20
|
token?: string;
|
|
14
21
|
projectId?: string;
|
|
@@ -41,13 +48,13 @@ export class ApiCacheBackend implements CacheBackend {
|
|
|
41
48
|
getEnvValue("VERYFRONT_API_BASE_URL") ??
|
|
42
49
|
"https://api.veryfront.com";
|
|
43
50
|
this.keyPrefix = options.keyPrefix ?? "";
|
|
44
|
-
this.timeoutMs = options.timeoutMs ??
|
|
51
|
+
this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
45
52
|
|
|
46
53
|
const breakerName = options.circuitBreakerName ?? "api-cache";
|
|
47
54
|
this.circuitBreaker = getCircuitBreaker(breakerName, {
|
|
48
|
-
failureThreshold:
|
|
49
|
-
resetTimeoutMs:
|
|
50
|
-
successThreshold:
|
|
55
|
+
failureThreshold: CIRCUIT_BREAKER_FAILURE_THRESHOLD,
|
|
56
|
+
resetTimeoutMs: CIRCUIT_BREAKER_RESET_TIMEOUT_MS,
|
|
57
|
+
successThreshold: CIRCUIT_BREAKER_SUCCESS_THRESHOLD,
|
|
51
58
|
});
|
|
52
59
|
}
|
|
53
60
|
|
|
@@ -114,7 +121,9 @@ export class ApiCacheBackend implements CacheBackend {
|
|
|
114
121
|
error: bodyError instanceof Error ? bodyError.message : String(bodyError),
|
|
115
122
|
});
|
|
116
123
|
}
|
|
117
|
-
throw
|
|
124
|
+
throw REQUEST_ERROR.create({
|
|
125
|
+
detail: `HTTP ${response.status}: ${responseBody.slice(0, ERROR_BODY_MAX_LENGTH)}`,
|
|
126
|
+
});
|
|
118
127
|
}
|
|
119
128
|
|
|
120
129
|
return (await response.json()) as T;
|
|
@@ -4,6 +4,7 @@ import { logger } from "../../utils/index.js";
|
|
|
4
4
|
import type { CacheBackend } from "../types.js";
|
|
5
5
|
|
|
6
6
|
const CACHE_SUBDIR = "veryfront-files";
|
|
7
|
+
const MAX_REGEX_CACHE_SIZE = 100;
|
|
7
8
|
const fsPromises = import("node:fs/promises");
|
|
8
9
|
|
|
9
10
|
interface DiskCacheEnvelope {
|
|
@@ -110,7 +111,7 @@ export class DiskCacheBackend implements CacheBackend {
|
|
|
110
111
|
if (!regex) {
|
|
111
112
|
const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
112
113
|
regex = new RegExp(`^${escaped.replace(/\*/g, ".*").replace(/\?/g, ".")}$`);
|
|
113
|
-
if (this.regexCache.size >=
|
|
114
|
+
if (this.regexCache.size >= MAX_REGEX_CACHE_SIZE) {
|
|
114
115
|
const firstKey = this.regexCache.keys().next().value as string | undefined;
|
|
115
116
|
if (firstKey) this.regexCache.delete(firstKey);
|
|
116
117
|
}
|
|
@@ -17,6 +17,8 @@ import { getEnvValue } from "./helpers.js";
|
|
|
17
17
|
|
|
18
18
|
const logger = baseLogger.component("cache-backend");
|
|
19
19
|
|
|
20
|
+
const DEFAULT_MEMORY_MAX_ENTRIES = 500;
|
|
21
|
+
|
|
20
22
|
// Re-export gateway types for backward compatibility
|
|
21
23
|
export type { CodeCacheGateway, TokenizingCacheGateway };
|
|
22
24
|
|
|
@@ -47,7 +49,7 @@ export function isDiskCacheConfigured(): boolean {
|
|
|
47
49
|
export function createCacheBackend(config: CacheBackendConfig = {}): Promise<CacheBackend> {
|
|
48
50
|
const {
|
|
49
51
|
keyPrefix = "",
|
|
50
|
-
memoryMaxEntries =
|
|
52
|
+
memoryMaxEntries = DEFAULT_MEMORY_MAX_ENTRIES,
|
|
51
53
|
preferredBackend,
|
|
52
54
|
apiBaseUrl,
|
|
53
55
|
circuitBreakerName,
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
} from "../../utils/constants/cache.js";
|
|
5
5
|
import type { CacheBackend } from "../types.js";
|
|
6
6
|
|
|
7
|
+
const DEFAULT_TTL_SECONDS = 300;
|
|
8
|
+
const MAX_REGEX_CACHE_SIZE = 100;
|
|
9
|
+
|
|
7
10
|
export class MemoryCacheBackend implements CacheBackend {
|
|
8
11
|
readonly type = "memory" as const;
|
|
9
12
|
private store = new Map<string, { value: string; expiresAt: number; sizeBytes: number }>();
|
|
@@ -66,7 +69,7 @@ export class MemoryCacheBackend implements CacheBackend {
|
|
|
66
69
|
return Promise.resolve(results);
|
|
67
70
|
}
|
|
68
71
|
|
|
69
|
-
set(key: string, value: string, ttlSeconds =
|
|
72
|
+
set(key: string, value: string, ttlSeconds = DEFAULT_TTL_SECONDS): Promise<void> {
|
|
70
73
|
const entrySize = this.estimateSize(key, value);
|
|
71
74
|
|
|
72
75
|
// Reject single entries that exceed the byte limit on their own
|
|
@@ -120,7 +123,7 @@ export class MemoryCacheBackend implements CacheBackend {
|
|
|
120
123
|
this.currentSizeBytes += entrySize;
|
|
121
124
|
this.store.set(key, {
|
|
122
125
|
value,
|
|
123
|
-
expiresAt: now + (ttl ??
|
|
126
|
+
expiresAt: now + (ttl ?? DEFAULT_TTL_SECONDS) * 1000,
|
|
124
127
|
sizeBytes: entrySize,
|
|
125
128
|
});
|
|
126
129
|
}
|
|
@@ -141,7 +144,7 @@ export class MemoryCacheBackend implements CacheBackend {
|
|
|
141
144
|
const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
142
145
|
regex = new RegExp(`^${escaped.replace(/\*/g, ".*").replace(/\?/g, ".")}$`);
|
|
143
146
|
|
|
144
|
-
if (this.regexCache.size >=
|
|
147
|
+
if (this.regexCache.size >= MAX_REGEX_CACHE_SIZE) {
|
|
145
148
|
const firstKey = this.regexCache.keys().next().value as string | undefined;
|
|
146
149
|
if (firstKey) this.regexCache.delete(firstKey);
|
|
147
150
|
}
|
|
@@ -3,6 +3,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
|
|
|
3
3
|
import type { HandlerContext } from "../types/index.js";
|
|
4
4
|
import { type CacheKeyContext, CacheKeyContextSchema } from "./schemas/index.js";
|
|
5
5
|
import { buildContentHashCacheKey } from "./keys.js";
|
|
6
|
+
import { CACHE_INVARIANT_VIOLATION } from "../errors/index.js";
|
|
6
7
|
|
|
7
8
|
type MultiProjectRequestContextType = {
|
|
8
9
|
projectSlug: string;
|
|
@@ -41,10 +42,10 @@ export function getCurrentCacheKeyContext(): CacheKeyContext {
|
|
|
41
42
|
const ctx = cacheKeyContextStorage.getStore();
|
|
42
43
|
if (ctx) return ctx;
|
|
43
44
|
|
|
44
|
-
throw
|
|
45
|
-
"[CacheKeyBuilder] No cache context available. " +
|
|
45
|
+
throw CACHE_INVARIANT_VIOLATION.create({
|
|
46
|
+
detail: "[CacheKeyBuilder] No cache context available. " +
|
|
46
47
|
"Ensure runWithCacheKeyContext() was called at request entry.",
|
|
47
|
-
);
|
|
48
|
+
});
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
function getRequestContextFn(): (() => MultiProjectRequestContextType | null) | null {
|
|
@@ -55,7 +56,8 @@ function getRequestContextFn(): (() => MultiProjectRequestContextType | null) |
|
|
|
55
56
|
| { getCurrentRequestContext?: () => MultiProjectRequestContextType | null }
|
|
56
57
|
| undefined;
|
|
57
58
|
_getCurrentRequestContext = mod?.getCurrentRequestContext ?? null;
|
|
58
|
-
} catch {
|
|
59
|
+
} catch (_) {
|
|
60
|
+
// expected: multi-project adapter may not be available
|
|
59
61
|
_getCurrentRequestContext = null;
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -201,7 +201,8 @@ async function buildDependencyGraph(
|
|
|
201
201
|
buildDependencyGraph(dep, graph, contentHashes, getContent, projectDir, visited)
|
|
202
202
|
),
|
|
203
203
|
);
|
|
204
|
-
} catch {
|
|
204
|
+
} catch (_) {
|
|
205
|
+
// expected: file may not exist or imports may fail to parse
|
|
205
206
|
graph.addModule(filePath, []);
|
|
206
207
|
}
|
|
207
208
|
}
|
|
@@ -10,7 +10,7 @@ import { isApiCacheAvailable, isDiskCacheConfigured } from "./backend.js";
|
|
|
10
10
|
|
|
11
11
|
const logger = baseLogger.component("distributed-cache");
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
interface DistributedCacheStatus {
|
|
14
14
|
backend: "api" | "redis" | "disk" | "memory";
|
|
15
15
|
transformCache: boolean;
|
|
16
16
|
ssrModuleCache: boolean;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { VERSION } from "../../../utils/version.js";
|
|
11
11
|
import { CacheKeyPrefix, type FileOperationContext } from "../prefixes.js";
|
|
12
12
|
import { hashPathWithName } from "../utils.js";
|
|
13
|
+
import { CACHE_INVARIANT_VIOLATION } from "../../../errors/index.js";
|
|
13
14
|
|
|
14
15
|
function getSourceTypeKey(sourceType: "branch" | "release" | "environment"): string {
|
|
15
16
|
return sourceType === "environment" ? "env" : sourceType;
|
|
@@ -19,9 +20,9 @@ function buildSourceQualifier(ctx: FileOperationContext): string {
|
|
|
19
20
|
if (ctx.sourceType === "branch") return ctx.branch ?? "main";
|
|
20
21
|
|
|
21
22
|
if (!ctx.releaseId) {
|
|
22
|
-
throw
|
|
23
|
-
`Missing releaseId for ${ctx.sourceType} sourceType (project: ${ctx.projectSlug})`,
|
|
24
|
-
);
|
|
23
|
+
throw CACHE_INVARIANT_VIOLATION.create({
|
|
24
|
+
detail: `Missing releaseId for ${ctx.sourceType} sourceType (project: ${ctx.projectSlug})`,
|
|
25
|
+
});
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
if (ctx.sourceType === "release") return ctx.releaseId;
|
|
@@ -11,6 +11,7 @@ import { VERSION } from "../../../utils/version.js";
|
|
|
11
11
|
import { CacheKeyPrefix } from "../prefixes.js";
|
|
12
12
|
import type { QueryParamCacheOptions } from "../prefixes.js";
|
|
13
13
|
import { sanitizeQueryParamsForCacheKey } from "../utils.js";
|
|
14
|
+
import { CACHE_INVARIANT_VIOLATION } from "../../../errors/index.js";
|
|
14
15
|
|
|
15
16
|
export function buildRenderCachePrefix(
|
|
16
17
|
projectId: string,
|
|
@@ -45,7 +46,9 @@ export function computeContentSourceId(
|
|
|
45
46
|
|
|
46
47
|
if (environment === "production") {
|
|
47
48
|
if (!releaseId) {
|
|
48
|
-
throw
|
|
49
|
+
throw CACHE_INVARIANT_VIOLATION.create({
|
|
50
|
+
detail: "Missing releaseId for production contentSourceId",
|
|
51
|
+
});
|
|
49
52
|
}
|
|
50
53
|
return `release-${releaseId}`;
|
|
51
54
|
}
|
|
@@ -92,7 +95,9 @@ export function buildProxyManagerCacheKey(
|
|
|
92
95
|
|
|
93
96
|
if (productionMode) {
|
|
94
97
|
if (!releaseId) {
|
|
95
|
-
throw
|
|
98
|
+
throw CACHE_INVARIANT_VIOLATION.create({
|
|
99
|
+
detail: `Missing releaseId in production for ${projectSlug}`,
|
|
100
|
+
});
|
|
96
101
|
}
|
|
97
102
|
return `${CacheKeyPrefix.PROXY}:${projectSlug}:${mode}:${releaseId}`;
|
|
98
103
|
}
|
|
@@ -6,6 +6,9 @@ import type { Span } from "@opentelemetry/api";
|
|
|
6
6
|
|
|
7
7
|
const logger = rendererLogger.component("cache-registry");
|
|
8
8
|
|
|
9
|
+
const DEFAULT_REDIS_SCAN_LIMIT = 1_000;
|
|
10
|
+
const REDIS_SCAN_BATCH_COUNT = 100;
|
|
11
|
+
|
|
9
12
|
export interface CacheStore {
|
|
10
13
|
readonly name: string;
|
|
11
14
|
get(key: string): unknown;
|
|
@@ -207,7 +210,7 @@ class CacheRegistry {
|
|
|
207
210
|
this.stores.clear();
|
|
208
211
|
}
|
|
209
212
|
|
|
210
|
-
scanRedisKeys(pattern: string, limit =
|
|
213
|
+
scanRedisKeys(pattern: string, limit = DEFAULT_REDIS_SCAN_LIMIT): Promise<string[]> {
|
|
211
214
|
if (!isRedisConfigured()) return Promise.resolve([]);
|
|
212
215
|
|
|
213
216
|
return withSpan(
|
|
@@ -219,7 +222,10 @@ class CacheRegistry {
|
|
|
219
222
|
let cursor = 0;
|
|
220
223
|
|
|
221
224
|
do {
|
|
222
|
-
const result = await client.scan(cursor, {
|
|
225
|
+
const result = await client.scan(cursor, {
|
|
226
|
+
MATCH: pattern,
|
|
227
|
+
COUNT: REDIS_SCAN_BATCH_COUNT,
|
|
228
|
+
});
|
|
223
229
|
cursor = typeof result.cursor === "string"
|
|
224
230
|
? parseInt(result.cursor, 10)
|
|
225
231
|
: result.cursor;
|
|
@@ -75,6 +75,11 @@ export interface EnvironmentConfig {
|
|
|
75
75
|
veryfrontVersion: string | undefined;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/** Default timeout for incoming HTTP requests (used when REQUEST_TIMEOUT_MS is set but unparseable) */
|
|
79
|
+
const DEFAULT_REQUEST_TIMEOUT_MS = 30_000;
|
|
80
|
+
/** Default timeout for outgoing HTTP fetch calls (used when VF_HTTP_FETCH_TIMEOUT is set but unparseable) */
|
|
81
|
+
const DEFAULT_HTTP_FETCH_TIMEOUT_MS = 30_000;
|
|
82
|
+
|
|
78
83
|
const DEFAULTS = {
|
|
79
84
|
apiBaseUrl: "https://api.veryfront.com",
|
|
80
85
|
port: 3001,
|
|
@@ -142,8 +147,12 @@ function readEnvSnapshot(): EnvironmentConfig {
|
|
|
142
147
|
appUrl: getEnv("APP_URL") || getEnv("NEXT_PUBLIC_APP_URL") || undefined,
|
|
143
148
|
|
|
144
149
|
port: parseNumber(getEnv("PORT"), DEFAULTS.port),
|
|
145
|
-
requestTimeoutMs: requestTimeoutRaw
|
|
146
|
-
|
|
150
|
+
requestTimeoutMs: requestTimeoutRaw
|
|
151
|
+
? parseNumber(requestTimeoutRaw, DEFAULT_REQUEST_TIMEOUT_MS)
|
|
152
|
+
: undefined,
|
|
153
|
+
httpFetchTimeoutMs: httpFetchTimeoutRaw
|
|
154
|
+
? parseNumber(httpFetchTimeoutRaw, DEFAULT_HTTP_FETCH_TIMEOUT_MS)
|
|
155
|
+
: undefined,
|
|
147
156
|
ssrMaxConcurrentTransforms: parseNumber(
|
|
148
157
|
getEnv("SSR_MAX_CONCURRENT_TRANSFORMS"),
|
|
149
158
|
DEFAULTS.ssrMaxConcurrentTransforms,
|
package/src/src/config/loader.ts
CHANGED
|
@@ -22,6 +22,19 @@ import { registerLRUCache } from "../cache/registry.js";
|
|
|
22
22
|
|
|
23
23
|
const logger = serverLogger.component("config");
|
|
24
24
|
|
|
25
|
+
/** Cache TTL for veryfront-api filesystem in proxy mode */
|
|
26
|
+
const DEFAULT_FS_CACHE_TTL_MS = 60_000;
|
|
27
|
+
/** Maximum retry attempts for veryfront-api filesystem requests */
|
|
28
|
+
const DEFAULT_FS_MAX_RETRIES = 3;
|
|
29
|
+
/** Initial backoff delay between retries */
|
|
30
|
+
const DEFAULT_FS_INITIAL_DELAY_MS = 500;
|
|
31
|
+
/** Maximum backoff delay between retries */
|
|
32
|
+
const DEFAULT_FS_MAX_DELAY_MS = 5_000;
|
|
33
|
+
/** Maximum entries in the render cache */
|
|
34
|
+
const DEFAULT_RENDER_CACHE_MAX_ENTRIES = 500;
|
|
35
|
+
/** Maximum entries in the per-project config cache */
|
|
36
|
+
const DEFAULT_CONFIG_CACHE_MAX_ENTRIES = 100;
|
|
37
|
+
|
|
25
38
|
export type { VeryfrontConfig } from "./schemas/index.js";
|
|
26
39
|
|
|
27
40
|
/**
|
|
@@ -58,8 +71,12 @@ function getDefaultFsConfig(): VeryfrontConfig["fs"] {
|
|
|
58
71
|
veryfront: {
|
|
59
72
|
apiBaseUrl,
|
|
60
73
|
proxyMode: true,
|
|
61
|
-
cache: { enabled: true, ttl:
|
|
62
|
-
retry: {
|
|
74
|
+
cache: { enabled: true, ttl: DEFAULT_FS_CACHE_TTL_MS },
|
|
75
|
+
retry: {
|
|
76
|
+
maxRetries: DEFAULT_FS_MAX_RETRIES,
|
|
77
|
+
initialDelay: DEFAULT_FS_INITIAL_DELAY_MS,
|
|
78
|
+
maxDelay: DEFAULT_FS_MAX_DELAY_MS,
|
|
79
|
+
},
|
|
63
80
|
},
|
|
64
81
|
};
|
|
65
82
|
}
|
|
@@ -104,7 +121,7 @@ function createFreshDefaults(): Partial<VeryfrontConfig> {
|
|
|
104
121
|
render: {
|
|
105
122
|
type: "memory",
|
|
106
123
|
ttl: undefined,
|
|
107
|
-
maxEntries:
|
|
124
|
+
maxEntries: DEFAULT_RENDER_CACHE_MAX_ENTRIES,
|
|
108
125
|
kvPath: undefined,
|
|
109
126
|
redisUrl: undefined,
|
|
110
127
|
redisKeyPrefix: undefined,
|
|
@@ -130,7 +147,7 @@ function createFreshDefaults(): Partial<VeryfrontConfig> {
|
|
|
130
147
|
}
|
|
131
148
|
|
|
132
149
|
const configCacheByProject = new LRUCache<string, { revision: number; config: VeryfrontConfig }>({
|
|
133
|
-
maxEntries:
|
|
150
|
+
maxEntries: DEFAULT_CONFIG_CACHE_MAX_ENTRIES,
|
|
134
151
|
});
|
|
135
152
|
|
|
136
153
|
// Register cache for monitoring
|
|
@@ -11,6 +11,9 @@ import type { VeryfrontConfig } from "./schemas/index.js";
|
|
|
11
11
|
import type { EnvironmentConfig } from "./environment-config.js";
|
|
12
12
|
import { createTestEnvironmentConfig, getEnvironmentConfig } from "./environment-config.js";
|
|
13
13
|
|
|
14
|
+
/** Maximum entries in the default render cache */
|
|
15
|
+
const DEFAULT_RENDER_CACHE_MAX_ENTRIES = 500;
|
|
16
|
+
|
|
14
17
|
/**
|
|
15
18
|
* Runtime-specific configuration derived from environment.
|
|
16
19
|
*/
|
|
@@ -70,7 +73,7 @@ export const DEFAULT_CONFIG: Partial<VeryfrontConfig> = {
|
|
|
70
73
|
dir: ".veryfront",
|
|
71
74
|
render: {
|
|
72
75
|
type: "memory",
|
|
73
|
-
maxEntries:
|
|
76
|
+
maxEntries: DEFAULT_RENDER_CACHE_MAX_ENTRIES,
|
|
74
77
|
},
|
|
75
78
|
},
|
|
76
79
|
dev: {
|
|
@@ -12,8 +12,7 @@ export class DataFetcher {
|
|
|
12
12
|
private staticFetcher: StaticDataFetcher;
|
|
13
13
|
private pathsFetcher: StaticPathsFetcher;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
constructor(adapter?: unknown) {
|
|
15
|
+
constructor(_adapter?: unknown) {
|
|
17
16
|
this.cacheManager = new CacheManager();
|
|
18
17
|
this.serverFetcher = new ServerDataFetcher();
|
|
19
18
|
this.staticFetcher = new StaticDataFetcher(this.cacheManager);
|
|
@@ -258,8 +258,8 @@ export class StaticDataFetcher {
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
});
|
|
261
|
-
} catch {
|
|
262
|
-
//
|
|
261
|
+
} catch (_) {
|
|
262
|
+
// expected: semaphore timeout when too many concurrent revalidations
|
|
263
263
|
serverLogger.warn("DATA_REVALIDATION_SKIPPED semaphore timeout", {
|
|
264
264
|
pathname,
|
|
265
265
|
cacheKey,
|
|
@@ -50,7 +50,8 @@ export async function findTypeScriptFiles(
|
|
|
50
50
|
files.push(...(await findTypeScriptFiles(filePath, context)));
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
} catch {
|
|
53
|
+
} catch (_) {
|
|
54
|
+
/* expected: directory may not exist or be unreadable */
|
|
54
55
|
return files;
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -62,7 +63,7 @@ export async function findTypeScriptFiles(
|
|
|
62
63
|
*
|
|
63
64
|
* Only called when no fsAdapter is present — callers must guard accordingly.
|
|
64
65
|
*/
|
|
65
|
-
|
|
66
|
+
async function getNodeDeps(
|
|
66
67
|
context: FileDiscoveryContext,
|
|
67
68
|
): Promise<{ fs: typeof import("node:fs"); path: typeof import("node:path") }> {
|
|
68
69
|
if (context.nodeDeps) return context.nodeDeps;
|
|
@@ -17,12 +17,12 @@ import type { FileDiscoveryContext } from "../types.js";
|
|
|
17
17
|
|
|
18
18
|
const logger = agentLogger.component("skill-discovery");
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
interface SkillDiscoveryError {
|
|
21
21
|
file: string;
|
|
22
22
|
error: Error;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface SkillDiscoveryResult {
|
|
26
26
|
skills: Map<string, Skill>;
|
|
27
27
|
errors: SkillDiscoveryError[];
|
|
28
28
|
}
|
|
@@ -114,7 +114,8 @@ export async function rewriteDiscoveryImports(
|
|
|
114
114
|
"index.js";
|
|
115
115
|
|
|
116
116
|
return pathToFileURL(pathHelper.join(packagePath, entryPoint)).href;
|
|
117
|
-
} catch {
|
|
117
|
+
} catch (_) {
|
|
118
|
+
/* expected: package.json not found at this level, walk up */
|
|
118
119
|
const parent = pathHelper.dirname(searchDir);
|
|
119
120
|
if (parent === searchDir) break;
|
|
120
121
|
searchDir = parent;
|
|
@@ -164,7 +165,8 @@ export async function rewriteDiscoveryImports(
|
|
|
164
165
|
const vfPackageJsonPath = pathHelper.join(vfPackagePath, "package.json");
|
|
165
166
|
const pkgJson = JSON.parse(await fs.readTextFile(vfPackageJsonPath));
|
|
166
167
|
exportsMap = pkgJson.exports || {};
|
|
167
|
-
} catch {
|
|
168
|
+
} catch (_) {
|
|
169
|
+
/* expected: veryfront package.json not found, fallback to deno.json search */
|
|
168
170
|
// Search for deno.json in parent directories
|
|
169
171
|
let searchDir = projectDir;
|
|
170
172
|
|
|
@@ -177,8 +179,8 @@ export async function rewriteDiscoveryImports(
|
|
|
177
179
|
vfPackagePath = searchDir;
|
|
178
180
|
break;
|
|
179
181
|
}
|
|
180
|
-
} catch {
|
|
181
|
-
|
|
182
|
+
} catch (_) {
|
|
183
|
+
/* expected: deno.json not found at this level */
|
|
182
184
|
}
|
|
183
185
|
searchDir = pathHelper.dirname(searchDir);
|
|
184
186
|
}
|
|
@@ -211,7 +213,8 @@ export async function rewriteDiscoveryImports(
|
|
|
211
213
|
const resolvedPath = pathHelper.join(vfPackagePath, exportPath);
|
|
212
214
|
return `from "${pathToFileURL(resolvedPath).href}"`;
|
|
213
215
|
});
|
|
214
|
-
} catch {
|
|
216
|
+
} catch (_) {
|
|
217
|
+
/* expected: Node.js URL module unavailable in non-Node runtime */
|
|
215
218
|
return transformed;
|
|
216
219
|
}
|
|
217
220
|
|
|
@@ -15,6 +15,7 @@ import { getEsbuildLoader } from "../utils/path-utils.js";
|
|
|
15
15
|
import type { FileSystemAdapter } from "../platform/adapters/base.js";
|
|
16
16
|
import type { FileDiscoveryContext } from "./types.js";
|
|
17
17
|
import { rewriteDiscoveryImports, rewriteForDeno } from "./import-rewriter.js";
|
|
18
|
+
import { COMPILATION_ERROR, FILE_NOT_FOUND } from "../errors/index.js";
|
|
18
19
|
import { wrapWithCurrentContext } from "../platform/adapters/fs/veryfront/multi-project-adapter.js";
|
|
19
20
|
// Static import ensures deno compile includes embedding in the binary.
|
|
20
21
|
// Other modules (agent, tool, etc.) are statically imported elsewhere;
|
|
@@ -159,7 +160,10 @@ export async function importModule(
|
|
|
159
160
|
? await context.fsAdapter.readFile(filePath)
|
|
160
161
|
: await createFileSystem().readTextFile(filePath);
|
|
161
162
|
} catch (error) {
|
|
162
|
-
throw
|
|
163
|
+
throw FILE_NOT_FOUND.create({
|
|
164
|
+
detail: `Failed to read file ${filePath}: ${error}`,
|
|
165
|
+
cause: error,
|
|
166
|
+
});
|
|
163
167
|
}
|
|
164
168
|
|
|
165
169
|
const loader = getEsbuildLoader(filePath);
|
|
@@ -208,9 +212,9 @@ export async function importModule(
|
|
|
208
212
|
});
|
|
209
213
|
|
|
210
214
|
if (result.errors.length > 0) {
|
|
211
|
-
throw
|
|
212
|
-
`Failed to transpile ${filePath}: ${result.errors[0]?.text ?? "unknown error"}`,
|
|
213
|
-
);
|
|
215
|
+
throw COMPILATION_ERROR.create({
|
|
216
|
+
detail: `Failed to transpile ${filePath}: ${result.errors[0]?.text ?? "unknown error"}`,
|
|
217
|
+
});
|
|
214
218
|
}
|
|
215
219
|
|
|
216
220
|
const js = result.outputFiles?.[0]?.text ?? "export {}";
|