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
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill path safety
|
|
3
|
+
*
|
|
4
|
+
* Validates file paths within skill directories to prevent traversal attacks.
|
|
5
|
+
* Uses centralized validatePath() from #veryfront/security.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import * as dntShim from "../../_dnt.shims.js";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
import { validatePath, type ValidationResult } from "../security/index.js";
|
|
13
|
+
import { isAbsolute, join, relative, resolve } from "../platform/compat/path/index.js";
|
|
14
|
+
import { exists, readDir, stat } from "../platform/compat/fs.js";
|
|
15
|
+
import { createError, toError } from "../errors/veryfront-error.js";
|
|
16
|
+
import type { FileSystemAdapter } from "../platform/adapters/base.js";
|
|
17
|
+
|
|
18
|
+
function isInsideDir(baseDir: string, targetPath: string): boolean {
|
|
19
|
+
const rel = relative(baseDir, targetPath);
|
|
20
|
+
return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function pathExists(path: string, fsAdapter?: FileSystemAdapter): Promise<boolean> {
|
|
24
|
+
return fsAdapter ? await fsAdapter.exists(path) : await exists(path);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function assertIsFile(path: string, fsAdapter?: FileSystemAdapter): Promise<void> {
|
|
28
|
+
const info = fsAdapter ? await fsAdapter.stat(path) : await stat(path);
|
|
29
|
+
if (!info.isFile) {
|
|
30
|
+
throw toError(
|
|
31
|
+
createError({
|
|
32
|
+
type: "agent",
|
|
33
|
+
message: `Skill path must point to a file: "${path}"`,
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function resolveLocalRealPath(path: string): Promise<string> {
|
|
40
|
+
if (typeof dntShim.Deno !== "undefined") {
|
|
41
|
+
return await dntShim.Deno.realPath(path);
|
|
42
|
+
}
|
|
43
|
+
const fs = await import("node:fs/promises");
|
|
44
|
+
return await fs.realpath(path);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function isLocalSymlink(path: string): Promise<boolean> {
|
|
48
|
+
try {
|
|
49
|
+
if (typeof dntShim.Deno !== "undefined") {
|
|
50
|
+
const info = await dntShim.Deno.lstat(path);
|
|
51
|
+
return info.isSymlink;
|
|
52
|
+
}
|
|
53
|
+
const fs = await import("node:fs/promises");
|
|
54
|
+
const info = await fs.lstat(path);
|
|
55
|
+
return info.isSymbolicLink();
|
|
56
|
+
} catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function isAdapterSymlink(
|
|
62
|
+
fsAdapter: FileSystemAdapter,
|
|
63
|
+
parentDir: string,
|
|
64
|
+
segment: string,
|
|
65
|
+
): Promise<boolean> {
|
|
66
|
+
for await (const entry of fsAdapter.readDir(parentDir)) {
|
|
67
|
+
if (entry.name !== segment) continue;
|
|
68
|
+
return entry.isSymlink;
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function hasSymlinkInPath(
|
|
74
|
+
skillRoot: string,
|
|
75
|
+
canonicalPath: string,
|
|
76
|
+
fsAdapter?: FileSystemAdapter,
|
|
77
|
+
): Promise<boolean> {
|
|
78
|
+
const resolvedRoot = resolve(skillRoot);
|
|
79
|
+
const resolvedTarget = resolve(canonicalPath);
|
|
80
|
+
const rel = relative(resolvedRoot, resolvedTarget).replaceAll("\\", "/");
|
|
81
|
+
|
|
82
|
+
if (!rel) return false;
|
|
83
|
+
if (rel.startsWith("..") || isAbsolute(rel)) return true;
|
|
84
|
+
|
|
85
|
+
let current = resolvedRoot;
|
|
86
|
+
for (const segment of rel.split("/").filter(Boolean)) {
|
|
87
|
+
if (fsAdapter) {
|
|
88
|
+
if (await isAdapterSymlink(fsAdapter, current, segment)) return true;
|
|
89
|
+
} else if (await isLocalSymlink(join(current, segment))) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
current = join(current, segment);
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Validate that a requested path is safe within a skill's root directory.
|
|
99
|
+
*
|
|
100
|
+
* @param skillRoot - Absolute path to the skill directory
|
|
101
|
+
* @param requestedPath - Relative path requested (e.g. "references/CLAUSES.md")
|
|
102
|
+
* @param allowedSubdirs - Allowed top-level subdirectories (e.g. ["references", "assets"])
|
|
103
|
+
* @param fsAdapter - Optional file system adapter for VFS/cloud-backed projects
|
|
104
|
+
* @returns The validated canonical path
|
|
105
|
+
* @throws If the path is invalid, escapes the skill root, or the file doesn't exist
|
|
106
|
+
*/
|
|
107
|
+
export async function validateSkillPath(
|
|
108
|
+
skillRoot: string,
|
|
109
|
+
requestedPath: string,
|
|
110
|
+
allowedSubdirs: string[],
|
|
111
|
+
fsAdapter?: FileSystemAdapter,
|
|
112
|
+
): Promise<string> {
|
|
113
|
+
const result: ValidationResult = await validatePath(requestedPath, {
|
|
114
|
+
baseDir: skillRoot,
|
|
115
|
+
allowedDirs: allowedSubdirs,
|
|
116
|
+
level: "strict",
|
|
117
|
+
allowAbsolute: false,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
if (!result.valid) {
|
|
121
|
+
throw toError(
|
|
122
|
+
createError({
|
|
123
|
+
type: "agent",
|
|
124
|
+
message: `Skill path validation failed for "${requestedPath}": ${
|
|
125
|
+
result.error ?? "access denied"
|
|
126
|
+
}`,
|
|
127
|
+
}),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const canonicalPath = result.canonicalPath!;
|
|
132
|
+
|
|
133
|
+
// Verify the path exists and points to a file.
|
|
134
|
+
if (!(await pathExists(canonicalPath, fsAdapter))) {
|
|
135
|
+
throw toError(
|
|
136
|
+
createError({
|
|
137
|
+
type: "agent",
|
|
138
|
+
message: `File not found: "${requestedPath}" in skill directory`,
|
|
139
|
+
}),
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
await assertIsFile(canonicalPath, fsAdapter);
|
|
143
|
+
|
|
144
|
+
// Enforce strict no-symlink policy for skill files.
|
|
145
|
+
if (await hasSymlinkInPath(skillRoot, canonicalPath, fsAdapter)) {
|
|
146
|
+
throw toError(
|
|
147
|
+
createError({
|
|
148
|
+
type: "agent",
|
|
149
|
+
message: `Skill path contains a symlink and is not allowed: "${requestedPath}"`,
|
|
150
|
+
}),
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Defense-in-depth: local realpath check to block symlink escapes.
|
|
155
|
+
if (!fsAdapter) {
|
|
156
|
+
const [realRoot, realTarget] = await Promise.all([
|
|
157
|
+
resolveLocalRealPath(skillRoot),
|
|
158
|
+
resolveLocalRealPath(canonicalPath),
|
|
159
|
+
]);
|
|
160
|
+
if (!isInsideDir(realRoot, realTarget)) {
|
|
161
|
+
throw toError(
|
|
162
|
+
createError({
|
|
163
|
+
type: "agent",
|
|
164
|
+
message: `Skill path escapes root directory via symlink: "${requestedPath}"`,
|
|
165
|
+
}),
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return canonicalPath;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* List files in a skill subdirectory.
|
|
175
|
+
*
|
|
176
|
+
* @param skillRoot - Absolute path to the skill directory
|
|
177
|
+
* @param subdir - Subdirectory name (e.g. "references", "scripts")
|
|
178
|
+
* @param fsAdapter - Optional file system adapter for VFS/cloud-backed projects
|
|
179
|
+
* @returns Array of relative paths like "references/filename.md"
|
|
180
|
+
*/
|
|
181
|
+
export async function listSkillSubdir(
|
|
182
|
+
skillRoot: string,
|
|
183
|
+
subdir: string,
|
|
184
|
+
fsAdapter?: FileSystemAdapter,
|
|
185
|
+
): Promise<string[]> {
|
|
186
|
+
const dirPath = join(skillRoot, subdir);
|
|
187
|
+
|
|
188
|
+
const dirExists = fsAdapter ? await fsAdapter.exists(dirPath) : await exists(dirPath);
|
|
189
|
+
if (!dirExists) {
|
|
190
|
+
return [];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const files: string[] = [];
|
|
194
|
+
const entries = fsAdapter ? fsAdapter.readDir(dirPath) : readDir(dirPath);
|
|
195
|
+
|
|
196
|
+
for await (const entry of entries) {
|
|
197
|
+
if (entry.isFile) {
|
|
198
|
+
files.push(`${subdir}/${entry.name}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return files;
|
|
203
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Prompt Augmentation
|
|
3
|
+
*
|
|
4
|
+
* Builds the skill manifest section that gets appended to agent system prompts.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { Skill } from "./types.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Build the skill manifest prompt section for an agent's system prompt.
|
|
13
|
+
*
|
|
14
|
+
* Lists all available skills with their descriptions and instructions
|
|
15
|
+
* on how to use the skill tools (load-skill, load-skill-reference, execute-skill-script).
|
|
16
|
+
*
|
|
17
|
+
* @param skills - Map of resolved skills for the agent
|
|
18
|
+
* @returns Prompt section string, or empty string if no skills
|
|
19
|
+
*/
|
|
20
|
+
export function buildSkillManifestPrompt(skills: Map<string, Skill>): string {
|
|
21
|
+
if (skills.size === 0) return "";
|
|
22
|
+
|
|
23
|
+
const lines: string[] = [
|
|
24
|
+
"## Available Skills",
|
|
25
|
+
"",
|
|
26
|
+
"You have access to skills via tool calling. IMPORTANT: You MUST call the load-skill tool (not write it as text) to activate a skill before performing skill-related tasks.",
|
|
27
|
+
"",
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
for (const [id, skill] of skills) {
|
|
31
|
+
lines.push(`- **${id}**: ${skill.metadata.description}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
lines.push("");
|
|
35
|
+
lines.push("### Skill Tools (call these as tools, never write them as text)");
|
|
36
|
+
lines.push("");
|
|
37
|
+
lines.push(
|
|
38
|
+
"- load-skill: Call with { skillId } to load a skill's full instructions and available references/scripts",
|
|
39
|
+
);
|
|
40
|
+
lines.push(
|
|
41
|
+
"- load-skill-reference: Call with { skillId, reference } to read a reference file from the skill",
|
|
42
|
+
);
|
|
43
|
+
lines.push(
|
|
44
|
+
"- execute-skill-script: Call with { skillId, script, args?, env?, timeoutMs? } to execute a script",
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return lines.join("\n");
|
|
48
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Registry
|
|
3
|
+
*
|
|
4
|
+
* Project-scoped registry for discovered skills.
|
|
5
|
+
* Follows the same pattern as src/tool/registry.ts.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { Skill } from "./types.js";
|
|
11
|
+
import { ProjectScopedRegistryManager } from "../ai/registry-manager.js";
|
|
12
|
+
import { ScopedRegistryFacade } from "../ai/registry-facade.js";
|
|
13
|
+
|
|
14
|
+
const skillManager = new ProjectScopedRegistryManager<Skill>("skill");
|
|
15
|
+
|
|
16
|
+
class SkillRegistryClass extends ScopedRegistryFacade<Skill> {
|
|
17
|
+
/**
|
|
18
|
+
* Resolve skills for an agent configuration.
|
|
19
|
+
*
|
|
20
|
+
* @param skillsConfig - `true` for all skills, or array of specific skill IDs
|
|
21
|
+
* @returns Map of resolved skills (missing IDs are silently skipped)
|
|
22
|
+
*/
|
|
23
|
+
resolveForAgent(skillsConfig: true | string[]): Map<string, Skill> {
|
|
24
|
+
if (skillsConfig === true) {
|
|
25
|
+
return this.getAll();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const result = new Map<string, Skill>();
|
|
29
|
+
for (const id of skillsConfig) {
|
|
30
|
+
const skill = this.get(id);
|
|
31
|
+
if (skill) {
|
|
32
|
+
result.set(id, skill);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const skillRegistry = new SkillRegistryClass(skillManager);
|
|
40
|
+
|
|
41
|
+
export function registerSkill(id: string, skill: Skill): void {
|
|
42
|
+
skillRegistry.register(id, skill);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function getSkill(id: string): Skill | undefined {
|
|
46
|
+
return skillRegistry.get(id);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function getAllSkills(): Map<string, Skill> {
|
|
50
|
+
return skillRegistry.getAll();
|
|
51
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Tools
|
|
3
|
+
*
|
|
4
|
+
* Three tools exposed to agents for interacting with skills:
|
|
5
|
+
* - load-skill: Load a skill's full instructions
|
|
6
|
+
* - load-skill-reference: Read a reference file from a skill
|
|
7
|
+
* - execute-skill-script: Execute a script from a skill
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import { tool } from "../tool/factory.js";
|
|
14
|
+
import type { Tool } from "../tool/index.js";
|
|
15
|
+
import { readTextFile } from "../platform/compat/fs.js";
|
|
16
|
+
import { join } from "../platform/compat/path/index.js";
|
|
17
|
+
import { createError, toError } from "../errors/veryfront-error.js";
|
|
18
|
+
import { skillRegistry } from "./registry.js";
|
|
19
|
+
import { parseSkillFrontmatter } from "./parser.js";
|
|
20
|
+
import { listSkillSubdir, validateSkillPath } from "./path-safety.js";
|
|
21
|
+
import { getSkillScriptExecutor } from "./executor.js";
|
|
22
|
+
import type { Skill, SkillContent } from "./types.js";
|
|
23
|
+
import {
|
|
24
|
+
SKILL_ASSETS_DIR,
|
|
25
|
+
SKILL_MD_FILENAME,
|
|
26
|
+
SKILL_REFERENCES_DIR,
|
|
27
|
+
SKILL_SCRIPTS_DIR,
|
|
28
|
+
} from "./types.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Read a file from a skill directory.
|
|
32
|
+
* Uses skill.fsAdapter if available (VFS/cloud), otherwise falls back to compat readTextFile.
|
|
33
|
+
*/
|
|
34
|
+
async function readSkillFile(skill: Skill, path: string): Promise<string> {
|
|
35
|
+
if (skill.fsAdapter) {
|
|
36
|
+
return await skill.fsAdapter.readFile(path);
|
|
37
|
+
}
|
|
38
|
+
return await readTextFile(path);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Create the load-skill tool.
|
|
43
|
+
* Loads a skill's full instructions, available references, and scripts.
|
|
44
|
+
*/
|
|
45
|
+
export function createLoadSkillTool(): Tool {
|
|
46
|
+
return tool({
|
|
47
|
+
id: "load-skill",
|
|
48
|
+
description: "Load a skill's full instructions. Returns the skill's markdown instructions, " +
|
|
49
|
+
"allowed tools policy, and lists of available reference files and scripts.",
|
|
50
|
+
inputSchema: z.object({
|
|
51
|
+
skillId: z.string().describe("The ID of the skill to load"),
|
|
52
|
+
}),
|
|
53
|
+
execute: async (input): Promise<SkillContent> => {
|
|
54
|
+
const skill = skillRegistry.get(input.skillId);
|
|
55
|
+
if (!skill) {
|
|
56
|
+
const available = skillRegistry.getAllIds().join(", ");
|
|
57
|
+
throw toError(
|
|
58
|
+
createError({
|
|
59
|
+
type: "agent",
|
|
60
|
+
message: `Skill "${input.skillId}" not found. Available skills: ${available || "none"}`,
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Read SKILL.md
|
|
66
|
+
const skillMdPath = join(skill.rootPath, SKILL_MD_FILENAME);
|
|
67
|
+
const content = await readSkillFile(skill, skillMdPath);
|
|
68
|
+
|
|
69
|
+
// Parse frontmatter to get instructions
|
|
70
|
+
const parsed = await parseSkillFrontmatter(content);
|
|
71
|
+
|
|
72
|
+
// List available references and scripts
|
|
73
|
+
const references = await listSkillSubdir(
|
|
74
|
+
skill.rootPath,
|
|
75
|
+
SKILL_REFERENCES_DIR,
|
|
76
|
+
skill.fsAdapter,
|
|
77
|
+
);
|
|
78
|
+
const scripts = await listSkillSubdir(
|
|
79
|
+
skill.rootPath,
|
|
80
|
+
SKILL_SCRIPTS_DIR,
|
|
81
|
+
skill.fsAdapter,
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
instructions: parsed.body,
|
|
86
|
+
allowedTools: skill.metadata.allowedTools,
|
|
87
|
+
references,
|
|
88
|
+
scripts,
|
|
89
|
+
...(scripts.length === 0 && references.length === 0
|
|
90
|
+
? {
|
|
91
|
+
note:
|
|
92
|
+
"This skill has no scripts or reference files. Do NOT call execute-skill-script or load-skill-reference.",
|
|
93
|
+
}
|
|
94
|
+
: scripts.length === 0
|
|
95
|
+
? { note: "This skill has no scripts. Do NOT call execute-skill-script." }
|
|
96
|
+
: references.length === 0
|
|
97
|
+
? { note: "This skill has no reference files. Do NOT call load-skill-reference." }
|
|
98
|
+
: {}),
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Create the load-skill-reference tool.
|
|
106
|
+
* Reads a reference file from a skill's references/ or assets/ directory.
|
|
107
|
+
*/
|
|
108
|
+
export function createLoadSkillReferenceTool(): Tool {
|
|
109
|
+
return tool({
|
|
110
|
+
id: "load-skill-reference",
|
|
111
|
+
description: "Read a reference file from a skill. Only files in the skill's " +
|
|
112
|
+
"references/ and assets/ directories are accessible.",
|
|
113
|
+
inputSchema: z.object({
|
|
114
|
+
skillId: z.string().describe("The ID of the skill"),
|
|
115
|
+
reference: z.string().describe(
|
|
116
|
+
"Relative path to the reference file (e.g. 'references/CLAUSES.md')",
|
|
117
|
+
),
|
|
118
|
+
}),
|
|
119
|
+
execute: async (input): Promise<{ content: string; path: string }> => {
|
|
120
|
+
const skill = skillRegistry.get(input.skillId);
|
|
121
|
+
if (!skill) {
|
|
122
|
+
throw toError(
|
|
123
|
+
createError({
|
|
124
|
+
type: "agent",
|
|
125
|
+
message: `Skill "${input.skillId}" not found`,
|
|
126
|
+
}),
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Validate path safety (only references/ and assets/ allowed)
|
|
131
|
+
const validatedPath = await validateSkillPath(
|
|
132
|
+
skill.rootPath,
|
|
133
|
+
input.reference,
|
|
134
|
+
[SKILL_REFERENCES_DIR, SKILL_ASSETS_DIR],
|
|
135
|
+
skill.fsAdapter,
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
const content = await readSkillFile(skill, validatedPath);
|
|
139
|
+
return { content, path: input.reference };
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Create the execute-skill-script tool.
|
|
146
|
+
* Executes a script from a skill's scripts/ directory.
|
|
147
|
+
*/
|
|
148
|
+
export function createExecuteSkillScriptTool(): Tool {
|
|
149
|
+
return tool({
|
|
150
|
+
id: "execute-skill-script",
|
|
151
|
+
description:
|
|
152
|
+
"Execute a script from a skill's scripts/ directory. Returns stdout, stderr, and exit code.",
|
|
153
|
+
inputSchema: z.object({
|
|
154
|
+
skillId: z.string().describe("The ID of the skill"),
|
|
155
|
+
script: z.string().describe("Relative path to the script (e.g. 'scripts/setup.sh')"),
|
|
156
|
+
args: z.array(z.string()).optional().describe("Arguments to pass to the script"),
|
|
157
|
+
env: z.record(z.string()).optional().describe("Environment variables for the script"),
|
|
158
|
+
timeoutMs: z
|
|
159
|
+
.number()
|
|
160
|
+
.int()
|
|
161
|
+
.positive()
|
|
162
|
+
.max(300_000)
|
|
163
|
+
.optional()
|
|
164
|
+
.describe("Optional execution timeout in milliseconds (max 300000)"),
|
|
165
|
+
}),
|
|
166
|
+
execute: async (input) => {
|
|
167
|
+
const skill = skillRegistry.get(input.skillId);
|
|
168
|
+
if (!skill) {
|
|
169
|
+
throw toError(
|
|
170
|
+
createError({
|
|
171
|
+
type: "agent",
|
|
172
|
+
message: `Skill "${input.skillId}" not found`,
|
|
173
|
+
}),
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Validate path safety (only scripts/ allowed)
|
|
178
|
+
const validatedPath = await validateSkillPath(
|
|
179
|
+
skill.rootPath,
|
|
180
|
+
input.script,
|
|
181
|
+
[SKILL_SCRIPTS_DIR],
|
|
182
|
+
skill.fsAdapter,
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
const scriptContent = await readSkillFile(skill, validatedPath);
|
|
186
|
+
const executor = getSkillScriptExecutor();
|
|
187
|
+
return await executor.execute({
|
|
188
|
+
scriptPath: validatedPath,
|
|
189
|
+
scriptContent,
|
|
190
|
+
args: input.args,
|
|
191
|
+
env: input.env,
|
|
192
|
+
cwd: skill.rootPath,
|
|
193
|
+
timeoutMs: input.timeoutMs,
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill type definitions
|
|
3
|
+
*
|
|
4
|
+
* Follows the agentskills.io specification.
|
|
5
|
+
* Pure type/const file — no runtime dependencies.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { FileSystemAdapter } from "../platform/adapters/base.js";
|
|
11
|
+
|
|
12
|
+
// ── Constants ───────────────────────────────────────────────────────────
|
|
13
|
+
|
|
14
|
+
/** Valid skill name: lowercase alphanumeric + hyphens, 1-64 chars */
|
|
15
|
+
export const SKILL_NAME_REGEX = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
16
|
+
|
|
17
|
+
/** Valid allowed-tool pattern: exact ID or prefix wildcard (e.g. "api:*") */
|
|
18
|
+
export const SKILL_ALLOWED_TOOL_PATTERN_REGEX =
|
|
19
|
+
/^[A-Za-z][A-Za-z0-9._-]*(:[A-Za-z][A-Za-z0-9._-]*)*(:\*)?$/;
|
|
20
|
+
|
|
21
|
+
/** Maximum description length in characters */
|
|
22
|
+
export const SKILL_DESCRIPTION_MAX_LENGTH = 1024;
|
|
23
|
+
|
|
24
|
+
/** Standard SKILL.md filename per agentskills.io spec */
|
|
25
|
+
export const SKILL_MD_FILENAME = "SKILL.md";
|
|
26
|
+
|
|
27
|
+
/** Tool IDs that belong to the skill system (single source of truth) */
|
|
28
|
+
export const SKILL_TOOL_IDS = new Set([
|
|
29
|
+
"load-skill",
|
|
30
|
+
"load-skill-reference",
|
|
31
|
+
"execute-skill-script",
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
/** Conventional subdirectory names */
|
|
35
|
+
export const SKILL_SCRIPTS_DIR = "scripts";
|
|
36
|
+
export const SKILL_REFERENCES_DIR = "references";
|
|
37
|
+
export const SKILL_ASSETS_DIR = "assets";
|
|
38
|
+
|
|
39
|
+
// ── Interfaces ──────────────────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
/** Parsed frontmatter metadata from SKILL.md */
|
|
42
|
+
export interface SkillMetadata {
|
|
43
|
+
/** Skill identifier (lowercase, hyphenated) */
|
|
44
|
+
name: string;
|
|
45
|
+
/** Human-readable description */
|
|
46
|
+
description: string;
|
|
47
|
+
/** Tool access restrictions (space-delimited in YAML, parsed to array) */
|
|
48
|
+
allowedTools?: string[];
|
|
49
|
+
/** SPDX license identifier */
|
|
50
|
+
license?: string;
|
|
51
|
+
/** Compatibility constraints */
|
|
52
|
+
compatibility?: string;
|
|
53
|
+
/** Arbitrary key-value metadata */
|
|
54
|
+
metadata?: Record<string, string>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Full skill content returned by load-skill tool */
|
|
58
|
+
export interface SkillContent {
|
|
59
|
+
/** Markdown instructions (body after frontmatter) */
|
|
60
|
+
instructions: string;
|
|
61
|
+
/** Tool access restrictions from frontmatter */
|
|
62
|
+
allowedTools?: string[];
|
|
63
|
+
/** Available reference file paths */
|
|
64
|
+
references: string[];
|
|
65
|
+
/** Available script file paths */
|
|
66
|
+
scripts: string[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Registered skill instance */
|
|
70
|
+
export interface Skill {
|
|
71
|
+
/** Unique skill ID (matches directory name) */
|
|
72
|
+
id: string;
|
|
73
|
+
/** Parsed frontmatter metadata */
|
|
74
|
+
metadata: SkillMetadata;
|
|
75
|
+
/** Absolute path to the skill directory */
|
|
76
|
+
rootPath: string;
|
|
77
|
+
/** Optional filesystem adapter for VFS/cloud-backed projects */
|
|
78
|
+
fsAdapter?: FileSystemAdapter;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Result from executing a skill script */
|
|
82
|
+
export interface SkillScriptResult {
|
|
83
|
+
stdout: string;
|
|
84
|
+
stderr: string;
|
|
85
|
+
exitCode: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Input for the script executor */
|
|
89
|
+
export interface SkillScriptExecutorInput {
|
|
90
|
+
scriptPath: string;
|
|
91
|
+
scriptContent?: string;
|
|
92
|
+
args?: string[];
|
|
93
|
+
env?: Record<string, string>;
|
|
94
|
+
cwd?: string;
|
|
95
|
+
timeoutMs?: number;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Script executor interface */
|
|
99
|
+
export interface SkillScriptExecutor {
|
|
100
|
+
execute(input: SkillScriptExecutorInput): Promise<SkillScriptResult>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Active skill context for runtime policy tracking */
|
|
104
|
+
export interface ActiveSkillContext {
|
|
105
|
+
skillId: string;
|
|
106
|
+
allowedTools?: string[];
|
|
107
|
+
}
|