@kamilio/wire 0.1.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/bin/wire-mcp.mjs +6 -0
- package/bin/wire.mjs +5 -0
- package/dist/adapters/root.d.ts +31 -0
- package/dist/adapters/root.d.ts.map +1 -0
- package/dist/adapters/root.js +447 -0
- package/dist/adapters/root.js.map +1 -0
- package/dist/adapters/services/catalog.d.ts +3 -0
- package/dist/adapters/services/catalog.d.ts.map +1 -0
- package/dist/adapters/services/catalog.js +18 -0
- package/dist/adapters/services/catalog.js.map +1 -0
- package/dist/auth.d.ts +25 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +305 -0
- package/dist/auth.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +526 -0
- package/dist/cli.js.map +1 -0
- package/dist/executable.d.ts +3 -0
- package/dist/executable.d.ts.map +1 -0
- package/dist/executable.js +101 -0
- package/dist/executable.js.map +1 -0
- package/dist/hooks.d.ts +9 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +176 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp.d.ts +6 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +8 -0
- package/dist/mcp.js.map +1 -0
- package/node_modules/ajv/.runkit_example.js +23 -0
- package/node_modules/ajv/LICENSE +22 -0
- package/node_modules/ajv/README.md +207 -0
- package/node_modules/ajv/dist/2019.d.ts +19 -0
- package/node_modules/ajv/dist/2019.js +61 -0
- package/node_modules/ajv/dist/2019.js.map +1 -0
- package/node_modules/ajv/dist/2020.d.ts +19 -0
- package/node_modules/ajv/dist/2020.js +55 -0
- package/node_modules/ajv/dist/2020.js.map +1 -0
- package/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/node_modules/ajv/dist/ajv.js +50 -0
- package/node_modules/ajv/dist/ajv.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/node_modules/ajv/dist/compile/codegen/code.js +156 -0
- package/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/index.js +697 -0
- package/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
- package/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/node_modules/ajv/dist/compile/errors.js +123 -0
- package/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/node_modules/ajv/dist/compile/index.js +242 -0
- package/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js +236 -0
- package/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/node_modules/ajv/dist/compile/names.js +28 -0
- package/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/node_modules/ajv/dist/compile/ref_error.js +12 -0
- package/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/node_modules/ajv/dist/compile/resolve.js +155 -0
- package/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/node_modules/ajv/dist/compile/rules.js +26 -0
- package/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/node_modules/ajv/dist/compile/util.js +178 -0
- package/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js +19 -0
- package/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js +203 -0
- package/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js +35 -0
- package/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/node_modules/ajv/dist/compile/validate/index.js +520 -0
- package/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js +124 -0
- package/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js +81 -0
- package/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/node_modules/ajv/dist/core.d.ts +174 -0
- package/node_modules/ajv/dist/core.js +618 -0
- package/node_modules/ajv/dist/core.js.map +1 -0
- package/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/node_modules/ajv/dist/jtd.js +72 -0
- package/node_modules/ajv/dist/jtd.js.map +1 -0
- package/node_modules/ajv/dist/refs/data.json +13 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/equal.js +7 -0
- package/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js +24 -0
- package/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/node_modules/ajv/dist/runtime/validation_error.js +11 -0
- package/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/node_modules/ajv/dist/standalone/index.js +90 -0
- package/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/node_modules/ajv/dist/types/index.js +3 -0
- package/node_modules/ajv/dist/types/index.js.map +1 -0
- package/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +106 -0
- package/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
- package/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/node_modules/ajv/dist/vocabularies/code.js +131 -0
- package/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js +10 -0
- package/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js +16 -0
- package/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js +122 -0
- package/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js +104 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js +23 -0
- package/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js +92 -0
- package/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js +6 -0
- package/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js +18 -0
- package/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/next.js +8 -0
- package/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +65 -0
- package/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js +25 -0
- package/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js +79 -0
- package/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/node_modules/ajv/lib/2019.ts +81 -0
- package/node_modules/ajv/lib/2020.ts +75 -0
- package/node_modules/ajv/lib/ajv.ts +70 -0
- package/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/node_modules/ajv/lib/compile/index.ts +324 -0
- package/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/node_modules/ajv/lib/compile/jtd/serialize.ts +277 -0
- package/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/node_modules/ajv/lib/compile/names.ts +27 -0
- package/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/node_modules/ajv/lib/compile/util.ts +213 -0
- package/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/node_modules/ajv/lib/core.ts +892 -0
- package/node_modules/ajv/lib/jtd.ts +132 -0
- package/node_modules/ajv/lib/refs/data.json +13 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/node_modules/ajv/lib/types/index.ts +244 -0
- package/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/node_modules/ajv/lib/vocabularies/validation/pattern.ts +39 -0
- package/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/node_modules/ajv/package.json +126 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1176 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +150 -0
- package/node_modules/commander/lib/command.js +2777 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +747 -0
- package/node_modules/commander/lib/option.js +380 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +19 -0
- package/node_modules/commander/package.json +82 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +1113 -0
- package/node_modules/fast-deep-equal/LICENSE +21 -0
- package/node_modules/fast-deep-equal/README.md +96 -0
- package/node_modules/fast-deep-equal/es6/index.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/index.js +72 -0
- package/node_modules/fast-deep-equal/es6/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/es6/react.js +79 -0
- package/node_modules/fast-deep-equal/index.d.ts +4 -0
- package/node_modules/fast-deep-equal/index.js +46 -0
- package/node_modules/fast-deep-equal/package.json +61 -0
- package/node_modules/fast-deep-equal/react.d.ts +2 -0
- package/node_modules/fast-deep-equal/react.js +53 -0
- package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/node_modules/fast-string-truncated-width/license +21 -0
- package/node_modules/fast-string-truncated-width/package.json +35 -0
- package/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-width/dist/index.js +14 -0
- package/node_modules/fast-string-width/license +21 -0
- package/node_modules/fast-string-width/package.json +34 -0
- package/node_modules/fast-string-width/readme.md +42 -0
- package/node_modules/fast-uri/.gitattributes +2 -0
- package/node_modules/fast-uri/.github/dependabot.yml +13 -0
- package/node_modules/fast-uri/.github/workflows/ci.yml +106 -0
- package/node_modules/fast-uri/.github/workflows/lock-threads.yml +19 -0
- package/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +24 -0
- package/node_modules/fast-uri/LICENSE +30 -0
- package/node_modules/fast-uri/README.md +152 -0
- package/node_modules/fast-uri/benchmark/benchmark.mjs +159 -0
- package/node_modules/fast-uri/benchmark/equal.mjs +51 -0
- package/node_modules/fast-uri/benchmark/non-simple-domain.mjs +22 -0
- package/node_modules/fast-uri/benchmark/package.json +17 -0
- package/node_modules/fast-uri/benchmark/string-array-to-hex-stripped.mjs +24 -0
- package/node_modules/fast-uri/benchmark/ws-is-secure.mjs +65 -0
- package/node_modules/fast-uri/eslint.config.js +6 -0
- package/node_modules/fast-uri/index.js +406 -0
- package/node_modules/fast-uri/lib/schemes.js +267 -0
- package/node_modules/fast-uri/lib/utils.js +443 -0
- package/node_modules/fast-uri/package.json +68 -0
- package/node_modules/fast-uri/test/ajv.test.js +43 -0
- package/node_modules/fast-uri/test/equal.test.js +117 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +501 -0
- package/node_modules/fast-uri/test/fixtures/uri-js-serialize.json +120 -0
- package/node_modules/fast-uri/test/parse.test.js +323 -0
- package/node_modules/fast-uri/test/resolve.test.js +87 -0
- package/node_modules/fast-uri/test/rfc-3986.test.js +90 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +39 -0
- package/node_modules/fast-uri/test/security.test.js +133 -0
- package/node_modules/fast-uri/test/serialize.test.js +151 -0
- package/node_modules/fast-uri/test/uri-js-compatibility.test.js +33 -0
- package/node_modules/fast-uri/test/uri-js.test.js +912 -0
- package/node_modules/fast-uri/test/util.test.js +38 -0
- package/node_modules/fast-uri/tsconfig.json +9 -0
- package/node_modules/fast-uri/types/index.d.ts +60 -0
- package/node_modules/fast-uri/types/index.test-d.ts +17 -0
- package/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/node_modules/fast-wrap-ansi/README.md +26 -0
- package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
- package/node_modules/fast-wrap-ansi/package.json +51 -0
- package/node_modules/ignore/LICENSE-MIT +21 -0
- package/node_modules/ignore/README.md +412 -0
- package/node_modules/ignore/index.d.ts +61 -0
- package/node_modules/ignore/index.js +636 -0
- package/node_modules/ignore/legacy.js +559 -0
- package/node_modules/ignore/package.json +74 -0
- package/node_modules/jose/LICENSE.md +21 -0
- package/node_modules/jose/README.md +153 -0
- package/node_modules/jose/dist/types/index.d.ts +55 -0
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +31 -0
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +65 -0
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +31 -0
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +83 -0
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +38 -0
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +74 -0
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +17 -0
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +32 -0
- package/node_modules/jose/dist/types/jwks/local.d.ts +29 -0
- package/node_modules/jose/dist/types/jwks/remote.d.ts +237 -0
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +36 -0
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +33 -0
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +42 -0
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +33 -0
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +53 -0
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +41 -0
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +35 -0
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +91 -0
- package/node_modules/jose/dist/types/jwt/sign.d.ts +43 -0
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +43 -0
- package/node_modules/jose/dist/types/jwt/verify.d.ts +37 -0
- package/node_modules/jose/dist/types/key/export.d.ts +33 -0
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +47 -0
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +35 -0
- package/node_modules/jose/dist/types/key/import.d.ts +83 -0
- package/node_modules/jose/dist/types/types.d.ts +852 -0
- package/node_modules/jose/dist/types/util/base64url.d.ts +9 -0
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +18 -0
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +17 -0
- package/node_modules/jose/dist/types/util/errors.d.ts +213 -0
- package/node_modules/jose/dist/webapi/index.js +32 -0
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +27 -0
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +27 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +159 -0
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +167 -0
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +31 -0
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +182 -0
- package/node_modules/jose/dist/webapi/jwk/embedded.js +17 -0
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +68 -0
- package/node_modules/jose/dist/webapi/jwks/local.js +119 -0
- package/node_modules/jose/dist/webapi/jwks/remote.js +179 -0
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +18 -0
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +21 -0
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +89 -0
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +110 -0
- package/node_modules/jose/dist/webapi/jws/general/sign.js +70 -0
- package/node_modules/jose/dist/webapi/jws/general/verify.js +24 -0
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +23 -0
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +101 -0
- package/node_modules/jose/dist/webapi/jwt/sign.js +52 -0
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +63 -0
- package/node_modules/jose/dist/webapi/jwt/verify.js +15 -0
- package/node_modules/jose/dist/webapi/key/export.js +11 -0
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +97 -0
- package/node_modules/jose/dist/webapi/key/generate_secret.js +40 -0
- package/node_modules/jose/dist/webapi/key/import.js +57 -0
- package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +15 -0
- package/node_modules/jose/dist/webapi/lib/aeskw.js +25 -0
- package/node_modules/jose/dist/webapi/lib/asn1.js +243 -0
- package/node_modules/jose/dist/webapi/lib/base64.js +22 -0
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +43 -0
- package/node_modules/jose/dist/webapi/lib/check_key_type.js +122 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +217 -0
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +136 -0
- package/node_modules/jose/dist/webapi/lib/deflate.js +44 -0
- package/node_modules/jose/dist/webapi/lib/ecdhes.js +52 -0
- package/node_modules/jose/dist/webapi/lib/helpers.js +19 -0
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +27 -0
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -0
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +107 -0
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +238 -0
- package/node_modules/jose/dist/webapi/lib/key_management.js +186 -0
- package/node_modules/jose/dist/webapi/lib/key_to_jwk.js +31 -0
- package/node_modules/jose/dist/webapi/lib/normalize_key.js +166 -0
- package/node_modules/jose/dist/webapi/lib/pbes2kw.js +42 -0
- package/node_modules/jose/dist/webapi/lib/rsaes.js +24 -0
- package/node_modules/jose/dist/webapi/lib/signing.js +68 -0
- package/node_modules/jose/dist/webapi/lib/type_checks.js +40 -0
- package/node_modules/jose/dist/webapi/lib/validate_algorithms.js +10 -0
- package/node_modules/jose/dist/webapi/lib/validate_crit.js +33 -0
- package/node_modules/jose/dist/webapi/util/base64url.js +30 -0
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -0
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +34 -0
- package/node_modules/jose/dist/webapi/util/errors.js +99 -0
- package/node_modules/jose/package.json +200 -0
- package/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/node_modules/json-schema-traverse/.github/FUNDING.yml +2 -0
- package/node_modules/json-schema-traverse/.github/workflows/build.yml +28 -0
- package/node_modules/json-schema-traverse/.github/workflows/publish.yml +27 -0
- package/node_modules/json-schema-traverse/LICENSE +21 -0
- package/node_modules/json-schema-traverse/README.md +95 -0
- package/node_modules/json-schema-traverse/index.d.ts +40 -0
- package/node_modules/json-schema-traverse/index.js +93 -0
- package/node_modules/json-schema-traverse/package.json +43 -0
- package/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/node_modules/jsonc-parser/README.md +364 -0
- package/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/node_modules/jsonc-parser/package.json +37 -0
- package/node_modules/pct-encode/.travis.yml +7 -0
- package/node_modules/pct-encode/AUTHORS +2 -0
- package/node_modules/pct-encode/LICENSE +11 -0
- package/node_modules/pct-encode/README.md +20 -0
- package/node_modules/pct-encode/index.js +23 -0
- package/node_modules/pct-encode/package.json +23 -0
- package/node_modules/pct-encode/test.js +10 -0
- package/node_modules/provider-asana/dist/asana-project.d.ts +29 -0
- package/node_modules/provider-asana/dist/asana-project.d.ts.map +1 -0
- package/node_modules/provider-asana/dist/asana-project.js +226 -0
- package/node_modules/provider-asana/dist/asana-project.js.map +1 -0
- package/node_modules/provider-asana/dist/asana-sync.d.ts +32 -0
- package/node_modules/provider-asana/dist/asana-sync.d.ts.map +1 -0
- package/node_modules/provider-asana/dist/asana-sync.js +208 -0
- package/node_modules/provider-asana/dist/asana-sync.js.map +1 -0
- package/node_modules/provider-asana/dist/asana-task.d.ts +29 -0
- package/node_modules/provider-asana/dist/asana-task.d.ts.map +1 -0
- package/node_modules/provider-asana/dist/asana-task.js +96 -0
- package/node_modules/provider-asana/dist/asana-task.js.map +1 -0
- package/node_modules/provider-asana/dist/index.d.ts +58 -0
- package/node_modules/provider-asana/dist/index.d.ts.map +1 -0
- package/node_modules/provider-asana/dist/index.js +9 -0
- package/node_modules/provider-asana/dist/index.js.map +1 -0
- package/node_modules/provider-asana/package.json +29 -0
- package/node_modules/provider-asana/src/asana-project.ts +202 -0
- package/node_modules/provider-asana/src/asana-sync.ts +217 -0
- package/node_modules/provider-asana/src/asana-task.ts +92 -0
- package/node_modules/provider-asana/src/index.ts +10 -0
- package/node_modules/provider-chatgpt/dist/chatgpt.d.ts +29 -0
- package/node_modules/provider-chatgpt/dist/chatgpt.d.ts.map +1 -0
- package/node_modules/provider-chatgpt/dist/chatgpt.js +169 -0
- package/node_modules/provider-chatgpt/dist/chatgpt.js.map +1 -0
- package/node_modules/provider-chatgpt/dist/index.d.ts +30 -0
- package/node_modules/provider-chatgpt/dist/index.d.ts.map +1 -0
- package/node_modules/provider-chatgpt/dist/index.js +6 -0
- package/node_modules/provider-chatgpt/dist/index.js.map +1 -0
- package/node_modules/provider-chatgpt/package.json +26 -0
- package/node_modules/provider-chatgpt/src/chatgpt.ts +158 -0
- package/node_modules/provider-chatgpt/src/index.ts +6 -0
- package/node_modules/provider-gmail/dist/gmail.d.ts +28 -0
- package/node_modules/provider-gmail/dist/gmail.d.ts.map +1 -0
- package/node_modules/provider-gmail/dist/gmail.js +86 -0
- package/node_modules/provider-gmail/dist/gmail.js.map +1 -0
- package/node_modules/provider-gmail/dist/index.d.ts +30 -0
- package/node_modules/provider-gmail/dist/index.d.ts.map +1 -0
- package/node_modules/provider-gmail/dist/index.js +6 -0
- package/node_modules/provider-gmail/dist/index.js.map +1 -0
- package/node_modules/provider-gmail/package.json +26 -0
- package/node_modules/provider-gmail/src/gmail.ts +83 -0
- package/node_modules/provider-gmail/src/index.ts +6 -0
- package/node_modules/provider-google-docs/dist/google-docs.d.ts +28 -0
- package/node_modules/provider-google-docs/dist/google-docs.d.ts.map +1 -0
- package/node_modules/provider-google-docs/dist/google-docs.js +833 -0
- package/node_modules/provider-google-docs/dist/google-docs.js.map +1 -0
- package/node_modules/provider-google-docs/dist/index.d.ts +30 -0
- package/node_modules/provider-google-docs/dist/index.d.ts.map +1 -0
- package/node_modules/provider-google-docs/dist/index.js +6 -0
- package/node_modules/provider-google-docs/dist/index.js.map +1 -0
- package/node_modules/provider-google-docs/package.json +26 -0
- package/node_modules/provider-google-docs/src/google-docs.ts +760 -0
- package/node_modules/provider-google-docs/src/index.ts +6 -0
- package/node_modules/provider-notion/dist/index.d.ts +32 -0
- package/node_modules/provider-notion/dist/index.d.ts.map +1 -0
- package/node_modules/provider-notion/dist/index.js +7 -0
- package/node_modules/provider-notion/dist/index.js.map +1 -0
- package/node_modules/provider-notion/dist/notion-sync.d.ts +56 -0
- package/node_modules/provider-notion/dist/notion-sync.d.ts.map +1 -0
- package/node_modules/provider-notion/dist/notion-sync.js +1036 -0
- package/node_modules/provider-notion/dist/notion-sync.js.map +1 -0
- package/node_modules/provider-notion/dist/notion.d.ts +28 -0
- package/node_modules/provider-notion/dist/notion.d.ts.map +1 -0
- package/node_modules/provider-notion/dist/notion.js +12 -0
- package/node_modules/provider-notion/dist/notion.js.map +1 -0
- package/node_modules/provider-notion/package.json +29 -0
- package/node_modules/provider-notion/src/index.ts +8 -0
- package/node_modules/provider-notion/src/notion-sync.ts +968 -0
- package/node_modules/provider-notion/src/notion.ts +14 -0
- package/node_modules/provider-slack/dist/index.d.ts +30 -0
- package/node_modules/provider-slack/dist/index.d.ts.map +1 -0
- package/node_modules/provider-slack/dist/index.js +6 -0
- package/node_modules/provider-slack/dist/index.js.map +1 -0
- package/node_modules/provider-slack/dist/slack.d.ts +28 -0
- package/node_modules/provider-slack/dist/slack.d.ts.map +1 -0
- package/node_modules/provider-slack/dist/slack.js +115 -0
- package/node_modules/provider-slack/dist/slack.js.map +1 -0
- package/node_modules/provider-slack/package.json +26 -0
- package/node_modules/provider-slack/src/index.ts +6 -0
- package/node_modules/provider-slack/src/slack.ts +108 -0
- package/node_modules/provider-zoom/dist/index.d.ts +30 -0
- package/node_modules/provider-zoom/dist/index.d.ts.map +1 -0
- package/node_modules/provider-zoom/dist/index.js +6 -0
- package/node_modules/provider-zoom/dist/index.js.map +1 -0
- package/node_modules/provider-zoom/dist/zoom-hub.d.ts +28 -0
- package/node_modules/provider-zoom/dist/zoom-hub.d.ts.map +1 -0
- package/node_modules/provider-zoom/dist/zoom-hub.js +209 -0
- package/node_modules/provider-zoom/dist/zoom-hub.js.map +1 -0
- package/node_modules/provider-zoom/package.json +26 -0
- package/node_modules/provider-zoom/src/index.ts +6 -0
- package/node_modules/provider-zoom/src/zoom-hub.ts +218 -0
- package/node_modules/require-from-string/index.js +34 -0
- package/node_modules/require-from-string/license +21 -0
- package/node_modules/require-from-string/package.json +28 -0
- package/node_modules/require-from-string/readme.md +56 -0
- package/node_modules/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/node_modules/smol-toml/LICENSE +24 -0
- package/node_modules/smol-toml/README.md +239 -0
- package/node_modules/smol-toml/dist/date.d.ts +41 -0
- package/node_modules/smol-toml/dist/date.js +127 -0
- package/node_modules/smol-toml/dist/error.d.ts +38 -0
- package/node_modules/smol-toml/dist/error.js +63 -0
- package/node_modules/smol-toml/dist/extract.d.ts +30 -0
- package/node_modules/smol-toml/dist/extract.js +100 -0
- package/node_modules/smol-toml/dist/index.cjs +897 -0
- package/node_modules/smol-toml/dist/index.d.ts +43 -0
- package/node_modules/smol-toml/dist/index.js +33 -0
- package/node_modules/smol-toml/dist/parse.d.ts +37 -0
- package/node_modules/smol-toml/dist/parse.js +148 -0
- package/node_modules/smol-toml/dist/primitive.d.ts +31 -0
- package/node_modules/smol-toml/dist/primitive.js +179 -0
- package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
- package/node_modules/smol-toml/dist/stringify.js +167 -0
- package/node_modules/smol-toml/dist/struct.d.ts +32 -0
- package/node_modules/smol-toml/dist/struct.js +184 -0
- package/node_modules/smol-toml/dist/util.d.ts +42 -0
- package/node_modules/smol-toml/dist/util.js +111 -0
- package/node_modules/smol-toml/package.json +54 -0
- package/node_modules/tiny-stdio-mcp-server/README.md +180 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/audio.d.ts +14 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/audio.js +84 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/convert.d.ts +16 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/convert.js +61 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/file-type.d.ts +11 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/file-type.js +93 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/file.d.ts +27 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/file.js +110 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/image.d.ts +14 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/image.js +72 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/index.d.ts +5 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/index.js +8 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/mime.d.ts +7 -0
- package/node_modules/tiny-stdio-mcp-server/dist/content/mime.js +52 -0
- package/node_modules/tiny-stdio-mcp-server/dist/index.d.ts +9 -0
- package/node_modules/tiny-stdio-mcp-server/dist/index.js +7 -0
- package/node_modules/tiny-stdio-mcp-server/dist/jsonrpc.d.ts +14 -0
- package/node_modules/tiny-stdio-mcp-server/dist/jsonrpc.js +117 -0
- package/node_modules/tiny-stdio-mcp-server/dist/schema.d.ts +19 -0
- package/node_modules/tiny-stdio-mcp-server/dist/schema.js +23 -0
- package/node_modules/tiny-stdio-mcp-server/dist/server.d.ts +29 -0
- package/node_modules/tiny-stdio-mcp-server/dist/server.js +666 -0
- package/node_modules/tiny-stdio-mcp-server/dist/types.d.ts +248 -0
- package/node_modules/tiny-stdio-mcp-server/dist/types.js +20 -0
- package/node_modules/tiny-stdio-mcp-server/package.json +53 -0
- package/node_modules/toolcraft/README.md +549 -0
- package/node_modules/toolcraft/dist/api-error-summary.d.ts +53 -0
- package/node_modules/toolcraft/dist/api-error-summary.js +162 -0
- package/node_modules/toolcraft/dist/cli.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/dist/cli.compile-check.js +40 -0
- package/node_modules/toolcraft/dist/cli.d.ts +32 -0
- package/node_modules/toolcraft/dist/cli.js +3533 -0
- package/node_modules/toolcraft/dist/design/brand.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/brand.js +1 -0
- package/node_modules/toolcraft/dist/design/brands.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/brands.js +1 -0
- package/node_modules/toolcraft/dist/design/cancel.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/cancel.js +1 -0
- package/node_modules/toolcraft/dist/design/color.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/color.js +1 -0
- package/node_modules/toolcraft/dist/design/configure-theme.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/configure-theme.js +1 -0
- package/node_modules/toolcraft/dist/design/confirm-or-cancel.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/confirm-or-cancel.js +1 -0
- package/node_modules/toolcraft/dist/design/confirm.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/confirm.js +1 -0
- package/node_modules/toolcraft/dist/design/create-dashboard.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/create-dashboard.js +1 -0
- package/node_modules/toolcraft/dist/design/create-logger.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/create-logger.js +1 -0
- package/node_modules/toolcraft/dist/design/dark.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/dark.js +1 -0
- package/node_modules/toolcraft/dist/design/format-columns.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/format-columns.js +1 -0
- package/node_modules/toolcraft/dist/design/format-command-list.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/format-command-list.js +1 -0
- package/node_modules/toolcraft/dist/design/format-command-not-found-panel.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/format-command-not-found-panel.js +1 -0
- package/node_modules/toolcraft/dist/design/format-command-not-found.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/format-command-not-found.js +1 -0
- package/node_modules/toolcraft/dist/design/format-command.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/format-command.js +1 -0
- package/node_modules/toolcraft/dist/design/format-option-list.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/format-option-list.js +1 -0
- package/node_modules/toolcraft/dist/design/format-option.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/format-option.js +1 -0
- package/node_modules/toolcraft/dist/design/format-usage.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/format-usage.js +1 -0
- package/node_modules/toolcraft/dist/design/get-template-partial-names.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/get-template-partial-names.js +1 -0
- package/node_modules/toolcraft/dist/design/get-theme-config.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/get-theme-config.js +1 -0
- package/node_modules/toolcraft/dist/design/get-theme.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/get-theme.js +1 -0
- package/node_modules/toolcraft/dist/design/help-formatter-plain.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/help-formatter-plain.js +2 -0
- package/node_modules/toolcraft/dist/design/help-formatter.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/help-formatter.js +1 -0
- package/node_modules/toolcraft/dist/design/intro-plain.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/intro-plain.js +1 -0
- package/node_modules/toolcraft/dist/design/intro.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/intro.js +1 -0
- package/node_modules/toolcraft/dist/design/is-cancel.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/is-cancel.js +1 -0
- package/node_modules/toolcraft/dist/design/light.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/light.js +1 -0
- package/node_modules/toolcraft/dist/design/log.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/log.js +1 -0
- package/node_modules/toolcraft/dist/design/logger.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/logger.js +1 -0
- package/node_modules/toolcraft/dist/design/multiselect.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/multiselect.js +1 -0
- package/node_modules/toolcraft/dist/design/note.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/note.js +1 -0
- package/node_modules/toolcraft/dist/design/open-external.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/open-external.js +1 -0
- package/node_modules/toolcraft/dist/design/outro.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/outro.js +1 -0
- package/node_modules/toolcraft/dist/design/parse.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/parse.js +1 -0
- package/node_modules/toolcraft/dist/design/password.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/password.js +1 -0
- package/node_modules/toolcraft/dist/design/prompt-cancelled-error.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/prompt-cancelled-error.js +1 -0
- package/node_modules/toolcraft/dist/design/prompt-text.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/prompt-text.js +1 -0
- package/node_modules/toolcraft/dist/design/prompt-theme.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/prompt-theme.js +1 -0
- package/node_modules/toolcraft/dist/design/render-catalog.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-catalog.js +1 -0
- package/node_modules/toolcraft/dist/design/render-detail-card.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-detail-card.js +1 -0
- package/node_modules/toolcraft/dist/design/render-html.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-html.js +1 -0
- package/node_modules/toolcraft/dist/design/render-inspector-card.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-inspector-card.js +1 -0
- package/node_modules/toolcraft/dist/design/render-markdown-html.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-markdown-html.js +1 -0
- package/node_modules/toolcraft/dist/design/render-markdown.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-markdown.js +1 -0
- package/node_modules/toolcraft/dist/design/render-menu.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-menu.js +1 -0
- package/node_modules/toolcraft/dist/design/render-resource-browser.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-resource-browser.js +1 -0
- package/node_modules/toolcraft/dist/design/render-spinner-frame.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-spinner-frame.js +1 -0
- package/node_modules/toolcraft/dist/design/render-spinner-stopped.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-spinner-stopped.js +1 -0
- package/node_modules/toolcraft/dist/design/render-table.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-table.js +1 -0
- package/node_modules/toolcraft/dist/design/render-template.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render-template.js +1 -0
- package/node_modules/toolcraft/dist/design/render.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/render.js +1 -0
- package/node_modules/toolcraft/dist/design/reset-output-format-cache.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/reset-output-format-cache.js +1 -0
- package/node_modules/toolcraft/dist/design/reset-theme-cache.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/reset-theme-cache.js +1 -0
- package/node_modules/toolcraft/dist/design/reset-theme.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/reset-theme.js +1 -0
- package/node_modules/toolcraft/dist/design/resolve-output-format.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/resolve-output-format.js +1 -0
- package/node_modules/toolcraft/dist/design/resolve-template-partials.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/resolve-template-partials.js +1 -0
- package/node_modules/toolcraft/dist/design/resolve-theme-name.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/resolve-theme-name.js +1 -0
- package/node_modules/toolcraft/dist/design/run-explorer.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/run-explorer.js +1 -0
- package/node_modules/toolcraft/dist/design/run-two-pane-explorer.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/run-two-pane-explorer.js +1 -0
- package/node_modules/toolcraft/dist/design/select.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/select.js +1 -0
- package/node_modules/toolcraft/dist/design/should-use-interactive-dashboard.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/should-use-interactive-dashboard.js +1 -0
- package/node_modules/toolcraft/dist/design/single-detail.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/single-detail.js +1 -0
- package/node_modules/toolcraft/dist/design/spacing.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/spacing.js +1 -0
- package/node_modules/toolcraft/dist/design/spinner-frames.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/spinner-frames.js +1 -0
- package/node_modules/toolcraft/dist/design/spinner.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/spinner.js +1 -0
- package/node_modules/toolcraft/dist/design/strip-ansi.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/strip-ansi.js +1 -0
- package/node_modules/toolcraft/dist/design/symbols.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/symbols.js +1 -0
- package/node_modules/toolcraft/dist/design/text.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/text.js +1 -0
- package/node_modules/toolcraft/dist/design/typography.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/typography.js +1 -0
- package/node_modules/toolcraft/dist/design/widths.d.ts +1 -0
- package/node_modules/toolcraft/dist/design/widths.js +1 -0
- package/node_modules/toolcraft/dist/design/with-output-format.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/with-output-format.js +1 -0
- package/node_modules/toolcraft/dist/design/with-spinner.d.ts +2 -0
- package/node_modules/toolcraft/dist/design/with-spinner.js +1 -0
- package/node_modules/toolcraft/dist/design.d.ts +1 -0
- package/node_modules/toolcraft/dist/design.js +1 -0
- package/node_modules/toolcraft/dist/error-codes.d.ts +1 -0
- package/node_modules/toolcraft/dist/error-codes.js +6 -0
- package/node_modules/toolcraft/dist/error-report.d.ts +39 -0
- package/node_modules/toolcraft/dist/error-report.js +432 -0
- package/node_modules/toolcraft/dist/http-errors.d.ts +57 -0
- package/node_modules/toolcraft/dist/http-errors.js +72 -0
- package/node_modules/toolcraft/dist/human-in-loop/approval-tasks.d.ts +32 -0
- package/node_modules/toolcraft/dist/human-in-loop/approval-tasks.js +206 -0
- package/node_modules/toolcraft/dist/human-in-loop/approvals-commands.d.ts +11 -0
- package/node_modules/toolcraft/dist/human-in-loop/approvals-commands.js +228 -0
- package/node_modules/toolcraft/dist/human-in-loop/config.d.ts +11 -0
- package/node_modules/toolcraft/dist/human-in-loop/config.js +21 -0
- package/node_modules/toolcraft/dist/human-in-loop/default-provider.d.ts +2 -0
- package/node_modules/toolcraft/dist/human-in-loop/default-provider.js +28 -0
- package/node_modules/toolcraft/dist/human-in-loop/gate.d.ts +4 -0
- package/node_modules/toolcraft/dist/human-in-loop/gate.js +57 -0
- package/node_modules/toolcraft/dist/human-in-loop/index.d.ts +7 -0
- package/node_modules/toolcraft/dist/human-in-loop/index.js +4 -0
- package/node_modules/toolcraft/dist/human-in-loop/runner.d.ts +3 -0
- package/node_modules/toolcraft/dist/human-in-loop/runner.js +245 -0
- package/node_modules/toolcraft/dist/human-in-loop/spawn.d.ts +3 -0
- package/node_modules/toolcraft/dist/human-in-loop/spawn.js +16 -0
- package/node_modules/toolcraft/dist/human-in-loop/state-machine.d.ts +4 -0
- package/node_modules/toolcraft/dist/human-in-loop/state-machine.js +18 -0
- package/node_modules/toolcraft/dist/human-in-loop/types.d.ts +41 -0
- package/node_modules/toolcraft/dist/human-in-loop/types.js +13 -0
- package/node_modules/toolcraft/dist/index.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/dist/index.compile-check.js +74 -0
- package/node_modules/toolcraft/dist/index.d.ts +212 -0
- package/node_modules/toolcraft/dist/index.js +476 -0
- package/node_modules/toolcraft/dist/json-schema-converter.d.ts +22 -0
- package/node_modules/toolcraft/dist/json-schema-converter.js +493 -0
- package/node_modules/toolcraft/dist/mcp-proxy.d.ts +12 -0
- package/node_modules/toolcraft/dist/mcp-proxy.js +489 -0
- package/node_modules/toolcraft/dist/mcp.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/dist/mcp.compile-check.js +29 -0
- package/node_modules/toolcraft/dist/mcp.d.ts +46 -0
- package/node_modules/toolcraft/dist/mcp.js +890 -0
- package/node_modules/toolcraft/dist/number-schema.d.ts +3 -0
- package/node_modules/toolcraft/dist/number-schema.js +15 -0
- package/node_modules/toolcraft/dist/package-metadata.d.ts +10 -0
- package/node_modules/toolcraft/dist/package-metadata.js +62 -0
- package/node_modules/toolcraft/dist/redaction.d.ts +4 -0
- package/node_modules/toolcraft/dist/redaction.js +70 -0
- package/node_modules/toolcraft/dist/renderer.d.ts +11 -0
- package/node_modules/toolcraft/dist/renderer.js +348 -0
- package/node_modules/toolcraft/dist/runtime-logging.d.ts +19 -0
- package/node_modules/toolcraft/dist/runtime-logging.js +42 -0
- package/node_modules/toolcraft/dist/schema-scope.d.ts +4 -0
- package/node_modules/toolcraft/dist/schema-scope.js +55 -0
- package/node_modules/toolcraft/dist/sdk.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/dist/sdk.compile-check.js +158 -0
- package/node_modules/toolcraft/dist/sdk.d.ts +81 -0
- package/node_modules/toolcraft/dist/sdk.js +494 -0
- package/node_modules/toolcraft/dist/source-snippet.d.ts +8 -0
- package/node_modules/toolcraft/dist/source-snippet.js +42 -0
- package/node_modules/toolcraft/dist/stack-trim.d.ts +4 -0
- package/node_modules/toolcraft/dist/stack-trim.js +70 -0
- package/node_modules/toolcraft/dist/suggest.d.ts +4 -0
- package/node_modules/toolcraft/dist/suggest.js +46 -0
- package/node_modules/toolcraft/dist/user-error.d.ts +6 -0
- package/node_modules/toolcraft/dist/user-error.js +12 -0
- package/node_modules/toolcraft/dist/validation-errors.d.ts +5 -0
- package/node_modules/toolcraft/dist/validation-errors.js +18 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/README.md +35 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/claude-code.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/claude-code.js +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/claude-desktop.js +18 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/codex.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/codex.js +25 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/cursor.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/cursor.js +15 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/gemini-cli.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/gemini-cli.js +16 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/goose.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/goose.js +16 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/index.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/index.js +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/kimi.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/kimi.js +16 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/opencode.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/opencode.js +20 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/agents/poe-agent.js +14 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/index.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/index.js +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/registry.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/registry.js +45 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/specifier.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/specifier.js +40 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/types.d.ts +28 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/dist/types.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-defs/package.json +20 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/README.md +42 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/index.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/index.js +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/providers/mock.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/providers/mock.js +18 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/providers/osascript-script.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/providers/osascript-script.js +46 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/providers/osascript.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/providers/osascript.js +39 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/request-approval.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/request-approval.js +46 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/types.d.ts +14 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/dist/types.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-human-in-loop/package.json +24 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/README.md +54 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/apply.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/apply.js +157 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/configs.d.ts +22 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/configs.js +83 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/index.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/index.js +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/shapes.d.ts +43 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/shapes.js +94 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/types.d.ts +25 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/dist/types.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/agent-mcp-config/package.json +23 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/README.md +55 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/error-codes.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/error-codes.js +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/execution/apply-mutation.js +829 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/execution/path-utils.d.ts +17 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/execution/path-utils.js +64 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/execution/run-mutations.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/execution/run-mutations.js +39 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/index.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/index.js +49 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/json.d.ts +32 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/json.js +171 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/object.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/object.js +27 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/toml.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/toml.js +75 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/yaml.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/formats/yaml.js +76 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/fs-utils.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/fs-utils.js +43 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/index.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/index.js +8 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/mutations/config-mutation.d.ts +47 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/mutations/config-mutation.js +34 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/mutations/file-mutation.d.ts +62 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/mutations/file-mutation.js +55 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/mutations/template-mutation.d.ts +40 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/mutations/template-mutation.js +32 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/template/render.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/template/render.js +8 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/testing/format-utils.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/testing/format-utils.js +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/testing/index.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/testing/index.js +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.d.ts +25 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/testing/mock-fs.js +194 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/types.d.ts +168 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/dist/types.js +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/config-mutations/package.json +29 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/README.md +35 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/fences.d.ts +25 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/fences.js +100 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/index.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/index.js +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/parse.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/parse.js +209 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/stringify.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/dist/stringify.js +48 -0
- package/node_modules/toolcraft/node_modules/@poe-code/frontmatter/package.json +25 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/README.md +41 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/args.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/args.js +61 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/build-context.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/build-context.js +37 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/context.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/context.js +30 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/docker-execution-env.d.ts +28 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/docker-execution-env.js +696 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/docker-runner.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/docker-runner.js +200 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/engine.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/engine.js +24 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/env-file.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/docker/env-file.js +49 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/host/host-execution-env.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/host/host-execution-env.js +62 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/host/host-runner.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/host/host-runner.js +124 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/index.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/index.js +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/testing/index.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/testing/index.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/testing/mock-runner.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/testing/mock-runner.js +137 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/testing/verify.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/testing/verify.js +359 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/types.d.ts +186 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/types.js +1 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/workspace-transfer.d.ts +61 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/dist/workspace-transfer.js +555 -0
- package/node_modules/toolcraft/node_modules/@poe-code/process-runner/package.json +34 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/README.md +271 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.d.ts +19 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/gh-issues-client.js +65 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/gh-issues-sync.d.ts +46 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/gh-issues-sync.js +357 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/gh-issues.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/gh-issues.js +1052 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/markdown-dir.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/markdown-dir.js +912 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/utils.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/utils.js +184 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/yaml-file.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/backends/yaml-file.js +610 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/index.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/index.js +7 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/move.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/move.js +218 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/open.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/open.js +82 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/schema/store.schema.json +32 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/schema/task.schema.json +33 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/state-machine.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/state-machine.js +81 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/state.d.ts +29 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/state.js +70 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/types.d.ts +205 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/dist/types.js +62 -0
- package/node_modules/toolcraft/node_modules/@poe-code/task-list/package.json +25 -0
- package/node_modules/toolcraft/node_modules/auth-store/README.md +47 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/create-secret-store.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/create-secret-store.js +44 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/encrypted-file-store.d.ts +47 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/encrypted-file-store.js +303 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/error-codes.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/error-codes.js +5 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/index.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/index.js +4 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/keychain-store.d.ts +25 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/keychain-store.js +154 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/provider-store.d.ts +14 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/provider-store.js +78 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/types.d.ts +22 -0
- package/node_modules/toolcraft/node_modules/auth-store/dist/types.js +1 -0
- package/node_modules/toolcraft/node_modules/auth-store/package.json +25 -0
- package/node_modules/toolcraft/node_modules/commander/LICENSE +22 -0
- package/node_modules/toolcraft/node_modules/commander/Readme.md +1149 -0
- package/node_modules/toolcraft/node_modules/commander/esm.mjs +16 -0
- package/node_modules/toolcraft/node_modules/commander/index.js +24 -0
- package/node_modules/toolcraft/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/toolcraft/node_modules/commander/lib/command.js +2662 -0
- package/node_modules/toolcraft/node_modules/commander/lib/error.js +39 -0
- package/node_modules/toolcraft/node_modules/commander/lib/help.js +709 -0
- package/node_modules/toolcraft/node_modules/commander/lib/option.js +367 -0
- package/node_modules/toolcraft/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/toolcraft/node_modules/commander/package-support.json +16 -0
- package/node_modules/toolcraft/node_modules/commander/package.json +82 -0
- package/node_modules/toolcraft/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/toolcraft/node_modules/commander/typings/index.d.ts +1045 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/README.md +31 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/auth-store-session-store.d.ts +14 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/auth-store-session-store.js +169 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/authorization-state.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/authorization-state.js +47 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/default-oauth-client-provider.js +627 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/loopback-authorization.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/loopback-authorization.js +207 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/pkce.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/pkce.js +7 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/token-endpoint.d.ts +40 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/token-endpoint.js +164 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/types.d.ts +113 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/client/types.js +1 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/index.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/index.js +7 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/resource-indicator.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/resource-indicator.js +11 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/server/jwks-token-verifier.d.ts +28 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/server/jwks-token-verifier.js +304 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/types.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/dist/types.compile-check.js +22 -0
- package/node_modules/toolcraft/node_modules/mcp-oauth/package.json +31 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/.turbo/turbo-build.log +7 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/README.md +104 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/index.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/index.js +1 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/internal.d.ts +556 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/internal.js +2688 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/jsonrpc-types.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/jsonrpc-types.compile-check.js +37 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-lifecycle-types.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-lifecycle-types.compile-check.js +50 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-prompt-types.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-prompt-types.compile-check.js +50 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-resource-types.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-resource-types.compile-check.js +51 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-tool-types.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-tool-types.compile-check.js +99 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-transport-types.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-transport-types.compile-check.js +56 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-utility-types.compile-check.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/mcp-utility-types.compile-check.js +145 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/oauth-discovery.d.ts +24 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/dist/oauth-discovery.js +382 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/package.json +20 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/http-oauth.integration.test.ts +808 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/http-oauth.test.ts +922 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/index.ts +94 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/internal.ts +3904 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/jsonrpc-types.compile-check.ts +66 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-client-http-transport.integration.test.ts +222 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-client-sdk.test.ts +1326 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-client-tiny-stdio-test-server-tools.test.ts +143 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-lifecycle-types.compile-check.ts +65 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-prompt-types.compile-check.ts +66 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-resource-types.compile-check.ts +70 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-tool-types.compile-check.ts +127 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-transport-types.compile-check.ts +75 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mcp-utility-types.compile-check.ts +181 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/mock-servers.test.ts +980 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/oauth-discovery.ts +578 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/package-runtime.test.ts +25 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/transports.test.ts +9018 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/src/utilities.test.ts +372 -0
- package/node_modules/toolcraft/node_modules/tiny-mcp-client/tsconfig.json +11 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/README.md +342 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/components.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/components.js +137 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/index.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/index.js +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/writer.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/acp/writer.js +21 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/brand.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/brand.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/brands.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/brands.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/cancel.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/cancel.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/color.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/color.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/browser.d.ts +15 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/browser.js +31 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/catalog.d.ts +26 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/catalog.js +95 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/color.d.ts +31 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/color.js +102 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/command-errors.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/command-errors.js +23 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/detail-card.d.ts +22 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/detail-card.js +45 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/help-formatter-plain.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/help-formatter-plain.js +132 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/help-formatter.d.ts +33 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/help-formatter.js +213 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/index.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/index.js +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/inspector-card.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/inspector-card.js +42 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/logger.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/logger.js +60 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/resource-browser.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/resource-browser.js +98 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/symbols.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/symbols.js +71 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/table.d.ts +15 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/table.js +302 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/template.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/template.js +437 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/text.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/components/text.js +145 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/configure-theme.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/configure-theme.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/confirm-or-cancel.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/confirm-or-cancel.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/confirm.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/confirm.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/create-dashboard.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/create-dashboard.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/create-logger.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/create-logger.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dark.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dark.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/ansi.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/ansi.js +343 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/buffer.d.ts +25 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/buffer.js +219 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/border.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/border.js +123 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/footer.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/footer.js +56 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/output-pane.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/output-pane.js +268 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/stats-pane.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/components/stats-pane.js +107 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/dashboard.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/dashboard.js +167 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/demo.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/demo.js +145 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/index.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/index.js +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/keymap.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/keymap.js +233 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/layout.d.ts +25 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/layout.js +79 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/should-use-dashboard.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/should-use-dashboard.js +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/snapshot.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/snapshot.js +68 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/store.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/store.js +51 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/terminal-width.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/terminal-width.js +71 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/terminal.d.ts +37 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/terminal.js +264 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/types.d.ts +38 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/dashboard/types.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/actions.d.ts +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/actions.js +39 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/demo.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/demo.js +297 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/events.d.ts +67 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/events.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/filter.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/filter.js +95 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/index.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/index.js +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/jobs.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/jobs.js +59 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/keymap.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/keymap.js +376 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/layout.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/layout.js +75 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/reducer.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/reducer.js +798 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/detail.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/detail.js +110 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/footer.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/footer.js +73 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/header.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/header.js +49 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/index.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/index.js +53 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/list.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/list.js +135 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/modal.d.ts +3 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/modal.js +87 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/pane.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/pane.js +30 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/test-fixtures.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/test-fixtures.js +156 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/text.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/render/text.js +81 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/runtime.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/runtime.js +358 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/runtime.test-helpers.d.ts +50 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/runtime.test-helpers.js +101 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/state.d.ts +137 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/state.js +86 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/theme.d.ts +27 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/theme.js +29 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/two-pane.d.ts +102 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/explorer/two-pane.js +510 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-columns.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-columns.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-command-list.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-command-list.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-command-not-found-panel.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-command-not-found-panel.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-command-not-found.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-command-not-found.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-command.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-command.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-option-list.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-option-list.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-option.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-option.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-usage.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/format-usage.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/get-template-partial-names.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/get-template-partial-names.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/get-theme-config.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/get-theme-config.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/get-theme.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/get-theme.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/help-formatter-plain.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/help-formatter-plain.js +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/help-formatter.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/help-formatter.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/index.d.ts +54 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/index.js +45 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/color-support.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/color-support.js +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/output-format.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/output-format.js +22 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/strip-ansi.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/strip-ansi.js +50 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/theme-detect.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/theme-detect.js +71 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/theme-state.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/internal/theme-state.js +35 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/intro-plain.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/intro-plain.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/intro.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/intro.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/is-cancel.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/is-cancel.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/light.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/light.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/log.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/log.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/logger.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/logger.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/multiselect.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/multiselect.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/note.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/note.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/open-external.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/open-external.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/outro.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/outro.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/parse.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/parse.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/password.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/password.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompt-cancelled-error.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompt-cancelled-error.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompt-text.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompt-text.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompt-theme.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompt-theme.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/index.d.ts +91 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/index.js +137 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/cancel-symbol.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/cancel-symbol.js +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/confirm.d.ts +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/confirm.js +47 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/core.d.ts +55 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/core.js +274 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/glyphs.d.ts +20 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/glyphs.js +53 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/index.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/index.js +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/keys.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/keys.js +31 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/multiselect.d.ts +13 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/multiselect.js +135 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/pagination.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/pagination.js +52 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/password.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/password.js +55 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/select.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/select.js +89 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/test-helpers.d.ts +21 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/test-helpers.js +32 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/text.d.ts +12 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/text.js +60 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/wrap.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/interactive/wrap.js +18 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/cancel.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/cancel.js +9 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/intro.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/intro.js +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/log.d.ts +18 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/log.js +104 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/note.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/note.js +39 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/outro.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/outro.js +16 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/spinner.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/primitives/spinner.js +74 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/theme.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/prompts/theme.js +15 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-catalog.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-catalog.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-detail-card.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-detail-card.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-html.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-html.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-inspector-card.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-inspector-card.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-markdown-html.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-markdown-html.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-markdown.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-markdown.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-menu.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-menu.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-resource-browser.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-resource-browser.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-spinner-frame.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-spinner-frame.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-spinner-stopped.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-spinner-stopped.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-table.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-table.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-template.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render-template.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/render.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/reset-output-format-cache.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/reset-output-format-cache.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/reset-theme-cache.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/reset-theme-cache.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/reset-theme.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/reset-theme.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/resolve-output-format.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/resolve-output-format.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/resolve-template-partials.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/resolve-template-partials.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/resolve-theme-name.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/resolve-theme-name.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/run-explorer.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/run-explorer.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/run-two-pane-explorer.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/run-two-pane-explorer.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/select.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/select.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/should-use-interactive-dashboard.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/should-use-interactive-dashboard.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/single-detail.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/single-detail.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/spacing.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/spacing.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/spinner-frames.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/spinner-frames.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/spinner.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/spinner.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/static/index.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/static/index.js +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/static/menu.d.ts +11 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/static/menu.js +42 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/static/spinner.d.ts +14 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/static/spinner.js +52 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/strip-ansi.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/strip-ansi.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/symbols.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/symbols.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/ast.d.ts +98 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/ast.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/demo-content.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/demo-content.js +139 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/html-renderer.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/html-renderer.js +366 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/index.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/index.js +14 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/block.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/block.js +1495 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/code-highlight.d.ts +4 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/code-highlight.js +1357 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.d.ts +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/frontmatter.js +36 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/inline.d.ts +10 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser/inline.js +1190 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/parser.js +42 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/renderer.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/renderer.js +677 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/testing/theme-render-fixture.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/terminal-markdown/testing/theme-render-fixture.js +27 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/text.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/text.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/brand.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/brand.js +5 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/colors.d.ts +37 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/colors.js +85 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/index.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/index.js +5 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/spacing.d.ts +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/spacing.js +6 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/typography.d.ts +7 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/typography.js +8 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/widths.d.ts +5 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/tokens/widths.js +5 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/typography.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/typography.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/widths.d.ts +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/widths.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/with-output-format.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/with-output-format.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/with-spinner.d.ts +2 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/dist/with-spinner.js +1 -0
- package/node_modules/toolcraft/node_modules/toolcraft-design/package.json +48 -0
- package/node_modules/toolcraft/package.json +103 -0
- package/node_modules/toolcraft-schema/README.md +75 -0
- package/node_modules/toolcraft-schema/dist/index.compile-check.d.ts +1 -0
- package/node_modules/toolcraft-schema/dist/index.compile-check.js +17 -0
- package/node_modules/toolcraft-schema/dist/index.d.ts +159 -0
- package/node_modules/toolcraft-schema/dist/index.js +294 -0
- package/node_modules/toolcraft-schema/dist/json-schema-document.d.ts +14 -0
- package/node_modules/toolcraft-schema/dist/json-schema-document.js +17 -0
- package/node_modules/toolcraft-schema/dist/json.compile-check.d.ts +1 -0
- package/node_modules/toolcraft-schema/dist/json.compile-check.js +2 -0
- package/node_modules/toolcraft-schema/dist/json.d.ts +10 -0
- package/node_modules/toolcraft-schema/dist/json.js +5 -0
- package/node_modules/toolcraft-schema/dist/oneof.compile-check.d.ts +1 -0
- package/node_modules/toolcraft-schema/dist/oneof.compile-check.js +12 -0
- package/node_modules/toolcraft-schema/dist/oneof.d.ts +15 -0
- package/node_modules/toolcraft-schema/dist/oneof.js +18 -0
- package/node_modules/toolcraft-schema/dist/record.compile-check.d.ts +1 -0
- package/node_modules/toolcraft-schema/dist/record.compile-check.js +2 -0
- package/node_modules/toolcraft-schema/dist/record.d.ts +5 -0
- package/node_modules/toolcraft-schema/dist/record.js +6 -0
- package/node_modules/toolcraft-schema/dist/union.compile-check.d.ts +1 -0
- package/node_modules/toolcraft-schema/dist/union.compile-check.js +9 -0
- package/node_modules/toolcraft-schema/dist/union.d.ts +8 -0
- package/node_modules/toolcraft-schema/dist/union.js +45 -0
- package/node_modules/toolcraft-schema/dist/validate.d.ts +16 -0
- package/node_modules/toolcraft-schema/dist/validate.js +379 -0
- package/node_modules/toolcraft-schema/package.json +30 -0
- package/node_modules/uri-template/AUTHORS +2 -0
- package/node_modules/uri-template/LICENSE +19 -0
- package/node_modules/uri-template/README.md +34 -0
- package/node_modules/uri-template/dist/ast.d.ts +28 -0
- package/node_modules/uri-template/dist/ast.js +27 -0
- package/node_modules/uri-template/dist/expander.d.ts +3 -0
- package/node_modules/uri-template/dist/expander.js +165 -0
- package/node_modules/uri-template/dist/grammar.d.ts +13 -0
- package/node_modules/uri-template/dist/grammar.js +749 -0
- package/node_modules/uri-template/dist/index.d.ts +19 -0
- package/node_modules/uri-template/dist/index.js +43 -0
- package/node_modules/uri-template/lib/ast.ts +59 -0
- package/node_modules/uri-template/lib/expander.ts +175 -0
- package/node_modules/uri-template/lib/grammar.js +773 -0
- package/node_modules/uri-template/lib/grammar.pegjs +33 -0
- package/node_modules/uri-template/lib/index.ts +33 -0
- package/node_modules/uri-template/package.json +33 -0
- package/node_modules/uri-template-lite/README.md +86 -0
- package/node_modules/uri-template-lite/index.js +140 -0
- package/node_modules/uri-template-lite/package.json +43 -0
- package/node_modules/wire-core/dist/core/json.d.ts +4 -0
- package/node_modules/wire-core/dist/core/json.d.ts.map +1 -0
- package/node_modules/wire-core/dist/core/json.js +65 -0
- package/node_modules/wire-core/dist/core/json.js.map +1 -0
- package/node_modules/wire-core/dist/core/model.d.ts +67 -0
- package/node_modules/wire-core/dist/core/model.d.ts.map +1 -0
- package/node_modules/wire-core/dist/core/model.js +2 -0
- package/node_modules/wire-core/dist/core/model.js.map +1 -0
- package/node_modules/wire-core/dist/core/resource.d.ts +4 -0
- package/node_modules/wire-core/dist/core/resource.d.ts.map +1 -0
- package/node_modules/wire-core/dist/core/resource.js +47 -0
- package/node_modules/wire-core/dist/core/resource.js.map +1 -0
- package/node_modules/wire-core/dist/core/source.d.ts +16 -0
- package/node_modules/wire-core/dist/core/source.d.ts.map +1 -0
- package/node_modules/wire-core/dist/core/source.js +45 -0
- package/node_modules/wire-core/dist/core/source.js.map +1 -0
- package/node_modules/wire-core/dist/core/transform.d.ts +39 -0
- package/node_modules/wire-core/dist/core/transform.d.ts.map +1 -0
- package/node_modules/wire-core/dist/core/transform.js +128 -0
- package/node_modules/wire-core/dist/core/transform.js.map +1 -0
- package/node_modules/wire-core/dist/index.d.ts +18 -0
- package/node_modules/wire-core/dist/index.d.ts.map +1 -0
- package/node_modules/wire-core/dist/index.js +12 -0
- package/node_modules/wire-core/dist/index.js.map +1 -0
- package/node_modules/wire-core/dist/operations.d.ts +66 -0
- package/node_modules/wire-core/dist/operations.d.ts.map +1 -0
- package/node_modules/wire-core/dist/operations.js +333 -0
- package/node_modules/wire-core/dist/operations.js.map +1 -0
- package/node_modules/wire-core/dist/ports.d.ts +116 -0
- package/node_modules/wire-core/dist/ports.d.ts.map +1 -0
- package/node_modules/wire-core/dist/ports.js +2 -0
- package/node_modules/wire-core/dist/ports.js.map +1 -0
- package/node_modules/wire-core/dist/runtime/chrome.d.ts +19 -0
- package/node_modules/wire-core/dist/runtime/chrome.d.ts.map +1 -0
- package/node_modules/wire-core/dist/runtime/chrome.js +292 -0
- package/node_modules/wire-core/dist/runtime/chrome.js.map +1 -0
- package/node_modules/wire-core/dist/runtime/cookies.d.ts +15 -0
- package/node_modules/wire-core/dist/runtime/cookies.d.ts.map +1 -0
- package/node_modules/wire-core/dist/runtime/cookies.js +200 -0
- package/node_modules/wire-core/dist/runtime/cookies.js.map +1 -0
- package/node_modules/wire-core/dist/runtime/google.d.ts +21 -0
- package/node_modules/wire-core/dist/runtime/google.d.ts.map +1 -0
- package/node_modules/wire-core/dist/runtime/google.js +61 -0
- package/node_modules/wire-core/dist/runtime/google.js.map +1 -0
- package/node_modules/wire-core/dist/runtime/node.d.ts +20 -0
- package/node_modules/wire-core/dist/runtime/node.d.ts.map +1 -0
- package/node_modules/wire-core/dist/runtime/node.js +93 -0
- package/node_modules/wire-core/dist/runtime/node.js.map +1 -0
- package/node_modules/wire-core/dist/storage/registry.d.ts +27 -0
- package/node_modules/wire-core/dist/storage/registry.d.ts.map +1 -0
- package/node_modules/wire-core/dist/storage/registry.js +305 -0
- package/node_modules/wire-core/dist/storage/registry.js.map +1 -0
- package/node_modules/wire-core/dist/storage/workspace.d.ts +14 -0
- package/node_modules/wire-core/dist/storage/workspace.d.ts.map +1 -0
- package/node_modules/wire-core/dist/storage/workspace.js +95 -0
- package/node_modules/wire-core/dist/storage/workspace.js.map +1 -0
- package/node_modules/wire-core/package.json +30 -0
- package/node_modules/wire-core/src/core/json.ts +71 -0
- package/node_modules/wire-core/src/core/model.ts +76 -0
- package/node_modules/wire-core/src/core/resource.ts +62 -0
- package/node_modules/wire-core/src/core/source.ts +76 -0
- package/node_modules/wire-core/src/core/transform.ts +155 -0
- package/node_modules/wire-core/src/index.ts +17 -0
- package/node_modules/wire-core/src/operations.ts +409 -0
- package/node_modules/wire-core/src/ports.ts +137 -0
- package/node_modules/wire-core/src/runtime/chrome.ts +319 -0
- package/node_modules/wire-core/src/runtime/cookies.ts +201 -0
- package/node_modules/wire-core/src/runtime/google.ts +88 -0
- package/node_modules/wire-core/src/runtime/node.ts +114 -0
- package/node_modules/wire-core/src/storage/registry.ts +336 -0
- package/node_modules/wire-core/src/storage/workspace.ts +96 -0
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +118 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/package.json +150 -0
- package/src/adapters/root.ts +469 -0
- package/src/adapters/services/catalog.ts +18 -0
- package/src/auth.ts +317 -0
- package/src/cli.ts +505 -0
- package/src/executable.ts +102 -0
- package/src/hooks.ts +196 -0
- package/src/index.ts +15 -0
- package/src/mcp.ts +11 -0
|
@@ -0,0 +1,3533 @@
|
|
|
1
|
+
import { access, lstat, readFile, rename, unlink, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { Command as CommanderCommand, CommanderError, InvalidArgumentError, Option } from "commander";
|
|
4
|
+
import { cancel, configureTheme, confirm, createLogger, formatCommandList, formatOptionList, getTheme, helpFormatterPlain, isCancel, note, promptText, renderTable, resetOutputFormatCache, select, text } from "toolcraft-design";
|
|
5
|
+
import { ApprovalDeclinedError, UserError, assertCommandRequirements, getCommandSourcePath, resolveCommandSecrets } from "./index.js";
|
|
6
|
+
import { hasOwnErrorCode } from "./error-codes.js";
|
|
7
|
+
import { mergeApprovalsGroup } from "./human-in-loop/approvals-commands.js";
|
|
8
|
+
import { writeErrorReport } from "./error-report.js";
|
|
9
|
+
import { invokeWithHumanInLoop } from "./human-in-loop/index.js";
|
|
10
|
+
import { resolveMcpProxies } from "./mcp-proxy.js";
|
|
11
|
+
import { getExpectedNumberDescription, isValidNumberSchemaValue } from "./number-schema.js";
|
|
12
|
+
import { findEntrypointPackageMetadata } from "./package-metadata.js";
|
|
13
|
+
import { redactHttpBody, redactHttpHeaderValue } from "./redaction.js";
|
|
14
|
+
import { createRuntimeLogger, isLogLevel, LOG_LEVELS } from "./runtime-logging.js";
|
|
15
|
+
import { summarizeHttpError } from "./api-error-summary.js";
|
|
16
|
+
import { renderResult } from "./renderer.js";
|
|
17
|
+
import { renderSourceSnippet } from "./source-snippet.js";
|
|
18
|
+
import { enableSourceMaps, formatDebugStack } from "./stack-trim.js";
|
|
19
|
+
import { suggest } from "./suggest.js";
|
|
20
|
+
import { throwValidationErrors } from "./validation-errors.js";
|
|
21
|
+
configureTheme({ brand: "blue", label: "Toolcraft" });
|
|
22
|
+
export { configureTheme };
|
|
23
|
+
const RESERVED_SERVICE_NAMES = new Set([
|
|
24
|
+
"params",
|
|
25
|
+
"secrets",
|
|
26
|
+
"fetch",
|
|
27
|
+
"fs",
|
|
28
|
+
"env",
|
|
29
|
+
"diagnostics",
|
|
30
|
+
"progress",
|
|
31
|
+
"runtimeOptions",
|
|
32
|
+
"root"
|
|
33
|
+
]);
|
|
34
|
+
const RESERVED_SERVICE_NAMES_MESSAGE = "Available reserved names: params, secrets, fetch, fs, env, diagnostics, progress, runtimeOptions, root.";
|
|
35
|
+
const NULL_OPTION_VALUE = Symbol("toolcraft.cli.null");
|
|
36
|
+
function inferProgramName(argv) {
|
|
37
|
+
const entrypoint = argv[1];
|
|
38
|
+
if (typeof entrypoint !== "string" || entrypoint.length === 0) {
|
|
39
|
+
return "toolcraft";
|
|
40
|
+
}
|
|
41
|
+
const parsed = path.parse(entrypoint);
|
|
42
|
+
return parsed.name.length > 0 ? parsed.name : "toolcraft";
|
|
43
|
+
}
|
|
44
|
+
function normalizeRoots(roots, argv) {
|
|
45
|
+
if (!Array.isArray(roots)) {
|
|
46
|
+
return roots;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
kind: "group",
|
|
50
|
+
name: inferProgramName(argv),
|
|
51
|
+
aliases: [],
|
|
52
|
+
secrets: {},
|
|
53
|
+
children: roots
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const HELP_FLAGS = new Set(["--help", "-h"]);
|
|
57
|
+
function unwrapOptional(schema) {
|
|
58
|
+
if (schema.kind === "optional") {
|
|
59
|
+
return unwrapOptional(schema.inner);
|
|
60
|
+
}
|
|
61
|
+
return schema;
|
|
62
|
+
}
|
|
63
|
+
function splitWords(value) {
|
|
64
|
+
const words = [];
|
|
65
|
+
let current = "";
|
|
66
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
67
|
+
const char = value[index] ?? "";
|
|
68
|
+
const lower = char.toLowerCase();
|
|
69
|
+
const upper = char.toUpperCase();
|
|
70
|
+
const isSeparator = char === "-" || char === "_" || char === " " || char === ".";
|
|
71
|
+
if (isSeparator) {
|
|
72
|
+
if (current.length > 0) {
|
|
73
|
+
words.push(current.toLowerCase());
|
|
74
|
+
current = "";
|
|
75
|
+
}
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const isUppercase = char !== lower && char === upper;
|
|
79
|
+
const previous = value[index - 1];
|
|
80
|
+
const next = value[index + 1];
|
|
81
|
+
const previousIsLowercase = previous !== undefined &&
|
|
82
|
+
previous === previous.toLowerCase() &&
|
|
83
|
+
previous !== previous.toUpperCase();
|
|
84
|
+
const nextIsLowercase = next !== undefined && next === next.toLowerCase() && next !== next.toUpperCase();
|
|
85
|
+
if (isUppercase && current.length > 0 && (previousIsLowercase || nextIsLowercase)) {
|
|
86
|
+
words.push(current.toLowerCase());
|
|
87
|
+
current = char;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
current += char;
|
|
91
|
+
}
|
|
92
|
+
if (current.length > 0) {
|
|
93
|
+
words.push(current.toLowerCase());
|
|
94
|
+
}
|
|
95
|
+
return words;
|
|
96
|
+
}
|
|
97
|
+
function formatSegment(segment, casing) {
|
|
98
|
+
const separator = casing === "snake" ? "_" : "-";
|
|
99
|
+
return splitWords(segment).join(separator);
|
|
100
|
+
}
|
|
101
|
+
function toOptionFlag(path, casing) {
|
|
102
|
+
return `--${path.map((segment) => formatSegment(segment, casing)).join(".")}`;
|
|
103
|
+
}
|
|
104
|
+
function toOptionAttribute(path, casing) {
|
|
105
|
+
return path
|
|
106
|
+
.map((segment) => {
|
|
107
|
+
const formatted = formatSegment(segment, casing);
|
|
108
|
+
if (casing === "snake") {
|
|
109
|
+
return formatted;
|
|
110
|
+
}
|
|
111
|
+
const words = formatted.split("-");
|
|
112
|
+
return words
|
|
113
|
+
.map((word, index) => index === 0 ? word : `${word[0]?.toUpperCase() ?? ""}${word.slice(1)}`)
|
|
114
|
+
.join("");
|
|
115
|
+
})
|
|
116
|
+
.join(".");
|
|
117
|
+
}
|
|
118
|
+
function toDisplayPath(path) {
|
|
119
|
+
return path.join(".");
|
|
120
|
+
}
|
|
121
|
+
function toUnionKindControlPath(path) {
|
|
122
|
+
if (path.length === 0) {
|
|
123
|
+
return ["kind"];
|
|
124
|
+
}
|
|
125
|
+
const head = path.slice(0, -1);
|
|
126
|
+
const tail = path[path.length - 1] ?? "";
|
|
127
|
+
return [...head, `${tail}Kind`];
|
|
128
|
+
}
|
|
129
|
+
function toUnionKindDisplayPath(path) {
|
|
130
|
+
if (path.length === 0) {
|
|
131
|
+
return "kind";
|
|
132
|
+
}
|
|
133
|
+
const head = path.slice(0, -1);
|
|
134
|
+
const tail = path[path.length - 1] ?? "";
|
|
135
|
+
return [...head, `${tail}-kind`].join(".");
|
|
136
|
+
}
|
|
137
|
+
function createSyntheticEnumSchema(values) {
|
|
138
|
+
if (values.length === 0) {
|
|
139
|
+
throw new Error("Synthetic enum schema requires at least one value.");
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
kind: "enum",
|
|
143
|
+
values: values
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function getRequiredBranchFingerprint(branch, casing) {
|
|
147
|
+
const requiredKeys = Object.entries(branch.shape)
|
|
148
|
+
.filter(([, schema]) => schema.kind !== "optional")
|
|
149
|
+
.map(([key]) => formatSegment(key, casing))
|
|
150
|
+
.sort();
|
|
151
|
+
return requiredKeys.join("+");
|
|
152
|
+
}
|
|
153
|
+
function collectFields(schema, casing, globalLongOptionFlags, path = [], inheritedOptional = false, variantContext) {
|
|
154
|
+
const collected = {
|
|
155
|
+
dynamicFields: [],
|
|
156
|
+
fields: [],
|
|
157
|
+
variants: []
|
|
158
|
+
};
|
|
159
|
+
for (const [key, rawChildSchema] of Object.entries(schema.shape)) {
|
|
160
|
+
const nextPath = [...path, key];
|
|
161
|
+
const runtimeOptional = inheritedOptional || rawChildSchema.kind === "optional";
|
|
162
|
+
const childSchema = unwrapOptional(rawChildSchema);
|
|
163
|
+
const requiredWhenActive = rawChildSchema.kind !== "optional" && childSchema.default === undefined;
|
|
164
|
+
if (childSchema.kind === "object") {
|
|
165
|
+
const nested = collectFields(childSchema, casing, globalLongOptionFlags, nextPath, runtimeOptional, variantContext);
|
|
166
|
+
collected.dynamicFields.push(...nested.dynamicFields);
|
|
167
|
+
collected.fields.push(...nested.fields);
|
|
168
|
+
collected.variants.push(...nested.variants);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (childSchema.kind === "oneOf") {
|
|
172
|
+
const variantId = `${toDisplayPath(nextPath)}:oneOf`;
|
|
173
|
+
const branchIds = Object.keys(childSchema.branches);
|
|
174
|
+
const controlField = {
|
|
175
|
+
id: toDisplayPath([...nextPath, childSchema.discriminator]),
|
|
176
|
+
path: [...nextPath, childSchema.discriminator],
|
|
177
|
+
displayPath: toDisplayPath([...nextPath, childSchema.discriminator]),
|
|
178
|
+
optionAttribute: toOptionAttribute([...nextPath, childSchema.discriminator], casing),
|
|
179
|
+
commanderOptionAttribute: toCommanderOptionAttribute([...nextPath, childSchema.discriminator], casing, globalLongOptionFlags),
|
|
180
|
+
optionFlag: toOptionFlag([...nextPath, childSchema.discriminator], casing),
|
|
181
|
+
longAliases: [],
|
|
182
|
+
shortFlag: undefined,
|
|
183
|
+
schema: createSyntheticEnumSchema(branchIds),
|
|
184
|
+
description: childSchema.description,
|
|
185
|
+
optional: runtimeOptional,
|
|
186
|
+
hasDefault: false,
|
|
187
|
+
defaultValue: undefined,
|
|
188
|
+
requiredWhenActive
|
|
189
|
+
};
|
|
190
|
+
collected.fields.push(controlField);
|
|
191
|
+
const branches = [];
|
|
192
|
+
for (const [branchId, branchSchema] of Object.entries(childSchema.branches)) {
|
|
193
|
+
const branch = collectFields(branchSchema, casing, globalLongOptionFlags, nextPath, true, {
|
|
194
|
+
id: variantId,
|
|
195
|
+
branchId
|
|
196
|
+
});
|
|
197
|
+
collected.dynamicFields.push(...branch.dynamicFields);
|
|
198
|
+
collected.fields.push(...branch.fields);
|
|
199
|
+
collected.variants.push(...branch.variants);
|
|
200
|
+
branches.push({
|
|
201
|
+
branchId,
|
|
202
|
+
dynamicFieldIds: branch.dynamicFields.map((field) => field.id),
|
|
203
|
+
fieldIds: branch.fields.map((field) => field.id),
|
|
204
|
+
requiredDynamicFieldIds: branch.dynamicFields
|
|
205
|
+
.filter((field) => field.requiredWhenActive)
|
|
206
|
+
.map((field) => field.id),
|
|
207
|
+
requiredFieldIds: branch.fields
|
|
208
|
+
.filter((field) => field.requiredWhenActive)
|
|
209
|
+
.map((field) => field.id)
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
collected.variants.push({
|
|
213
|
+
id: variantId,
|
|
214
|
+
controlDisplayPath: controlField.displayPath,
|
|
215
|
+
controlFieldId: controlField.id,
|
|
216
|
+
optional: runtimeOptional,
|
|
217
|
+
branches
|
|
218
|
+
});
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
if (childSchema.kind === "union") {
|
|
222
|
+
const variantId = `${toDisplayPath(nextPath)}:union`;
|
|
223
|
+
const controlPath = toUnionKindControlPath(nextPath);
|
|
224
|
+
const controlDisplayPath = toUnionKindDisplayPath(nextPath);
|
|
225
|
+
const branchIds = childSchema.branches.map((branch) => getRequiredBranchFingerprint(branch, casing));
|
|
226
|
+
const controlField = {
|
|
227
|
+
id: controlDisplayPath,
|
|
228
|
+
path: controlPath,
|
|
229
|
+
displayPath: controlDisplayPath,
|
|
230
|
+
optionAttribute: toOptionAttribute(controlPath, casing),
|
|
231
|
+
commanderOptionAttribute: toCommanderOptionAttribute(controlPath, casing, globalLongOptionFlags),
|
|
232
|
+
optionFlag: toOptionFlag(controlPath, casing),
|
|
233
|
+
longAliases: [],
|
|
234
|
+
shortFlag: undefined,
|
|
235
|
+
schema: createSyntheticEnumSchema(branchIds),
|
|
236
|
+
description: childSchema.description,
|
|
237
|
+
optional: runtimeOptional,
|
|
238
|
+
hasDefault: false,
|
|
239
|
+
defaultValue: undefined,
|
|
240
|
+
requiredWhenActive,
|
|
241
|
+
synthetic: true
|
|
242
|
+
};
|
|
243
|
+
collected.fields.push(controlField);
|
|
244
|
+
const branches = [];
|
|
245
|
+
childSchema.branches.forEach((branchSchema, index) => {
|
|
246
|
+
const branchId = branchIds[index] ?? "";
|
|
247
|
+
const branch = collectFields(branchSchema, casing, globalLongOptionFlags, nextPath, true, {
|
|
248
|
+
id: variantId,
|
|
249
|
+
branchId
|
|
250
|
+
});
|
|
251
|
+
collected.dynamicFields.push(...branch.dynamicFields);
|
|
252
|
+
collected.fields.push(...branch.fields);
|
|
253
|
+
collected.variants.push(...branch.variants);
|
|
254
|
+
branches.push({
|
|
255
|
+
branchId,
|
|
256
|
+
dynamicFieldIds: branch.dynamicFields.map((field) => field.id),
|
|
257
|
+
fieldIds: branch.fields.map((field) => field.id),
|
|
258
|
+
requiredDynamicFieldIds: branch.dynamicFields
|
|
259
|
+
.filter((field) => field.requiredWhenActive)
|
|
260
|
+
.map((field) => field.id),
|
|
261
|
+
requiredFieldIds: branch.fields
|
|
262
|
+
.filter((field) => field.requiredWhenActive)
|
|
263
|
+
.map((field) => field.id)
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
collected.variants.push({
|
|
267
|
+
id: variantId,
|
|
268
|
+
controlDisplayPath,
|
|
269
|
+
controlFieldId: controlField.id,
|
|
270
|
+
optional: runtimeOptional,
|
|
271
|
+
branches
|
|
272
|
+
});
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
if (childSchema.kind === "record") {
|
|
276
|
+
collected.dynamicFields.push({
|
|
277
|
+
id: toDisplayPath(nextPath),
|
|
278
|
+
path: nextPath,
|
|
279
|
+
displayPath: toDisplayPath(nextPath),
|
|
280
|
+
optionPath: nextPath,
|
|
281
|
+
optionPathDisplay: `${toDisplayPath(nextPath)}.<key>`,
|
|
282
|
+
optionFlag: `${toOptionFlag(nextPath, casing)}.<key>`,
|
|
283
|
+
description: childSchema.description,
|
|
284
|
+
optional: runtimeOptional,
|
|
285
|
+
hasDefault: childSchema.default !== undefined,
|
|
286
|
+
defaultValue: childSchema.default,
|
|
287
|
+
requiredWhenActive,
|
|
288
|
+
schema: childSchema,
|
|
289
|
+
variantId: variantContext?.id,
|
|
290
|
+
variantBranchId: variantContext?.branchId
|
|
291
|
+
});
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
if (childSchema.kind === "array" && unwrapOptional(childSchema.item).kind === "object") {
|
|
295
|
+
collected.dynamicFields.push({
|
|
296
|
+
id: toDisplayPath(nextPath),
|
|
297
|
+
path: nextPath,
|
|
298
|
+
displayPath: toDisplayPath(nextPath),
|
|
299
|
+
optionPath: nextPath,
|
|
300
|
+
optionPathDisplay: `${toDisplayPath(nextPath)}.<index>`,
|
|
301
|
+
optionFlag: `${toOptionFlag(nextPath, casing)}.<index>`,
|
|
302
|
+
description: childSchema.description,
|
|
303
|
+
optional: runtimeOptional,
|
|
304
|
+
hasDefault: childSchema.default !== undefined,
|
|
305
|
+
defaultValue: childSchema.default,
|
|
306
|
+
requiredWhenActive,
|
|
307
|
+
schema: childSchema,
|
|
308
|
+
variantId: variantContext?.id,
|
|
309
|
+
variantBranchId: variantContext?.branchId
|
|
310
|
+
});
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
collected.fields.push({
|
|
314
|
+
id: toDisplayPath(nextPath),
|
|
315
|
+
path: nextPath,
|
|
316
|
+
displayPath: toDisplayPath(nextPath),
|
|
317
|
+
optionAttribute: toOptionAttribute(nextPath, casing),
|
|
318
|
+
commanderOptionAttribute: toCommanderOptionAttribute(nextPath, casing, globalLongOptionFlags),
|
|
319
|
+
optionFlag: toOptionFlag(nextPath, casing),
|
|
320
|
+
longAliases: [...(childSchema.cliAliases ?? [])].map((alias) => alias.startsWith("--") ? alias : `--${alias}`),
|
|
321
|
+
shortFlag: childSchema.short,
|
|
322
|
+
schema: childSchema,
|
|
323
|
+
description: childSchema.description,
|
|
324
|
+
optional: runtimeOptional,
|
|
325
|
+
hasDefault: childSchema.default !== undefined,
|
|
326
|
+
defaultValue: childSchema.default,
|
|
327
|
+
requiredWhenActive,
|
|
328
|
+
global: childSchema.global === true ? true : undefined,
|
|
329
|
+
variantId: variantContext?.id,
|
|
330
|
+
variantBranchId: variantContext?.branchId
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
return collected;
|
|
334
|
+
}
|
|
335
|
+
function toCommanderOptionAttribute(path, casing, globalLongOptionFlags) {
|
|
336
|
+
const optionAttribute = toOptionAttribute(path, casing);
|
|
337
|
+
const optionFlag = toOptionFlag(path, casing);
|
|
338
|
+
if (!globalLongOptionFlags.has(optionFlag)) {
|
|
339
|
+
return optionAttribute;
|
|
340
|
+
}
|
|
341
|
+
return `param_${optionAttribute}`;
|
|
342
|
+
}
|
|
343
|
+
function assignPositionals(fields, positional) {
|
|
344
|
+
if (positional.length === 0) {
|
|
345
|
+
return fields;
|
|
346
|
+
}
|
|
347
|
+
const byPath = new Map(fields.map((field) => [field.displayPath, field]));
|
|
348
|
+
let variadicPositionSeen = false;
|
|
349
|
+
positional.forEach((name, index) => {
|
|
350
|
+
const field = byPath.get(name);
|
|
351
|
+
if (field === undefined) {
|
|
352
|
+
throw new UserError(`Positional parameter "${name}" does not exist in params.`);
|
|
353
|
+
}
|
|
354
|
+
if (field.schema.kind === "array") {
|
|
355
|
+
if (index !== positional.length - 1) {
|
|
356
|
+
throw new UserError(`Positional array parameter "${name}" must be the last positional.`);
|
|
357
|
+
}
|
|
358
|
+
variadicPositionSeen = true;
|
|
359
|
+
}
|
|
360
|
+
if (variadicPositionSeen && field.schema.kind !== "array") {
|
|
361
|
+
throw new UserError(`Positional parameter "${name}" cannot appear after a positional array.`);
|
|
362
|
+
}
|
|
363
|
+
field.positionalIndex = index;
|
|
364
|
+
field.variadicPosition = field.schema.kind === "array";
|
|
365
|
+
});
|
|
366
|
+
return fields;
|
|
367
|
+
}
|
|
368
|
+
function formatOptionFlags(field, globalLongOptionFlags) {
|
|
369
|
+
const collidesWithGlobalFlag = globalLongOptionFlags.has(field.optionFlag);
|
|
370
|
+
if (collidesWithGlobalFlag) {
|
|
371
|
+
if (field.shortFlag === undefined) {
|
|
372
|
+
throw new UserError(`Parameter "${field.displayPath}" uses reserved CLI flag "${field.optionFlag}". Add a short flag or rename the parameter.`);
|
|
373
|
+
}
|
|
374
|
+
return `-${field.shortFlag}`;
|
|
375
|
+
}
|
|
376
|
+
if (field.shortFlag === undefined) {
|
|
377
|
+
return [field.optionFlag, ...field.longAliases].join(", ");
|
|
378
|
+
}
|
|
379
|
+
return [`-${field.shortFlag}`, field.optionFlag, ...field.longAliases].join(", ");
|
|
380
|
+
}
|
|
381
|
+
function formatPositionalToken(field) {
|
|
382
|
+
const optionalPositional = field.optional || field.hasDefault;
|
|
383
|
+
if (field.variadicPosition === true) {
|
|
384
|
+
return optionalPositional ? `[${field.displayPath}...]` : `<${field.displayPath}...>`;
|
|
385
|
+
}
|
|
386
|
+
return optionalPositional ? `[${field.displayPath}]` : `<${field.displayPath}>`;
|
|
387
|
+
}
|
|
388
|
+
function parseBooleanText(value, label) {
|
|
389
|
+
const normalized = value.trim().toLowerCase();
|
|
390
|
+
if (normalized === "true") {
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
if (normalized === "false") {
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
throw new InvalidArgumentError(`Invalid value for "${label}". Expected true or false, got ${describeReceived(value)}.`);
|
|
397
|
+
}
|
|
398
|
+
function parseEnumValue(value, values, label) {
|
|
399
|
+
const match = values.find((candidate) => String(candidate) === value);
|
|
400
|
+
if (match === undefined) {
|
|
401
|
+
const suggestions = suggest(value, values.map((candidate) => String(candidate)));
|
|
402
|
+
const suggestionLine = suggestions.length > 0 ? ` Did you mean: ${suggestions.join(", ")}?\n` : " ";
|
|
403
|
+
throw new InvalidArgumentError(`Invalid value for "${label}".${suggestionLine}Expected one of: ${values.map((candidate) => String(candidate)).join(", ")}, got ${describeReceived(value)}.`);
|
|
404
|
+
}
|
|
405
|
+
return match;
|
|
406
|
+
}
|
|
407
|
+
function validateStringPattern(value, schema, label) {
|
|
408
|
+
if (schema.minLength !== undefined && value.length < schema.minLength) {
|
|
409
|
+
throw new UserError(`Invalid value for "${label}". Expected a string with length at least ${schema.minLength}, got string with length ${value.length}.`);
|
|
410
|
+
}
|
|
411
|
+
if (schema.maxLength !== undefined && value.length > schema.maxLength) {
|
|
412
|
+
throw new UserError(`Invalid value for "${label}". Expected a string with length at most ${schema.maxLength}, got string with length ${value.length}.`);
|
|
413
|
+
}
|
|
414
|
+
if (schema.pattern !== undefined && !matchesStringPattern(value, schema.pattern)) {
|
|
415
|
+
throw new UserError(`Invalid value for "${label}": "${value}" does not match pattern "${schema.pattern}".`);
|
|
416
|
+
}
|
|
417
|
+
return value;
|
|
418
|
+
}
|
|
419
|
+
function matchesStringPattern(value, pattern) {
|
|
420
|
+
return new RegExp(pattern).test(value);
|
|
421
|
+
}
|
|
422
|
+
function parseJsonText(value, label) {
|
|
423
|
+
try {
|
|
424
|
+
return JSON.parse(value);
|
|
425
|
+
}
|
|
426
|
+
catch (error) {
|
|
427
|
+
throw new InvalidArgumentError(`Invalid value for "${label}". Expected valid JSON, got ${describeReceived(value)} (parser: ${getErrorMessage(error)}).`);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function describeReceived(value) {
|
|
431
|
+
if (value === null)
|
|
432
|
+
return "null";
|
|
433
|
+
if (value === undefined)
|
|
434
|
+
return "missing";
|
|
435
|
+
if (Array.isArray(value))
|
|
436
|
+
return `array(${value.length})`;
|
|
437
|
+
if (typeof value === "object")
|
|
438
|
+
return "object";
|
|
439
|
+
if (typeof value === "string") {
|
|
440
|
+
const s = value.length > 40 ? `${value.slice(0, 40)}…` : value;
|
|
441
|
+
return `${JSON.stringify(s)}`;
|
|
442
|
+
}
|
|
443
|
+
return JSON.stringify(value);
|
|
444
|
+
}
|
|
445
|
+
function getErrorMessage(error) {
|
|
446
|
+
return error instanceof Error ? error.message : String(error);
|
|
447
|
+
}
|
|
448
|
+
function formatJsonParseUserErrorMessage(label, filePath, source, error, options) {
|
|
449
|
+
const location = getJsonParseErrorLocation(error, source);
|
|
450
|
+
const message = location === null
|
|
451
|
+
? getErrorMessage(error)
|
|
452
|
+
: removeNativeJsonParseLocation(getErrorMessage(error), location);
|
|
453
|
+
const positionText = location === null ? "" : ` at line ${location.line} column ${location.column}`;
|
|
454
|
+
const formattedPath = options.quotePath ? `"${filePath}"` : filePath;
|
|
455
|
+
const snippet = location === null
|
|
456
|
+
? ""
|
|
457
|
+
: `\n${renderSourceSnippet({
|
|
458
|
+
source,
|
|
459
|
+
line: location.line,
|
|
460
|
+
column: location.column,
|
|
461
|
+
filePath
|
|
462
|
+
})}`;
|
|
463
|
+
return `${label} ${formattedPath} is not valid JSON: ${message}${positionText}.${snippet}`;
|
|
464
|
+
}
|
|
465
|
+
function removeNativeJsonParseLocation(message, location) {
|
|
466
|
+
const nativeSuffix = ` (line ${location.line} column ${location.column})`;
|
|
467
|
+
return message.endsWith(nativeSuffix) ? message.slice(0, -nativeSuffix.length) : message;
|
|
468
|
+
}
|
|
469
|
+
function getJsonParseErrorLocation(error, source) {
|
|
470
|
+
const causeLocation = getJsonParseCauseLocation(error);
|
|
471
|
+
if (causeLocation !== null) {
|
|
472
|
+
return causeLocation;
|
|
473
|
+
}
|
|
474
|
+
const directPosition = getNumericProperty(error, "position");
|
|
475
|
+
if (directPosition !== null) {
|
|
476
|
+
return getSourceOffsetLocation(source, directPosition);
|
|
477
|
+
}
|
|
478
|
+
const messagePosition = getJsonParseMessagePosition(getErrorMessage(error));
|
|
479
|
+
if (messagePosition !== null) {
|
|
480
|
+
return getSourceOffsetLocation(source, messagePosition);
|
|
481
|
+
}
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
function getJsonParseCauseLocation(error) {
|
|
485
|
+
if (typeof error !== "object" || error === null || !hasOwnProperty(error, "cause")) {
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
const cause = error.cause;
|
|
489
|
+
const line = getNumericProperty(cause, "line");
|
|
490
|
+
const column = getNumericProperty(cause, "column") ?? getNumericProperty(cause, "col");
|
|
491
|
+
if (line === null || column === null) {
|
|
492
|
+
return null;
|
|
493
|
+
}
|
|
494
|
+
return { line, column };
|
|
495
|
+
}
|
|
496
|
+
function getNumericProperty(value, key) {
|
|
497
|
+
if (typeof value !== "object" || value === null || !hasOwnProperty(value, key)) {
|
|
498
|
+
return null;
|
|
499
|
+
}
|
|
500
|
+
const propertyValue = value[key];
|
|
501
|
+
return typeof propertyValue === "number" && Number.isFinite(propertyValue) ? propertyValue : null;
|
|
502
|
+
}
|
|
503
|
+
function getJsonParseMessagePosition(message) {
|
|
504
|
+
const marker = " at position ";
|
|
505
|
+
const markerIndex = message.indexOf(marker);
|
|
506
|
+
if (markerIndex === -1) {
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
const startIndex = markerIndex + marker.length;
|
|
510
|
+
let endIndex = startIndex;
|
|
511
|
+
while (endIndex < message.length && isAsciiDigit(message[endIndex] ?? "")) {
|
|
512
|
+
endIndex += 1;
|
|
513
|
+
}
|
|
514
|
+
if (endIndex === startIndex) {
|
|
515
|
+
return null;
|
|
516
|
+
}
|
|
517
|
+
return Number.parseInt(message.slice(startIndex, endIndex), 10);
|
|
518
|
+
}
|
|
519
|
+
function getSourceOffsetLocation(source, offset) {
|
|
520
|
+
let line = 1;
|
|
521
|
+
let column = 1;
|
|
522
|
+
const boundedOffset = Math.max(0, Math.floor(offset));
|
|
523
|
+
for (let index = 0; index < boundedOffset && index < source.length; index += 1) {
|
|
524
|
+
if (source[index] === "\n") {
|
|
525
|
+
line += 1;
|
|
526
|
+
column = 1;
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
column += 1;
|
|
530
|
+
}
|
|
531
|
+
return { line, column };
|
|
532
|
+
}
|
|
533
|
+
function isAsciiDigit(value) {
|
|
534
|
+
return value >= "0" && value <= "9";
|
|
535
|
+
}
|
|
536
|
+
function formatAvailableList(values) {
|
|
537
|
+
return `Available: ${[...values].sort().join(", ")}.`;
|
|
538
|
+
}
|
|
539
|
+
function normalizeCommanderOptionValue(value) {
|
|
540
|
+
return value === NULL_OPTION_VALUE ? null : value;
|
|
541
|
+
}
|
|
542
|
+
function parseScalarValue(value, schema, label) {
|
|
543
|
+
if (value === "null" && schema.nullable === true) {
|
|
544
|
+
return null;
|
|
545
|
+
}
|
|
546
|
+
switch (schema.kind) {
|
|
547
|
+
case "string":
|
|
548
|
+
return validateStringPattern(value, schema, label);
|
|
549
|
+
case "number": {
|
|
550
|
+
const parsed = Number(value);
|
|
551
|
+
if (!isValidNumberSchemaValue(parsed, schema)) {
|
|
552
|
+
throw new InvalidArgumentError(`Invalid value for "${label}". Expected ${getExpectedNumberDescription(schema)}, got ${describeReceived(value)}.`);
|
|
553
|
+
}
|
|
554
|
+
return parsed;
|
|
555
|
+
}
|
|
556
|
+
case "boolean":
|
|
557
|
+
return parseBooleanText(value, label);
|
|
558
|
+
case "enum":
|
|
559
|
+
return parseEnumValue(value, schema.values, label);
|
|
560
|
+
}
|
|
561
|
+
throw new UserError(`Unsupported CLI schema kind. ${formatAvailableList(["boolean", "enum", "number", "string"])}`);
|
|
562
|
+
}
|
|
563
|
+
function splitArrayInput(value) {
|
|
564
|
+
const items = [];
|
|
565
|
+
let current = "";
|
|
566
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
567
|
+
const char = value[index] ?? "";
|
|
568
|
+
if (char === ",") {
|
|
569
|
+
const trimmed = current.trim();
|
|
570
|
+
if (trimmed.length > 0) {
|
|
571
|
+
items.push(trimmed);
|
|
572
|
+
}
|
|
573
|
+
current = "";
|
|
574
|
+
continue;
|
|
575
|
+
}
|
|
576
|
+
current += char;
|
|
577
|
+
}
|
|
578
|
+
const trimmed = current.trim();
|
|
579
|
+
if (trimmed.length > 0) {
|
|
580
|
+
items.push(trimmed);
|
|
581
|
+
}
|
|
582
|
+
return items;
|
|
583
|
+
}
|
|
584
|
+
function parseArrayValue(value, schema, label) {
|
|
585
|
+
if (value === "null" && schema.nullable === true) {
|
|
586
|
+
return null;
|
|
587
|
+
}
|
|
588
|
+
const itemSchema = unwrapOptional(schema.item);
|
|
589
|
+
if (itemSchema.kind === "array" || itemSchema.kind === "object") {
|
|
590
|
+
throw new UserError(`Array parameter "${label}" must use scalar items.`);
|
|
591
|
+
}
|
|
592
|
+
return splitArrayInput(value).map((item) => parseScalarValue(item, itemSchema, label));
|
|
593
|
+
}
|
|
594
|
+
function isNegativeNumericArrayToken(token, schema) {
|
|
595
|
+
if (!token.startsWith("-") || token.startsWith("--")) {
|
|
596
|
+
return false;
|
|
597
|
+
}
|
|
598
|
+
const itemSchema = unwrapOptional(schema.item);
|
|
599
|
+
if (itemSchema.kind !== "number") {
|
|
600
|
+
return false;
|
|
601
|
+
}
|
|
602
|
+
const items = splitArrayInput(token);
|
|
603
|
+
return (items.length > 0 && items.every((item) => isValidNumberSchemaValue(Number(item), itemSchema)));
|
|
604
|
+
}
|
|
605
|
+
function isNextArrayOptionToken(token, schema) {
|
|
606
|
+
return token.startsWith("-") && !isNegativeNumericArrayToken(token, schema);
|
|
607
|
+
}
|
|
608
|
+
function validateArrayBounds(value, schema, label) {
|
|
609
|
+
if (schema.minItems !== undefined && value.length < schema.minItems) {
|
|
610
|
+
throw new UserError(`Invalid value for "${label}". Expected an array with at least ${schema.minItems} items, got array(${value.length}).`);
|
|
611
|
+
}
|
|
612
|
+
if (schema.maxItems !== undefined && value.length > schema.maxItems) {
|
|
613
|
+
throw new UserError(`Invalid value for "${label}". Expected an array with at most ${schema.maxItems} items, got array(${value.length}).`);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function createOption(field, globalLongOptionFlags) {
|
|
617
|
+
const flags = formatOptionFlags(field, globalLongOptionFlags);
|
|
618
|
+
const collidesWithGlobalFlag = globalLongOptionFlags.has(field.optionFlag);
|
|
619
|
+
if (field.schema.kind === "boolean") {
|
|
620
|
+
if (collidesWithGlobalFlag) {
|
|
621
|
+
return [createCommanderOption(flags, field.description, field)];
|
|
622
|
+
}
|
|
623
|
+
const mainOption = createCommanderOption(`${flags} [value]`, field.description, field);
|
|
624
|
+
mainOption.preset(true);
|
|
625
|
+
// Commander v14 passes the preset value through argParser too, so guard with typeof check
|
|
626
|
+
mainOption.argParser((value) => (typeof value === "boolean" ? value : value));
|
|
627
|
+
return [
|
|
628
|
+
mainOption,
|
|
629
|
+
createCommanderOption(`--no-${field.optionFlag.slice(2)}`, field.description, field)
|
|
630
|
+
];
|
|
631
|
+
}
|
|
632
|
+
if (field.schema.kind === "array") {
|
|
633
|
+
return [
|
|
634
|
+
createCommanderOption(`${flags} <value...>`, field.description, field).argParser((value, previous = []) => [...previous, value])
|
|
635
|
+
];
|
|
636
|
+
}
|
|
637
|
+
if (field.schema.kind === "json") {
|
|
638
|
+
return [createCommanderOption(`${flags} <json>`, field.description, field)];
|
|
639
|
+
}
|
|
640
|
+
const option = createCommanderOption(`${flags} <value>`, field.description, field);
|
|
641
|
+
return [option];
|
|
642
|
+
}
|
|
643
|
+
function resolveCLIControls(controls) {
|
|
644
|
+
return {
|
|
645
|
+
debug: controls?.debug === true,
|
|
646
|
+
logLevel: controls?.logLevel === true,
|
|
647
|
+
output: controls?.output === true,
|
|
648
|
+
verbose: controls?.verbose === true,
|
|
649
|
+
yes: controls?.yes === true
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
function getGlobalLongOptionFlags(presetsEnabled, versionEnabled, controls) {
|
|
653
|
+
const flags = [];
|
|
654
|
+
if (presetsEnabled) {
|
|
655
|
+
flags.push("--preset");
|
|
656
|
+
}
|
|
657
|
+
if (controls.yes) {
|
|
658
|
+
flags.push("--yes");
|
|
659
|
+
}
|
|
660
|
+
if (controls.output) {
|
|
661
|
+
flags.push("--output");
|
|
662
|
+
}
|
|
663
|
+
if (controls.debug) {
|
|
664
|
+
flags.push("--debug");
|
|
665
|
+
}
|
|
666
|
+
if (controls.logLevel) {
|
|
667
|
+
flags.push("--log-level");
|
|
668
|
+
}
|
|
669
|
+
if (controls.verbose) {
|
|
670
|
+
flags.push("--verbose");
|
|
671
|
+
}
|
|
672
|
+
if (versionEnabled) {
|
|
673
|
+
flags.push("--version");
|
|
674
|
+
}
|
|
675
|
+
return new Set(flags);
|
|
676
|
+
}
|
|
677
|
+
function validateUniqueOptionFlags(fields, globalLongOptionFlags) {
|
|
678
|
+
const fieldsByFlag = new Map();
|
|
679
|
+
for (const field of fields) {
|
|
680
|
+
if (field.positionalIndex !== undefined) {
|
|
681
|
+
continue;
|
|
682
|
+
}
|
|
683
|
+
for (const flag of [field.optionFlag, ...field.longAliases]) {
|
|
684
|
+
if (globalLongOptionFlags.has(flag)) {
|
|
685
|
+
if (flag === field.optionFlag && field.shortFlag !== undefined) {
|
|
686
|
+
continue;
|
|
687
|
+
}
|
|
688
|
+
throw new UserError(`Parameter "${field.displayPath}" uses reserved CLI flag "${flag}". Add a short flag or rename the parameter.`);
|
|
689
|
+
}
|
|
690
|
+
const existing = fieldsByFlag.get(flag);
|
|
691
|
+
if (existing !== undefined) {
|
|
692
|
+
throw new UserError(`Parameters "${existing.displayPath}" and "${field.displayPath}" use conflicting CLI flag "${flag}".`);
|
|
693
|
+
}
|
|
694
|
+
fieldsByFlag.set(flag, field);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
function createCommanderOption(flags, description, field) {
|
|
699
|
+
const option = new Option(flags, description);
|
|
700
|
+
if (field.commanderOptionAttribute !== field.optionAttribute || field.longAliases.length > 0) {
|
|
701
|
+
option.attributeName = () => field.commanderOptionAttribute;
|
|
702
|
+
}
|
|
703
|
+
return option;
|
|
704
|
+
}
|
|
705
|
+
function hasHelpFlag(argv) {
|
|
706
|
+
return argv.some((token) => HELP_FLAGS.has(token));
|
|
707
|
+
}
|
|
708
|
+
function normalizeVerboseAlias(argv) {
|
|
709
|
+
return argv.map((token) => (token === "-v" ? "--verbose" : token));
|
|
710
|
+
}
|
|
711
|
+
function resolveHelpOutput(argv) {
|
|
712
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
713
|
+
const token = argv[index] ?? "";
|
|
714
|
+
if (token === "--output") {
|
|
715
|
+
const value = argv[index + 1];
|
|
716
|
+
if (value === "rich" || value === "md" || value === "json") {
|
|
717
|
+
return value;
|
|
718
|
+
}
|
|
719
|
+
if (value === "markdown") {
|
|
720
|
+
return "md";
|
|
721
|
+
}
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
if (token.startsWith("--output=")) {
|
|
725
|
+
const value = token.slice("--output=".length);
|
|
726
|
+
if (value === "rich" || value === "md" || value === "json") {
|
|
727
|
+
return value;
|
|
728
|
+
}
|
|
729
|
+
if (value === "markdown") {
|
|
730
|
+
return "md";
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
return "rich";
|
|
735
|
+
}
|
|
736
|
+
function isNodeVisibleInScope(node, scope) {
|
|
737
|
+
if (node.kind === "command") {
|
|
738
|
+
return node.scope.includes(scope);
|
|
739
|
+
}
|
|
740
|
+
return (getVisibleChildren(node, scope).length > 0 ||
|
|
741
|
+
Boolean(node.default && node.default.scope.includes(scope)) ||
|
|
742
|
+
node.scope === undefined ||
|
|
743
|
+
node.scope.includes(scope));
|
|
744
|
+
}
|
|
745
|
+
function getVisibleChildren(group, scope) {
|
|
746
|
+
return group.children.filter((child) => isNodeVisibleInScope(child, scope));
|
|
747
|
+
}
|
|
748
|
+
function getHelpChildren(group, scope) {
|
|
749
|
+
return getVisibleChildren(group, scope).filter((child) => {
|
|
750
|
+
if (child.kind === "command") {
|
|
751
|
+
return child.hidden !== true;
|
|
752
|
+
}
|
|
753
|
+
return true;
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
function findVisibleChild(group, token, scope) {
|
|
757
|
+
return getVisibleChildren(group, scope).find((child) => child.name === token || child.aliases.includes(token));
|
|
758
|
+
}
|
|
759
|
+
function resolveHelpTarget(root, argv, scope, rootUsageName, rootDisplayName) {
|
|
760
|
+
const breadcrumb = [rootDisplayName ?? root.name];
|
|
761
|
+
let current = root;
|
|
762
|
+
for (const token of argv.slice(2)) {
|
|
763
|
+
if (token.startsWith("-") || token === "help") {
|
|
764
|
+
break;
|
|
765
|
+
}
|
|
766
|
+
if (current.kind !== "group") {
|
|
767
|
+
break;
|
|
768
|
+
}
|
|
769
|
+
const child = findVisibleChild(current, token, scope);
|
|
770
|
+
if (child === undefined) {
|
|
771
|
+
throw new UserError(formatUnknownHelpCommandMessage(current, token, scope, rootUsageName, breadcrumb));
|
|
772
|
+
}
|
|
773
|
+
breadcrumb.push(child.name);
|
|
774
|
+
current = child;
|
|
775
|
+
}
|
|
776
|
+
return {
|
|
777
|
+
breadcrumb,
|
|
778
|
+
node: current
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
function formatUnknownHelpCommandMessage(group, input, scope, rootUsageName, breadcrumb) {
|
|
782
|
+
const suggestions = suggest(input, getHelpChildren(group, scope).map((child) => child.name));
|
|
783
|
+
const commandPath = breadcrumb.slice(1).join(" ");
|
|
784
|
+
const helpTarget = commandPath.length === 0 ? rootUsageName : `${rootUsageName} ${commandPath}`;
|
|
785
|
+
return `${formatSuggestionMessage(`Unknown command "${input}".`, suggestions)}\nRun ${helpTarget} --help for usage.`;
|
|
786
|
+
}
|
|
787
|
+
function formatHelpFieldFlags(field, globalLongOptionFlags) {
|
|
788
|
+
if (field.positionalIndex !== undefined) {
|
|
789
|
+
return formatPositionalToken(field);
|
|
790
|
+
}
|
|
791
|
+
if (field.schema.kind === "boolean") {
|
|
792
|
+
if (field.defaultValue === true) {
|
|
793
|
+
return `--no-${field.optionFlag.slice(2)}`;
|
|
794
|
+
}
|
|
795
|
+
return formatOptionFlags(field, globalLongOptionFlags);
|
|
796
|
+
}
|
|
797
|
+
return `${formatOptionFlags(field, globalLongOptionFlags)} <${describeHelpValueToken(field.schema, {
|
|
798
|
+
displayPath: field.displayPath,
|
|
799
|
+
optionFlag: field.optionFlag
|
|
800
|
+
})}>`;
|
|
801
|
+
}
|
|
802
|
+
function appendHelpMetadata(description, metadata) {
|
|
803
|
+
if (metadata.length === 0) {
|
|
804
|
+
return description;
|
|
805
|
+
}
|
|
806
|
+
if (description.length === 0) {
|
|
807
|
+
return `(${metadata.join(", ")})`;
|
|
808
|
+
}
|
|
809
|
+
return `${description} (${metadata.join(", ")})`;
|
|
810
|
+
}
|
|
811
|
+
function formatHelpFieldDescription(field) {
|
|
812
|
+
const description = field.description ?? field.displayPath;
|
|
813
|
+
const metadata = [];
|
|
814
|
+
if (!field.optional && !field.hasDefault) {
|
|
815
|
+
metadata.push("required");
|
|
816
|
+
}
|
|
817
|
+
if (field.hasDefault) {
|
|
818
|
+
metadata.push(`default: ${formatResolvedValue(field.defaultValue)}`);
|
|
819
|
+
}
|
|
820
|
+
return appendHelpMetadata(description, metadata);
|
|
821
|
+
}
|
|
822
|
+
function describeKnownStringFormat(format) {
|
|
823
|
+
switch (format) {
|
|
824
|
+
case "date":
|
|
825
|
+
return "date";
|
|
826
|
+
case "date-time":
|
|
827
|
+
return "datetime";
|
|
828
|
+
case "uri":
|
|
829
|
+
return "url";
|
|
830
|
+
case "email":
|
|
831
|
+
return "email";
|
|
832
|
+
default:
|
|
833
|
+
return undefined;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
function describeKnownStringPattern(pattern) {
|
|
837
|
+
if (pattern === undefined) {
|
|
838
|
+
return undefined;
|
|
839
|
+
}
|
|
840
|
+
if (pattern === "^\\d{4}-\\d{2}-\\d{2}$") {
|
|
841
|
+
return "YYYY-MM-DD";
|
|
842
|
+
}
|
|
843
|
+
if (pattern.startsWith("^\\d{4}-\\d{2}-\\d{2}T")) {
|
|
844
|
+
return "YYYY-MM-DDTHH:MM:SS";
|
|
845
|
+
}
|
|
846
|
+
return undefined;
|
|
847
|
+
}
|
|
848
|
+
function stripLongOptionPrefix(optionFlag) {
|
|
849
|
+
return optionFlag.startsWith("--") ? optionFlag.slice(2) : optionFlag;
|
|
850
|
+
}
|
|
851
|
+
function getLastSegment(value, separator) {
|
|
852
|
+
const segments = value.split(separator);
|
|
853
|
+
return segments[segments.length - 1] ?? value;
|
|
854
|
+
}
|
|
855
|
+
function matchesFieldNameSuffix(name, suffix) {
|
|
856
|
+
const lowerName = name.toLowerCase();
|
|
857
|
+
const lowerSuffix = suffix.toLowerCase();
|
|
858
|
+
return (lowerName === lowerSuffix ||
|
|
859
|
+
name.endsWith(suffix) ||
|
|
860
|
+
lowerName.endsWith(`-${lowerSuffix}`) ||
|
|
861
|
+
lowerName.endsWith(`_${lowerSuffix}`));
|
|
862
|
+
}
|
|
863
|
+
function describeFieldNameValueToken(displayPath, optionFlag) {
|
|
864
|
+
const displayName = getLastSegment(displayPath, ".");
|
|
865
|
+
const optionName = getLastSegment(stripLongOptionPrefix(optionFlag), ".");
|
|
866
|
+
const candidates = [displayName, optionName];
|
|
867
|
+
const suffixTokens = [
|
|
868
|
+
["Path", "path"],
|
|
869
|
+
["Paths", "path"],
|
|
870
|
+
["File", "path"],
|
|
871
|
+
["Files", "path"],
|
|
872
|
+
["Url", "url"],
|
|
873
|
+
["Email", "email"],
|
|
874
|
+
["Name", "name"],
|
|
875
|
+
["Id", "id"]
|
|
876
|
+
];
|
|
877
|
+
for (const [suffix, token] of suffixTokens) {
|
|
878
|
+
if (candidates.some((candidate) => matchesFieldNameSuffix(candidate, suffix))) {
|
|
879
|
+
return token;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
return undefined;
|
|
883
|
+
}
|
|
884
|
+
function describeHelpValueToken(schema, field) {
|
|
885
|
+
if (schema.kind === "array") {
|
|
886
|
+
const itemSchema = unwrapOptional(schema.item);
|
|
887
|
+
if (itemSchema.kind === "array" || itemSchema.kind === "object") {
|
|
888
|
+
return "value...";
|
|
889
|
+
}
|
|
890
|
+
return `${describeHelpValueToken(itemSchema, field)}...`;
|
|
891
|
+
}
|
|
892
|
+
if (schema.kind === "json") {
|
|
893
|
+
return "json";
|
|
894
|
+
}
|
|
895
|
+
if (schema.kind === "string") {
|
|
896
|
+
const metadataToken = describeKnownStringFormat(schema.format) ?? describeKnownStringPattern(schema.pattern);
|
|
897
|
+
if (metadataToken !== undefined) {
|
|
898
|
+
return metadataToken;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
if (schema.kind === "enum") {
|
|
902
|
+
return "value";
|
|
903
|
+
}
|
|
904
|
+
return describeFieldNameValueToken(field.displayPath, field.optionFlag) ?? "value";
|
|
905
|
+
}
|
|
906
|
+
function formatCompactEnumSignatureToken(schema) {
|
|
907
|
+
if (schema.kind !== "enum" || schema.values.length < 2 || schema.values.length > 3) {
|
|
908
|
+
return undefined;
|
|
909
|
+
}
|
|
910
|
+
const tokens = schema.values.map((value) => String(value));
|
|
911
|
+
const compact = tokens.every((token) => token.length > 0 &&
|
|
912
|
+
token.length <= 24 &&
|
|
913
|
+
token.trim() === token &&
|
|
914
|
+
!token.includes("|") &&
|
|
915
|
+
!token.includes("\t") &&
|
|
916
|
+
!token.includes("\n") &&
|
|
917
|
+
!token.includes("\r") &&
|
|
918
|
+
!token.includes(" "));
|
|
919
|
+
return compact ? tokens.join("|") : undefined;
|
|
920
|
+
}
|
|
921
|
+
function formatCommandParameterFieldFlags(field, globalLongOptionFlags) {
|
|
922
|
+
if (field.positionalIndex !== undefined || field.schema.kind === "boolean") {
|
|
923
|
+
return formatHelpFieldFlags(field, globalLongOptionFlags);
|
|
924
|
+
}
|
|
925
|
+
const enumToken = formatCompactEnumSignatureToken(field.schema);
|
|
926
|
+
if (enumToken !== undefined) {
|
|
927
|
+
return `${formatOptionFlags(field, globalLongOptionFlags)} ${enumToken}`;
|
|
928
|
+
}
|
|
929
|
+
return formatHelpFieldFlags(field, globalLongOptionFlags);
|
|
930
|
+
}
|
|
931
|
+
function describeDynamicFieldType(field) {
|
|
932
|
+
if (field.schema.kind === "record") {
|
|
933
|
+
const valueSchema = unwrapOptional(field.schema.value);
|
|
934
|
+
if (valueSchema.kind === "json") {
|
|
935
|
+
return "json";
|
|
936
|
+
}
|
|
937
|
+
if (valueSchema.kind === "array") {
|
|
938
|
+
return describeHelpValueToken(valueSchema, {
|
|
939
|
+
displayPath: field.optionPathDisplay,
|
|
940
|
+
optionFlag: field.optionFlag
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
if (valueSchema.kind === "object") {
|
|
944
|
+
return "value";
|
|
945
|
+
}
|
|
946
|
+
return describeHelpValueToken(valueSchema, {
|
|
947
|
+
displayPath: field.optionPathDisplay,
|
|
948
|
+
optionFlag: field.optionFlag
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
return "value";
|
|
952
|
+
}
|
|
953
|
+
function formatDynamicHelpMetadata(field) {
|
|
954
|
+
const metadata = [];
|
|
955
|
+
if (!field.optional && !field.hasDefault) {
|
|
956
|
+
metadata.push("required");
|
|
957
|
+
}
|
|
958
|
+
if (field.hasDefault) {
|
|
959
|
+
metadata.push(`default: ${formatResolvedValue(field.defaultValue)}`);
|
|
960
|
+
}
|
|
961
|
+
return metadata;
|
|
962
|
+
}
|
|
963
|
+
function collectDynamicObjectHelpRows(schema, casing, optionPrefix, displayPrefix, metadata) {
|
|
964
|
+
const rows = [];
|
|
965
|
+
for (const [key, rawChildSchema] of Object.entries(schema.shape)) {
|
|
966
|
+
const childSchema = unwrapOptional(rawChildSchema);
|
|
967
|
+
const optionFlag = `${optionPrefix}.${formatSegment(key, casing)}`;
|
|
968
|
+
const displayPath = `${displayPrefix}.${key}`;
|
|
969
|
+
const description = childSchema.description ?? displayPath;
|
|
970
|
+
if (childSchema.kind === "object") {
|
|
971
|
+
rows.push(...collectDynamicObjectHelpRows(childSchema, casing, optionFlag, displayPath, metadata));
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
if (childSchema.kind === "record") {
|
|
975
|
+
rows.push({
|
|
976
|
+
flags: `${optionFlag}.<key> <${describeDynamicFieldType({
|
|
977
|
+
...{
|
|
978
|
+
id: displayPath,
|
|
979
|
+
path: [],
|
|
980
|
+
displayPath,
|
|
981
|
+
optionPath: [],
|
|
982
|
+
optionPathDisplay: `${displayPath}.<key>`,
|
|
983
|
+
optionFlag: `${optionFlag}.<key>`,
|
|
984
|
+
optional: false,
|
|
985
|
+
hasDefault: false,
|
|
986
|
+
defaultValue: undefined,
|
|
987
|
+
requiredWhenActive: false,
|
|
988
|
+
schema: childSchema
|
|
989
|
+
}
|
|
990
|
+
})}>`,
|
|
991
|
+
description: appendHelpMetadata(description, metadata)
|
|
992
|
+
});
|
|
993
|
+
continue;
|
|
994
|
+
}
|
|
995
|
+
if (childSchema.kind === "array" && unwrapOptional(childSchema.item).kind === "object") {
|
|
996
|
+
rows.push(...collectDynamicObjectHelpRows(unwrapOptional(childSchema.item), casing, `${optionFlag}.<index>`, `${displayPath}.<index>`, metadata));
|
|
997
|
+
continue;
|
|
998
|
+
}
|
|
999
|
+
rows.push({
|
|
1000
|
+
flags: childSchema.kind === "boolean"
|
|
1001
|
+
? childSchema.default === true
|
|
1002
|
+
? `--no-${optionFlag.slice(2)}`
|
|
1003
|
+
: optionFlag
|
|
1004
|
+
: `${optionFlag} <${describeHelpValueToken(childSchema, {
|
|
1005
|
+
displayPath,
|
|
1006
|
+
optionFlag
|
|
1007
|
+
})}>`,
|
|
1008
|
+
description: appendHelpMetadata(description, metadata)
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1011
|
+
return rows;
|
|
1012
|
+
}
|
|
1013
|
+
function formatDynamicHelpFields(field, casing) {
|
|
1014
|
+
const metadata = formatDynamicHelpMetadata(field);
|
|
1015
|
+
if (field.schema.kind === "record") {
|
|
1016
|
+
const valueSchema = unwrapOptional(field.schema.value);
|
|
1017
|
+
if (valueSchema.kind === "object") {
|
|
1018
|
+
return collectDynamicObjectHelpRows(valueSchema, casing, `${field.optionFlag}`, `${field.optionPathDisplay}`, metadata);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
if (field.schema.kind === "array") {
|
|
1022
|
+
const itemSchema = unwrapOptional(field.schema.item);
|
|
1023
|
+
if (itemSchema.kind === "object") {
|
|
1024
|
+
return collectDynamicObjectHelpRows(itemSchema, casing, `${field.optionFlag}`, `${field.optionPathDisplay}`, metadata);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
return [
|
|
1028
|
+
{
|
|
1029
|
+
flags: `${field.optionFlag} <${describeDynamicFieldType(field)}>`,
|
|
1030
|
+
description: appendHelpMetadata(field.description ?? field.optionPathDisplay, metadata)
|
|
1031
|
+
}
|
|
1032
|
+
];
|
|
1033
|
+
}
|
|
1034
|
+
function formatSecretRows(secrets) {
|
|
1035
|
+
return Object.values(secrets).map((secret) => ({
|
|
1036
|
+
flags: secret.env,
|
|
1037
|
+
description: formatSecretDescription(secret)
|
|
1038
|
+
}));
|
|
1039
|
+
}
|
|
1040
|
+
function formatSecretDescription(secret) {
|
|
1041
|
+
if (secret.description !== undefined && secret.description.length > 0) {
|
|
1042
|
+
return secret.description;
|
|
1043
|
+
}
|
|
1044
|
+
return secret.optional === true ? "Optional secret" : "Required secret";
|
|
1045
|
+
}
|
|
1046
|
+
function formatExampleValue(value) {
|
|
1047
|
+
if (typeof value === "string" && value.length > 0 && !value.includes(" ")) {
|
|
1048
|
+
return value;
|
|
1049
|
+
}
|
|
1050
|
+
return JSON.stringify(value);
|
|
1051
|
+
}
|
|
1052
|
+
function formatExampleCommand(breadcrumb, rootUsageName, params) {
|
|
1053
|
+
const commandPath = buildUsageLine(breadcrumb, rootUsageName, "");
|
|
1054
|
+
const flags = Object.entries(params).map(([key, value]) => {
|
|
1055
|
+
const flag = `--${key}`;
|
|
1056
|
+
return typeof value === "boolean"
|
|
1057
|
+
? value
|
|
1058
|
+
? flag
|
|
1059
|
+
: `--no-${key}`
|
|
1060
|
+
: `${flag} ${formatExampleValue(value)}`;
|
|
1061
|
+
});
|
|
1062
|
+
return [commandPath, ...flags].filter((token) => token.length > 0).join(" ");
|
|
1063
|
+
}
|
|
1064
|
+
function formatExampleRows(examples, breadcrumb, rootUsageName) {
|
|
1065
|
+
return examples.map((example) => `${example.title}\n ${formatExampleCommand(breadcrumb, rootUsageName, example.params)}`);
|
|
1066
|
+
}
|
|
1067
|
+
function wrapOptionalCommandParameterToken(token, optional) {
|
|
1068
|
+
return optional ? `[${token}]` : token;
|
|
1069
|
+
}
|
|
1070
|
+
function formatCommandDynamicParameterTokens(field, casing) {
|
|
1071
|
+
const optional = field.optional || field.hasDefault;
|
|
1072
|
+
return formatDynamicHelpFields(field, casing).map((row) => wrapOptionalCommandParameterToken(row.flags, optional));
|
|
1073
|
+
}
|
|
1074
|
+
function formatCommandParameterTokens(command, casing, globalLongOptionFlags) {
|
|
1075
|
+
const collected = collectFields(command.params, casing, globalLongOptionFlags);
|
|
1076
|
+
const fields = assignPositionals(collected.fields, command.positional);
|
|
1077
|
+
return fields
|
|
1078
|
+
.filter((field) => field.global !== true)
|
|
1079
|
+
.map((field) => wrapOptionalCommandParameterToken(formatCommandParameterFieldFlags(field, globalLongOptionFlags), field.positionalIndex === undefined && (field.optional || field.hasDefault)))
|
|
1080
|
+
.concat(collected.dynamicFields.flatMap((field) => formatCommandDynamicParameterTokens(field, casing)));
|
|
1081
|
+
}
|
|
1082
|
+
function formatCommandRowName(node, casing, globalLongOptionFlags) {
|
|
1083
|
+
const baseName = node.aliases.length === 0 ? node.name : `${node.name} (${node.aliases.join(", ")})`;
|
|
1084
|
+
const parameterTokens = node.kind === "command"
|
|
1085
|
+
? formatCommandParameterTokens(node, casing, globalLongOptionFlags)
|
|
1086
|
+
: [];
|
|
1087
|
+
const name = parameterTokens.length === 0 ? baseName : `${baseName} ${parameterTokens.join(" ")}`;
|
|
1088
|
+
return name;
|
|
1089
|
+
}
|
|
1090
|
+
function formatCommandRows(group, scope, casing, globalLongOptionFlags) {
|
|
1091
|
+
return getHelpChildren(group, scope).map((child) => ({
|
|
1092
|
+
name: formatCommandRowName(child, casing, globalLongOptionFlags),
|
|
1093
|
+
description: child.description ?? ""
|
|
1094
|
+
}));
|
|
1095
|
+
}
|
|
1096
|
+
function formatGlobalOptionsLine(ctx) {
|
|
1097
|
+
const flags = [];
|
|
1098
|
+
if (ctx.presetsEnabled) {
|
|
1099
|
+
flags.push("--preset <path>");
|
|
1100
|
+
}
|
|
1101
|
+
if (ctx.controls.yes) {
|
|
1102
|
+
flags.push("--yes");
|
|
1103
|
+
}
|
|
1104
|
+
if (ctx.controls.output) {
|
|
1105
|
+
flags.push("--output <format>");
|
|
1106
|
+
}
|
|
1107
|
+
if (ctx.controls.verbose) {
|
|
1108
|
+
flags.push("-v, --verbose");
|
|
1109
|
+
}
|
|
1110
|
+
if (ctx.showVersion) {
|
|
1111
|
+
flags.push("--version");
|
|
1112
|
+
}
|
|
1113
|
+
return flags.length > 0 ? `${text.section("Options:")} ${flags.join(" ")}` : "";
|
|
1114
|
+
}
|
|
1115
|
+
function formatLeafGlobalOptionsLine(ctx) {
|
|
1116
|
+
return ctx.controls.verbose ? `${text.section("Options:")} -v, --verbose` : "";
|
|
1117
|
+
}
|
|
1118
|
+
function collectSchemaGlobalFieldRows(group, scope, casing, globalLongOptionFlags) {
|
|
1119
|
+
const seen = new Map();
|
|
1120
|
+
const visit = (node) => {
|
|
1121
|
+
if (node.kind === "command") {
|
|
1122
|
+
const collected = collectFields(node.params, casing, globalLongOptionFlags);
|
|
1123
|
+
for (const field of collected.fields) {
|
|
1124
|
+
if (field.global !== true) {
|
|
1125
|
+
continue;
|
|
1126
|
+
}
|
|
1127
|
+
if (globalLongOptionFlags.has(field.optionFlag)) {
|
|
1128
|
+
continue;
|
|
1129
|
+
}
|
|
1130
|
+
const dedupeKey = `${field.optionFlag}|${field.shortFlag ?? ""}`;
|
|
1131
|
+
if (seen.has(dedupeKey)) {
|
|
1132
|
+
continue;
|
|
1133
|
+
}
|
|
1134
|
+
seen.set(dedupeKey, {
|
|
1135
|
+
flags: formatHelpFieldFlags(field, globalLongOptionFlags),
|
|
1136
|
+
description: formatHelpFieldDescription(field)
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
for (const child of getHelpChildren(node, scope)) {
|
|
1142
|
+
visit(child);
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
visit(group);
|
|
1146
|
+
return [...seen.values()];
|
|
1147
|
+
}
|
|
1148
|
+
function renderHelpSections(sections) {
|
|
1149
|
+
return sections.filter((section) => section.length > 0).join("\n\n");
|
|
1150
|
+
}
|
|
1151
|
+
function formatHelpCommandList(rows) {
|
|
1152
|
+
return process.stdout.isTTY !== true
|
|
1153
|
+
? helpFormatterPlain.formatCommandList(rows)
|
|
1154
|
+
: formatCommandList(rows);
|
|
1155
|
+
}
|
|
1156
|
+
function formatHelpOptionList(rows) {
|
|
1157
|
+
return process.stdout.isTTY !== true
|
|
1158
|
+
? helpFormatterPlain.formatOptionList(rows)
|
|
1159
|
+
: formatOptionList(rows);
|
|
1160
|
+
}
|
|
1161
|
+
function buildUsageLine(breadcrumb, rootUsageName, suffix) {
|
|
1162
|
+
const visibleBreadcrumb = breadcrumb.filter((segment) => segment.length > 0);
|
|
1163
|
+
const usageBreadcrumb = breadcrumb[0] === "" ? [rootUsageName, ...visibleBreadcrumb] : visibleBreadcrumb;
|
|
1164
|
+
const subPath = usageBreadcrumb.slice(1).join(" ");
|
|
1165
|
+
const tokens = [rootUsageName, subPath, suffix].filter((segment) => segment.length > 0);
|
|
1166
|
+
return tokens.join(" ");
|
|
1167
|
+
}
|
|
1168
|
+
function formatGroupUsageSuffix(group, scope, casing, globalLongOptionFlags) {
|
|
1169
|
+
if (group.default !== undefined &&
|
|
1170
|
+
group.default.hidden === true &&
|
|
1171
|
+
group.default.scope.includes(scope)) {
|
|
1172
|
+
const parameterTokens = formatCommandParameterTokens(group.default, casing, globalLongOptionFlags);
|
|
1173
|
+
return ["[command]", "[OPTIONS]", ...parameterTokens].join(" ");
|
|
1174
|
+
}
|
|
1175
|
+
return "[command] [OPTIONS]";
|
|
1176
|
+
}
|
|
1177
|
+
function renderGroupHelp(group, breadcrumb, scope, casing, globalOptions, rootUsageName, isRoot) {
|
|
1178
|
+
const sections = [];
|
|
1179
|
+
const globalLongOptionFlags = getGlobalLongOptionFlags(globalOptions.presetsEnabled, globalOptions.showVersion, globalOptions.controls);
|
|
1180
|
+
const commandRows = formatCommandRows(group, scope, casing, globalLongOptionFlags);
|
|
1181
|
+
if (commandRows.length > 0) {
|
|
1182
|
+
sections.push(`${text.sectionHeader("Commands")}\n${formatHelpCommandList(commandRows)}`);
|
|
1183
|
+
}
|
|
1184
|
+
if (isRoot) {
|
|
1185
|
+
const schemaGlobalRows = collectSchemaGlobalFieldRows(group, scope, casing, globalLongOptionFlags);
|
|
1186
|
+
const builtInLine = formatGlobalOptionsLine(globalOptions);
|
|
1187
|
+
if (schemaGlobalRows.length > 0) {
|
|
1188
|
+
sections.push(`${text.sectionHeader("Options")}\n${formatHelpOptionList(schemaGlobalRows)}\n${builtInLine}`);
|
|
1189
|
+
}
|
|
1190
|
+
else {
|
|
1191
|
+
sections.push(builtInLine);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
return renderHelpDocument({
|
|
1195
|
+
breadcrumb,
|
|
1196
|
+
rootUsageName,
|
|
1197
|
+
usageLine: buildUsageLine(breadcrumb, rootUsageName, formatGroupUsageSuffix(group, scope, casing, globalLongOptionFlags)),
|
|
1198
|
+
description: group.description,
|
|
1199
|
+
requiresAuth: group.requires?.auth === true,
|
|
1200
|
+
sections
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
function renderLeafHelp(command, breadcrumb, casing, globalOptions, rootUsageName) {
|
|
1204
|
+
const sections = [];
|
|
1205
|
+
const globalLongOptionFlags = getGlobalLongOptionFlags(globalOptions.presetsEnabled, globalOptions.showVersion, globalOptions.controls);
|
|
1206
|
+
const collected = collectFields(command.params, casing, globalLongOptionFlags);
|
|
1207
|
+
const fields = assignPositionals(collected.fields, command.positional);
|
|
1208
|
+
const optionRows = fields
|
|
1209
|
+
.filter((field) => field.global !== true)
|
|
1210
|
+
.map((field) => ({
|
|
1211
|
+
flags: formatHelpFieldFlags(field, globalLongOptionFlags),
|
|
1212
|
+
description: formatHelpFieldDescription(field)
|
|
1213
|
+
}))
|
|
1214
|
+
.concat(collected.dynamicFields.flatMap((field) => formatDynamicHelpFields(field, casing)));
|
|
1215
|
+
if (optionRows.length > 0) {
|
|
1216
|
+
sections.push(`${text.sectionHeader("Options")}\n${formatHelpOptionList(optionRows)}`);
|
|
1217
|
+
}
|
|
1218
|
+
const builtInLine = formatLeafGlobalOptionsLine(globalOptions);
|
|
1219
|
+
if (builtInLine.length > 0) {
|
|
1220
|
+
sections.push(builtInLine);
|
|
1221
|
+
}
|
|
1222
|
+
const secretRows = formatSecretRows(command.secrets);
|
|
1223
|
+
if (secretRows.length > 0) {
|
|
1224
|
+
sections.push(`${text.sectionHeader("Secrets (environment)")}\n${formatHelpOptionList(secretRows)}`);
|
|
1225
|
+
}
|
|
1226
|
+
if (command.examples.length > 0) {
|
|
1227
|
+
sections.push(`${text.sectionHeader("Examples")}\n${formatExampleRows(command.examples, breadcrumb, rootUsageName).join("\n")}`);
|
|
1228
|
+
}
|
|
1229
|
+
const positionalFields = fields.filter((f) => f.positionalIndex !== undefined);
|
|
1230
|
+
const usageSuffix = positionalFields.length > 0
|
|
1231
|
+
? `[OPTIONS] ${positionalFields.map(formatPositionalToken).join(" ")}`
|
|
1232
|
+
: "[OPTIONS]";
|
|
1233
|
+
return renderHelpDocument({
|
|
1234
|
+
breadcrumb,
|
|
1235
|
+
rootUsageName,
|
|
1236
|
+
usageLine: buildUsageLine(breadcrumb, rootUsageName, usageSuffix),
|
|
1237
|
+
description: command.description,
|
|
1238
|
+
requiresAuth: command.requires?.auth === true,
|
|
1239
|
+
sections
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
function renderJsonHelp(target, root, casing, globalOptions, rootUsageName) {
|
|
1243
|
+
const globalLongOptionFlags = getGlobalLongOptionFlags(globalOptions.presetsEnabled, globalOptions.showVersion, globalOptions.controls);
|
|
1244
|
+
const node = target.node;
|
|
1245
|
+
if (node.kind === "group") {
|
|
1246
|
+
const commandRows = formatCommandRows(node, "cli", casing, globalLongOptionFlags);
|
|
1247
|
+
const isRoot = node === root;
|
|
1248
|
+
return `${JSON.stringify({
|
|
1249
|
+
schemaVersion: 1,
|
|
1250
|
+
kind: "group",
|
|
1251
|
+
name: target.breadcrumb.at(-1) ?? rootUsageName,
|
|
1252
|
+
path: target.breadcrumb.filter((segment) => segment.length > 0),
|
|
1253
|
+
usage: buildUsageLine(target.breadcrumb, rootUsageName, formatGroupUsageSuffix(node, "cli", casing, globalLongOptionFlags)),
|
|
1254
|
+
...(node.description === undefined ? {} : { description: node.description }),
|
|
1255
|
+
commands: commandRows.map((row) => ({ name: row.name, description: row.description })),
|
|
1256
|
+
options: isRoot
|
|
1257
|
+
? collectSchemaGlobalFieldRows(node, "cli", casing, globalLongOptionFlags).map((row) => ({
|
|
1258
|
+
name: row.flags.split(/[ ,]+/)[0]?.replace(/^--/, "") ?? row.flags,
|
|
1259
|
+
flags: row.flags.split(", "),
|
|
1260
|
+
type: "unknown",
|
|
1261
|
+
description: row.description,
|
|
1262
|
+
required: false
|
|
1263
|
+
}))
|
|
1264
|
+
: []
|
|
1265
|
+
}, null, 2)}\n`;
|
|
1266
|
+
}
|
|
1267
|
+
const collected = collectFields(node.params, casing, globalLongOptionFlags);
|
|
1268
|
+
const fields = assignPositionals(collected.fields, node.positional);
|
|
1269
|
+
const positionalFields = fields.filter((field) => field.positionalIndex !== undefined);
|
|
1270
|
+
const usageSuffix = positionalFields.length > 0
|
|
1271
|
+
? `[OPTIONS] ${positionalFields.map(formatPositionalToken).join(" ")}`
|
|
1272
|
+
: "[OPTIONS]";
|
|
1273
|
+
return `${JSON.stringify({
|
|
1274
|
+
schemaVersion: 1,
|
|
1275
|
+
kind: "command",
|
|
1276
|
+
name: node.name,
|
|
1277
|
+
path: target.breadcrumb.filter((segment) => segment.length > 0),
|
|
1278
|
+
usage: buildUsageLine(target.breadcrumb, rootUsageName, usageSuffix),
|
|
1279
|
+
...(node.description === undefined ? {} : { description: node.description }),
|
|
1280
|
+
options: fields
|
|
1281
|
+
.filter((field) => field.global !== true)
|
|
1282
|
+
.map((field) => formatJsonHelpOption(field, globalLongOptionFlags)),
|
|
1283
|
+
secrets: Object.entries(node.secrets).map(([name, secret]) => ({
|
|
1284
|
+
name,
|
|
1285
|
+
env: secret.env,
|
|
1286
|
+
required: secret.optional !== true,
|
|
1287
|
+
...(secret.description === undefined ? {} : { description: secret.description })
|
|
1288
|
+
})),
|
|
1289
|
+
examples: node.examples
|
|
1290
|
+
}, null, 2)}\n`;
|
|
1291
|
+
}
|
|
1292
|
+
function formatJsonHelpOption(field, globalLongOptionFlags) {
|
|
1293
|
+
return {
|
|
1294
|
+
name: field.displayPath,
|
|
1295
|
+
flags: formatHelpFieldFlags(field, globalLongOptionFlags).split(", "),
|
|
1296
|
+
type: formatJsonHelpSchemaType(field.schema),
|
|
1297
|
+
...(field.description === undefined ? {} : { description: field.description }),
|
|
1298
|
+
required: field.requiredWhenActive,
|
|
1299
|
+
...(field.hasDefault ? { default: field.defaultValue } : {}),
|
|
1300
|
+
...(field.positionalIndex === undefined ? {} : { positional: true })
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
function formatJsonHelpSchemaType(schema) {
|
|
1304
|
+
if (schema.kind === "enum") {
|
|
1305
|
+
return "enum";
|
|
1306
|
+
}
|
|
1307
|
+
if (schema.kind === "array") {
|
|
1308
|
+
return "array";
|
|
1309
|
+
}
|
|
1310
|
+
if (schema.kind === "json") {
|
|
1311
|
+
return "json";
|
|
1312
|
+
}
|
|
1313
|
+
return schema.kind;
|
|
1314
|
+
}
|
|
1315
|
+
function renderHelpDocument(input) {
|
|
1316
|
+
const title = input.breadcrumb.filter((segment) => segment.length > 0).join(" ") || input.rootUsageName;
|
|
1317
|
+
const description = input.description ?? "";
|
|
1318
|
+
const sentenceEndIndex = description.indexOf(". ");
|
|
1319
|
+
const headingDescription = sentenceEndIndex === -1 ? description : description.slice(0, sentenceEndIndex + 1);
|
|
1320
|
+
const remainingDescription = sentenceEndIndex === -1 ? "" : description.slice(sentenceEndIndex + 2);
|
|
1321
|
+
const heading = headingDescription.length > 0 ? `${title} — ${headingDescription}` : title;
|
|
1322
|
+
const lines = [text.heading(heading), ""];
|
|
1323
|
+
if (remainingDescription.length > 0) {
|
|
1324
|
+
lines.push(remainingDescription, "");
|
|
1325
|
+
}
|
|
1326
|
+
lines.push(`Usage: ${text.usageCommand(input.usageLine)}`, "");
|
|
1327
|
+
if (input.requiresAuth) {
|
|
1328
|
+
lines.push("Requires: authentication");
|
|
1329
|
+
}
|
|
1330
|
+
if (input.requiresAuth) {
|
|
1331
|
+
lines.push("");
|
|
1332
|
+
}
|
|
1333
|
+
lines.push(renderHelpSections(input.sections));
|
|
1334
|
+
return `${lines.join("\n").trimEnd()}\n`;
|
|
1335
|
+
}
|
|
1336
|
+
async function renderGeneratedHelp(root, argv, options) {
|
|
1337
|
+
const output = resolveHelpOutput(argv);
|
|
1338
|
+
const casing = options.casing ?? "kebab";
|
|
1339
|
+
const rootUsageName = options.rootUsageName ?? inferProgramName(argv);
|
|
1340
|
+
const target = resolveHelpTarget(root, argv, "cli", rootUsageName, options.rootDisplayName);
|
|
1341
|
+
const controls = resolveCLIControls(options.controls);
|
|
1342
|
+
if (output === "json") {
|
|
1343
|
+
process.stdout.write(renderJsonHelp(target, root, casing, {
|
|
1344
|
+
controls,
|
|
1345
|
+
showVersion: options.version !== undefined,
|
|
1346
|
+
presetsEnabled: options.presets === true
|
|
1347
|
+
}, rootUsageName));
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
await withOutputFormat(output, async () => {
|
|
1351
|
+
const rendered = target.node.kind === "group"
|
|
1352
|
+
? renderGroupHelp(target.node, target.breadcrumb, "cli", casing, {
|
|
1353
|
+
controls,
|
|
1354
|
+
showVersion: options.version !== undefined,
|
|
1355
|
+
presetsEnabled: options.presets === true
|
|
1356
|
+
}, rootUsageName, target.node === root)
|
|
1357
|
+
: renderLeafHelp(target.node, target.breadcrumb, casing, {
|
|
1358
|
+
controls,
|
|
1359
|
+
showVersion: options.version !== undefined,
|
|
1360
|
+
presetsEnabled: options.presets === true
|
|
1361
|
+
}, rootUsageName);
|
|
1362
|
+
process.stdout.write(rendered);
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
function createNodeCommand(node, casing, globalLongOptionFlags, execute, presetsEnabled, controls, pathSegments = []) {
|
|
1366
|
+
const nextPathSegments = [...pathSegments, node.name];
|
|
1367
|
+
if (node.kind === "command") {
|
|
1368
|
+
if (!node.scope.includes("cli")) {
|
|
1369
|
+
return null;
|
|
1370
|
+
}
|
|
1371
|
+
const command = new CommanderCommand(node.name);
|
|
1372
|
+
Reflect.set(command, "_toolcraftHidden", node.hidden);
|
|
1373
|
+
Reflect.set(command, "_toolcraftOriginalName", node.name);
|
|
1374
|
+
const collected = collectFields(node.params, casing, globalLongOptionFlags);
|
|
1375
|
+
const fields = assignPositionals(collected.fields, node.positional);
|
|
1376
|
+
validateUniqueOptionFlags(fields, globalLongOptionFlags);
|
|
1377
|
+
if (node.description !== undefined) {
|
|
1378
|
+
command.description(node.description);
|
|
1379
|
+
}
|
|
1380
|
+
node.aliases.forEach((alias) => command.alias(alias));
|
|
1381
|
+
command.addHelpCommand(false);
|
|
1382
|
+
addGlobalOptions(command, presetsEnabled, controls);
|
|
1383
|
+
command.allowExcessArguments(true);
|
|
1384
|
+
if (collected.dynamicFields.length > 0) {
|
|
1385
|
+
command.allowUnknownOption(true);
|
|
1386
|
+
}
|
|
1387
|
+
for (const field of fields) {
|
|
1388
|
+
if (field.positionalIndex !== undefined) {
|
|
1389
|
+
command.argument(formatPositionalToken(field));
|
|
1390
|
+
continue;
|
|
1391
|
+
}
|
|
1392
|
+
for (const option of createOption(field, globalLongOptionFlags)) {
|
|
1393
|
+
command.addOption(option);
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
command.action(async (...args) => {
|
|
1397
|
+
const actionCommand = args[args.length - 1];
|
|
1398
|
+
const positionalValues = args.slice(0, -2);
|
|
1399
|
+
await execute({
|
|
1400
|
+
command: node,
|
|
1401
|
+
commandPath: nextPathSegments.join("."),
|
|
1402
|
+
casing,
|
|
1403
|
+
dynamicFields: collected.dynamicFields,
|
|
1404
|
+
fields,
|
|
1405
|
+
positionalValues,
|
|
1406
|
+
presetsEnabled,
|
|
1407
|
+
rawArgv: actionCommand.args,
|
|
1408
|
+
actionCommand,
|
|
1409
|
+
variants: collected.variants
|
|
1410
|
+
});
|
|
1411
|
+
});
|
|
1412
|
+
return command;
|
|
1413
|
+
}
|
|
1414
|
+
if (!isNodeVisibleInScope(node, "cli")) {
|
|
1415
|
+
return null;
|
|
1416
|
+
}
|
|
1417
|
+
const reservedChildNames = node.children
|
|
1418
|
+
.filter((child) => !isNodeVisibleInScope(child, "cli"))
|
|
1419
|
+
.flatMap((child) => getNodeCommandNames(child));
|
|
1420
|
+
const visibleChildren = node.children
|
|
1421
|
+
.map((child) => createNodeCommand(child, casing, globalLongOptionFlags, execute, presetsEnabled, controls, nextPathSegments))
|
|
1422
|
+
.filter((child) => child !== null);
|
|
1423
|
+
const group = new CommanderCommand(node.name);
|
|
1424
|
+
Reflect.set(group, "_toolcraftReservedChildNames", reservedChildNames);
|
|
1425
|
+
if (node.description !== undefined) {
|
|
1426
|
+
group.description(node.description);
|
|
1427
|
+
}
|
|
1428
|
+
node.aliases.forEach((alias) => group.alias(alias));
|
|
1429
|
+
group.addHelpCommand(false);
|
|
1430
|
+
addGlobalOptions(group, presetsEnabled, controls);
|
|
1431
|
+
const childNames = new Set(visibleChildren.map((child) => child.name()));
|
|
1432
|
+
for (const child of visibleChildren) {
|
|
1433
|
+
const isDefaultChild = node.default !== undefined &&
|
|
1434
|
+
node.default.scope.includes("cli") &&
|
|
1435
|
+
(child.name() === node.default.name || child.aliases().includes(node.default.name));
|
|
1436
|
+
addCommanderChild(group, child, isDefaultChild, childNames);
|
|
1437
|
+
}
|
|
1438
|
+
return group;
|
|
1439
|
+
}
|
|
1440
|
+
function addCommanderChild(parent, child, isDefault, siblingNames) {
|
|
1441
|
+
if (isDefault && (child.name().length === 0 || isToolcraftHiddenCommander(child))) {
|
|
1442
|
+
let internalName = "__toolcraft_default__";
|
|
1443
|
+
let suffix = 2;
|
|
1444
|
+
while (siblingNames.has(internalName)) {
|
|
1445
|
+
internalName = `__toolcraft_default_${suffix}`;
|
|
1446
|
+
suffix += 1;
|
|
1447
|
+
}
|
|
1448
|
+
child.name(internalName);
|
|
1449
|
+
Reflect.set(parent, "_toolcraftHiddenDefaultNames", getToolcraftHiddenDefaultNames(parent).concat([
|
|
1450
|
+
...new Set([Reflect.get(child, "_toolcraftOriginalName"), ...child.aliases()].filter((name) => typeof name === "string" && name.length > 0))
|
|
1451
|
+
]));
|
|
1452
|
+
parent.addCommand(child, { hidden: true, isDefault: true });
|
|
1453
|
+
return;
|
|
1454
|
+
}
|
|
1455
|
+
const options = {
|
|
1456
|
+
...(isDefault ? { isDefault: true } : {}),
|
|
1457
|
+
...(isToolcraftHiddenCommander(child) ? { hidden: true } : {})
|
|
1458
|
+
};
|
|
1459
|
+
parent.addCommand(child, Object.keys(options).length > 0 ? options : undefined);
|
|
1460
|
+
}
|
|
1461
|
+
function isToolcraftHiddenCommander(command) {
|
|
1462
|
+
return Reflect.get(command, "_toolcraftHidden") === true;
|
|
1463
|
+
}
|
|
1464
|
+
function getToolcraftHiddenDefaultNames(command) {
|
|
1465
|
+
const value = Reflect.get(command, "_toolcraftHiddenDefaultNames");
|
|
1466
|
+
return Array.isArray(value)
|
|
1467
|
+
? value.filter((item) => typeof item === "string")
|
|
1468
|
+
: [];
|
|
1469
|
+
}
|
|
1470
|
+
function getToolcraftReservedChildNames(command) {
|
|
1471
|
+
const value = Reflect.get(command, "_toolcraftReservedChildNames");
|
|
1472
|
+
return Array.isArray(value)
|
|
1473
|
+
? value.filter((item) => typeof item === "string")
|
|
1474
|
+
: [];
|
|
1475
|
+
}
|
|
1476
|
+
function getNodeCommandNames(node) {
|
|
1477
|
+
return [node.name, ...node.aliases].filter((name) => name.length > 0);
|
|
1478
|
+
}
|
|
1479
|
+
function addGlobalOptions(command, presetsEnabled, controls) {
|
|
1480
|
+
const options = [];
|
|
1481
|
+
if (presetsEnabled) {
|
|
1482
|
+
options.push(new Option("--preset <path>", "Load parameter defaults from a JSON file."));
|
|
1483
|
+
}
|
|
1484
|
+
if (controls.yes) {
|
|
1485
|
+
options.push(new Option("--yes", "Accept defaults and skip prompts."));
|
|
1486
|
+
}
|
|
1487
|
+
if (controls.output) {
|
|
1488
|
+
options.push(new Option("--output <format>", "Output format.").argParser((value) => {
|
|
1489
|
+
if (value === "rich" || value === "md" || value === "json") {
|
|
1490
|
+
return value;
|
|
1491
|
+
}
|
|
1492
|
+
if (value === "markdown") {
|
|
1493
|
+
return "md";
|
|
1494
|
+
}
|
|
1495
|
+
throw new InvalidArgumentError(formatInvalidEnumMessage("--output", value, ["rich", "md", "markdown", "json"], {
|
|
1496
|
+
candidates: ["rich", "markdown", "json"],
|
|
1497
|
+
threshold: 3
|
|
1498
|
+
}));
|
|
1499
|
+
}));
|
|
1500
|
+
}
|
|
1501
|
+
if (controls.debug) {
|
|
1502
|
+
options.push(new Option("--debug [mode]", "Print stack traces for unexpected errors.")
|
|
1503
|
+
.preset("trim")
|
|
1504
|
+
.argParser(parseDebugStackMode));
|
|
1505
|
+
}
|
|
1506
|
+
if (controls.logLevel) {
|
|
1507
|
+
options.push(new Option("--log-level <level>", "Set runtime diagnostic log level.").argParser(parseLogLevel));
|
|
1508
|
+
}
|
|
1509
|
+
if (controls.verbose) {
|
|
1510
|
+
options.push(new Option("--verbose", "Print detailed runtime diagnostics."));
|
|
1511
|
+
}
|
|
1512
|
+
for (const option of options) {
|
|
1513
|
+
option.hideHelp(true);
|
|
1514
|
+
command.addOption(option);
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
function parseDebugStackMode(value) {
|
|
1518
|
+
if (value === true || value === "trim") {
|
|
1519
|
+
return "trim";
|
|
1520
|
+
}
|
|
1521
|
+
if (value === "raw") {
|
|
1522
|
+
return "raw";
|
|
1523
|
+
}
|
|
1524
|
+
throw new InvalidArgumentError(formatInvalidEnumMessage("--debug", String(value), ["raw"], { candidates: ["raw"] }));
|
|
1525
|
+
}
|
|
1526
|
+
function parseLogLevel(value) {
|
|
1527
|
+
if (isLogLevel(value)) {
|
|
1528
|
+
return value;
|
|
1529
|
+
}
|
|
1530
|
+
throw new InvalidArgumentError(formatInvalidEnumMessage("--log-level", value, [...LOG_LEVELS], {
|
|
1531
|
+
candidates: ["warn", "debug", "trace"],
|
|
1532
|
+
threshold: 3
|
|
1533
|
+
}));
|
|
1534
|
+
}
|
|
1535
|
+
function writeCLIDiagnosticEvent(event) {
|
|
1536
|
+
const transcript = event.data?.transcript;
|
|
1537
|
+
if (typeof transcript === "string") {
|
|
1538
|
+
process.stderr.write(transcript);
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1541
|
+
if (event.category === "progress" || event.level === "trace") {
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
process.stderr.write(`${event.message}\n`);
|
|
1545
|
+
}
|
|
1546
|
+
function setNestedValue(target, path, value) {
|
|
1547
|
+
let cursor = target;
|
|
1548
|
+
for (let index = 0; index < path.length - 1; index += 1) {
|
|
1549
|
+
const segment = path[index] ?? "";
|
|
1550
|
+
const existing = Object.prototype.hasOwnProperty.call(cursor, segment)
|
|
1551
|
+
? cursor[segment]
|
|
1552
|
+
: undefined;
|
|
1553
|
+
if (typeof existing === "object" && existing !== null) {
|
|
1554
|
+
cursor = existing;
|
|
1555
|
+
continue;
|
|
1556
|
+
}
|
|
1557
|
+
const next = {};
|
|
1558
|
+
Object.defineProperty(cursor, segment, {
|
|
1559
|
+
value: next,
|
|
1560
|
+
enumerable: true,
|
|
1561
|
+
configurable: true,
|
|
1562
|
+
writable: true
|
|
1563
|
+
});
|
|
1564
|
+
cursor = next;
|
|
1565
|
+
}
|
|
1566
|
+
const leaf = path[path.length - 1];
|
|
1567
|
+
if (leaf !== undefined) {
|
|
1568
|
+
Object.defineProperty(cursor, leaf, {
|
|
1569
|
+
value,
|
|
1570
|
+
enumerable: true,
|
|
1571
|
+
configurable: true,
|
|
1572
|
+
writable: true
|
|
1573
|
+
});
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
function formatResolvedValue(value) {
|
|
1577
|
+
if (Array.isArray(value)) {
|
|
1578
|
+
return value.map((item) => String(item)).join(", ");
|
|
1579
|
+
}
|
|
1580
|
+
if (typeof value === "string") {
|
|
1581
|
+
return value;
|
|
1582
|
+
}
|
|
1583
|
+
return JSON.stringify(value);
|
|
1584
|
+
}
|
|
1585
|
+
function fieldPromptLabel(field) {
|
|
1586
|
+
return field.positionalIndex === undefined ? field.optionFlag : `<${field.displayPath}>`;
|
|
1587
|
+
}
|
|
1588
|
+
function enumOptionLabel(schema, value) {
|
|
1589
|
+
const key = String(value);
|
|
1590
|
+
if (schema.labels === undefined || !Object.prototype.hasOwnProperty.call(schema.labels, key)) {
|
|
1591
|
+
return key;
|
|
1592
|
+
}
|
|
1593
|
+
return schema.labels[key] ?? key;
|
|
1594
|
+
}
|
|
1595
|
+
async function promptForField(field) {
|
|
1596
|
+
const schema = field.schema;
|
|
1597
|
+
if (schema.kind === "enum") {
|
|
1598
|
+
const options = schema.loadOptions
|
|
1599
|
+
? await schema.loadOptions()
|
|
1600
|
+
: schema.values.map((value) => ({
|
|
1601
|
+
label: enumOptionLabel(schema, value),
|
|
1602
|
+
value
|
|
1603
|
+
}));
|
|
1604
|
+
const selected = await select({
|
|
1605
|
+
message: field.description ?? fieldPromptLabel(field),
|
|
1606
|
+
options,
|
|
1607
|
+
initialValue: field.hasDefault ? field.defaultValue : undefined
|
|
1608
|
+
});
|
|
1609
|
+
if (isCancel(selected)) {
|
|
1610
|
+
cancel("Operation cancelled.");
|
|
1611
|
+
throw new UserError("Operation cancelled.");
|
|
1612
|
+
}
|
|
1613
|
+
return selected;
|
|
1614
|
+
}
|
|
1615
|
+
if (field.schema.kind === "boolean") {
|
|
1616
|
+
const selected = await confirm({
|
|
1617
|
+
message: fieldPromptLabel(field),
|
|
1618
|
+
initialValue: field.hasDefault ? Boolean(field.defaultValue) : undefined
|
|
1619
|
+
});
|
|
1620
|
+
if (isCancel(selected)) {
|
|
1621
|
+
cancel("Operation cancelled.");
|
|
1622
|
+
throw new UserError("Operation cancelled.");
|
|
1623
|
+
}
|
|
1624
|
+
return selected;
|
|
1625
|
+
}
|
|
1626
|
+
const entered = await promptText({
|
|
1627
|
+
message: fieldPromptLabel(field),
|
|
1628
|
+
initialValue: field.hasDefault && field.defaultValue !== undefined
|
|
1629
|
+
? formatResolvedValue(field.defaultValue)
|
|
1630
|
+
: undefined
|
|
1631
|
+
});
|
|
1632
|
+
if (isCancel(entered)) {
|
|
1633
|
+
cancel("Operation cancelled.");
|
|
1634
|
+
throw new UserError("Operation cancelled.");
|
|
1635
|
+
}
|
|
1636
|
+
if (typeof entered !== "string") {
|
|
1637
|
+
throw new UserError(`Missing required parameter "${field.displayPath}".`);
|
|
1638
|
+
}
|
|
1639
|
+
if (entered.trim().length === 0 && field.hasDefault) {
|
|
1640
|
+
return field.defaultValue;
|
|
1641
|
+
}
|
|
1642
|
+
if (field.schema.kind === "array") {
|
|
1643
|
+
return parseArrayValue(entered, field.schema, field.displayPath);
|
|
1644
|
+
}
|
|
1645
|
+
if (field.schema.kind === "json") {
|
|
1646
|
+
if (entered === "null" && field.schema.nullable === true) {
|
|
1647
|
+
return null;
|
|
1648
|
+
}
|
|
1649
|
+
return parseJsonText(entered, field.displayPath);
|
|
1650
|
+
}
|
|
1651
|
+
return parseScalarValue(entered, field.schema, field.displayPath);
|
|
1652
|
+
}
|
|
1653
|
+
function resolveOutput(resolvedFlags) {
|
|
1654
|
+
if (resolvedFlags.json === true) {
|
|
1655
|
+
return "json";
|
|
1656
|
+
}
|
|
1657
|
+
if (resolvedFlags.output !== undefined) {
|
|
1658
|
+
return resolvedFlags.output;
|
|
1659
|
+
}
|
|
1660
|
+
return "rich";
|
|
1661
|
+
}
|
|
1662
|
+
function resolveOutputFromArgv(argv) {
|
|
1663
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
1664
|
+
const token = argv[index] ?? "";
|
|
1665
|
+
if (token === "--json") {
|
|
1666
|
+
return "json";
|
|
1667
|
+
}
|
|
1668
|
+
if (token === "--md" || token === "--markdown") {
|
|
1669
|
+
return "md";
|
|
1670
|
+
}
|
|
1671
|
+
if (token === "--output") {
|
|
1672
|
+
const value = argv[index + 1];
|
|
1673
|
+
if (value === "rich" || value === "md" || value === "json") {
|
|
1674
|
+
return value;
|
|
1675
|
+
}
|
|
1676
|
+
if (value === "markdown") {
|
|
1677
|
+
return "md";
|
|
1678
|
+
}
|
|
1679
|
+
continue;
|
|
1680
|
+
}
|
|
1681
|
+
if (token.startsWith("--output=")) {
|
|
1682
|
+
const value = token.slice("--output=".length);
|
|
1683
|
+
if (value === "rich" || value === "md" || value === "json") {
|
|
1684
|
+
return value;
|
|
1685
|
+
}
|
|
1686
|
+
if (value === "markdown") {
|
|
1687
|
+
return "md";
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
return "rich";
|
|
1692
|
+
}
|
|
1693
|
+
const DESIGN_SYSTEM_OUTPUT_BY_MODE = {
|
|
1694
|
+
rich: "terminal",
|
|
1695
|
+
md: "markdown",
|
|
1696
|
+
json: "json"
|
|
1697
|
+
};
|
|
1698
|
+
function toDesignSystemOutput(output) {
|
|
1699
|
+
return DESIGN_SYSTEM_OUTPUT_BY_MODE[output];
|
|
1700
|
+
}
|
|
1701
|
+
async function withOutputFormat(output, fn) {
|
|
1702
|
+
const previous = process.env.OUTPUT_FORMAT;
|
|
1703
|
+
process.env.OUTPUT_FORMAT = toDesignSystemOutput(output);
|
|
1704
|
+
resetOutputFormatCache();
|
|
1705
|
+
try {
|
|
1706
|
+
return await fn();
|
|
1707
|
+
}
|
|
1708
|
+
finally {
|
|
1709
|
+
if (previous === undefined) {
|
|
1710
|
+
delete process.env.OUTPUT_FORMAT;
|
|
1711
|
+
}
|
|
1712
|
+
else {
|
|
1713
|
+
process.env.OUTPUT_FORMAT = previous;
|
|
1714
|
+
}
|
|
1715
|
+
resetOutputFormatCache();
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
function createFs() {
|
|
1719
|
+
return {
|
|
1720
|
+
readFile: async (path, encoding = "utf8") => readFile(path, { encoding }),
|
|
1721
|
+
writeFile: async (path, contents, options) => {
|
|
1722
|
+
await writeFile(path, contents, options);
|
|
1723
|
+
},
|
|
1724
|
+
exists: async (path) => {
|
|
1725
|
+
try {
|
|
1726
|
+
await access(path);
|
|
1727
|
+
return true;
|
|
1728
|
+
}
|
|
1729
|
+
catch {
|
|
1730
|
+
return false;
|
|
1731
|
+
}
|
|
1732
|
+
},
|
|
1733
|
+
lstat: async (path) => lstat(path),
|
|
1734
|
+
rename: async (fromPath, toPath) => rename(fromPath, toPath),
|
|
1735
|
+
unlink: async (path) => unlink(path)
|
|
1736
|
+
};
|
|
1737
|
+
}
|
|
1738
|
+
function createEnv(values = process.env) {
|
|
1739
|
+
return {
|
|
1740
|
+
get(key) {
|
|
1741
|
+
return values[key];
|
|
1742
|
+
}
|
|
1743
|
+
};
|
|
1744
|
+
}
|
|
1745
|
+
function isPlainObject(value) {
|
|
1746
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1747
|
+
}
|
|
1748
|
+
function hasFieldValue(value) {
|
|
1749
|
+
return value !== undefined;
|
|
1750
|
+
}
|
|
1751
|
+
function hasNestedField(fields, path) {
|
|
1752
|
+
return fields.some((field) => path.length < field.path.length &&
|
|
1753
|
+
path.every((segment, index) => field.path[index] === segment));
|
|
1754
|
+
}
|
|
1755
|
+
function describeExpectedPresetValue(schema) {
|
|
1756
|
+
if (schema.kind === "array") {
|
|
1757
|
+
return "an array";
|
|
1758
|
+
}
|
|
1759
|
+
if (schema.kind === "number") {
|
|
1760
|
+
return getExpectedNumberDescription(schema);
|
|
1761
|
+
}
|
|
1762
|
+
if (schema.kind === "json") {
|
|
1763
|
+
return "valid JSON";
|
|
1764
|
+
}
|
|
1765
|
+
if (schema.kind === "enum") {
|
|
1766
|
+
return `one of: ${schema.values.map((value) => JSON.stringify(value)).join(", ")}`;
|
|
1767
|
+
}
|
|
1768
|
+
return `a ${schema.kind}`;
|
|
1769
|
+
}
|
|
1770
|
+
function validatePresetScalarValue(value, schema, fieldPath, presetPath) {
|
|
1771
|
+
if (value === null && schema.nullable === true) {
|
|
1772
|
+
return null;
|
|
1773
|
+
}
|
|
1774
|
+
switch (schema.kind) {
|
|
1775
|
+
case "string":
|
|
1776
|
+
if (typeof value !== "string") {
|
|
1777
|
+
break;
|
|
1778
|
+
}
|
|
1779
|
+
if (schema.minLength !== undefined && value.length < schema.minLength) {
|
|
1780
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${fieldPath}". Expected a string with length at least ${schema.minLength}, got string with length ${value.length}.`);
|
|
1781
|
+
}
|
|
1782
|
+
if (schema.maxLength !== undefined && value.length > schema.maxLength) {
|
|
1783
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${fieldPath}". Expected a string with length at most ${schema.maxLength}, got string with length ${value.length}.`);
|
|
1784
|
+
}
|
|
1785
|
+
if (schema.pattern !== undefined && !matchesStringPattern(value, schema.pattern)) {
|
|
1786
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${fieldPath}": "${value}" does not match pattern "${schema.pattern}".`);
|
|
1787
|
+
}
|
|
1788
|
+
return value;
|
|
1789
|
+
case "number":
|
|
1790
|
+
if (!isValidNumberSchemaValue(value, schema)) {
|
|
1791
|
+
break;
|
|
1792
|
+
}
|
|
1793
|
+
return value;
|
|
1794
|
+
case "boolean":
|
|
1795
|
+
if (typeof value !== "boolean") {
|
|
1796
|
+
break;
|
|
1797
|
+
}
|
|
1798
|
+
return value;
|
|
1799
|
+
case "enum": {
|
|
1800
|
+
const match = schema.values.find((candidate) => Object.is(candidate, value));
|
|
1801
|
+
if (match !== undefined) {
|
|
1802
|
+
return match;
|
|
1803
|
+
}
|
|
1804
|
+
break;
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${fieldPath}". Expected ${describeExpectedPresetValue(schema)}, got ${describeReceived(value)}.`);
|
|
1808
|
+
}
|
|
1809
|
+
function validatePresetFieldValue(value, field, presetPath) {
|
|
1810
|
+
if (field.schema.kind === "json") {
|
|
1811
|
+
return value;
|
|
1812
|
+
}
|
|
1813
|
+
if (field.schema.kind !== "array") {
|
|
1814
|
+
return validatePresetScalarValue(value, field.schema, field.displayPath, presetPath);
|
|
1815
|
+
}
|
|
1816
|
+
const itemSchema = unwrapOptional(field.schema.item);
|
|
1817
|
+
if (itemSchema.kind === "array" || itemSchema.kind === "object") {
|
|
1818
|
+
throw new UserError(`Array parameter "${field.displayPath}" must use scalar items.`);
|
|
1819
|
+
}
|
|
1820
|
+
if (!Array.isArray(value)) {
|
|
1821
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${field.displayPath}". Expected an array, got ${describeReceived(value)}.`);
|
|
1822
|
+
}
|
|
1823
|
+
if (field.schema.minItems !== undefined && value.length < field.schema.minItems) {
|
|
1824
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${field.displayPath}". Expected an array with at least ${field.schema.minItems} items, got array(${value.length}).`);
|
|
1825
|
+
}
|
|
1826
|
+
if (field.schema.maxItems !== undefined && value.length > field.schema.maxItems) {
|
|
1827
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${field.displayPath}". Expected an array with at most ${field.schema.maxItems} items, got array(${value.length}).`);
|
|
1828
|
+
}
|
|
1829
|
+
return value.map((item) => validatePresetScalarValue(item, itemSchema, field.displayPath, presetPath));
|
|
1830
|
+
}
|
|
1831
|
+
async function loadPresetValues(fields, presetPath) {
|
|
1832
|
+
let rawPreset;
|
|
1833
|
+
try {
|
|
1834
|
+
rawPreset = await readFile(presetPath, {
|
|
1835
|
+
encoding: "utf8"
|
|
1836
|
+
});
|
|
1837
|
+
}
|
|
1838
|
+
catch (error) {
|
|
1839
|
+
if (hasOwnErrorCode(error, "ENOENT")) {
|
|
1840
|
+
throw new UserError(`Preset file "${presetPath}" was not found.`);
|
|
1841
|
+
}
|
|
1842
|
+
const message = error instanceof Error && error.message.length > 0 ? error.message : "Unknown read error.";
|
|
1843
|
+
throw new UserError(`Preset file "${presetPath}" could not be read: ${message}`);
|
|
1844
|
+
}
|
|
1845
|
+
let parsedPreset;
|
|
1846
|
+
try {
|
|
1847
|
+
parsedPreset = JSON.parse(rawPreset);
|
|
1848
|
+
}
|
|
1849
|
+
catch (error) {
|
|
1850
|
+
throw new UserError(formatJsonParseUserErrorMessage("Preset file", presetPath, rawPreset, error, {
|
|
1851
|
+
quotePath: true
|
|
1852
|
+
}), { cause: error });
|
|
1853
|
+
}
|
|
1854
|
+
if (!isPlainObject(parsedPreset)) {
|
|
1855
|
+
throw new UserError(`Preset file "${presetPath}" must contain a JSON object.`);
|
|
1856
|
+
}
|
|
1857
|
+
const fieldByPath = new Map(fields.map((field) => [field.displayPath, field]));
|
|
1858
|
+
const presetValues = {};
|
|
1859
|
+
function visitObject(current, path) {
|
|
1860
|
+
for (const [key, value] of Object.entries(current)) {
|
|
1861
|
+
const nextPath = [...path, key];
|
|
1862
|
+
const displayPath = toDisplayPath(nextPath);
|
|
1863
|
+
const field = fieldByPath.get(displayPath);
|
|
1864
|
+
if (field !== undefined) {
|
|
1865
|
+
presetValues[field.optionAttribute] = validatePresetFieldValue(value, field, presetPath);
|
|
1866
|
+
continue;
|
|
1867
|
+
}
|
|
1868
|
+
if (!hasNestedField(fields, nextPath)) {
|
|
1869
|
+
throw new UserError(`Preset file "${presetPath}" contains unknown parameter "${displayPath}".`);
|
|
1870
|
+
}
|
|
1871
|
+
if (!isPlainObject(value)) {
|
|
1872
|
+
throw new UserError(`Preset file "${presetPath}" has an invalid value for "${displayPath}". Expected an object, got ${describeReceived(value)}.`);
|
|
1873
|
+
}
|
|
1874
|
+
visitObject(value, nextPath);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
visitObject(parsedPreset, []);
|
|
1878
|
+
return presetValues;
|
|
1879
|
+
}
|
|
1880
|
+
function isNumericFixtureSelector(value) {
|
|
1881
|
+
if (value.length === 0) {
|
|
1882
|
+
return false;
|
|
1883
|
+
}
|
|
1884
|
+
for (const char of value) {
|
|
1885
|
+
if (char < "0" || char > "9") {
|
|
1886
|
+
return false;
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
return true;
|
|
1890
|
+
}
|
|
1891
|
+
function normalizeHttpMethod(value) {
|
|
1892
|
+
return (value ?? "GET").toUpperCase();
|
|
1893
|
+
}
|
|
1894
|
+
function isReadLikeMethod(name) {
|
|
1895
|
+
const normalized = name.toLowerCase();
|
|
1896
|
+
return (normalized === "get" ||
|
|
1897
|
+
normalized === "head" ||
|
|
1898
|
+
normalized === "options" ||
|
|
1899
|
+
normalized.startsWith("read") ||
|
|
1900
|
+
normalized.startsWith("get") ||
|
|
1901
|
+
normalized.startsWith("find") ||
|
|
1902
|
+
normalized.startsWith("list") ||
|
|
1903
|
+
normalized.startsWith("load") ||
|
|
1904
|
+
normalized.startsWith("fetch") ||
|
|
1905
|
+
normalized.startsWith("query") ||
|
|
1906
|
+
normalized.startsWith("exists") ||
|
|
1907
|
+
normalized.startsWith("has"));
|
|
1908
|
+
}
|
|
1909
|
+
function isWriteLikeMethod(name) {
|
|
1910
|
+
const normalized = name.toLowerCase();
|
|
1911
|
+
return (normalized === "post" ||
|
|
1912
|
+
normalized === "put" ||
|
|
1913
|
+
normalized === "patch" ||
|
|
1914
|
+
normalized === "delete" ||
|
|
1915
|
+
normalized.startsWith("write") ||
|
|
1916
|
+
normalized.startsWith("set") ||
|
|
1917
|
+
normalized.startsWith("save") ||
|
|
1918
|
+
normalized.startsWith("create") ||
|
|
1919
|
+
normalized.startsWith("update") ||
|
|
1920
|
+
normalized.startsWith("delete") ||
|
|
1921
|
+
normalized.startsWith("remove") ||
|
|
1922
|
+
normalized.startsWith("insert"));
|
|
1923
|
+
}
|
|
1924
|
+
function matchesFixtureValue(expected, actual) {
|
|
1925
|
+
if (typeof expected === "string" && typeof actual === "string" && expected.endsWith("%")) {
|
|
1926
|
+
return actual.startsWith(expected.slice(0, -1));
|
|
1927
|
+
}
|
|
1928
|
+
if (Array.isArray(expected)) {
|
|
1929
|
+
if (!Array.isArray(actual) || expected.length !== actual.length) {
|
|
1930
|
+
return false;
|
|
1931
|
+
}
|
|
1932
|
+
return expected.every((item, index) => matchesFixtureValue(item, actual[index]));
|
|
1933
|
+
}
|
|
1934
|
+
if (isPlainObject(expected)) {
|
|
1935
|
+
if (!isPlainObject(actual)) {
|
|
1936
|
+
return false;
|
|
1937
|
+
}
|
|
1938
|
+
return Object.entries(expected).every(([key, value]) => matchesFixtureValue(value, actual[key]));
|
|
1939
|
+
}
|
|
1940
|
+
return Object.is(expected, actual);
|
|
1941
|
+
}
|
|
1942
|
+
function getFetchUrl(input) {
|
|
1943
|
+
if (typeof input === "string") {
|
|
1944
|
+
return input;
|
|
1945
|
+
}
|
|
1946
|
+
if (input instanceof URL) {
|
|
1947
|
+
return input.toString();
|
|
1948
|
+
}
|
|
1949
|
+
return input.url;
|
|
1950
|
+
}
|
|
1951
|
+
function createFixtureResponse(response) {
|
|
1952
|
+
const status = response.status ?? 200;
|
|
1953
|
+
const headers = new Headers(response.headers);
|
|
1954
|
+
if (response.body === undefined) {
|
|
1955
|
+
return new Response(null, {
|
|
1956
|
+
status,
|
|
1957
|
+
headers
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
if (typeof response.body === "string") {
|
|
1961
|
+
return new Response(response.body, {
|
|
1962
|
+
status,
|
|
1963
|
+
headers
|
|
1964
|
+
});
|
|
1965
|
+
}
|
|
1966
|
+
if (!headers.has("content-type")) {
|
|
1967
|
+
headers.set("content-type", "application/json");
|
|
1968
|
+
}
|
|
1969
|
+
return new Response(JSON.stringify(response.body), {
|
|
1970
|
+
status,
|
|
1971
|
+
headers
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
function createFixtureFetch(entries) {
|
|
1975
|
+
return async (input, init) => {
|
|
1976
|
+
const method = normalizeHttpMethod(init?.method ?? (input instanceof Request ? input.method : undefined));
|
|
1977
|
+
const url = getFetchUrl(input);
|
|
1978
|
+
const match = entries?.find((entry) => {
|
|
1979
|
+
const requestMethod = normalizeHttpMethod(entry.request.method);
|
|
1980
|
+
return requestMethod === method && entry.request.url === url;
|
|
1981
|
+
});
|
|
1982
|
+
if (match !== undefined) {
|
|
1983
|
+
return createFixtureResponse(match.response);
|
|
1984
|
+
}
|
|
1985
|
+
if (isReadLikeMethod(method)) {
|
|
1986
|
+
return null;
|
|
1987
|
+
}
|
|
1988
|
+
return new Response(null, {
|
|
1989
|
+
status: 204
|
|
1990
|
+
});
|
|
1991
|
+
};
|
|
1992
|
+
}
|
|
1993
|
+
function createFixtureFs(definition) {
|
|
1994
|
+
const fsDefinition = isPlainObject(definition) ? definition : {};
|
|
1995
|
+
const readFileEntries = isPlainObject(fsDefinition.readFile) ? fsDefinition.readFile : {};
|
|
1996
|
+
const existsEntries = isPlainObject(fsDefinition.exists) ? fsDefinition.exists : {};
|
|
1997
|
+
return {
|
|
1998
|
+
readFile: async (filePath) => {
|
|
1999
|
+
if (Object.prototype.hasOwnProperty.call(readFileEntries, filePath)) {
|
|
2000
|
+
return String(readFileEntries[filePath]);
|
|
2001
|
+
}
|
|
2002
|
+
return null;
|
|
2003
|
+
},
|
|
2004
|
+
writeFile: async () => undefined,
|
|
2005
|
+
exists: async (filePath) => {
|
|
2006
|
+
if (Object.prototype.hasOwnProperty.call(existsEntries, filePath)) {
|
|
2007
|
+
return Boolean(existsEntries[filePath]);
|
|
2008
|
+
}
|
|
2009
|
+
return Object.prototype.hasOwnProperty.call(readFileEntries, filePath);
|
|
2010
|
+
},
|
|
2011
|
+
lstat: async () => ({ isSymbolicLink: () => false }),
|
|
2012
|
+
rename: async () => undefined,
|
|
2013
|
+
unlink: async () => undefined
|
|
2014
|
+
};
|
|
2015
|
+
}
|
|
2016
|
+
function resolveFixtureMethodResult(methodName, definition, args) {
|
|
2017
|
+
if (Array.isArray(definition)) {
|
|
2018
|
+
for (const entry of definition) {
|
|
2019
|
+
if (!isPlainObject(entry)) {
|
|
2020
|
+
continue;
|
|
2021
|
+
}
|
|
2022
|
+
const explicitMatcher = isPlainObject(entry.request) ? entry.request : undefined;
|
|
2023
|
+
const matcher = explicitMatcher ??
|
|
2024
|
+
Object.fromEntries(Object.entries(entry).filter(([key]) => key !== "result" && key !== "response" && key !== "error"));
|
|
2025
|
+
const firstArg = args[0];
|
|
2026
|
+
let matched = false;
|
|
2027
|
+
if (Array.isArray(matcher.args)) {
|
|
2028
|
+
matched = matchesFixtureValue(matcher.args, args);
|
|
2029
|
+
}
|
|
2030
|
+
else if (Object.keys(matcher).length === 0) {
|
|
2031
|
+
matched = true;
|
|
2032
|
+
}
|
|
2033
|
+
else if (isPlainObject(firstArg)) {
|
|
2034
|
+
matched = matchesFixtureValue(matcher, firstArg);
|
|
2035
|
+
}
|
|
2036
|
+
else if (args.length === 1 && Object.keys(matcher).length === 1) {
|
|
2037
|
+
const [[, expectedValue]] = Object.entries(matcher);
|
|
2038
|
+
matched = matchesFixtureValue(expectedValue, firstArg);
|
|
2039
|
+
}
|
|
2040
|
+
if (!matched) {
|
|
2041
|
+
continue;
|
|
2042
|
+
}
|
|
2043
|
+
if (entry.error !== undefined) {
|
|
2044
|
+
throw new Error(String(entry.error));
|
|
2045
|
+
}
|
|
2046
|
+
if (Object.prototype.hasOwnProperty.call(entry, "result")) {
|
|
2047
|
+
return Promise.resolve(entry.result);
|
|
2048
|
+
}
|
|
2049
|
+
if (Object.prototype.hasOwnProperty.call(entry, "response")) {
|
|
2050
|
+
return Promise.resolve(entry.response);
|
|
2051
|
+
}
|
|
2052
|
+
return Promise.resolve(null);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
if (isPlainObject(definition)) {
|
|
2056
|
+
const firstArg = args[0];
|
|
2057
|
+
if (typeof firstArg === "string" &&
|
|
2058
|
+
Object.prototype.hasOwnProperty.call(definition, firstArg)) {
|
|
2059
|
+
return Promise.resolve(definition[firstArg]);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
if (isWriteLikeMethod(methodName)) {
|
|
2063
|
+
return Promise.resolve(undefined);
|
|
2064
|
+
}
|
|
2065
|
+
return Promise.resolve(null);
|
|
2066
|
+
}
|
|
2067
|
+
function createFixtureService(definition) {
|
|
2068
|
+
const methods = isPlainObject(definition) ? definition : {};
|
|
2069
|
+
return new Proxy({}, {
|
|
2070
|
+
get(_target, property) {
|
|
2071
|
+
if (property === "then") {
|
|
2072
|
+
return undefined;
|
|
2073
|
+
}
|
|
2074
|
+
const methodName = String(property);
|
|
2075
|
+
return async (...args) => resolveFixtureMethodResult(methodName, methods[methodName], args);
|
|
2076
|
+
}
|
|
2077
|
+
});
|
|
2078
|
+
}
|
|
2079
|
+
function resolveFixturePath(commandPath) {
|
|
2080
|
+
const parsed = path.parse(commandPath);
|
|
2081
|
+
return path.join(parsed.dir, `${parsed.name}.fixture.json`);
|
|
2082
|
+
}
|
|
2083
|
+
function selectFixtureScenario(scenarios, selector, fixturePath) {
|
|
2084
|
+
if (isNumericFixtureSelector(selector)) {
|
|
2085
|
+
const index = Number(selector) - 1;
|
|
2086
|
+
const scenario = scenarios[index];
|
|
2087
|
+
if (scenario === undefined) {
|
|
2088
|
+
throw new UserError(`Fixture scenario index ${selector} is out of range. Available scenarios: ${scenarios.length}.`);
|
|
2089
|
+
}
|
|
2090
|
+
return scenario;
|
|
2091
|
+
}
|
|
2092
|
+
const scenario = scenarios.find((entry) => entry.name === selector);
|
|
2093
|
+
if (scenario === undefined) {
|
|
2094
|
+
const names = scenarios
|
|
2095
|
+
.map((entry) => entry.name)
|
|
2096
|
+
.filter((name) => typeof name === "string" && name.length > 0);
|
|
2097
|
+
const available = names.length === 0
|
|
2098
|
+
? `No fixtures are declared in ${fixturePath}.`
|
|
2099
|
+
: formatAvailableList(names);
|
|
2100
|
+
throw new UserError(`Fixture scenario "${selector}" was not found. ${available}`);
|
|
2101
|
+
}
|
|
2102
|
+
return scenario;
|
|
2103
|
+
}
|
|
2104
|
+
async function loadFixtureScenario(command, selector) {
|
|
2105
|
+
const commandPath = getCommandSourcePath(command);
|
|
2106
|
+
if (commandPath === undefined) {
|
|
2107
|
+
throw new UserError(`Fixture mode could not determine the source file for command "${command.name}".`);
|
|
2108
|
+
}
|
|
2109
|
+
const fixturePath = resolveFixturePath(commandPath);
|
|
2110
|
+
let rawFixture;
|
|
2111
|
+
try {
|
|
2112
|
+
rawFixture = await readFile(fixturePath, {
|
|
2113
|
+
encoding: "utf8"
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
2116
|
+
catch {
|
|
2117
|
+
throw new UserError(`Fixture file not found for command "${command.name}". Expected ${fixturePath}.`);
|
|
2118
|
+
}
|
|
2119
|
+
let parsed;
|
|
2120
|
+
try {
|
|
2121
|
+
parsed = JSON.parse(rawFixture);
|
|
2122
|
+
}
|
|
2123
|
+
catch (error) {
|
|
2124
|
+
throw new UserError(formatJsonParseUserErrorMessage("Fixture file", fixturePath, rawFixture, error, {
|
|
2125
|
+
quotePath: false
|
|
2126
|
+
}), { cause: error });
|
|
2127
|
+
}
|
|
2128
|
+
if (!Array.isArray(parsed)) {
|
|
2129
|
+
throw new UserError(`Fixture file ${fixturePath} must contain a JSON array of scenarios.`);
|
|
2130
|
+
}
|
|
2131
|
+
return selectFixtureScenario(parsed, selector, fixturePath);
|
|
2132
|
+
}
|
|
2133
|
+
function resolveFixtureSecrets(command) {
|
|
2134
|
+
return Object.fromEntries(Object.keys(command.secrets).map((name) => [name, "fixture-secret"]));
|
|
2135
|
+
}
|
|
2136
|
+
function createFixtureEnvValues(command) {
|
|
2137
|
+
const values = {
|
|
2138
|
+
...process.env,
|
|
2139
|
+
POE_API_KEY: process.env.POE_API_KEY ?? "fixture-secret"
|
|
2140
|
+
};
|
|
2141
|
+
for (const secret of Object.values(command.secrets)) {
|
|
2142
|
+
values[secret.env] = values[secret.env] ?? "fixture-secret";
|
|
2143
|
+
}
|
|
2144
|
+
return values;
|
|
2145
|
+
}
|
|
2146
|
+
async function resolveFixtureRuntime(command, services, requirementOptions, runtimeFetch) {
|
|
2147
|
+
const selector = process.env.TOOLCRAFT_FIXTURE;
|
|
2148
|
+
if (selector === undefined || selector.length === 0) {
|
|
2149
|
+
return {
|
|
2150
|
+
env: createEnv(),
|
|
2151
|
+
fetch: runtimeFetch,
|
|
2152
|
+
fs: createFs(),
|
|
2153
|
+
isFixture: false,
|
|
2154
|
+
requirementOptions,
|
|
2155
|
+
secrets: resolveCommandSecrets(command),
|
|
2156
|
+
services
|
|
2157
|
+
};
|
|
2158
|
+
}
|
|
2159
|
+
const scenario = await loadFixtureScenario(command, selector);
|
|
2160
|
+
const scenarioServices = isPlainObject(scenario.services) ? scenario.services : {};
|
|
2161
|
+
const customServiceNames = new Set([
|
|
2162
|
+
...Object.keys(services),
|
|
2163
|
+
...Object.keys(scenarioServices).filter((name) => !RESERVED_SERVICE_NAMES.has(name))
|
|
2164
|
+
]);
|
|
2165
|
+
const fixtureServices = Object.fromEntries([...customServiceNames].map((name) => [name, createFixtureService(scenarioServices[name])]));
|
|
2166
|
+
const fixtureEnvValues = createFixtureEnvValues(command);
|
|
2167
|
+
return {
|
|
2168
|
+
env: createEnv(fixtureEnvValues),
|
|
2169
|
+
fetch: createFixtureFetch(scenarioServices.fetch),
|
|
2170
|
+
fs: createFixtureFs(scenarioServices.fs),
|
|
2171
|
+
isFixture: true,
|
|
2172
|
+
requirementOptions: {
|
|
2173
|
+
...requirementOptions,
|
|
2174
|
+
env: fixtureEnvValues
|
|
2175
|
+
},
|
|
2176
|
+
secrets: resolveFixtureSecrets(command),
|
|
2177
|
+
services: fixtureServices
|
|
2178
|
+
};
|
|
2179
|
+
}
|
|
2180
|
+
function writeRichHeader(title) {
|
|
2181
|
+
const padding = Math.max(12, 34 - title.length);
|
|
2182
|
+
process.stdout.write(`── ${title} ${"─".repeat(padding)}\n`);
|
|
2183
|
+
}
|
|
2184
|
+
function isHumanInLoopPending(result) {
|
|
2185
|
+
return (typeof result === "object" &&
|
|
2186
|
+
result !== null &&
|
|
2187
|
+
result.status === "pending-approval" &&
|
|
2188
|
+
typeof result.approvalId === "string" &&
|
|
2189
|
+
typeof result.message === "string" &&
|
|
2190
|
+
typeof result.enqueuedAt === "string");
|
|
2191
|
+
}
|
|
2192
|
+
function renderHumanInLoopPending(pending) {
|
|
2193
|
+
process.stdout.write(`✓ Queued for human approval (id: ${pending.approvalId})\n` +
|
|
2194
|
+
` Message: ${pending.message}\n` +
|
|
2195
|
+
` Track: toolcraft approvals show ${pending.approvalId}\n`);
|
|
2196
|
+
}
|
|
2197
|
+
function renderApprovalDeclined(error) {
|
|
2198
|
+
const logger = createLogger();
|
|
2199
|
+
logger.error(error.message);
|
|
2200
|
+
process.exitCode = 1;
|
|
2201
|
+
}
|
|
2202
|
+
function renderCliErrorPattern(pattern) {
|
|
2203
|
+
const logger = createLogger();
|
|
2204
|
+
if (pattern.kind === "usage") {
|
|
2205
|
+
logger.error(appendUsagePointer(pattern.message, {
|
|
2206
|
+
rootUsageName: pattern.rootUsageName,
|
|
2207
|
+
commandPath: pattern.commandPath
|
|
2208
|
+
}));
|
|
2209
|
+
process.exitCode = 1;
|
|
2210
|
+
return;
|
|
2211
|
+
}
|
|
2212
|
+
if (pattern.kind === "runtime-user") {
|
|
2213
|
+
logger.error(pattern.message);
|
|
2214
|
+
process.exitCode = 1;
|
|
2215
|
+
return;
|
|
2216
|
+
}
|
|
2217
|
+
if (pattern.kind === "definition") {
|
|
2218
|
+
logger.error(`Command definition error: ${pattern.error.message}\n` +
|
|
2219
|
+
"This is a bug in the generated command definition, not in your command arguments.\n" +
|
|
2220
|
+
"Run with --debug for a stack trace.");
|
|
2221
|
+
if (pattern.debugStackMode !== undefined && pattern.error.stack) {
|
|
2222
|
+
process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}\n`);
|
|
2223
|
+
}
|
|
2224
|
+
process.exitCode = 1;
|
|
2225
|
+
return;
|
|
2226
|
+
}
|
|
2227
|
+
if (pattern.kind === "toolcraft-bug") {
|
|
2228
|
+
logger.error(`toolcraft hit an internal invariant: ${pattern.error.message}\n` +
|
|
2229
|
+
`This is a bug in toolcraft or in the command definition; ` +
|
|
2230
|
+
`it cannot be worked around by changing argv. ` +
|
|
2231
|
+
`Re-run with --debug for a stack trace and file an issue.`);
|
|
2232
|
+
if (pattern.debugStackMode !== undefined && pattern.error.stack) {
|
|
2233
|
+
process.stderr.write(`${formatDebugStack(pattern.error.stack, pattern.debugStackMode)}\n`);
|
|
2234
|
+
}
|
|
2235
|
+
process.exitCode = 1;
|
|
2236
|
+
return;
|
|
2237
|
+
}
|
|
2238
|
+
logger.error(pattern.debugStackMode !== undefined
|
|
2239
|
+
? pattern.message
|
|
2240
|
+
: `${pattern.message} Use --debug for a stack trace.`);
|
|
2241
|
+
if (pattern.debugStackMode !== undefined && pattern.stack !== undefined) {
|
|
2242
|
+
process.stderr.write(`${formatDebugStack(pattern.stack, pattern.debugStackMode)}\n`);
|
|
2243
|
+
}
|
|
2244
|
+
process.exitCode = 1;
|
|
2245
|
+
}
|
|
2246
|
+
function validateServices(services) {
|
|
2247
|
+
for (const name of Object.keys(services)) {
|
|
2248
|
+
if (RESERVED_SERVICE_NAMES.has(name)) {
|
|
2249
|
+
throw new Error(`Service name "${name}" is reserved. Choose a different name. ${RESERVED_SERVICE_NAMES_MESSAGE}`);
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
function getNestedValue(target, path) {
|
|
2254
|
+
return path.reduce((current, segment) => current !== null && typeof current === "object"
|
|
2255
|
+
? current[segment]
|
|
2256
|
+
: undefined, target);
|
|
2257
|
+
}
|
|
2258
|
+
function parseFieldInputValue(value, schema, label) {
|
|
2259
|
+
if (schema.kind === "array") {
|
|
2260
|
+
return parseArrayValue(value, schema, label);
|
|
2261
|
+
}
|
|
2262
|
+
if (schema.kind === "json") {
|
|
2263
|
+
if (value === "null" && schema.nullable === true) {
|
|
2264
|
+
return null;
|
|
2265
|
+
}
|
|
2266
|
+
return parseJsonText(value, label);
|
|
2267
|
+
}
|
|
2268
|
+
return parseScalarValue(value, schema, label);
|
|
2269
|
+
}
|
|
2270
|
+
function parseOptionFieldValue(field, value, errors) {
|
|
2271
|
+
try {
|
|
2272
|
+
if (value === null) {
|
|
2273
|
+
return { ok: true, value };
|
|
2274
|
+
}
|
|
2275
|
+
if (field.schema.kind === "array" && Array.isArray(value)) {
|
|
2276
|
+
const parsedValues = [];
|
|
2277
|
+
for (const item of value) {
|
|
2278
|
+
const parsed = parseArrayValue(String(item), field.schema, field.displayPath);
|
|
2279
|
+
if (parsed === null) {
|
|
2280
|
+
return { ok: true, value: null };
|
|
2281
|
+
}
|
|
2282
|
+
parsedValues.push(...parsed);
|
|
2283
|
+
}
|
|
2284
|
+
validateArrayBounds(parsedValues, field.schema, field.displayPath);
|
|
2285
|
+
return { ok: true, value: parsedValues };
|
|
2286
|
+
}
|
|
2287
|
+
if (typeof value !== "string") {
|
|
2288
|
+
return { ok: true, value };
|
|
2289
|
+
}
|
|
2290
|
+
const parsedValue = parseFieldInputValue(value, field.schema, field.displayPath);
|
|
2291
|
+
if (field.schema.kind === "array" && Array.isArray(parsedValue)) {
|
|
2292
|
+
validateArrayBounds(parsedValue, field.schema, field.displayPath);
|
|
2293
|
+
}
|
|
2294
|
+
return { ok: true, value: parsedValue };
|
|
2295
|
+
}
|
|
2296
|
+
catch (error) {
|
|
2297
|
+
if (error instanceof UserError || error instanceof InvalidArgumentError) {
|
|
2298
|
+
errors.push({
|
|
2299
|
+
path: field.displayPath,
|
|
2300
|
+
message: error.message
|
|
2301
|
+
});
|
|
2302
|
+
return { ok: false };
|
|
2303
|
+
}
|
|
2304
|
+
throw error;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
function consumeFieldValue(args, index, schema, label, inlineValue) {
|
|
2308
|
+
if (schema.kind === "boolean") {
|
|
2309
|
+
if (inlineValue !== undefined) {
|
|
2310
|
+
return {
|
|
2311
|
+
nextIndex: index,
|
|
2312
|
+
value: parseScalarValue(inlineValue, schema, label)
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
const next = args[index + 1];
|
|
2316
|
+
if (next === "true" || next === "false" || (schema.nullable === true && next === "null")) {
|
|
2317
|
+
return {
|
|
2318
|
+
nextIndex: index + 1,
|
|
2319
|
+
value: parseScalarValue(next, schema, label)
|
|
2320
|
+
};
|
|
2321
|
+
}
|
|
2322
|
+
return {
|
|
2323
|
+
nextIndex: index,
|
|
2324
|
+
value: true
|
|
2325
|
+
};
|
|
2326
|
+
}
|
|
2327
|
+
if (inlineValue !== undefined) {
|
|
2328
|
+
return {
|
|
2329
|
+
nextIndex: index,
|
|
2330
|
+
value: parseFieldInputValue(inlineValue, schema, label)
|
|
2331
|
+
};
|
|
2332
|
+
}
|
|
2333
|
+
if (schema.kind === "array") {
|
|
2334
|
+
const values = [];
|
|
2335
|
+
let nextIndex = index;
|
|
2336
|
+
let cursor = index + 1;
|
|
2337
|
+
while (cursor < args.length) {
|
|
2338
|
+
const token = args[cursor] ?? "";
|
|
2339
|
+
if (isNextArrayOptionToken(token, schema)) {
|
|
2340
|
+
break;
|
|
2341
|
+
}
|
|
2342
|
+
const parsed = parseArrayValue(token, schema, label);
|
|
2343
|
+
if (parsed === null) {
|
|
2344
|
+
return {
|
|
2345
|
+
nextIndex: cursor,
|
|
2346
|
+
value: null
|
|
2347
|
+
};
|
|
2348
|
+
}
|
|
2349
|
+
values.push(...parsed);
|
|
2350
|
+
nextIndex = cursor;
|
|
2351
|
+
cursor += 1;
|
|
2352
|
+
}
|
|
2353
|
+
if (values.length === 0) {
|
|
2354
|
+
throw new InvalidArgumentError(`option '${label}' argument missing`);
|
|
2355
|
+
}
|
|
2356
|
+
validateArrayBounds(values, schema, label);
|
|
2357
|
+
return {
|
|
2358
|
+
nextIndex,
|
|
2359
|
+
value: values
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2362
|
+
const next = args[index + 1];
|
|
2363
|
+
if (next === undefined) {
|
|
2364
|
+
throw new InvalidArgumentError(`option '${label}' argument missing`);
|
|
2365
|
+
}
|
|
2366
|
+
return {
|
|
2367
|
+
nextIndex: index + 1,
|
|
2368
|
+
value: parseFieldInputValue(next, schema, label)
|
|
2369
|
+
};
|
|
2370
|
+
}
|
|
2371
|
+
function resolveDynamicLeaf(schema, rawSegments, casing, outputPath = [], displayPath = [], displayPathPrefix = "") {
|
|
2372
|
+
const unwrappedSchema = unwrapOptional(schema);
|
|
2373
|
+
const kind = formatCliSchemaKind(unwrappedSchema.kind);
|
|
2374
|
+
if (rawSegments.length === 0) {
|
|
2375
|
+
if (unwrappedSchema.kind === "json" ||
|
|
2376
|
+
unwrappedSchema.kind === "array" ||
|
|
2377
|
+
unwrappedSchema.kind === "string" ||
|
|
2378
|
+
unwrappedSchema.kind === "number" ||
|
|
2379
|
+
unwrappedSchema.kind === "boolean" ||
|
|
2380
|
+
unwrappedSchema.kind === "enum") {
|
|
2381
|
+
return {
|
|
2382
|
+
displayPath: toDisplayPath(displayPath),
|
|
2383
|
+
path: outputPath,
|
|
2384
|
+
schema: unwrappedSchema
|
|
2385
|
+
};
|
|
2386
|
+
}
|
|
2387
|
+
throw new UserError(formatUnsupportedDynamicSchemaMessage(kind, qualifyDisplayPath(displayPathPrefix, toDisplayPath(displayPath))));
|
|
2388
|
+
}
|
|
2389
|
+
switch (unwrappedSchema.kind) {
|
|
2390
|
+
case "object": {
|
|
2391
|
+
const [head, ...rest] = rawSegments;
|
|
2392
|
+
for (const [key, childSchema] of Object.entries(unwrappedSchema.shape)) {
|
|
2393
|
+
if (formatSegment(key, casing) !== head) {
|
|
2394
|
+
continue;
|
|
2395
|
+
}
|
|
2396
|
+
return resolveDynamicLeaf(childSchema, rest, casing, [...outputPath, key], [...displayPath, key], displayPathPrefix);
|
|
2397
|
+
}
|
|
2398
|
+
throw new UserError(`Unknown parameter "${qualifyDisplayPath(displayPathPrefix, [...displayPath, head].join("."))}". ${formatAvailableList(Object.keys(unwrappedSchema.shape).map((key) => qualifyDisplayPath(displayPathPrefix, toDisplayPath([...displayPath, formatSegment(key, casing)]))))}`);
|
|
2399
|
+
}
|
|
2400
|
+
case "record": {
|
|
2401
|
+
const [head, ...rest] = rawSegments;
|
|
2402
|
+
return resolveDynamicLeaf(unwrappedSchema.value, rest, casing, [...outputPath, head ?? ""], [...displayPath, head ?? ""], displayPathPrefix);
|
|
2403
|
+
}
|
|
2404
|
+
case "array": {
|
|
2405
|
+
const itemSchema = unwrapOptional(unwrappedSchema.item);
|
|
2406
|
+
if (itemSchema.kind !== "object") {
|
|
2407
|
+
throw new UserError(`Array parameter "${qualifyDisplayPath(displayPathPrefix, toDisplayPath(displayPath))}" must use object items.`);
|
|
2408
|
+
}
|
|
2409
|
+
const [head, ...rest] = rawSegments;
|
|
2410
|
+
if (head === undefined || !isNumericFixtureSelector(head)) {
|
|
2411
|
+
throw new UserError(`Array parameter "${qualifyDisplayPath(displayPathPrefix, toDisplayPath(displayPath))}" must use numeric indices.`);
|
|
2412
|
+
}
|
|
2413
|
+
return resolveDynamicLeaf(itemSchema, rest, casing, [...outputPath, head], [...displayPath, head], displayPathPrefix);
|
|
2414
|
+
}
|
|
2415
|
+
default:
|
|
2416
|
+
throw new UserError(`Unknown parameter "${qualifyDisplayPath(displayPathPrefix, [...displayPath, ...rawSegments].join("."))}". ${formatAvailableList(displayPath.length === 0
|
|
2417
|
+
? []
|
|
2418
|
+
: [qualifyDisplayPath(displayPathPrefix, toDisplayPath(displayPath))])}`);
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
function finalizeDynamicValue(schema, value, displayPath, errors) {
|
|
2422
|
+
const unwrappedSchema = unwrapOptional(schema);
|
|
2423
|
+
if (value === undefined) {
|
|
2424
|
+
return undefined;
|
|
2425
|
+
}
|
|
2426
|
+
if (value === null && unwrappedSchema.nullable === true) {
|
|
2427
|
+
return null;
|
|
2428
|
+
}
|
|
2429
|
+
switch (unwrappedSchema.kind) {
|
|
2430
|
+
case "string":
|
|
2431
|
+
case "number":
|
|
2432
|
+
case "boolean":
|
|
2433
|
+
case "enum":
|
|
2434
|
+
case "json":
|
|
2435
|
+
return value;
|
|
2436
|
+
case "array": {
|
|
2437
|
+
const itemSchema = unwrapOptional(unwrappedSchema.item);
|
|
2438
|
+
if (itemSchema.kind !== "object") {
|
|
2439
|
+
return value;
|
|
2440
|
+
}
|
|
2441
|
+
if (!isPlainObject(value)) {
|
|
2442
|
+
errors.push({
|
|
2443
|
+
path: displayPath,
|
|
2444
|
+
message: `Invalid value for "${displayPath}". Expected indexed object entries, got ${describeReceived(value)}.`
|
|
2445
|
+
});
|
|
2446
|
+
return value;
|
|
2447
|
+
}
|
|
2448
|
+
const entries = Object.entries(value);
|
|
2449
|
+
const indices = entries.map(([key]) => Number(key)).sort((left, right) => left - right);
|
|
2450
|
+
if (indices.some((index) => !Number.isInteger(index) || index < 0)) {
|
|
2451
|
+
errors.push({
|
|
2452
|
+
path: displayPath,
|
|
2453
|
+
message: `Array parameter "${displayPath}" must use numeric indices.`
|
|
2454
|
+
});
|
|
2455
|
+
return value;
|
|
2456
|
+
}
|
|
2457
|
+
for (let index = 0; index < indices.length; index += 1) {
|
|
2458
|
+
if (indices[index] !== index) {
|
|
2459
|
+
errors.push({
|
|
2460
|
+
path: displayPath,
|
|
2461
|
+
message: `Array parameter "${displayPath}" must use contiguous indices starting at 0.`
|
|
2462
|
+
});
|
|
2463
|
+
return value;
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
return indices.map((index) => finalizeDynamicValue(unwrappedSchema.item, value[String(index)], `${displayPath}.${index}`, errors));
|
|
2467
|
+
}
|
|
2468
|
+
case "object": {
|
|
2469
|
+
if (!isPlainObject(value)) {
|
|
2470
|
+
errors.push({
|
|
2471
|
+
path: displayPath,
|
|
2472
|
+
message: `Invalid value for "${displayPath}". Expected an object, got ${describeReceived(value)}.`
|
|
2473
|
+
});
|
|
2474
|
+
return value;
|
|
2475
|
+
}
|
|
2476
|
+
const result = {};
|
|
2477
|
+
for (const [key, rawChildSchema] of Object.entries(unwrappedSchema.shape)) {
|
|
2478
|
+
const childSchema = unwrapOptional(rawChildSchema);
|
|
2479
|
+
const childValue = value[key];
|
|
2480
|
+
const childDisplayPath = displayPath.length === 0 ? key : `${displayPath}.${key}`;
|
|
2481
|
+
if (childValue === undefined) {
|
|
2482
|
+
if (childSchema.default !== undefined) {
|
|
2483
|
+
result[key] = childSchema.default;
|
|
2484
|
+
continue;
|
|
2485
|
+
}
|
|
2486
|
+
if (rawChildSchema.kind === "optional") {
|
|
2487
|
+
continue;
|
|
2488
|
+
}
|
|
2489
|
+
errors.push({
|
|
2490
|
+
path: childDisplayPath,
|
|
2491
|
+
message: `Missing required parameter "${childDisplayPath}".`
|
|
2492
|
+
});
|
|
2493
|
+
continue;
|
|
2494
|
+
}
|
|
2495
|
+
result[key] = finalizeDynamicValue(rawChildSchema, childValue, childDisplayPath, errors);
|
|
2496
|
+
}
|
|
2497
|
+
return result;
|
|
2498
|
+
}
|
|
2499
|
+
case "record": {
|
|
2500
|
+
if (!isPlainObject(value)) {
|
|
2501
|
+
errors.push({
|
|
2502
|
+
path: displayPath,
|
|
2503
|
+
message: `Invalid value for "${displayPath}". Expected an object, got ${describeReceived(value)}.`
|
|
2504
|
+
});
|
|
2505
|
+
return value;
|
|
2506
|
+
}
|
|
2507
|
+
return Object.fromEntries(Object.entries(value).map(([key, entryValue]) => [
|
|
2508
|
+
key,
|
|
2509
|
+
finalizeDynamicValue(unwrappedSchema.value, entryValue, displayPath.length === 0 ? key : `${displayPath}.${key}`, errors)
|
|
2510
|
+
]));
|
|
2511
|
+
}
|
|
2512
|
+
default:
|
|
2513
|
+
errors.push({
|
|
2514
|
+
path: displayPath,
|
|
2515
|
+
message: formatUnsupportedDynamicSchemaMessage(formatCliSchemaKind(unwrappedSchema.kind), displayPath)
|
|
2516
|
+
});
|
|
2517
|
+
return value;
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
function formatCliSchemaKind(kind) {
|
|
2521
|
+
return kind === "oneOf" ? "oneof" : kind;
|
|
2522
|
+
}
|
|
2523
|
+
function formatUnsupportedDynamicSchemaMessage(kind, displayPath) {
|
|
2524
|
+
return `Unsupported parameter type "${kind}" for "${displayPath}". Supported types: string, number, integer, boolean, array, object, enum, oneof.`;
|
|
2525
|
+
}
|
|
2526
|
+
function qualifyDisplayPath(prefix, displayPath) {
|
|
2527
|
+
if (prefix.length === 0) {
|
|
2528
|
+
return displayPath;
|
|
2529
|
+
}
|
|
2530
|
+
if (displayPath.length === 0) {
|
|
2531
|
+
return prefix;
|
|
2532
|
+
}
|
|
2533
|
+
return `${prefix}.${displayPath}`;
|
|
2534
|
+
}
|
|
2535
|
+
function parseDynamicValues(dynamicFields, rawArgv, casing, errors) {
|
|
2536
|
+
const rawValues = new Map();
|
|
2537
|
+
const providedFieldIds = new Set();
|
|
2538
|
+
const sortedFields = [...dynamicFields].sort((left, right) => right.optionPath.length - left.optionPath.length);
|
|
2539
|
+
for (let index = 0; index < rawArgv.length; index += 1) {
|
|
2540
|
+
const token = rawArgv[index] ?? "";
|
|
2541
|
+
if (!token.startsWith("--")) {
|
|
2542
|
+
continue;
|
|
2543
|
+
}
|
|
2544
|
+
const negated = token.startsWith("--no-");
|
|
2545
|
+
const normalized = negated ? `--${token.slice("--no-".length)}` : token;
|
|
2546
|
+
const equalsIndex = normalized.indexOf("=");
|
|
2547
|
+
const flagName = equalsIndex >= 0 ? normalized.slice(2, equalsIndex) : normalized.slice(2);
|
|
2548
|
+
const inlineValue = equalsIndex >= 0 ? normalized.slice(equalsIndex + 1) : undefined;
|
|
2549
|
+
const flagPath = flagName.split(".");
|
|
2550
|
+
const match = sortedFields.find((field) => {
|
|
2551
|
+
const optionPath = field.optionPath.map((segment) => formatSegment(segment, casing));
|
|
2552
|
+
return (flagPath.length > optionPath.length &&
|
|
2553
|
+
optionPath.every((segment, segmentIndex) => flagPath[segmentIndex] === segment));
|
|
2554
|
+
});
|
|
2555
|
+
if (match === undefined) {
|
|
2556
|
+
throw new UserError(`Unknown parameter "${flagName}". ${formatAvailableList(dynamicFields.map((field) => field.optionPathDisplay))}`);
|
|
2557
|
+
}
|
|
2558
|
+
const optionPath = match.optionPath.map((segment) => formatSegment(segment, casing));
|
|
2559
|
+
const remainder = flagPath.slice(optionPath.length);
|
|
2560
|
+
const leaf = resolveDynamicLeaf(match.schema, remainder, casing, [], [], match.displayPath);
|
|
2561
|
+
const rawStore = rawValues.get(match.id) ?? {};
|
|
2562
|
+
const label = `${match.displayPath}.${leaf.displayPath}`.replace(/^\./u, "");
|
|
2563
|
+
const parsed = negated && leaf.schema.kind === "boolean"
|
|
2564
|
+
? {
|
|
2565
|
+
nextIndex: index,
|
|
2566
|
+
value: false
|
|
2567
|
+
}
|
|
2568
|
+
: consumeFieldValue(rawArgv, index, leaf.schema, label, inlineValue);
|
|
2569
|
+
setNestedValue(rawStore, leaf.path, parsed.value);
|
|
2570
|
+
rawValues.set(match.id, rawStore);
|
|
2571
|
+
providedFieldIds.add(match.id);
|
|
2572
|
+
index = parsed.nextIndex;
|
|
2573
|
+
}
|
|
2574
|
+
return {
|
|
2575
|
+
providedFieldIds,
|
|
2576
|
+
values: new Map(dynamicFields
|
|
2577
|
+
.filter((field) => rawValues.has(field.id))
|
|
2578
|
+
.map((field) => [
|
|
2579
|
+
field.id,
|
|
2580
|
+
finalizeDynamicValue(field.schema.kind === "record" ? field.schema : field.schema, rawValues.get(field.id), field.displayPath, errors)
|
|
2581
|
+
]))
|
|
2582
|
+
};
|
|
2583
|
+
}
|
|
2584
|
+
async function enforceVariantConstraints(params, fields, dynamicFields, variants, resolvedFieldValues, providedDynamicFieldIds, providedFieldIds, shouldPrompt, errors) {
|
|
2585
|
+
const fieldById = new Map(fields.map((field) => [field.id, field]));
|
|
2586
|
+
const dynamicFieldById = new Map(dynamicFields.map((field) => [field.id, field]));
|
|
2587
|
+
const getAvailableBranchParameters = (branch) => [
|
|
2588
|
+
...branch.fieldIds
|
|
2589
|
+
.map((fieldId) => fieldById.get(fieldId))
|
|
2590
|
+
.filter((field) => field !== undefined && field.synthetic !== true)
|
|
2591
|
+
.map((field) => field.displayPath),
|
|
2592
|
+
...branch.dynamicFieldIds
|
|
2593
|
+
.map((fieldId) => dynamicFieldById.get(fieldId))
|
|
2594
|
+
.filter((field) => field !== undefined)
|
|
2595
|
+
.map((field) => field.optionPathDisplay)
|
|
2596
|
+
];
|
|
2597
|
+
for (const variant of variants) {
|
|
2598
|
+
let selectedBranchId = resolvedFieldValues.get(variant.controlFieldId);
|
|
2599
|
+
if (selectedBranchId === undefined && shouldPrompt) {
|
|
2600
|
+
const controlField = fieldById.get(variant.controlFieldId);
|
|
2601
|
+
if (controlField !== undefined) {
|
|
2602
|
+
selectedBranchId = await promptForField(controlField);
|
|
2603
|
+
resolvedFieldValues.set(controlField.id, selectedBranchId);
|
|
2604
|
+
if (!controlField.synthetic) {
|
|
2605
|
+
setNestedValue(params, controlField.path, selectedBranchId);
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
if (selectedBranchId === undefined) {
|
|
2610
|
+
if (variant.optional) {
|
|
2611
|
+
continue;
|
|
2612
|
+
}
|
|
2613
|
+
errors.push({
|
|
2614
|
+
path: variant.controlDisplayPath,
|
|
2615
|
+
message: `Missing required parameter "${variant.controlDisplayPath}".`
|
|
2616
|
+
});
|
|
2617
|
+
continue;
|
|
2618
|
+
}
|
|
2619
|
+
const selectedBranch = variant.branches.find((branch) => branch.branchId === selectedBranchId);
|
|
2620
|
+
if (selectedBranch === undefined) {
|
|
2621
|
+
errors.push({
|
|
2622
|
+
path: variant.controlDisplayPath,
|
|
2623
|
+
message: `Invalid value for "${variant.controlDisplayPath}". Expected one of: ${variant.branches.map((branch) => branch.branchId).join(", ")}, got ${describeReceived(selectedBranchId)}.`
|
|
2624
|
+
});
|
|
2625
|
+
continue;
|
|
2626
|
+
}
|
|
2627
|
+
let hasInvalidBranchParameter = false;
|
|
2628
|
+
for (const branch of variant.branches) {
|
|
2629
|
+
if (branch.branchId === selectedBranch.branchId) {
|
|
2630
|
+
continue;
|
|
2631
|
+
}
|
|
2632
|
+
const invalidFieldId = branch.fieldIds.find((fieldId) => providedFieldIds.has(fieldId));
|
|
2633
|
+
if (invalidFieldId !== undefined) {
|
|
2634
|
+
const field = fieldById.get(invalidFieldId);
|
|
2635
|
+
if (field !== undefined) {
|
|
2636
|
+
errors.push({
|
|
2637
|
+
path: field.displayPath,
|
|
2638
|
+
message: `Unknown parameter "${field.displayPath}" for ${variant.controlDisplayPath}="${selectedBranch.branchId}". ${formatAvailableList(getAvailableBranchParameters(selectedBranch))}`
|
|
2639
|
+
});
|
|
2640
|
+
hasInvalidBranchParameter = true;
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
const invalidDynamicFieldId = branch.dynamicFieldIds.find((fieldId) => providedDynamicFieldIds.has(fieldId));
|
|
2644
|
+
if (invalidDynamicFieldId !== undefined) {
|
|
2645
|
+
const field = dynamicFieldById.get(invalidDynamicFieldId);
|
|
2646
|
+
if (field !== undefined) {
|
|
2647
|
+
errors.push({
|
|
2648
|
+
path: field.displayPath,
|
|
2649
|
+
message: `Unknown parameter "${field.displayPath}" for ${variant.controlDisplayPath}="${selectedBranch.branchId}". ${formatAvailableList(getAvailableBranchParameters(selectedBranch))}`
|
|
2650
|
+
});
|
|
2651
|
+
hasInvalidBranchParameter = true;
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
if (hasInvalidBranchParameter) {
|
|
2656
|
+
continue;
|
|
2657
|
+
}
|
|
2658
|
+
for (const fieldId of selectedBranch.requiredFieldIds) {
|
|
2659
|
+
const field = fieldById.get(fieldId);
|
|
2660
|
+
if (field === undefined || field.synthetic) {
|
|
2661
|
+
continue;
|
|
2662
|
+
}
|
|
2663
|
+
if (getNestedValue(params, field.path) !== undefined) {
|
|
2664
|
+
continue;
|
|
2665
|
+
}
|
|
2666
|
+
if (shouldPrompt) {
|
|
2667
|
+
const promptedValue = await promptForField(field);
|
|
2668
|
+
resolvedFieldValues.set(field.id, promptedValue);
|
|
2669
|
+
setNestedValue(params, field.path, promptedValue);
|
|
2670
|
+
providedFieldIds.add(field.id);
|
|
2671
|
+
continue;
|
|
2672
|
+
}
|
|
2673
|
+
errors.push({
|
|
2674
|
+
path: field.displayPath,
|
|
2675
|
+
message: `Missing required parameter "${field.displayPath}" for ${variant.controlDisplayPath}="${selectedBranch.branchId}". ${formatAvailableList(getAvailableBranchParameters(selectedBranch))}`
|
|
2676
|
+
});
|
|
2677
|
+
}
|
|
2678
|
+
for (const fieldId of selectedBranch.requiredDynamicFieldIds) {
|
|
2679
|
+
const field = dynamicFieldById.get(fieldId);
|
|
2680
|
+
if (field === undefined) {
|
|
2681
|
+
continue;
|
|
2682
|
+
}
|
|
2683
|
+
if (getNestedValue(params, field.path) !== undefined) {
|
|
2684
|
+
continue;
|
|
2685
|
+
}
|
|
2686
|
+
errors.push({
|
|
2687
|
+
path: field.displayPath,
|
|
2688
|
+
message: `Missing required parameter "${field.displayPath}" for ${variant.controlDisplayPath}="${selectedBranch.branchId}". ${formatAvailableList(getAvailableBranchParameters(selectedBranch))}`
|
|
2689
|
+
});
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
async function resolveParams(fields, dynamicFields, variants, positionalValues, optionValues, rawArgv, casing, presetPath, shouldPrompt) {
|
|
2694
|
+
const params = {};
|
|
2695
|
+
const presetValues = typeof presetPath === "string" && presetPath.length > 0
|
|
2696
|
+
? await loadPresetValues(fields, presetPath)
|
|
2697
|
+
: {};
|
|
2698
|
+
const providedFieldIds = new Set();
|
|
2699
|
+
const resolvedFieldValues = new Map();
|
|
2700
|
+
const errors = [];
|
|
2701
|
+
for (const field of fields) {
|
|
2702
|
+
let value;
|
|
2703
|
+
let source;
|
|
2704
|
+
if (field.positionalIndex !== undefined) {
|
|
2705
|
+
const positionalValue = positionalValues[field.positionalIndex];
|
|
2706
|
+
if (field.schema.kind === "array") {
|
|
2707
|
+
if (Array.isArray(positionalValue) && positionalValue.length > 0) {
|
|
2708
|
+
const itemSchema = unwrapOptional(field.schema.item);
|
|
2709
|
+
if (itemSchema.kind === "array" || itemSchema.kind === "object") {
|
|
2710
|
+
throw new UserError(`Array parameter "${field.displayPath}" must use scalar items.`);
|
|
2711
|
+
}
|
|
2712
|
+
value = positionalValue.map((item) => parseScalarValue(String(item), itemSchema, field.displayPath));
|
|
2713
|
+
source = "positional";
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
else if (typeof positionalValue === "string" && positionalValue.length > 0) {
|
|
2717
|
+
value = parseFieldInputValue(positionalValue, field.schema, field.displayPath);
|
|
2718
|
+
source = "positional";
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
if (value === undefined &&
|
|
2722
|
+
Object.prototype.hasOwnProperty.call(optionValues, field.commanderOptionAttribute) &&
|
|
2723
|
+
hasFieldValue(optionValues[field.commanderOptionAttribute])) {
|
|
2724
|
+
value = normalizeCommanderOptionValue(optionValues[field.commanderOptionAttribute]);
|
|
2725
|
+
source = "option";
|
|
2726
|
+
}
|
|
2727
|
+
if (value === undefined &&
|
|
2728
|
+
field.commanderOptionAttribute === field.optionAttribute &&
|
|
2729
|
+
Object.prototype.hasOwnProperty.call(optionValues, field.optionAttribute) &&
|
|
2730
|
+
hasFieldValue(optionValues[field.optionAttribute])) {
|
|
2731
|
+
value = normalizeCommanderOptionValue(optionValues[field.optionAttribute]);
|
|
2732
|
+
source = "option";
|
|
2733
|
+
}
|
|
2734
|
+
if (value === undefined &&
|
|
2735
|
+
field.optionFlag === "--verbose" &&
|
|
2736
|
+
Object.prototype.hasOwnProperty.call(optionValues, field.optionAttribute) &&
|
|
2737
|
+
hasFieldValue(optionValues[field.optionAttribute])) {
|
|
2738
|
+
value = normalizeCommanderOptionValue(optionValues[field.optionAttribute]);
|
|
2739
|
+
source = "option";
|
|
2740
|
+
}
|
|
2741
|
+
if (value === undefined &&
|
|
2742
|
+
Object.prototype.hasOwnProperty.call(presetValues, field.optionAttribute)) {
|
|
2743
|
+
value = presetValues[field.optionAttribute];
|
|
2744
|
+
source = "preset";
|
|
2745
|
+
}
|
|
2746
|
+
if (source === "option") {
|
|
2747
|
+
const parsed = parseOptionFieldValue(field, value, errors);
|
|
2748
|
+
if (!parsed.ok) {
|
|
2749
|
+
continue;
|
|
2750
|
+
}
|
|
2751
|
+
value = parsed.value;
|
|
2752
|
+
}
|
|
2753
|
+
if (value === undefined && shouldPrompt && !field.optional) {
|
|
2754
|
+
value = await promptForField(field);
|
|
2755
|
+
source = "prompt";
|
|
2756
|
+
}
|
|
2757
|
+
if (value === undefined && field.hasDefault) {
|
|
2758
|
+
value = field.defaultValue;
|
|
2759
|
+
source = "default";
|
|
2760
|
+
}
|
|
2761
|
+
if (value === undefined) {
|
|
2762
|
+
if (field.optional) {
|
|
2763
|
+
continue;
|
|
2764
|
+
}
|
|
2765
|
+
errors.push({
|
|
2766
|
+
path: field.displayPath,
|
|
2767
|
+
message: `Missing required parameter "${field.displayPath}".`
|
|
2768
|
+
});
|
|
2769
|
+
continue;
|
|
2770
|
+
}
|
|
2771
|
+
resolvedFieldValues.set(field.id, value);
|
|
2772
|
+
if (source !== undefined && source !== "default") {
|
|
2773
|
+
providedFieldIds.add(field.id);
|
|
2774
|
+
}
|
|
2775
|
+
if (!field.synthetic) {
|
|
2776
|
+
setNestedValue(params, field.path, value);
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
const dynamicResults = dynamicFields.length > 0
|
|
2780
|
+
? parseDynamicValues(dynamicFields, rawArgv, casing, errors)
|
|
2781
|
+
: {
|
|
2782
|
+
providedFieldIds: new Set(),
|
|
2783
|
+
values: new Map()
|
|
2784
|
+
};
|
|
2785
|
+
for (const field of dynamicFields) {
|
|
2786
|
+
let value = dynamicResults.values.get(field.id);
|
|
2787
|
+
if (value === undefined && field.hasDefault) {
|
|
2788
|
+
value = field.defaultValue;
|
|
2789
|
+
}
|
|
2790
|
+
if (value === undefined) {
|
|
2791
|
+
if (field.optional || field.variantId !== undefined) {
|
|
2792
|
+
continue;
|
|
2793
|
+
}
|
|
2794
|
+
errors.push({
|
|
2795
|
+
path: field.displayPath,
|
|
2796
|
+
message: `Missing required parameter "${field.displayPath}".`
|
|
2797
|
+
});
|
|
2798
|
+
continue;
|
|
2799
|
+
}
|
|
2800
|
+
setNestedValue(params, field.path, value);
|
|
2801
|
+
}
|
|
2802
|
+
await enforceVariantConstraints(params, fields, dynamicFields, variants, resolvedFieldValues, dynamicResults.providedFieldIds, providedFieldIds, shouldPrompt, errors);
|
|
2803
|
+
throwValidationErrors(errors);
|
|
2804
|
+
return params;
|
|
2805
|
+
}
|
|
2806
|
+
function getResolvedFlags(command) {
|
|
2807
|
+
const flags = command.optsWithGlobals();
|
|
2808
|
+
return flags;
|
|
2809
|
+
}
|
|
2810
|
+
async function executeCommand(state, services, requirementOptions, runtimeFetch, runtimeOptions, diagnosticsOptions, onErrorReportContext) {
|
|
2811
|
+
const logger = createLogger();
|
|
2812
|
+
const primitives = {
|
|
2813
|
+
logger,
|
|
2814
|
+
renderTable,
|
|
2815
|
+
getTheme,
|
|
2816
|
+
note
|
|
2817
|
+
};
|
|
2818
|
+
const optionValues = state.actionCommand.optsWithGlobals();
|
|
2819
|
+
const resolvedFlags = optionValues;
|
|
2820
|
+
const output = resolveOutput(resolvedFlags);
|
|
2821
|
+
const diagnostics = createRuntimeLogger({
|
|
2822
|
+
level: resolvedFlags.logLevel ??
|
|
2823
|
+
(diagnosticsOptions.verboseControlEnabled && resolvedFlags.verbose
|
|
2824
|
+
? "trace"
|
|
2825
|
+
: diagnosticsOptions.logLevel),
|
|
2826
|
+
logger: diagnosticsOptions.logger ?? writeCLIDiagnosticEvent
|
|
2827
|
+
});
|
|
2828
|
+
const shouldPrompt = !resolvedFlags.yes && Boolean(process.stdin.isTTY);
|
|
2829
|
+
const runtime = await resolveFixtureRuntime(state.command, services, requirementOptions, runtimeFetch);
|
|
2830
|
+
const preflightContext = {
|
|
2831
|
+
...runtime.services,
|
|
2832
|
+
secrets: runtime.secrets,
|
|
2833
|
+
fetch: runtime.fetch,
|
|
2834
|
+
fs: runtime.fs,
|
|
2835
|
+
env: runtime.env,
|
|
2836
|
+
diagnostics,
|
|
2837
|
+
progress(message) {
|
|
2838
|
+
diagnostics.emit({ level: "info", message, category: "progress" });
|
|
2839
|
+
logger.info(message);
|
|
2840
|
+
}
|
|
2841
|
+
};
|
|
2842
|
+
let runtimeSecrets;
|
|
2843
|
+
let resolvedParams;
|
|
2844
|
+
try {
|
|
2845
|
+
await withOutputFormat(output, async () => {
|
|
2846
|
+
await assertCommandRequirements(state.command, preflightContext, runtime.requirementOptions);
|
|
2847
|
+
const params = await resolveParams(state.fields, state.dynamicFields, state.variants, state.positionalValues, optionValues, state.rawArgv, state.casing, state.presetsEnabled ? resolvedFlags.preset : undefined, shouldPrompt);
|
|
2848
|
+
resolvedParams = params;
|
|
2849
|
+
runtimeSecrets = runtime.secrets;
|
|
2850
|
+
const context = {
|
|
2851
|
+
...preflightContext,
|
|
2852
|
+
params
|
|
2853
|
+
};
|
|
2854
|
+
if (state.command.confirm &&
|
|
2855
|
+
!state.command.humanInLoop &&
|
|
2856
|
+
!resolvedFlags.yes &&
|
|
2857
|
+
process.stdin.isTTY) {
|
|
2858
|
+
for (const field of state.fields) {
|
|
2859
|
+
const value = field.path.reduce((current, segment) => current && typeof current === "object"
|
|
2860
|
+
? current[segment]
|
|
2861
|
+
: undefined, params);
|
|
2862
|
+
if (value !== undefined) {
|
|
2863
|
+
logger.resolved(field.displayPath, formatResolvedValue(value));
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
const proceed = await confirm({
|
|
2867
|
+
message: "Proceed?",
|
|
2868
|
+
initialValue: true
|
|
2869
|
+
});
|
|
2870
|
+
if (isCancel(proceed)) {
|
|
2871
|
+
cancel("Operation cancelled.");
|
|
2872
|
+
throw new UserError("Operation cancelled.");
|
|
2873
|
+
}
|
|
2874
|
+
if (proceed !== true) {
|
|
2875
|
+
throw new UserError("Operation cancelled.");
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
const result = await invokeWithHumanInLoop(state.command, context, runtimeOptions, state.commandPath);
|
|
2879
|
+
if (output === "rich" && runtime.isFixture) {
|
|
2880
|
+
writeRichHeader(`${state.command.name} (fixture)`);
|
|
2881
|
+
}
|
|
2882
|
+
if (isHumanInLoopPending(result)) {
|
|
2883
|
+
renderHumanInLoopPending(result);
|
|
2884
|
+
return;
|
|
2885
|
+
}
|
|
2886
|
+
const renderStatus = renderResult(state.command, result, output, primitives);
|
|
2887
|
+
if (renderStatus.mcpError) {
|
|
2888
|
+
process.exitCode = 1;
|
|
2889
|
+
}
|
|
2890
|
+
});
|
|
2891
|
+
}
|
|
2892
|
+
catch (error) {
|
|
2893
|
+
onErrorReportContext?.({
|
|
2894
|
+
command: state.command,
|
|
2895
|
+
commandPath: state.commandPath,
|
|
2896
|
+
params: resolvedParams,
|
|
2897
|
+
secrets: runtimeSecrets ?? runtime.secrets
|
|
2898
|
+
});
|
|
2899
|
+
throw error;
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
function isStringRecord(value) {
|
|
2903
|
+
return isPlainObject(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
2904
|
+
}
|
|
2905
|
+
function isHttpErrorLike(error) {
|
|
2906
|
+
if (!isPlainObject(error)) {
|
|
2907
|
+
return false;
|
|
2908
|
+
}
|
|
2909
|
+
if (typeof error.name !== "string" || typeof error.message !== "string") {
|
|
2910
|
+
return false;
|
|
2911
|
+
}
|
|
2912
|
+
const request = error.request;
|
|
2913
|
+
const response = error.response;
|
|
2914
|
+
return (isPlainObject(request) &&
|
|
2915
|
+
typeof request.method === "string" &&
|
|
2916
|
+
typeof request.url === "string" &&
|
|
2917
|
+
isStringRecord(request.headers) &&
|
|
2918
|
+
isPlainObject(response) &&
|
|
2919
|
+
typeof response.status === "number" &&
|
|
2920
|
+
typeof response.statusText === "string" &&
|
|
2921
|
+
isStringRecord(response.headers) &&
|
|
2922
|
+
hasOwnProperty(response, "body"));
|
|
2923
|
+
}
|
|
2924
|
+
function hasTypedOptionalField(value, field, type) {
|
|
2925
|
+
return !hasOwnProperty(value, field) || typeof value[field] === type;
|
|
2926
|
+
}
|
|
2927
|
+
function isNonEmptyString(value) {
|
|
2928
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
2929
|
+
}
|
|
2930
|
+
function isProblemDetailsLike(body) {
|
|
2931
|
+
if (!isPlainObject(body)) {
|
|
2932
|
+
return false;
|
|
2933
|
+
}
|
|
2934
|
+
if (!hasTypedOptionalField(body, "type", "string")) {
|
|
2935
|
+
return false;
|
|
2936
|
+
}
|
|
2937
|
+
if (!hasTypedOptionalField(body, "title", "string")) {
|
|
2938
|
+
return false;
|
|
2939
|
+
}
|
|
2940
|
+
if (!hasTypedOptionalField(body, "status", "number")) {
|
|
2941
|
+
return false;
|
|
2942
|
+
}
|
|
2943
|
+
if (!hasTypedOptionalField(body, "detail", "string")) {
|
|
2944
|
+
return false;
|
|
2945
|
+
}
|
|
2946
|
+
if (!hasTypedOptionalField(body, "instance", "string")) {
|
|
2947
|
+
return false;
|
|
2948
|
+
}
|
|
2949
|
+
return hasOwnNonEmptyString(body, "title") || hasOwnNonEmptyString(body, "detail");
|
|
2950
|
+
}
|
|
2951
|
+
function isGraphQLErrorEnvelopeLike(body) {
|
|
2952
|
+
if (!isPlainObject(body) || !Array.isArray(body.errors) || body.errors.length === 0) {
|
|
2953
|
+
return false;
|
|
2954
|
+
}
|
|
2955
|
+
return body.errors.every((error) => {
|
|
2956
|
+
if (!isPlainObject(error) || typeof error.message !== "string") {
|
|
2957
|
+
return false;
|
|
2958
|
+
}
|
|
2959
|
+
if (hasOwnProperty(error, "path")) {
|
|
2960
|
+
const pathValue = error.path;
|
|
2961
|
+
if (!Array.isArray(pathValue) ||
|
|
2962
|
+
!pathValue.every((entry) => typeof entry === "string" || typeof entry === "number")) {
|
|
2963
|
+
return false;
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
if (hasOwnProperty(error, "extensions")) {
|
|
2967
|
+
if (!isPlainObject(error.extensions)) {
|
|
2968
|
+
return false;
|
|
2969
|
+
}
|
|
2970
|
+
if (hasOwnProperty(error.extensions, "code") && typeof error.extensions.code !== "string") {
|
|
2971
|
+
return false;
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
return true;
|
|
2975
|
+
});
|
|
2976
|
+
}
|
|
2977
|
+
function hasOwnProperty(value, name) {
|
|
2978
|
+
return Object.prototype.hasOwnProperty.call(value, name);
|
|
2979
|
+
}
|
|
2980
|
+
function hasOwnNonEmptyString(value, name) {
|
|
2981
|
+
return hasOwnProperty(value, name) && isNonEmptyString(value[name]);
|
|
2982
|
+
}
|
|
2983
|
+
function styleHttpErrorLine(value, style) {
|
|
2984
|
+
return process.stdout.isTTY !== true ? value : style(value);
|
|
2985
|
+
}
|
|
2986
|
+
function formatHttpErrorStatus(value) {
|
|
2987
|
+
return styleHttpErrorLine(value, text.error);
|
|
2988
|
+
}
|
|
2989
|
+
function formatProblemDetailsBody(body) {
|
|
2990
|
+
const lines = [];
|
|
2991
|
+
if (hasOwnNonEmptyString(body, "title")) {
|
|
2992
|
+
lines.push(`Problem: ${body.title}`);
|
|
2993
|
+
}
|
|
2994
|
+
if (hasOwnNonEmptyString(body, "detail")) {
|
|
2995
|
+
lines.push(`Detail: ${body.detail}`);
|
|
2996
|
+
}
|
|
2997
|
+
if (hasOwnProperty(body, "type") && body.type !== undefined) {
|
|
2998
|
+
lines.push(`Type: ${body.type}`);
|
|
2999
|
+
}
|
|
3000
|
+
if (hasOwnProperty(body, "instance") && body.instance !== undefined) {
|
|
3001
|
+
lines.push(`Instance: ${body.instance}`);
|
|
3002
|
+
}
|
|
3003
|
+
if (hasOwnProperty(body, "status") && body.status !== undefined) {
|
|
3004
|
+
lines.push(`Status: ${body.status}`);
|
|
3005
|
+
}
|
|
3006
|
+
return lines.join("\n");
|
|
3007
|
+
}
|
|
3008
|
+
function formatGraphQLErrorEnvelopeBody(body) {
|
|
3009
|
+
return body.errors
|
|
3010
|
+
.map((error) => {
|
|
3011
|
+
const lines = [`GraphQL error: ${error.message}`];
|
|
3012
|
+
if (hasOwnProperty(error, "path") && error.path !== undefined) {
|
|
3013
|
+
lines.push(` at path: ${error.path.join(".")}`);
|
|
3014
|
+
}
|
|
3015
|
+
if (hasOwnProperty(error, "extensions") &&
|
|
3016
|
+
error.extensions !== undefined &&
|
|
3017
|
+
hasOwnProperty(error.extensions, "code") &&
|
|
3018
|
+
error.extensions.code !== undefined) {
|
|
3019
|
+
lines.push(` code: ${error.extensions.code}`);
|
|
3020
|
+
}
|
|
3021
|
+
return lines.join("\n");
|
|
3022
|
+
})
|
|
3023
|
+
.join("\n\n");
|
|
3024
|
+
}
|
|
3025
|
+
function formatHttpErrorBody(body) {
|
|
3026
|
+
const redactedBody = redactHttpBody(body);
|
|
3027
|
+
if (typeof redactedBody === "string") {
|
|
3028
|
+
return redactedBody;
|
|
3029
|
+
}
|
|
3030
|
+
if (isProblemDetailsLike(redactedBody)) {
|
|
3031
|
+
return formatProblemDetailsBody(redactedBody);
|
|
3032
|
+
}
|
|
3033
|
+
if (isGraphQLErrorEnvelopeLike(redactedBody)) {
|
|
3034
|
+
return formatGraphQLErrorEnvelopeBody(redactedBody);
|
|
3035
|
+
}
|
|
3036
|
+
const serialized = JSON.stringify(redactedBody, null, 2);
|
|
3037
|
+
return serialized === undefined ? String(redactedBody) : serialized;
|
|
3038
|
+
}
|
|
3039
|
+
function indentHttpErrorBlock(value) {
|
|
3040
|
+
return value
|
|
3041
|
+
.split("\n")
|
|
3042
|
+
.map((line) => ` ${line}`)
|
|
3043
|
+
.join("\n");
|
|
3044
|
+
}
|
|
3045
|
+
function formatHttpHeaderValue(name, value) {
|
|
3046
|
+
return redactHttpHeaderValue(name, value);
|
|
3047
|
+
}
|
|
3048
|
+
function formatHttpErrorHeaders(headers) {
|
|
3049
|
+
return Object.entries(headers).map(([name, value]) => ` ${name}: ${formatHttpHeaderValue(name, value)}`);
|
|
3050
|
+
}
|
|
3051
|
+
function formatHttpErrorSnippet(body) {
|
|
3052
|
+
return formatHttpErrorBody(body).replace(/\s+/g, " ").trim().slice(0, 200);
|
|
3053
|
+
}
|
|
3054
|
+
function renderHttpError(error, options) {
|
|
3055
|
+
const detailed = options.verbose || options.debugStackMode !== undefined;
|
|
3056
|
+
const summary = summarizeHttpError(error);
|
|
3057
|
+
const lines = [
|
|
3058
|
+
styleHttpErrorLine(`Request: ${error.request.method} ${error.request.url}`, text.muted)
|
|
3059
|
+
];
|
|
3060
|
+
if (detailed) {
|
|
3061
|
+
lines.push("", "Request headers:", ...formatHttpErrorHeaders(error.request.headers), "");
|
|
3062
|
+
if (error.request.body !== undefined) {
|
|
3063
|
+
lines.push("Request body:", indentHttpErrorBlock(formatHttpErrorBody(error.request.body)), "");
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
lines.push(formatHttpErrorStatus(`Status: ${error.response.status} ${error.response.statusText}`));
|
|
3067
|
+
if (detailed) {
|
|
3068
|
+
lines.push("", "Response headers:", ...formatHttpErrorHeaders(error.response.headers), "", "Response body:", indentHttpErrorBlock(formatHttpErrorBody(error.response.body)));
|
|
3069
|
+
}
|
|
3070
|
+
else {
|
|
3071
|
+
const summaryLines = [
|
|
3072
|
+
summary.code === undefined ? undefined : `Code: ${summary.code}`,
|
|
3073
|
+
summary.message === undefined ? undefined : `Message: ${summary.message}`,
|
|
3074
|
+
summary.requestId === undefined ? undefined : `Request id: ${summary.requestId}`,
|
|
3075
|
+
summary.retryAfter === undefined ? undefined : `Retry after: ${summary.retryAfter}`,
|
|
3076
|
+
summary.hint === undefined ? undefined : `Hint: ${summary.hint}`
|
|
3077
|
+
].filter((line) => line !== undefined);
|
|
3078
|
+
if (summary.fieldErrors !== undefined && summary.fieldErrors.length > 0) {
|
|
3079
|
+
summaryLines.push("", "Field errors:", ...summary.fieldErrors.map((fieldError) => ` ${fieldError.path}: ${fieldError.message}`));
|
|
3080
|
+
}
|
|
3081
|
+
lines.push("");
|
|
3082
|
+
if (summaryLines.length > 0) {
|
|
3083
|
+
lines.push(...summaryLines);
|
|
3084
|
+
}
|
|
3085
|
+
else {
|
|
3086
|
+
lines.push(`Response body: ${formatHttpErrorSnippet(error.response.body)}`);
|
|
3087
|
+
}
|
|
3088
|
+
lines.push("Re-run with --verbose to see headers and full body.");
|
|
3089
|
+
}
|
|
3090
|
+
process.stderr.write(`${lines.join("\n")}\n`);
|
|
3091
|
+
const stack = error instanceof Error ? error.stack : undefined;
|
|
3092
|
+
if (options.debugStackMode !== undefined && stack) {
|
|
3093
|
+
process.stderr.write(`${formatDebugStack(stack, options.debugStackMode)}\n`);
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
async function handleRunError(error, options) {
|
|
3097
|
+
const logger = createLogger();
|
|
3098
|
+
await withOutputFormat(options.output, async () => {
|
|
3099
|
+
if (error instanceof UserError) {
|
|
3100
|
+
renderCliErrorPattern(options.userErrorPattern === "definition"
|
|
3101
|
+
? {
|
|
3102
|
+
kind: "definition",
|
|
3103
|
+
error,
|
|
3104
|
+
debugStackMode: options.debugStackMode
|
|
3105
|
+
}
|
|
3106
|
+
: options.userErrorPattern === "usage"
|
|
3107
|
+
? {
|
|
3108
|
+
kind: "usage",
|
|
3109
|
+
message: error.message,
|
|
3110
|
+
rootUsageName: options.rootUsageName,
|
|
3111
|
+
commandPath: options.commandPath
|
|
3112
|
+
}
|
|
3113
|
+
: {
|
|
3114
|
+
kind: "runtime-user",
|
|
3115
|
+
message: error.message
|
|
3116
|
+
});
|
|
3117
|
+
return;
|
|
3118
|
+
}
|
|
3119
|
+
if (error instanceof Error && error.name === "ToolcraftBugError") {
|
|
3120
|
+
renderCliErrorPattern({
|
|
3121
|
+
kind: "toolcraft-bug",
|
|
3122
|
+
error,
|
|
3123
|
+
debugStackMode: options.debugStackMode
|
|
3124
|
+
});
|
|
3125
|
+
return;
|
|
3126
|
+
}
|
|
3127
|
+
if (error instanceof CommanderError) {
|
|
3128
|
+
process.exitCode = error.exitCode;
|
|
3129
|
+
if (error.code === "commander.helpDisplayed" || error.code === "commander.version") {
|
|
3130
|
+
return;
|
|
3131
|
+
}
|
|
3132
|
+
if (error.code === "commander.unknownCommand") {
|
|
3133
|
+
logger.error(appendUsagePointer(formatUnknownCommandError(error, options.program, options.argv ?? process.argv), {
|
|
3134
|
+
rootUsageName: options.rootUsageName,
|
|
3135
|
+
commandPath: options.commandPath
|
|
3136
|
+
}));
|
|
3137
|
+
return;
|
|
3138
|
+
}
|
|
3139
|
+
if (error.code === "commander.unknownOption") {
|
|
3140
|
+
const argv = options.argv ?? process.argv;
|
|
3141
|
+
logger.error(appendUsagePointer(formatUnknownOptionError(error, options.program, argv), {
|
|
3142
|
+
rootUsageName: options.rootUsageName,
|
|
3143
|
+
commandPath: options.commandPath.length > 0
|
|
3144
|
+
? options.commandPath
|
|
3145
|
+
: findCurrentCommanderCommandPath(options.program, argv)
|
|
3146
|
+
}));
|
|
3147
|
+
return;
|
|
3148
|
+
}
|
|
3149
|
+
logger.error(appendUsagePointer(formatCommanderErrorMessage(error), {
|
|
3150
|
+
rootUsageName: options.rootUsageName,
|
|
3151
|
+
commandPath: options.commandPath.length > 0
|
|
3152
|
+
? options.commandPath
|
|
3153
|
+
: findCurrentCommanderCommandPath(options.program, options.argv ?? process.argv)
|
|
3154
|
+
}));
|
|
3155
|
+
return;
|
|
3156
|
+
}
|
|
3157
|
+
if (isHttpErrorLike(error)) {
|
|
3158
|
+
renderHttpError(error, options);
|
|
3159
|
+
process.exitCode = 1;
|
|
3160
|
+
return;
|
|
3161
|
+
}
|
|
3162
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
3163
|
+
renderCliErrorPattern({
|
|
3164
|
+
kind: "unexpected",
|
|
3165
|
+
message,
|
|
3166
|
+
stack: error instanceof Error ? error.stack : undefined,
|
|
3167
|
+
debugStackMode: options.debugStackMode
|
|
3168
|
+
});
|
|
3169
|
+
});
|
|
3170
|
+
}
|
|
3171
|
+
function formatCommanderErrorMessage(error) {
|
|
3172
|
+
return error.message.startsWith("error:") ? error.message : `error: ${error.message}`;
|
|
3173
|
+
}
|
|
3174
|
+
function formatInvalidEnumMessage(label, value, values, opts = {}) {
|
|
3175
|
+
const suggestions = suggest(value, opts.candidates ?? values.map((candidate) => String(candidate)), opts);
|
|
3176
|
+
const suggestionLine = suggestions.length > 0 ? ` Did you mean: ${suggestions.join(", ")}?\n` : " ";
|
|
3177
|
+
return `Invalid value for "${label}".${suggestionLine}Expected one of: ${values.map((candidate) => String(candidate)).join(", ")}, got ${describeReceived(value)}.`;
|
|
3178
|
+
}
|
|
3179
|
+
function formatUnknownCommandError(error, program, argv) {
|
|
3180
|
+
const input = extractQuotedCommanderValue(error.message) ?? "";
|
|
3181
|
+
const currentCommand = program === undefined ? undefined : findCurrentCommanderCommand(program, argv);
|
|
3182
|
+
return formatUnknownCommandMessage(input, currentCommand);
|
|
3183
|
+
}
|
|
3184
|
+
function appendUsagePointer(message, options) {
|
|
3185
|
+
if (message.includes("--help")) {
|
|
3186
|
+
return message;
|
|
3187
|
+
}
|
|
3188
|
+
const helpTarget = options.commandPath.length === 0
|
|
3189
|
+
? options.rootUsageName
|
|
3190
|
+
: `${options.rootUsageName} ${options.commandPath}`;
|
|
3191
|
+
return `${message}\nRun ${helpTarget} --help for usage.`;
|
|
3192
|
+
}
|
|
3193
|
+
function formatCliCommandPath(commandPath) {
|
|
3194
|
+
return commandPath
|
|
3195
|
+
.split(".")
|
|
3196
|
+
.filter((segment) => segment.length > 0)
|
|
3197
|
+
.join(" ");
|
|
3198
|
+
}
|
|
3199
|
+
function formatUnknownCommandMessage(input, currentCommand) {
|
|
3200
|
+
const suggestions = currentCommand === undefined
|
|
3201
|
+
? []
|
|
3202
|
+
: suggest(input, currentCommand.commands.map((command) => command.name()));
|
|
3203
|
+
return formatSuggestionMessage(`Unknown command "${input}".`, suggestions);
|
|
3204
|
+
}
|
|
3205
|
+
function formatUnknownOptionError(error, program, argv) {
|
|
3206
|
+
const input = extractQuotedCommanderValue(error.message) ?? "";
|
|
3207
|
+
const currentCommand = program === undefined ? undefined : findCurrentCommanderCommand(program, argv);
|
|
3208
|
+
const suggestions = currentCommand === undefined
|
|
3209
|
+
? []
|
|
3210
|
+
: suggest(input, currentCommand.options
|
|
3211
|
+
.map((option) => option.long)
|
|
3212
|
+
.filter((flag) => flag !== undefined));
|
|
3213
|
+
return formatSuggestionMessage(`Unknown option "${input}".`, suggestions);
|
|
3214
|
+
}
|
|
3215
|
+
function formatSuggestionMessage(message, suggestions) {
|
|
3216
|
+
if (suggestions.length === 0) {
|
|
3217
|
+
return message;
|
|
3218
|
+
}
|
|
3219
|
+
return `${message}\nDid you mean: ${suggestions.join(", ")}?`;
|
|
3220
|
+
}
|
|
3221
|
+
function extractQuotedCommanderValue(message) {
|
|
3222
|
+
const singleQuoted = extractBetweenQuotes(message, "'");
|
|
3223
|
+
if (singleQuoted !== undefined) {
|
|
3224
|
+
return singleQuoted;
|
|
3225
|
+
}
|
|
3226
|
+
return extractBetweenQuotes(message, '"');
|
|
3227
|
+
}
|
|
3228
|
+
function extractBetweenQuotes(message, quote) {
|
|
3229
|
+
const start = message.indexOf(quote);
|
|
3230
|
+
if (start === -1) {
|
|
3231
|
+
return undefined;
|
|
3232
|
+
}
|
|
3233
|
+
const end = message.indexOf(quote, start + 1);
|
|
3234
|
+
if (end === -1) {
|
|
3235
|
+
return undefined;
|
|
3236
|
+
}
|
|
3237
|
+
return message.slice(start + 1, end);
|
|
3238
|
+
}
|
|
3239
|
+
function resolveDebugStackMode(value) {
|
|
3240
|
+
if (value === true || value === "trim") {
|
|
3241
|
+
return "trim";
|
|
3242
|
+
}
|
|
3243
|
+
if (value === "raw") {
|
|
3244
|
+
return "raw";
|
|
3245
|
+
}
|
|
3246
|
+
return undefined;
|
|
3247
|
+
}
|
|
3248
|
+
function getDebugStackModeFromArgv(argv) {
|
|
3249
|
+
for (let index = 2; index < argv.length; index += 1) {
|
|
3250
|
+
const token = argv[index];
|
|
3251
|
+
if (token === undefined) {
|
|
3252
|
+
continue;
|
|
3253
|
+
}
|
|
3254
|
+
if (token === "--debug") {
|
|
3255
|
+
return "trim";
|
|
3256
|
+
}
|
|
3257
|
+
if (token === "--debug=raw") {
|
|
3258
|
+
return "raw";
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
return undefined;
|
|
3262
|
+
}
|
|
3263
|
+
function findCurrentCommanderCommand(program, argv) {
|
|
3264
|
+
let current = program;
|
|
3265
|
+
const tokens = argv.slice(2);
|
|
3266
|
+
for (let index = 0; index < tokens.length; index += 1) {
|
|
3267
|
+
const token = tokens[index];
|
|
3268
|
+
if (token === undefined || token === "--") {
|
|
3269
|
+
break;
|
|
3270
|
+
}
|
|
3271
|
+
if (token.startsWith("-")) {
|
|
3272
|
+
const option = current.options.find((candidate) => candidate.long === token || candidate.short === token);
|
|
3273
|
+
if (option?.required === true && !token.includes("=")) {
|
|
3274
|
+
index += 1;
|
|
3275
|
+
}
|
|
3276
|
+
continue;
|
|
3277
|
+
}
|
|
3278
|
+
const child = current.commands.find((command) => command.name() === token || command.aliases().includes(token));
|
|
3279
|
+
if (child === undefined) {
|
|
3280
|
+
break;
|
|
3281
|
+
}
|
|
3282
|
+
current = child;
|
|
3283
|
+
}
|
|
3284
|
+
return current;
|
|
3285
|
+
}
|
|
3286
|
+
function findCurrentCommanderCommandPath(program, argv) {
|
|
3287
|
+
if (program === undefined) {
|
|
3288
|
+
return "";
|
|
3289
|
+
}
|
|
3290
|
+
let current = program;
|
|
3291
|
+
const pathSegments = [];
|
|
3292
|
+
const tokens = argv.slice(2);
|
|
3293
|
+
for (let index = 0; index < tokens.length; index += 1) {
|
|
3294
|
+
const token = tokens[index];
|
|
3295
|
+
if (token === undefined || token === "--" || token.startsWith("-")) {
|
|
3296
|
+
break;
|
|
3297
|
+
}
|
|
3298
|
+
const child = current.commands.find((command) => command.name() === token || command.aliases().includes(token));
|
|
3299
|
+
if (child === undefined) {
|
|
3300
|
+
break;
|
|
3301
|
+
}
|
|
3302
|
+
current = child;
|
|
3303
|
+
pathSegments.push(child.name());
|
|
3304
|
+
}
|
|
3305
|
+
return pathSegments.join(" ");
|
|
3306
|
+
}
|
|
3307
|
+
function findUnknownCommanderCommand(program, argv) {
|
|
3308
|
+
let current = program;
|
|
3309
|
+
const pathSegments = [];
|
|
3310
|
+
const tokens = argv.slice(2);
|
|
3311
|
+
for (let index = 0; index < tokens.length; index += 1) {
|
|
3312
|
+
const token = tokens[index];
|
|
3313
|
+
if (token === undefined || token === "--") {
|
|
3314
|
+
return undefined;
|
|
3315
|
+
}
|
|
3316
|
+
if (token.startsWith("-")) {
|
|
3317
|
+
const option = current.options.find((candidate) => candidate.long === token || candidate.short === token);
|
|
3318
|
+
if (option?.required === true && !token.includes("=")) {
|
|
3319
|
+
index += 1;
|
|
3320
|
+
}
|
|
3321
|
+
continue;
|
|
3322
|
+
}
|
|
3323
|
+
if (getToolcraftHiddenDefaultNames(current).includes(token) ||
|
|
3324
|
+
getToolcraftReservedChildNames(current).includes(token)) {
|
|
3325
|
+
return {
|
|
3326
|
+
input: token,
|
|
3327
|
+
currentCommand: current,
|
|
3328
|
+
commandPath: pathSegments.join(" ")
|
|
3329
|
+
};
|
|
3330
|
+
}
|
|
3331
|
+
if (current.commands.length === 0) {
|
|
3332
|
+
return undefined;
|
|
3333
|
+
}
|
|
3334
|
+
const child = current.commands.find((command) => command.name() === token || command.aliases().includes(token));
|
|
3335
|
+
if (child === undefined) {
|
|
3336
|
+
if (getDefaultCommanderCommandName(current) !== undefined) {
|
|
3337
|
+
if (shouldRejectDefaultCommandToken(current, token, pathSegments)) {
|
|
3338
|
+
return {
|
|
3339
|
+
input: token,
|
|
3340
|
+
currentCommand: current,
|
|
3341
|
+
commandPath: pathSegments.join(" ")
|
|
3342
|
+
};
|
|
3343
|
+
}
|
|
3344
|
+
return undefined;
|
|
3345
|
+
}
|
|
3346
|
+
return {
|
|
3347
|
+
input: token,
|
|
3348
|
+
currentCommand: current,
|
|
3349
|
+
commandPath: pathSegments.join(" ")
|
|
3350
|
+
};
|
|
3351
|
+
}
|
|
3352
|
+
current = child;
|
|
3353
|
+
pathSegments.push(child.name());
|
|
3354
|
+
}
|
|
3355
|
+
return undefined;
|
|
3356
|
+
}
|
|
3357
|
+
function shouldRejectDefaultCommandToken(command, token, pathSegments) {
|
|
3358
|
+
return (pathSegments.length === 0 &&
|
|
3359
|
+
isBareCommandLikeToken(token) &&
|
|
3360
|
+
hasNonDefaultPublicChildCommand(command));
|
|
3361
|
+
}
|
|
3362
|
+
function hasNonDefaultPublicChildCommand(command) {
|
|
3363
|
+
const defaultName = getDefaultCommanderCommandName(command);
|
|
3364
|
+
return command.commands.some((child) => child.name() !== defaultName &&
|
|
3365
|
+
!isToolcraftHiddenCommander(child) &&
|
|
3366
|
+
!getToolcraftReservedChildNames(command).includes(child.name()));
|
|
3367
|
+
}
|
|
3368
|
+
function isBareCommandLikeToken(token) {
|
|
3369
|
+
if (token.length === 0) {
|
|
3370
|
+
return false;
|
|
3371
|
+
}
|
|
3372
|
+
for (const character of token) {
|
|
3373
|
+
if (!isCommandNameCharacter(character)) {
|
|
3374
|
+
return false;
|
|
3375
|
+
}
|
|
3376
|
+
}
|
|
3377
|
+
return true;
|
|
3378
|
+
}
|
|
3379
|
+
function isCommandNameCharacter(character) {
|
|
3380
|
+
const code = character.codePointAt(0);
|
|
3381
|
+
if (code === undefined) {
|
|
3382
|
+
return false;
|
|
3383
|
+
}
|
|
3384
|
+
const isLowercaseLetter = code >= 97 && code <= 122;
|
|
3385
|
+
const isUppercaseLetter = code >= 65 && code <= 90;
|
|
3386
|
+
const isDigit = code >= 48 && code <= 57;
|
|
3387
|
+
return isLowercaseLetter || isUppercaseLetter || isDigit || character === "-" || character === "_";
|
|
3388
|
+
}
|
|
3389
|
+
function getDefaultCommanderCommandName(command) {
|
|
3390
|
+
const candidate = command;
|
|
3391
|
+
return typeof candidate._defaultCommandName === "string"
|
|
3392
|
+
? candidate._defaultCommandName
|
|
3393
|
+
: undefined;
|
|
3394
|
+
}
|
|
3395
|
+
function configureCommanderSuggestionOutput(command) {
|
|
3396
|
+
command.exitOverride();
|
|
3397
|
+
command.configureOutput({
|
|
3398
|
+
outputError: (message, write) => {
|
|
3399
|
+
if (message.includes("unknown command") || message.includes("unknown option")) {
|
|
3400
|
+
return;
|
|
3401
|
+
}
|
|
3402
|
+
write(message);
|
|
3403
|
+
}
|
|
3404
|
+
});
|
|
3405
|
+
command.commands.forEach((child) => configureCommanderSuggestionOutput(child));
|
|
3406
|
+
}
|
|
3407
|
+
export async function runCLI(roots, options = {}) {
|
|
3408
|
+
enableSourceMaps();
|
|
3409
|
+
const controls = resolveCLIControls(options.controls);
|
|
3410
|
+
const argv = controls.verbose
|
|
3411
|
+
? normalizeVerboseAlias([...(options.argv ?? process.argv)])
|
|
3412
|
+
: [...(options.argv ?? process.argv)];
|
|
3413
|
+
const rootUsageName = options.rootUsageName ?? inferProgramName(argv);
|
|
3414
|
+
let lastActionCommand;
|
|
3415
|
+
let resolvedCommandPath = "";
|
|
3416
|
+
let program;
|
|
3417
|
+
let version;
|
|
3418
|
+
let userErrorPattern = "definition";
|
|
3419
|
+
let errorReportContext;
|
|
3420
|
+
try {
|
|
3421
|
+
const normalizedRoot = normalizeRoots(roots, argv);
|
|
3422
|
+
const root = options.approvals === true ? mergeApprovalsGroup(normalizedRoot) : normalizedRoot;
|
|
3423
|
+
await resolveMcpProxies(root, { projectRoot: options.projectRoot });
|
|
3424
|
+
const casing = options.casing ?? "kebab";
|
|
3425
|
+
const services = (options.services ?? {});
|
|
3426
|
+
const runtimeOptions = options.humanInLoop ?? {};
|
|
3427
|
+
const runtimeFetch = options.fetch ?? globalThis.fetch;
|
|
3428
|
+
version = options.version ?? findEntrypointPackageMetadata(argv[1])?.version;
|
|
3429
|
+
const servicesWithBuiltIns = {
|
|
3430
|
+
...services,
|
|
3431
|
+
runtimeOptions,
|
|
3432
|
+
root
|
|
3433
|
+
};
|
|
3434
|
+
const requirementOptions = {
|
|
3435
|
+
apiVersion: options.apiVersion
|
|
3436
|
+
};
|
|
3437
|
+
validateServices(services);
|
|
3438
|
+
if (hasHelpFlag(argv)) {
|
|
3439
|
+
userErrorPattern = "usage";
|
|
3440
|
+
await renderGeneratedHelp(root, argv, { ...options, version });
|
|
3441
|
+
return;
|
|
3442
|
+
}
|
|
3443
|
+
if (argv.length <= 2 && root.default?.scope.includes("cli") !== true) {
|
|
3444
|
+
userErrorPattern = "usage";
|
|
3445
|
+
await renderGeneratedHelp(root, argv, { ...options, version });
|
|
3446
|
+
return;
|
|
3447
|
+
}
|
|
3448
|
+
program = new CommanderCommand();
|
|
3449
|
+
program.name(root.name);
|
|
3450
|
+
program.exitOverride();
|
|
3451
|
+
program.showHelpAfterError();
|
|
3452
|
+
program.addHelpCommand(false);
|
|
3453
|
+
const presetsEnabled = options.presets === true;
|
|
3454
|
+
const globalLongOptionFlags = getGlobalLongOptionFlags(presetsEnabled, version !== undefined, controls);
|
|
3455
|
+
addGlobalOptions(program, presetsEnabled, controls);
|
|
3456
|
+
if (version !== undefined) {
|
|
3457
|
+
program.version(version, "--version");
|
|
3458
|
+
}
|
|
3459
|
+
Reflect.set(program, "_toolcraftReservedChildNames", root.children
|
|
3460
|
+
.filter((child) => !isNodeVisibleInScope(child, "cli"))
|
|
3461
|
+
.flatMap((child) => getNodeCommandNames(child)));
|
|
3462
|
+
const execute = async (state) => {
|
|
3463
|
+
lastActionCommand = state.actionCommand;
|
|
3464
|
+
resolvedCommandPath = formatCliCommandPath(state.commandPath);
|
|
3465
|
+
await executeCommand(state, servicesWithBuiltIns, requirementOptions, runtimeFetch, runtimeOptions, {
|
|
3466
|
+
logLevel: options.logLevel,
|
|
3467
|
+
logger: options.logger,
|
|
3468
|
+
verboseControlEnabled: controls.verbose
|
|
3469
|
+
}, (context) => {
|
|
3470
|
+
errorReportContext = context;
|
|
3471
|
+
});
|
|
3472
|
+
};
|
|
3473
|
+
const rootChildNames = new Set(root.children
|
|
3474
|
+
.filter((candidate) => isNodeVisibleInScope(candidate, "cli"))
|
|
3475
|
+
.map((candidate) => candidate.name));
|
|
3476
|
+
for (const child of root.children) {
|
|
3477
|
+
const command = createNodeCommand(child, casing, globalLongOptionFlags, execute, presetsEnabled, controls);
|
|
3478
|
+
if (command === null) {
|
|
3479
|
+
continue;
|
|
3480
|
+
}
|
|
3481
|
+
const isDefaultChild = root.default !== undefined &&
|
|
3482
|
+
root.default.scope.includes("cli") &&
|
|
3483
|
+
(command.name() === root.default.name || command.aliases().includes(root.default.name));
|
|
3484
|
+
addCommanderChild(program, command, isDefaultChild, rootChildNames);
|
|
3485
|
+
}
|
|
3486
|
+
configureCommanderSuggestionOutput(program);
|
|
3487
|
+
const unknownCommand = findUnknownCommanderCommand(program, argv);
|
|
3488
|
+
if (unknownCommand !== undefined) {
|
|
3489
|
+
createLogger().error(appendUsagePointer(formatUnknownCommandMessage(unknownCommand.input, unknownCommand.currentCommand), {
|
|
3490
|
+
rootUsageName,
|
|
3491
|
+
commandPath: unknownCommand.commandPath
|
|
3492
|
+
}));
|
|
3493
|
+
process.exitCode = 1;
|
|
3494
|
+
return;
|
|
3495
|
+
}
|
|
3496
|
+
userErrorPattern = "usage";
|
|
3497
|
+
await program.parseAsync(argv);
|
|
3498
|
+
}
|
|
3499
|
+
catch (error) {
|
|
3500
|
+
if (error instanceof ApprovalDeclinedError) {
|
|
3501
|
+
renderApprovalDeclined(error);
|
|
3502
|
+
return;
|
|
3503
|
+
}
|
|
3504
|
+
const resolvedFlags = lastActionCommand ? getResolvedFlags(lastActionCommand) : undefined;
|
|
3505
|
+
const report = await writeErrorReport({
|
|
3506
|
+
argv,
|
|
3507
|
+
command: errorReportContext?.command,
|
|
3508
|
+
commandPath: errorReportContext?.commandPath ?? resolvedCommandPath,
|
|
3509
|
+
env: process.env,
|
|
3510
|
+
error,
|
|
3511
|
+
errorReports: options.errorReports,
|
|
3512
|
+
params: errorReportContext?.params,
|
|
3513
|
+
projectRoot: options.projectRoot,
|
|
3514
|
+
secrets: errorReportContext?.secrets,
|
|
3515
|
+
version
|
|
3516
|
+
});
|
|
3517
|
+
if (report !== undefined) {
|
|
3518
|
+
process.stderr.write(`Saved error report to ${report.displayPath}\n`);
|
|
3519
|
+
}
|
|
3520
|
+
await handleRunError(error, {
|
|
3521
|
+
debugStackMode: resolvedFlags !== undefined
|
|
3522
|
+
? resolveDebugStackMode(resolvedFlags.debug)
|
|
3523
|
+
: getDebugStackModeFromArgv(argv),
|
|
3524
|
+
output: resolvedFlags !== undefined ? resolveOutput(resolvedFlags) : resolveOutputFromArgv(argv),
|
|
3525
|
+
verbose: resolvedFlags ? Boolean(resolvedFlags.verbose) : argv.includes("--verbose"),
|
|
3526
|
+
program,
|
|
3527
|
+
argv,
|
|
3528
|
+
rootUsageName,
|
|
3529
|
+
commandPath: resolvedCommandPath,
|
|
3530
|
+
userErrorPattern: errorReportContext?.params === undefined ? userErrorPattern : "runtime-user"
|
|
3531
|
+
});
|
|
3532
|
+
}
|
|
3533
|
+
}
|