@vurb/core 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +677 -0
- package/dist/cli/args.d.ts +26 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +117 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/commands/create.d.ts +11 -0
- package/dist/cli/commands/create.d.ts.map +1 -0
- package/dist/cli/commands/create.js +121 -0
- package/dist/cli/commands/create.js.map +1 -0
- package/dist/cli/commands/deploy.d.ts +3 -0
- package/dist/cli/commands/deploy.d.ts.map +1 -0
- package/dist/cli/commands/deploy.js +268 -0
- package/dist/cli/commands/deploy.js.map +1 -0
- package/dist/cli/commands/dev.d.ts +9 -0
- package/dist/cli/commands/dev.d.ts.map +1 -0
- package/dist/cli/commands/dev.js +58 -0
- package/dist/cli/commands/dev.js.map +1 -0
- package/dist/cli/commands/lock.d.ts +5 -0
- package/dist/cli/commands/lock.d.ts.map +1 -0
- package/dist/cli/commands/lock.js +94 -0
- package/dist/cli/commands/lock.js.map +1 -0
- package/dist/cli/commands/remote.d.ts +3 -0
- package/dist/cli/commands/remote.d.ts.map +1 -0
- package/dist/cli/commands/remote.js +37 -0
- package/dist/cli/commands/remote.js.map +1 -0
- package/dist/cli/constants.d.ts +18 -0
- package/dist/cli/constants.d.ts.map +1 -0
- package/dist/cli/constants.js +95 -0
- package/dist/cli/constants.js.map +1 -0
- package/dist/cli/progress.d.ts +34 -0
- package/dist/cli/progress.d.ts.map +1 -0
- package/dist/cli/progress.js +102 -0
- package/dist/cli/progress.js.map +1 -0
- package/dist/cli/rc.d.ts +11 -0
- package/dist/cli/rc.d.ts.map +1 -0
- package/dist/cli/rc.js +75 -0
- package/dist/cli/rc.js.map +1 -0
- package/dist/cli/registry.d.ts +25 -0
- package/dist/cli/registry.d.ts.map +1 -0
- package/dist/cli/registry.js +86 -0
- package/dist/cli/registry.js.map +1 -0
- package/dist/cli/scaffold.d.ts +10 -0
- package/dist/cli/scaffold.d.ts.map +1 -0
- package/dist/cli/scaffold.js +105 -0
- package/dist/cli/scaffold.js.map +1 -0
- package/dist/cli/templates/config.d.ts +14 -0
- package/dist/cli/templates/config.d.ts.map +1 -0
- package/dist/cli/templates/config.js +133 -0
- package/dist/cli/templates/config.js.map +1 -0
- package/dist/cli/templates/constants.d.ts +9 -0
- package/dist/cli/templates/constants.d.ts.map +1 -0
- package/dist/cli/templates/constants.js +9 -0
- package/dist/cli/templates/constants.js.map +1 -0
- package/dist/cli/templates/core.d.ts +14 -0
- package/dist/cli/templates/core.d.ts.map +1 -0
- package/dist/cli/templates/core.js +186 -0
- package/dist/cli/templates/core.js.map +1 -0
- package/dist/cli/templates/cursor.d.ts +8 -0
- package/dist/cli/templates/cursor.d.ts.map +1 -0
- package/dist/cli/templates/cursor.js +13 -0
- package/dist/cli/templates/cursor.js.map +1 -0
- package/dist/cli/templates/index.d.ts +17 -0
- package/dist/cli/templates/index.d.ts.map +1 -0
- package/dist/cli/templates/index.js +27 -0
- package/dist/cli/templates/index.js.map +1 -0
- package/dist/cli/templates/middleware.d.ts +7 -0
- package/dist/cli/templates/middleware.d.ts.map +1 -0
- package/dist/cli/templates/middleware.js +34 -0
- package/dist/cli/templates/middleware.js.map +1 -0
- package/dist/cli/templates/presenter.d.ts +7 -0
- package/dist/cli/templates/presenter.d.ts.map +1 -0
- package/dist/cli/templates/presenter.js +46 -0
- package/dist/cli/templates/presenter.js.map +1 -0
- package/dist/cli/templates/prompt.d.ts +7 -0
- package/dist/cli/templates/prompt.d.ts.map +1 -0
- package/dist/cli/templates/prompt.js +42 -0
- package/dist/cli/templates/prompt.js.map +1 -0
- package/dist/cli/templates/readme.d.ts +8 -0
- package/dist/cli/templates/readme.d.ts.map +1 -0
- package/dist/cli/templates/readme.js +173 -0
- package/dist/cli/templates/readme.js.map +1 -0
- package/dist/cli/templates/testing.d.ts +11 -0
- package/dist/cli/templates/testing.d.ts.map +1 -0
- package/dist/cli/templates/testing.js +101 -0
- package/dist/cli/templates/testing.js.map +1 -0
- package/dist/cli/templates/tools.d.ts +13 -0
- package/dist/cli/templates/tools.d.ts.map +1 -0
- package/dist/cli/templates/tools.js +63 -0
- package/dist/cli/templates/tools.js.map +1 -0
- package/dist/cli/templates/vectors/database.d.ts +9 -0
- package/dist/cli/templates/vectors/database.d.ts.map +1 -0
- package/dist/cli/templates/vectors/database.js +82 -0
- package/dist/cli/templates/vectors/database.js.map +1 -0
- package/dist/cli/templates/vectors/index.d.ts +9 -0
- package/dist/cli/templates/vectors/index.d.ts.map +1 -0
- package/dist/cli/templates/vectors/index.js +9 -0
- package/dist/cli/templates/vectors/index.js.map +1 -0
- package/dist/cli/templates/vectors/oauth.d.ts +10 -0
- package/dist/cli/templates/vectors/oauth.d.ts.map +1 -0
- package/dist/cli/templates/vectors/oauth.js +76 -0
- package/dist/cli/templates/vectors/oauth.js.map +1 -0
- package/dist/cli/templates/vectors/openapi.d.ts +10 -0
- package/dist/cli/templates/vectors/openapi.d.ts.map +1 -0
- package/dist/cli/templates/vectors/openapi.js +106 -0
- package/dist/cli/templates/vectors/openapi.js.map +1 -0
- package/dist/cli/templates/vectors/workflow.d.ts +7 -0
- package/dist/cli/templates/vectors/workflow.d.ts.map +1 -0
- package/dist/cli/templates/vectors/workflow.js +49 -0
- package/dist/cli/templates/vectors/workflow.js.map +1 -0
- package/dist/cli/types.d.ts +36 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +10 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/utils.d.ts +27 -0
- package/dist/cli/utils.d.ts.map +1 -0
- package/dist/cli/utils.js +73 -0
- package/dist/cli/utils.js.map +1 -0
- package/dist/cli/vurb.d.ts +15 -0
- package/dist/cli/vurb.d.ts.map +1 -0
- package/dist/cli/vurb.js +87 -0
- package/dist/cli/vurb.js.map +1 -0
- package/dist/client/InferRouter.d.ts +92 -0
- package/dist/client/InferRouter.d.ts.map +1 -0
- package/dist/client/InferRouter.js +31 -0
- package/dist/client/InferRouter.js.map +1 -0
- package/dist/client/VurbClient.d.ts +282 -0
- package/dist/client/VurbClient.d.ts.map +1 -0
- package/dist/client/VurbClient.js +287 -0
- package/dist/client/VurbClient.js.map +1 -0
- package/dist/client/createTypedRegistry.d.ts +25 -0
- package/dist/client/createTypedRegistry.d.ts.map +1 -0
- package/dist/client/createTypedRegistry.js +74 -0
- package/dist/client/createTypedRegistry.js.map +1 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +4 -0
- package/dist/client/index.js.map +1 -0
- package/dist/converters/ConverterBase.d.ts +68 -0
- package/dist/converters/ConverterBase.d.ts.map +1 -0
- package/dist/converters/ConverterBase.js +62 -0
- package/dist/converters/ConverterBase.js.map +1 -0
- package/dist/converters/GroupConverter.d.ts +33 -0
- package/dist/converters/GroupConverter.d.ts.map +1 -0
- package/dist/converters/GroupConverter.js +26 -0
- package/dist/converters/GroupConverter.js.map +1 -0
- package/dist/converters/PromptConverter.d.ts +33 -0
- package/dist/converters/PromptConverter.d.ts.map +1 -0
- package/dist/converters/PromptConverter.js +26 -0
- package/dist/converters/PromptConverter.js.map +1 -0
- package/dist/converters/ResourceConverter.d.ts +35 -0
- package/dist/converters/ResourceConverter.d.ts.map +1 -0
- package/dist/converters/ResourceConverter.js +28 -0
- package/dist/converters/ResourceConverter.js.map +1 -0
- package/dist/converters/ToolAnnotationsConverter.d.ts +33 -0
- package/dist/converters/ToolAnnotationsConverter.d.ts.map +1 -0
- package/dist/converters/ToolAnnotationsConverter.js +26 -0
- package/dist/converters/ToolAnnotationsConverter.js.map +1 -0
- package/dist/converters/ToolConverter.d.ts +35 -0
- package/dist/converters/ToolConverter.d.ts.map +1 -0
- package/dist/converters/ToolConverter.js +28 -0
- package/dist/converters/ToolConverter.js.map +1 -0
- package/dist/converters/index.d.ts +7 -0
- package/dist/converters/index.d.ts.map +1 -0
- package/dist/converters/index.js +7 -0
- package/dist/converters/index.js.map +1 -0
- package/dist/core/StandardSchema.d.ts +178 -0
- package/dist/core/StandardSchema.d.ts.map +1 -0
- package/dist/core/StandardSchema.js +174 -0
- package/dist/core/StandardSchema.js.map +1 -0
- package/dist/core/builder/ActionGroupBuilder.d.ts +208 -0
- package/dist/core/builder/ActionGroupBuilder.d.ts.map +1 -0
- package/dist/core/builder/ActionGroupBuilder.js +193 -0
- package/dist/core/builder/ActionGroupBuilder.js.map +1 -0
- package/dist/core/builder/ErrorBuilder.d.ts +59 -0
- package/dist/core/builder/ErrorBuilder.d.ts.map +1 -0
- package/dist/core/builder/ErrorBuilder.js +99 -0
- package/dist/core/builder/ErrorBuilder.js.map +1 -0
- package/dist/core/builder/FluentRouter.d.ts +96 -0
- package/dist/core/builder/FluentRouter.d.ts.map +1 -0
- package/dist/core/builder/FluentRouter.js +116 -0
- package/dist/core/builder/FluentRouter.js.map +1 -0
- package/dist/core/builder/FluentSchemaHelpers.d.ts +237 -0
- package/dist/core/builder/FluentSchemaHelpers.d.ts.map +1 -0
- package/dist/core/builder/FluentSchemaHelpers.js +227 -0
- package/dist/core/builder/FluentSchemaHelpers.js.map +1 -0
- package/dist/core/builder/FluentToolBuilder.d.ts +419 -0
- package/dist/core/builder/FluentToolBuilder.d.ts.map +1 -0
- package/dist/core/builder/FluentToolBuilder.js +643 -0
- package/dist/core/builder/FluentToolBuilder.js.map +1 -0
- package/dist/core/builder/GroupedToolBuilder.d.ts +832 -0
- package/dist/core/builder/GroupedToolBuilder.d.ts.map +1 -0
- package/dist/core/builder/GroupedToolBuilder.js +1306 -0
- package/dist/core/builder/GroupedToolBuilder.js.map +1 -0
- package/dist/core/builder/ParamDescriptors.d.ts +142 -0
- package/dist/core/builder/ParamDescriptors.d.ts.map +1 -0
- package/dist/core/builder/ParamDescriptors.js +164 -0
- package/dist/core/builder/ParamDescriptors.js.map +1 -0
- package/dist/core/builder/ToolDefinitionCompiler.d.ts +37 -0
- package/dist/core/builder/ToolDefinitionCompiler.d.ts.map +1 -0
- package/dist/core/builder/ToolDefinitionCompiler.js +72 -0
- package/dist/core/builder/ToolDefinitionCompiler.js.map +1 -0
- package/dist/core/builder/defineTool.d.ts +180 -0
- package/dist/core/builder/defineTool.d.ts.map +1 -0
- package/dist/core/builder/defineTool.js +164 -0
- package/dist/core/builder/defineTool.js.map +1 -0
- package/dist/core/builder/index.d.ts +13 -0
- package/dist/core/builder/index.d.ts.map +1 -0
- package/dist/core/builder/index.js +13 -0
- package/dist/core/builder/index.js.map +1 -0
- package/dist/core/createGroup.d.ts +140 -0
- package/dist/core/createGroup.d.ts.map +1 -0
- package/dist/core/createGroup.js +144 -0
- package/dist/core/createGroup.js.map +1 -0
- package/dist/core/execution/ConcurrencyGuard.d.ts +103 -0
- package/dist/core/execution/ConcurrencyGuard.d.ts.map +1 -0
- package/dist/core/execution/ConcurrencyGuard.js +147 -0
- package/dist/core/execution/ConcurrencyGuard.js.map +1 -0
- package/dist/core/execution/EgressGuard.d.ts +72 -0
- package/dist/core/execution/EgressGuard.d.ts.map +1 -0
- package/dist/core/execution/EgressGuard.js +163 -0
- package/dist/core/execution/EgressGuard.js.map +1 -0
- package/dist/core/execution/ExecutionPipeline.d.ts +67 -0
- package/dist/core/execution/ExecutionPipeline.d.ts.map +1 -0
- package/dist/core/execution/ExecutionPipeline.js +176 -0
- package/dist/core/execution/ExecutionPipeline.js.map +1 -0
- package/dist/core/execution/MiddlewareCompiler.d.ts +35 -0
- package/dist/core/execution/MiddlewareCompiler.d.ts.map +1 -0
- package/dist/core/execution/MiddlewareCompiler.js +111 -0
- package/dist/core/execution/MiddlewareCompiler.js.map +1 -0
- package/dist/core/execution/MutationSerializer.d.ts +78 -0
- package/dist/core/execution/MutationSerializer.d.ts.map +1 -0
- package/dist/core/execution/MutationSerializer.js +106 -0
- package/dist/core/execution/MutationSerializer.js.map +1 -0
- package/dist/core/execution/PipelineHooks.d.ts +46 -0
- package/dist/core/execution/PipelineHooks.d.ts.map +1 -0
- package/dist/core/execution/PipelineHooks.js +66 -0
- package/dist/core/execution/PipelineHooks.js.map +1 -0
- package/dist/core/execution/ProgressHelper.d.ts +67 -0
- package/dist/core/execution/ProgressHelper.d.ts.map +1 -0
- package/dist/core/execution/ProgressHelper.js +59 -0
- package/dist/core/execution/ProgressHelper.js.map +1 -0
- package/dist/core/execution/ValidationErrorFormatter.d.ts +34 -0
- package/dist/core/execution/ValidationErrorFormatter.d.ts.map +1 -0
- package/dist/core/execution/ValidationErrorFormatter.js +193 -0
- package/dist/core/execution/ValidationErrorFormatter.js.map +1 -0
- package/dist/core/execution/index.d.ts +9 -0
- package/dist/core/execution/index.d.ts.map +1 -0
- package/dist/core/execution/index.js +9 -0
- package/dist/core/execution/index.js.map +1 -0
- package/dist/core/index.d.ts +34 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +29 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/initVurb.d.ts +295 -0
- package/dist/core/initVurb.d.ts.map +1 -0
- package/dist/core/initVurb.js +171 -0
- package/dist/core/initVurb.js.map +1 -0
- package/dist/core/middleware/ContextDerivation.d.ts +124 -0
- package/dist/core/middleware/ContextDerivation.d.ts.map +1 -0
- package/dist/core/middleware/ContextDerivation.js +117 -0
- package/dist/core/middleware/ContextDerivation.js.map +1 -0
- package/dist/core/middleware/index.d.ts +4 -0
- package/dist/core/middleware/index.d.ts.map +1 -0
- package/dist/core/middleware/index.js +3 -0
- package/dist/core/middleware/index.js.map +1 -0
- package/dist/core/registry/ToolFilterEngine.d.ts +27 -0
- package/dist/core/registry/ToolFilterEngine.d.ts.map +1 -0
- package/dist/core/registry/ToolFilterEngine.js +45 -0
- package/dist/core/registry/ToolFilterEngine.js.map +1 -0
- package/dist/core/registry/ToolRegistry.d.ts +259 -0
- package/dist/core/registry/ToolRegistry.d.ts.map +1 -0
- package/dist/core/registry/ToolRegistry.js +343 -0
- package/dist/core/registry/ToolRegistry.js.map +1 -0
- package/dist/core/registry/index.d.ts +4 -0
- package/dist/core/registry/index.d.ts.map +1 -0
- package/dist/core/registry/index.js +3 -0
- package/dist/core/registry/index.js.map +1 -0
- package/dist/core/response.d.ts +289 -0
- package/dist/core/response.d.ts.map +1 -0
- package/dist/core/response.js +286 -0
- package/dist/core/response.js.map +1 -0
- package/dist/core/result.d.ts +93 -0
- package/dist/core/result.d.ts.map +1 -0
- package/dist/core/result.js +66 -0
- package/dist/core/result.js.map +1 -0
- package/dist/core/schema/AnnotationAggregator.d.ts +11 -0
- package/dist/core/schema/AnnotationAggregator.d.ts.map +1 -0
- package/dist/core/schema/AnnotationAggregator.js +40 -0
- package/dist/core/schema/AnnotationAggregator.js.map +1 -0
- package/dist/core/schema/DescriptionGenerator.d.ts +12 -0
- package/dist/core/schema/DescriptionGenerator.d.ts.map +1 -0
- package/dist/core/schema/DescriptionGenerator.js +81 -0
- package/dist/core/schema/DescriptionGenerator.js.map +1 -0
- package/dist/core/schema/SchemaGenerator.d.ts +15 -0
- package/dist/core/schema/SchemaGenerator.d.ts.map +1 -0
- package/dist/core/schema/SchemaGenerator.js +192 -0
- package/dist/core/schema/SchemaGenerator.js.map +1 -0
- package/dist/core/schema/SchemaUtils.d.ts +26 -0
- package/dist/core/schema/SchemaUtils.d.ts.map +1 -0
- package/dist/core/schema/SchemaUtils.js +85 -0
- package/dist/core/schema/SchemaUtils.js.map +1 -0
- package/dist/core/schema/ToonDescriptionGenerator.d.ts +3 -0
- package/dist/core/schema/ToonDescriptionGenerator.d.ts.map +1 -0
- package/dist/core/schema/ToonDescriptionGenerator.js +65 -0
- package/dist/core/schema/ToonDescriptionGenerator.js.map +1 -0
- package/dist/core/schema/index.d.ts +7 -0
- package/dist/core/schema/index.d.ts.map +1 -0
- package/dist/core/schema/index.js +7 -0
- package/dist/core/schema/index.js.map +1 -0
- package/dist/core/serialization/JsonSerializer.d.ts +71 -0
- package/dist/core/serialization/JsonSerializer.d.ts.map +1 -0
- package/dist/core/serialization/JsonSerializer.js +192 -0
- package/dist/core/serialization/JsonSerializer.js.map +1 -0
- package/dist/core/serialization/index.d.ts +7 -0
- package/dist/core/serialization/index.d.ts.map +1 -0
- package/dist/core/serialization/index.js +7 -0
- package/dist/core/serialization/index.js.map +1 -0
- package/dist/core/types.d.ts +303 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +17 -0
- package/dist/core/types.js.map +1 -0
- package/dist/domain/Annotations.d.ts +42 -0
- package/dist/domain/Annotations.d.ts.map +1 -0
- package/dist/domain/Annotations.js +16 -0
- package/dist/domain/Annotations.js.map +1 -0
- package/dist/domain/BaseModel.d.ts +50 -0
- package/dist/domain/BaseModel.d.ts.map +1 -0
- package/dist/domain/BaseModel.js +41 -0
- package/dist/domain/BaseModel.js.map +1 -0
- package/dist/domain/Group.d.ts +99 -0
- package/dist/domain/Group.d.ts.map +1 -0
- package/dist/domain/Group.js +172 -0
- package/dist/domain/Group.js.map +1 -0
- package/dist/domain/GroupItem.d.ts +46 -0
- package/dist/domain/GroupItem.d.ts.map +1 -0
- package/dist/domain/GroupItem.js +58 -0
- package/dist/domain/GroupItem.js.map +1 -0
- package/dist/domain/Icon.d.ts +41 -0
- package/dist/domain/Icon.d.ts.map +1 -0
- package/dist/domain/Icon.js +15 -0
- package/dist/domain/Icon.js.map +1 -0
- package/dist/domain/Prompt.d.ts +49 -0
- package/dist/domain/Prompt.d.ts.map +1 -0
- package/dist/domain/Prompt.js +59 -0
- package/dist/domain/Prompt.js.map +1 -0
- package/dist/domain/PromptArgument.d.ts +23 -0
- package/dist/domain/PromptArgument.d.ts.map +1 -0
- package/dist/domain/PromptArgument.js +27 -0
- package/dist/domain/PromptArgument.js.map +1 -0
- package/dist/domain/Resource.d.ts +37 -0
- package/dist/domain/Resource.d.ts.map +1 -0
- package/dist/domain/Resource.js +39 -0
- package/dist/domain/Resource.js.map +1 -0
- package/dist/domain/Role.d.ts +23 -0
- package/dist/domain/Role.d.ts.map +1 -0
- package/dist/domain/Role.js +24 -0
- package/dist/domain/Role.js.map +1 -0
- package/dist/domain/Tool.d.ts +39 -0
- package/dist/domain/Tool.d.ts.map +1 -0
- package/dist/domain/Tool.js +41 -0
- package/dist/domain/Tool.js.map +1 -0
- package/dist/domain/ToolAnnotations.d.ts +48 -0
- package/dist/domain/ToolAnnotations.d.ts.map +1 -0
- package/dist/domain/ToolAnnotations.js +15 -0
- package/dist/domain/ToolAnnotations.js.map +1 -0
- package/dist/domain/index.d.ts +16 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +13 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/utils.d.ts +6 -0
- package/dist/domain/utils.d.ts.map +1 -0
- package/dist/domain/utils.js +12 -0
- package/dist/domain/utils.js.map +1 -0
- package/dist/edge-stub.d.ts +73 -0
- package/dist/edge-stub.d.ts.map +1 -0
- package/dist/edge-stub.js +83 -0
- package/dist/edge-stub.js.map +1 -0
- package/dist/exposition/ExpositionCompiler.d.ts +66 -0
- package/dist/exposition/ExpositionCompiler.d.ts.map +1 -0
- package/dist/exposition/ExpositionCompiler.js +279 -0
- package/dist/exposition/ExpositionCompiler.js.map +1 -0
- package/dist/exposition/index.d.ts +4 -0
- package/dist/exposition/index.d.ts.map +1 -0
- package/dist/exposition/index.js +2 -0
- package/dist/exposition/index.js.map +1 -0
- package/dist/exposition/types.d.ts +58 -0
- package/dist/exposition/types.d.ts.map +1 -0
- package/dist/exposition/types.js +11 -0
- package/dist/exposition/types.js.map +1 -0
- package/dist/fsm/StateMachineGate.d.ts +294 -0
- package/dist/fsm/StateMachineGate.d.ts.map +1 -0
- package/dist/fsm/StateMachineGate.js +400 -0
- package/dist/fsm/StateMachineGate.js.map +1 -0
- package/dist/index.d.ts +148 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -0
- package/dist/introspection/BehaviorDigest.d.ts +112 -0
- package/dist/introspection/BehaviorDigest.d.ts.map +1 -0
- package/dist/introspection/BehaviorDigest.js +149 -0
- package/dist/introspection/BehaviorDigest.js.map +1 -0
- package/dist/introspection/CapabilityLockfile.d.ts +261 -0
- package/dist/introspection/CapabilityLockfile.d.ts.map +1 -0
- package/dist/introspection/CapabilityLockfile.js +395 -0
- package/dist/introspection/CapabilityLockfile.js.map +1 -0
- package/dist/introspection/ContractAwareSelfHealing.d.ts +90 -0
- package/dist/introspection/ContractAwareSelfHealing.d.ts.map +1 -0
- package/dist/introspection/ContractAwareSelfHealing.js +132 -0
- package/dist/introspection/ContractAwareSelfHealing.js.map +1 -0
- package/dist/introspection/ContractDiff.d.ts +91 -0
- package/dist/introspection/ContractDiff.d.ts.map +1 -0
- package/dist/introspection/ContractDiff.js +466 -0
- package/dist/introspection/ContractDiff.js.map +1 -0
- package/dist/introspection/CryptoAttestation.d.ts +143 -0
- package/dist/introspection/CryptoAttestation.d.ts.map +1 -0
- package/dist/introspection/CryptoAttestation.js +192 -0
- package/dist/introspection/CryptoAttestation.js.map +1 -0
- package/dist/introspection/EntitlementScanner.d.ts +177 -0
- package/dist/introspection/EntitlementScanner.d.ts.map +1 -0
- package/dist/introspection/EntitlementScanner.js +459 -0
- package/dist/introspection/EntitlementScanner.js.map +1 -0
- package/dist/introspection/GovernanceObserver.d.ts +88 -0
- package/dist/introspection/GovernanceObserver.d.ts.map +1 -0
- package/dist/introspection/GovernanceObserver.js +136 -0
- package/dist/introspection/GovernanceObserver.js.map +1 -0
- package/dist/introspection/IntrospectionResource.d.ts +20 -0
- package/dist/introspection/IntrospectionResource.d.ts.map +1 -0
- package/dist/introspection/IntrospectionResource.js +112 -0
- package/dist/introspection/IntrospectionResource.js.map +1 -0
- package/dist/introspection/ManifestCompiler.d.ts +33 -0
- package/dist/introspection/ManifestCompiler.d.ts.map +1 -0
- package/dist/introspection/ManifestCompiler.js +88 -0
- package/dist/introspection/ManifestCompiler.js.map +1 -0
- package/dist/introspection/SemanticProbe.d.ts +207 -0
- package/dist/introspection/SemanticProbe.d.ts.map +1 -0
- package/dist/introspection/SemanticProbe.js +274 -0
- package/dist/introspection/SemanticProbe.js.map +1 -0
- package/dist/introspection/TokenEconomics.d.ts +210 -0
- package/dist/introspection/TokenEconomics.d.ts.map +1 -0
- package/dist/introspection/TokenEconomics.js +292 -0
- package/dist/introspection/TokenEconomics.js.map +1 -0
- package/dist/introspection/ToolContract.d.ts +161 -0
- package/dist/introspection/ToolContract.d.ts.map +1 -0
- package/dist/introspection/ToolContract.js +218 -0
- package/dist/introspection/ToolContract.js.map +1 -0
- package/dist/introspection/canonicalize.d.ts +35 -0
- package/dist/introspection/canonicalize.d.ts.map +1 -0
- package/dist/introspection/canonicalize.js +72 -0
- package/dist/introspection/canonicalize.js.map +1 -0
- package/dist/introspection/index.d.ts +26 -0
- package/dist/introspection/index.d.ts.map +1 -0
- package/dist/introspection/index.js +24 -0
- package/dist/introspection/index.js.map +1 -0
- package/dist/introspection/types.d.ts +120 -0
- package/dist/introspection/types.d.ts.map +1 -0
- package/dist/introspection/types.js +13 -0
- package/dist/introspection/types.js.map +1 -0
- package/dist/observability/DebugObserver.d.ts +185 -0
- package/dist/observability/DebugObserver.d.ts.map +1 -0
- package/dist/observability/DebugObserver.js +102 -0
- package/dist/observability/DebugObserver.js.map +1 -0
- package/dist/observability/TelemetryBus.d.ts +88 -0
- package/dist/observability/TelemetryBus.d.ts.map +1 -0
- package/dist/observability/TelemetryBus.js +463 -0
- package/dist/observability/TelemetryBus.js.map +1 -0
- package/dist/observability/TelemetryEvent.d.ts +177 -0
- package/dist/observability/TelemetryEvent.d.ts.map +1 -0
- package/dist/observability/TelemetryEvent.js +2 -0
- package/dist/observability/TelemetryEvent.js.map +1 -0
- package/dist/observability/Tracing.d.ts +155 -0
- package/dist/observability/Tracing.d.ts.map +1 -0
- package/dist/observability/Tracing.js +67 -0
- package/dist/observability/Tracing.js.map +1 -0
- package/dist/observability/index.d.ts +13 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +12 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/presenter/PostProcessor.d.ts +52 -0
- package/dist/presenter/PostProcessor.d.ts.map +1 -0
- package/dist/presenter/PostProcessor.js +148 -0
- package/dist/presenter/PostProcessor.js.map +1 -0
- package/dist/presenter/Presenter.d.ts +575 -0
- package/dist/presenter/Presenter.d.ts.map +1 -0
- package/dist/presenter/Presenter.js +768 -0
- package/dist/presenter/Presenter.js.map +1 -0
- package/dist/presenter/PresenterValidationError.d.ts +42 -0
- package/dist/presenter/PresenterValidationError.d.ts.map +1 -0
- package/dist/presenter/PresenterValidationError.js +55 -0
- package/dist/presenter/PresenterValidationError.js.map +1 -0
- package/dist/presenter/RedactEngine.d.ts +110 -0
- package/dist/presenter/RedactEngine.d.ts.map +1 -0
- package/dist/presenter/RedactEngine.js +128 -0
- package/dist/presenter/RedactEngine.js.map +1 -0
- package/dist/presenter/ResponseBuilder.d.ts +262 -0
- package/dist/presenter/ResponseBuilder.d.ts.map +1 -0
- package/dist/presenter/ResponseBuilder.js +374 -0
- package/dist/presenter/ResponseBuilder.js.map +1 -0
- package/dist/presenter/SelectUtils.d.ts +78 -0
- package/dist/presenter/SelectUtils.d.ts.map +1 -0
- package/dist/presenter/SelectUtils.js +141 -0
- package/dist/presenter/SelectUtils.js.map +1 -0
- package/dist/presenter/ZodDescriptionExtractor.d.ts +54 -0
- package/dist/presenter/ZodDescriptionExtractor.d.ts.map +1 -0
- package/dist/presenter/ZodDescriptionExtractor.js +131 -0
- package/dist/presenter/ZodDescriptionExtractor.js.map +1 -0
- package/dist/presenter/definePresenter.d.ts +193 -0
- package/dist/presenter/definePresenter.d.ts.map +1 -0
- package/dist/presenter/definePresenter.js +99 -0
- package/dist/presenter/definePresenter.js.map +1 -0
- package/dist/presenter/index.d.ts +21 -0
- package/dist/presenter/index.d.ts.map +1 -0
- package/dist/presenter/index.js +28 -0
- package/dist/presenter/index.js.map +1 -0
- package/dist/presenter/suggest.d.ts +39 -0
- package/dist/presenter/suggest.d.ts.map +1 -0
- package/dist/presenter/suggest.js +41 -0
- package/dist/presenter/suggest.js.map +1 -0
- package/dist/presenter/typeHelpers.d.ts +147 -0
- package/dist/presenter/typeHelpers.d.ts.map +1 -0
- package/dist/presenter/typeHelpers.js +152 -0
- package/dist/presenter/typeHelpers.js.map +1 -0
- package/dist/presenter/ui.d.ts +205 -0
- package/dist/presenter/ui.d.ts.map +1 -0
- package/dist/presenter/ui.js +222 -0
- package/dist/presenter/ui.js.map +1 -0
- package/dist/prompt/CursorCodec.d.ts +43 -0
- package/dist/prompt/CursorCodec.d.ts.map +1 -0
- package/dist/prompt/CursorCodec.js +171 -0
- package/dist/prompt/CursorCodec.js.map +1 -0
- package/dist/prompt/FluentPromptBuilder.d.ts +155 -0
- package/dist/prompt/FluentPromptBuilder.d.ts.map +1 -0
- package/dist/prompt/FluentPromptBuilder.js +195 -0
- package/dist/prompt/FluentPromptBuilder.js.map +1 -0
- package/dist/prompt/HydrationSandbox.d.ts +55 -0
- package/dist/prompt/HydrationSandbox.d.ts.map +1 -0
- package/dist/prompt/HydrationSandbox.js +122 -0
- package/dist/prompt/HydrationSandbox.js.map +1 -0
- package/dist/prompt/PromptExecutionPipeline.d.ts +61 -0
- package/dist/prompt/PromptExecutionPipeline.d.ts.map +1 -0
- package/dist/prompt/PromptExecutionPipeline.js +177 -0
- package/dist/prompt/PromptExecutionPipeline.js.map +1 -0
- package/dist/prompt/PromptMessage.d.ts +133 -0
- package/dist/prompt/PromptMessage.d.ts.map +1 -0
- package/dist/prompt/PromptMessage.js +182 -0
- package/dist/prompt/PromptMessage.js.map +1 -0
- package/dist/prompt/PromptRegistry.d.ts +236 -0
- package/dist/prompt/PromptRegistry.d.ts.map +1 -0
- package/dist/prompt/PromptRegistry.js +399 -0
- package/dist/prompt/PromptRegistry.js.map +1 -0
- package/dist/prompt/definePrompt.d.ts +111 -0
- package/dist/prompt/definePrompt.d.ts.map +1 -0
- package/dist/prompt/definePrompt.js +130 -0
- package/dist/prompt/definePrompt.js.map +1 -0
- package/dist/prompt/index.d.ts +12 -0
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +13 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/prompt/types.d.ts +425 -0
- package/dist/prompt/types.d.ts.map +1 -0
- package/dist/prompt/types.js +19 -0
- package/dist/prompt/types.js.map +1 -0
- package/dist/sandbox/SandboxEngine.d.ts +225 -0
- package/dist/sandbox/SandboxEngine.d.ts.map +1 -0
- package/dist/sandbox/SandboxEngine.js +437 -0
- package/dist/sandbox/SandboxEngine.js.map +1 -0
- package/dist/sandbox/SandboxGuard.d.ts +47 -0
- package/dist/sandbox/SandboxGuard.d.ts.map +1 -0
- package/dist/sandbox/SandboxGuard.js +127 -0
- package/dist/sandbox/SandboxGuard.js.map +1 -0
- package/dist/sandbox/index.d.ts +23 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +26 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/server/DevServer.d.ts +120 -0
- package/dist/server/DevServer.d.ts.map +1 -0
- package/dist/server/DevServer.js +252 -0
- package/dist/server/DevServer.js.map +1 -0
- package/dist/server/ServerAttachment.d.ts +354 -0
- package/dist/server/ServerAttachment.d.ts.map +1 -0
- package/dist/server/ServerAttachment.js +709 -0
- package/dist/server/ServerAttachment.js.map +1 -0
- package/dist/server/ServerResolver.d.ts +24 -0
- package/dist/server/ServerResolver.d.ts.map +1 -0
- package/dist/server/ServerResolver.js +50 -0
- package/dist/server/ServerResolver.js.map +1 -0
- package/dist/server/autoDiscover.d.ts +75 -0
- package/dist/server/autoDiscover.d.ts.map +1 -0
- package/dist/server/autoDiscover.js +164 -0
- package/dist/server/autoDiscover.js.map +1 -0
- package/dist/server/index.d.ts +12 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +11 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/startServer.d.ts +81 -0
- package/dist/server/startServer.d.ts.map +1 -0
- package/dist/server/startServer.js +143 -0
- package/dist/server/startServer.js.map +1 -0
- package/dist/state-sync/CausalEngine.d.ts +28 -0
- package/dist/state-sync/CausalEngine.d.ts.map +1 -0
- package/dist/state-sync/CausalEngine.js +17 -0
- package/dist/state-sync/CausalEngine.js.map +1 -0
- package/dist/state-sync/DescriptionDecorator.d.ts +31 -0
- package/dist/state-sync/DescriptionDecorator.d.ts.map +1 -0
- package/dist/state-sync/DescriptionDecorator.js +38 -0
- package/dist/state-sync/DescriptionDecorator.js.map +1 -0
- package/dist/state-sync/GlobMatcher.d.ts +29 -0
- package/dist/state-sync/GlobMatcher.d.ts.map +1 -0
- package/dist/state-sync/GlobMatcher.js +79 -0
- package/dist/state-sync/GlobMatcher.js.map +1 -0
- package/dist/state-sync/PolicyEngine.d.ts +75 -0
- package/dist/state-sync/PolicyEngine.d.ts.map +1 -0
- package/dist/state-sync/PolicyEngine.js +107 -0
- package/dist/state-sync/PolicyEngine.js.map +1 -0
- package/dist/state-sync/PolicyValidator.d.ts +67 -0
- package/dist/state-sync/PolicyValidator.d.ts.map +1 -0
- package/dist/state-sync/PolicyValidator.js +122 -0
- package/dist/state-sync/PolicyValidator.js.map +1 -0
- package/dist/state-sync/ResponseDecorator.d.ts +33 -0
- package/dist/state-sync/ResponseDecorator.d.ts.map +1 -0
- package/dist/state-sync/ResponseDecorator.js +20 -0
- package/dist/state-sync/ResponseDecorator.js.map +1 -0
- package/dist/state-sync/StateSyncBuilder.d.ts +77 -0
- package/dist/state-sync/StateSyncBuilder.d.ts.map +1 -0
- package/dist/state-sync/StateSyncBuilder.js +129 -0
- package/dist/state-sync/StateSyncBuilder.js.map +1 -0
- package/dist/state-sync/StateSyncLayer.d.ts +107 -0
- package/dist/state-sync/StateSyncLayer.d.ts.map +1 -0
- package/dist/state-sync/StateSyncLayer.js +158 -0
- package/dist/state-sync/StateSyncLayer.js.map +1 -0
- package/dist/state-sync/index.d.ts +27 -0
- package/dist/state-sync/index.d.ts.map +1 -0
- package/dist/state-sync/index.js +27 -0
- package/dist/state-sync/index.js.map +1 -0
- package/dist/state-sync/types.d.ts +174 -0
- package/dist/state-sync/types.d.ts.map +1 -0
- package/dist/state-sync/types.js +17 -0
- package/dist/state-sync/types.js.map +1 -0
- package/dist/testing/MvaMetaSymbol.d.ts +45 -0
- package/dist/testing/MvaMetaSymbol.d.ts.map +1 -0
- package/dist/testing/MvaMetaSymbol.js +34 -0
- package/dist/testing/MvaMetaSymbol.js.map +1 -0
- package/package.json +153 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptConverter.d.ts","sourceRoot":"","sources":["../../src/converters/PromptConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAAsB,mBAAmB,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;CAAG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {} from '../domain/Prompt.js';
|
|
2
|
+
import { ConverterBase } from './ConverterBase.js';
|
|
3
|
+
/**
|
|
4
|
+
* Base class for Prompt converters.
|
|
5
|
+
*
|
|
6
|
+
* Extend this and implement `convertFrom(prompt)` and `convertTo(dto)`.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam T - The target DTO type
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* class MyPromptConverter extends PromptConverterBase<PromptDto> {
|
|
13
|
+
* convertFrom(prompt: Prompt): PromptDto {
|
|
14
|
+
* return { name: prompt.name, args: prompt.promptArguments.length };
|
|
15
|
+
* }
|
|
16
|
+
* convertTo(dto: PromptDto): Prompt {
|
|
17
|
+
* return new Prompt(dto.name);
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @see {@link ConverterBase} for batch conversion methods
|
|
23
|
+
*/
|
|
24
|
+
export class PromptConverterBase extends ConverterBase {
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=PromptConverter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromptConverter.js","sourceRoot":"","sources":["../../src/converters/PromptConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAgB,mBAAuB,SAAQ,aAAwB;CAAG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Resource } from '../domain/Resource.js';
|
|
2
|
+
import { ConverterBase } from './ConverterBase.js';
|
|
3
|
+
/**
|
|
4
|
+
* Type-safe Resource converter contract.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam T - The target DTO type
|
|
7
|
+
* @see {@link ResourceConverterBase} for the base implementation class
|
|
8
|
+
*/
|
|
9
|
+
export type ResourceConverter<T> = ConverterBase<Resource, T>;
|
|
10
|
+
/**
|
|
11
|
+
* Base class for Resource converters.
|
|
12
|
+
*
|
|
13
|
+
* Extend this and implement `convertFrom(resource)` and `convertTo(dto)`.
|
|
14
|
+
*
|
|
15
|
+
* @typeParam T - The target DTO type
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* class MyResourceConverter extends ResourceConverterBase<ResourceDto> {
|
|
20
|
+
* convertFrom(resource: Resource): ResourceDto {
|
|
21
|
+
* return { name: resource.name, uri: resource.uri ?? '' };
|
|
22
|
+
* }
|
|
23
|
+
* convertTo(dto: ResourceDto): Resource {
|
|
24
|
+
* const r = new Resource(dto.name);
|
|
25
|
+
* r.uri = dto.uri;
|
|
26
|
+
* return r;
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see {@link ConverterBase} for batch conversion methods
|
|
32
|
+
*/
|
|
33
|
+
export declare abstract class ResourceConverterBase<T> extends ConverterBase<Resource, T> {
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ResourceConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceConverter.d.ts","sourceRoot":"","sources":["../../src/converters/ResourceConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,qBAAqB,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;CAAG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {} from '../domain/Resource.js';
|
|
2
|
+
import { ConverterBase } from './ConverterBase.js';
|
|
3
|
+
/**
|
|
4
|
+
* Base class for Resource converters.
|
|
5
|
+
*
|
|
6
|
+
* Extend this and implement `convertFrom(resource)` and `convertTo(dto)`.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam T - The target DTO type
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* class MyResourceConverter extends ResourceConverterBase<ResourceDto> {
|
|
13
|
+
* convertFrom(resource: Resource): ResourceDto {
|
|
14
|
+
* return { name: resource.name, uri: resource.uri ?? '' };
|
|
15
|
+
* }
|
|
16
|
+
* convertTo(dto: ResourceDto): Resource {
|
|
17
|
+
* const r = new Resource(dto.name);
|
|
18
|
+
* r.uri = dto.uri;
|
|
19
|
+
* return r;
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @see {@link ConverterBase} for batch conversion methods
|
|
25
|
+
*/
|
|
26
|
+
export class ResourceConverterBase extends ConverterBase {
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=ResourceConverter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceConverter.js","sourceRoot":"","sources":["../../src/converters/ResourceConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,qBAAyB,SAAQ,aAA0B;CAAG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ToolAnnotations } from '../domain/ToolAnnotations.js';
|
|
2
|
+
import { ConverterBase } from './ConverterBase.js';
|
|
3
|
+
/**
|
|
4
|
+
* Type-safe ToolAnnotations converter contract.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam T - The target DTO type
|
|
7
|
+
* @see {@link ToolAnnotationsConverterBase} for the base implementation class
|
|
8
|
+
*/
|
|
9
|
+
export type ToolAnnotationsConverter<T> = ConverterBase<ToolAnnotations, T>;
|
|
10
|
+
/**
|
|
11
|
+
* Base class for ToolAnnotations converters.
|
|
12
|
+
*
|
|
13
|
+
* Extend this and implement `convertFrom(annotations)` and `convertTo(dto)`.
|
|
14
|
+
*
|
|
15
|
+
* @typeParam T - The target DTO type
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* class MyAnnotationsConverter extends ToolAnnotationsConverterBase<McpAnnotations> {
|
|
20
|
+
* convertFrom(ta: ToolAnnotations): McpAnnotations {
|
|
21
|
+
* return { readOnly: ta.readOnlyHint ?? false, destructive: ta.destructiveHint ?? false };
|
|
22
|
+
* }
|
|
23
|
+
* convertTo(mcp: McpAnnotations): ToolAnnotations {
|
|
24
|
+
* return createToolAnnotations({ readOnlyHint: mcp.readOnly, destructiveHint: mcp.destructive });
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @see {@link ConverterBase} for batch conversion methods
|
|
30
|
+
*/
|
|
31
|
+
export declare abstract class ToolAnnotationsConverterBase<T> extends ConverterBase<ToolAnnotations, T> {
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ToolAnnotationsConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolAnnotationsConverter.d.ts","sourceRoot":"","sources":["../../src/converters/ToolAnnotationsConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI,aAAa,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAAsB,4BAA4B,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,eAAe,EAAE,CAAC,CAAC;CAAG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {} from '../domain/ToolAnnotations.js';
|
|
2
|
+
import { ConverterBase } from './ConverterBase.js';
|
|
3
|
+
/**
|
|
4
|
+
* Base class for ToolAnnotations converters.
|
|
5
|
+
*
|
|
6
|
+
* Extend this and implement `convertFrom(annotations)` and `convertTo(dto)`.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam T - The target DTO type
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* class MyAnnotationsConverter extends ToolAnnotationsConverterBase<McpAnnotations> {
|
|
13
|
+
* convertFrom(ta: ToolAnnotations): McpAnnotations {
|
|
14
|
+
* return { readOnly: ta.readOnlyHint ?? false, destructive: ta.destructiveHint ?? false };
|
|
15
|
+
* }
|
|
16
|
+
* convertTo(mcp: McpAnnotations): ToolAnnotations {
|
|
17
|
+
* return createToolAnnotations({ readOnlyHint: mcp.readOnly, destructiveHint: mcp.destructive });
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @see {@link ConverterBase} for batch conversion methods
|
|
23
|
+
*/
|
|
24
|
+
export class ToolAnnotationsConverterBase extends ConverterBase {
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=ToolAnnotationsConverter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolAnnotationsConverter.js","sourceRoot":"","sources":["../../src/converters/ToolAnnotationsConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAgB,4BAAgC,SAAQ,aAAiC;CAAG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Tool } from '../domain/Tool.js';
|
|
2
|
+
import { ConverterBase } from './ConverterBase.js';
|
|
3
|
+
/**
|
|
4
|
+
* Type-safe Tool converter contract.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam T - The target DTO type
|
|
7
|
+
* @see {@link ToolConverterBase} for the base implementation class
|
|
8
|
+
*/
|
|
9
|
+
export type ToolConverter<T> = ConverterBase<Tool, T>;
|
|
10
|
+
/**
|
|
11
|
+
* Base class for Tool converters.
|
|
12
|
+
*
|
|
13
|
+
* Extend this and implement `convertFrom(tool)` and `convertTo(dto)`.
|
|
14
|
+
*
|
|
15
|
+
* @typeParam T - The target DTO type
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* class McpToolConverter extends ToolConverterBase<McpTool> {
|
|
20
|
+
* convertFrom(tool: Tool): McpTool {
|
|
21
|
+
* return { name: tool.name, description: tool.description ?? '' };
|
|
22
|
+
* }
|
|
23
|
+
* convertTo(mcp: McpTool): Tool {
|
|
24
|
+
* const tool = new Tool(mcp.name);
|
|
25
|
+
* tool.description = mcp.description;
|
|
26
|
+
* return tool;
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see {@link ConverterBase} for batch conversion methods
|
|
32
|
+
*/
|
|
33
|
+
export declare abstract class ToolConverterBase<T> extends ConverterBase<Tool, T> {
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ToolConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolConverter.d.ts","sourceRoot":"","sources":["../../src/converters/ToolConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,iBAAiB,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;CAAG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {} from '../domain/Tool.js';
|
|
2
|
+
import { ConverterBase } from './ConverterBase.js';
|
|
3
|
+
/**
|
|
4
|
+
* Base class for Tool converters.
|
|
5
|
+
*
|
|
6
|
+
* Extend this and implement `convertFrom(tool)` and `convertTo(dto)`.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam T - The target DTO type
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* class McpToolConverter extends ToolConverterBase<McpTool> {
|
|
13
|
+
* convertFrom(tool: Tool): McpTool {
|
|
14
|
+
* return { name: tool.name, description: tool.description ?? '' };
|
|
15
|
+
* }
|
|
16
|
+
* convertTo(mcp: McpTool): Tool {
|
|
17
|
+
* const tool = new Tool(mcp.name);
|
|
18
|
+
* tool.description = mcp.description;
|
|
19
|
+
* return tool;
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @see {@link ConverterBase} for batch conversion methods
|
|
25
|
+
*/
|
|
26
|
+
export class ToolConverterBase extends ConverterBase {
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=ToolConverter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolConverter.js","sourceRoot":"","sources":["../../src/converters/ToolConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,iBAAqB,SAAQ,aAAsB;CAAG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ConverterBase } from './ConverterBase.js';
|
|
2
|
+
export { type GroupConverter, GroupConverterBase } from './GroupConverter.js';
|
|
3
|
+
export { type ToolConverter, ToolConverterBase } from './ToolConverter.js';
|
|
4
|
+
export { type PromptConverter, PromptConverterBase } from './PromptConverter.js';
|
|
5
|
+
export { type ResourceConverter, ResourceConverterBase } from './ResourceConverter.js';
|
|
6
|
+
export { type ToolAnnotationsConverter, ToolAnnotationsConverterBase } from './ToolAnnotationsConverter.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/converters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,cAAc,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,KAAK,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,KAAK,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,KAAK,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ConverterBase } from './ConverterBase.js';
|
|
2
|
+
export { GroupConverterBase } from './GroupConverter.js';
|
|
3
|
+
export { ToolConverterBase } from './ToolConverter.js';
|
|
4
|
+
export { PromptConverterBase } from './PromptConverter.js';
|
|
5
|
+
export { ResourceConverterBase } from './ResourceConverter.js';
|
|
6
|
+
export { ToolAnnotationsConverterBase } from './ToolAnnotationsConverter.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/converters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAuB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAsB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAwB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAA0B,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAiC,4BAA4B,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StandardSchema — Universal Schema Abstraction Layer
|
|
3
|
+
*
|
|
4
|
+
* Decouples the Vurb validation engine from Zod specifically,
|
|
5
|
+
* enabling support for any validator that implements the Standard Schema
|
|
6
|
+
* specification (`@standard-schema/spec`).
|
|
7
|
+
*
|
|
8
|
+
* This allows users to choose lighter alternatives:
|
|
9
|
+
* - **Zod** (~14kb min): Full-featured, most popular
|
|
10
|
+
* - **Valibot** (~1kb min via tree-shaking): Ultra-lightweight
|
|
11
|
+
* - **ArkType** (~5kb min): Fastest runtime validation
|
|
12
|
+
* - **TypeBox** (~4kb min): JSON Schema native
|
|
13
|
+
*
|
|
14
|
+
* ## Standard Schema Spec
|
|
15
|
+
*
|
|
16
|
+
* Any object with `~standard` property conforming to:
|
|
17
|
+
* ```typescript
|
|
18
|
+
* interface StandardSchema {
|
|
19
|
+
* '~standard': {
|
|
20
|
+
* version: 1;
|
|
21
|
+
* vendor: string;
|
|
22
|
+
* validate: (value: unknown) => { value: T } | { issues: Issue[] };
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see https://github.com/standard-schema/standard-schema
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* import { toStandardValidator } from 'vurb';
|
|
32
|
+
* import * as v from 'valibot';
|
|
33
|
+
*
|
|
34
|
+
* // Valibot schemas work natively via Standard Schema
|
|
35
|
+
* const schema = v.object({ name: v.string(), age: v.number() });
|
|
36
|
+
* const validator = toStandardValidator(schema);
|
|
37
|
+
*
|
|
38
|
+
* const result = validator.validate({ name: 'Alice', age: 30 });
|
|
39
|
+
* // { success: true, data: { name: 'Alice', age: 30 } }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @module
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* Issue reported by a Standard Schema validator.
|
|
46
|
+
*/
|
|
47
|
+
export interface StandardSchemaIssue {
|
|
48
|
+
readonly message: string;
|
|
49
|
+
readonly path?: readonly (string | number | symbol)[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Standard Schema v1 spec — the universal validator contract.
|
|
53
|
+
*
|
|
54
|
+
* Any schema library implementing this interface can be used with
|
|
55
|
+
* Vurb's validation pipeline.
|
|
56
|
+
*/
|
|
57
|
+
export interface StandardSchemaV1<TInput = unknown, TOutput = TInput> {
|
|
58
|
+
readonly '~standard': {
|
|
59
|
+
readonly version: 1;
|
|
60
|
+
readonly vendor: string;
|
|
61
|
+
readonly validate: (value: TInput) => {
|
|
62
|
+
readonly value: TOutput;
|
|
63
|
+
} | {
|
|
64
|
+
readonly issues: readonly StandardSchemaIssue[];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Infer the output type from a Standard Schema.
|
|
70
|
+
*/
|
|
71
|
+
export type InferStandardOutput<T> = T extends StandardSchemaV1<unknown, infer O> ? O : never;
|
|
72
|
+
/**
|
|
73
|
+
* Vurb's internal validation result.
|
|
74
|
+
*/
|
|
75
|
+
export type ValidationResult<T> = {
|
|
76
|
+
readonly success: true;
|
|
77
|
+
readonly data: T;
|
|
78
|
+
} | {
|
|
79
|
+
readonly success: false;
|
|
80
|
+
readonly issues: readonly StandardSchemaIssue[];
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Universal validator interface used internally by Vurb.
|
|
84
|
+
*
|
|
85
|
+
* Wraps any schema library (Zod, Valibot, ArkType, etc.) into
|
|
86
|
+
* a consistent validation contract.
|
|
87
|
+
*/
|
|
88
|
+
export interface VurbValidator<T = unknown> {
|
|
89
|
+
/** Run validation and return a result (never throws) */
|
|
90
|
+
validate(value: unknown): ValidationResult<T>;
|
|
91
|
+
/** Vendor identifier (e.g. 'zod', 'valibot', 'arktype') */
|
|
92
|
+
readonly vendor: string;
|
|
93
|
+
/** Original schema reference (for introspection) */
|
|
94
|
+
readonly schema: unknown;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create a VurbValidator from a Standard Schema v1 compatible schema.
|
|
98
|
+
*
|
|
99
|
+
* This is the primary entry point for non-Zod validators. Any schema
|
|
100
|
+
* library implementing the Standard Schema spec can be used directly.
|
|
101
|
+
*
|
|
102
|
+
* @param schema - A Standard Schema v1 compatible schema
|
|
103
|
+
* @returns A {@link VurbValidator} wrapping the schema
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* import * as v from 'valibot'; // ~1kb tree-shaken
|
|
108
|
+
*
|
|
109
|
+
* const schema = v.object({ name: v.string() });
|
|
110
|
+
* const validator = toStandardValidator(schema);
|
|
111
|
+
*
|
|
112
|
+
* const ok = validator.validate({ name: 'Alice' });
|
|
113
|
+
* // { success: true, data: { name: 'Alice' } }
|
|
114
|
+
*
|
|
115
|
+
* const err = validator.validate({ name: 42 });
|
|
116
|
+
* // { success: false, issues: [{ message: 'Expected string', path: ['name'] }] }
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare function toStandardValidator<T>(schema: StandardSchemaV1<unknown, T>): VurbValidator<T>;
|
|
120
|
+
/**
|
|
121
|
+
* Create a VurbValidator from a raw Zod schema.
|
|
122
|
+
*
|
|
123
|
+
* This adapter uses Zod's `.safeParse()` method and maps the result
|
|
124
|
+
* to the standard VurbValidator interface.
|
|
125
|
+
*
|
|
126
|
+
* @param schema - A Zod schema (z.object, z.string, etc.)
|
|
127
|
+
* @returns A {@link VurbValidator} wrapping the Zod schema
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* import { z } from 'zod';
|
|
132
|
+
*
|
|
133
|
+
* const schema = z.object({ name: z.string() });
|
|
134
|
+
* const validator = fromZodSchema(schema);
|
|
135
|
+
*
|
|
136
|
+
* const ok = validator.validate({ name: 'Alice' });
|
|
137
|
+
* // { success: true, data: { name: 'Alice' } }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export declare function fromZodSchema<T>(schema: ZodSchemaLike<T>): VurbValidator<T>;
|
|
141
|
+
/**
|
|
142
|
+
* Check if a value implements the Standard Schema v1 spec.
|
|
143
|
+
*
|
|
144
|
+
* @param value - Any value to check
|
|
145
|
+
* @returns `true` if the value has a valid `~standard` property
|
|
146
|
+
*/
|
|
147
|
+
export declare function isStandardSchema(value: unknown): value is StandardSchemaV1;
|
|
148
|
+
/**
|
|
149
|
+
* Auto-detect and create a VurbValidator from any supported schema.
|
|
150
|
+
*
|
|
151
|
+
* Detection order:
|
|
152
|
+
* 1. Standard Schema v1 (Valibot, ArkType, etc.)
|
|
153
|
+
* 2. Zod-like (has `.safeParse()`)
|
|
154
|
+
* 3. Throws if unrecognized
|
|
155
|
+
*
|
|
156
|
+
* @param schema - Any supported schema
|
|
157
|
+
* @returns A {@link VurbValidator}
|
|
158
|
+
* @throws If the schema type is not recognized
|
|
159
|
+
*/
|
|
160
|
+
export declare function autoValidator<T = unknown>(schema: unknown): VurbValidator<T>;
|
|
161
|
+
/** Duck-typed Zod schema interface */
|
|
162
|
+
interface ZodSchemaLike<T = unknown> {
|
|
163
|
+
safeParse(value: unknown): {
|
|
164
|
+
success: true;
|
|
165
|
+
data: unknown;
|
|
166
|
+
} | {
|
|
167
|
+
success: false;
|
|
168
|
+
error: {
|
|
169
|
+
issues: Array<{
|
|
170
|
+
message: string;
|
|
171
|
+
path?: (string | number)[];
|
|
172
|
+
}>;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
parse?(value: unknown): T;
|
|
176
|
+
}
|
|
177
|
+
export {};
|
|
178
|
+
//# sourceMappingURL=StandardSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StandardSchema.d.ts","sourceRoot":"","sources":["../../src/core/StandardSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAIH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACzD;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,MAAM;IAChE,QAAQ,CAAC,WAAW,EAAE;QAClB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;QACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAC3B;YAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;SAAE,GAC3B;YAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAA;SAAE,CAAC;KAC7D,CAAC;CACL;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAI9F;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IACxB;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;CAAE,GAC5C;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAA;CAAE,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IACtC,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC9C,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC5B;AAID;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACjC,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,GACrC,aAAa,CAAC,CAAC,CAAC,CA2BlB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAyB3E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAU1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,CAa5E;AAID,sCAAsC;AACtC,UAAU,aAAa,CAAC,CAAC,GAAG,OAAO;IAC/B,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG;QAAE,OAAO,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE;YAAE,MAAM,EAAE,KAAK,CAAC;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;aAAE,CAAC,CAAA;SAAE,CAAA;KAAE,CAAC;IAC5J,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC;CAC7B"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StandardSchema — Universal Schema Abstraction Layer
|
|
3
|
+
*
|
|
4
|
+
* Decouples the Vurb validation engine from Zod specifically,
|
|
5
|
+
* enabling support for any validator that implements the Standard Schema
|
|
6
|
+
* specification (`@standard-schema/spec`).
|
|
7
|
+
*
|
|
8
|
+
* This allows users to choose lighter alternatives:
|
|
9
|
+
* - **Zod** (~14kb min): Full-featured, most popular
|
|
10
|
+
* - **Valibot** (~1kb min via tree-shaking): Ultra-lightweight
|
|
11
|
+
* - **ArkType** (~5kb min): Fastest runtime validation
|
|
12
|
+
* - **TypeBox** (~4kb min): JSON Schema native
|
|
13
|
+
*
|
|
14
|
+
* ## Standard Schema Spec
|
|
15
|
+
*
|
|
16
|
+
* Any object with `~standard` property conforming to:
|
|
17
|
+
* ```typescript
|
|
18
|
+
* interface StandardSchema {
|
|
19
|
+
* '~standard': {
|
|
20
|
+
* version: 1;
|
|
21
|
+
* vendor: string;
|
|
22
|
+
* validate: (value: unknown) => { value: T } | { issues: Issue[] };
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see https://github.com/standard-schema/standard-schema
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* import { toStandardValidator } from 'vurb';
|
|
32
|
+
* import * as v from 'valibot';
|
|
33
|
+
*
|
|
34
|
+
* // Valibot schemas work natively via Standard Schema
|
|
35
|
+
* const schema = v.object({ name: v.string(), age: v.number() });
|
|
36
|
+
* const validator = toStandardValidator(schema);
|
|
37
|
+
*
|
|
38
|
+
* const result = validator.validate({ name: 'Alice', age: 30 });
|
|
39
|
+
* // { success: true, data: { name: 'Alice', age: 30 } }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @module
|
|
43
|
+
*/
|
|
44
|
+
// ── Adapters ─────────────────────────────────────────────
|
|
45
|
+
/**
|
|
46
|
+
* Create a VurbValidator from a Standard Schema v1 compatible schema.
|
|
47
|
+
*
|
|
48
|
+
* This is the primary entry point for non-Zod validators. Any schema
|
|
49
|
+
* library implementing the Standard Schema spec can be used directly.
|
|
50
|
+
*
|
|
51
|
+
* @param schema - A Standard Schema v1 compatible schema
|
|
52
|
+
* @returns A {@link VurbValidator} wrapping the schema
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import * as v from 'valibot'; // ~1kb tree-shaken
|
|
57
|
+
*
|
|
58
|
+
* const schema = v.object({ name: v.string() });
|
|
59
|
+
* const validator = toStandardValidator(schema);
|
|
60
|
+
*
|
|
61
|
+
* const ok = validator.validate({ name: 'Alice' });
|
|
62
|
+
* // { success: true, data: { name: 'Alice' } }
|
|
63
|
+
*
|
|
64
|
+
* const err = validator.validate({ name: 42 });
|
|
65
|
+
* // { success: false, issues: [{ message: 'Expected string', path: ['name'] }] }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export function toStandardValidator(schema) {
|
|
69
|
+
const spec = schema['~standard'];
|
|
70
|
+
return {
|
|
71
|
+
validate(value) {
|
|
72
|
+
const result = spec.validate(value);
|
|
73
|
+
// Guard: async validators return a Promise, which would silently
|
|
74
|
+
// produce { success: false, issues: undefined } because
|
|
75
|
+
// 'value' in Promise is false. Detect and throw early. (Bug #9 fix)
|
|
76
|
+
if (result != null && typeof result.then === 'function') {
|
|
77
|
+
throw new Error(`[Vurb] Schema validator "${spec.vendor}" returned a Promise. ` +
|
|
78
|
+
'Async validators are not supported — use a synchronous schema. ' +
|
|
79
|
+
'See: https://vurb.vinkius.com/docs/standard-schema');
|
|
80
|
+
}
|
|
81
|
+
if ('value' in result) {
|
|
82
|
+
return { success: true, data: result.value };
|
|
83
|
+
}
|
|
84
|
+
return { success: false, issues: result.issues };
|
|
85
|
+
},
|
|
86
|
+
vendor: spec.vendor,
|
|
87
|
+
schema,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Create a VurbValidator from a raw Zod schema.
|
|
92
|
+
*
|
|
93
|
+
* This adapter uses Zod's `.safeParse()` method and maps the result
|
|
94
|
+
* to the standard VurbValidator interface.
|
|
95
|
+
*
|
|
96
|
+
* @param schema - A Zod schema (z.object, z.string, etc.)
|
|
97
|
+
* @returns A {@link VurbValidator} wrapping the Zod schema
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* import { z } from 'zod';
|
|
102
|
+
*
|
|
103
|
+
* const schema = z.object({ name: z.string() });
|
|
104
|
+
* const validator = fromZodSchema(schema);
|
|
105
|
+
*
|
|
106
|
+
* const ok = validator.validate({ name: 'Alice' });
|
|
107
|
+
* // { success: true, data: { name: 'Alice' } }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export function fromZodSchema(schema) {
|
|
111
|
+
return {
|
|
112
|
+
validate(value) {
|
|
113
|
+
const result = schema.safeParse(value);
|
|
114
|
+
if (result.success) {
|
|
115
|
+
return { success: true, data: result.data };
|
|
116
|
+
}
|
|
117
|
+
// Map Zod errors to StandardSchemaIssue
|
|
118
|
+
const issues = (result.error?.issues ?? []).map((issue) => {
|
|
119
|
+
const mapped = { message: issue.message };
|
|
120
|
+
if (issue.path) {
|
|
121
|
+
mapped.path = issue.path;
|
|
122
|
+
}
|
|
123
|
+
return mapped;
|
|
124
|
+
});
|
|
125
|
+
return { success: false, issues };
|
|
126
|
+
},
|
|
127
|
+
vendor: 'zod',
|
|
128
|
+
schema,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Check if a value implements the Standard Schema v1 spec.
|
|
133
|
+
*
|
|
134
|
+
* @param value - Any value to check
|
|
135
|
+
* @returns `true` if the value has a valid `~standard` property
|
|
136
|
+
*/
|
|
137
|
+
export function isStandardSchema(value) {
|
|
138
|
+
return (typeof value === 'object' &&
|
|
139
|
+
value !== null &&
|
|
140
|
+
'~standard' in value &&
|
|
141
|
+
typeof value['~standard'] === 'object' &&
|
|
142
|
+
value['~standard'] !== null &&
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
144
|
+
value['~standard'].version === 1);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Auto-detect and create a VurbValidator from any supported schema.
|
|
148
|
+
*
|
|
149
|
+
* Detection order:
|
|
150
|
+
* 1. Standard Schema v1 (Valibot, ArkType, etc.)
|
|
151
|
+
* 2. Zod-like (has `.safeParse()`)
|
|
152
|
+
* 3. Throws if unrecognized
|
|
153
|
+
*
|
|
154
|
+
* @param schema - Any supported schema
|
|
155
|
+
* @returns A {@link VurbValidator}
|
|
156
|
+
* @throws If the schema type is not recognized
|
|
157
|
+
*/
|
|
158
|
+
export function autoValidator(schema) {
|
|
159
|
+
if (isStandardSchema(schema)) {
|
|
160
|
+
return toStandardValidator(schema);
|
|
161
|
+
}
|
|
162
|
+
if (isZodLike(schema)) {
|
|
163
|
+
return fromZodSchema(schema);
|
|
164
|
+
}
|
|
165
|
+
throw new Error('Unsupported schema type. Expected a Standard Schema v1 (' +
|
|
166
|
+
'Valibot, ArkType) or Zod schema. See: https://vurb.vinkius.com/docs/standard-schema');
|
|
167
|
+
}
|
|
168
|
+
/** Duck-type check for Zod-like schemas */
|
|
169
|
+
function isZodLike(value) {
|
|
170
|
+
return (typeof value === 'object' &&
|
|
171
|
+
value !== null &&
|
|
172
|
+
typeof value.safeParse === 'function');
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=StandardSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StandardSchema.js","sourceRoot":"","sources":["../../src/core/StandardSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAyDH,4DAA4D;AAE5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,mBAAmB,CAC/B,MAAoC;IAEpC,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAEjC,OAAO;QACH,QAAQ,CAAC,KAAc;YACnB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEpC,iEAAiE;YACjE,wDAAwD;YACxD,oEAAoE;YACpE,IAAI,MAAM,IAAI,IAAI,IAAI,OAAQ,MAAc,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBAC/D,MAAM,IAAI,KAAK,CACX,4BAA4B,IAAI,CAAC,MAAM,wBAAwB;oBAC/D,iEAAiE;oBACjE,oDAAoD,CACvD,CAAC;YACN,CAAC;YAED,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;YACjD,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QACrD,CAAC;QACD,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,MAAM;KACT,CAAC;AACN,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,aAAa,CAAI,MAAwB;IACrD,OAAO;QACH,QAAQ,CAAC,KAAc;YACnB,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAEvC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAS,EAAE,CAAC;YACrD,CAAC;YAED,wCAAwC;YACxC,MAAM,MAAM,GAA0B,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAClE,CAAC,KAAsD,EAAE,EAAE;gBACvD,MAAM,MAAM,GAAwB,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;gBAC/D,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;oBACZ,MAAiD,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;gBACzE,CAAC;gBACD,OAAO,MAAM,CAAC;YAClB,CAAC,CACJ,CAAC;YAEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QACtC,CAAC;QACD,MAAM,EAAE,KAAK;QACb,MAAM;KACT,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC3C,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,WAAW,IAAI,KAAK;QACpB,OAAQ,KAA0B,CAAC,WAAW,CAAC,KAAK,QAAQ;QAC3D,KAA0B,CAAC,WAAW,CAAC,KAAK,IAAI;QACjD,uEAAuE;QACtE,KAA0B,CAAC,WAAW,CAAC,CAAC,OAAO,KAAK,CAAC,CACzD,CAAC;AACN,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAc,MAAe;IACtD,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,mBAAmB,CAAC,MAAsC,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QACpB,OAAO,aAAa,CAAC,MAA0B,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,IAAI,KAAK,CACX,0DAA0D;QAC1D,qFAAqF,CACxF,CAAC;AACN,CAAC;AAUD,2CAA2C;AAC3C,SAAS,SAAS,CAAC,KAAc;IAC7B,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAAuB,CAAC,SAAS,KAAK,UAAU,CAC3D,CAAC;AACN,CAAC"}
|