veryfront 0.1.48 → 0.1.49
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/app/components/inline-input.d.ts +1 -4
- package/esm/cli/app/components/inline-input.d.ts.map +1 -1
- package/esm/cli/app/components/inline-input.js +1 -1
- package/esm/cli/app/components/list-select.d.ts +0 -8
- package/esm/cli/app/components/list-select.d.ts.map +1 -1
- package/esm/cli/app/components/list-select.js +0 -13
- package/esm/cli/app/operations/project-creation.d.ts +2 -14
- package/esm/cli/app/operations/project-creation.d.ts.map +1 -1
- package/esm/cli/app/operations/project-creation.js +3 -68
- package/esm/cli/app/shell.js +1 -1
- package/esm/cli/app/utils.d.ts +1 -2
- package/esm/cli/app/utils.d.ts.map +1 -1
- package/esm/cli/app/utils.js +1 -17
- package/esm/cli/app/views/dashboard.d.ts +0 -4
- package/esm/cli/app/views/dashboard.d.ts.map +1 -1
- package/esm/cli/app/views/dashboard.js +0 -15
- package/esm/cli/app/views/startup.d.ts +0 -4
- package/esm/cli/app/views/startup.d.ts.map +1 -1
- package/esm/cli/app/views/startup.js +0 -7
- package/esm/cli/auth/login.d.ts.map +1 -1
- package/esm/cli/auth/login.js +1 -2
- package/esm/cli/auth/token-store.js +1 -1
- package/esm/cli/auth/utils.d.ts +2 -1
- package/esm/cli/auth/utils.d.ts.map +1 -1
- package/esm/cli/commands/generate/integration-generator.js +1 -1
- package/esm/cli/commands/install/types.d.ts +2 -2
- package/esm/cli/help/formatters.d.ts +1 -1
- package/esm/cli/help/formatters.d.ts.map +1 -1
- package/esm/cli/help/formatters.js +8 -4
- package/esm/cli/help/main-help.d.ts.map +1 -1
- package/esm/cli/help/main-help.js +2 -2
- package/esm/cli/mcp/server.d.ts +0 -1
- package/esm/cli/mcp/server.d.ts.map +1 -1
- package/esm/cli/mcp/server.js +2 -5
- package/esm/cli/mcp/tools/dev-tools.d.ts +1 -1
- package/esm/cli/mcp/tools/dev-tools.d.ts.map +1 -1
- package/esm/cli/mcp/tools/dev-tools.js +1 -2
- package/esm/cli/mcp/tools/scaffold-tools.d.ts +2 -2
- package/esm/cli/mcp/tools.d.ts +1 -2
- package/esm/cli/mcp/tools.d.ts.map +1 -1
- package/esm/cli/mcp/tools.js +1 -2
- package/esm/cli/shared/reserve-slug.d.ts.map +1 -1
- package/esm/cli/shared/reserve-slug.js +1 -3
- package/esm/cli/sync/ignore.d.ts +1 -1
- package/esm/cli/sync/ignore.d.ts.map +1 -1
- package/esm/cli/sync/ignore.js +22 -18
- package/esm/cli/ui/colors.d.ts +0 -1
- package/esm/cli/ui/colors.d.ts.map +1 -1
- package/esm/cli/ui/colors.js +0 -10
- package/esm/cli/ui/dot-matrix.d.ts.map +1 -1
- package/esm/cli/ui/dot-matrix.js +2 -5
- package/esm/cli/ui/tui.js +2 -3
- package/esm/cli/utils/index.js +1 -2
- package/esm/cli/utils/package-manager.d.ts.map +1 -1
- package/esm/cli/utils/package-manager.js +3 -4
- package/esm/deno.d.ts +3 -0
- package/esm/deno.js +22 -19
- package/esm/src/agent/chat-handler.d.ts.map +1 -1
- package/esm/src/agent/chat-handler.js +8 -23
- package/esm/src/agent/factory.d.ts +0 -8
- package/esm/src/agent/factory.d.ts.map +1 -1
- package/esm/src/agent/factory.js +50 -1
- package/esm/src/agent/index.d.ts +16 -1
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +16 -1
- package/esm/src/agent/memory/memory.d.ts +2 -2
- package/esm/src/agent/memory/memory.d.ts.map +1 -1
- package/esm/src/agent/memory/memory.js +0 -1
- package/esm/src/agent/react/use-chat/types.d.ts +2 -0
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +15 -9
- package/esm/src/agent/runtime/index.d.ts +18 -0
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +167 -36
- package/esm/src/agent/runtime/tool-helpers.d.ts +6 -1
- package/esm/src/agent/runtime/tool-helpers.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-helpers.js +10 -1
- package/esm/src/agent/schemas/agent.schema.d.ts +4 -4
- package/esm/src/agent/types.d.ts +10 -0
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/ai/registry-manager.d.ts.map +1 -1
- package/esm/src/ai/registry-manager.js +2 -1
- package/esm/src/build/bundler/code-splitter/manifest-builder.d.ts +0 -2
- package/esm/src/build/bundler/code-splitter/manifest-builder.d.ts.map +1 -1
- package/esm/src/build/bundler/code-splitter/manifest-builder.js +1 -1
- package/esm/src/build/compiler/mdx-compiler/validator.d.ts.map +1 -1
- package/esm/src/build/compiler/mdx-compiler/validator.js +2 -3
- package/esm/src/build/compiler/mdx-to-js.d.ts +0 -2
- package/esm/src/build/compiler/mdx-to-js.d.ts.map +1 -1
- package/esm/src/build/compiler/mdx-to-js.js +0 -81
- package/esm/src/build/index.d.ts +0 -6
- package/esm/src/build/index.d.ts.map +1 -1
- package/esm/src/build/index.js +0 -1
- package/esm/src/build/production-build/build/route-collector.d.ts.map +1 -1
- package/esm/src/build/production-build/build/route-collector.js +2 -3
- package/esm/src/build/production-build/templates.d.ts +5 -9
- package/esm/src/build/production-build/templates.d.ts.map +1 -1
- package/esm/src/build/production-build/templates.js +6 -18
- package/esm/src/build/vendor-cache.d.ts.map +1 -1
- package/esm/src/build/vendor-cache.js +0 -5
- package/esm/src/cache/tokenizing-gateway.d.ts +0 -2
- package/esm/src/cache/tokenizing-gateway.d.ts.map +1 -1
- package/esm/src/cache/tokenizing-gateway.js +1 -3
- package/esm/src/chat/index.d.ts +2 -2
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +1 -1
- package/esm/src/config/define-config.d.ts.map +1 -1
- package/esm/src/config/define-config.js +28 -25
- package/esm/src/config/loader.d.ts.map +1 -1
- package/esm/src/config/loader.js +10 -7
- package/esm/src/config/schemas/config.schema.d.ts +58 -12
- package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
- package/esm/src/config/schemas/config.schema.js +12 -0
- package/esm/src/data/data-fetcher.d.ts +1 -2
- package/esm/src/data/data-fetcher.d.ts.map +1 -1
- package/esm/src/data/data-fetcher.js +14 -15
- package/esm/src/data/server-data-fetcher.d.ts +0 -3
- package/esm/src/data/server-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/server-data-fetcher.js +1 -8
- package/esm/src/data/static-data-fetcher.d.ts +1 -3
- package/esm/src/data/static-data-fetcher.d.ts.map +1 -1
- package/esm/src/data/static-data-fetcher.js +1 -3
- package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
- package/esm/src/discovery/discovery-engine.js +19 -1
- package/esm/src/discovery/discovery-utils.d.ts +0 -4
- package/esm/src/discovery/discovery-utils.d.ts.map +1 -1
- package/esm/src/discovery/discovery-utils.js +0 -6
- package/esm/src/discovery/file-discovery.d.ts +3 -1
- package/esm/src/discovery/file-discovery.d.ts.map +1 -1
- package/esm/src/discovery/file-discovery.js +3 -8
- package/esm/src/discovery/handlers/index.d.ts +1 -0
- package/esm/src/discovery/handlers/index.d.ts.map +1 -1
- package/esm/src/discovery/handlers/index.js +1 -0
- package/esm/src/discovery/handlers/skill-handler.d.ts +26 -0
- package/esm/src/discovery/handlers/skill-handler.d.ts.map +1 -0
- package/esm/src/discovery/handlers/skill-handler.js +87 -0
- package/esm/src/discovery/handlers/task-handler.d.ts.map +1 -1
- package/esm/src/discovery/handlers/task-handler.js +1 -5
- package/esm/src/discovery/transpiler.d.ts.map +1 -1
- package/esm/src/discovery/transpiler.js +7 -4
- package/esm/src/discovery/types.d.ts +3 -0
- package/esm/src/discovery/types.d.ts.map +1 -1
- package/esm/src/embedding/resolve.d.ts.map +1 -1
- package/esm/src/embedding/resolve.js +1 -3
- package/esm/src/embedding/upload-handler.d.ts.map +1 -1
- package/esm/src/embedding/upload-handler.js +4 -3
- package/esm/src/embedding/upload-store.js +4 -4
- package/esm/src/errors/error-registry.d.ts +2 -1
- package/esm/src/errors/error-registry.d.ts.map +1 -1
- package/esm/src/errors/http-error.d.ts +1 -2
- package/esm/src/errors/http-error.d.ts.map +1 -1
- package/esm/src/errors/http-error.js +2 -2
- package/esm/src/errors/middleware/cli-error-boundary.d.ts.map +1 -1
- package/esm/src/errors/middleware/cli-error-boundary.js +13 -2
- package/esm/src/errors/middleware/wrap-unknown.d.ts +0 -7
- package/esm/src/errors/middleware/wrap-unknown.d.ts.map +1 -1
- package/esm/src/errors/middleware/wrap-unknown.js +0 -9
- package/esm/src/errors/veryfront-error.d.ts +0 -3
- package/esm/src/errors/veryfront-error.d.ts.map +1 -1
- package/esm/src/errors/veryfront-error.js +0 -5
- package/esm/src/html/schemas/html.schema.d.ts +2 -2
- package/esm/src/html/styles-builder/css-hash-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/css-hash-cache.js +1 -2
- package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
- package/esm/src/html/styles-builder/plugin-loader.js +50 -21
- package/esm/src/html/styles-builder/tailwind-compiler-cache.d.ts.map +1 -1
- package/esm/src/html/styles-builder/tailwind-compiler-cache.js +12 -4
- package/esm/src/html/utils.d.ts +0 -7
- package/esm/src/html/utils.d.ts.map +1 -1
- package/esm/src/html/utils.js +0 -25
- package/esm/src/modules/component-registry/registry.d.ts +0 -3
- package/esm/src/modules/component-registry/registry.d.ts.map +1 -1
- package/esm/src/modules/component-registry/registry.js +0 -3
- package/esm/src/oauth/handlers/callback-handler.d.ts +2 -0
- package/esm/src/oauth/handlers/callback-handler.d.ts.map +1 -1
- package/esm/src/oauth/handlers/callback-handler.js +10 -4
- package/esm/src/oauth/providers/common.d.ts.map +1 -1
- package/esm/src/oauth/providers/common.js +0 -23
- package/esm/src/observability/auto-instrument/react-instrumentation.js +2 -1
- package/esm/src/observability/instruments/instruments-factory.d.ts +1 -1
- package/esm/src/observability/instruments/instruments-factory.d.ts.map +1 -1
- package/esm/src/observability/instruments/instruments-factory.js +5 -4
- package/esm/src/observability/metrics/config.js +5 -4
- package/esm/src/observability/metrics/manager.js +1 -1
- package/esm/src/observability/tracing/span-operations.d.ts.map +1 -1
- package/esm/src/observability/tracing/span-operations.js +14 -8
- package/esm/src/platform/compat/console/node.d.ts +0 -1
- package/esm/src/platform/compat/console/node.d.ts.map +1 -1
- package/esm/src/platform/compat/console/node.js +4 -11
- package/esm/src/platform/compat/fs.d.ts.map +1 -1
- package/esm/src/platform/compat/fs.js +4 -2
- package/esm/src/platform/compat/opaque-deps.d.ts +4 -2
- package/esm/src/platform/compat/opaque-deps.d.ts.map +1 -1
- package/esm/src/platform/compat/opaque-deps.js +1 -1
- package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -1
- package/esm/src/platform/compat/path/basic-operations.js +8 -7
- package/esm/src/platform/compat/path/resolution.d.ts.map +1 -1
- package/esm/src/platform/compat/path/resolution.js +15 -10
- package/esm/src/platform/compat/path/url-conversion.d.ts.map +1 -1
- package/esm/src/platform/compat/path/url-conversion.js +3 -2
- package/esm/src/platform/compat/process.d.ts +2 -14
- package/esm/src/platform/compat/process.d.ts.map +1 -1
- package/esm/src/platform/compat/process.js +92 -70
- package/esm/src/provider/index.d.ts +1 -1
- package/esm/src/provider/index.d.ts.map +1 -1
- package/esm/src/provider/index.js +1 -1
- package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +1 -1
- package/esm/src/provider/local/ai-sdk-adapter.js +18 -18
- package/esm/src/provider/local/env.d.ts.map +1 -1
- package/esm/src/provider/local/env.js +2 -1
- package/esm/src/provider/model-registry.d.ts +10 -0
- package/esm/src/provider/model-registry.d.ts.map +1 -1
- package/esm/src/provider/model-registry.js +43 -0
- package/esm/src/proxy/retry.d.ts +3 -3
- package/esm/src/proxy/retry.d.ts.map +1 -1
- package/esm/src/proxy/retry.js +0 -7
- package/esm/src/proxy/tracing.d.ts +1 -5
- package/esm/src/proxy/tracing.d.ts.map +1 -1
- package/esm/src/proxy/tracing.js +1 -7
- package/esm/src/react/components/ai/chat/components/code-block.js +1 -1
- package/esm/src/react/components/ai/chat/components/skill-badge.d.ts +12 -0
- package/esm/src/react/components/ai/chat/components/skill-badge.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/skill-badge.js +34 -0
- package/esm/src/react/components/ai/chat/components/step-indicator.js +4 -4
- package/esm/src/react/components/ai/chat/composition/chat-message-list.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/composition/chat-message-list.js +8 -2
- package/esm/src/react/components/ai/chat/composition/message.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/composition/message.js +8 -2
- package/esm/src/react/components/ai/chat/index.d.ts +4 -1
- package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/index.js +4 -3
- package/esm/src/react/components/ai/chat/utils/message-parts.d.ts +2 -0
- package/esm/src/react/components/ai/chat/utils/message-parts.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/utils/message-parts.js +9 -0
- package/esm/src/react/components/ai/chat-with-sidebar.d.ts +1 -0
- package/esm/src/react/components/ai/chat-with-sidebar.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat-with-sidebar.js +1 -0
- package/esm/src/react/components/ai/chat.d.ts +1 -1
- package/esm/src/react/components/ai/chat.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat.js +1 -1
- package/esm/src/rendering/cache/index.d.ts +1 -5
- package/esm/src/rendering/cache/index.d.ts.map +1 -1
- package/esm/src/rendering/cache/index.js +1 -5
- package/esm/src/rendering/orchestrator/pipeline.d.ts +11 -2
- package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
- package/esm/src/rendering/shared/context-aware-cache.js +0 -4
- package/esm/src/repositories/schemas/index.d.ts +1 -1
- package/esm/src/repositories/schemas/index.d.ts.map +1 -1
- package/esm/src/repositories/schemas/index.js +1 -1
- package/esm/src/repositories/schemas/repository.schema.d.ts +0 -11
- package/esm/src/repositories/schemas/repository.schema.d.ts.map +1 -1
- package/esm/src/repositories/schemas/repository.schema.js +0 -13
- package/esm/src/repositories/types.d.ts +1 -1
- package/esm/src/repositories/types.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/loader.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/loader.js +63 -7
- package/esm/src/routing/api/openapi/path-utils.d.ts +0 -19
- package/esm/src/routing/api/openapi/path-utils.d.ts.map +1 -1
- package/esm/src/routing/api/openapi/path-utils.js +0 -34
- package/esm/src/routing/api/openapi/spec-generator.d.ts.map +1 -1
- package/esm/src/routing/api/openapi/spec-generator.js +1 -19
- package/esm/src/routing/api/openapi/types.d.ts +1 -0
- package/esm/src/routing/api/openapi/types.d.ts.map +1 -1
- package/esm/src/routing/api/openapi/types.js +18 -0
- package/esm/src/sandbox/sandbox.d.ts +1 -0
- package/esm/src/sandbox/sandbox.d.ts.map +1 -1
- package/esm/src/sandbox/sandbox.js +7 -8
- package/esm/src/security/http/cors/constants.d.ts +0 -2
- package/esm/src/security/http/cors/constants.d.ts.map +1 -1
- package/esm/src/security/http/cors/constants.js +0 -2
- package/esm/src/security/http/response/index.d.ts +3 -4
- package/esm/src/security/http/response/index.d.ts.map +1 -1
- package/esm/src/security/http/response/index.js +2 -3
- package/esm/src/server/context/enriched-context.d.ts +0 -8
- package/esm/src/server/context/enriched-context.d.ts.map +1 -1
- package/esm/src/server/context/enriched-context.js +1 -12
- package/esm/src/server/dev-server/server.d.ts.map +1 -1
- package/esm/src/server/dev-server/server.js +11 -4
- package/esm/src/server/dev-ui/manifest.d.ts +20 -20
- package/esm/src/server/dev-ui/manifest.js +20 -20
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +426 -179
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +14 -24
- package/esm/src/server/shared/renderer/memory/pressure.d.ts +0 -7
- package/esm/src/server/shared/renderer/memory/pressure.d.ts.map +1 -1
- package/esm/src/server/shared/renderer/memory/pressure.js +1 -13
- package/esm/src/server/utils/domain-lookup.d.ts +0 -4
- package/esm/src/server/utils/domain-lookup.d.ts.map +1 -1
- package/esm/src/server/utils/domain-lookup.js +0 -3
- package/esm/src/skill/allowed-tools.d.ts +54 -0
- package/esm/src/skill/allowed-tools.d.ts.map +1 -0
- package/esm/src/skill/allowed-tools.js +87 -0
- package/esm/src/skill/executor.d.ts +28 -0
- package/esm/src/skill/executor.d.ts.map +1 -0
- package/esm/src/skill/executor.js +187 -0
- package/esm/src/skill/index.d.ts +19 -0
- package/esm/src/skill/index.d.ts.map +1 -0
- package/esm/src/skill/index.js +24 -0
- package/esm/src/skill/parser.d.ts +30 -0
- package/esm/src/skill/parser.d.ts.map +1 -0
- package/esm/src/skill/parser.js +162 -0
- package/esm/src/skill/path-safety.d.ts +22 -0
- package/esm/src/skill/path-safety.d.ts.map +1 -0
- package/esm/src/skill/path-safety.js +156 -0
- package/esm/src/skill/prompt-augmentation.d.ts +19 -0
- package/esm/src/skill/prompt-augmentation.d.ts.map +1 -0
- package/esm/src/skill/prompt-augmentation.js +36 -0
- package/esm/src/skill/registry.d.ts +25 -0
- package/esm/src/skill/registry.d.ts.map +1 -0
- package/esm/src/skill/registry.js +42 -0
- package/esm/src/skill/tools.d.ts +27 -0
- package/esm/src/skill/tools.d.ts.map +1 -0
- package/esm/src/skill/tools.js +149 -0
- package/esm/src/skill/types.d.ts +85 -0
- package/esm/src/skill/types.d.ts.map +1 -0
- package/esm/src/skill/types.js +27 -0
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts +1 -1
- 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/studio/element-selector-injector.d.ts +0 -2
- package/esm/src/studio/element-selector-injector.d.ts.map +1 -1
- package/esm/src/task/runner.d.ts +6 -0
- package/esm/src/task/runner.d.ts.map +1 -1
- package/esm/src/task/runner.js +8 -8
- package/esm/src/tool/factory.js +31 -39
- package/esm/src/transforms/esm/http-cache-helpers.d.ts +0 -8
- package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
- package/esm/src/transforms/esm/http-cache-helpers.js +0 -20
- package/esm/src/transforms/esm/path-resolver.d.ts +0 -14
- package/esm/src/transforms/esm/path-resolver.d.ts.map +1 -1
- package/esm/src/transforms/esm/path-resolver.js +1 -92
- package/esm/src/transforms/esm/source-url-embed.d.ts +0 -14
- package/esm/src/transforms/esm/source-url-embed.d.ts.map +1 -1
- package/esm/src/transforms/esm/source-url-embed.js +0 -47
- package/esm/src/transforms/esm/transform-cache.d.ts.map +1 -1
- package/esm/src/transforms/esm/transform-cache.js +2 -6
- package/esm/src/transforms/mdx/index.d.ts +0 -1
- package/esm/src/transforms/mdx/index.d.ts.map +1 -1
- package/esm/src/transforms/mdx/index.js +0 -4
- package/esm/src/transforms/pipeline/context.d.ts +0 -1
- package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/context.js +0 -1
- package/esm/src/transforms/pipeline/index.d.ts +1 -2
- package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/index.js +0 -3
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-http-cache.js +0 -1
- package/esm/src/types/entities/getEntityInfo.js +1 -1
- package/esm/src/types/index.d.ts +2 -13
- package/esm/src/types/index.d.ts.map +1 -1
- package/esm/src/types/server.d.ts +2 -1
- package/esm/src/types/server.d.ts.map +1 -1
- package/esm/src/utils/cache-file-ops.d.ts +1 -1
- package/esm/src/utils/cache-file-ops.d.ts.map +1 -1
- package/esm/src/utils/cache-file-ops.js +5 -6
- package/esm/src/utils/lru-wrapper.d.ts.map +1 -1
- package/esm/src/utils/lru-wrapper.js +2 -4
- package/esm/src/workflow/claude-code/event-publisher.d.ts +0 -4
- package/esm/src/workflow/claude-code/event-publisher.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/event-publisher.js +2 -6
- package/esm/src/workflow/executor/workflow-executor.d.ts.map +1 -1
- package/esm/src/workflow/executor/workflow-executor.js +6 -1
- package/esm/src/workflow/react/use-workflow-list.d.ts.map +1 -1
- package/esm/src/workflow/react/use-workflow-list.js +2 -1
- package/esm/src/workflow/schemas/workflow.schema.d.ts +8 -8
- package/package.json +1 -2
- package/src/cli/app/components/inline-input.ts +0 -5
- package/src/cli/app/components/list-select.ts +0 -21
- package/src/cli/app/operations/project-creation.ts +4 -109
- package/src/cli/app/shell.ts +1 -1
- package/src/cli/app/utils.ts +0 -22
- package/src/cli/app/views/dashboard.ts +0 -17
- package/src/cli/app/views/startup.ts +0 -13
- package/src/cli/auth/login.ts +1 -2
- package/src/cli/auth/token-store.ts +1 -1
- package/src/cli/auth/utils.ts +2 -1
- package/src/cli/commands/generate/integration-generator.ts +1 -1
- package/src/cli/help/formatters.ts +11 -4
- package/src/cli/help/main-help.ts +2 -3
- package/src/cli/mcp/server.ts +2 -5
- package/src/cli/mcp/tools/dev-tools.ts +1 -2
- package/src/cli/mcp/tools.ts +8 -2
- package/src/cli/shared/reserve-slug.ts +1 -4
- package/src/cli/sync/ignore.ts +26 -21
- package/src/cli/ui/colors.ts +0 -12
- package/src/cli/ui/dot-matrix.ts +3 -6
- package/src/cli/ui/tui.ts +3 -3
- package/src/cli/utils/index.ts +1 -1
- package/src/cli/utils/package-manager.ts +3 -4
- package/src/deno.js +22 -19
- package/src/src/agent/chat-handler.ts +8 -23
- package/src/src/agent/factory.ts +58 -9
- package/src/src/agent/index.ts +16 -1
- package/src/src/agent/memory/memory.ts +0 -9
- package/src/src/agent/react/use-chat/types.ts +2 -0
- package/src/src/agent/react/use-chat/use-chat.ts +15 -9
- package/src/src/agent/runtime/index.ts +213 -35
- package/src/src/agent/runtime/tool-helpers.ts +9 -0
- package/src/src/agent/types.ts +10 -0
- package/src/src/ai/registry-manager.ts +2 -1
- package/src/src/build/bundler/code-splitter/manifest-builder.ts +1 -1
- package/src/src/build/compiler/mdx-compiler/validator.ts +3 -7
- package/src/src/build/compiler/mdx-to-js.ts +0 -101
- package/src/src/build/index.ts +0 -8
- package/src/src/build/production-build/build/route-collector.ts +2 -4
- package/src/src/build/production-build/templates.ts +9 -18
- package/src/src/build/vendor-cache.ts +0 -6
- package/src/src/cache/tokenizing-gateway.ts +1 -9
- package/src/src/chat/index.ts +3 -0
- package/src/src/config/define-config.ts +30 -29
- package/src/src/config/loader.ts +10 -9
- package/src/src/config/schemas/config.schema.ts +12 -0
- package/src/src/data/data-fetcher.ts +15 -21
- package/src/src/data/server-data-fetcher.ts +1 -8
- package/src/src/data/static-data-fetcher.ts +1 -6
- package/src/src/discovery/discovery-engine.ts +27 -0
- package/src/src/discovery/discovery-utils.ts +0 -7
- package/src/src/discovery/file-discovery.ts +3 -9
- package/src/src/discovery/handlers/index.ts +1 -0
- package/src/src/discovery/handlers/skill-handler.ts +123 -0
- package/src/src/discovery/handlers/task-handler.ts +1 -5
- package/src/src/discovery/transpiler.ts +7 -4
- package/src/src/discovery/types.ts +3 -0
- package/src/src/embedding/resolve.ts +1 -3
- package/src/src/embedding/upload-handler.ts +7 -3
- package/src/src/embedding/upload-store.ts +4 -4
- package/src/src/errors/error-registry.ts +2 -2
- package/src/src/errors/http-error.ts +7 -3
- package/src/src/errors/middleware/cli-error-boundary.ts +28 -2
- package/src/src/errors/middleware/wrap-unknown.ts +0 -10
- package/src/src/errors/veryfront-error.ts +0 -9
- package/src/src/html/styles-builder/css-hash-cache.ts +5 -2
- package/src/src/html/styles-builder/plugin-loader.ts +58 -21
- package/src/src/html/styles-builder/tailwind-compiler-cache.ts +11 -4
- package/src/src/html/utils.ts +0 -33
- package/src/src/modules/component-registry/registry.ts +0 -3
- package/src/src/modules/server/websocket-handler.ts +1 -1
- package/src/src/oauth/handlers/callback-handler.ts +17 -5
- package/src/src/oauth/providers/base.ts +3 -3
- package/src/src/oauth/providers/common.ts +0 -23
- package/src/src/observability/auto-instrument/react-instrumentation.ts +2 -2
- package/src/src/observability/instruments/instruments-factory.ts +6 -6
- package/src/src/observability/metrics/config.ts +5 -5
- package/src/src/observability/metrics/manager.ts +1 -1
- package/src/src/observability/tracing/span-operations.ts +14 -9
- package/src/src/platform/compat/console/node.ts +4 -14
- package/src/src/platform/compat/fs.ts +14 -3
- package/src/src/platform/compat/opaque-deps.ts +10 -5
- package/src/src/platform/compat/path/basic-operations.ts +9 -7
- package/src/src/platform/compat/path/resolution.ts +15 -8
- package/src/src/platform/compat/path/url-conversion.ts +10 -6
- package/src/src/platform/compat/process.ts +133 -76
- package/src/src/provider/index.ts +1 -0
- package/src/src/provider/local/ai-sdk-adapter.ts +40 -37
- package/src/src/provider/local/env.ts +4 -1
- package/src/src/provider/model-registry.ts +47 -0
- package/src/src/proxy/retry.ts +0 -9
- package/src/src/proxy/tracing.ts +1 -9
- package/src/src/react/components/ai/chat/components/code-block.tsx +1 -1
- package/src/src/react/components/ai/chat/components/skill-badge.tsx +51 -0
- package/src/src/react/components/ai/chat/components/step-indicator.tsx +4 -4
- package/src/src/react/components/ai/chat/composition/chat-message-list.tsx +9 -2
- package/src/src/react/components/ai/chat/composition/message.tsx +9 -2
- package/src/src/react/components/ai/chat/index.tsx +6 -1
- package/src/src/react/components/ai/chat/utils/message-parts.ts +11 -0
- package/src/src/react/components/ai/chat-with-sidebar.tsx +2 -0
- package/src/src/react/components/ai/chat.tsx +3 -0
- package/src/src/rendering/cache/index.ts +12 -5
- package/src/src/rendering/orchestrator/pipeline.ts +12 -2
- package/src/src/rendering/renderer.ts +1 -1
- package/src/src/rendering/shared/context-aware-cache.ts +0 -5
- package/src/src/repositories/schemas/index.ts +0 -2
- package/src/src/repositories/schemas/repository.schema.ts +0 -15
- package/src/src/repositories/types.ts +1 -6
- package/src/src/routing/api/module-loader/loader.ts +88 -3
- package/src/src/routing/api/openapi/path-utils.ts +0 -39
- package/src/src/routing/api/openapi/spec-generator.ts +1 -20
- package/src/src/routing/api/openapi/types.ts +20 -0
- package/src/src/sandbox/sandbox.ts +8 -8
- package/src/src/security/http/cors/constants.ts +0 -4
- package/src/src/security/http/response/index.ts +3 -9
- package/src/src/server/context/enriched-context.ts +1 -19
- package/src/src/server/dev-server/server.ts +11 -4
- package/src/src/server/dev-ui/manifest.js +20 -20
- package/src/src/server/handlers/dev/framework-candidates.generated.ts +426 -179
- package/src/src/server/runtime-handler/index.ts +17 -28
- package/src/src/server/shared/renderer/memory/pressure.ts +2 -15
- package/src/src/server/utils/domain-lookup.ts +0 -4
- package/src/src/skill/allowed-tools.ts +107 -0
- package/src/src/skill/executor.ts +215 -0
- package/src/src/skill/index.ts +60 -0
- package/src/src/skill/parser.ts +214 -0
- package/src/src/skill/path-safety.ts +203 -0
- package/src/src/skill/prompt-augmentation.ts +48 -0
- package/src/src/skill/registry.ts +51 -0
- package/src/src/skill/tools.ts +197 -0
- package/src/src/skill/types.ts +107 -0
- package/src/src/studio/bridge/bridge-bundle.generated.ts +1 -1
- package/src/src/studio/element-selector-injector.ts +0 -2
- package/src/src/task/runner.ts +10 -8
- package/src/src/tool/factory.ts +54 -54
- package/src/src/transforms/esm/http-cache-helpers.ts +0 -20
- package/src/src/transforms/esm/path-resolver.ts +1 -140
- package/src/src/transforms/esm/source-url-embed.ts +0 -53
- package/src/src/transforms/esm/transform-cache.ts +3 -7
- package/src/src/transforms/mdx/index.ts +0 -5
- package/src/src/transforms/pipeline/context.ts +0 -2
- package/src/src/transforms/pipeline/index.ts +0 -4
- package/src/src/transforms/pipeline/stages/ssr-http-cache.ts +0 -1
- package/src/src/types/entities/getEntityInfo.ts +1 -1
- package/src/src/types/index.ts +1 -20
- package/src/src/types/server.ts +1 -1
- package/src/src/utils/cache-file-ops.ts +5 -5
- package/src/src/utils/lru-wrapper.ts +2 -8
- package/src/src/workflow/claude-code/event-publisher.ts +13 -4
- package/src/src/workflow/executor/workflow-executor.ts +7 -2
- package/src/src/workflow/react/use-workflow-list.ts +3 -2
- package/esm/src/transforms/mdx/parser.d.ts +0 -4
- package/esm/src/transforms/mdx/parser.d.ts.map +0 -1
- package/esm/src/transforms/mdx/parser.js +0 -49
- package/src/src/transforms/mdx/parser.ts +0 -65
|
@@ -31,6 +31,7 @@ import { MessageActions as ActionsImpl } from "../components/message-actions.js"
|
|
|
31
31
|
import { MessageFeedback as FeedbackImpl } from "../components/message-feedback.js";
|
|
32
32
|
import { BranchPicker as BranchPickerImpl } from "../components/branch-picker.js";
|
|
33
33
|
import { ReasoningCard } from "../components/reasoning.js";
|
|
34
|
+
import { SkillBadge } from "../components/skill-badge.js";
|
|
34
35
|
import { ToolCallCard } from "../components/tool-ui.js";
|
|
35
36
|
import { StepIndicator } from "../components/step-indicator.js";
|
|
36
37
|
import { Sources as SourcesImpl } from "../components/sources.js";
|
|
@@ -40,6 +41,7 @@ import {
|
|
|
40
41
|
extractSourcesFromParts,
|
|
41
42
|
getTextContent,
|
|
42
43
|
groupPartsInOrder,
|
|
44
|
+
isSkillToolPart,
|
|
43
45
|
} from "../utils/message-parts.js";
|
|
44
46
|
|
|
45
47
|
// ---------------------------------------------------------------------------
|
|
@@ -241,9 +243,14 @@ function MessageContent({
|
|
|
241
243
|
)
|
|
242
244
|
: null;
|
|
243
245
|
}
|
|
246
|
+
const isSkill = isSkillToolPart(group.tool);
|
|
244
247
|
return (
|
|
245
|
-
<div key={group.tool.toolCallId} className="my-3">
|
|
246
|
-
{renderTool
|
|
248
|
+
<div key={group.tool.toolCallId} className={isSkill ? "my-2" : "my-3"}>
|
|
249
|
+
{renderTool
|
|
250
|
+
? renderTool(group.tool)
|
|
251
|
+
: isSkill
|
|
252
|
+
? <SkillBadge tool={group.tool} />
|
|
253
|
+
: <ToolCallCard tool={group.tool} />}
|
|
247
254
|
</div>
|
|
248
255
|
);
|
|
249
256
|
})}
|
|
@@ -98,6 +98,7 @@ export { MessageActions, type MessageActionsProps } from "./components/message-a
|
|
|
98
98
|
export { MessageEditForm, type MessageEditFormProps } from "./components/message-edit-form.js";
|
|
99
99
|
export { BranchPicker, type BranchPickerProps } from "./components/branch-picker.js";
|
|
100
100
|
export { DropZoneOverlay, type DropZoneOverlayProps } from "./components/drop-zone.js";
|
|
101
|
+
export { SkillBadge, type SkillBadgeProps } from "./components/skill-badge.js";
|
|
101
102
|
export { ToolCallCard, ToolStatusBadge } from "./components/tool-ui.js";
|
|
102
103
|
export { InferenceBadge, type InferenceBadgeProps } from "./components/inference-badge.js";
|
|
103
104
|
export { UpgradeCTA, type UpgradeCTAProps } from "./components/upgrade-cta.js";
|
|
@@ -142,6 +143,7 @@ export {
|
|
|
142
143
|
getTextContent,
|
|
143
144
|
groupPartsInOrder,
|
|
144
145
|
isReasoningPart,
|
|
146
|
+
isSkillToolPart,
|
|
145
147
|
isToolPart,
|
|
146
148
|
type PartGroup,
|
|
147
149
|
} from "./utils/message-parts.js";
|
|
@@ -218,6 +220,8 @@ export interface ChatProps {
|
|
|
218
220
|
showMessageActions?: boolean;
|
|
219
221
|
models?: ModelOption[];
|
|
220
222
|
model?: string;
|
|
223
|
+
/** The actual resolved model after auto-upgrade (used for avatar display) */
|
|
224
|
+
activeModel?: string;
|
|
221
225
|
onModelChange?: (model: string) => void;
|
|
222
226
|
inferenceMode?: InferenceMode;
|
|
223
227
|
browserStatus?: BrowserInferenceStatus | null;
|
|
@@ -282,6 +286,7 @@ export const Chat = React.forwardRef<HTMLDivElement, ChatProps>(function Chat(
|
|
|
282
286
|
showMessageActions = true,
|
|
283
287
|
models,
|
|
284
288
|
model,
|
|
289
|
+
activeModel,
|
|
285
290
|
onModelChange,
|
|
286
291
|
inferenceMode,
|
|
287
292
|
browserStatus,
|
|
@@ -445,7 +450,7 @@ export const Chat = React.forwardRef<HTMLDivElement, ChatProps>(function Chat(
|
|
|
445
450
|
theme={theme}
|
|
446
451
|
renderMessage={renderMessage}
|
|
447
452
|
renderTool={renderTool}
|
|
448
|
-
model={model}
|
|
453
|
+
model={activeModel || model}
|
|
449
454
|
showMessageActions={showMessageActions}
|
|
450
455
|
showSources={showSources}
|
|
451
456
|
showSteps={showSteps}
|
|
@@ -28,6 +28,17 @@ export function isToolPart(part: UIMessagePart): part is ToolUIPart | DynamicToo
|
|
|
28
28
|
return part.type.startsWith("tool-") && part.type !== "tool-result";
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
const SKILL_TOOL_NAMES: ReadonlySet<string> = new Set([
|
|
32
|
+
"load-skill",
|
|
33
|
+
"load-skill-reference",
|
|
34
|
+
"execute-skill-script",
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
/** Check if a tool part is a skill-related tool (load-skill, load-skill-reference, execute-skill-script) */
|
|
38
|
+
export function isSkillToolPart(tool: ToolUIPart | DynamicToolUIPart): boolean {
|
|
39
|
+
return SKILL_TOOL_NAMES.has(tool.toolName);
|
|
40
|
+
}
|
|
41
|
+
|
|
31
42
|
/** Check if a part is a reasoning part */
|
|
32
43
|
export function isReasoningPart(
|
|
33
44
|
part: UIMessagePart,
|
|
@@ -24,6 +24,7 @@ export interface ChatWithSidebarChatController {
|
|
|
24
24
|
isLoading?: ChatProps["isLoading"];
|
|
25
25
|
error?: ChatProps["error"];
|
|
26
26
|
model?: ChatProps["model"];
|
|
27
|
+
activeModel?: ChatProps["activeModel"];
|
|
27
28
|
onModelChange?: ChatProps["onModelChange"];
|
|
28
29
|
inferenceMode?: ChatProps["inferenceMode"];
|
|
29
30
|
browserStatus?: ChatProps["browserStatus"];
|
|
@@ -170,6 +171,7 @@ export const ChatWithSidebar = React.forwardRef<HTMLDivElement, ChatWithSidebarP
|
|
|
170
171
|
showScrollButton: features?.scrollButton,
|
|
171
172
|
showMessageActions: features?.messageActions,
|
|
172
173
|
models: models?.options,
|
|
174
|
+
activeModel: chat.activeModel,
|
|
173
175
|
inferenceMode: chat.inferenceMode,
|
|
174
176
|
browserStatus: chat.browserStatus,
|
|
175
177
|
showSources: features?.sources,
|
|
@@ -84,6 +84,7 @@ export {
|
|
|
84
84
|
InlineCitation,
|
|
85
85
|
type InlineCitationProps,
|
|
86
86
|
isReasoningPart,
|
|
87
|
+
isSkillToolPart,
|
|
87
88
|
isToolPart,
|
|
88
89
|
Loader,
|
|
89
90
|
MessageActions,
|
|
@@ -99,6 +100,8 @@ export {
|
|
|
99
100
|
ReasoningCard,
|
|
100
101
|
RichCodeBlock,
|
|
101
102
|
Shimmer,
|
|
103
|
+
SkillBadge,
|
|
104
|
+
type SkillBadgeProps,
|
|
102
105
|
type Source,
|
|
103
106
|
Sources,
|
|
104
107
|
type SourcesProps,
|
|
@@ -10,8 +10,15 @@ export {
|
|
|
10
10
|
type CacheLookupResult,
|
|
11
11
|
} from "./cache-coordinator.js";
|
|
12
12
|
export type { CachePayload, CacheStore } from "./types.js";
|
|
13
|
-
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
export {
|
|
14
|
+
APICacheStore,
|
|
15
|
+
type APICacheStoreOptions,
|
|
16
|
+
FilesystemCacheStore,
|
|
17
|
+
type FilesystemCacheStoreOptions,
|
|
18
|
+
KVCacheStore,
|
|
19
|
+
type KVCacheStoreOptions,
|
|
20
|
+
MemoryCacheStore,
|
|
21
|
+
type MemoryCacheStoreOptions,
|
|
22
|
+
RedisCacheStore,
|
|
23
|
+
type RedisCacheStoreOptions,
|
|
24
|
+
} from "./stores/index.js";
|
|
@@ -30,7 +30,7 @@ import { join } from "../../platform/compat/path/index.js";
|
|
|
30
30
|
import type { MdxBundle, PageBundle } from "../../types/index.js";
|
|
31
31
|
import type { RuntimeAdapter } from "../../platform/adapters/base.js";
|
|
32
32
|
import { isExtendedFSAdapter } from "../../platform/adapters/fs/wrapper.js";
|
|
33
|
-
import type {
|
|
33
|
+
import type { CacheLookupResult } from "../cache/cache-coordinator.js";
|
|
34
34
|
import type { PageRenderer } from "../page-renderer.js";
|
|
35
35
|
import type { PageResolver } from "../page-resolution/index.js";
|
|
36
36
|
import type { LayoutOrchestrator } from "./layout.js";
|
|
@@ -77,9 +77,19 @@ const resolvePageDataLog = logger.component("resolve-page-data");
|
|
|
77
77
|
// Re-export test helper for backward compatibility
|
|
78
78
|
export { __injectCssCacheForTests } from "./css-cache.js";
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Minimal cache interface used by RenderPipeline.
|
|
82
|
+
* Decoupled from the concrete CacheCoordinator class so that Renderer
|
|
83
|
+
* can supply a context-aware adapter without an unsafe `as any` cast.
|
|
84
|
+
*/
|
|
85
|
+
export interface PipelineCacheCoordinator {
|
|
86
|
+
checkCache(slug: string, cacheKey?: string): Promise<CacheLookupResult>;
|
|
87
|
+
persistResult(result: RenderResult, slug: string, cacheKey?: string): Promise<void>;
|
|
88
|
+
}
|
|
89
|
+
|
|
80
90
|
export interface RenderPipelineConfig {
|
|
81
91
|
pageResolver: PageResolver;
|
|
82
|
-
cacheCoordinator:
|
|
92
|
+
cacheCoordinator: PipelineCacheCoordinator;
|
|
83
93
|
pageRenderer: PageRenderer;
|
|
84
94
|
layoutOrchestrator: LayoutOrchestrator;
|
|
85
95
|
ssrOrchestrator: SSROrchestrator;
|
|
@@ -518,7 +518,7 @@ export class Renderer {
|
|
|
518
518
|
|
|
519
519
|
const pipeline = new RenderPipeline({
|
|
520
520
|
pageResolver,
|
|
521
|
-
cacheCoordinator: pipelineCacheCoordinator
|
|
521
|
+
cacheCoordinator: pipelineCacheCoordinator,
|
|
522
522
|
pageRenderer,
|
|
523
523
|
layoutOrchestrator,
|
|
524
524
|
ssrOrchestrator,
|
|
@@ -21,22 +21,7 @@ export const CacheRepositoryOptionsSchema = z.object({
|
|
|
21
21
|
maxEntries: z.number().int().positive().optional(),
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
export const FileSystemRepositoryOptionsSchema = z.object({
|
|
25
|
-
baseDir: z.string(),
|
|
26
|
-
securityContext: z
|
|
27
|
-
.enum([
|
|
28
|
-
"user-input",
|
|
29
|
-
"static-serving",
|
|
30
|
-
"build",
|
|
31
|
-
"internal",
|
|
32
|
-
"route-discovery",
|
|
33
|
-
"module-loading",
|
|
34
|
-
])
|
|
35
|
-
.optional(),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
24
|
// Inferred types
|
|
39
25
|
export type RepositoryContext = z.infer<typeof RepositoryContextSchema>;
|
|
40
26
|
export type CacheStats = z.infer<typeof CacheStatsSchema>;
|
|
41
27
|
export type CacheRepositoryOptions = z.infer<typeof CacheRepositoryOptionsSchema>;
|
|
42
|
-
export type FileSystemRepositoryOptions = z.infer<typeof FileSystemRepositoryOptionsSchema>;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { DirEntry, FileInfo } from "../platform/adapters/base.js";
|
|
2
2
|
|
|
3
3
|
// Re-export schema-based types
|
|
4
|
-
export type {
|
|
5
|
-
CacheRepositoryOptions,
|
|
6
|
-
CacheStats,
|
|
7
|
-
FileSystemRepositoryOptions,
|
|
8
|
-
RepositoryContext,
|
|
9
|
-
} from "./schemas/index.js";
|
|
4
|
+
export type { CacheRepositoryOptions, CacheStats, RepositoryContext } from "./schemas/index.js";
|
|
10
5
|
|
|
11
6
|
// Import for use in interface definitions
|
|
12
7
|
import type { CacheStats, RepositoryContext } from "./schemas/index.js";
|
|
@@ -16,9 +16,28 @@ import { isDeno, isNode } from "../../../platform/compat/runtime.js";
|
|
|
16
16
|
import { withSpan } from "../../../observability/tracing/otlp-setup.js";
|
|
17
17
|
import { isCompiledBinary } from "../../../utils/index.js";
|
|
18
18
|
import { wrapWithCurrentContext } from "../../../platform/adapters/fs/veryfront/multi-project-adapter.js";
|
|
19
|
+
import { isWithinDirectory } from "../../../security/path-validation.js";
|
|
19
20
|
|
|
20
21
|
const logger = serverLogger.component("api");
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Validates that a module path is contained within the project directory.
|
|
25
|
+
* Prevents path traversal attacks that could load arbitrary files from the host.
|
|
26
|
+
*/
|
|
27
|
+
function validateModulePath(modulePath: string, projectDir: string): void {
|
|
28
|
+
const resolved = pathHelper.resolve(modulePath);
|
|
29
|
+
const resolvedProject = pathHelper.resolve(projectDir);
|
|
30
|
+
|
|
31
|
+
if (!isWithinDirectory(resolvedProject, resolved)) {
|
|
32
|
+
throw toError(
|
|
33
|
+
createError({
|
|
34
|
+
type: "api",
|
|
35
|
+
message: `[API] module path escapes project directory: ${modulePath}`,
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
22
41
|
/** Node.js built-in module names — shared across the CJS shim, esbuild externals, and Deno rewrites. */
|
|
23
42
|
const NODE_BUILTINS = [
|
|
24
43
|
"assert",
|
|
@@ -82,13 +101,22 @@ async function readProjectDependencies(
|
|
|
82
101
|
function generateCompiledBinaryRequireShim(projectDir: string): string {
|
|
83
102
|
const builtinSet = JSON.stringify(NODE_BUILTINS);
|
|
84
103
|
const safeProjectDir = JSON.stringify(projectDir + "/package.json");
|
|
104
|
+
const safeProjectRoot = JSON.stringify(pathHelper.resolve(projectDir));
|
|
85
105
|
|
|
86
106
|
return `
|
|
87
107
|
import { createRequire as __vf_createRequire } from "node:module";
|
|
88
108
|
import { dirname as __vf_dirname, resolve as __vf_resolve } from "node:path";
|
|
89
109
|
var __vf_builtinRequire = __vf_createRequire(${safeProjectDir});
|
|
90
110
|
var __vf_builtinSet = new Set(${builtinSet});
|
|
111
|
+
var __vf_projectRoot = ${safeProjectRoot};
|
|
91
112
|
var __vf_cache = Object.create(null);
|
|
113
|
+
function __vf_assertContained(resolved) {
|
|
114
|
+
var norm = __vf_resolve(resolved).replace(/\\\\/g, "/");
|
|
115
|
+
var root = __vf_projectRoot.replace(/\\\\/g, "/");
|
|
116
|
+
if (!norm.startsWith(root + "/") && norm !== root) {
|
|
117
|
+
throw new Error("CJS loader blocked path outside project: " + resolved);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
92
120
|
function __vf_loadCjs(id, parentDir) {
|
|
93
121
|
if (id.startsWith("node:")) return __vf_builtinRequire(id);
|
|
94
122
|
if (__vf_builtinSet.has(id)) return __vf_builtinRequire(id);
|
|
@@ -103,6 +131,7 @@ function __vf_loadCjs(id, parentDir) {
|
|
|
103
131
|
try { Deno.statSync(resolved + exts[i]); resolved += exts[i]; break; } catch {}
|
|
104
132
|
}
|
|
105
133
|
}
|
|
134
|
+
__vf_assertContained(resolved);
|
|
106
135
|
} else {
|
|
107
136
|
resolved = __vf_builtinRequire.resolve(id);
|
|
108
137
|
}
|
|
@@ -189,6 +218,8 @@ export function loadHandlerModule(options: LoadModuleOptions): Promise<APIRoute
|
|
|
189
218
|
const { projectDir, modulePath, adapter, config } = options;
|
|
190
219
|
const fs = createFileSystem();
|
|
191
220
|
|
|
221
|
+
validateModulePath(modulePath, projectDir);
|
|
222
|
+
|
|
192
223
|
try {
|
|
193
224
|
const module = await loadModule({ modulePath, projectDir, adapter, fs, config });
|
|
194
225
|
return extractAPIRouteHandlers(module);
|
|
@@ -312,6 +343,13 @@ function createImportMapPlugin(
|
|
|
312
343
|
? resolvedPath
|
|
313
344
|
: pathHelper.resolve(projectDir, resolvedPath);
|
|
314
345
|
|
|
346
|
+
if (!isWithinDirectory(pathHelper.resolve(projectDir), absolutePath)) {
|
|
347
|
+
logger.error(
|
|
348
|
+
`[API] Import map entry escapes project directory: ${args.path} -> ${absolutePath}`,
|
|
349
|
+
);
|
|
350
|
+
return { errors: [{ text: `Import map path escapes project: ${args.path}` }] };
|
|
351
|
+
}
|
|
352
|
+
|
|
315
353
|
logger.debug(`Import map resolved: ${args.path} -> ${absolutePath}`);
|
|
316
354
|
|
|
317
355
|
return { path: absolutePath, namespace: "import-map" };
|
|
@@ -325,6 +363,7 @@ function createImportMapPlugin(
|
|
|
325
363
|
adapter,
|
|
326
364
|
args.path,
|
|
327
365
|
FILE_EXTENSIONS,
|
|
366
|
+
projectDir,
|
|
328
367
|
);
|
|
329
368
|
|
|
330
369
|
return {
|
|
@@ -344,7 +383,10 @@ function createImportMapPlugin(
|
|
|
344
383
|
}
|
|
345
384
|
|
|
346
385
|
/** Resolves relative imports through the adapter's virtual FS for remote projects. */
|
|
347
|
-
function createAdapterResolvePlugin(
|
|
386
|
+
function createAdapterResolvePlugin(
|
|
387
|
+
adapter: RuntimeAdapter,
|
|
388
|
+
projectDir: string,
|
|
389
|
+
): Plugin {
|
|
348
390
|
return {
|
|
349
391
|
name: "vf-adapter-resolve",
|
|
350
392
|
setup(build) {
|
|
@@ -355,6 +397,16 @@ function createAdapterResolvePlugin(adapter: RuntimeAdapter): Plugin {
|
|
|
355
397
|
if (!baseDir) return undefined;
|
|
356
398
|
|
|
357
399
|
const absolutePath = pathHelper.resolve(baseDir, args.path);
|
|
400
|
+
|
|
401
|
+
if (!isWithinDirectory(pathHelper.resolve(projectDir), absolutePath)) {
|
|
402
|
+
logger.error(
|
|
403
|
+
`[API] Adapter resolve path escapes project: ${args.path} -> ${absolutePath}`,
|
|
404
|
+
);
|
|
405
|
+
return {
|
|
406
|
+
errors: [{ text: `Relative import escapes project: ${args.path}` }],
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
|
|
358
410
|
logger.debug(
|
|
359
411
|
`[API] Adapter resolve: ${args.path} (from ${
|
|
360
412
|
args.importer || "stdin"
|
|
@@ -376,6 +428,7 @@ function createAdapterResolvePlugin(adapter: RuntimeAdapter): Plugin {
|
|
|
376
428
|
adapter,
|
|
377
429
|
args.path,
|
|
378
430
|
FILE_EXTENSIONS,
|
|
431
|
+
projectDir,
|
|
379
432
|
);
|
|
380
433
|
|
|
381
434
|
return {
|
|
@@ -408,6 +461,7 @@ function loadAndTranspileModule(
|
|
|
408
461
|
adapter,
|
|
409
462
|
modulePath,
|
|
410
463
|
FILE_EXTENSIONS,
|
|
464
|
+
projectDir,
|
|
411
465
|
);
|
|
412
466
|
|
|
413
467
|
if (!source) {
|
|
@@ -495,7 +549,7 @@ function loadAndTranspileModule(
|
|
|
495
549
|
},
|
|
496
550
|
plugins: [
|
|
497
551
|
createImportMapPlugin(projectDir, adapter, config),
|
|
498
|
-
createAdapterResolvePlugin(adapter),
|
|
552
|
+
createAdapterResolvePlugin(adapter, projectDir),
|
|
499
553
|
createHTTPPlugin(allowedHosts),
|
|
500
554
|
],
|
|
501
555
|
});
|
|
@@ -524,9 +578,25 @@ async function readFileWithExtensions(
|
|
|
524
578
|
adapter: RuntimeAdapter,
|
|
525
579
|
basePath: string,
|
|
526
580
|
extensions: string[],
|
|
581
|
+
projectDir?: string,
|
|
527
582
|
): Promise<{ filePath: string; contents: string }> {
|
|
583
|
+
const resolvedProjectDir = projectDir ? pathHelper.resolve(projectDir) : undefined;
|
|
584
|
+
|
|
528
585
|
for (const ext of extensions) {
|
|
529
586
|
const filePath = ext ? basePath + ext : basePath;
|
|
587
|
+
|
|
588
|
+
if (resolvedProjectDir) {
|
|
589
|
+
const resolved = pathHelper.resolve(filePath);
|
|
590
|
+
if (!isWithinDirectory(resolvedProjectDir, resolved)) {
|
|
591
|
+
throw toError(
|
|
592
|
+
createError({
|
|
593
|
+
type: "api",
|
|
594
|
+
message: `[API] file path escapes project directory: ${filePath}`,
|
|
595
|
+
}),
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
530
600
|
try {
|
|
531
601
|
const contents = await adapter.fs.readFile(filePath);
|
|
532
602
|
return { filePath, contents };
|
|
@@ -974,11 +1044,26 @@ async function registerVfModules(subpaths: Set<string>): Promise<void> {
|
|
|
974
1044
|
Record<string, unknown>
|
|
975
1045
|
>;
|
|
976
1046
|
|
|
1047
|
+
// __VERYFRONT_MODULES__ is populated by the discovery transpiler via hash
|
|
1048
|
+
// imports (#veryfront/...) which resolve correctly in compiled binaries.
|
|
1049
|
+
// Check it first before attempting bare specifier dynamic imports.
|
|
1050
|
+
const discoveryModules = (dntShim.dntGlobalThis as Record<string, unknown>).__VERYFRONT_MODULES__ as
|
|
1051
|
+
| Record<string, Record<string, unknown>>
|
|
1052
|
+
| undefined;
|
|
1053
|
+
|
|
977
1054
|
for (const subpath of subpaths) {
|
|
978
1055
|
if (modules[subpath]) continue;
|
|
979
1056
|
|
|
1057
|
+
const specifier = `veryfront/${subpath}`;
|
|
1058
|
+
|
|
1059
|
+
const fromDiscovery = discoveryModules?.[specifier];
|
|
1060
|
+
if (fromDiscovery) {
|
|
1061
|
+
modules[subpath] = fromDiscovery;
|
|
1062
|
+
logger.debug(`[API] Registered module ${specifier} from discovery globals`);
|
|
1063
|
+
continue;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
980
1066
|
try {
|
|
981
|
-
const specifier = `veryfront/${subpath}`;
|
|
982
1067
|
modules[subpath] = await import(specifier) as Record<string, unknown>;
|
|
983
1068
|
logger.debug(`[API] Registered module ${specifier} on globalThis`);
|
|
984
1069
|
} catch (e) {
|
|
@@ -97,45 +97,6 @@ export function extractPathParams(pattern: string): PathParam[] {
|
|
|
97
97
|
return params;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
/**
|
|
101
|
-
* Convert file path to route pattern.
|
|
102
|
-
*
|
|
103
|
-
* Transforms a file system path to an API route pattern.
|
|
104
|
-
*
|
|
105
|
-
* @param filePath - File path relative to pages/api or app directory
|
|
106
|
-
* @param routePrefix - Prefix to add (e.g., "/api")
|
|
107
|
-
* @returns Route pattern
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* ```typescript
|
|
111
|
-
* filePathToPattern("users/[id]/route.ts", "/api")
|
|
112
|
-
* // → "/api/users/[id]"
|
|
113
|
-
*
|
|
114
|
-
* filePathToPattern("users/[id].ts", "/api")
|
|
115
|
-
* // → "/api/users/[id]"
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
|
-
export function filePathToPattern(filePath: string, routePrefix: string = ""): string {
|
|
119
|
-
let pattern = filePath
|
|
120
|
-
.replace(/\.(ts|tsx|js|jsx)$/, "")
|
|
121
|
-
.replace(/\/route$/, "")
|
|
122
|
-
.replace(/\/index$/, "");
|
|
123
|
-
|
|
124
|
-
if (!pattern.startsWith("/")) pattern = `/${pattern}`;
|
|
125
|
-
|
|
126
|
-
if (routePrefix && !pattern.startsWith(routePrefix)) {
|
|
127
|
-
pattern = `${routePrefix}${pattern}`;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
pattern = pattern.replace(/\/+/g, "/");
|
|
131
|
-
|
|
132
|
-
if (pattern.length > 1 && pattern.endsWith("/")) {
|
|
133
|
-
pattern = pattern.slice(0, -1);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return pattern;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
100
|
/**
|
|
140
101
|
* Generate a unique operation ID from method and path.
|
|
141
102
|
*
|
|
@@ -11,6 +11,7 @@ import type { VeryfrontConfig } from "../../../config/index.js";
|
|
|
11
11
|
import type { DynamicRouter, RouteEntry } from "../api-route-matcher.js";
|
|
12
12
|
import { loadHandlerModule } from "../module-loader/loader.js";
|
|
13
13
|
import {
|
|
14
|
+
getDefaultStatusDescription,
|
|
14
15
|
OPENAPI_METADATA,
|
|
15
16
|
type OpenAPIOperation,
|
|
16
17
|
type OpenAPIParameter,
|
|
@@ -261,23 +262,3 @@ function toYaml(obj: unknown, indent: number): string {
|
|
|
261
262
|
|
|
262
263
|
return String(obj);
|
|
263
264
|
}
|
|
264
|
-
|
|
265
|
-
function getDefaultStatusDescription(statusCode: number): string {
|
|
266
|
-
const descriptions: Record<number, string> = {
|
|
267
|
-
200: "Successful response",
|
|
268
|
-
201: "Resource created",
|
|
269
|
-
204: "No content",
|
|
270
|
-
400: "Bad request",
|
|
271
|
-
401: "Unauthorized",
|
|
272
|
-
403: "Forbidden",
|
|
273
|
-
404: "Not found",
|
|
274
|
-
409: "Conflict",
|
|
275
|
-
422: "Unprocessable entity",
|
|
276
|
-
429: "Too many requests",
|
|
277
|
-
500: "Internal server error",
|
|
278
|
-
502: "Bad gateway",
|
|
279
|
-
503: "Service unavailable",
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
return descriptions[statusCode] || `Response with status ${statusCode}`;
|
|
283
|
-
}
|
|
@@ -113,3 +113,23 @@ export interface OpenAPIResponse {
|
|
|
113
113
|
"application/json"?: { schema: JsonSchema };
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
+
|
|
117
|
+
const STATUS_DESCRIPTIONS: Record<number, string> = {
|
|
118
|
+
200: "Successful response",
|
|
119
|
+
201: "Resource created",
|
|
120
|
+
204: "No content",
|
|
121
|
+
400: "Bad request",
|
|
122
|
+
401: "Unauthorized",
|
|
123
|
+
403: "Forbidden",
|
|
124
|
+
404: "Not found",
|
|
125
|
+
409: "Conflict",
|
|
126
|
+
422: "Unprocessable entity",
|
|
127
|
+
429: "Too many requests",
|
|
128
|
+
500: "Internal server error",
|
|
129
|
+
502: "Bad gateway",
|
|
130
|
+
503: "Service unavailable",
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export function getDefaultStatusDescription(statusCode: number): string {
|
|
134
|
+
return STATUS_DESCRIPTIONS[statusCode] ?? `Response with status ${statusCode}`;
|
|
135
|
+
}
|
|
@@ -40,13 +40,17 @@ export class Sandbox {
|
|
|
40
40
|
private apiUrl: string,
|
|
41
41
|
) {}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const apiUrl = options.apiUrl ||
|
|
43
|
+
private static resolveApiUrl(options: SandboxOptions): string {
|
|
44
|
+
return options.apiUrl ||
|
|
46
45
|
(typeof dntShim.Deno !== "undefined"
|
|
47
46
|
? dntShim.Deno.env.get("VERYFRONT_API_URL")
|
|
48
47
|
: process.env.VERYFRONT_API_URL) ||
|
|
49
48
|
"https://api.veryfront.com";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Create a new sandbox session. Claims a warm pod or creates a new one. */
|
|
52
|
+
static async create(options: SandboxOptions): Promise<Sandbox> {
|
|
53
|
+
const apiUrl = Sandbox.resolveApiUrl(options);
|
|
50
54
|
|
|
51
55
|
const res = await dntShim.fetch(`${apiUrl}/sandbox-sessions`, {
|
|
52
56
|
method: "POST",
|
|
@@ -72,11 +76,7 @@ export class Sandbox {
|
|
|
72
76
|
|
|
73
77
|
/** Reconnect to an existing sandbox session. */
|
|
74
78
|
static async get(id: string, options: SandboxOptions): Promise<Sandbox> {
|
|
75
|
-
const apiUrl = options
|
|
76
|
-
(typeof dntShim.Deno !== "undefined"
|
|
77
|
-
? dntShim.Deno.env.get("VERYFRONT_API_URL")
|
|
78
|
-
: process.env.VERYFRONT_API_URL) ||
|
|
79
|
-
"https://api.veryfront.com";
|
|
79
|
+
const apiUrl = Sandbox.resolveApiUrl(options);
|
|
80
80
|
|
|
81
81
|
const res = await dntShim.fetch(`${apiUrl}/sandbox-sessions/${id}`, {
|
|
82
82
|
headers: { Authorization: `Bearer ${options.authToken}` },
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { DEV_LOCALHOST_ORIGINS } from "../../../config/index.js";
|
|
2
|
-
|
|
3
1
|
export const DEFAULT_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"];
|
|
4
2
|
export const DEFAULT_HEADERS = ["Content-Type", "Authorization"];
|
|
5
3
|
export const DEFAULT_MAX_AGE = 86400;
|
|
6
4
|
|
|
7
|
-
export { DEV_LOCALHOST_ORIGINS };
|
|
8
|
-
|
|
9
5
|
export const HTTP_NO_CONTENT = 204;
|
|
10
6
|
export const HTTP_FORBIDDEN = 403;
|
|
@@ -4,14 +4,8 @@
|
|
|
4
4
|
* @module security/http/response
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export type { CacheStrategy,
|
|
8
|
-
export { CACHE_DURATIONS
|
|
7
|
+
export type { CacheStrategy, ResponseBuilderConfig } from "./types.js";
|
|
8
|
+
export { CACHE_DURATIONS } from "./constants.js";
|
|
9
9
|
export { createResponseBuilder, ResponseBuilder } from "./builder.js";
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
applySecurityHeaders,
|
|
13
|
-
buildCSP,
|
|
14
|
-
generateNonce,
|
|
15
|
-
getSecurityHeader,
|
|
16
|
-
} from "./security-handler.js";
|
|
10
|
+
export { applySecurityHeaders, generateNonce, getSecurityHeader } from "./security-handler.js";
|
|
17
11
|
export { buildCacheControl } from "./cache-handler.js";
|
|
@@ -103,25 +103,7 @@ export function buildEnrichedContext(options: BuildEnrichedContextOptions): Enri
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
token: string;
|
|
108
|
-
slug: string;
|
|
109
|
-
branch: string | null;
|
|
110
|
-
mode: Environment;
|
|
111
|
-
} {
|
|
112
|
-
return {
|
|
113
|
-
token: enriched.token,
|
|
114
|
-
slug: enriched.projectSlug,
|
|
115
|
-
branch: enriched.branch,
|
|
116
|
-
mode: enriched.environment,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export function shouldEnableCacheFromEnriched(enriched: EnrichedContext): boolean {
|
|
121
|
-
return !enriched.isLocalProject && enriched.environment !== "preview";
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function shouldUseNoCacheHeadersFromEnriched(enriched: EnrichedContext): boolean {
|
|
106
|
+
function shouldUseNoCacheHeadersFromEnriched(enriched: EnrichedContext): boolean {
|
|
125
107
|
return enriched.isLocalProject || enriched.environment === "preview";
|
|
126
108
|
}
|
|
127
109
|
|