@vellumai/credential-executor 0.4.55 → 0.4.56
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/Dockerfile +6 -2
- package/node_modules/@vellumai/ces-contracts/bun.lock +29 -0
- package/node_modules/@vellumai/ces-contracts/package.json +24 -0
- package/node_modules/@vellumai/ces-contracts/src/__tests__/contracts.test.ts +293 -0
- package/node_modules/@vellumai/ces-contracts/src/__tests__/grants.test.ts +686 -0
- package/node_modules/@vellumai/ces-contracts/src/error.ts +25 -0
- package/node_modules/@vellumai/ces-contracts/src/grants.ts +184 -0
- package/node_modules/@vellumai/ces-contracts/src/handles.ts +213 -0
- package/node_modules/@vellumai/ces-contracts/src/index.ts +147 -0
- package/node_modules/@vellumai/ces-contracts/src/rendering.ts +135 -0
- package/node_modules/@vellumai/ces-contracts/src/rpc.ts +511 -0
- package/node_modules/@vellumai/ces-contracts/tsconfig.json +20 -0
- package/node_modules/@vellumai/credential-storage/bun.lock +24 -0
- package/node_modules/@vellumai/credential-storage/package.json +17 -0
- package/node_modules/@vellumai/credential-storage/src/__tests__/package-boundary.test.ts +151 -0
- package/node_modules/@vellumai/credential-storage/src/index.ts +213 -0
- package/node_modules/@vellumai/credential-storage/src/oauth-runtime.ts +340 -0
- package/node_modules/@vellumai/credential-storage/src/static-credentials.ts +365 -0
- package/node_modules/@vellumai/credential-storage/tsconfig.json +20 -0
- package/node_modules/@vellumai/egress-proxy/bun.lock +24 -0
- package/node_modules/@vellumai/egress-proxy/package.json +17 -0
- package/node_modules/@vellumai/egress-proxy/src/__tests__/package-boundary.test.ts +131 -0
- package/node_modules/@vellumai/egress-proxy/src/index.ts +54 -0
- package/node_modules/@vellumai/egress-proxy/src/session-core.ts +466 -0
- package/node_modules/@vellumai/egress-proxy/src/types.ts +227 -0
- package/node_modules/@vellumai/egress-proxy/tsconfig.json +20 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +6 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +6 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +51 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +643 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2409 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +276 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +562 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +365 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +661 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +595 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +734 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +270 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +640 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +223 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +427 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +282 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +632 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +582 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +570 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1175 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2990 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +361 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +183 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +219 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1798 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +138 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +448 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +667 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +183 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4538 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +83 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +67 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +613 -0
- package/node_modules/zod/src/v4/core/util.ts +966 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/en.ts +119 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +116 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +49 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +116 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1916 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +529 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +963 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +347 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +6 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +15 -0
- package/node_modules/zod/v4/classic/external.d.ts +15 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +610 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +584 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/package.json +6 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1272 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +739 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +739 -0
- package/node_modules/zod/v4/classic/schemas.js +1157 -0
- package/node_modules/zod/v4/core/api.cjs +1222 -0
- package/node_modules/zod/v4/core/api.d.cts +304 -0
- package/node_modules/zod/v4/core/api.d.ts +304 -0
- package/node_modules/zod/v4/core/api.js +1082 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +575 -0
- package/node_modules/zod/v4/core/core.cjs +83 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +76 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +213 -0
- package/node_modules/zod/v4/core/errors.d.cts +220 -0
- package/node_modules/zod/v4/core/errors.d.ts +220 -0
- package/node_modules/zod/v4/core/errors.js +182 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +648 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +605 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +6 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +166 -0
- package/node_modules/zod/v4/core/regexes.d.cts +79 -0
- package/node_modules/zod/v4/core/regexes.d.ts +79 -0
- package/node_modules/zod/v4/core/regexes.js +133 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2124 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1146 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1146 -0
- package/node_modules/zod/v4/core/schemas.js +2093 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +446 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +437 -0
- package/node_modules/zod/v4/core/util.cjs +710 -0
- package/node_modules/zod/v4/core/util.d.cts +199 -0
- package/node_modules/zod/v4/core/util.d.ts +199 -0
- package/node_modules/zod/v4/core/util.js +651 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +133 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +108 -0
- package/node_modules/zod/v4/locales/en.cjs +136 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +109 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +135 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +108 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +214 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +106 -0
- package/node_modules/zod/v4/locales/index.cjs +104 -0
- package/node_modules/zod/v4/locales/index.d.cts +49 -0
- package/node_modules/zod/v4/locales/index.d.ts +49 -0
- package/node_modules/zod/v4/locales/index.js +49 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +112 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +137 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +109 -0
- package/node_modules/zod/v4/locales/package.json +6 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +108 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +105 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +136 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +109 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +12 -0
- package/node_modules/zod/v4/mini/external.d.ts +12 -0
- package/node_modules/zod/v4/mini/external.js +14 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +6 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1046 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +427 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +427 -0
- package/node_modules/zod/v4/mini/schemas.js +925 -0
- package/node_modules/zod/v4/package.json +6 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +6 -0
- package/package.json +3 -2
- package/src/__tests__/command-executor.test.ts +575 -60
- package/src/__tests__/command-validator.test.ts +697 -0
- package/src/__tests__/command-workspace.test.ts +30 -0
- package/src/__tests__/grant-store.test.ts +151 -33
- package/src/__tests__/http-executor.test.ts +106 -16
- package/src/__tests__/http-policy.test.ts +121 -22
- package/src/__tests__/local-materializers.test.ts +34 -0
- package/src/__tests__/managed-integration.test.ts +633 -0
- package/src/__tests__/managed-lazy-getters.test.ts +245 -0
- package/src/__tests__/managed-materializers.test.ts +107 -38
- package/src/__tests__/managed-rejection.test.ts +43 -0
- package/src/__tests__/toolstore.test.ts +207 -18
- package/src/__tests__/transport.test.ts +26 -6
- package/src/commands/auth-adapters.ts +2 -2
- package/src/commands/egress-hooks.ts +203 -0
- package/src/commands/executor.ts +403 -87
- package/src/commands/profiles.ts +4 -0
- package/src/commands/validator.ts +267 -3
- package/src/commands/workspace.ts +59 -21
- package/src/grants/index.ts +1 -1
- package/src/grants/persistent-store.ts +79 -17
- package/src/grants/rpc-handlers.ts +67 -43
- package/src/grants/temporary-store.ts +26 -19
- package/src/http/executor.ts +170 -25
- package/src/http/path-template.ts +75 -9
- package/src/http/policy.ts +9 -27
- package/src/index.ts +3 -0
- package/src/main.ts +102 -43
- package/src/managed-errors.ts +9 -0
- package/src/managed-lazy-getters.ts +70 -0
- package/src/managed-main.ts +191 -65
- package/src/materializers/local-oauth-lookup.ts +97 -0
- package/src/materializers/local-secure-key-backend.ts +254 -0
- package/src/materializers/local-token-refresh.ts +263 -0
- package/src/materializers/local.ts +21 -5
- package/src/materializers/managed-platform.ts +50 -25
- package/src/paths.ts +28 -10
- package/src/server.ts +147 -11
- package/src/subjects/managed.ts +33 -12
- package/src/subjects/policy.ts +79 -0
- package/src/toolstore/publish.ts +236 -7
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable outbound proxy session core.
|
|
3
|
+
*
|
|
4
|
+
* Provides the portable session lifecycle primitives (create, start, stop,
|
|
5
|
+
* env injection, idle timer, per-conversation limits, atomic acquire) that
|
|
6
|
+
* are shared by the assistant trusted-session proxy and the CES secure
|
|
7
|
+
* command egress layer. All credential resolution and policy wiring is
|
|
8
|
+
* delegated to the caller via the `SessionStartHooks` interface so this
|
|
9
|
+
* module has zero coupling to assistant or CES internals.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { randomUUID } from "node:crypto";
|
|
13
|
+
import type { Server } from "node:http";
|
|
14
|
+
|
|
15
|
+
import type {
|
|
16
|
+
ProxyApprovalCallback,
|
|
17
|
+
ProxyEnvVars,
|
|
18
|
+
ProxySession,
|
|
19
|
+
ProxySessionConfig,
|
|
20
|
+
ProxySessionId,
|
|
21
|
+
} from "./types.js";
|
|
22
|
+
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Default configuration
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
const DEFAULT_CONFIG: ProxySessionConfig = {
|
|
28
|
+
idleTimeoutMs: 5 * 60 * 1000, // 5 minutes
|
|
29
|
+
maxSessionsPerConversation: 3,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// Internal managed session state
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
export interface ManagedSession {
|
|
37
|
+
session: ProxySession;
|
|
38
|
+
server: Server | null;
|
|
39
|
+
idleTimer: ReturnType<typeof setTimeout> | null;
|
|
40
|
+
config: ProxySessionConfig;
|
|
41
|
+
dataDir: string | null;
|
|
42
|
+
approvalCallback: ProxyApprovalCallback | null;
|
|
43
|
+
/** The host address the server is bound to (e.g. '127.0.0.1'). */
|
|
44
|
+
listenHost: string;
|
|
45
|
+
/** In-flight stop promise so concurrent callers can await the same shutdown. */
|
|
46
|
+
stopPromise: Promise<void> | null;
|
|
47
|
+
/** Path to the combined CA bundle, set only when ensureCombinedCABundle succeeds. */
|
|
48
|
+
combinedCABundlePath: string | null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
// Hooks — caller-provided wiring for credential resolution & server setup
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Hooks invoked during session start to wire up credential resolution,
|
|
57
|
+
* proxy server creation, and CA setup. The caller (assistant session-manager
|
|
58
|
+
* or CES egress enforcer) supplies these to customize behavior without
|
|
59
|
+
* coupling the session core to runtime-specific modules.
|
|
60
|
+
*/
|
|
61
|
+
export interface SessionStartHooks {
|
|
62
|
+
/**
|
|
63
|
+
* Create and configure the HTTP proxy server for this session.
|
|
64
|
+
* Called during `startSession` — the returned server is bound to an
|
|
65
|
+
* ephemeral port by the core.
|
|
66
|
+
*/
|
|
67
|
+
createServer: (managed: ManagedSession) => Promise<Server>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Optional hook for CA / TLS setup before the server starts.
|
|
71
|
+
* If it sets `managed.combinedCABundlePath`, `getSessionEnv` will
|
|
72
|
+
* include `NODE_EXTRA_CA_CERTS` and `SSL_CERT_FILE`.
|
|
73
|
+
*/
|
|
74
|
+
setupCA?: (managed: ManagedSession) => Promise<void>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Return the path to the CA cert for `NODE_EXTRA_CA_CERTS`.
|
|
78
|
+
* Only called when `managed.combinedCABundlePath` is set.
|
|
79
|
+
*/
|
|
80
|
+
getCAPath?: (dataDir: string) => string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
// Session store
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* In-process session store. Exported so callers can construct isolated
|
|
89
|
+
* stores (e.g. for testing) or share a singleton.
|
|
90
|
+
*/
|
|
91
|
+
export class SessionStore {
|
|
92
|
+
readonly sessions = new Map<ProxySessionId, ManagedSession>();
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Per-conversation mutex for session acquisition. Prevents concurrent
|
|
96
|
+
* proxied commands from each observing "no active session" and creating
|
|
97
|
+
* duplicate sessions (check-then-act race).
|
|
98
|
+
*/
|
|
99
|
+
readonly acquireLocks = new Map<string, Promise<ProxySession>>();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// Helpers
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
|
|
106
|
+
/** Return a defensive copy so callers cannot mutate internal state. */
|
|
107
|
+
export function cloneSession(s: ProxySession): ProxySession {
|
|
108
|
+
return {
|
|
109
|
+
...s,
|
|
110
|
+
credentialIds: [...s.credentialIds],
|
|
111
|
+
createdAt: new Date(s.createdAt.getTime()),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function resetIdleTimer(
|
|
116
|
+
managed: ManagedSession,
|
|
117
|
+
store: SessionStore,
|
|
118
|
+
): void {
|
|
119
|
+
if (managed.idleTimer != null) {
|
|
120
|
+
clearTimeout(managed.idleTimer);
|
|
121
|
+
}
|
|
122
|
+
managed.idleTimer = setTimeout(() => {
|
|
123
|
+
if (managed.session.status === "active") {
|
|
124
|
+
stopSession(managed.session.id, store).catch(() => {});
|
|
125
|
+
}
|
|
126
|
+
}, managed.config.idleTimeoutMs);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Sorted comparison so order doesn't matter. */
|
|
130
|
+
export function credentialIdsMatch(a: string[], b: string[]): boolean {
|
|
131
|
+
if (a.length !== b.length) return false;
|
|
132
|
+
const sa = [...a].sort();
|
|
133
|
+
const sb = [...b].sort();
|
|
134
|
+
return sa.every((v, i) => v === sb[i]);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
// Session lifecycle
|
|
139
|
+
// ---------------------------------------------------------------------------
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Create a new proxy session bound to a conversation.
|
|
143
|
+
* The session starts in 'starting' status with no port assigned yet.
|
|
144
|
+
*/
|
|
145
|
+
export function createSession(
|
|
146
|
+
store: SessionStore,
|
|
147
|
+
conversationId: string,
|
|
148
|
+
credentialIds: string[],
|
|
149
|
+
config?: Partial<ProxySessionConfig>,
|
|
150
|
+
dataDir?: string,
|
|
151
|
+
approvalCallback?: ProxyApprovalCallback,
|
|
152
|
+
): ProxySession {
|
|
153
|
+
const merged: ProxySessionConfig = { ...DEFAULT_CONFIG, ...config };
|
|
154
|
+
|
|
155
|
+
// Enforce per-conversation limit
|
|
156
|
+
const existing = getSessionsForConversation(store, conversationId);
|
|
157
|
+
const liveCount = existing.filter((s) => s.status !== "stopped").length;
|
|
158
|
+
if (liveCount >= merged.maxSessionsPerConversation) {
|
|
159
|
+
throw new Error(
|
|
160
|
+
`Max sessions (${merged.maxSessionsPerConversation}) reached for conversation ${conversationId}`,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const session: ProxySession = {
|
|
165
|
+
id: randomUUID(),
|
|
166
|
+
conversationId,
|
|
167
|
+
credentialIds: [...credentialIds],
|
|
168
|
+
status: "starting",
|
|
169
|
+
createdAt: new Date(),
|
|
170
|
+
port: null,
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
store.sessions.set(session.id, {
|
|
174
|
+
session,
|
|
175
|
+
server: null,
|
|
176
|
+
idleTimer: null,
|
|
177
|
+
config: merged,
|
|
178
|
+
dataDir: dataDir ?? null,
|
|
179
|
+
approvalCallback: approvalCallback ?? null,
|
|
180
|
+
listenHost: "127.0.0.1",
|
|
181
|
+
stopPromise: null,
|
|
182
|
+
combinedCABundlePath: null,
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
return cloneSession(session);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Start the proxy session — invokes the caller's hooks to create the
|
|
190
|
+
* server and opens it on an ephemeral port.
|
|
191
|
+
*/
|
|
192
|
+
export async function startSession(
|
|
193
|
+
store: SessionStore,
|
|
194
|
+
sessionId: ProxySessionId,
|
|
195
|
+
hooks: SessionStartHooks,
|
|
196
|
+
options?: { listenHost?: string },
|
|
197
|
+
): Promise<ProxySession> {
|
|
198
|
+
const managed = store.sessions.get(sessionId);
|
|
199
|
+
if (!managed) throw new Error(`Session not found: ${sessionId}`);
|
|
200
|
+
if (managed.session.status !== "starting") {
|
|
201
|
+
throw new Error(
|
|
202
|
+
`Session ${sessionId} is ${managed.session.status}, expected starting`,
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Optional CA setup
|
|
207
|
+
if (hooks.setupCA) {
|
|
208
|
+
try {
|
|
209
|
+
await hooks.setupCA(managed);
|
|
210
|
+
} catch (err) {
|
|
211
|
+
store.sessions.delete(sessionId);
|
|
212
|
+
throw err;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Create the proxy server via caller hook
|
|
217
|
+
const server = await hooks.createServer(managed);
|
|
218
|
+
const listenHost = options?.listenHost ?? "127.0.0.1";
|
|
219
|
+
|
|
220
|
+
try {
|
|
221
|
+
return await new Promise<ProxySession>((resolve, reject) => {
|
|
222
|
+
server.listen(0, listenHost, () => {
|
|
223
|
+
const addr = server.address();
|
|
224
|
+
if (!addr || typeof addr === "string") {
|
|
225
|
+
reject(new Error("Failed to get server address"));
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
managed.server = server;
|
|
229
|
+
managed.session.port = addr.port;
|
|
230
|
+
managed.session.status = "active";
|
|
231
|
+
managed.listenHost = listenHost;
|
|
232
|
+
resetIdleTimer(managed, store);
|
|
233
|
+
resolve(cloneSession(managed.session));
|
|
234
|
+
});
|
|
235
|
+
server.on("error", reject);
|
|
236
|
+
});
|
|
237
|
+
} catch (err) {
|
|
238
|
+
server.close(() => {});
|
|
239
|
+
store.sessions.delete(sessionId);
|
|
240
|
+
throw err;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Gracefully stop a session — closes the HTTP server and clears the idle timer.
|
|
246
|
+
*/
|
|
247
|
+
export async function stopSession(
|
|
248
|
+
sessionId: ProxySessionId,
|
|
249
|
+
store: SessionStore,
|
|
250
|
+
): Promise<void> {
|
|
251
|
+
const managed = store.sessions.get(sessionId);
|
|
252
|
+
if (!managed) throw new Error(`Session not found: ${sessionId}`);
|
|
253
|
+
if (managed.session.status === "stopped") return;
|
|
254
|
+
|
|
255
|
+
// If a shutdown is already in flight, await it instead of returning early.
|
|
256
|
+
if (managed.session.status === "stopping" && managed.stopPromise) {
|
|
257
|
+
return managed.stopPromise;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
managed.session.status = "stopping";
|
|
261
|
+
|
|
262
|
+
const doStop = async () => {
|
|
263
|
+
if (managed.idleTimer != null) {
|
|
264
|
+
clearTimeout(managed.idleTimer);
|
|
265
|
+
managed.idleTimer = null;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (managed.server) {
|
|
269
|
+
await new Promise<void>((resolve, reject) => {
|
|
270
|
+
managed.server!.close((err) => (err ? reject(err) : resolve()));
|
|
271
|
+
});
|
|
272
|
+
managed.server = null;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
managed.session.status = "stopped";
|
|
276
|
+
managed.session.port = null;
|
|
277
|
+
managed.approvalCallback = null;
|
|
278
|
+
managed.stopPromise = null;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
managed.stopPromise = doStop();
|
|
282
|
+
return managed.stopPromise;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Build environment variables to inject into a subprocess so its HTTP
|
|
287
|
+
* traffic flows through this proxy session.
|
|
288
|
+
*/
|
|
289
|
+
export function getSessionEnv(
|
|
290
|
+
store: SessionStore,
|
|
291
|
+
sessionId: ProxySessionId,
|
|
292
|
+
hooks?: Pick<SessionStartHooks, "getCAPath">,
|
|
293
|
+
): ProxyEnvVars {
|
|
294
|
+
const managed = store.sessions.get(sessionId);
|
|
295
|
+
if (!managed) throw new Error(`Session not found: ${sessionId}`);
|
|
296
|
+
if (managed.session.status !== "active" || managed.session.port == null) {
|
|
297
|
+
throw new Error(`Session ${sessionId} is not active`);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Touch the idle timer on access
|
|
301
|
+
resetIdleTimer(managed, store);
|
|
302
|
+
|
|
303
|
+
const proxyUrl = `http://127.0.0.1:${managed.session.port}`;
|
|
304
|
+
const env: ProxyEnvVars = {
|
|
305
|
+
HTTP_PROXY: proxyUrl,
|
|
306
|
+
HTTPS_PROXY: proxyUrl,
|
|
307
|
+
NO_PROXY: "localhost,127.0.0.1,::1",
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
// Only set cert env vars when the CA was actually initialized (MITM mode).
|
|
311
|
+
if (managed.dataDir && managed.combinedCABundlePath) {
|
|
312
|
+
if (hooks?.getCAPath) {
|
|
313
|
+
env.NODE_EXTRA_CA_CERTS = hooks.getCAPath(managed.dataDir);
|
|
314
|
+
}
|
|
315
|
+
env.SSL_CERT_FILE = managed.combinedCABundlePath;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return env;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Find an active session for a conversation (returns the first match).
|
|
323
|
+
*/
|
|
324
|
+
export function getActiveSession(
|
|
325
|
+
store: SessionStore,
|
|
326
|
+
conversationId: string,
|
|
327
|
+
): ProxySession | undefined {
|
|
328
|
+
for (const managed of store.sessions.values()) {
|
|
329
|
+
if (
|
|
330
|
+
managed.session.conversationId === conversationId &&
|
|
331
|
+
managed.session.status === "active"
|
|
332
|
+
) {
|
|
333
|
+
return cloneSession(managed.session);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return undefined;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Get all sessions for a given conversation.
|
|
341
|
+
*/
|
|
342
|
+
export function getSessionsForConversation(
|
|
343
|
+
store: SessionStore,
|
|
344
|
+
conversationId: string,
|
|
345
|
+
): ProxySession[] {
|
|
346
|
+
const result: ProxySession[] = [];
|
|
347
|
+
for (const managed of store.sessions.values()) {
|
|
348
|
+
if (managed.session.conversationId === conversationId) {
|
|
349
|
+
result.push(cloneSession(managed.session));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return result;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Atomically acquire a proxy session for a conversation — reuses an active
|
|
357
|
+
* session or creates + starts a new one. Serialized per conversation so
|
|
358
|
+
* concurrent callers share the same session instead of each spawning one.
|
|
359
|
+
*
|
|
360
|
+
* If the active session was created with different `credentialIds`, it is
|
|
361
|
+
* stopped and a fresh session is created so callers always get a session
|
|
362
|
+
* bound to the requested credentials.
|
|
363
|
+
*
|
|
364
|
+
* Returns `{ session, created }` so the caller knows whether it owns the
|
|
365
|
+
* session lifecycle (and should stop it) or is borrowing a shared one.
|
|
366
|
+
*/
|
|
367
|
+
export async function getOrStartSession(
|
|
368
|
+
store: SessionStore,
|
|
369
|
+
conversationId: string,
|
|
370
|
+
credentialIds: string[],
|
|
371
|
+
hooks: SessionStartHooks,
|
|
372
|
+
config?: Partial<ProxySessionConfig>,
|
|
373
|
+
dataDir?: string,
|
|
374
|
+
approvalCallback?: ProxyApprovalCallback,
|
|
375
|
+
options?: { listenHost?: string },
|
|
376
|
+
): Promise<{ session: ProxySession; created: boolean }> {
|
|
377
|
+
const requestedHost = options?.listenHost ?? "127.0.0.1";
|
|
378
|
+
|
|
379
|
+
// Fast path — session already active with matching credentials and listen
|
|
380
|
+
// host, no lock needed.
|
|
381
|
+
const existing = getActiveSession(store, conversationId);
|
|
382
|
+
if (existing && credentialIdsMatch(existing.credentialIds, credentialIds)) {
|
|
383
|
+
const managed = store.sessions.get(existing.id);
|
|
384
|
+
if (managed && managed.listenHost === requestedHost) {
|
|
385
|
+
return { session: existing, created: false };
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Serialize: if another caller is already creating a session for this
|
|
390
|
+
// conversation, wait for it rather than creating a second one.
|
|
391
|
+
for (;;) {
|
|
392
|
+
const inflight = store.acquireLocks.get(conversationId);
|
|
393
|
+
if (!inflight) break;
|
|
394
|
+
const session = await inflight;
|
|
395
|
+
if (credentialIdsMatch(session.credentialIds, credentialIds)) {
|
|
396
|
+
const m = store.sessions.get(session.id);
|
|
397
|
+
if (m && m.listenHost === requestedHost) {
|
|
398
|
+
return { session, created: false };
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
await stopSession(session.id, store);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const promise = (async () => {
|
|
405
|
+
// Re-check after winning the lock
|
|
406
|
+
const recheck = getActiveSession(store, conversationId);
|
|
407
|
+
if (recheck) {
|
|
408
|
+
const m = store.sessions.get(recheck.id);
|
|
409
|
+
if (
|
|
410
|
+
credentialIdsMatch(recheck.credentialIds, credentialIds) &&
|
|
411
|
+
m &&
|
|
412
|
+
m.listenHost === requestedHost
|
|
413
|
+
) {
|
|
414
|
+
return { session: recheck, created: false };
|
|
415
|
+
}
|
|
416
|
+
await stopSession(recheck.id, store);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const session = createSession(
|
|
420
|
+
store,
|
|
421
|
+
conversationId,
|
|
422
|
+
credentialIds,
|
|
423
|
+
config,
|
|
424
|
+
dataDir,
|
|
425
|
+
approvalCallback,
|
|
426
|
+
);
|
|
427
|
+
const started = await startSession(store, session.id, hooks, options);
|
|
428
|
+
return { session: started, created: true };
|
|
429
|
+
})();
|
|
430
|
+
|
|
431
|
+
// Wrap the inner promise to extract just the session for lock waiters.
|
|
432
|
+
const sessionPromise = promise.then((r) => r.session);
|
|
433
|
+
sessionPromise.catch(() => {}); // Rejection handled by `await promise` below
|
|
434
|
+
store.acquireLocks.set(conversationId, sessionPromise);
|
|
435
|
+
try {
|
|
436
|
+
return await promise;
|
|
437
|
+
} finally {
|
|
438
|
+
store.acquireLocks.delete(conversationId);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Stop all sessions and clear internal state. Useful for daemon shutdown.
|
|
444
|
+
*
|
|
445
|
+
* @param onError — optional callback invoked for each session that fails to
|
|
446
|
+
* stop. When omitted, errors are silently swallowed so shutdown always
|
|
447
|
+
* completes.
|
|
448
|
+
*/
|
|
449
|
+
export async function stopAllSessions(
|
|
450
|
+
store: SessionStore,
|
|
451
|
+
onError?: (sessionId: ProxySessionId, err: unknown) => void,
|
|
452
|
+
): Promise<void> {
|
|
453
|
+
const ids = [...store.sessions.keys()];
|
|
454
|
+
await Promise.all(
|
|
455
|
+
ids.map((id) =>
|
|
456
|
+
stopSession(id, store).catch((err) => {
|
|
457
|
+
try {
|
|
458
|
+
onError?.(id, err);
|
|
459
|
+
} catch {
|
|
460
|
+
// swallow – never let a throwing callback break Promise.all
|
|
461
|
+
}
|
|
462
|
+
}),
|
|
463
|
+
),
|
|
464
|
+
);
|
|
465
|
+
store.sessions.clear();
|
|
466
|
+
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for @vellumai/egress-proxy.
|
|
3
|
+
*
|
|
4
|
+
* These types define the portable primitives shared by the assistant
|
|
5
|
+
* trusted-session proxy flows and the CES secure command egress
|
|
6
|
+
* enforcement layer. They intentionally have zero dependencies on
|
|
7
|
+
* assistant runtime or CES server modules.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// Session identity
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
/** Unique identifier for a proxy session (opaque string, typically a UUID). */
|
|
15
|
+
export type ProxySessionId = string;
|
|
16
|
+
|
|
17
|
+
/** Lifecycle states a proxy session progresses through. */
|
|
18
|
+
export type ProxySessionStatus = "starting" | "active" | "stopping" | "stopped";
|
|
19
|
+
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Session model
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
/** Runtime representation of a proxy session. */
|
|
25
|
+
export interface ProxySession {
|
|
26
|
+
id: ProxySessionId;
|
|
27
|
+
conversationId: string;
|
|
28
|
+
credentialIds: string[];
|
|
29
|
+
status: ProxySessionStatus;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
/** Ephemeral port assigned once the session starts listening. */
|
|
32
|
+
port: number | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// Allowed network target
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Describes a network target that an egress proxy session is allowed to
|
|
41
|
+
* connect to. Carries host, port, and protocol restrictions from the
|
|
42
|
+
* secure command manifest.
|
|
43
|
+
*/
|
|
44
|
+
export interface AllowedTarget {
|
|
45
|
+
/** Host glob pattern (e.g. "api.github.com", "*.amazonaws.com"). */
|
|
46
|
+
host: string;
|
|
47
|
+
/** Allowed port(s). When omitted or empty, any port is allowed. */
|
|
48
|
+
ports?: number[];
|
|
49
|
+
/** Allowed protocol(s) ("http" | "https"). When omitted or empty, any protocol is allowed. */
|
|
50
|
+
protocols?: Array<"http" | "https">;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Session configuration
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
/** Tuning knobs for a proxy session. */
|
|
58
|
+
export interface ProxySessionConfig {
|
|
59
|
+
/** How long (ms) an idle session stays alive before auto-stopping. */
|
|
60
|
+
idleTimeoutMs: number;
|
|
61
|
+
/** Maximum concurrent sessions per conversation. */
|
|
62
|
+
maxSessionsPerConversation: number;
|
|
63
|
+
/**
|
|
64
|
+
* Per-command network target allowlist.
|
|
65
|
+
* When set, the proxy server MUST reject outbound connections to targets
|
|
66
|
+
* that do not match any entry. Used by CES egress enforcement to carry
|
|
67
|
+
* manifest `allowedNetworkTargets` through to the proxy session.
|
|
68
|
+
*
|
|
69
|
+
* Each entry specifies a host glob pattern and optional port/protocol
|
|
70
|
+
* restrictions. When `ports` is omitted, any port is allowed. When
|
|
71
|
+
* `protocols` is omitted, any protocol is allowed.
|
|
72
|
+
*/
|
|
73
|
+
allowedTargets?: AllowedTarget[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
// Environment injection
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Environment variables injected into a subprocess so its HTTP(S) traffic
|
|
82
|
+
* is routed through an egress proxy session.
|
|
83
|
+
*/
|
|
84
|
+
export interface ProxyEnvVars {
|
|
85
|
+
HTTP_PROXY: string;
|
|
86
|
+
HTTPS_PROXY: string;
|
|
87
|
+
NO_PROXY: string;
|
|
88
|
+
/** Extra CA certs path for Node.js / Bun TLS (proxy CA cert). */
|
|
89
|
+
NODE_EXTRA_CA_CERTS?: string;
|
|
90
|
+
/** Combined CA bundle (system roots + proxy CA) for non-Node TLS clients. */
|
|
91
|
+
SSL_CERT_FILE?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
// Credential injection
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
|
|
98
|
+
/** How a credential value is injected into an outbound proxied request. */
|
|
99
|
+
export type CredentialInjectionType = "header" | "query";
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Describes where and how to inject a credential into proxied requests
|
|
103
|
+
* matching a specific host pattern.
|
|
104
|
+
*/
|
|
105
|
+
export interface CredentialInjectionTemplate {
|
|
106
|
+
/** Glob pattern for matching request hosts (e.g. "*.fal.ai"). */
|
|
107
|
+
hostPattern: string;
|
|
108
|
+
/** Where the credential value is injected. */
|
|
109
|
+
injectionType: CredentialInjectionType;
|
|
110
|
+
/** Header name when injectionType is 'header' (e.g. "Authorization"). */
|
|
111
|
+
headerName?: string;
|
|
112
|
+
/** Prefix prepended to the secret value (e.g. "Key ", "Bearer "). */
|
|
113
|
+
valuePrefix?: string;
|
|
114
|
+
/** Query parameter name when injectionType is 'query'. */
|
|
115
|
+
queryParamName?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// ---------------------------------------------------------------------------
|
|
119
|
+
// Request target context
|
|
120
|
+
// ---------------------------------------------------------------------------
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Context about an outbound request target, used by the policy engine and
|
|
124
|
+
* approval prompts.
|
|
125
|
+
*/
|
|
126
|
+
export interface RequestTargetContext {
|
|
127
|
+
hostname: string;
|
|
128
|
+
port: number | null;
|
|
129
|
+
path: string;
|
|
130
|
+
/** The protocol scheme of the original request ('http' or 'https'). */
|
|
131
|
+
scheme: "http" | "https";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ---------------------------------------------------------------------------
|
|
135
|
+
// Policy decisions
|
|
136
|
+
// ---------------------------------------------------------------------------
|
|
137
|
+
|
|
138
|
+
/** A single credential matched — inject it. */
|
|
139
|
+
export interface PolicyDecisionMatched {
|
|
140
|
+
kind: "matched";
|
|
141
|
+
credentialId: string;
|
|
142
|
+
template: CredentialInjectionTemplate;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Multiple credentials match — caller must disambiguate. */
|
|
146
|
+
export interface PolicyDecisionAmbiguous {
|
|
147
|
+
kind: "ambiguous";
|
|
148
|
+
candidates: Array<{
|
|
149
|
+
credentialId: string;
|
|
150
|
+
template: CredentialInjectionTemplate;
|
|
151
|
+
}>;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** No credential matches the target host/path. */
|
|
155
|
+
export interface PolicyDecisionMissing {
|
|
156
|
+
kind: "missing";
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** No credential_ids were requested — pass-through. */
|
|
160
|
+
export interface PolicyDecisionUnauthenticated {
|
|
161
|
+
kind: "unauthenticated";
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The target host matches a known credential template pattern, but the
|
|
166
|
+
* session has no credential bound for it.
|
|
167
|
+
*/
|
|
168
|
+
export interface PolicyDecisionAskMissingCredential {
|
|
169
|
+
kind: "ask_missing_credential";
|
|
170
|
+
target: RequestTargetContext;
|
|
171
|
+
/** Host patterns from the known registry that matched the target. */
|
|
172
|
+
matchingPatterns: string[];
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The request doesn't match any known credential template and the session
|
|
177
|
+
* has no credentials.
|
|
178
|
+
*/
|
|
179
|
+
export interface PolicyDecisionAskUnauthenticated {
|
|
180
|
+
kind: "ask_unauthenticated";
|
|
181
|
+
target: RequestTargetContext;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** Union of all possible policy evaluation outcomes. */
|
|
185
|
+
export type PolicyDecision =
|
|
186
|
+
| PolicyDecisionMatched
|
|
187
|
+
| PolicyDecisionAmbiguous
|
|
188
|
+
| PolicyDecisionMissing
|
|
189
|
+
| PolicyDecisionUnauthenticated
|
|
190
|
+
| PolicyDecisionAskMissingCredential
|
|
191
|
+
| PolicyDecisionAskUnauthenticated;
|
|
192
|
+
|
|
193
|
+
// ---------------------------------------------------------------------------
|
|
194
|
+
// Policy callback shapes
|
|
195
|
+
// ---------------------------------------------------------------------------
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Callback invoked by the proxy HTTP forwarder for each outbound request.
|
|
199
|
+
* Returns injected headers on allow, or `null` to block the request.
|
|
200
|
+
*/
|
|
201
|
+
export type PolicyCallback = (
|
|
202
|
+
hostname: string,
|
|
203
|
+
port: number | null,
|
|
204
|
+
path: string,
|
|
205
|
+
scheme: "http" | "https",
|
|
206
|
+
) => Promise<Record<string, string> | null>;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Payload passed to the approval callback when the policy engine emits an
|
|
210
|
+
* `ask_missing_credential` or `ask_unauthenticated` decision.
|
|
211
|
+
*/
|
|
212
|
+
export interface ProxyApprovalRequest {
|
|
213
|
+
/** The policy decision that triggered the approval prompt. */
|
|
214
|
+
decision:
|
|
215
|
+
| PolicyDecisionAskMissingCredential
|
|
216
|
+
| PolicyDecisionAskUnauthenticated;
|
|
217
|
+
/** The proxy session ID that originated the request. */
|
|
218
|
+
sessionId: ProxySessionId;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Callback signature for proxy approval prompts. Returns `true` if the
|
|
223
|
+
* user approves, `false` if denied.
|
|
224
|
+
*/
|
|
225
|
+
export type ProxyApprovalCallback = (
|
|
226
|
+
request: ProxyApprovalRequest,
|
|
227
|
+
) => Promise<boolean>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"declarationMap": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"outDir": "./dist",
|
|
15
|
+
"rootDir": "./src",
|
|
16
|
+
"types": ["bun-types"]
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/**/*"],
|
|
19
|
+
"exclude": ["node_modules", "dist"]
|
|
20
|
+
}
|