veryfront 0.1.1190 → 0.1.1191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/cli/commands/serve/command.d.ts.map +1 -1
- package/esm/cli/commands/serve/command.js +5 -24
- package/esm/cli/commands/serve/proxy-extension-composition.d.ts +6 -5
- package/esm/cli/commands/serve/proxy-extension-composition.d.ts.map +1 -1
- package/esm/cli/commands/serve/proxy-extension-composition.js +58 -29
- package/esm/cli/commands/serve/proxy-runtime.d.ts +17 -0
- package/esm/cli/commands/serve/proxy-runtime.d.ts.map +1 -0
- package/esm/cli/commands/serve/proxy-runtime.js +54 -0
- package/esm/cli/mcp/dev-server-client.d.ts +6 -0
- package/esm/cli/mcp/dev-server-client.d.ts.map +1 -1
- package/esm/cli/mcp/dev-server-client.js +117 -5
- package/esm/cli/shared/config.d.ts +15 -1
- package/esm/cli/shared/config.d.ts.map +1 -1
- package/esm/cli/shared/config.js +24 -15
- package/esm/cli/shared/deployment/control-plane.d.ts +9 -2
- package/esm/cli/shared/deployment/control-plane.d.ts.map +1 -1
- package/esm/cli/shared/deployment/control-plane.js +7 -2
- package/esm/cli/shared/deployment/deploy-project.d.ts +2 -2
- package/esm/cli/shared/deployment/deploy-project.d.ts.map +1 -1
- package/esm/cli/shared/deployment/deploy-project.js +97 -28
- package/esm/cli/templates/manifest.d.ts +2 -0
- package/esm/cli/templates/manifest.js +7 -5
- package/esm/deno.d.ts +5 -0
- package/esm/deno.js +9 -4
- package/esm/extensions/ext-llm-anthropic/src/anthropic-native-content.d.ts.map +1 -1
- package/esm/extensions/ext-llm-anthropic/src/anthropic-native-content.js +2 -2
- package/esm/extensions/ext-llm-google/src/google-thought-signatures.d.ts.map +1 -1
- package/esm/extensions/ext-llm-google/src/google-thought-signatures.js +2 -2
- package/esm/extensions/ext-llm-openai/src/openai-web-search.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-web-search.js +2 -2
- package/esm/src/agent/hosted/child-fork-run-context.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-fork-run-context.js +4 -1
- package/esm/src/agent/hosted/child-pending-tool-lifecycle.d.ts +1 -0
- package/esm/src/agent/hosted/child-pending-tool-lifecycle.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-pending-tool-lifecycle.js +8 -2
- package/esm/src/agent/hosted/child-tool-input.d.ts +1 -0
- package/esm/src/agent/hosted/child-tool-input.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-tool-input.js +14 -1
- package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-agent-chat-execution.js +3 -3
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts +2 -1
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-agent-child-tools.js +12 -6
- package/esm/src/agent/hosted/cloud-agent-config.d.ts +3 -0
- package/esm/src/agent/hosted/cloud-agent-config.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-agent-config.js +5 -0
- package/esm/src/agent/hosted/cloud-agent-provider-bootstrap.d.ts +2 -0
- package/esm/src/agent/hosted/cloud-agent-provider-bootstrap.d.ts.map +1 -1
- package/esm/src/agent/hosted/project-reference-resolver.d.ts +5 -0
- package/esm/src/agent/hosted/project-reference-resolver.d.ts.map +1 -1
- package/esm/src/agent/hosted/project-reference-resolver.js +63 -8
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts +10 -0
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts +9 -2
- package/esm/src/agent/runtime/agent-invocation-contract.d.ts.map +1 -1
- package/esm/src/agent/runtime/agent-invocation-contract.js +38 -3
- package/esm/src/agent/runtime/error-utils.d.ts +2 -0
- package/esm/src/agent/runtime/error-utils.d.ts.map +1 -1
- package/esm/src/agent/runtime/error-utils.js +300 -5
- package/esm/src/agent/runtime/model-resolution.js +36 -36
- package/esm/src/agent/schemas/agent.schema.d.ts +4 -4
- package/esm/src/agent/service/config.d.ts.map +1 -1
- package/esm/src/agent/service/config.js +4 -1
- package/esm/src/build/production-build/templates.d.ts.map +1 -1
- package/esm/src/build/production-build/templates.js +1 -1
- package/esm/src/cache/config-hash.d.ts.map +1 -1
- package/esm/src/cache/config-hash.js +39 -26
- package/esm/src/cache/keys/builders/render.d.ts +4 -1
- package/esm/src/cache/keys/builders/render.d.ts.map +1 -1
- package/esm/src/cache/keys/builders/render.js +13 -3
- package/esm/src/channels/control-plane.d.ts +17 -0
- package/esm/src/channels/control-plane.d.ts.map +1 -1
- package/esm/src/channels/control-plane.js +32 -0
- package/esm/src/errors/catalog/module-errors.d.ts.map +1 -1
- package/esm/src/errors/catalog/module-errors.js +10 -0
- package/esm/src/errors/error-registry/module.d.ts +4 -0
- package/esm/src/errors/error-registry/module.d.ts.map +1 -1
- package/esm/src/errors/error-registry/module.js +16 -0
- 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/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/types.d.ts.map +1 -1
- package/esm/src/errors/types.js +5 -2
- package/esm/src/eval/studio.d.ts +1 -1
- package/esm/src/extensions/bundler/bundler.d.ts +8 -0
- package/esm/src/extensions/bundler/bundler.d.ts.map +1 -1
- package/esm/src/extensions/distributed/rate-limit-support.d.ts +3 -1
- package/esm/src/extensions/distributed/rate-limit-support.d.ts.map +1 -1
- package/esm/src/extensions/distributed/rate-limit-support.js +3 -1
- package/esm/src/html/dev-scripts.d.ts.map +1 -1
- package/esm/src/html/dev-scripts.js +2 -1
- package/esm/src/html/html-injection.d.ts.map +1 -1
- package/esm/src/html/html-injection.js +37 -3
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/html/index.d.ts +1 -0
- package/esm/src/html/index.d.ts.map +1 -1
- package/esm/src/html/index.js +1 -0
- package/esm/src/html/project-stylesheet-ids.d.ts +4 -0
- package/esm/src/html/project-stylesheet-ids.d.ts.map +1 -0
- package/esm/src/html/project-stylesheet-ids.js +6 -0
- package/esm/src/internal-agents/schema.d.ts +2 -0
- package/esm/src/internal-agents/schema.d.ts.map +1 -1
- package/esm/src/internal-agents/schema.js +4 -1
- package/esm/src/middleware/builtin/security/rate-limit.d.ts +26 -1
- package/esm/src/middleware/builtin/security/rate-limit.d.ts.map +1 -1
- package/esm/src/middleware/builtin/security/rate-limit.js +164 -36
- package/esm/src/middleware/builtin/security/redis-rate-limit-script.d.ts +2 -0
- package/esm/src/middleware/builtin/security/redis-rate-limit-script.d.ts.map +1 -0
- package/esm/src/middleware/builtin/security/redis-rate-limit-script.js +9 -0
- package/esm/src/middleware/builtin/security/redis-rate-limit.d.ts +13 -2
- package/esm/src/middleware/builtin/security/redis-rate-limit.d.ts.map +1 -1
- package/esm/src/middleware/builtin/security/redis-rate-limit.js +88 -20
- package/esm/src/middleware/index.d.ts +1 -1
- package/esm/src/middleware/index.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.d.ts +2 -1
- package/esm/src/modules/import-map/loader.d.ts.map +1 -1
- package/esm/src/modules/import-map/loader.js +210 -81
- package/esm/src/modules/import-map/merger.d.ts.map +1 -1
- package/esm/src/modules/import-map/merger.js +57 -11
- package/esm/src/modules/import-map/preloader.d.ts +83 -2
- package/esm/src/modules/import-map/preloader.d.ts.map +1 -1
- package/esm/src/modules/import-map/preloader.js +824 -25
- package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/loader.js +28 -1
- package/esm/src/modules/server/browser-module-admission.d.ts +27 -0
- package/esm/src/modules/server/browser-module-admission.d.ts.map +1 -0
- package/esm/src/modules/server/browser-module-admission.js +164 -0
- package/esm/src/modules/server/classify.d.ts.map +1 -1
- package/esm/src/modules/server/classify.js +18 -2
- package/esm/src/modules/server/module-server.d.ts +14 -0
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +500 -132
- package/esm/src/modules/server/rate-limiter.d.ts +7 -2
- package/esm/src/modules/server/rate-limiter.d.ts.map +1 -1
- package/esm/src/modules/server/rate-limiter.js +30 -6
- package/esm/src/modules/server/websocket-handler.d.ts.map +1 -1
- package/esm/src/modules/server/websocket-handler.js +4 -5
- package/esm/src/observability/tracing/service-tracer.d.ts.map +1 -1
- package/esm/src/observability/tracing/service-tracer.js +2 -10
- package/esm/src/platform/adapters/fs/cache/file-cache.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/cache/file-cache.js +11 -1
- package/esm/src/platform/adapters/fs/github/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/github/adapter.js +0 -5
- package/esm/src/platform/adapters/fs/github/github-api-client.d.ts +1 -0
- 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 +81 -6
- package/esm/src/platform/adapters/fs/github/path-utils.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/github/path-utils.js +22 -1
- package/esm/src/platform/adapters/fs/github/types.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/github/types.js +12 -11
- package/esm/src/platform/adapters/fs/integration.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/integration.js +25 -36
- package/esm/src/platform/adapters/fs/veryfront/path-normalizer.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/path-normalizer.js +17 -4
- package/esm/src/platform/adapters/fs/veryfront/proxy-manager.d.ts +6 -2
- package/esm/src/platform/adapters/fs/veryfront/proxy-manager.d.ts.map +1 -1
- package/esm/src/platform/adapters/fs/veryfront/proxy-manager.js +207 -59
- package/esm/src/platform/adapters/fs/veryfront/schemas/proxy-manager.schema.js +1 -1
- package/esm/src/platform/adapters/veryfront-api-transport.d.ts +4 -0
- package/esm/src/platform/adapters/veryfront-api-transport.d.ts.map +1 -1
- package/esm/src/platform/adapters/veryfront-api-transport.js +20 -6
- package/esm/src/platform/compat/error-introspection.d.ts +12 -1
- package/esm/src/platform/compat/error-introspection.d.ts.map +1 -1
- package/esm/src/platform/compat/error-introspection.js +40 -5
- package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -1
- package/esm/src/platform/compat/path/basic-operations.js +6 -2
- package/esm/src/platform/compat/path/portable.d.ts.map +1 -1
- package/esm/src/platform/compat/path/portable.js +98 -54
- package/esm/src/platform/compat/path/resolution.d.ts.map +1 -1
- package/esm/src/platform/compat/path/resolution.js +14 -5
- package/esm/src/platform/compat/primordials/array.d.ts +8 -0
- package/esm/src/platform/compat/primordials/array.d.ts.map +1 -0
- package/esm/src/platform/compat/primordials/array.js +33 -0
- package/esm/src/platform/index.d.ts +1 -1
- package/esm/src/platform/index.d.ts.map +1 -1
- package/esm/src/platform/index.js +1 -1
- package/esm/src/provider/runtime-loader/json-snapshot.d.ts +12 -0
- package/esm/src/provider/runtime-loader/json-snapshot.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader/json-snapshot.js +203 -57
- package/esm/src/provider/runtime-loader.d.ts +1 -1
- package/esm/src/provider/runtime-loader.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader.js +3 -3
- package/esm/src/provider/shared/index.d.ts +1 -1
- package/esm/src/provider/shared/index.d.ts.map +1 -1
- package/esm/src/provider/shared/index.js +1 -1
- package/esm/src/proxy/control-plane-signature.d.ts +14 -0
- package/esm/src/proxy/control-plane-signature.d.ts.map +1 -1
- package/esm/src/proxy/control-plane-signature.js +131 -1
- package/esm/src/proxy/handler.d.ts +3 -1
- package/esm/src/proxy/handler.d.ts.map +1 -1
- package/esm/src/proxy/handler.js +56 -3
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts +12 -5
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedBackgroundImage.js +5 -4
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts +8 -2
- package/esm/src/react/components/optimized-image/OptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/OptimizedImage.js +7 -7
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts +4 -3
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/SimpleOptimizedImage.js +10 -7
- package/esm/src/react/components/optimized-image/helpers.d.ts +20 -1
- package/esm/src/react/components/optimized-image/helpers.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/helpers.js +168 -6
- package/esm/src/react/components/optimized-image/index.d.ts +3 -2
- package/esm/src/react/components/optimized-image/index.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/useOptimizedImage.d.ts +11 -6
- package/esm/src/react/components/optimized-image/useOptimizedImage.d.ts.map +1 -1
- package/esm/src/react/components/optimized-image/useOptimizedImage.js +6 -8
- package/esm/src/react/index.d.ts +1 -1
- package/esm/src/react/index.d.ts.map +1 -1
- package/esm/src/release-assets/index.d.ts +1 -1
- package/esm/src/release-assets/index.d.ts.map +1 -1
- package/esm/src/release-assets/index.js +1 -1
- package/esm/src/release-assets/manifest-cache.d.ts +7 -6
- package/esm/src/release-assets/manifest-cache.d.ts.map +1 -1
- package/esm/src/release-assets/manifest-cache.js +19 -5
- package/esm/src/release-assets/manifest-schema.d.ts +14 -2
- package/esm/src/release-assets/manifest-schema.d.ts.map +1 -1
- package/esm/src/release-assets/manifest-schema.js +21 -1
- package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/layout-applicator.js +1 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts +2 -1
- package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/applicator.js +3 -3
- package/esm/src/rendering/layouts/utils/component-loader.d.ts +4 -3
- package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
- package/esm/src/rendering/layouts/utils/component-loader.js +10 -6
- package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
- package/esm/src/rendering/orchestrator/layout.js +6 -2
- package/esm/src/routing/api/module-loader/esbuild-plugin.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/esbuild-plugin.js +9 -3
- package/esm/src/runs/schemas.d.ts +11 -11
- package/esm/src/security/http/base-handler.d.ts.map +1 -1
- package/esm/src/security/http/base-handler.js +5 -3
- package/esm/src/security/http/local-control-request.d.ts +39 -0
- package/esm/src/security/http/local-control-request.d.ts.map +1 -0
- package/esm/src/security/http/local-control-request.js +137 -0
- package/esm/src/server/bootstrap.d.ts.map +1 -1
- package/esm/src/server/bootstrap.js +11 -0
- package/esm/src/server/context/request-context.d.ts +6 -0
- package/esm/src/server/context/request-context.d.ts.map +1 -1
- package/esm/src/server/context/request-context.js +2 -1
- package/esm/src/server/handlers/dev/dashboard/access-policy.d.ts +20 -0
- package/esm/src/server/handlers/dev/dashboard/access-policy.d.ts.map +1 -0
- package/esm/src/server/handlers/dev/dashboard/access-policy.js +106 -0
- package/esm/src/server/handlers/dev/dashboard/html-shell.d.ts +2 -1
- package/esm/src/server/handlers/dev/dashboard/html-shell.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/html-shell.js +8 -32
- package/esm/src/server/handlers/dev/dashboard/index.d.ts +3 -0
- package/esm/src/server/handlers/dev/dashboard/index.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/index.js +73 -8
- package/esm/src/server/handlers/dev/dashboard/ui-handler.d.ts +2 -1
- package/esm/src/server/handlers/dev/dashboard/ui-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/dashboard/ui-handler.js +5 -84
- 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 -0
- package/esm/src/server/handlers/dev/files/dev-file.handler.d.ts +0 -1
- package/esm/src/server/handlers/dev/files/dev-file.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/dev-file.handler.js +21 -30
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts +5 -0
- package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/esbuild-plugins.js +56 -14
- package/esm/src/server/handlers/dev/files/path-validator.d.ts +8 -1
- package/esm/src/server/handlers/dev/files/path-validator.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/files/path-validator.js +21 -8
- package/esm/src/server/handlers/dev/projects/api.js +1 -1
- package/esm/src/server/handlers/dev/projects/html-shell.d.ts +1 -1
- package/esm/src/server/handlers/dev/projects/html-shell.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/projects/html-shell.js +2 -36
- package/esm/src/server/handlers/dev/projects/index.d.ts +3 -0
- package/esm/src/server/handlers/dev/projects/index.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/projects/index.js +37 -7
- package/esm/src/server/handlers/dev/projects/ui-handler.d.ts +2 -1
- package/esm/src/server/handlers/dev/projects/ui-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/projects/ui-handler.js +5 -103
- package/esm/src/server/handlers/dev/scripts/hmr-scripts.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/scripts/hmr-scripts.js +37 -13
- package/esm/src/server/handlers/dev/shared/dev-ui-bundle-response.d.ts +10 -0
- package/esm/src/server/handlers/dev/shared/dev-ui-bundle-response.d.ts.map +1 -0
- package/esm/src/server/handlers/dev/shared/dev-ui-bundle-response.js +50 -0
- package/esm/src/server/handlers/monitoring/client-log.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/monitoring/client-log.handler.js +4 -0
- package/esm/src/server/handlers/monitoring/memory.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/monitoring/memory.handler.js +4 -0
- package/esm/src/server/handlers/monitoring/metrics.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/monitoring/metrics.handler.js +4 -0
- package/esm/src/server/handlers/preview/hmr-client-message.d.ts +2 -1
- package/esm/src/server/handlers/preview/hmr-client-message.d.ts.map +1 -1
- package/esm/src/server/handlers/preview/hmr-client-message.js +4 -13
- package/esm/src/server/handlers/preview/hmr.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/preview/hmr.handler.js +3 -24
- package/esm/src/server/handlers/request/agent-stream.handler.d.ts +5 -0
- package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/agent-stream.handler.js +78 -60
- package/esm/src/server/handlers/request/module/module-server-handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/module/module-server-handler.js +2 -0
- package/esm/src/server/project-env/cache.d.ts +31 -8
- package/esm/src/server/project-env/cache.d.ts.map +1 -1
- package/esm/src/server/project-env/cache.js +222 -42
- package/esm/src/server/project-env/fetcher.d.ts +10 -3
- package/esm/src/server/project-env/fetcher.d.ts.map +1 -1
- package/esm/src/server/project-env/fetcher.js +138 -27
- package/esm/src/server/project-env/index.d.ts +2 -1
- package/esm/src/server/project-env/index.d.ts.map +1 -1
- package/esm/src/server/project-env/index.js +2 -1
- package/esm/src/server/project-env/production-environment-resolver.d.ts +40 -0
- package/esm/src/server/project-env/production-environment-resolver.d.ts.map +1 -0
- package/esm/src/server/project-env/production-environment-resolver.js +237 -0
- package/esm/src/server/runtime-handler/adapter-factory.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/adapter-factory.js +4 -9
- package/esm/src/server/runtime-handler/environment-resolution.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/environment-resolution.js +7 -2
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts +9 -1
- package/esm/src/server/runtime-handler/handler-context-builder.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/handler-context-builder.js +4 -0
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +45 -25
- package/esm/src/server/runtime-handler/project-middleware.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/project-middleware.js +15 -8
- package/esm/src/server/runtime-handler/project-resolution.d.ts +5 -1
- package/esm/src/server/runtime-handler/project-resolution.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/project-resolution.js +30 -16
- package/esm/src/server/runtime-handler/project-runtime-context.d.ts +9 -8
- package/esm/src/server/runtime-handler/project-runtime-context.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/project-runtime-context.js +86 -28
- package/esm/src/server/runtime-handler/timeout-manager.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/timeout-manager.js +11 -4
- package/esm/src/server/services/rsc/endpoints/endpoint-router.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/endpoint-router.js +67 -99
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
- package/esm/src/server/shared/browser-module-bundler.d.ts +56 -1
- package/esm/src/server/shared/browser-module-bundler.d.ts.map +1 -1
- package/esm/src/server/shared/browser-module-bundler.js +626 -83
- package/esm/src/server/utils/proxy-trust.d.ts +9 -16
- package/esm/src/server/utils/proxy-trust.d.ts.map +1 -1
- package/esm/src/server/utils/proxy-trust.js +8 -29
- package/esm/src/testing/assert.d.ts +1 -1
- package/esm/src/testing/assert.d.ts.map +1 -1
- package/esm/src/testing/assert.js +3 -1
- package/esm/src/tool/factory.d.ts.map +1 -1
- package/esm/src/tool/factory.js +42 -10
- package/esm/src/tool/index.d.ts +1 -1
- package/esm/src/tool/index.d.ts.map +1 -1
- package/esm/src/tool/index.js +1 -1
- package/esm/src/tool/remote-mcp.d.ts +16 -1
- package/esm/src/tool/remote-mcp.d.ts.map +1 -1
- package/esm/src/tool/remote-mcp.js +48 -6
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +4 -0
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +184 -62
- package/esm/src/transforms/esm/package-registry.d.ts +6 -0
- package/esm/src/transforms/esm/package-registry.d.ts.map +1 -1
- package/esm/src/transforms/esm/package-registry.js +9 -0
- package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/specifier-resolver.js +22 -9
- package/esm/src/transforms/esm/types.d.ts +8 -0
- package/esm/src/transforms/esm/types.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/url-builder.js +40 -14
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts +1 -0
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts.map +1 -1
- package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.js +8 -4
- package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts +15 -0
- 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 +32 -2
- package/esm/src/transforms/pipeline/cache-identity.d.ts +38 -0
- package/esm/src/transforms/pipeline/cache-identity.d.ts.map +1 -0
- package/esm/src/transforms/pipeline/cache-identity.js +381 -0
- package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/index.js +71 -27
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.js +2 -0
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/constants.d.ts +4 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/constants.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/constants.js +17 -2
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.js +4 -2
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/transform.d.ts +2 -2
- 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 +10 -10
- package/esm/src/transforms/pipeline/types.d.ts +19 -1
- package/esm/src/transforms/pipeline/types.d.ts.map +1 -1
- package/esm/src/transforms/shared/server-only-packages.d.ts.map +1 -1
- package/esm/src/transforms/shared/server-only-packages.js +17 -2
- package/esm/src/types/server.d.ts +8 -0
- package/esm/src/types/server.d.ts.map +1 -1
- package/esm/src/utils/base64url.d.ts.map +1 -1
- package/esm/src/utils/base64url.js +10 -4
- package/esm/src/utils/bundle-manifest.d.ts +19 -1
- package/esm/src/utils/bundle-manifest.d.ts.map +1 -1
- package/esm/src/utils/bundle-manifest.js +124 -27
- package/esm/src/utils/cache/eviction/eviction-manager.js +2 -2
- package/esm/src/utils/cache/stores/memory/entry-manager.d.ts +2 -1
- package/esm/src/utils/cache/stores/memory/entry-manager.d.ts.map +1 -1
- package/esm/src/utils/cache/stores/memory/entry-manager.js +7 -5
- package/esm/src/utils/cache/stores/memory/lru-cache-adapter.d.ts +7 -0
- package/esm/src/utils/cache/stores/memory/lru-cache-adapter.d.ts.map +1 -1
- package/esm/src/utils/cache/stores/memory/lru-cache-adapter.js +74 -17
- package/esm/src/utils/cache/stores/memory/lru-list-manager.d.ts +2 -0
- package/esm/src/utils/cache/stores/memory/lru-list-manager.d.ts.map +1 -1
- package/esm/src/utils/cache/stores/memory/lru-list-manager.js +6 -2
- package/esm/src/utils/cache/stores/memory/types.d.ts +2 -0
- package/esm/src/utils/cache/stores/memory/types.d.ts.map +1 -1
- package/esm/src/utils/cache-dir.d.ts +22 -1
- package/esm/src/utils/cache-dir.d.ts.map +1 -1
- package/esm/src/utils/cache-dir.js +171 -18
- package/esm/src/utils/cache-file-ops.d.ts +7 -3
- package/esm/src/utils/cache-file-ops.d.ts.map +1 -1
- package/esm/src/utils/cache-file-ops.js +26 -9
- package/esm/src/utils/cache-namespace.d.ts.map +1 -1
- package/esm/src/utils/cache-namespace.js +3 -1
- package/esm/src/utils/constants/limits.d.ts +1 -1
- package/esm/src/utils/constants/limits.d.ts.map +1 -1
- package/esm/src/utils/constants/limits.js +1 -1
- package/esm/src/utils/cookie-utils.d.ts.map +1 -1
- package/esm/src/utils/cookie-utils.js +15 -2
- package/esm/src/utils/env-loader.d.ts.map +1 -1
- package/esm/src/utils/env-loader.js +7 -2
- package/esm/src/utils/file-discovery.d.ts.map +1 -1
- package/esm/src/utils/file-discovery.js +88 -4
- package/esm/src/utils/hash-utils.d.ts.map +1 -1
- package/esm/src/utils/hash-utils.js +32 -6
- package/esm/src/utils/header-identity.d.ts +3 -0
- package/esm/src/utils/header-identity.d.ts.map +1 -0
- package/esm/src/utils/header-identity.js +25 -0
- package/esm/src/utils/id.d.ts.map +1 -1
- package/esm/src/utils/id.js +26 -4
- package/esm/src/utils/image-variant-widths.d.ts +13 -0
- package/esm/src/utils/image-variant-widths.d.ts.map +1 -0
- package/esm/src/utils/image-variant-widths.js +75 -0
- package/esm/src/utils/import-lockfile.d.ts +52 -1
- package/esm/src/utils/import-lockfile.d.ts.map +1 -1
- package/esm/src/utils/import-lockfile.js +1041 -58
- package/esm/src/utils/index.d.ts +1 -1
- package/esm/src/utils/index.d.ts.map +1 -1
- package/esm/src/utils/index.js +1 -1
- package/esm/src/utils/logger/logger.d.ts +1 -0
- package/esm/src/utils/logger/logger.d.ts.map +1 -1
- package/esm/src/utils/logger/logger.js +359 -78
- package/esm/src/utils/logger/redact.d.ts +4 -2
- package/esm/src/utils/logger/redact.d.ts.map +1 -1
- package/esm/src/utils/logger/redact.js +300 -112
- package/esm/src/utils/logger/serialization.d.ts +3 -0
- package/esm/src/utils/logger/serialization.d.ts.map +1 -0
- package/esm/src/utils/logger/serialization.js +81 -0
- package/esm/src/utils/lru-wrapper.js +2 -2
- package/esm/src/utils/memoize.d.ts +1 -1
- package/esm/src/utils/memoize.d.ts.map +1 -1
- package/esm/src/utils/memoize.js +16 -5
- package/esm/src/utils/memory/profiler.d.ts +11 -0
- package/esm/src/utils/memory/profiler.d.ts.map +1 -1
- package/esm/src/utils/memory/profiler.js +20 -5
- package/esm/src/utils/path-utils.d.ts.map +1 -1
- package/esm/src/utils/path-utils.js +4 -2
- package/esm/src/utils/sleep.d.ts +8 -1
- package/esm/src/utils/sleep.d.ts.map +1 -1
- package/esm/src/utils/sleep.js +11 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/utils/websocket-message-size.d.ts +22 -0
- package/esm/src/utils/websocket-message-size.d.ts.map +1 -0
- package/esm/src/utils/websocket-message-size.js +41 -0
- package/esm/src/workflow/schemas/workflow.schema.d.ts +10 -10
- package/esm/src/workflow/worker/shared.d.ts.map +1 -1
- package/esm/src/workflow/worker/shared.js +16 -5
- package/package.json +8 -8
- package/esm/src/server/dev-ui/manifest.d.ts +0 -33
- package/esm/src/server/dev-ui/manifest.d.ts.map +0 -1
- package/esm/src/server/dev-ui/manifest.js +0 -31
- package/esm/src/server/handlers/dev/shared/ui-module-transform.d.ts +0 -8
- package/esm/src/server/handlers/dev/shared/ui-module-transform.d.ts.map +0 -1
- package/esm/src/server/handlers/dev/shared/ui-module-transform.js +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/command.ts"],"names":[],"mappings":"AAWA,KAAK,oBAAoB,GAAG;IAC1B,uBAAuB,EAAE,CACvB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAC1B,MAAM,GAAG,SAAS,CAAC;IACxB,sBAAsB,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjE,gBAAgB,CAAC,EAAE,CACjB,SAAS,EAAE,SAAS,GAAG,OAAO,EAC9B,KAAK,EAAE,OAAO,KACX,IAAI,CAAC;CACX,CAAC;AAEF,KAAK,4BAA4B,GAAG;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,4BAA4B,GAAG;IAClC,sBAAsB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,wBAAwB,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACzD,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,uBAAuB,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;IACzE,sBAAsB,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,CAAC;IACvE,uBAAuB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACjD,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,4BAA4B,CAAC,CAAC,EAClD,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,CAAC,CAAC,CAqBZ;AAoCD,wBAAsB,sCAAsC,CAAC,CAAC,EAC5D,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,QAAQ,EAAE,oBAAoB,EAC9B,sBAAsB,GAAE,MAAM,OAAO,CAAC,IAAI,CAA6B,EACvE,uBAAuB,GAAE,MAAM,OAAO,CAAC,OAAO,CAA2B,GACxE,OAAO,CAAC,CAAC,CAAC,CAMZ;AA2DD,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,YAAY,EACrB,YAAY,GAAE,4BAAiC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAgFf;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,YAAY,EACrB,YAAY,GAAE,wBAA6B,GAC1C,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
|
@@ -5,6 +5,7 @@ import { exitProcess, registerTerminationSignals, showHeader } from "../../utils
|
|
|
5
5
|
import { generateDefaultProjectId } from "../../utils/project.js";
|
|
6
6
|
import { startCliProductionServer } from "../../shared/server-startup.js";
|
|
7
7
|
import { ensureCliBundlerContracts } from "../../shared/default-contracts.js";
|
|
8
|
+
import { runStandaloneProxyRuntime } from "./proxy-runtime.js";
|
|
8
9
|
const STARTUP_ERROR_FLUSH_TIMEOUT_MS = 2_000;
|
|
9
10
|
export async function runWithStartupErrorReporting(startup, reporter, options = {}) {
|
|
10
11
|
const flushTimeoutMs = options.flushTimeoutMs ?? STARTUP_ERROR_FLUSH_TIMEOUT_MS;
|
|
@@ -75,30 +76,10 @@ async function runSplit(options) {
|
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
async function runProxy(options) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
setEnv("HOST", options.bindAddress);
|
|
83
|
-
const { activateStandaloneProxyCacheExtension, registerStandaloneProxyCacheExtensionTeardown, } = await import("./proxy-extension-composition.js");
|
|
84
|
-
const extensionLoader = await activateStandaloneProxyCacheExtension();
|
|
85
|
-
const teardownCacheExtension = await registerStandaloneProxyCacheExtensionTeardown(extensionLoader);
|
|
86
|
-
// DenoHttpServer.serve() blocks until the server stops,
|
|
87
|
-
// so this import keeps the process alive.
|
|
88
|
-
try {
|
|
89
|
-
await import("../../../src/proxy/main.js");
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
try {
|
|
93
|
-
await teardownCacheExtension();
|
|
94
|
-
}
|
|
95
|
-
catch (cleanupError) {
|
|
96
|
-
cliLogger.error("Failed to clean up proxy extensions after startup failure", cleanupError);
|
|
97
|
-
}
|
|
98
|
-
throw error;
|
|
99
|
-
}
|
|
100
|
-
// Keep the process alive (Deno.serve returns immediately in compiled binaries)
|
|
101
|
-
await new Promise(() => { });
|
|
79
|
+
await runStandaloneProxyRuntime({
|
|
80
|
+
bindAddress: options.bindAddress,
|
|
81
|
+
port: options.port,
|
|
82
|
+
});
|
|
102
83
|
}
|
|
103
84
|
function createDeferredProductionStartupErrorReporter() {
|
|
104
85
|
let sentryModule;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
* Standalone proxy extension composition.
|
|
3
3
|
*
|
|
4
4
|
* This CLI/deployment boundary activates provider implementations before the
|
|
5
|
-
* provider-neutral proxy runtime is imported. Core consumes
|
|
6
|
-
* `TokenCacheStore` contract published by the
|
|
5
|
+
* provider-neutral proxy runtime is imported. Core consumes the
|
|
6
|
+
* `TokenCacheStore` contract and the Redis runtime provider published by the
|
|
7
|
+
* extension loader.
|
|
7
8
|
*/
|
|
8
9
|
import { ExtensionLoader } from "../../../src/extensions/index.js";
|
|
9
10
|
import { type RegisterProxyShutdownHook } from "../../../src/proxy/shutdown-hooks.js";
|
|
10
|
-
/** Start explicit standalone
|
|
11
|
-
export declare function
|
|
11
|
+
/** Start explicit standalone proxy extension composition. */
|
|
12
|
+
export declare function activateStandaloneProxyExtensions(): Promise<ExtensionLoader | null>;
|
|
12
13
|
/** Register exactly-once provider teardown with the proxy's shutdown owner. */
|
|
13
|
-
export declare function
|
|
14
|
+
export declare function registerStandaloneProxyExtensionTeardown(loader: ExtensionLoader | null, registerHook?: RegisterProxyShutdownHook): Promise<() => Promise<void>>;
|
|
14
15
|
//# sourceMappingURL=proxy-extension-composition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-extension-composition.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/proxy-extension-composition.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"proxy-extension-composition.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/proxy-extension-composition.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAyB,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAG1F,OAAO,EAEL,KAAK,yBAAyB,EAE/B,MAAM,sCAAsC,CAAC;AAqG9C,6DAA6D;AAC7D,wBAAgB,iCAAiC,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAEnF;AA2DD,+EAA+E;AAC/E,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,YAAY,GAAE,yBAAqD,GAClE,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAI9B"}
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
* Standalone proxy extension composition.
|
|
3
3
|
*
|
|
4
4
|
* This CLI/deployment boundary activates provider implementations before the
|
|
5
|
-
* provider-neutral proxy runtime is imported. Core consumes
|
|
6
|
-
* `TokenCacheStore` contract published by the
|
|
5
|
+
* provider-neutral proxy runtime is imported. Core consumes the
|
|
6
|
+
* `TokenCacheStore` contract and the Redis runtime provider published by the
|
|
7
|
+
* extension loader.
|
|
7
8
|
*/
|
|
8
|
-
import { cliLogger } from "
|
|
9
|
+
import { cliLogger } from "../../../src/utils/logger/index.js";
|
|
9
10
|
import { ExtensionLoader } from "../../../src/extensions/index.js";
|
|
10
11
|
import { importFirstPartyExtensionModule } from "../../../src/extensions/first-party-import.js";
|
|
11
|
-
import { getEnv } from "../../../src/platform/
|
|
12
|
+
import { getEnv, setEnv } from "../../../src/platform/compat/process/env.js";
|
|
12
13
|
import { createProxyShutdownAggregateError, registerProxyShutdownHook, } from "../../../src/proxy/shutdown-hooks.js";
|
|
13
14
|
// This module is evaluated before extension activation. Pin promises created
|
|
14
15
|
// by the later teardown path so extension code cannot replace Promise species
|
|
@@ -29,29 +30,57 @@ function pinCompositionPromise(promise) {
|
|
|
29
30
|
const resolvedBeforeExtensionActivation = pinCompositionPromise(new NativePromise((resolve) => resolve()));
|
|
30
31
|
const CACHE_EXTENSION_SOURCE_DIRECTORY = "ext-cache-redis";
|
|
31
32
|
const CACHE_EXTENSION_PACKAGE_NAME = "@veryfront/ext-cache-redis";
|
|
33
|
+
const REDIS_EXTENSION_SOURCE_DIRECTORY = "ext-redis";
|
|
34
|
+
const REDIS_EXTENSION_PACKAGE_NAME = "@veryfront/ext-redis";
|
|
32
35
|
/**
|
|
33
|
-
* Activate the standalone proxy's explicitly selected cache
|
|
34
|
-
*
|
|
35
|
-
* teardown; the proxy borrows its registered `TokenCacheStore`.
|
|
36
|
+
* Activate the standalone proxy's explicitly selected cache and Redis runtime
|
|
37
|
+
* providers. The returned loader owns provider teardown.
|
|
36
38
|
*/
|
|
37
|
-
async function
|
|
39
|
+
async function activateStandaloneProxyExtensionsInternal() {
|
|
38
40
|
const cacheType = getEnv("CACHE_TYPE") || "memory";
|
|
39
|
-
if (cacheType !== "memory" && cacheType !== "extension") {
|
|
40
|
-
throw new NativeTypeError(
|
|
41
|
+
if (cacheType !== "memory" && cacheType !== "extension" && cacheType !== "redis") {
|
|
42
|
+
throw new NativeTypeError(`CACHE_TYPE must be memory, extension, or redis (received "${cacheType}")`);
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
const selected = [];
|
|
45
|
+
if (cacheType === "extension" || cacheType === "redis") {
|
|
46
|
+
selected.push({
|
|
47
|
+
origin: "standalone proxy cache selection",
|
|
48
|
+
packageName: CACHE_EXTENSION_PACKAGE_NAME,
|
|
49
|
+
sourceDirectory: CACHE_EXTENSION_SOURCE_DIRECTORY,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (getEnv("REDIS_URL")) {
|
|
53
|
+
selected.push({
|
|
54
|
+
origin: "standalone proxy routing invalidation",
|
|
55
|
+
packageName: REDIS_EXTENSION_PACKAGE_NAME,
|
|
56
|
+
sourceDirectory: REDIS_EXTENSION_SOURCE_DIRECTORY,
|
|
57
|
+
});
|
|
47
58
|
}
|
|
59
|
+
if (selected.length === 0)
|
|
60
|
+
return null;
|
|
61
|
+
const extensions = await NativePromise.all(selected.map(async (definition) => {
|
|
62
|
+
const module = await importFirstPartyExtensionModule(definition.sourceDirectory, definition.packageName);
|
|
63
|
+
if (typeof module.default !== "function") {
|
|
64
|
+
throw new NativeTypeError(`${definition.packageName} must export an ExtensionFactory`);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
extension: module.default(),
|
|
68
|
+
source: "config",
|
|
69
|
+
origin: definition.origin,
|
|
70
|
+
};
|
|
71
|
+
}));
|
|
48
72
|
const loader = new ExtensionLoader(cliLogger);
|
|
49
73
|
try {
|
|
50
|
-
await loader.setupAll(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
74
|
+
await loader.setupAll(extensions, {});
|
|
75
|
+
// Keep the chart compatible with older universal binaries during rollout.
|
|
76
|
+
// This shared boundary translates the legacy value only after the
|
|
77
|
+
// extension-backed store is registered. The downstream cache validators
|
|
78
|
+
// (src/proxy/cache/index.ts, src/proxy/cache/extension-store.ts) accept
|
|
79
|
+
// only "memory" and "extension", so this translation must complete before
|
|
80
|
+
// the proxy runtime is imported. TODO: remove this rollout shim once the
|
|
81
|
+
// hosted charts stop passing CACHE_TYPE=redis.
|
|
82
|
+
if (cacheType === "redis")
|
|
83
|
+
setEnv("CACHE_TYPE", "extension");
|
|
55
84
|
return loader;
|
|
56
85
|
}
|
|
57
86
|
catch (error) {
|
|
@@ -59,16 +88,16 @@ async function activateStandaloneProxyCacheExtensionInternal() {
|
|
|
59
88
|
await loader.teardownAll();
|
|
60
89
|
}
|
|
61
90
|
catch (cleanupError) {
|
|
62
|
-
cliLogger.error("Failed to clean up standalone proxy
|
|
91
|
+
cliLogger.error("Failed to clean up standalone proxy extensions", cleanupError);
|
|
63
92
|
}
|
|
64
93
|
throw error;
|
|
65
94
|
}
|
|
66
95
|
}
|
|
67
|
-
/** Start explicit standalone
|
|
68
|
-
export function
|
|
69
|
-
return pinCompositionPromise(
|
|
96
|
+
/** Start explicit standalone proxy extension composition. */
|
|
97
|
+
export function activateStandaloneProxyExtensions() {
|
|
98
|
+
return pinCompositionPromise(activateStandaloneProxyExtensionsInternal());
|
|
70
99
|
}
|
|
71
|
-
async function
|
|
100
|
+
async function registerStandaloneProxyExtensionTeardownInternal(loader, registerHook) {
|
|
72
101
|
if (!loader)
|
|
73
102
|
return () => resolvedBeforeExtensionActivation;
|
|
74
103
|
let teardownPromise = null;
|
|
@@ -90,7 +119,7 @@ async function registerStandaloneProxyCacheExtensionTeardownInternal(loader, reg
|
|
|
90
119
|
await teardown();
|
|
91
120
|
}
|
|
92
121
|
catch (cleanupError) {
|
|
93
|
-
throw createProxyShutdownAggregateError([error, cleanupError], "Failed to register and clean up standalone proxy
|
|
122
|
+
throw createProxyShutdownAggregateError([error, cleanupError], "Failed to register and clean up standalone proxy extension teardown");
|
|
94
123
|
}
|
|
95
124
|
throw error;
|
|
96
125
|
}
|
|
@@ -109,7 +138,7 @@ async function registerStandaloneProxyCacheExtensionTeardownInternal(loader, reg
|
|
|
109
138
|
}
|
|
110
139
|
catch (teardownError) {
|
|
111
140
|
if (disposalFailed) {
|
|
112
|
-
throw createProxyShutdownAggregateError([disposalError, teardownError], "Failed to unregister and tear down standalone proxy
|
|
141
|
+
throw createProxyShutdownAggregateError([disposalError, teardownError], "Failed to unregister and tear down standalone proxy extensions");
|
|
113
142
|
}
|
|
114
143
|
throw teardownError;
|
|
115
144
|
}
|
|
@@ -118,6 +147,6 @@ async function registerStandaloneProxyCacheExtensionTeardownInternal(loader, reg
|
|
|
118
147
|
})());
|
|
119
148
|
}
|
|
120
149
|
/** Register exactly-once provider teardown with the proxy's shutdown owner. */
|
|
121
|
-
export function
|
|
122
|
-
return pinCompositionPromise(
|
|
150
|
+
export function registerStandaloneProxyExtensionTeardown(loader, registerHook = registerProxyShutdownHook) {
|
|
151
|
+
return pinCompositionPromise(registerStandaloneProxyExtensionTeardownInternal(loader, registerHook));
|
|
123
152
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { activateStandaloneProxyExtensions, registerStandaloneProxyExtensionTeardown } from "./proxy-extension-composition.js";
|
|
2
|
+
export interface StandaloneProxyRuntimeOptions {
|
|
3
|
+
bindAddress?: string;
|
|
4
|
+
port?: number;
|
|
5
|
+
}
|
|
6
|
+
interface StandaloneProxyRuntimeDependencies {
|
|
7
|
+
activateExtensions?: typeof activateStandaloneProxyExtensions;
|
|
8
|
+
keepAlive?: () => Promise<void>;
|
|
9
|
+
loadProxy?: () => Promise<unknown>;
|
|
10
|
+
registerTeardown?: typeof registerStandaloneProxyExtensionTeardown;
|
|
11
|
+
}
|
|
12
|
+
/** Create the never-settling promise that owns the standalone process lifetime. */
|
|
13
|
+
export declare function createStandaloneProxyKeepAlivePromise(): Promise<void>;
|
|
14
|
+
/** Start the standalone proxy with the same lifecycle in CLI and dedicated binaries. */
|
|
15
|
+
export declare function runStandaloneProxyRuntime(options?: StandaloneProxyRuntimeOptions, dependencies?: StandaloneProxyRuntimeDependencies): Promise<void>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=proxy-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-runtime.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/serve/proxy-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iCAAiC,EACjC,wCAAwC,EACzC,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,6BAA6B;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,kCAAkC;IAC1C,kBAAkB,CAAC,EAAE,OAAO,iCAAiC,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,wCAAwC,CAAC;CACpE;AAMD,mFAAmF;AACnF,wBAAgB,qCAAqC,IAAI,OAAO,CAAC,IAAI,CAAC,CAErE;AAWD,wFAAwF;AACxF,wBAAsB,yBAAyB,CAC7C,OAAO,GAAE,6BAAkC,EAC3C,YAAY,GAAE,kCAAuC,GACpD,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getEnv, setEnv } from "../../../src/platform/compat/process/env.js";
|
|
2
|
+
import { cliLogger } from "../../../src/utils/logger/index.js";
|
|
3
|
+
import denoConfig from "../../../deno.js";
|
|
4
|
+
import { isJsonMode } from "../../shared/json-output.js";
|
|
5
|
+
import { bold, brand, dim } from "../../ui/colors.js";
|
|
6
|
+
import { activateStandaloneProxyExtensions, registerStandaloneProxyExtensionTeardown, } from "./proxy-extension-composition.js";
|
|
7
|
+
// Capture the constructor before extension activation so extension-owned
|
|
8
|
+
// global mutations cannot break the CLI-owned process lifetime promise.
|
|
9
|
+
const NativePromise = Promise;
|
|
10
|
+
/** Create the never-settling promise that owns the standalone process lifetime. */
|
|
11
|
+
export function createStandaloneProxyKeepAlivePromise() {
|
|
12
|
+
return new NativePromise(() => { });
|
|
13
|
+
}
|
|
14
|
+
function showProxyHeader() {
|
|
15
|
+
if (isJsonMode())
|
|
16
|
+
return;
|
|
17
|
+
const version = typeof denoConfig.version === "string" ? denoConfig.version : "0.0.0";
|
|
18
|
+
// Preserve the existing `veryfront serve --mode=proxy` output while the
|
|
19
|
+
// dedicated binary shares this runtime with the universal CLI.
|
|
20
|
+
console.log(`${bold(brand("Veryfront"))} ${dim(`(v${version})`)}`);
|
|
21
|
+
console.log();
|
|
22
|
+
}
|
|
23
|
+
/** Start the standalone proxy with the same lifecycle in CLI and dedicated binaries. */
|
|
24
|
+
export async function runStandaloneProxyRuntime(options = {}, dependencies = {}) {
|
|
25
|
+
if (options.port !== undefined)
|
|
26
|
+
setEnv("PORT", String(options.port));
|
|
27
|
+
if (options.bindAddress !== undefined)
|
|
28
|
+
setEnv("HOST", options.bindAddress);
|
|
29
|
+
const port = getEnv("PORT") || "8080";
|
|
30
|
+
const bindAddress = getEnv("HOST") || "0.0.0.0";
|
|
31
|
+
showProxyHeader();
|
|
32
|
+
cliLogger.info(`Starting proxy server on ${bindAddress}:${port}`);
|
|
33
|
+
const activateExtensions = dependencies.activateExtensions ??
|
|
34
|
+
activateStandaloneProxyExtensions;
|
|
35
|
+
const registerTeardown = dependencies.registerTeardown ??
|
|
36
|
+
registerStandaloneProxyExtensionTeardown;
|
|
37
|
+
const extensionLoader = await activateExtensions();
|
|
38
|
+
const teardownExtensions = await registerTeardown(extensionLoader);
|
|
39
|
+
try {
|
|
40
|
+
await (dependencies.loadProxy ?? (() => import("../../../src/proxy/main.js")))();
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
try {
|
|
44
|
+
await teardownExtensions();
|
|
45
|
+
}
|
|
46
|
+
catch (cleanupError) {
|
|
47
|
+
cliLogger.error("Failed to clean up proxy extensions after startup failure", cleanupError);
|
|
48
|
+
}
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
// Deno.serve returns after binding in compiled binaries, while the proxy's
|
|
52
|
+
// signal handlers own shutdown and extension teardown.
|
|
53
|
+
await (dependencies.keepAlive ?? createStandaloneProxyKeepAlivePromise)();
|
|
54
|
+
}
|
|
@@ -9,6 +9,7 @@ export interface DevServerClientOptions {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class DevServerClient {
|
|
11
11
|
private baseUrl;
|
|
12
|
+
private dashboardSession?;
|
|
12
13
|
constructor(options: DevServerClientOptions);
|
|
13
14
|
getLiveErrors(type?: string): Promise<unknown>;
|
|
14
15
|
getLiveLogs(options?: {
|
|
@@ -20,6 +21,11 @@ export declare class DevServerClient {
|
|
|
20
21
|
}): Promise<unknown>;
|
|
21
22
|
getStats(): Promise<unknown>;
|
|
22
23
|
triggerHmr(path?: string): Promise<unknown>;
|
|
24
|
+
private mutate;
|
|
23
25
|
private pull;
|
|
26
|
+
private readSuccessBody;
|
|
27
|
+
private throwForHttpError;
|
|
28
|
+
private ensureDashboardMutationSession;
|
|
29
|
+
private fetchWithRetries;
|
|
24
30
|
}
|
|
25
31
|
//# sourceMappingURL=dev-server-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server-client.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/dev-server-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"dev-server-client.d.ts","sourceRoot":"","sources":["../../../src/cli/mcp/dev-server-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2DH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,gBAAgB,CAAC,CAA8C;gBAE3D,OAAO,EAAE,sBAAsB;IAI3C,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK9C,WAAW,CAAC,OAAO,CAAC,EAAE;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,OAAO,CAAC;IAapB,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC;IAI5B,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;YAI7B,MAAM;YAmCN,IAAI;YAMJ,eAAe;YAWf,iBAAiB;YAcjB,8BAA8B;YAqB9B,gBAAgB;CAoB/B"}
|
|
@@ -5,10 +5,56 @@
|
|
|
5
5
|
* LogBuffer, and HMR data over HTTP from the user's running `veryfront` process.
|
|
6
6
|
*/
|
|
7
7
|
import { REQUEST_TIMEOUT_MS } from "../shared/constants.js";
|
|
8
|
+
import { DASHBOARD_CSRF_HEADER_NAME, DASHBOARD_SESSION_PATH, } from "../../src/extensions/dev-ui/protocol.js";
|
|
8
9
|
const MAX_RETRIES = 2;
|
|
9
10
|
const RETRY_DELAYS_MS = [200, 500];
|
|
11
|
+
const MAX_ERROR_BODY_BYTES = 2_048;
|
|
12
|
+
const MAX_ERROR_DETAIL_CHARS = 512;
|
|
13
|
+
async function readErrorBodyPrefix(response, maxBytes) {
|
|
14
|
+
const body = response.body;
|
|
15
|
+
if (!body)
|
|
16
|
+
return { text: "", truncated: false };
|
|
17
|
+
const reader = body.getReader();
|
|
18
|
+
const decoder = new TextDecoder();
|
|
19
|
+
let remaining = maxBytes;
|
|
20
|
+
let text = "";
|
|
21
|
+
let completed = false;
|
|
22
|
+
let truncated = false;
|
|
23
|
+
try {
|
|
24
|
+
while (remaining > 0) {
|
|
25
|
+
const { done, value } = await reader.read();
|
|
26
|
+
if (done) {
|
|
27
|
+
completed = true;
|
|
28
|
+
text += decoder.decode();
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
const selected = value.byteLength <= remaining ? value : value.subarray(0, remaining);
|
|
32
|
+
text += decoder.decode(selected, { stream: true });
|
|
33
|
+
remaining -= selected.byteLength;
|
|
34
|
+
if (selected.byteLength < value.byteLength) {
|
|
35
|
+
truncated = true;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (!completed && remaining === 0)
|
|
40
|
+
truncated = true;
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
if (!completed) {
|
|
44
|
+
try {
|
|
45
|
+
void reader.cancel().catch(() => { });
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// Response-stream cancellation is best-effort cleanup.
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
reader.releaseLock();
|
|
52
|
+
}
|
|
53
|
+
return { text, truncated };
|
|
54
|
+
}
|
|
10
55
|
export class DevServerClient {
|
|
11
56
|
baseUrl;
|
|
57
|
+
dashboardSession;
|
|
12
58
|
constructor(options) {
|
|
13
59
|
this.baseUrl = `http://localhost:${options.port}`;
|
|
14
60
|
}
|
|
@@ -35,21 +81,87 @@ export class DevServerClient {
|
|
|
35
81
|
return this.pull("/_dev/api/stats");
|
|
36
82
|
}
|
|
37
83
|
triggerHmr(path) {
|
|
38
|
-
return this.
|
|
84
|
+
return this.mutate("/_dev/api/hmr-trigger", JSON.stringify(path ? { path } : {}));
|
|
85
|
+
}
|
|
86
|
+
async mutate(path, body) {
|
|
87
|
+
const buildInit = (session) => ({
|
|
39
88
|
method: "POST",
|
|
40
|
-
headers: {
|
|
41
|
-
|
|
89
|
+
headers: {
|
|
90
|
+
"Content-Type": "application/json",
|
|
91
|
+
"Cookie": session.cookieHeader,
|
|
92
|
+
[DASHBOARD_CSRF_HEADER_NAME]: session.csrfToken,
|
|
93
|
+
},
|
|
94
|
+
body,
|
|
42
95
|
});
|
|
96
|
+
const session = await this.ensureDashboardMutationSession();
|
|
97
|
+
let response = await this.fetchWithRetries(path, buildInit(session));
|
|
98
|
+
// The server's dashboard session token lives for its process lifetime, so
|
|
99
|
+
// a dev-server restart while this MCP process stays up invalidates the
|
|
100
|
+
// cached credential and yields HTTP 403. Discard the stale session,
|
|
101
|
+
// re-bootstrap once, and retry the mutation exactly once.
|
|
102
|
+
if (response.status === 403) {
|
|
103
|
+
try {
|
|
104
|
+
await response.body?.cancel();
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
// Response-stream cancellation is best-effort cleanup.
|
|
108
|
+
}
|
|
109
|
+
this.dashboardSession = undefined;
|
|
110
|
+
const freshSession = await this.ensureDashboardMutationSession();
|
|
111
|
+
response = await this.fetchWithRetries(path, buildInit(freshSession));
|
|
112
|
+
}
|
|
113
|
+
await this.throwForHttpError(path, response);
|
|
114
|
+
return await this.readSuccessBody(response);
|
|
43
115
|
}
|
|
44
116
|
async pull(path, init) {
|
|
117
|
+
const response = await this.fetchWithRetries(path, init);
|
|
118
|
+
await this.throwForHttpError(path, response);
|
|
119
|
+
return await this.readSuccessBody(response);
|
|
120
|
+
}
|
|
121
|
+
async readSuccessBody(response) {
|
|
122
|
+
const mediaType = response.headers.get("content-type")
|
|
123
|
+
?.split(";", 1)[0]
|
|
124
|
+
?.trim()
|
|
125
|
+
.toLowerCase();
|
|
126
|
+
if (mediaType === "application/json" || mediaType?.endsWith("+json")) {
|
|
127
|
+
return await response.json();
|
|
128
|
+
}
|
|
129
|
+
return await response.text();
|
|
130
|
+
}
|
|
131
|
+
async throwForHttpError(path, response) {
|
|
132
|
+
if (response.ok)
|
|
133
|
+
return;
|
|
134
|
+
const { text, truncated } = await readErrorBodyPrefix(response, MAX_ERROR_BODY_BYTES);
|
|
135
|
+
const normalized = text.replace(/\s+/g, " ").trim();
|
|
136
|
+
const detail = normalized.slice(0, MAX_ERROR_DETAIL_CHARS);
|
|
137
|
+
const suffix = truncated || normalized.length > MAX_ERROR_DETAIL_CHARS ? "…" : "";
|
|
138
|
+
throw new Error(`Dev server request ${path} failed with HTTP ${response.status}${detail ? `: ${detail}${suffix}` : ""}`);
|
|
139
|
+
}
|
|
140
|
+
async ensureDashboardMutationSession() {
|
|
141
|
+
if (this.dashboardSession)
|
|
142
|
+
return this.dashboardSession;
|
|
143
|
+
const response = await this.fetchWithRetries(DASHBOARD_SESSION_PATH, { method: "GET" });
|
|
144
|
+
await this.throwForHttpError(DASHBOARD_SESSION_PATH, response);
|
|
145
|
+
const setCookie = response.headers.get("set-cookie");
|
|
146
|
+
const cookiePair = setCookie?.split(";", 1)[0]?.trim();
|
|
147
|
+
const separator = cookiePair?.indexOf("=") ?? -1;
|
|
148
|
+
if (!cookiePair || separator <= 0) {
|
|
149
|
+
throw new Error("Dev server did not issue a dashboard session");
|
|
150
|
+
}
|
|
151
|
+
this.dashboardSession = {
|
|
152
|
+
cookieHeader: cookiePair,
|
|
153
|
+
csrfToken: cookiePair.slice(separator + 1),
|
|
154
|
+
};
|
|
155
|
+
return this.dashboardSession;
|
|
156
|
+
}
|
|
157
|
+
async fetchWithRetries(path, init) {
|
|
45
158
|
let lastError;
|
|
46
159
|
for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
|
|
47
160
|
try {
|
|
48
|
-
|
|
161
|
+
return await fetch(`${this.baseUrl}${path}`, {
|
|
49
162
|
...init,
|
|
50
163
|
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
51
164
|
});
|
|
52
|
-
return await response.json();
|
|
53
165
|
}
|
|
54
166
|
catch (error) {
|
|
55
167
|
lastError = error;
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { InferSchema } from "../../src/extensions/schema/index.js";
|
|
8
8
|
import { type EnvironmentConfig } from "../../src/config/index.js";
|
|
9
|
+
/**
|
|
10
|
+
* Classify failures from an idempotent API read conservatively.
|
|
11
|
+
*
|
|
12
|
+
* A structured HTTP status is authoritative: authentication, validation, and
|
|
13
|
+
* other client failures must not become retryable merely because an attached
|
|
14
|
+
* cause resembles a connection error.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isRetryableApiReadError(error: unknown): boolean;
|
|
9
17
|
export declare const getVeryfrontConfigSchema: () => import("../../src/internal-agents/schema.js").Schema<import("../../src/extensions/schema/schema-validator.js").InferShape<{
|
|
10
18
|
projectSlug: import("../../src/internal-agents/schema.js").Schema<string | undefined>;
|
|
11
19
|
/** List of project slugs for multi-project pull */
|
|
@@ -79,8 +87,14 @@ export declare const resolveConfig: (projectDir?: string, env?: EnvironmentConfi
|
|
|
79
87
|
*/
|
|
80
88
|
export declare const resolveConfigWithAuth: (projectDir?: string, env?: EnvironmentConfig) => Promise<ResolvedConfig>;
|
|
81
89
|
export declare function resolveConfigWithAuthDetails(projectDir?: string, env?: EnvironmentConfig): Promise<ResolvedConfigDetails>;
|
|
90
|
+
export interface ApiReadOptions {
|
|
91
|
+
/** Abort the in-flight HTTP request when this signal fires. */
|
|
92
|
+
signal?: AbortSignal;
|
|
93
|
+
/** Use `none` when a higher-level polling loop owns retry timing. */
|
|
94
|
+
retryPolicy?: "default" | "none";
|
|
95
|
+
}
|
|
82
96
|
export interface ApiClient {
|
|
83
|
-
get<T>(path: string, params?: Record<string, string
|
|
97
|
+
get<T>(path: string, params?: Record<string, string>, options?: ApiReadOptions): Promise<T>;
|
|
84
98
|
post<T>(path: string, body?: unknown): Promise<T>;
|
|
85
99
|
put<T>(path: string, body?: unknown): Promise<T>;
|
|
86
100
|
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,2BAA2B,CAAC;AAkBzF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK/D;AAQD,eAAO,MAAM,wBAAwB;;IAGjC,mDAAmD;;;;GAKtD,CAAC;AACF,eAAO,MAAM,qBAAqB;;IAN9B,mDAAmD;;;;GAMkB,CAAC;AAC1E,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC;AAEvF,eAAO,MAAM,uBAAuB;;;;;;GAQnC,CAAC;AACF,eAAO,MAAM,oBAAoB;;;;;;GAAsC,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC;AAUrF,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,2BAA2B,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,yBAAyB,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,CAAC;AAEhD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,cAAc,CAAC;IACvB,sBAAsB,EAAE,sBAAsB,CAAC;CAChD;AAED,eAAO,MAAM,mCAAmC,yGAKtC,CAAC;AAEX,MAAM,MAAM,+BAA+B,GAAG,OAAO,mCAAmC,CAAC,MAAM,CAAC,CAAC;AAsDjG,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAExF;AAED,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAatF;AAyBD,wBAAgB,kCAAkC,IAC9C;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,+BAA+B,CAAA;CAAE,GAC5D,SAAS,CAMZ;AAgID,eAAO,MAAM,aAAa,gBAJG,MAAM,QAAQ,iBAAiB,KAAG,OAAO,CAAC,cAAc,CAI7B,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,gBAZL,MAAM,QAAQ,iBAAiB,KAAG,OAAO,CAAC,cAAc,CAYtB,CAAC;AAEhE,wBAAgB,4BAA4B,CAC1C,UAAU,CAAC,EAAE,MAAM,EACnB,GAAG,CAAC,EAAE,iBAAiB,GACtB,OAAO,CAAC,qBAAqB,CAAC,CAEhC;AAUD,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,qEAAqE;IACrE,WAAW,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,CAAC,EACH,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAAC;IACd,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAClD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACjD,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACnD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACrC;AAED,eAAO,MAAM,iBAAiB;;;;;;;;GAU7B,CAAC;AACF,eAAO,MAAM,cAAc;;;;;;;;GAAgC,CAAC;AAC5D,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC;AAEzE,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGvE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,CAyHjE"}
|
package/esm/cli/shared/config.js
CHANGED
|
@@ -22,6 +22,19 @@ const API_MAX_RETRIES = 3;
|
|
|
22
22
|
function isTransientStatus(status) {
|
|
23
23
|
return status === 502 || status === 503 || status === 504;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Classify failures from an idempotent API read conservatively.
|
|
27
|
+
*
|
|
28
|
+
* A structured HTTP status is authoritative: authentication, validation, and
|
|
29
|
+
* other client failures must not become retryable merely because an attached
|
|
30
|
+
* cause resembles a connection error.
|
|
31
|
+
*/
|
|
32
|
+
export function isRetryableApiReadError(error) {
|
|
33
|
+
const status = typeof error === "object" && error !== null
|
|
34
|
+
? error.status
|
|
35
|
+
: undefined;
|
|
36
|
+
return typeof status === "number" ? isTransientStatus(status) : isRetryableConnectionError(error);
|
|
37
|
+
}
|
|
25
38
|
/** Sleep for `ms` milliseconds plus a random jitter up to 20% of `ms`. */
|
|
26
39
|
function sleepWithJitter(ms) {
|
|
27
40
|
const jitter = Math.floor(ms * 0.2 * Math.random());
|
|
@@ -282,9 +295,10 @@ export function createApiClient(config) {
|
|
|
282
295
|
return message;
|
|
283
296
|
return `${message}. VERYFRONT_API_TOKEN was loaded from a project .env file. For management commands, run 'veryfront login' and remove or rename the project runtime token, or pass a management token explicitly in the shell.`;
|
|
284
297
|
}
|
|
285
|
-
async function requestOnce(method, url, body) {
|
|
298
|
+
async function requestOnce(method, url, body, signal) {
|
|
286
299
|
const response = await fetch(url, {
|
|
287
300
|
method,
|
|
301
|
+
...(signal ? { signal } : {}),
|
|
288
302
|
headers: {
|
|
289
303
|
Authorization: `Bearer ${apiToken}`,
|
|
290
304
|
"Content-Type": "application/json",
|
|
@@ -317,30 +331,25 @@ export function createApiClient(config) {
|
|
|
317
331
|
function isIdempotent(method) {
|
|
318
332
|
return method === "GET" || method === "HEAD" || method === "PUT";
|
|
319
333
|
}
|
|
320
|
-
async function request(method, path, body, params) {
|
|
334
|
+
async function request(method, path, body, params, options = {}) {
|
|
321
335
|
const url = new URL(`${apiUrl}${path}`);
|
|
322
336
|
for (const [key, value] of Object.entries(params ?? {})) {
|
|
323
337
|
url.searchParams.set(key, value);
|
|
324
338
|
}
|
|
325
339
|
const urlStr = url.toString();
|
|
326
340
|
let lastError;
|
|
327
|
-
|
|
341
|
+
const maxAttempts = options.retryPolicy === "none" ? 1 : API_MAX_RETRIES;
|
|
342
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
328
343
|
try {
|
|
329
|
-
return await requestOnce(method, urlStr, body);
|
|
344
|
+
return await requestOnce(method, urlStr, body, options.signal);
|
|
330
345
|
}
|
|
331
346
|
catch (error) {
|
|
332
347
|
lastError = error;
|
|
333
|
-
const status = error.status;
|
|
334
|
-
const isTransient = status !== undefined
|
|
335
|
-
? isTransientStatus(status)
|
|
336
|
-
: isRetryableConnectionError(error);
|
|
337
348
|
const isRefused = isConnectionRefusedError(error);
|
|
338
|
-
// Idempotent: retry on transient HTTP status or
|
|
349
|
+
// Idempotent: retry on transient HTTP status or status-less retryable connection errors.
|
|
339
350
|
// Non-idempotent: retry only on connection-refused (request never reached server).
|
|
340
|
-
const shouldRetry = isIdempotent(method)
|
|
341
|
-
|
|
342
|
-
: isRefused;
|
|
343
|
-
if (!shouldRetry || attempt >= API_MAX_RETRIES - 1) {
|
|
351
|
+
const shouldRetry = isIdempotent(method) ? isRetryableApiReadError(error) : isRefused;
|
|
352
|
+
if (!shouldRetry || attempt >= maxAttempts - 1) {
|
|
344
353
|
throw error;
|
|
345
354
|
}
|
|
346
355
|
await sleepWithJitter(API_RETRY_DELAYS_MS[attempt]);
|
|
@@ -350,8 +359,8 @@ export function createApiClient(config) {
|
|
|
350
359
|
throw lastError;
|
|
351
360
|
}
|
|
352
361
|
return {
|
|
353
|
-
get(path, params) {
|
|
354
|
-
return request("GET", path, undefined, params);
|
|
362
|
+
get(path, params, options) {
|
|
363
|
+
return request("GET", path, undefined, params, options);
|
|
355
364
|
},
|
|
356
365
|
post(path, body) {
|
|
357
366
|
return request("POST", path, body);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ApiClient, ResolvedConfig } from "../config.js";
|
|
2
|
-
import type { ReleaseAssetManifestResponse } from "../../../src/release-assets/index.js";
|
|
3
2
|
export interface DeployProjectRecord {
|
|
4
3
|
id: string;
|
|
5
4
|
slug: string;
|
|
@@ -43,6 +42,10 @@ export interface DeployReleaseFile {
|
|
|
43
42
|
path: string;
|
|
44
43
|
content: string;
|
|
45
44
|
}
|
|
45
|
+
export type DeployReleaseAssetManifestBody = object | string | number | boolean;
|
|
46
|
+
export interface DeployReleaseAssetManifestReadOptions {
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
}
|
|
46
49
|
export interface DeployControlPlane {
|
|
47
50
|
readonly controlPlane: string;
|
|
48
51
|
getProject(reference: string): Promise<DeployProjectRecord>;
|
|
@@ -53,7 +56,11 @@ export interface DeployControlPlane {
|
|
|
53
56
|
}): Promise<DeployRelease>;
|
|
54
57
|
getRelease(reference: string, releaseId: string): Promise<DeployRelease>;
|
|
55
58
|
listReleaseFiles(reference: string, releaseId: string): AsyncIterable<DeployReleaseFile>;
|
|
56
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Performs one manifest read and returns null only while it does not exist.
|
|
61
|
+
* The caller owns polling and retry timing.
|
|
62
|
+
*/
|
|
63
|
+
getReleaseAssetManifest(projectSlug: string, releaseId: string, options?: DeployReleaseAssetManifestReadOptions): Promise<DeployReleaseAssetManifestBody | null>;
|
|
57
64
|
createDeployment(reference: string, input: {
|
|
58
65
|
releaseId: string;
|
|
59
66
|
environmentId: string;
|