@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,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZodDescriptionExtractor — Automatic Prompt Extraction from Zod .describe()
|
|
3
|
+
*
|
|
4
|
+
* Walks a Zod schema's AST and collects `.describe()` annotations from
|
|
5
|
+
* every field. These descriptions are injected as system rules via
|
|
6
|
+
* Context Tree-Shaking, eliminating the need for manual `systemRules`
|
|
7
|
+
* when the Zod schema already carries domain-specific constraints.
|
|
8
|
+
*
|
|
9
|
+
* This ensures documentation never drifts from the actual data shape:
|
|
10
|
+
* the single source of truth is the Zod `.describe()` annotation.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const schema = z.object({
|
|
15
|
+
* amount_cents: z.number().describe('CRITICAL: in CENTS. Divide by 100.'),
|
|
16
|
+
* status: z.enum(['paid', 'pending']).describe('Always display with emoji'),
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* extractZodDescriptions(schema);
|
|
20
|
+
* // → ['amount_cents: CRITICAL: in CENTS. Divide by 100.',
|
|
21
|
+
* // 'status: Always display with emoji']
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @module
|
|
25
|
+
*/
|
|
26
|
+
import {} from 'zod';
|
|
27
|
+
// ── Extraction Logic ─────────────────────────────────────
|
|
28
|
+
/**
|
|
29
|
+
* Recursively unwrap wrapper Zod nodes (optional, nullable, default, branded,
|
|
30
|
+
* readonly, effects, lazy, catches, pipes) to reach the inner schema.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
function unwrap(node) {
|
|
34
|
+
const def = node._def;
|
|
35
|
+
if (!def)
|
|
36
|
+
return node;
|
|
37
|
+
const typeName = def.typeName ?? '';
|
|
38
|
+
const wrapperTypes = [
|
|
39
|
+
'ZodOptional', 'ZodNullable', 'ZodDefault', 'ZodBranded',
|
|
40
|
+
'ZodReadonly', 'ZodEffects', 'ZodLazy', 'ZodCatch', 'ZodPipeline',
|
|
41
|
+
];
|
|
42
|
+
if (wrapperTypes.includes(typeName)) {
|
|
43
|
+
const inner = def.innerType ?? def.type ?? def.schema ?? def['in'];
|
|
44
|
+
if (inner)
|
|
45
|
+
return unwrap(inner);
|
|
46
|
+
}
|
|
47
|
+
return node;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get the shape record from a Zod object node.
|
|
51
|
+
* Supports both v3 (`_def.shape()`) and v4 (`_def.shape`) patterns.
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
function getShape(node) {
|
|
55
|
+
const def = node._def;
|
|
56
|
+
if (!def)
|
|
57
|
+
return undefined;
|
|
58
|
+
if (typeof def.shape === 'function') {
|
|
59
|
+
return def.shape();
|
|
60
|
+
}
|
|
61
|
+
if (typeof def.shape === 'object' && def.shape !== null) {
|
|
62
|
+
return def.shape;
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Extract `.describe()` annotations from a Zod schema's fields.
|
|
68
|
+
*
|
|
69
|
+
* Walks the top-level `z.object()` shape and retrieves the description
|
|
70
|
+
* string from each field (after unwrapping wrappers like `z.optional()`,
|
|
71
|
+
* `z.nullable()`, `z.default()`, etc.).
|
|
72
|
+
*
|
|
73
|
+
* Returns an array of human-readable `"fieldName: description"` strings,
|
|
74
|
+
* ready to be injected as system rules.
|
|
75
|
+
*
|
|
76
|
+
* @param schema - A Zod schema (typically z.object, but safely handles non-objects)
|
|
77
|
+
* @returns Array of `"fieldName: description"` strings (empty if no descriptions found)
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const schema = z.object({
|
|
82
|
+
* amount_cents: z.number().describe('CRITICAL: value is in CENTS. Divide by 100.'),
|
|
83
|
+
* currency: z.string(), // No .describe() → skipped
|
|
84
|
+
* status: z.enum(['paid', 'pending']).describe('Show with emoji'),
|
|
85
|
+
* });
|
|
86
|
+
*
|
|
87
|
+
* extractZodDescriptions(schema);
|
|
88
|
+
* // → ['amount_cents: CRITICAL: value is in CENTS. Divide by 100.',
|
|
89
|
+
* // 'status: Show with emoji']
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export function extractZodDescriptions(schema) {
|
|
93
|
+
const node = schema;
|
|
94
|
+
const shape = getShape(node);
|
|
95
|
+
if (!shape)
|
|
96
|
+
return [];
|
|
97
|
+
const descriptions = [];
|
|
98
|
+
for (const [key, fieldNode] of Object.entries(shape)) {
|
|
99
|
+
const desc = resolveDescription(fieldNode);
|
|
100
|
+
if (desc) {
|
|
101
|
+
descriptions.push(`${key}: ${desc}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return descriptions;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Resolve the description from a field node by unwrapping wrappers.
|
|
108
|
+
*
|
|
109
|
+
* Priority:
|
|
110
|
+
* 1. Outermost `.description` (Zod v4 style)
|
|
111
|
+
* 2. `_def.description` (Zod v3 style)
|
|
112
|
+
* 3. Unwrapped inner node's description
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
function resolveDescription(node) {
|
|
116
|
+
// Check outermost description first
|
|
117
|
+
if (node.description)
|
|
118
|
+
return node.description;
|
|
119
|
+
if (node._def?.description)
|
|
120
|
+
return node._def.description;
|
|
121
|
+
// Unwrap and check inner
|
|
122
|
+
const inner = unwrap(node);
|
|
123
|
+
if (inner !== node) {
|
|
124
|
+
if (inner.description)
|
|
125
|
+
return inner.description;
|
|
126
|
+
if (inner._def?.description)
|
|
127
|
+
return inner._def.description;
|
|
128
|
+
}
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=ZodDescriptionExtractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZodDescriptionExtractor.js","sourceRoot":"","sources":["../../src/presenter/ZodDescriptionExtractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAgB,MAAM,KAAK,CAAC;AAwBnC,4DAA4D;AAE5D;;;;GAIG;AACH,SAAS,MAAM,CAAC,IAAa;IACzB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC;IACtB,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IAEtB,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;IACpC,MAAM,YAAY,GAAG;QACjB,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY;QACxD,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa;KACpE,CAAC;IAEF,IAAI,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,IAAK,GAA+B,CAAC,IAAI,CAAC,CAAC;QAChG,IAAI,KAAK;YAAE,OAAO,MAAM,CAAC,KAAgB,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAS,QAAQ,CAAC,IAAa;IAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC;IACtB,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAE3B,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,GAAG,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAED,IAA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W,CAAC;IAC/D,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* definePresenter() — Declarative Presenter Definition
|
|
3
|
+
*
|
|
4
|
+
* Zero-friction object-config API for creating Presenters.
|
|
5
|
+
* Replaces the fluent builder pattern with a single object literal
|
|
6
|
+
* that enables instant Ctrl+Space autocomplete and zero generic noise.
|
|
7
|
+
*
|
|
8
|
+
* The `schema` field drives type inference: the `ui`, `rules`, and
|
|
9
|
+
* `suggestActions` callbacks automatically receive the inferred type,
|
|
10
|
+
* so the developer never writes a generic parameter manually.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { definePresenter, ui } from 'vurb';
|
|
15
|
+
* import { z } from 'zod';
|
|
16
|
+
*
|
|
17
|
+
* export const InvoicePresenter = definePresenter({
|
|
18
|
+
* name: 'Invoice',
|
|
19
|
+
* schema: z.object({
|
|
20
|
+
* id: z.string(),
|
|
21
|
+
* amount_cents: z.number().describe('CRITICAL: in CENTS. Divide by 100.'),
|
|
22
|
+
* status: z.enum(['paid', 'pending']),
|
|
23
|
+
* }),
|
|
24
|
+
* rules: ['CRITICAL: Divide amount_cents by 100 before displaying.'],
|
|
25
|
+
* ui: (inv) => [ui.echarts({ series: [{ type: 'gauge', data: [{ value: inv.amount_cents / 100 }] }] })],
|
|
26
|
+
* suggestActions: (inv) =>
|
|
27
|
+
* inv.status === 'pending'
|
|
28
|
+
* ? [{ tool: 'billing.pay', reason: 'Offer immediate payment' }]
|
|
29
|
+
* : [],
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @module
|
|
34
|
+
*/
|
|
35
|
+
import { type ZodType } from 'zod';
|
|
36
|
+
import { Presenter, type ActionSuggestion } from './Presenter.js';
|
|
37
|
+
import { type UiBlock } from './ui.js';
|
|
38
|
+
/**
|
|
39
|
+
* Agent limit configuration for cognitive guardrails.
|
|
40
|
+
*/
|
|
41
|
+
export interface AgentLimitDef {
|
|
42
|
+
/** Maximum items to keep when data is an array */
|
|
43
|
+
readonly max: number;
|
|
44
|
+
/** Callback that produces a warning block when items are truncated */
|
|
45
|
+
readonly onTruncate: (omittedCount: number) => UiBlock;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Embedded child Presenter definition for relational composition.
|
|
49
|
+
*/
|
|
50
|
+
export interface EmbedDef {
|
|
51
|
+
/** Property key in the parent data that contains the nested data */
|
|
52
|
+
readonly key: string;
|
|
53
|
+
/** The child Presenter to apply to the nested data */
|
|
54
|
+
readonly presenter: Presenter<unknown>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Full declarative configuration for `definePresenter()`.
|
|
58
|
+
*
|
|
59
|
+
* @typeParam T - Inferred from the `schema` field's output type
|
|
60
|
+
*/
|
|
61
|
+
export interface PresenterConfig<T> {
|
|
62
|
+
/** Human-readable domain name (for debugging and introspection) */
|
|
63
|
+
readonly name: string;
|
|
64
|
+
/** Zod schema for data validation and field filtering */
|
|
65
|
+
readonly schema?: ZodType<any, any, any>;
|
|
66
|
+
/**
|
|
67
|
+
* System rules that travel with the data.
|
|
68
|
+
*
|
|
69
|
+
* - **Static**: `string[]` — always injected
|
|
70
|
+
* - **Dynamic**: `(data, ctx?) => (string | null)[]` — context-aware (RBAC, DLP, locale)
|
|
71
|
+
*
|
|
72
|
+
* Return `null` from dynamic rules to conditionally exclude them.
|
|
73
|
+
*/
|
|
74
|
+
readonly rules?: readonly string[] | ((data: T, ctx?: unknown) => (string | null)[]);
|
|
75
|
+
/**
|
|
76
|
+
* UI blocks for a **single data item**.
|
|
77
|
+
*
|
|
78
|
+
* Return `null` for conditional blocks (filtered automatically).
|
|
79
|
+
*/
|
|
80
|
+
readonly ui?: (item: T, ctx?: unknown) => (UiBlock | null)[];
|
|
81
|
+
/**
|
|
82
|
+
* Aggregated UI blocks for a **collection** (array) of items.
|
|
83
|
+
*
|
|
84
|
+
* Called once with the entire validated array. Prevents N individual
|
|
85
|
+
* charts from flooding the LLM's context.
|
|
86
|
+
*/
|
|
87
|
+
readonly collectionUi?: (items: T[], ctx?: unknown) => (UiBlock | null)[];
|
|
88
|
+
/**
|
|
89
|
+
* Cognitive guardrail that truncates large collections.
|
|
90
|
+
*
|
|
91
|
+
* Protects against context DDoS by limiting returned array length
|
|
92
|
+
* and injecting a summary block.
|
|
93
|
+
*/
|
|
94
|
+
readonly agentLimit?: AgentLimitDef;
|
|
95
|
+
/**
|
|
96
|
+
* HATEOAS-style next-action suggestions based on data state.
|
|
97
|
+
*
|
|
98
|
+
* Eliminates routing hallucinations by providing explicit next-step hints.
|
|
99
|
+
*/
|
|
100
|
+
readonly suggestActions?: (data: T, ctx?: unknown) => ActionSuggestion[];
|
|
101
|
+
/**
|
|
102
|
+
* Embedded child Presenters for nested relational data.
|
|
103
|
+
*
|
|
104
|
+
* Define once, embed everywhere. Each embed's `key` is looked up on
|
|
105
|
+
* the parent data, and the child Presenter renders its own blocks/rules.
|
|
106
|
+
*/
|
|
107
|
+
readonly embeds?: readonly EmbedDef[];
|
|
108
|
+
/**
|
|
109
|
+
* Automatically extract `.describe()` annotations from the Zod schema
|
|
110
|
+
* and merge them with `rules` as system rules.
|
|
111
|
+
*
|
|
112
|
+
* When `true` (the default), field-level `.describe()` annotations
|
|
113
|
+
* become system rules, ensuring documentation never drifts from the
|
|
114
|
+
* actual data shape. Set to `false` to opt out.
|
|
115
|
+
*
|
|
116
|
+
* @default true
|
|
117
|
+
*/
|
|
118
|
+
readonly autoRules?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* PII redaction paths for DLP compliance.
|
|
121
|
+
*
|
|
122
|
+
* Compiles object paths into V8-optimized masking functions
|
|
123
|
+
* using `fast-redact`. Masked data reaches the LLM, while
|
|
124
|
+
* UI blocks and system rules see the full unmasked data.
|
|
125
|
+
*
|
|
126
|
+
* Requires `fast-redact` as an optional peer dependency.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* redactPII: {
|
|
131
|
+
* paths: ['*.ssn', 'credit_card.number', 'patients[*].diagnosis'],
|
|
132
|
+
* censor: '[REDACTED]',
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
readonly redactPII?: {
|
|
137
|
+
readonly paths: string[];
|
|
138
|
+
readonly censor?: string | ((value: unknown) => string);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Define a domain-level Presenter using a declarative config object.
|
|
143
|
+
*
|
|
144
|
+
* This is the recommended, zero-friction API. The `schema` field drives
|
|
145
|
+
* full type inference — `ui`, `rules`, and `suggestActions` callbacks
|
|
146
|
+
* all receive correctly-typed parameters without any explicit generics.
|
|
147
|
+
*
|
|
148
|
+
* @typeParam TSchema - Zod type (inferred from the `schema` field)
|
|
149
|
+
* @param config - Declarative presenter configuration
|
|
150
|
+
* @returns A fully-configured {@link Presenter} ready for use
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* // Minimal
|
|
155
|
+
* const TaskPresenter = definePresenter({
|
|
156
|
+
* name: 'Task',
|
|
157
|
+
* schema: z.object({ id: z.string(), title: z.string(), done: z.boolean() }),
|
|
158
|
+
* rules: ['Use ✅ for done, 🔄 for in-progress.'],
|
|
159
|
+
* ui: (task) => [ui.markdown(`**${task.title}**: ${task.done ? '✅' : '🔄'}`)],
|
|
160
|
+
* });
|
|
161
|
+
*
|
|
162
|
+
* // With embeds, agent limit, and dynamic rules
|
|
163
|
+
* const OrderPresenter = definePresenter({
|
|
164
|
+
* name: 'Order',
|
|
165
|
+
* schema: orderSchema,
|
|
166
|
+
* rules: (order, ctx) => [
|
|
167
|
+
* ctx?.locale === 'pt-BR' ? 'Formate datas em DD/MM/YYYY' : null,
|
|
168
|
+
* ],
|
|
169
|
+
* agentLimit: { max: 100, onTruncate: (n) => ui.summary(`⚠️ ${n} orders hidden`) },
|
|
170
|
+
* embeds: [{ key: 'customer', presenter: CustomerPresenter }],
|
|
171
|
+
* suggestActions: (order) =>
|
|
172
|
+
* order.status === 'pending'
|
|
173
|
+
* ? [{ tool: 'orders.approve', reason: 'Ready for approval' }]
|
|
174
|
+
* : [],
|
|
175
|
+
* });
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* @see {@link createPresenter} for the legacy fluent builder API
|
|
179
|
+
* @see {@link Presenter} for the full Presenter class documentation
|
|
180
|
+
*/
|
|
181
|
+
export declare function definePresenter<TSchema extends ZodType<any, any, any>>(config: Omit<PresenterConfig<TSchema['_output']>, 'schema'> & {
|
|
182
|
+
schema: TSchema;
|
|
183
|
+
}): Presenter<TSchema['_output']>;
|
|
184
|
+
/**
|
|
185
|
+
* Define a Presenter without a schema (untyped data passthrough).
|
|
186
|
+
*
|
|
187
|
+
* @param config - Configuration without a schema field
|
|
188
|
+
* @returns A Presenter that passes data through without validation
|
|
189
|
+
*/
|
|
190
|
+
export declare function definePresenter(config: PresenterConfig<unknown> & {
|
|
191
|
+
schema?: undefined;
|
|
192
|
+
}): Presenter<unknown>;
|
|
193
|
+
//# sourceMappingURL=definePresenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definePresenter.d.ts","sourceRoot":"","sources":["../../src/presenter/definePresenter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAKvC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,kDAAkD;IAClD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,QAAQ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,QAAQ,EAAE,CAAC;IAEtC;;;;;;;;;OASG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE;QACjB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC;KAC3D,CAAC;CACL;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,eAAe,CAAC,OAAO,SAAS,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAClE,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAClF,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,eAAe,CAC3B,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GAC1D,SAAS,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* definePresenter() — Declarative Presenter Definition
|
|
3
|
+
*
|
|
4
|
+
* Zero-friction object-config API for creating Presenters.
|
|
5
|
+
* Replaces the fluent builder pattern with a single object literal
|
|
6
|
+
* that enables instant Ctrl+Space autocomplete and zero generic noise.
|
|
7
|
+
*
|
|
8
|
+
* The `schema` field drives type inference: the `ui`, `rules`, and
|
|
9
|
+
* `suggestActions` callbacks automatically receive the inferred type,
|
|
10
|
+
* so the developer never writes a generic parameter manually.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { definePresenter, ui } from 'vurb';
|
|
15
|
+
* import { z } from 'zod';
|
|
16
|
+
*
|
|
17
|
+
* export const InvoicePresenter = definePresenter({
|
|
18
|
+
* name: 'Invoice',
|
|
19
|
+
* schema: z.object({
|
|
20
|
+
* id: z.string(),
|
|
21
|
+
* amount_cents: z.number().describe('CRITICAL: in CENTS. Divide by 100.'),
|
|
22
|
+
* status: z.enum(['paid', 'pending']),
|
|
23
|
+
* }),
|
|
24
|
+
* rules: ['CRITICAL: Divide amount_cents by 100 before displaying.'],
|
|
25
|
+
* ui: (inv) => [ui.echarts({ series: [{ type: 'gauge', data: [{ value: inv.amount_cents / 100 }] }] })],
|
|
26
|
+
* suggestActions: (inv) =>
|
|
27
|
+
* inv.status === 'pending'
|
|
28
|
+
* ? [{ tool: 'billing.pay', reason: 'Offer immediate payment' }]
|
|
29
|
+
* : [],
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @module
|
|
34
|
+
*/
|
|
35
|
+
import {} from 'zod';
|
|
36
|
+
import { Presenter } from './Presenter.js';
|
|
37
|
+
import {} from './ui.js';
|
|
38
|
+
import { extractZodDescriptions } from './ZodDescriptionExtractor.js';
|
|
39
|
+
/**
|
|
40
|
+
* Implementation
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export function definePresenter(config) {
|
|
44
|
+
const presenter = new Presenter(config.name);
|
|
45
|
+
if (config.schema) {
|
|
46
|
+
presenter.schema(config.schema);
|
|
47
|
+
}
|
|
48
|
+
// ── Zod-Driven Prompts: auto-extract .describe() annotations ──
|
|
49
|
+
const autoRules = config.autoRules !== false; // default: true
|
|
50
|
+
const zodDescriptions = (autoRules && config.schema)
|
|
51
|
+
? extractZodDescriptions(config.schema)
|
|
52
|
+
: [];
|
|
53
|
+
if (config.rules) {
|
|
54
|
+
if (typeof config.rules === 'function') {
|
|
55
|
+
// Dynamic rules — wrap to prepend Zod descriptions
|
|
56
|
+
if (zodDescriptions.length > 0) {
|
|
57
|
+
const dynamicFn = config.rules;
|
|
58
|
+
presenter.systemRules((data, ctx) => [
|
|
59
|
+
...zodDescriptions,
|
|
60
|
+
...dynamicFn(data, ctx),
|
|
61
|
+
]);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
presenter.systemRules(config.rules);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// Static rules — merge with Zod descriptions
|
|
69
|
+
const merged = [...zodDescriptions, ...config.rules];
|
|
70
|
+
presenter.systemRules(merged);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (zodDescriptions.length > 0) {
|
|
74
|
+
// No explicit rules — use Zod descriptions alone
|
|
75
|
+
presenter.systemRules(zodDescriptions);
|
|
76
|
+
}
|
|
77
|
+
if (config.ui) {
|
|
78
|
+
presenter.uiBlocks(config.ui);
|
|
79
|
+
}
|
|
80
|
+
if (config.collectionUi) {
|
|
81
|
+
presenter.collectionUiBlocks(config.collectionUi);
|
|
82
|
+
}
|
|
83
|
+
if (config.agentLimit) {
|
|
84
|
+
presenter.agentLimit(config.agentLimit.max, config.agentLimit.onTruncate);
|
|
85
|
+
}
|
|
86
|
+
if (config.suggestActions) {
|
|
87
|
+
presenter.suggestActions(config.suggestActions);
|
|
88
|
+
}
|
|
89
|
+
if (config.embeds) {
|
|
90
|
+
for (const embed of config.embeds) {
|
|
91
|
+
presenter.embed(embed.key, embed.presenter);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (config.redactPII) {
|
|
95
|
+
presenter.redactPII(config.redactPII.paths, config.redactPII.censor);
|
|
96
|
+
}
|
|
97
|
+
return presenter;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=definePresenter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definePresenter.js","sourceRoot":"","sources":["../../src/presenter/definePresenter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;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rel Export
|
|
3
|
+
*
|
|
4
|
+
* Public API for the MVA (Model-View-Agent) presenter system.
|
|
5
|
+
*/
|
|
6
|
+
export { ResponseBuilder, response, isResponseBuilder } from './ResponseBuilder.js';
|
|
7
|
+
export type { ActionSuggestion } from './ResponseBuilder.js';
|
|
8
|
+
export { ui } from './ui.js';
|
|
9
|
+
export type { UiBlock } from './ui.js';
|
|
10
|
+
export { Presenter, createPresenter, isPresenter } from './Presenter.js';
|
|
11
|
+
export { definePresenter } from './definePresenter.js';
|
|
12
|
+
export type { PresenterConfig, AgentLimitDef, EmbedDef } from './definePresenter.js';
|
|
13
|
+
export { extractZodDescriptions } from './ZodDescriptionExtractor.js';
|
|
14
|
+
export { PresenterValidationError } from './PresenterValidationError.js';
|
|
15
|
+
export { t } from './typeHelpers.js';
|
|
16
|
+
export { suggest } from './suggest.js';
|
|
17
|
+
export { postProcessResult, isToolResponse } from './PostProcessor.js';
|
|
18
|
+
export { extractZodKeys, pickFields, applySelectFilter } from './SelectUtils.js';
|
|
19
|
+
export { compileRedactor, initRedactEngine } from './RedactEngine.js';
|
|
20
|
+
export type { RedactConfig, RedactFn } from './RedactEngine.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presenter/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACpF,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AAGrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGvE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGjF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presenter Module — Barrel Export
|
|
3
|
+
*
|
|
4
|
+
* Public API for the MVA (Model-View-Agent) presenter system.
|
|
5
|
+
*/
|
|
6
|
+
// ── Response Builder ─────────────────────────────────────
|
|
7
|
+
export { ResponseBuilder, response, isResponseBuilder } from './ResponseBuilder.js';
|
|
8
|
+
// ── UI Helpers ───────────────────────────────────────────
|
|
9
|
+
export { ui } from './ui.js';
|
|
10
|
+
// ── Presenter ────────────────────────────────────────────
|
|
11
|
+
export { Presenter, createPresenter, isPresenter } from './Presenter.js';
|
|
12
|
+
// ── Declarative Presenter ────────────────────────────────
|
|
13
|
+
export { definePresenter } from './definePresenter.js';
|
|
14
|
+
// ── Zod Description Extraction ───────────────────────────
|
|
15
|
+
export { extractZodDescriptions } from './ZodDescriptionExtractor.js';
|
|
16
|
+
// ── Validation Error ─────────────────────────────────────
|
|
17
|
+
export { PresenterValidationError } from './PresenterValidationError.js';
|
|
18
|
+
// ── Type Helpers (Fluent Schema Namespace) ───────────────
|
|
19
|
+
export { t } from './typeHelpers.js';
|
|
20
|
+
// ── Action Suggestion Helper ─────────────────────────────
|
|
21
|
+
export { suggest } from './suggest.js';
|
|
22
|
+
// ── Post-Processing ──────────────────────────────────────
|
|
23
|
+
export { postProcessResult, isToolResponse } from './PostProcessor.js';
|
|
24
|
+
// ── Select Reflection (Context Window Optimization) ──────
|
|
25
|
+
export { extractZodKeys, pickFields, applySelectFilter } from './SelectUtils.js';
|
|
26
|
+
// ── DLP Compliance (PII Redaction) ───────────────────────
|
|
27
|
+
export { compileRedactor, initRedactEngine } from './RedactEngine.js';
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/presenter/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,4DAA4D;AAC5D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGpF,4DAA4D;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAG7B,4DAA4D;AAC5D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEzE,4DAA4D;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,4DAA4D;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,4DAA4D;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,4DAA4D;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AAErC,4DAA4D;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,4DAA4D;AAC5D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvE,4DAA4D;AAC5D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEjF,4DAA4D;AAC5D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* suggest() — Fluent Action Suggestion Helper
|
|
3
|
+
*
|
|
4
|
+
* Replaces `{ tool: '...', reason: '...' }` config objects with a
|
|
5
|
+
* clean function call that reads like English.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { suggest } from 'vurb';
|
|
10
|
+
*
|
|
11
|
+
* .suggest((invoice) => [
|
|
12
|
+
* suggest('invoices.get', 'View invoice details'),
|
|
13
|
+
* invoice.status === 'overdue'
|
|
14
|
+
* ? suggest('billing.remind', 'Send collection reminder')
|
|
15
|
+
* : null,
|
|
16
|
+
* ])
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import { type ActionSuggestion } from './Presenter.js';
|
|
22
|
+
/**
|
|
23
|
+
* Create an action suggestion for HATEOAS-style agent guidance.
|
|
24
|
+
*
|
|
25
|
+
* Fluent alternative to `{ tool: '...', reason: '...' }` config objects.
|
|
26
|
+
* Reads like `suggest(what, why)` — zero ceremony.
|
|
27
|
+
*
|
|
28
|
+
* @param tool - Tool name to suggest (e.g. `'billing.pay'`)
|
|
29
|
+
* @param reason - Human-readable reason for the suggestion
|
|
30
|
+
* @returns An {@link ActionSuggestion} object
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* suggest('projects.archive', 'Archive this inactive project')
|
|
35
|
+
* // → { tool: 'projects.archive', reason: 'Archive this inactive project' }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function suggest(tool: string, reason: string): ActionSuggestion;
|
|
39
|
+
//# sourceMappingURL=suggest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../src/presenter/suggest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAEtE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* suggest() — Fluent Action Suggestion Helper
|
|
3
|
+
*
|
|
4
|
+
* Replaces `{ tool: '...', reason: '...' }` config objects with a
|
|
5
|
+
* clean function call that reads like English.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { suggest } from 'vurb';
|
|
10
|
+
*
|
|
11
|
+
* .suggest((invoice) => [
|
|
12
|
+
* suggest('invoices.get', 'View invoice details'),
|
|
13
|
+
* invoice.status === 'overdue'
|
|
14
|
+
* ? suggest('billing.remind', 'Send collection reminder')
|
|
15
|
+
* : null,
|
|
16
|
+
* ])
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import {} from './Presenter.js';
|
|
22
|
+
/**
|
|
23
|
+
* Create an action suggestion for HATEOAS-style agent guidance.
|
|
24
|
+
*
|
|
25
|
+
* Fluent alternative to `{ tool: '...', reason: '...' }` config objects.
|
|
26
|
+
* Reads like `suggest(what, why)` — zero ceremony.
|
|
27
|
+
*
|
|
28
|
+
* @param tool - Tool name to suggest (e.g. `'billing.pay'`)
|
|
29
|
+
* @param reason - Human-readable reason for the suggestion
|
|
30
|
+
* @returns An {@link ActionSuggestion} object
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* suggest('projects.archive', 'Archive this inactive project')
|
|
35
|
+
* // → { tool: 'projects.archive', reason: 'Archive this inactive project' }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export function suggest(tool, reason) {
|
|
39
|
+
return { tool, reason };
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=suggest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest.js","sourceRoot":"","sources":["../../src/presenter/suggest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAyB,MAAM,gBAAgB,CAAC;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,MAAc;IAChD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC"}
|