@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,261 @@
|
|
|
1
|
+
import type { ToolContract } from './ToolContract.js';
|
|
2
|
+
/** Current lockfile format version. */
|
|
3
|
+
declare const LOCKFILE_VERSION: 1;
|
|
4
|
+
/** Default lockfile name. */
|
|
5
|
+
export declare const LOCKFILE_NAME: "vurb.lock";
|
|
6
|
+
/**
|
|
7
|
+
* Root structure of `vurb.lock`.
|
|
8
|
+
*
|
|
9
|
+
* Designed for human reviewability in pull request diffs.
|
|
10
|
+
* Keys are sorted, values are deterministic.
|
|
11
|
+
*/
|
|
12
|
+
export interface CapabilityLockfile {
|
|
13
|
+
/** Format version for forward-compatible parsing */
|
|
14
|
+
readonly lockfileVersion: typeof LOCKFILE_VERSION;
|
|
15
|
+
/** MCP server name */
|
|
16
|
+
readonly serverName: string;
|
|
17
|
+
/** Vurb framework version */
|
|
18
|
+
readonly vurbVersion: string;
|
|
19
|
+
/** ISO-8601 generation timestamp */
|
|
20
|
+
readonly generatedAt: string;
|
|
21
|
+
/** SHA-256 over all tool digests — the server's behavioral identity */
|
|
22
|
+
readonly integrityDigest: string;
|
|
23
|
+
/** Per-capability lockfile entries */
|
|
24
|
+
readonly capabilities: LockfileCapabilities;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Capability sections in the lockfile.
|
|
28
|
+
*
|
|
29
|
+
* Currently supports `tools` and `prompts`. Future sections may
|
|
30
|
+
* include `resources` and `subscriptions`.
|
|
31
|
+
*/
|
|
32
|
+
export interface LockfileCapabilities {
|
|
33
|
+
/** Per-tool behavioral snapshots, sorted by tool name */
|
|
34
|
+
readonly tools: Readonly<Record<string, LockfileTool>>;
|
|
35
|
+
/** Per-prompt declarative snapshots, sorted by prompt name */
|
|
36
|
+
readonly prompts?: Readonly<Record<string, LockfilePrompt>>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Behavioral snapshot for a single tool.
|
|
40
|
+
*
|
|
41
|
+
* Every field is derived from the `ToolContract` — no manual
|
|
42
|
+
* annotation required. The snapshot captures everything an LLM
|
|
43
|
+
* relies on to behave correctly with this tool.
|
|
44
|
+
*/
|
|
45
|
+
export interface LockfileTool {
|
|
46
|
+
/** SHA-256 integrity digest for this tool's behavioral contract */
|
|
47
|
+
readonly integrityDigest: string;
|
|
48
|
+
/** Declarative surface visible via MCP `tools/list` */
|
|
49
|
+
readonly surface: LockfileToolSurface;
|
|
50
|
+
/** Behavioral contract internals */
|
|
51
|
+
readonly behavior: LockfileToolBehavior;
|
|
52
|
+
/** Token economics profile */
|
|
53
|
+
readonly tokenEconomics: LockfileTokenEconomics;
|
|
54
|
+
/** Handler entitlements (I/O capabilities) */
|
|
55
|
+
readonly entitlements: LockfileEntitlements;
|
|
56
|
+
}
|
|
57
|
+
/** Surface section of a lockfile tool entry. */
|
|
58
|
+
export interface LockfileToolSurface {
|
|
59
|
+
/** Tool description */
|
|
60
|
+
readonly description: string | null;
|
|
61
|
+
/** Sorted action keys */
|
|
62
|
+
readonly actions: readonly string[];
|
|
63
|
+
/** SHA-256 of the canonical input schema */
|
|
64
|
+
readonly inputSchemaDigest: string;
|
|
65
|
+
/** Sorted tags */
|
|
66
|
+
readonly tags: readonly string[];
|
|
67
|
+
}
|
|
68
|
+
/** Behavior section of a lockfile tool entry. */
|
|
69
|
+
export interface LockfileToolBehavior {
|
|
70
|
+
/** Presenter egress schema digest (null if no Presenter) */
|
|
71
|
+
readonly egressSchemaDigest: string | null;
|
|
72
|
+
/** System rules fingerprint */
|
|
73
|
+
readonly systemRulesFingerprint: string;
|
|
74
|
+
/** Actions marked as destructive */
|
|
75
|
+
readonly destructiveActions: readonly string[];
|
|
76
|
+
/** Actions marked as read-only */
|
|
77
|
+
readonly readOnlyActions: readonly string[];
|
|
78
|
+
/** Named middleware chain */
|
|
79
|
+
readonly middlewareChain: readonly string[];
|
|
80
|
+
/** Affordance topology — suggested next-action tool names */
|
|
81
|
+
readonly affordanceTopology: readonly string[];
|
|
82
|
+
/** Cognitive guardrails */
|
|
83
|
+
readonly cognitiveGuardrails: {
|
|
84
|
+
readonly agentLimitMax: number | null;
|
|
85
|
+
readonly egressMaxBytes: number | null;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** Token economics section of a lockfile tool entry. */
|
|
89
|
+
export interface LockfileTokenEconomics {
|
|
90
|
+
/** Cognitive overload risk classification */
|
|
91
|
+
readonly inflationRisk: string;
|
|
92
|
+
/** Number of fields in the egress schema */
|
|
93
|
+
readonly schemaFieldCount: number;
|
|
94
|
+
/** Whether output collections are unbounded */
|
|
95
|
+
readonly unboundedCollection: boolean;
|
|
96
|
+
}
|
|
97
|
+
/** Entitlements section of a lockfile tool entry. */
|
|
98
|
+
export interface LockfileEntitlements {
|
|
99
|
+
/** Filesystem I/O */
|
|
100
|
+
readonly filesystem: boolean;
|
|
101
|
+
/** Network I/O */
|
|
102
|
+
readonly network: boolean;
|
|
103
|
+
/** Subprocess execution */
|
|
104
|
+
readonly subprocess: boolean;
|
|
105
|
+
/** Cryptographic operations */
|
|
106
|
+
readonly crypto: boolean;
|
|
107
|
+
/** Dynamic code evaluation (eval, Function, vm) */
|
|
108
|
+
readonly codeEvaluation: boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Duck-typed interface for prompt builders.
|
|
112
|
+
*
|
|
113
|
+
* Decouples the lockfile module from the Prompt Engine implementation.
|
|
114
|
+
* Any object implementing these methods can be snapshotted.
|
|
115
|
+
*/
|
|
116
|
+
export interface PromptBuilderLike {
|
|
117
|
+
getName(): string;
|
|
118
|
+
getDescription(): string | undefined;
|
|
119
|
+
getTags(): string[];
|
|
120
|
+
hasMiddleware(): boolean;
|
|
121
|
+
getHydrationTimeout(): number | undefined;
|
|
122
|
+
buildPromptDefinition(): {
|
|
123
|
+
name: string;
|
|
124
|
+
title?: string;
|
|
125
|
+
description?: string;
|
|
126
|
+
icons?: {
|
|
127
|
+
light?: string;
|
|
128
|
+
dark?: string;
|
|
129
|
+
};
|
|
130
|
+
arguments?: Array<{
|
|
131
|
+
name: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
required?: boolean;
|
|
134
|
+
}>;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Behavioral snapshot for a single prompt.
|
|
139
|
+
*
|
|
140
|
+
* Captures the declarative surface that an LLM client relies on
|
|
141
|
+
* to offer the correct slash-command palette. Changes to arguments,
|
|
142
|
+
* descriptions, or middleware affect how the LLM invokes the prompt.
|
|
143
|
+
*/
|
|
144
|
+
export interface LockfilePrompt {
|
|
145
|
+
/** SHA-256 integrity digest for this prompt's declarative contract */
|
|
146
|
+
readonly integrityDigest: string;
|
|
147
|
+
/** Human-readable description */
|
|
148
|
+
readonly description: string | null;
|
|
149
|
+
/** Display title (MCP BaseMetadata.title) */
|
|
150
|
+
readonly title: string | null;
|
|
151
|
+
/** Sorted capability tags */
|
|
152
|
+
readonly tags: readonly string[];
|
|
153
|
+
/** Argument definitions from the Zod schema */
|
|
154
|
+
readonly arguments: readonly LockfilePromptArgument[];
|
|
155
|
+
/** SHA-256 of canonical arguments JSON */
|
|
156
|
+
readonly argumentsDigest: string;
|
|
157
|
+
/** Whether middleware is attached to this prompt */
|
|
158
|
+
readonly hasMiddleware: boolean;
|
|
159
|
+
/** Hydration timeout in ms, or null if unlimited */
|
|
160
|
+
readonly hydrationTimeout: number | null;
|
|
161
|
+
}
|
|
162
|
+
/** A single prompt argument definition. */
|
|
163
|
+
export interface LockfilePromptArgument {
|
|
164
|
+
/** Argument name */
|
|
165
|
+
readonly name: string;
|
|
166
|
+
/** Human-readable description */
|
|
167
|
+
readonly description: string | null;
|
|
168
|
+
/** Whether this argument is required */
|
|
169
|
+
readonly required: boolean;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Options for lockfile generation beyond tools.
|
|
173
|
+
*/
|
|
174
|
+
export interface GenerateLockfileOptions {
|
|
175
|
+
/** Prompt builders to snapshot alongside tools */
|
|
176
|
+
readonly prompts?: ReadonlyArray<PromptBuilderLike>;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Generate a `CapabilityLockfile` from compiled tool contracts
|
|
180
|
+
* and (optionally) prompt builders.
|
|
181
|
+
*
|
|
182
|
+
* This is a **pure function**: given the same contracts and metadata,
|
|
183
|
+
* it always produces the same lockfile (modulo `generatedAt` timestamp).
|
|
184
|
+
*
|
|
185
|
+
* @param serverName - MCP server name
|
|
186
|
+
* @param contracts - Record of tool name → materialized contract
|
|
187
|
+
* @param vurbVersion - Vurb version string
|
|
188
|
+
* @param options - Optional: prompt builders to include
|
|
189
|
+
* @returns A fully materialized lockfile
|
|
190
|
+
*/
|
|
191
|
+
export declare function generateLockfile(serverName: string, contracts: Readonly<Record<string, ToolContract>>, vurbVersion: string, options?: GenerateLockfileOptions): Promise<CapabilityLockfile>;
|
|
192
|
+
/**
|
|
193
|
+
* Serialize a lockfile to a deterministic JSON string.
|
|
194
|
+
*
|
|
195
|
+
* Uses sorted keys and 2-space indentation for git-friendly diffs.
|
|
196
|
+
* The output is canonical — identical lockfiles produce identical strings.
|
|
197
|
+
*
|
|
198
|
+
* @param lockfile - The lockfile to serialize
|
|
199
|
+
* @returns Deterministic JSON string with trailing newline
|
|
200
|
+
*/
|
|
201
|
+
export declare function serializeLockfile(lockfile: CapabilityLockfile): string;
|
|
202
|
+
/**
|
|
203
|
+
* Result of a lockfile verification check.
|
|
204
|
+
*/
|
|
205
|
+
export interface LockfileCheckResult {
|
|
206
|
+
/** Whether the lockfile matches the current server surface */
|
|
207
|
+
readonly ok: boolean;
|
|
208
|
+
/** Human-readable status message */
|
|
209
|
+
readonly message: string;
|
|
210
|
+
/** Added tools since lockfile was generated */
|
|
211
|
+
readonly added: readonly string[];
|
|
212
|
+
/** Removed tools since lockfile was generated */
|
|
213
|
+
readonly removed: readonly string[];
|
|
214
|
+
/** Tools whose behavioral digest changed */
|
|
215
|
+
readonly changed: readonly string[];
|
|
216
|
+
/** Tools that match the lockfile exactly */
|
|
217
|
+
readonly unchanged: readonly string[];
|
|
218
|
+
/** Added prompts since lockfile was generated */
|
|
219
|
+
readonly addedPrompts: readonly string[];
|
|
220
|
+
/** Removed prompts since lockfile was generated */
|
|
221
|
+
readonly removedPrompts: readonly string[];
|
|
222
|
+
/** Prompts whose declarative digest changed */
|
|
223
|
+
readonly changedPrompts: readonly string[];
|
|
224
|
+
/** Prompts that match the lockfile exactly */
|
|
225
|
+
readonly unchangedPrompts: readonly string[];
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Verify that a lockfile matches the current server contracts and prompts.
|
|
229
|
+
*
|
|
230
|
+
* This is the **CI gate**: `vurb lock --check` calls this function
|
|
231
|
+
* and exits non-zero if the lockfile is stale.
|
|
232
|
+
*
|
|
233
|
+
* @param lockfile - Previously generated lockfile (from disk)
|
|
234
|
+
* @param contracts - Current compiled tool contracts (from code)
|
|
235
|
+
* @param options - Optional: prompt builders for prompt verification
|
|
236
|
+
* @returns Check result with per-tool and per-prompt diff details
|
|
237
|
+
*/
|
|
238
|
+
export declare function checkLockfile(lockfile: CapabilityLockfile, contracts: Readonly<Record<string, ToolContract>>, options?: GenerateLockfileOptions): Promise<LockfileCheckResult>;
|
|
239
|
+
/**
|
|
240
|
+
* Parse and validate a lockfile JSON string.
|
|
241
|
+
*
|
|
242
|
+
* @param content - Raw JSON string from `vurb.lock`
|
|
243
|
+
* @returns Parsed lockfile, or null if invalid
|
|
244
|
+
*/
|
|
245
|
+
export declare function parseLockfile(content: string): CapabilityLockfile | null;
|
|
246
|
+
/**
|
|
247
|
+
* Write a lockfile to disk.
|
|
248
|
+
*
|
|
249
|
+
* @param lockfile - The lockfile to persist
|
|
250
|
+
* @param projectRoot - Project root directory
|
|
251
|
+
*/
|
|
252
|
+
export declare function writeLockfile(lockfile: CapabilityLockfile, projectRoot: string): Promise<void>;
|
|
253
|
+
/**
|
|
254
|
+
* Read a lockfile from disk.
|
|
255
|
+
*
|
|
256
|
+
* @param projectRoot - Project root directory
|
|
257
|
+
* @returns Parsed lockfile, or null if not found / invalid
|
|
258
|
+
*/
|
|
259
|
+
export declare function readLockfile(projectRoot: string): Promise<CapabilityLockfile | null>;
|
|
260
|
+
export {};
|
|
261
|
+
//# sourceMappingURL=CapabilityLockfile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CapabilityLockfile.d.ts","sourceRoot":"","sources":["../../src/introspection/CapabilityLockfile.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAStD,uCAAuC;AACvC,QAAA,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAEpC,6BAA6B;AAC7B,eAAO,MAAM,aAAa,EAAG,WAAoB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,eAAe,EAAE,OAAO,gBAAgB,CAAC;IAClD,sBAAsB;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,6BAA6B;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,uEAAuE;IACvE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,sCAAsC;IACtC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;CAC/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACjC,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MA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,OAAO,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAexE;AAMD;;;;;GAKG;AACH,wBAAsB,aAAa,CAC/B,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAC9B,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAQpC"}
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CapabilityLockfile — Behavioral Surface Snapshot
|
|
3
|
+
*
|
|
4
|
+
* Generates a deterministic, human-readable, git-diffable lockfile
|
|
5
|
+
* that captures the complete behavioral surface of an Vurb
|
|
6
|
+
* server at a point in time.
|
|
7
|
+
*
|
|
8
|
+
* **Inspired by**: `yarn.lock`, `package-lock.json`, `Cargo.lock`.
|
|
9
|
+
* Those files snapshot the dependency resolution graph so that every
|
|
10
|
+
* `install` produces the same tree. `vurb.lock` does the same
|
|
11
|
+
* for the **behavioral surface** — ensuring that every deployment
|
|
12
|
+
* exposes the same tool contracts, cognitive guardrails, entitlements,
|
|
13
|
+
* and token economics that were reviewed and approved.
|
|
14
|
+
*
|
|
15
|
+
* **Why this matters for AI**:
|
|
16
|
+
*
|
|
17
|
+
* An LLM's calibration to a tool server depends on the *behavioral*
|
|
18
|
+
* surface — not just the input schema. If a system rule changes, an
|
|
19
|
+
* affordance link disappears, or a Presenter's egress schema mutates,
|
|
20
|
+
* the LLM may hallucinate or violate requirements. The lockfile makes
|
|
21
|
+
* these invisible changes **visible and auditable** in version control.
|
|
22
|
+
*
|
|
23
|
+
* **Workflow**:
|
|
24
|
+
*
|
|
25
|
+
* ```bash
|
|
26
|
+
* # Generate or update the lockfile
|
|
27
|
+
* vurb lock
|
|
28
|
+
*
|
|
29
|
+
* # CI gate: fail if the lockfile is stale
|
|
30
|
+
* vurb lock --check
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* The lockfile is committed alongside the code. Pull request diffs
|
|
34
|
+
* show exactly which behavioral surfaces changed, enabling reviewers
|
|
35
|
+
* to assess AI-facing impact before merge.
|
|
36
|
+
*
|
|
37
|
+
* Pure-function module for generation and verification.
|
|
38
|
+
* Side-effectful I/O is clearly separated.
|
|
39
|
+
*
|
|
40
|
+
* @module
|
|
41
|
+
*/
|
|
42
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
43
|
+
import { resolve } from 'node:path';
|
|
44
|
+
import { computeServerDigest } from './BehaviorDigest.js';
|
|
45
|
+
import { sha256, canonicalize } from './canonicalize.js';
|
|
46
|
+
// ============================================================================
|
|
47
|
+
// Lockfile Schema
|
|
48
|
+
// ============================================================================
|
|
49
|
+
/** Current lockfile format version. */
|
|
50
|
+
const LOCKFILE_VERSION = 1;
|
|
51
|
+
/** Default lockfile name. */
|
|
52
|
+
export const LOCKFILE_NAME = 'vurb.lock';
|
|
53
|
+
/**
|
|
54
|
+
* Generate a `CapabilityLockfile` from compiled tool contracts
|
|
55
|
+
* and (optionally) prompt builders.
|
|
56
|
+
*
|
|
57
|
+
* This is a **pure function**: given the same contracts and metadata,
|
|
58
|
+
* it always produces the same lockfile (modulo `generatedAt` timestamp).
|
|
59
|
+
*
|
|
60
|
+
* @param serverName - MCP server name
|
|
61
|
+
* @param contracts - Record of tool name → materialized contract
|
|
62
|
+
* @param vurbVersion - Vurb version string
|
|
63
|
+
* @param options - Optional: prompt builders to include
|
|
64
|
+
* @returns A fully materialized lockfile
|
|
65
|
+
*/
|
|
66
|
+
export async function generateLockfile(serverName, contracts, vurbVersion, options) {
|
|
67
|
+
const serverDigest = await computeServerDigest(contracts);
|
|
68
|
+
const sortedNames = Object.keys(contracts).sort();
|
|
69
|
+
const tools = {};
|
|
70
|
+
for (const name of sortedNames) {
|
|
71
|
+
tools[name] = snapshotTool(contracts[name], serverDigest.tools[name]);
|
|
72
|
+
}
|
|
73
|
+
// ── Prompt Snapshots ─────────────────────────────────
|
|
74
|
+
const promptBuilders = options?.prompts ?? [];
|
|
75
|
+
let prompts;
|
|
76
|
+
const promptDigestParts = [];
|
|
77
|
+
if (promptBuilders.length > 0) {
|
|
78
|
+
prompts = {};
|
|
79
|
+
// Deduplicate by name — last-registered builder wins
|
|
80
|
+
const buildersByName = new Map();
|
|
81
|
+
for (const b of promptBuilders) {
|
|
82
|
+
buildersByName.set(b.getName(), b);
|
|
83
|
+
}
|
|
84
|
+
const sortedPromptNames = [...buildersByName.keys()].sort();
|
|
85
|
+
for (const name of sortedPromptNames) {
|
|
86
|
+
const builder = buildersByName.get(name);
|
|
87
|
+
const snapshot = await snapshotPrompt(builder);
|
|
88
|
+
prompts[name] = snapshot;
|
|
89
|
+
promptDigestParts.push(`${name}:${snapshot.integrityDigest}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// ── Integrity Digest (tools + prompts) ───────────────
|
|
93
|
+
const digestInput = promptDigestParts.length > 0
|
|
94
|
+
? `${serverDigest.digest}\n---prompts---\n${promptDigestParts.join('\n')}`
|
|
95
|
+
: serverDigest.digest;
|
|
96
|
+
const integrityDigest = promptDigestParts.length > 0
|
|
97
|
+
? await sha256(digestInput)
|
|
98
|
+
: serverDigest.digest;
|
|
99
|
+
const capabilities = prompts
|
|
100
|
+
? { tools, prompts }
|
|
101
|
+
: { tools };
|
|
102
|
+
return {
|
|
103
|
+
lockfileVersion: LOCKFILE_VERSION,
|
|
104
|
+
serverName,
|
|
105
|
+
vurbVersion,
|
|
106
|
+
generatedAt: new Date().toISOString(),
|
|
107
|
+
integrityDigest: `sha256:${integrityDigest}`,
|
|
108
|
+
capabilities,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Serialize a lockfile to a deterministic JSON string.
|
|
113
|
+
*
|
|
114
|
+
* Uses sorted keys and 2-space indentation for git-friendly diffs.
|
|
115
|
+
* The output is canonical — identical lockfiles produce identical strings.
|
|
116
|
+
*
|
|
117
|
+
* @param lockfile - The lockfile to serialize
|
|
118
|
+
* @returns Deterministic JSON string with trailing newline
|
|
119
|
+
*/
|
|
120
|
+
export function serializeLockfile(lockfile) {
|
|
121
|
+
return JSON.stringify(lockfile, (_key, value) => {
|
|
122
|
+
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
|
123
|
+
return Object.keys(value)
|
|
124
|
+
.sort()
|
|
125
|
+
.reduce((sorted, k) => {
|
|
126
|
+
sorted[k] = value[k];
|
|
127
|
+
return sorted;
|
|
128
|
+
}, {});
|
|
129
|
+
}
|
|
130
|
+
return value;
|
|
131
|
+
}, 2) + '\n';
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Verify that a lockfile matches the current server contracts and prompts.
|
|
135
|
+
*
|
|
136
|
+
* This is the **CI gate**: `vurb lock --check` calls this function
|
|
137
|
+
* and exits non-zero if the lockfile is stale.
|
|
138
|
+
*
|
|
139
|
+
* @param lockfile - Previously generated lockfile (from disk)
|
|
140
|
+
* @param contracts - Current compiled tool contracts (from code)
|
|
141
|
+
* @param options - Optional: prompt builders for prompt verification
|
|
142
|
+
* @returns Check result with per-tool and per-prompt diff details
|
|
143
|
+
*/
|
|
144
|
+
export async function checkLockfile(lockfile, contracts, options) {
|
|
145
|
+
// Regenerate a fresh lockfile to compare digests
|
|
146
|
+
const fresh = await generateLockfile(lockfile.serverName, contracts, lockfile.vurbVersion, options);
|
|
147
|
+
// Fast path: integrity digest matches → everything is identical
|
|
148
|
+
if (lockfile.integrityDigest === fresh.integrityDigest) {
|
|
149
|
+
return {
|
|
150
|
+
ok: true,
|
|
151
|
+
message: 'Lockfile is up to date.',
|
|
152
|
+
added: [],
|
|
153
|
+
removed: [],
|
|
154
|
+
changed: [],
|
|
155
|
+
unchanged: Object.keys(contracts).sort(),
|
|
156
|
+
addedPrompts: [],
|
|
157
|
+
removedPrompts: [],
|
|
158
|
+
changedPrompts: [],
|
|
159
|
+
unchangedPrompts: Object.keys(fresh.capabilities.prompts ?? {}).sort(),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
// Slow path: per-tool comparison
|
|
163
|
+
const lockedToolNames = new Set(Object.keys(lockfile.capabilities.tools));
|
|
164
|
+
const currentToolNames = new Set(Object.keys(contracts));
|
|
165
|
+
const added = [];
|
|
166
|
+
const removed = [];
|
|
167
|
+
const changed = [];
|
|
168
|
+
const unchanged = [];
|
|
169
|
+
for (const name of currentToolNames) {
|
|
170
|
+
if (!lockedToolNames.has(name)) {
|
|
171
|
+
added.push(name);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
const lockedDigest = lockfile.capabilities.tools[name].integrityDigest;
|
|
175
|
+
const freshDigest = fresh.capabilities.tools[name].integrityDigest;
|
|
176
|
+
if (lockedDigest === freshDigest) {
|
|
177
|
+
unchanged.push(name);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
changed.push(name);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
for (const name of lockedToolNames) {
|
|
185
|
+
if (!currentToolNames.has(name)) {
|
|
186
|
+
removed.push(name);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// ── Per-prompt comparison ────────────────────────────
|
|
190
|
+
const lockedPrompts = lockfile.capabilities.prompts ?? {};
|
|
191
|
+
const freshPrompts = fresh.capabilities.prompts ?? {};
|
|
192
|
+
const lockedPromptNames = new Set(Object.keys(lockedPrompts));
|
|
193
|
+
const currentPromptNames = new Set(Object.keys(freshPrompts));
|
|
194
|
+
const addedPrompts = [];
|
|
195
|
+
const removedPrompts = [];
|
|
196
|
+
const changedPrompts = [];
|
|
197
|
+
const unchangedPrompts = [];
|
|
198
|
+
for (const name of currentPromptNames) {
|
|
199
|
+
if (!lockedPromptNames.has(name)) {
|
|
200
|
+
addedPrompts.push(name);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
const lockedDigest = lockedPrompts[name].integrityDigest;
|
|
204
|
+
const freshDigest = freshPrompts[name].integrityDigest;
|
|
205
|
+
if (lockedDigest === freshDigest) {
|
|
206
|
+
unchangedPrompts.push(name);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
changedPrompts.push(name);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
for (const name of lockedPromptNames) {
|
|
214
|
+
if (!currentPromptNames.has(name)) {
|
|
215
|
+
removedPrompts.push(name);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// ── Build message ────────────────────────────────────
|
|
219
|
+
const driftParts = [];
|
|
220
|
+
if (added.length > 0)
|
|
221
|
+
driftParts.push(`tools added: [${added.join(', ')}]`);
|
|
222
|
+
if (removed.length > 0)
|
|
223
|
+
driftParts.push(`tools removed: [${removed.join(', ')}]`);
|
|
224
|
+
if (changed.length > 0)
|
|
225
|
+
driftParts.push(`tools changed: [${changed.join(', ')}]`);
|
|
226
|
+
if (addedPrompts.length > 0)
|
|
227
|
+
driftParts.push(`prompts added: [${addedPrompts.join(', ')}]`);
|
|
228
|
+
if (removedPrompts.length > 0)
|
|
229
|
+
driftParts.push(`prompts removed: [${removedPrompts.join(', ')}]`);
|
|
230
|
+
if (changedPrompts.length > 0)
|
|
231
|
+
driftParts.push(`prompts changed: [${changedPrompts.join(', ')}]`);
|
|
232
|
+
return {
|
|
233
|
+
ok: false,
|
|
234
|
+
message: `Lockfile is stale. ${driftParts.join('; ')}. Run \`vurb lock\` to update.`,
|
|
235
|
+
added,
|
|
236
|
+
removed,
|
|
237
|
+
changed,
|
|
238
|
+
unchanged,
|
|
239
|
+
addedPrompts,
|
|
240
|
+
removedPrompts,
|
|
241
|
+
changedPrompts,
|
|
242
|
+
unchangedPrompts,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Parse and validate a lockfile JSON string.
|
|
247
|
+
*
|
|
248
|
+
* @param content - Raw JSON string from `vurb.lock`
|
|
249
|
+
* @returns Parsed lockfile, or null if invalid
|
|
250
|
+
*/
|
|
251
|
+
export function parseLockfile(content) {
|
|
252
|
+
try {
|
|
253
|
+
const parsed = JSON.parse(content);
|
|
254
|
+
if (parsed['lockfileVersion'] !== LOCKFILE_VERSION)
|
|
255
|
+
return null;
|
|
256
|
+
if (typeof parsed['serverName'] !== 'string')
|
|
257
|
+
return null;
|
|
258
|
+
if (typeof parsed['integrityDigest'] !== 'string')
|
|
259
|
+
return null;
|
|
260
|
+
if (typeof parsed['generatedAt'] !== 'string')
|
|
261
|
+
return null;
|
|
262
|
+
if (typeof parsed['vurbVersion'] !== 'string')
|
|
263
|
+
return null;
|
|
264
|
+
if (!parsed['capabilities'] || typeof parsed['capabilities'] !== 'object')
|
|
265
|
+
return null;
|
|
266
|
+
const caps = parsed['capabilities'];
|
|
267
|
+
if (!caps['tools'] || typeof caps['tools'] !== 'object')
|
|
268
|
+
return null;
|
|
269
|
+
return parsed;
|
|
270
|
+
}
|
|
271
|
+
catch {
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// ============================================================================
|
|
276
|
+
// Persistence (Side-effectful — clearly separated)
|
|
277
|
+
// ============================================================================
|
|
278
|
+
/**
|
|
279
|
+
* Write a lockfile to disk.
|
|
280
|
+
*
|
|
281
|
+
* @param lockfile - The lockfile to persist
|
|
282
|
+
* @param projectRoot - Project root directory
|
|
283
|
+
*/
|
|
284
|
+
export async function writeLockfile(lockfile, projectRoot) {
|
|
285
|
+
const filePath = resolve(projectRoot, LOCKFILE_NAME);
|
|
286
|
+
await writeFile(filePath, serializeLockfile(lockfile), 'utf-8');
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Read a lockfile from disk.
|
|
290
|
+
*
|
|
291
|
+
* @param projectRoot - Project root directory
|
|
292
|
+
* @returns Parsed lockfile, or null if not found / invalid
|
|
293
|
+
*/
|
|
294
|
+
export async function readLockfile(projectRoot) {
|
|
295
|
+
const filePath = resolve(projectRoot, LOCKFILE_NAME);
|
|
296
|
+
try {
|
|
297
|
+
const content = await readFile(filePath, 'utf-8');
|
|
298
|
+
return parseLockfile(content);
|
|
299
|
+
}
|
|
300
|
+
catch {
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
// ============================================================================
|
|
305
|
+
// Internals
|
|
306
|
+
// ============================================================================
|
|
307
|
+
/**
|
|
308
|
+
* Snapshot a single tool's contract into lockfile format.
|
|
309
|
+
* @internal
|
|
310
|
+
*/
|
|
311
|
+
function snapshotTool(contract, digest) {
|
|
312
|
+
const actionKeys = Object.keys(contract.surface.actions).sort();
|
|
313
|
+
const destructiveActions = actionKeys.filter(key => contract.surface.actions[key].destructive);
|
|
314
|
+
const readOnlyActions = actionKeys.filter(key => contract.surface.actions[key].readOnly);
|
|
315
|
+
return {
|
|
316
|
+
integrityDigest: `sha256:${digest.digest}`,
|
|
317
|
+
surface: {
|
|
318
|
+
description: contract.surface.description ?? null,
|
|
319
|
+
actions: actionKeys,
|
|
320
|
+
inputSchemaDigest: `sha256:${contract.surface.inputSchemaDigest}`,
|
|
321
|
+
tags: [...contract.surface.tags].sort(),
|
|
322
|
+
},
|
|
323
|
+
behavior: {
|
|
324
|
+
egressSchemaDigest: contract.behavior.egressSchemaDigest
|
|
325
|
+
? `sha256:${contract.behavior.egressSchemaDigest}`
|
|
326
|
+
: null,
|
|
327
|
+
systemRulesFingerprint: contract.behavior.systemRulesFingerprint,
|
|
328
|
+
destructiveActions,
|
|
329
|
+
readOnlyActions,
|
|
330
|
+
middlewareChain: [...contract.behavior.middlewareChain],
|
|
331
|
+
affordanceTopology: [...contract.behavior.affordanceTopology],
|
|
332
|
+
cognitiveGuardrails: {
|
|
333
|
+
agentLimitMax: contract.behavior.cognitiveGuardrails.agentLimitMax,
|
|
334
|
+
egressMaxBytes: contract.behavior.cognitiveGuardrails.egressMaxBytes,
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
tokenEconomics: {
|
|
338
|
+
inflationRisk: contract.tokenEconomics.inflationRisk,
|
|
339
|
+
schemaFieldCount: contract.tokenEconomics.schemaFieldCount,
|
|
340
|
+
unboundedCollection: contract.tokenEconomics.unboundedCollection,
|
|
341
|
+
},
|
|
342
|
+
entitlements: {
|
|
343
|
+
filesystem: contract.entitlements.filesystem,
|
|
344
|
+
network: contract.entitlements.network,
|
|
345
|
+
subprocess: contract.entitlements.subprocess,
|
|
346
|
+
crypto: contract.entitlements.crypto,
|
|
347
|
+
codeEvaluation: contract.entitlements.codeEvaluation,
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Snapshot a single prompt builder into lockfile format.
|
|
353
|
+
*
|
|
354
|
+
* Extracts all declarative metadata and computes a SHA-256 digest
|
|
355
|
+
* over the canonical representation.
|
|
356
|
+
*
|
|
357
|
+
* @internal
|
|
358
|
+
*/
|
|
359
|
+
async function snapshotPrompt(builder) {
|
|
360
|
+
const def = builder.buildPromptDefinition();
|
|
361
|
+
const tags = [...builder.getTags()].sort();
|
|
362
|
+
const hasMiddleware = builder.hasMiddleware();
|
|
363
|
+
const hydrationTimeout = builder.getHydrationTimeout() ?? null;
|
|
364
|
+
// Normalize arguments for deterministic serialization
|
|
365
|
+
const args = (def.arguments ?? [])
|
|
366
|
+
.map(a => ({
|
|
367
|
+
name: a.name,
|
|
368
|
+
description: a.description ?? null,
|
|
369
|
+
required: a.required ?? false,
|
|
370
|
+
}))
|
|
371
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
372
|
+
const argumentsDigest = `sha256:${await sha256(canonicalize(args))}`;
|
|
373
|
+
// Compute integrity digest over all declarative fields
|
|
374
|
+
const surface = {
|
|
375
|
+
name: def.name,
|
|
376
|
+
description: def.description ?? null,
|
|
377
|
+
title: def.title ?? null,
|
|
378
|
+
tags,
|
|
379
|
+
arguments: args,
|
|
380
|
+
hasMiddleware,
|
|
381
|
+
hydrationTimeout,
|
|
382
|
+
};
|
|
383
|
+
const integrityDigest = `sha256:${await sha256(canonicalize(surface))}`;
|
|
384
|
+
return {
|
|
385
|
+
integrityDigest,
|
|
386
|
+
description: def.description ?? null,
|
|
387
|
+
title: def.title ?? null,
|
|
388
|
+
tags,
|
|
389
|
+
arguments: args,
|
|
390
|
+
argumentsDigest,
|
|
391
|
+
hasMiddleware,
|
|
392
|
+
hydrationTimeout,
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
//# sourceMappingURL=CapabilityLockfile.js.map
|