@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
package/dist/cli/vurb.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Vurb CLI
|
|
4
|
+
*
|
|
5
|
+
* Slim entry point: parses args, dispatches to command modules.
|
|
6
|
+
* All logic lives in focused modules under `./commands/`.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { parseArgs } from './args.js';
|
|
11
|
+
import { HELP } from './constants.js';
|
|
12
|
+
import { commandLock } from './commands/lock.js';
|
|
13
|
+
import { commandDev } from './commands/dev.js';
|
|
14
|
+
import { commandCreate } from './commands/create.js';
|
|
15
|
+
import { commandRemote } from './commands/remote.js';
|
|
16
|
+
import { commandDeploy } from './commands/deploy.js';
|
|
17
|
+
// ─── Re-exports (backward compat — tests import from vurb.js) ──
|
|
18
|
+
export { parseArgs } from './args.js';
|
|
19
|
+
export { VURB_VERSION, HELP, ansi } from './constants.js';
|
|
20
|
+
export { ProgressTracker, createDefaultReporter } from './progress.js';
|
|
21
|
+
export { resolveRegistry } from './registry.js';
|
|
22
|
+
export { collectConfig } from './commands/create.js';
|
|
23
|
+
export { commandLock, commandDev, commandCreate };
|
|
24
|
+
export { ask } from './utils.js';
|
|
25
|
+
// ─── Main ────────────────────────────────────────────────────────
|
|
26
|
+
async function main() {
|
|
27
|
+
const args = parseArgs(process.argv);
|
|
28
|
+
if (args.help || !args.command) {
|
|
29
|
+
console.log(HELP);
|
|
30
|
+
process.exit(args.help ? 0 : 1);
|
|
31
|
+
}
|
|
32
|
+
switch (args.command) {
|
|
33
|
+
case 'create':
|
|
34
|
+
await commandCreate(args);
|
|
35
|
+
break;
|
|
36
|
+
case 'dev':
|
|
37
|
+
await commandDev(args);
|
|
38
|
+
break;
|
|
39
|
+
case 'lock':
|
|
40
|
+
await commandLock(args);
|
|
41
|
+
process.exit(0);
|
|
42
|
+
break;
|
|
43
|
+
case 'deploy':
|
|
44
|
+
await commandDeploy(args);
|
|
45
|
+
process.exit(0);
|
|
46
|
+
break;
|
|
47
|
+
case 'remote':
|
|
48
|
+
await commandRemote(args);
|
|
49
|
+
break;
|
|
50
|
+
case 'inspect':
|
|
51
|
+
case 'insp':
|
|
52
|
+
case 'debug':
|
|
53
|
+
case 'dbg': {
|
|
54
|
+
const inspectArgv = process.argv.slice(3);
|
|
55
|
+
try {
|
|
56
|
+
const { runInspector } = await import('@vurb/inspector');
|
|
57
|
+
await runInspector(inspectArgv);
|
|
58
|
+
}
|
|
59
|
+
catch (importErr) {
|
|
60
|
+
console.error(`\x1b[31m\u2717\x1b[0m The inspector TUI requires the optional package:\n\n` +
|
|
61
|
+
` npm install @vurb/inspector\n`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
default:
|
|
67
|
+
console.error(`Unknown command: "${args.command}"\n`);
|
|
68
|
+
console.log(HELP);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/* c8 ignore next 9 — CLI entry-point guard */
|
|
73
|
+
function detectCLI() {
|
|
74
|
+
if (typeof process === 'undefined' || !process.argv[1])
|
|
75
|
+
return false;
|
|
76
|
+
const base = process.argv[1].replace(/\\/g, '/').split('/').pop() ?? '';
|
|
77
|
+
// Strip extension (.js, .cjs, .mjs, .cmd, .ps1, .exe, etc.)
|
|
78
|
+
const name = base.replace(/\.[a-z0-9]+$/i, '');
|
|
79
|
+
return name === 'vurb';
|
|
80
|
+
}
|
|
81
|
+
if (detectCLI()) {
|
|
82
|
+
main().catch((err) => {
|
|
83
|
+
console.error(`Error: ${err.message}`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=vurb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vurb.js","sourceRoot":"","sources":["../../src/cli/vurb.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,kEAAkE;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,oEAAoE;AAEpE,KAAK,UAAU,IAAI;IACf,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;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C,IAAI,CAAC,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;AACL,CAAC;AAED,8CAA8C;AAC9C,SAAS,SAAS;IACd,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IACxE,4DAA4D;IAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAC/C,OAAO,IAAI,KAAK,MAAM,CAAC;AAC3B,CAAC;AACD,IAAI,SAAS,EAAE,EAAE,CAAC;IACd,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;QACxB,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InferRouter — Compile-Time Router Type Extraction
|
|
3
|
+
*
|
|
4
|
+
* Extracts a fully typed `RouterMap` from a `TypedToolRegistry` or
|
|
5
|
+
* an array of `GroupedToolBuilder` instances. This is the key piece
|
|
6
|
+
* that makes the VurbClient tRPC-style experience real.
|
|
7
|
+
*
|
|
8
|
+
* **Zero runtime cost** — this module contains only type declarations.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // ── SERVER SIDE ──
|
|
13
|
+
* const registry = createTypedRegistry<AppContext>()(
|
|
14
|
+
* projectsTool, // GroupedToolBuilder<AppContext, ..., 'projects', { 'projects.list': ..., ... }>
|
|
15
|
+
* billingTool,
|
|
16
|
+
* );
|
|
17
|
+
* export type AppRouter = InferRouter<typeof registry>;
|
|
18
|
+
*
|
|
19
|
+
* // ── CLIENT SIDE ──
|
|
20
|
+
* import type { AppRouter } from './server';
|
|
21
|
+
* const client = createVurbClient<AppRouter>(transport);
|
|
22
|
+
* await client.execute('projects.list', { workspace_id: 'ws_1' });
|
|
23
|
+
* // ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
|
|
24
|
+
* // autocomplete! typed args!
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @module
|
|
28
|
+
*/
|
|
29
|
+
import { type GroupedToolBuilder } from '../core/builder/GroupedToolBuilder.js';
|
|
30
|
+
import { type ToolRegistry } from '../core/registry/ToolRegistry.js';
|
|
31
|
+
/**
|
|
32
|
+
* A typed wrapper around `ToolRegistry` that preserves builder types
|
|
33
|
+
* for compile-time router inference.
|
|
34
|
+
*
|
|
35
|
+
* Created by {@link createTypedRegistry}. The registry itself stores
|
|
36
|
+
* builders at runtime via a standard `ToolRegistry`, but the `_builders`
|
|
37
|
+
* tuple type is preserved for `InferRouter` extraction.
|
|
38
|
+
*
|
|
39
|
+
* @typeParam TContext - Application context type
|
|
40
|
+
* @typeParam TBuilders - Tuple of registered builder types
|
|
41
|
+
*/
|
|
42
|
+
export interface TypedToolRegistry<TContext, TBuilders extends readonly unknown[]> {
|
|
43
|
+
/** The underlying ToolRegistry instance (for runtime use) */
|
|
44
|
+
readonly registry: ToolRegistry<TContext>;
|
|
45
|
+
/** Branded field for type inference — never accessed at runtime */
|
|
46
|
+
readonly _builders: TBuilders;
|
|
47
|
+
/** Branded phantom type for context inference */
|
|
48
|
+
readonly _context: TContext;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Infer a `RouterMap` from a `TypedToolRegistry`.
|
|
52
|
+
*
|
|
53
|
+
* Extracts the accumulated `TRouterMap` from each builder registered
|
|
54
|
+
* in the typed registry, producing a flat intersection of all
|
|
55
|
+
* `{ 'toolName.actionName': ArgsType }` entries.
|
|
56
|
+
*
|
|
57
|
+
* @typeParam T - A `TypedToolRegistry` instance type
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* const projects = createTool<Ctx>('projects')
|
|
62
|
+
* .action({ name: 'list', schema: z.object({ status: z.string() }), handler: ... })
|
|
63
|
+
* .action({ name: 'create', schema: z.object({ name: z.string() }), handler: ... });
|
|
64
|
+
*
|
|
65
|
+
* const registry = createTypedRegistry<Ctx>()(projects);
|
|
66
|
+
* type AppRouter = InferRouter<typeof registry>;
|
|
67
|
+
* // Result: {
|
|
68
|
+
* // 'projects.list': { status: string };
|
|
69
|
+
* // 'projects.create': { name: string };
|
|
70
|
+
* // }
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export type InferRouter<T> = T extends TypedToolRegistry<infer _TCtx, infer TBuilders> ? InferRouterFromBuilders<TBuilders> : T extends readonly unknown[] ? InferRouterFromBuilders<T> : Record<string, Record<string, unknown>>;
|
|
74
|
+
/**
|
|
75
|
+
* Infer router entries from a tuple of builders.
|
|
76
|
+
*
|
|
77
|
+
* Recursively intersects the `TRouterMap` from each builder in the tuple.
|
|
78
|
+
*
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
type InferRouterFromBuilders<T> = T extends readonly [infer First, ...infer Rest] ? ExtractRouterMap<First> & InferRouterFromBuilders<Rest> : T extends readonly [] ? {} : Record<string, Record<string, unknown>>;
|
|
82
|
+
/**
|
|
83
|
+
* Extract the accumulated `TRouterMap` from a single `GroupedToolBuilder`.
|
|
84
|
+
*
|
|
85
|
+
* The 4th generic parameter of `GroupedToolBuilder<TCtx, TCommon, TName, TRouterMap>`
|
|
86
|
+
* carries the compile-time action map. This type extracts it.
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
type ExtractRouterMap<T> = T extends GroupedToolBuilder<infer _TCtx, infer _TCommon, infer _TName, infer TRouterMap> ? TRouterMap : Record<string, Record<string, unknown>>;
|
|
91
|
+
export {};
|
|
92
|
+
//# sourceMappingURL=InferRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InferRouter.d.ts","sourceRoot":"","sources":["../../src/client/InferRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAMrE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB,CAAC,QAAQ,EAAE,SAAS,SAAS,SAAS,OAAO,EAAE;IAC7E,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC1C,mEAAmE;IACnE,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC/B;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IACrB,CAAC,SAAS,iBAAiB,CAAC,MAAM,KAAK,EAAE,MAAM,SAAS,CAAC,GACnD,uBAAuB,CAAC,SAAS,CAAC,GAClC,CAAC,SAAS,SAAS,OAAO,EAAE,GACxB,uBAAuB,CAAC,CAAC,CAAC,GAC1B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEtD;;;;;;GAMG;AACH,KAAK,uBAAuB,CAAC,CAAC,IAC1B,CAAC,SAAS,SAAS,CAAC,MAAM,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,GACzC,gBAAgB,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAC,IAAI,CAAC,GACvD,CAAC,SAAS,SAAS,EAAE,GAEjB,EAAE,GACF,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEtD;;;;;;;GAOG;AACH,KAAK,gBAAgB,CAAC,CAAC,IACnB,CAAC,SAAS,kBAAkB,CAAC,MAAM,KAAK,EAAE,MAAM,QAAQ,EAAE,MAAM,MAAM,EAAE,MAAM,UAAU,CAAC,GACnF,UAAU,GACV,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InferRouter — Compile-Time Router Type Extraction
|
|
3
|
+
*
|
|
4
|
+
* Extracts a fully typed `RouterMap` from a `TypedToolRegistry` or
|
|
5
|
+
* an array of `GroupedToolBuilder` instances. This is the key piece
|
|
6
|
+
* that makes the VurbClient tRPC-style experience real.
|
|
7
|
+
*
|
|
8
|
+
* **Zero runtime cost** — this module contains only type declarations.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // ── SERVER SIDE ──
|
|
13
|
+
* const registry = createTypedRegistry<AppContext>()(
|
|
14
|
+
* projectsTool, // GroupedToolBuilder<AppContext, ..., 'projects', { 'projects.list': ..., ... }>
|
|
15
|
+
* billingTool,
|
|
16
|
+
* );
|
|
17
|
+
* export type AppRouter = InferRouter<typeof registry>;
|
|
18
|
+
*
|
|
19
|
+
* // ── CLIENT SIDE ──
|
|
20
|
+
* import type { AppRouter } from './server';
|
|
21
|
+
* const client = createVurbClient<AppRouter>(transport);
|
|
22
|
+
* await client.execute('projects.list', { workspace_id: 'ws_1' });
|
|
23
|
+
* // ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
|
|
24
|
+
* // autocomplete! typed args!
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @module
|
|
28
|
+
*/
|
|
29
|
+
import {} from '../core/builder/GroupedToolBuilder.js';
|
|
30
|
+
import {} from '../core/registry/ToolRegistry.js';
|
|
31
|
+
//# sourceMappingURL=InferRouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InferRouter.js","sourceRoot":"","sources":["../../src/client/InferRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAA2B,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAqB,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VurbClient — Type-Safe MCP Client (tRPC-style)
|
|
3
|
+
*
|
|
4
|
+
* Provides end-to-end type safety from server to client.
|
|
5
|
+
* The server exports its router type, and the client consumes it
|
|
6
|
+
* with full autocomplete and compile-time validation.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // ── SERVER (mcp-server.ts) ──
|
|
11
|
+
* export const registry = new ToolRegistry<AppContext>();
|
|
12
|
+
* registry.register(projects);
|
|
13
|
+
* registry.register(billing);
|
|
14
|
+
* export type AppRouter = InferRouter<typeof registry>;
|
|
15
|
+
*
|
|
16
|
+
* // ── CLIENT (agent.ts) ──
|
|
17
|
+
* import { createVurbClient } from 'vurb/client';
|
|
18
|
+
* import type { AppRouter } from './mcp-server';
|
|
19
|
+
*
|
|
20
|
+
* const client = createVurbClient<AppRouter>(transport);
|
|
21
|
+
* const result = await client.execute('projects.create', { name: 'Vinkius V2' });
|
|
22
|
+
* // ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
|
|
23
|
+
* // autocomplete! typed args!
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @module
|
|
27
|
+
*/
|
|
28
|
+
import { type ToolResponse } from '../core/response.js';
|
|
29
|
+
/**
|
|
30
|
+
* Transport interface for the Vurb client.
|
|
31
|
+
* This abstracts the MCP transport layer (stdio, HTTP, WebSocket, etc.)
|
|
32
|
+
*/
|
|
33
|
+
export interface VurbTransport {
|
|
34
|
+
/** Call a tool by name with arguments */
|
|
35
|
+
callTool(name: string, args: Record<string, unknown>): Promise<ToolResponse>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Router type inferred from a ToolRegistry.
|
|
39
|
+
*
|
|
40
|
+
* Maps tool names to their action names and argument shapes.
|
|
41
|
+
* This type is used at compile-time only — zero runtime cost.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* type MyRouter = {
|
|
46
|
+
* 'projects.list': { workspace_id: string; status?: string };
|
|
47
|
+
* 'projects.create': { workspace_id: string; name: string };
|
|
48
|
+
* 'billing.refund': { invoice_id: string; amount: number };
|
|
49
|
+
* };
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export type RouterMap = Record<string, Record<string, unknown>>;
|
|
53
|
+
/**
|
|
54
|
+
* Client-side middleware for request/response interception.
|
|
55
|
+
*
|
|
56
|
+
* Follows the same onion model as server-side middleware:
|
|
57
|
+
* each middleware wraps the next, forming a pipeline.
|
|
58
|
+
*
|
|
59
|
+
* Use cases: authentication injection, request logging,
|
|
60
|
+
* retry logic, timeout enforcement, response transformation.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const authMiddleware: ClientMiddleware = async (action, args, next) => {
|
|
65
|
+
* const enrichedArgs = { ...args, _token: getToken() };
|
|
66
|
+
* return next(action, enrichedArgs);
|
|
67
|
+
* };
|
|
68
|
+
*
|
|
69
|
+
* const retryMiddleware: ClientMiddleware = async (action, args, next) => {
|
|
70
|
+
* for (let i = 0; i < 3; i++) {
|
|
71
|
+
* const result = await next(action, args);
|
|
72
|
+
* if (!result.isError) return result;
|
|
73
|
+
* }
|
|
74
|
+
* return next(action, args);
|
|
75
|
+
* };
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export type ClientMiddleware = (action: string, args: Record<string, unknown>, next: (action: string, args: Record<string, unknown>) => Promise<ToolResponse>) => Promise<ToolResponse>;
|
|
79
|
+
/**
|
|
80
|
+
* Structured error parsed from a `<tool_error>` XML envelope.
|
|
81
|
+
*
|
|
82
|
+
* Provides typed access to self-healing fields so client code
|
|
83
|
+
* can programmatically react to server errors without regex parsing.
|
|
84
|
+
*/
|
|
85
|
+
export declare class VurbClientError extends Error {
|
|
86
|
+
/** Error code from the `code` attribute (e.g. `'NOT_FOUND'`). */
|
|
87
|
+
readonly code: string;
|
|
88
|
+
/** Recovery suggestion from `<recovery>` element. */
|
|
89
|
+
readonly recovery?: string | undefined;
|
|
90
|
+
/** Available actions from `<available_actions>` children. */
|
|
91
|
+
readonly availableActions: readonly string[];
|
|
92
|
+
/** Error severity from the `severity` attribute. */
|
|
93
|
+
readonly severity: string;
|
|
94
|
+
/** Raw ToolResponse that caused the error. */
|
|
95
|
+
readonly raw: ToolResponse;
|
|
96
|
+
constructor(message: string, code: string, raw: ToolResponse, options?: {
|
|
97
|
+
recovery?: string | undefined;
|
|
98
|
+
availableActions?: string[] | undefined;
|
|
99
|
+
severity?: string | undefined;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Options for creating a VurbClient.
|
|
104
|
+
*/
|
|
105
|
+
export interface VurbClientOptions {
|
|
106
|
+
/**
|
|
107
|
+
* Client-side middleware pipeline.
|
|
108
|
+
*
|
|
109
|
+
* Middleware execute in registration order (first = outermost).
|
|
110
|
+
* Each middleware can modify the request, response, or both.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* const client = createVurbClient<AppRouter>(transport, {
|
|
115
|
+
* middleware: [authMiddleware, loggingMiddleware],
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
middleware?: ClientMiddleware[];
|
|
120
|
+
/**
|
|
121
|
+
* When `true`, `execute()` throws a {@link VurbClientError}
|
|
122
|
+
* for responses with `isError: true`.
|
|
123
|
+
*
|
|
124
|
+
* When `false` (default), error responses are returned normally
|
|
125
|
+
* and the caller must check `result.isError`.
|
|
126
|
+
*
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
throwOnError?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Key used as the discriminator when calling grouped tools.
|
|
132
|
+
*
|
|
133
|
+
* Must match the discriminator key configured on the server
|
|
134
|
+
* (e.g. `group.discriminator('command')`).
|
|
135
|
+
*
|
|
136
|
+
* @default 'action'
|
|
137
|
+
*/
|
|
138
|
+
discriminatorKey?: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Type-safe client that provides autocomplete and compile-time
|
|
142
|
+
* validation for MCP tool calls.
|
|
143
|
+
*
|
|
144
|
+
* @typeParam TRouter - The router map inferred from the server's registry
|
|
145
|
+
*/
|
|
146
|
+
export interface VurbClient<TRouter extends RouterMap> {
|
|
147
|
+
/**
|
|
148
|
+
* Execute a tool action with full type safety.
|
|
149
|
+
*
|
|
150
|
+
* @param action - Full action path (e.g. 'projects.create')
|
|
151
|
+
* @param args - Typed arguments matching the action's schema
|
|
152
|
+
* @returns The tool response
|
|
153
|
+
*/
|
|
154
|
+
execute<TAction extends keyof TRouter & string>(action: TAction, args: TRouter[TAction]): Promise<ToolResponse>;
|
|
155
|
+
/**
|
|
156
|
+
* Execute multiple tool actions concurrently.
|
|
157
|
+
*
|
|
158
|
+
* All calls run in parallel via `Promise.all`.
|
|
159
|
+
* Use `{ sequential: true }` for ordered execution.
|
|
160
|
+
*
|
|
161
|
+
* @param calls - Array of `{ action, args }` objects
|
|
162
|
+
* @param options - Optional execution mode
|
|
163
|
+
* @returns Array of tool responses, one per call
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```typescript
|
|
167
|
+
* const results = await client.executeBatch([
|
|
168
|
+
* { action: 'projects.list', args: { workspace_id: 'ws_1' } },
|
|
169
|
+
* { action: 'billing.balance', args: { account_id: 'acc_1' } },
|
|
170
|
+
* ]);
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
executeBatch<TActions extends ReadonlyArray<keyof TRouter & string>>(calls: {
|
|
174
|
+
[K in keyof TActions]: {
|
|
175
|
+
action: TActions[K];
|
|
176
|
+
args: TRouter[TActions[K] & keyof TRouter];
|
|
177
|
+
};
|
|
178
|
+
}, options?: {
|
|
179
|
+
sequential?: boolean | undefined;
|
|
180
|
+
} | undefined): Promise<ToolResponse[]>;
|
|
181
|
+
/**
|
|
182
|
+
* Fluent proxy for calling tools with dot-navigation.
|
|
183
|
+
*
|
|
184
|
+
* Builds the action path from chained property accesses,
|
|
185
|
+
* then executes when invoked as a function.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* // Equivalent to: client.execute('projects.create', { name: 'V2' })
|
|
190
|
+
* await client.proxy.projects.create({ name: 'V2' });
|
|
191
|
+
*
|
|
192
|
+
* // Also works for deeper paths:
|
|
193
|
+
* await client.proxy.platform.users.list({ limit: 10 });
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
readonly proxy: FluentProxy<TRouter>;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Splits a dotted key `'a.b.c'` into head `'a'` and tail `'b.c'`.
|
|
200
|
+
* @internal
|
|
201
|
+
*/
|
|
202
|
+
type SplitKey<K extends string> = K extends `${infer Head}.${infer Tail}` ? [Head, Tail] : [K, never];
|
|
203
|
+
/**
|
|
204
|
+
* Collects all first segments from the router keys.
|
|
205
|
+
* @internal
|
|
206
|
+
*/
|
|
207
|
+
type FirstSegments<TRouter extends RouterMap> = {
|
|
208
|
+
[K in keyof TRouter & string]: SplitKey<K>[0];
|
|
209
|
+
}[keyof TRouter & string];
|
|
210
|
+
/**
|
|
211
|
+
* Given a segment prefix, collects remaining tails and their arg types.
|
|
212
|
+
* @internal
|
|
213
|
+
*/
|
|
214
|
+
type SubRouter<TRouter extends RouterMap, Prefix extends string> = {
|
|
215
|
+
[K in keyof TRouter & string as K extends `${Prefix}.${infer Rest}` ? Rest : never]: TRouter[K];
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Recursive proxy node type.
|
|
219
|
+
*
|
|
220
|
+
* - If the key resolves to a leaf action, it becomes callable.
|
|
221
|
+
* - If it has further segments, it exposes another level of navigation.
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
224
|
+
type ProxyNode<TRouter extends RouterMap> = {
|
|
225
|
+
[Seg in FirstSegments<TRouter>]: (Seg extends keyof TRouter ? ((args: TRouter[Seg]) => Promise<ToolResponse>) : unknown) & (string extends FirstSegments<SubRouter<TRouter, Seg>> ? unknown : FluentProxy<SubRouter<TRouter, Seg>>);
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Top-level fluent proxy type.
|
|
229
|
+
*
|
|
230
|
+
* Provides dot-navigation for calling tools:
|
|
231
|
+
* ```typescript
|
|
232
|
+
* await client.proxy.projects.create({ name: 'V2' });
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
export type FluentProxy<TRouter extends RouterMap> = ProxyNode<TRouter>;
|
|
236
|
+
/**
|
|
237
|
+
* Create a type-safe MCP client.
|
|
238
|
+
*
|
|
239
|
+
* The client provides full autocomplete for action names and
|
|
240
|
+
* compile-time validation for arguments based on the server's
|
|
241
|
+
* router type.
|
|
242
|
+
*
|
|
243
|
+
* @typeParam TRouter - The router map (use `InferRouter<typeof registry>`)
|
|
244
|
+
* @param transport - The MCP transport layer
|
|
245
|
+
* @param options - Client options (middleware, error handling)
|
|
246
|
+
* @returns A typed {@link VurbClient}
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```typescript
|
|
250
|
+
* import type { AppRouter } from './mcp-server';
|
|
251
|
+
*
|
|
252
|
+
* const client = createVurbClient<AppRouter>(transport);
|
|
253
|
+
*
|
|
254
|
+
* // Full autocomplete + type validation:
|
|
255
|
+
* await client.execute('projects.create', { name: 'Vinkius V2' });
|
|
256
|
+
*
|
|
257
|
+
* // TS error: 'projects.nonexistent' is not a valid action
|
|
258
|
+
* await client.execute('projects.nonexistent', {});
|
|
259
|
+
*
|
|
260
|
+
* // TS error: missing required arg 'name'
|
|
261
|
+
* await client.execute('projects.create', {});
|
|
262
|
+
* ```
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```typescript
|
|
266
|
+
* // With client middleware and throwOnError
|
|
267
|
+
* const client = createVurbClient<AppRouter>(transport, {
|
|
268
|
+
* throwOnError: true,
|
|
269
|
+
* middleware: [
|
|
270
|
+
* async (action, args, next) => {
|
|
271
|
+
* console.log(`[Client] calling ${action}`);
|
|
272
|
+
* const result = await next(action, args);
|
|
273
|
+
* console.log(`[Client] ${action} done`);
|
|
274
|
+
* return result;
|
|
275
|
+
* },
|
|
276
|
+
* ],
|
|
277
|
+
* });
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
export declare function createVurbClient<TRouter extends RouterMap>(transport: VurbTransport, options?: VurbClientOptions): VurbClient<TRouter>;
|
|
281
|
+
export {};
|
|
282
|
+
//# sourceMappingURL=VurbClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VurbClient.d.ts","sourceRoot":"","sources":["../../src/client/VurbClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMxD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAChF;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM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