@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,633 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Managed CES integration test with real Unix socket transport.
|
|
3
|
+
*
|
|
4
|
+
* Exercises the full CES RPC transport stack over a real Unix socket
|
|
5
|
+
* without mocks, Docker, K8s, or real OAuth credentials:
|
|
6
|
+
*
|
|
7
|
+
* 1. Starts the managed CES server on a temporary Unix socket
|
|
8
|
+
* 2. Connects as a client via the real socket
|
|
9
|
+
* 3. Performs the RPC handshake (protocol version negotiation)
|
|
10
|
+
* 4. Sends an RPC request (`list_grants`) and verifies the response
|
|
11
|
+
* 5. Verifies the health server responds on its HTTP port
|
|
12
|
+
* 6. Cleans up sockets, temp dirs, and servers
|
|
13
|
+
*
|
|
14
|
+
* This complements the existing transport.test.ts (which uses
|
|
15
|
+
* PassThrough streams) by proving that the real Unix socket
|
|
16
|
+
* accept-one-connection flow, newline-delimited JSON framing,
|
|
17
|
+
* and health endpoint all work end-to-end.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { afterEach, describe, expect, test } from "bun:test";
|
|
21
|
+
import { mkdirSync, mkdtempSync, rmSync } from "node:fs";
|
|
22
|
+
import { tmpdir } from "node:os";
|
|
23
|
+
import { join } from "node:path";
|
|
24
|
+
import { createConnection, type Socket } from "node:net";
|
|
25
|
+
import { Readable, Writable } from "node:stream";
|
|
26
|
+
|
|
27
|
+
import {
|
|
28
|
+
CES_PROTOCOL_VERSION,
|
|
29
|
+
CesRpcMethod,
|
|
30
|
+
type HandshakeAck,
|
|
31
|
+
type ListGrantsResponse,
|
|
32
|
+
type RpcEnvelope,
|
|
33
|
+
} from "@vellumai/ces-contracts";
|
|
34
|
+
|
|
35
|
+
import { PersistentGrantStore } from "../grants/persistent-store.js";
|
|
36
|
+
import { TemporaryGrantStore } from "../grants/temporary-store.js";
|
|
37
|
+
import { AuditStore } from "../audit/store.js";
|
|
38
|
+
import {
|
|
39
|
+
createListGrantsHandler,
|
|
40
|
+
createListAuditRecordsHandler,
|
|
41
|
+
} from "../grants/rpc-handlers.js";
|
|
42
|
+
import { CesRpcServer, type RpcHandlerRegistry, type SessionIdRef } from "../server.js";
|
|
43
|
+
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// Environment setup
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
/** Env vars saved/restored across tests. */
|
|
49
|
+
const SAVED_ENV_KEYS = [
|
|
50
|
+
"CES_DATA_DIR",
|
|
51
|
+
"CES_BOOTSTRAP_SOCKET_DIR",
|
|
52
|
+
"CES_BOOTSTRAP_SOCKET",
|
|
53
|
+
"CES_HEALTH_PORT",
|
|
54
|
+
"CES_MODE",
|
|
55
|
+
] as const;
|
|
56
|
+
|
|
57
|
+
type SavedEnv = Record<string, string | undefined>;
|
|
58
|
+
|
|
59
|
+
function saveEnv(): SavedEnv {
|
|
60
|
+
const saved: SavedEnv = {};
|
|
61
|
+
for (const key of SAVED_ENV_KEYS) {
|
|
62
|
+
saved[key] = process.env[key];
|
|
63
|
+
}
|
|
64
|
+
return saved;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function restoreEnv(saved: SavedEnv): void {
|
|
68
|
+
for (const [key, val] of Object.entries(saved)) {
|
|
69
|
+
if (val === undefined) {
|
|
70
|
+
delete process.env[key];
|
|
71
|
+
} else {
|
|
72
|
+
process.env[key] = val;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
// Helpers
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Build a minimal RPC handler registry with `list_grants` and
|
|
83
|
+
* `list_audit_records` backed by real stores in a temp directory.
|
|
84
|
+
*/
|
|
85
|
+
function buildMinimalHandlers(dataDir: string): RpcHandlerRegistry {
|
|
86
|
+
const grantsDir = join(dataDir, "grants");
|
|
87
|
+
const auditDir = join(dataDir, "audit");
|
|
88
|
+
mkdirSync(grantsDir, { recursive: true });
|
|
89
|
+
mkdirSync(auditDir, { recursive: true });
|
|
90
|
+
|
|
91
|
+
const persistentGrantStore = new PersistentGrantStore(grantsDir);
|
|
92
|
+
persistentGrantStore.init();
|
|
93
|
+
|
|
94
|
+
const auditStore = new AuditStore(auditDir);
|
|
95
|
+
auditStore.init();
|
|
96
|
+
|
|
97
|
+
const handlers: RpcHandlerRegistry = {};
|
|
98
|
+
|
|
99
|
+
handlers[CesRpcMethod.ListGrants] = createListGrantsHandler({
|
|
100
|
+
persistentGrantStore,
|
|
101
|
+
}) as typeof handlers[string];
|
|
102
|
+
|
|
103
|
+
handlers[CesRpcMethod.ListAuditRecords] = createListAuditRecordsHandler({
|
|
104
|
+
auditStore,
|
|
105
|
+
}) as typeof handlers[string];
|
|
106
|
+
|
|
107
|
+
return handlers;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Accept a single connection on a Unix socket and return
|
|
112
|
+
* readable/writable streams plus cleanup helpers.
|
|
113
|
+
*
|
|
114
|
+
* Replicates the same accept-one-connection pattern from managed-main.ts
|
|
115
|
+
* but in a test-friendly form.
|
|
116
|
+
*/
|
|
117
|
+
function acceptOneConnection(socketPath: string, signal: AbortSignal): Promise<{
|
|
118
|
+
readable: Readable;
|
|
119
|
+
writable: Writable;
|
|
120
|
+
socket: Socket;
|
|
121
|
+
}> {
|
|
122
|
+
return new Promise((resolve, reject) => {
|
|
123
|
+
const { createServer: createNetServer } = require("node:net");
|
|
124
|
+
const netServer = createNetServer();
|
|
125
|
+
|
|
126
|
+
const cleanup = () => {
|
|
127
|
+
netServer.close();
|
|
128
|
+
try { require("node:fs").unlinkSync(socketPath); } catch { /* ok */ }
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
if (signal.aborted) {
|
|
132
|
+
reject(new Error("Aborted before listening"));
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
signal.addEventListener("abort", () => {
|
|
137
|
+
cleanup();
|
|
138
|
+
reject(new Error("Aborted while waiting for connection"));
|
|
139
|
+
}, { once: true });
|
|
140
|
+
|
|
141
|
+
netServer.on("error", (err: Error) => {
|
|
142
|
+
cleanup();
|
|
143
|
+
reject(err);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
netServer.listen(socketPath, () => {
|
|
147
|
+
// listening
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
netServer.on("connection", (sock: Socket) => {
|
|
151
|
+
netServer.close();
|
|
152
|
+
try { require("node:fs").unlinkSync(socketPath); } catch { /* ok */ }
|
|
153
|
+
|
|
154
|
+
const readable = new Readable({ read() {} });
|
|
155
|
+
const writable = new Writable({
|
|
156
|
+
write(chunk: Buffer, _encoding: string, callback: (err?: Error | null) => void) {
|
|
157
|
+
if (sock.writable) {
|
|
158
|
+
sock.write(chunk, callback);
|
|
159
|
+
} else {
|
|
160
|
+
callback(new Error("Socket no longer writable"));
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
sock.on("data", (chunk: Buffer) => readable.push(chunk));
|
|
166
|
+
sock.on("end", () => readable.push(null));
|
|
167
|
+
sock.on("error", (err: Error) => {
|
|
168
|
+
readable.destroy(err);
|
|
169
|
+
writable.destroy(err);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
resolve({ readable, writable, socket: sock });
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Connect to a Unix socket as a client, retrying on transient errors.
|
|
179
|
+
*
|
|
180
|
+
* `acceptOneConnection` starts a `net.Server` and the socket path only
|
|
181
|
+
* exists once the server's `listen` callback fires. On slower CI runners
|
|
182
|
+
* the `createConnection` call can race ahead and hit `ENOENT` or
|
|
183
|
+
* `ECONNREFUSED` before the path is ready. A short retry loop with
|
|
184
|
+
* exponential back-off absorbs this race without needing an explicit
|
|
185
|
+
* readiness signal from the server side.
|
|
186
|
+
*/
|
|
187
|
+
function connectToSocket(
|
|
188
|
+
socketPath: string,
|
|
189
|
+
{ maxRetries = 20, baseDelayMs = 10 } = {},
|
|
190
|
+
): Promise<Socket> {
|
|
191
|
+
return new Promise((resolve, reject) => {
|
|
192
|
+
let attempt = 0;
|
|
193
|
+
|
|
194
|
+
const tryConnect = () => {
|
|
195
|
+
const sock = createConnection(socketPath, () => {
|
|
196
|
+
sock.removeAllListeners("error");
|
|
197
|
+
resolve(sock);
|
|
198
|
+
});
|
|
199
|
+
sock.on("error", (err: NodeJS.ErrnoException) => {
|
|
200
|
+
sock.destroy();
|
|
201
|
+
attempt++;
|
|
202
|
+
if (
|
|
203
|
+
attempt < maxRetries &&
|
|
204
|
+
(err.code === "ENOENT" || err.code === "ECONNREFUSED")
|
|
205
|
+
) {
|
|
206
|
+
const delay = baseDelayMs * Math.pow(2, Math.min(attempt, 6));
|
|
207
|
+
setTimeout(tryConnect, delay);
|
|
208
|
+
} else {
|
|
209
|
+
reject(err);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
tryConnect();
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Read newline-delimited JSON messages from a socket, collecting them
|
|
220
|
+
* until the expected count is reached or a timeout fires.
|
|
221
|
+
*/
|
|
222
|
+
function readMessages(sock: Socket, expectedCount: number, timeoutMs = 3000): Promise<unknown[]> {
|
|
223
|
+
return new Promise((resolve, reject) => {
|
|
224
|
+
const messages: unknown[] = [];
|
|
225
|
+
let buffer = "";
|
|
226
|
+
|
|
227
|
+
const timer = setTimeout(() => {
|
|
228
|
+
sock.removeAllListeners("data");
|
|
229
|
+
resolve(messages); // resolve with what we have
|
|
230
|
+
}, timeoutMs);
|
|
231
|
+
|
|
232
|
+
sock.on("data", (chunk: Buffer) => {
|
|
233
|
+
buffer += chunk.toString("utf-8");
|
|
234
|
+
let idx: number;
|
|
235
|
+
while ((idx = buffer.indexOf("\n")) !== -1) {
|
|
236
|
+
const line = buffer.slice(0, idx).trim();
|
|
237
|
+
buffer = buffer.slice(idx + 1);
|
|
238
|
+
if (line.length === 0) continue;
|
|
239
|
+
try {
|
|
240
|
+
messages.push(JSON.parse(line));
|
|
241
|
+
} catch {
|
|
242
|
+
// skip malformed lines
|
|
243
|
+
}
|
|
244
|
+
if (messages.length >= expectedCount) {
|
|
245
|
+
clearTimeout(timer);
|
|
246
|
+
sock.removeAllListeners("data");
|
|
247
|
+
resolve(messages);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
sock.on("error", (err) => {
|
|
254
|
+
clearTimeout(timer);
|
|
255
|
+
reject(err);
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Send a newline-delimited JSON message through a socket.
|
|
262
|
+
*/
|
|
263
|
+
function sendMessage(sock: Socket, msg: unknown): void {
|
|
264
|
+
sock.write(JSON.stringify(msg) + "\n");
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// ---------------------------------------------------------------------------
|
|
268
|
+
// Test state
|
|
269
|
+
// ---------------------------------------------------------------------------
|
|
270
|
+
|
|
271
|
+
let tmpDir: string;
|
|
272
|
+
let savedEnv: SavedEnv;
|
|
273
|
+
let controller: AbortController;
|
|
274
|
+
let healthServer: ReturnType<typeof Bun.serve> | undefined;
|
|
275
|
+
let clientSocket: Socket | undefined;
|
|
276
|
+
let serverRpcServer: CesRpcServer | undefined;
|
|
277
|
+
|
|
278
|
+
afterEach(async () => {
|
|
279
|
+
// Shut down server and client
|
|
280
|
+
controller?.abort();
|
|
281
|
+
serverRpcServer?.close();
|
|
282
|
+
clientSocket?.destroy();
|
|
283
|
+
if (healthServer) {
|
|
284
|
+
healthServer.stop(true);
|
|
285
|
+
healthServer = undefined;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Restore env
|
|
289
|
+
if (savedEnv) restoreEnv(savedEnv);
|
|
290
|
+
|
|
291
|
+
// Clean up temp dir
|
|
292
|
+
if (tmpDir) {
|
|
293
|
+
try {
|
|
294
|
+
rmSync(tmpDir, { recursive: true, force: true });
|
|
295
|
+
} catch { /* ok */ }
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
// ---------------------------------------------------------------------------
|
|
300
|
+
// Integration tests
|
|
301
|
+
// ---------------------------------------------------------------------------
|
|
302
|
+
|
|
303
|
+
describe("managed CES integration (real Unix socket)", () => {
|
|
304
|
+
test("full lifecycle: handshake, RPC dispatch, and health endpoint", async () => {
|
|
305
|
+
// -- Setup temp dirs and env -----------------------------------------------
|
|
306
|
+
savedEnv = saveEnv();
|
|
307
|
+
tmpDir = mkdtempSync(join(tmpdir(), "ces-managed-integ-"));
|
|
308
|
+
const dataDir = join(tmpDir, "ces-data");
|
|
309
|
+
const socketDir = join(tmpDir, "bootstrap");
|
|
310
|
+
const socketPath = join(socketDir, "ces.sock");
|
|
311
|
+
mkdirSync(dataDir, { recursive: true });
|
|
312
|
+
mkdirSync(socketDir, { recursive: true });
|
|
313
|
+
|
|
314
|
+
process.env["CES_DATA_DIR"] = dataDir;
|
|
315
|
+
process.env["CES_MODE"] = "managed";
|
|
316
|
+
|
|
317
|
+
// -- Pick a free port for health server ------------------------------------
|
|
318
|
+
// Use port 0 trick: bind, read the port, close, then use it.
|
|
319
|
+
const healthPort = await new Promise<number>((resolve) => {
|
|
320
|
+
const srv = require("node:net").createServer();
|
|
321
|
+
srv.listen(0, () => {
|
|
322
|
+
const port = srv.address().port;
|
|
323
|
+
srv.close(() => resolve(port));
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
process.env["CES_HEALTH_PORT"] = String(healthPort);
|
|
327
|
+
|
|
328
|
+
controller = new AbortController();
|
|
329
|
+
|
|
330
|
+
// -- Start health server ---------------------------------------------------
|
|
331
|
+
// NOTE: This uses a local Bun.serve mock rather than the production
|
|
332
|
+
// `startHealthServer()` from managed-main.ts. The production function is
|
|
333
|
+
// not exported and depends on module-level mutable state (the
|
|
334
|
+
// `rpcConnected` flag) that cannot be controlled from tests.
|
|
335
|
+
//
|
|
336
|
+
// What this covers:
|
|
337
|
+
// - The health endpoint contract (/healthz, /readyz response shapes)
|
|
338
|
+
// that Kubernetes probes and the assistant runtime depend on.
|
|
339
|
+
// - End-to-end socket + RPC + health plumbing in one integration flow.
|
|
340
|
+
//
|
|
341
|
+
// What this does NOT cover:
|
|
342
|
+
// - The actual `startHealthServer()` implementation in managed-main.ts,
|
|
343
|
+
// including the `rpcConnected` field in the /readyz response. If the
|
|
344
|
+
// production health handler drifts (changes routes, status codes, or
|
|
345
|
+
// response shape), this test will not catch it. To close that gap,
|
|
346
|
+
// extract `startHealthServer` into an importable module so this test
|
|
347
|
+
// can exercise the real code path.
|
|
348
|
+
healthServer = Bun.serve({
|
|
349
|
+
port: healthPort,
|
|
350
|
+
fetch(req) {
|
|
351
|
+
const url = new URL(req.url);
|
|
352
|
+
if (url.pathname === "/healthz") {
|
|
353
|
+
return new Response(
|
|
354
|
+
JSON.stringify({ status: "ok", version: CES_PROTOCOL_VERSION }),
|
|
355
|
+
{ headers: { "Content-Type": "application/json" } },
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
if (url.pathname === "/readyz") {
|
|
359
|
+
return new Response(
|
|
360
|
+
JSON.stringify({ ready: true, version: CES_PROTOCOL_VERSION }),
|
|
361
|
+
{ status: 200, headers: { "Content-Type": "application/json" } },
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
return new Response("Not Found", { status: 404 });
|
|
365
|
+
},
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
// -- Start accept-one-connection on the Unix socket ------------------------
|
|
369
|
+
const connectionPromise = acceptOneConnection(socketPath, controller.signal);
|
|
370
|
+
|
|
371
|
+
// -- Client connects -------------------------------------------------------
|
|
372
|
+
clientSocket = await connectToSocket(socketPath);
|
|
373
|
+
|
|
374
|
+
// -- Server gets the connection and wires up RPC ---------------------------
|
|
375
|
+
const conn = await connectionPromise;
|
|
376
|
+
|
|
377
|
+
const sessionIdRef: SessionIdRef = { current: `integ-${Date.now()}` };
|
|
378
|
+
const handlers = buildMinimalHandlers(dataDir);
|
|
379
|
+
|
|
380
|
+
serverRpcServer = new CesRpcServer({
|
|
381
|
+
input: conn.readable,
|
|
382
|
+
output: conn.writable,
|
|
383
|
+
handlers,
|
|
384
|
+
logger: {
|
|
385
|
+
log: () => {},
|
|
386
|
+
warn: () => {},
|
|
387
|
+
error: () => {},
|
|
388
|
+
},
|
|
389
|
+
signal: controller.signal,
|
|
390
|
+
onHandshakeComplete: (hsSessionId) => {
|
|
391
|
+
sessionIdRef.current = hsSessionId;
|
|
392
|
+
},
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
const servePromise = serverRpcServer.serve();
|
|
396
|
+
|
|
397
|
+
// -- Step 1: Handshake -----------------------------------------------------
|
|
398
|
+
const handshakeSessionId = `integ-session-${Date.now()}`;
|
|
399
|
+
sendMessage(clientSocket, {
|
|
400
|
+
type: "handshake_request",
|
|
401
|
+
protocolVersion: CES_PROTOCOL_VERSION,
|
|
402
|
+
sessionId: handshakeSessionId,
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
const handshakeMessages = await readMessages(clientSocket, 1);
|
|
406
|
+
expect(handshakeMessages.length).toBe(1);
|
|
407
|
+
|
|
408
|
+
const ack = handshakeMessages[0] as HandshakeAck;
|
|
409
|
+
expect(ack.type).toBe("handshake_ack");
|
|
410
|
+
expect(ack.accepted).toBe(true);
|
|
411
|
+
expect(ack.protocolVersion).toBe(CES_PROTOCOL_VERSION);
|
|
412
|
+
expect(ack.sessionId).toBe(handshakeSessionId);
|
|
413
|
+
|
|
414
|
+
// Verify onHandshakeComplete callback fired
|
|
415
|
+
expect(sessionIdRef.current).toBe(handshakeSessionId);
|
|
416
|
+
|
|
417
|
+
// -- Step 2: RPC dispatch (list_grants) ------------------------------------
|
|
418
|
+
const rpcId = "rpc-1";
|
|
419
|
+
sendMessage(clientSocket, {
|
|
420
|
+
type: "rpc",
|
|
421
|
+
id: rpcId,
|
|
422
|
+
kind: "request",
|
|
423
|
+
method: CesRpcMethod.ListGrants,
|
|
424
|
+
payload: {},
|
|
425
|
+
timestamp: new Date().toISOString(),
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
const rpcMessages = await readMessages(clientSocket, 1);
|
|
429
|
+
expect(rpcMessages.length).toBe(1);
|
|
430
|
+
|
|
431
|
+
const rpcResp = rpcMessages[0] as RpcEnvelope & { type: "rpc" };
|
|
432
|
+
expect(rpcResp.type).toBe("rpc");
|
|
433
|
+
expect(rpcResp.id).toBe(rpcId);
|
|
434
|
+
expect(rpcResp.kind).toBe("response");
|
|
435
|
+
expect(rpcResp.method).toBe(CesRpcMethod.ListGrants);
|
|
436
|
+
|
|
437
|
+
const grantsPayload = rpcResp.payload as ListGrantsResponse;
|
|
438
|
+
expect(grantsPayload.grants).toEqual([]);
|
|
439
|
+
|
|
440
|
+
// -- Step 3: RPC dispatch (list_audit_records) -----------------------------
|
|
441
|
+
const auditRpcId = "rpc-2";
|
|
442
|
+
sendMessage(clientSocket, {
|
|
443
|
+
type: "rpc",
|
|
444
|
+
id: auditRpcId,
|
|
445
|
+
kind: "request",
|
|
446
|
+
method: CesRpcMethod.ListAuditRecords,
|
|
447
|
+
payload: {},
|
|
448
|
+
timestamp: new Date().toISOString(),
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
const auditMessages = await readMessages(clientSocket, 1);
|
|
452
|
+
expect(auditMessages.length).toBe(1);
|
|
453
|
+
|
|
454
|
+
const auditResp = auditMessages[0] as RpcEnvelope & { type: "rpc" };
|
|
455
|
+
expect(auditResp.type).toBe("rpc");
|
|
456
|
+
expect(auditResp.id).toBe(auditRpcId);
|
|
457
|
+
expect(auditResp.kind).toBe("response");
|
|
458
|
+
expect(auditResp.method).toBe(CesRpcMethod.ListAuditRecords);
|
|
459
|
+
|
|
460
|
+
const auditPayload = auditResp.payload as { records: unknown[]; nextCursor: string | null };
|
|
461
|
+
expect(auditPayload.records).toEqual([]);
|
|
462
|
+
expect(auditPayload.nextCursor).toBeNull();
|
|
463
|
+
|
|
464
|
+
// -- Step 4: Health endpoint -----------------------------------------------
|
|
465
|
+
const healthzResp = await fetch(`http://localhost:${healthPort}/healthz`);
|
|
466
|
+
expect(healthzResp.status).toBe(200);
|
|
467
|
+
const healthzBody = await healthzResp.json();
|
|
468
|
+
expect(healthzBody.status).toBe("ok");
|
|
469
|
+
expect(healthzBody.version).toBe(CES_PROTOCOL_VERSION);
|
|
470
|
+
|
|
471
|
+
const readyzResp = await fetch(`http://localhost:${healthPort}/readyz`);
|
|
472
|
+
expect(readyzResp.status).toBe(200);
|
|
473
|
+
const readyzBody = await readyzResp.json();
|
|
474
|
+
expect(readyzBody.ready).toBe(true);
|
|
475
|
+
expect(readyzBody.version).toBe(CES_PROTOCOL_VERSION);
|
|
476
|
+
|
|
477
|
+
// -- Step 5: Unknown method returns METHOD_NOT_FOUND -----------------------
|
|
478
|
+
const unknownRpcId = "rpc-3";
|
|
479
|
+
sendMessage(clientSocket, {
|
|
480
|
+
type: "rpc",
|
|
481
|
+
id: unknownRpcId,
|
|
482
|
+
kind: "request",
|
|
483
|
+
method: "nonexistent_method",
|
|
484
|
+
payload: {},
|
|
485
|
+
timestamp: new Date().toISOString(),
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
const unknownMessages = await readMessages(clientSocket, 1);
|
|
489
|
+
expect(unknownMessages.length).toBe(1);
|
|
490
|
+
|
|
491
|
+
const unknownResp = unknownMessages[0] as RpcEnvelope & { type: "rpc" };
|
|
492
|
+
expect(unknownResp.id).toBe(unknownRpcId);
|
|
493
|
+
expect(unknownResp.kind).toBe("response");
|
|
494
|
+
const unknownPayload = unknownResp.payload as { success: boolean; error: { code: string } };
|
|
495
|
+
expect(unknownPayload.error.code).toBe("METHOD_NOT_FOUND");
|
|
496
|
+
|
|
497
|
+
// -- Cleanup ---------------------------------------------------------------
|
|
498
|
+
clientSocket.end();
|
|
499
|
+
controller.abort();
|
|
500
|
+
await servePromise;
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
test("rejects handshake with mismatched protocol version over real socket", async () => {
|
|
504
|
+
savedEnv = saveEnv();
|
|
505
|
+
tmpDir = mkdtempSync(join(tmpdir(), "ces-managed-integ-hs-"));
|
|
506
|
+
const dataDir = join(tmpDir, "ces-data");
|
|
507
|
+
const socketDir = join(tmpDir, "bootstrap");
|
|
508
|
+
const socketPath = join(socketDir, "ces.sock");
|
|
509
|
+
mkdirSync(dataDir, { recursive: true });
|
|
510
|
+
mkdirSync(socketDir, { recursive: true });
|
|
511
|
+
|
|
512
|
+
process.env["CES_DATA_DIR"] = dataDir;
|
|
513
|
+
process.env["CES_MODE"] = "managed";
|
|
514
|
+
|
|
515
|
+
controller = new AbortController();
|
|
516
|
+
|
|
517
|
+
const connectionPromise = acceptOneConnection(socketPath, controller.signal);
|
|
518
|
+
clientSocket = await connectToSocket(socketPath);
|
|
519
|
+
const conn = await connectionPromise;
|
|
520
|
+
|
|
521
|
+
serverRpcServer = new CesRpcServer({
|
|
522
|
+
input: conn.readable,
|
|
523
|
+
output: conn.writable,
|
|
524
|
+
handlers: {},
|
|
525
|
+
logger: { log: () => {}, warn: () => {}, error: () => {} },
|
|
526
|
+
signal: controller.signal,
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
const servePromise = serverRpcServer.serve();
|
|
530
|
+
|
|
531
|
+
// Send handshake with wrong version
|
|
532
|
+
sendMessage(clientSocket, {
|
|
533
|
+
type: "handshake_request",
|
|
534
|
+
protocolVersion: "99.99.99",
|
|
535
|
+
sessionId: "bad-version-session",
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
const messages = await readMessages(clientSocket, 1);
|
|
539
|
+
expect(messages.length).toBe(1);
|
|
540
|
+
|
|
541
|
+
const ack = messages[0] as HandshakeAck;
|
|
542
|
+
expect(ack.type).toBe("handshake_ack");
|
|
543
|
+
expect(ack.accepted).toBe(false);
|
|
544
|
+
expect(ack.reason).toMatch(/Unsupported protocol version/);
|
|
545
|
+
expect(ack.protocolVersion).toBe(CES_PROTOCOL_VERSION);
|
|
546
|
+
|
|
547
|
+
clientSocket.end();
|
|
548
|
+
controller.abort();
|
|
549
|
+
await servePromise;
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
test("rejects RPC before handshake over real socket", async () => {
|
|
553
|
+
savedEnv = saveEnv();
|
|
554
|
+
tmpDir = mkdtempSync(join(tmpdir(), "ces-managed-integ-pre-hs-"));
|
|
555
|
+
const dataDir = join(tmpDir, "ces-data");
|
|
556
|
+
const socketDir = join(tmpDir, "bootstrap");
|
|
557
|
+
const socketPath = join(socketDir, "ces.sock");
|
|
558
|
+
mkdirSync(dataDir, { recursive: true });
|
|
559
|
+
mkdirSync(socketDir, { recursive: true });
|
|
560
|
+
|
|
561
|
+
process.env["CES_DATA_DIR"] = dataDir;
|
|
562
|
+
process.env["CES_MODE"] = "managed";
|
|
563
|
+
|
|
564
|
+
controller = new AbortController();
|
|
565
|
+
|
|
566
|
+
const connectionPromise = acceptOneConnection(socketPath, controller.signal);
|
|
567
|
+
clientSocket = await connectToSocket(socketPath);
|
|
568
|
+
const conn = await connectionPromise;
|
|
569
|
+
|
|
570
|
+
const handlers = buildMinimalHandlers(dataDir);
|
|
571
|
+
serverRpcServer = new CesRpcServer({
|
|
572
|
+
input: conn.readable,
|
|
573
|
+
output: conn.writable,
|
|
574
|
+
handlers,
|
|
575
|
+
logger: { log: () => {}, warn: () => {}, error: () => {} },
|
|
576
|
+
signal: controller.signal,
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
const servePromise = serverRpcServer.serve();
|
|
580
|
+
|
|
581
|
+
// Send RPC without handshake
|
|
582
|
+
sendMessage(clientSocket, {
|
|
583
|
+
type: "rpc",
|
|
584
|
+
id: "pre-hs-1",
|
|
585
|
+
kind: "request",
|
|
586
|
+
method: CesRpcMethod.ListGrants,
|
|
587
|
+
payload: {},
|
|
588
|
+
timestamp: new Date().toISOString(),
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
const messages = await readMessages(clientSocket, 1);
|
|
592
|
+
expect(messages.length).toBe(1);
|
|
593
|
+
|
|
594
|
+
const resp = messages[0] as RpcEnvelope & { type: "rpc" };
|
|
595
|
+
expect(resp.id).toBe("pre-hs-1");
|
|
596
|
+
expect(resp.kind).toBe("response");
|
|
597
|
+
const payload = resp.payload as { success: boolean; error: { code: string } };
|
|
598
|
+
expect(payload.error.code).toBe("HANDSHAKE_REQUIRED");
|
|
599
|
+
|
|
600
|
+
clientSocket.end();
|
|
601
|
+
controller.abort();
|
|
602
|
+
await servePromise;
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
test("socket is single-use (second connection attempt fails)", async () => {
|
|
606
|
+
savedEnv = saveEnv();
|
|
607
|
+
tmpDir = mkdtempSync(join(tmpdir(), "ces-managed-integ-single-"));
|
|
608
|
+
const socketDir = join(tmpDir, "bootstrap");
|
|
609
|
+
const socketPath = join(socketDir, "ces.sock");
|
|
610
|
+
mkdirSync(socketDir, { recursive: true });
|
|
611
|
+
|
|
612
|
+
controller = new AbortController();
|
|
613
|
+
|
|
614
|
+
const connectionPromise = acceptOneConnection(socketPath, controller.signal);
|
|
615
|
+
|
|
616
|
+
// First connection succeeds
|
|
617
|
+
clientSocket = await connectToSocket(socketPath);
|
|
618
|
+
const conn = await connectionPromise;
|
|
619
|
+
|
|
620
|
+
// Socket file should be unlinked after the first connection,
|
|
621
|
+
// so a second connection attempt should fail.
|
|
622
|
+
// Use maxRetries: 0 so the ENOENT rejects immediately instead of
|
|
623
|
+
// retrying for ~10 s (which exceeds the 5 s test timeout on slow CI).
|
|
624
|
+
await expect(
|
|
625
|
+
connectToSocket(socketPath, { maxRetries: 0 }),
|
|
626
|
+
).rejects.toThrow();
|
|
627
|
+
|
|
628
|
+
// Clean up
|
|
629
|
+
conn.socket.destroy();
|
|
630
|
+
clientSocket.end();
|
|
631
|
+
controller.abort();
|
|
632
|
+
});
|
|
633
|
+
});
|