@xenosystem/agent-cli 0.5.179 → 0.5.181

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.
Files changed (865) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/index.js +2463 -2461
  3. package/dist/metafile-esm.json +1 -1
  4. package/dist/sdk-build-identity.json +12 -12
  5. package/ownership/ownership-policy.json +99 -20
  6. package/package.json +94 -94
  7. package/node_modules/@xeno-corporation/account/LICENSE +0 -39
  8. package/node_modules/@xeno-corporation/account/README.md +0 -266
  9. package/node_modules/@xeno-corporation/account/dist/chunk-FELZILY4.mjs +0 -60
  10. package/node_modules/@xeno-corporation/account/dist/chunk-FELZILY4.mjs.map +0 -1
  11. package/node_modules/@xeno-corporation/account/dist/client-CVtf6u7F.d.mts +0 -2346
  12. package/node_modules/@xeno-corporation/account/dist/client-CVtf6u7F.d.ts +0 -2346
  13. package/node_modules/@xeno-corporation/account/dist/index.d.mts +0 -110
  14. package/node_modules/@xeno-corporation/account/dist/index.d.ts +0 -110
  15. package/node_modules/@xeno-corporation/account/dist/index.js +0 -4115
  16. package/node_modules/@xeno-corporation/account/dist/index.js.map +0 -1
  17. package/node_modules/@xeno-corporation/account/dist/index.mjs +0 -3967
  18. package/node_modules/@xeno-corporation/account/dist/index.mjs.map +0 -1
  19. package/node_modules/@xeno-corporation/account/dist/node.d.mts +0 -109
  20. package/node_modules/@xeno-corporation/account/dist/node.d.ts +0 -109
  21. package/node_modules/@xeno-corporation/account/dist/node.js +0 -1448
  22. package/node_modules/@xeno-corporation/account/dist/node.js.map +0 -1
  23. package/node_modules/@xeno-corporation/account/dist/node.mjs +0 -1374
  24. package/node_modules/@xeno-corporation/account/dist/node.mjs.map +0 -1
  25. package/node_modules/@xeno-corporation/account/package.json +0 -62
  26. package/node_modules/zod/LICENSE +0 -21
  27. package/node_modules/zod/README.md +0 -218
  28. package/node_modules/zod/compile.cjs +0 -96
  29. package/node_modules/zod/compile.d.cts +0 -1
  30. package/node_modules/zod/compile.d.ts +0 -1
  31. package/node_modules/zod/compile.js +0 -52
  32. package/node_modules/zod/index.cjs +0 -52
  33. package/node_modules/zod/index.d.cts +0 -3
  34. package/node_modules/zod/index.d.ts +0 -3
  35. package/node_modules/zod/index.js +0 -7
  36. package/node_modules/zod/locales/index.cjs +0 -36
  37. package/node_modules/zod/locales/index.d.cts +0 -1
  38. package/node_modules/zod/locales/index.d.ts +0 -1
  39. package/node_modules/zod/locales/index.js +0 -1
  40. package/node_modules/zod/locales/package.json +0 -7
  41. package/node_modules/zod/mini/index.cjs +0 -51
  42. package/node_modules/zod/mini/index.d.cts +0 -3
  43. package/node_modules/zod/mini/index.d.ts +0 -3
  44. package/node_modules/zod/mini/index.js +0 -3
  45. package/node_modules/zod/mini/package.json +0 -7
  46. package/node_modules/zod/package.json +0 -147
  47. package/node_modules/zod/src/compile.ts +0 -56
  48. package/node_modules/zod/src/index.ts +0 -7
  49. package/node_modules/zod/src/locales/index.ts +0 -1
  50. package/node_modules/zod/src/mini/index.ts +0 -3
  51. package/node_modules/zod/src/v3/ZodError.ts +0 -340
  52. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  53. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  54. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  55. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  56. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  57. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  58. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  59. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  60. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  61. package/node_modules/zod/src/v3/errors.ts +0 -13
  62. package/node_modules/zod/src/v3/external.ts +0 -6
  63. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  64. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  65. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  66. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  67. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  68. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  69. package/node_modules/zod/src/v3/index.ts +0 -4
  70. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  71. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  72. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  73. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  74. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  75. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  76. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  77. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  78. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  79. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  80. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  81. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  82. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  83. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  84. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  85. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  86. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  87. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  88. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  89. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  90. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  91. package/node_modules/zod/src/v3/tests/error.test.ts +0 -586
  92. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  93. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  94. package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  95. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  96. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  97. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -128
  98. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  99. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -206
  100. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  101. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  102. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  103. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  104. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  105. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  106. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  107. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  108. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  109. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  110. package/node_modules/zod/src/v3/tests/object.test.ts +0 -431
  111. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  112. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  113. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  114. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  115. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  116. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  117. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  118. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  119. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  120. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -114
  121. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  122. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  123. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  124. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  125. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  126. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  127. package/node_modules/zod/src/v3/tests/string.test.ts +0 -922
  128. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  129. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  130. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  131. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  132. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  133. package/node_modules/zod/src/v3/types.ts +0 -5138
  134. package/node_modules/zod/src/v4/classic/checks.ts +0 -33
  135. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  136. package/node_modules/zod/src/v4/classic/compat.ts +0 -78
  137. package/node_modules/zod/src/v4/classic/deep-partial.ts +0 -76
  138. package/node_modules/zod/src/v4/classic/errors.ts +0 -97
  139. package/node_modules/zod/src/v4/classic/external.ts +0 -57
  140. package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -944
  141. package/node_modules/zod/src/v4/classic/in-out.ts +0 -45
  142. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  143. package/node_modules/zod/src/v4/classic/iso.ts +0 -20
  144. package/node_modules/zod/src/v4/classic/parse.ts +0 -88
  145. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2937
  146. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  147. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -86
  148. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -291
  149. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -402
  150. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  151. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  152. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  153. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -89
  154. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  155. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -604
  156. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  157. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -572
  158. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -704
  159. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  160. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  161. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +0 -76
  162. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  163. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +0 -985
  164. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -92
  165. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -316
  166. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +0 -380
  167. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +0 -32
  168. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -455
  169. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  170. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  171. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -221
  172. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -942
  173. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -305
  174. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -917
  175. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -1108
  176. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  177. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  178. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  179. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -1467
  180. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -391
  181. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  182. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -32
  183. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -67
  184. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +0 -81
  185. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +0 -159
  186. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -958
  187. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +0 -319
  188. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -127
  189. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -334
  190. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +0 -215
  191. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -39
  192. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  193. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -262
  194. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -128
  195. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  196. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  197. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -349
  198. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  199. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  200. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  201. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  202. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -401
  203. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -1006
  204. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +0 -235
  205. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -366
  206. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -497
  207. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  208. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  209. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -144
  210. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -44
  211. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  212. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  213. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  214. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +0 -141
  215. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  216. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -184
  217. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -885
  218. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -707
  219. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +0 -68
  220. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -693
  221. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  222. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -196
  223. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -153
  224. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  225. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1440
  226. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -124
  227. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -812
  228. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  229. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -4733
  230. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  231. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -511
  232. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -310
  233. package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  234. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +0 -645
  235. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  236. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  237. package/node_modules/zod/src/v4/core/api.ts +0 -1875
  238. package/node_modules/zod/src/v4/core/checks.ts +0 -1266
  239. package/node_modules/zod/src/v4/core/compile.ts +0 -2322
  240. package/node_modules/zod/src/v4/core/core.ts +0 -230
  241. package/node_modules/zod/src/v4/core/doc.ts +0 -52
  242. package/node_modules/zod/src/v4/core/errors.ts +0 -543
  243. package/node_modules/zod/src/v4/core/index.ts +0 -19
  244. package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -131
  245. package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -934
  246. package/node_modules/zod/src/v4/core/json-schema.ts +0 -148
  247. package/node_modules/zod/src/v4/core/memoizer.ts +0 -331
  248. package/node_modules/zod/src/v4/core/parse.ts +0 -309
  249. package/node_modules/zod/src/v4/core/regexes.ts +0 -217
  250. package/node_modules/zod/src/v4/core/registries.ts +0 -105
  251. package/node_modules/zod/src/v4/core/schemas.ts +0 -5226
  252. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  253. package/node_modules/zod/src/v4/core/tests/cached.test.ts +0 -54
  254. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +0 -1004
  255. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +0 -445
  256. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +0 -89
  257. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +0 -26
  258. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +0 -34
  259. package/node_modules/zod/src/v4/core/tests/compile.test.ts +0 -2036
  260. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +0 -140
  261. package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  262. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  263. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  264. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -214
  265. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  266. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -180
  267. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  268. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  269. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  270. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  271. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +0 -42
  272. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  273. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +0 -85
  274. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +0 -69
  275. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  276. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  277. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +0 -46
  278. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  279. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  280. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +0 -51
  281. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +0 -133
  282. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -857
  283. package/node_modules/zod/src/v4/core/util.ts +0 -1293
  284. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  285. package/node_modules/zod/src/v4/core/visit.ts +0 -193
  286. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  287. package/node_modules/zod/src/v4/index.ts +0 -4
  288. package/node_modules/zod/src/v4/locales/ar.ts +0 -120
  289. package/node_modules/zod/src/v4/locales/az.ts +0 -116
  290. package/node_modules/zod/src/v4/locales/be.ts +0 -188
  291. package/node_modules/zod/src/v4/locales/bg.ts +0 -133
  292. package/node_modules/zod/src/v4/locales/bn.ts +0 -123
  293. package/node_modules/zod/src/v4/locales/ca.ts +0 -121
  294. package/node_modules/zod/src/v4/locales/ckb.ts +0 -140
  295. package/node_modules/zod/src/v4/locales/cs.ts +0 -123
  296. package/node_modules/zod/src/v4/locales/da.ts +0 -128
  297. package/node_modules/zod/src/v4/locales/de.ts +0 -121
  298. package/node_modules/zod/src/v4/locales/el.ts +0 -124
  299. package/node_modules/zod/src/v4/locales/en.ts +0 -136
  300. package/node_modules/zod/src/v4/locales/eo.ts +0 -123
  301. package/node_modules/zod/src/v4/locales/es.ts +0 -145
  302. package/node_modules/zod/src/v4/locales/fa.ts +0 -131
  303. package/node_modules/zod/src/v4/locales/fi.ts +0 -126
  304. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -121
  305. package/node_modules/zod/src/v4/locales/fr.ts +0 -139
  306. package/node_modules/zod/src/v4/locales/gu.ts +0 -123
  307. package/node_modules/zod/src/v4/locales/he.ts +0 -253
  308. package/node_modules/zod/src/v4/locales/hi.ts +0 -126
  309. package/node_modules/zod/src/v4/locales/hr.ts +0 -135
  310. package/node_modules/zod/src/v4/locales/hu.ts +0 -122
  311. package/node_modules/zod/src/v4/locales/hy.ts +0 -175
  312. package/node_modules/zod/src/v4/locales/id.ts +0 -120
  313. package/node_modules/zod/src/v4/locales/index.ts +0 -63
  314. package/node_modules/zod/src/v4/locales/is.ts +0 -124
  315. package/node_modules/zod/src/v4/locales/it.ts +0 -121
  316. package/node_modules/zod/src/v4/locales/ja.ts +0 -119
  317. package/node_modules/zod/src/v4/locales/ka.ts +0 -128
  318. package/node_modules/zod/src/v4/locales/kh.ts +0 -7
  319. package/node_modules/zod/src/v4/locales/km.ts +0 -124
  320. package/node_modules/zod/src/v4/locales/kn.ts +0 -126
  321. package/node_modules/zod/src/v4/locales/ko.ts +0 -126
  322. package/node_modules/zod/src/v4/locales/lt.ts +0 -243
  323. package/node_modules/zod/src/v4/locales/mk.ts +0 -123
  324. package/node_modules/zod/src/v4/locales/ms.ts +0 -120
  325. package/node_modules/zod/src/v4/locales/ne.ts +0 -128
  326. package/node_modules/zod/src/v4/locales/nl.ts +0 -126
  327. package/node_modules/zod/src/v4/locales/nn.ts +0 -121
  328. package/node_modules/zod/src/v4/locales/no.ts +0 -121
  329. package/node_modules/zod/src/v4/locales/ota.ts +0 -122
  330. package/node_modules/zod/src/v4/locales/pl.ts +0 -123
  331. package/node_modules/zod/src/v4/locales/ps.ts +0 -131
  332. package/node_modules/zod/src/v4/locales/pt-BR.ts +0 -161
  333. package/node_modules/zod/src/v4/locales/pt.ts +0 -159
  334. package/node_modules/zod/src/v4/locales/ro.ts +0 -132
  335. package/node_modules/zod/src/v4/locales/ru.ts +0 -188
  336. package/node_modules/zod/src/v4/locales/sk.ts +0 -123
  337. package/node_modules/zod/src/v4/locales/sl.ts +0 -123
  338. package/node_modules/zod/src/v4/locales/sv.ts +0 -124
  339. package/node_modules/zod/src/v4/locales/ta.ts +0 -123
  340. package/node_modules/zod/src/v4/locales/tg.ts +0 -135
  341. package/node_modules/zod/src/v4/locales/th.ts +0 -124
  342. package/node_modules/zod/src/v4/locales/tk.ts +0 -113
  343. package/node_modules/zod/src/v4/locales/tr.ts +0 -116
  344. package/node_modules/zod/src/v4/locales/ua.ts +0 -7
  345. package/node_modules/zod/src/v4/locales/uk.ts +0 -122
  346. package/node_modules/zod/src/v4/locales/ur.ts +0 -124
  347. package/node_modules/zod/src/v4/locales/uz.ts +0 -120
  348. package/node_modules/zod/src/v4/locales/vi.ts +0 -122
  349. package/node_modules/zod/src/v4/locales/yo.ts +0 -129
  350. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -121
  351. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -120
  352. package/node_modules/zod/src/v4/mini/checks.ts +0 -33
  353. package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  354. package/node_modules/zod/src/v4/mini/deep-partial.ts +0 -73
  355. package/node_modules/zod/src/v4/mini/external.ts +0 -52
  356. package/node_modules/zod/src/v4/mini/in-out.ts +0 -45
  357. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  358. package/node_modules/zod/src/v4/mini/iso.ts +0 -66
  359. package/node_modules/zod/src/v4/mini/parse.ts +0 -16
  360. package/node_modules/zod/src/v4/mini/schemas.ts +0 -2051
  361. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -57
  362. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -190
  363. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  364. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -158
  365. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -582
  366. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -30
  367. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +0 -84
  368. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +0 -54
  369. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -41
  370. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -14
  371. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -1146
  372. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -109
  373. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -292
  374. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  375. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -341
  376. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  377. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -396
  378. package/node_modules/zod/src/v4-mini/index.ts +0 -3
  379. package/node_modules/zod/v3/ZodError.cjs +0 -167
  380. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  381. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  382. package/node_modules/zod/v3/ZodError.js +0 -143
  383. package/node_modules/zod/v3/errors.cjs +0 -36
  384. package/node_modules/zod/v3/errors.d.cts +0 -5
  385. package/node_modules/zod/v3/errors.d.ts +0 -5
  386. package/node_modules/zod/v3/errors.js +0 -9
  387. package/node_modules/zod/v3/external.cjs +0 -41
  388. package/node_modules/zod/v3/external.d.cts +0 -6
  389. package/node_modules/zod/v3/external.d.ts +0 -6
  390. package/node_modules/zod/v3/external.js +0 -6
  391. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -21
  392. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  393. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  394. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  395. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -28
  396. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  397. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  398. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  399. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -143
  400. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  401. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  402. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  403. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -21
  404. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  405. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  406. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  407. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -21
  408. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  409. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  410. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  411. package/node_modules/zod/v3/helpers/util.cjs +0 -156
  412. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  413. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  414. package/node_modules/zod/v3/helpers/util.js +0 -133
  415. package/node_modules/zod/v3/index.cjs +0 -52
  416. package/node_modules/zod/v3/index.d.cts +0 -4
  417. package/node_modules/zod/v3/index.d.ts +0 -4
  418. package/node_modules/zod/v3/index.js +0 -4
  419. package/node_modules/zod/v3/locales/en.cjs +0 -112
  420. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  421. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  422. package/node_modules/zod/v3/locales/en.js +0 -109
  423. package/node_modules/zod/v3/package.json +0 -7
  424. package/node_modules/zod/v3/standard-schema.cjs +0 -21
  425. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  426. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  427. package/node_modules/zod/v3/standard-schema.js +0 -1
  428. package/node_modules/zod/v3/types.cjs +0 -3798
  429. package/node_modules/zod/v3/types.d.cts +0 -1034
  430. package/node_modules/zod/v3/types.d.ts +0 -1034
  431. package/node_modules/zod/v3/types.js +0 -3697
  432. package/node_modules/zod/v4/classic/checks.cjs +0 -53
  433. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  434. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  435. package/node_modules/zod/v4/classic/checks.js +0 -1
  436. package/node_modules/zod/v4/classic/coerce.cjs +0 -66
  437. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  438. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  439. package/node_modules/zod/v4/classic/coerce.js +0 -17
  440. package/node_modules/zod/v4/classic/compat.cjs +0 -80
  441. package/node_modules/zod/v4/classic/compat.d.cts +0 -48
  442. package/node_modules/zod/v4/classic/compat.d.ts +0 -48
  443. package/node_modules/zod/v4/classic/compat.js +0 -31
  444. package/node_modules/zod/v4/classic/deep-partial.cjs +0 -58
  445. package/node_modules/zod/v4/classic/deep-partial.d.cts +0 -14
  446. package/node_modules/zod/v4/classic/deep-partial.d.ts +0 -14
  447. package/node_modules/zod/v4/classic/deep-partial.js +0 -13
  448. package/node_modules/zod/v4/classic/errors.cjs +0 -102
  449. package/node_modules/zod/v4/classic/errors.d.cts +0 -29
  450. package/node_modules/zod/v4/classic/errors.d.ts +0 -29
  451. package/node_modules/zod/v4/classic/errors.js +0 -57
  452. package/node_modules/zod/v4/classic/external.cjs +0 -97
  453. package/node_modules/zod/v4/classic/external.d.cts +0 -19
  454. package/node_modules/zod/v4/classic/external.d.ts +0 -19
  455. package/node_modules/zod/v4/classic/external.js +0 -17
  456. package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -926
  457. package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  458. package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  459. package/node_modules/zod/v4/classic/from-json-schema.js +0 -881
  460. package/node_modules/zod/v4/classic/in-out.cjs +0 -82
  461. package/node_modules/zod/v4/classic/in-out.d.cts +0 -8
  462. package/node_modules/zod/v4/classic/in-out.d.ts +0 -8
  463. package/node_modules/zod/v4/classic/in-out.js +0 -36
  464. package/node_modules/zod/v4/classic/index.cjs +0 -52
  465. package/node_modules/zod/v4/classic/index.d.cts +0 -3
  466. package/node_modules/zod/v4/classic/index.d.ts +0 -3
  467. package/node_modules/zod/v4/classic/index.js +0 -4
  468. package/node_modules/zod/v4/classic/iso.cjs +0 -68
  469. package/node_modules/zod/v4/classic/iso.d.cts +0 -7
  470. package/node_modules/zod/v4/classic/iso.d.ts +0 -7
  471. package/node_modules/zod/v4/classic/iso.js +0 -15
  472. package/node_modules/zod/v4/classic/package.json +0 -7
  473. package/node_modules/zod/v4/classic/parse.cjs +0 -63
  474. package/node_modules/zod/v4/classic/parse.d.cts +0 -44
  475. package/node_modules/zod/v4/classic/parse.d.ts +0 -44
  476. package/node_modules/zod/v4/classic/parse.js +0 -16
  477. package/node_modules/zod/v4/classic/schemas.cjs +0 -1676
  478. package/node_modules/zod/v4/classic/schemas.d.cts +0 -816
  479. package/node_modules/zod/v4/classic/schemas.d.ts +0 -816
  480. package/node_modules/zod/v4/classic/schemas.js +0 -1535
  481. package/node_modules/zod/v4/core/api.cjs +0 -1269
  482. package/node_modules/zod/v4/core/api.d.cts +0 -335
  483. package/node_modules/zod/v4/core/api.d.ts +0 -335
  484. package/node_modules/zod/v4/core/api.js +0 -1107
  485. package/node_modules/zod/v4/core/checks.cjs +0 -561
  486. package/node_modules/zod/v4/core/checks.d.cts +0 -294
  487. package/node_modules/zod/v4/core/checks.d.ts +0 -294
  488. package/node_modules/zod/v4/core/checks.js +0 -516
  489. package/node_modules/zod/v4/core/compile.cjs +0 -1916
  490. package/node_modules/zod/v4/core/compile.d.cts +0 -65
  491. package/node_modules/zod/v4/core/compile.d.ts +0 -65
  492. package/node_modules/zod/v4/core/compile.js +0 -1866
  493. package/node_modules/zod/v4/core/core.cjs +0 -167
  494. package/node_modules/zod/v4/core/core.d.cts +0 -82
  495. package/node_modules/zod/v4/core/core.d.ts +0 -82
  496. package/node_modules/zod/v4/core/core.js +0 -141
  497. package/node_modules/zod/v4/core/doc.cjs +0 -61
  498. package/node_modules/zod/v4/core/doc.d.cts +0 -16
  499. package/node_modules/zod/v4/core/doc.d.ts +0 -16
  500. package/node_modules/zod/v4/core/doc.js +0 -38
  501. package/node_modules/zod/v4/core/errors.cjs +0 -317
  502. package/node_modules/zod/v4/core/errors.d.cts +0 -225
  503. package/node_modules/zod/v4/core/errors.d.ts +0 -225
  504. package/node_modules/zod/v4/core/errors.js +0 -267
  505. package/node_modules/zod/v4/core/index.cjs +0 -70
  506. package/node_modules/zod/v4/core/index.d.cts +0 -19
  507. package/node_modules/zod/v4/core/index.d.ts +0 -19
  508. package/node_modules/zod/v4/core/index.js +0 -19
  509. package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -122
  510. package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  511. package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  512. package/node_modules/zod/v4/core/json-schema-generator.js +0 -99
  513. package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -929
  514. package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -65
  515. package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -65
  516. package/node_modules/zod/v4/core/json-schema-processors.js +0 -843
  517. package/node_modules/zod/v4/core/json-schema.cjs +0 -21
  518. package/node_modules/zod/v4/core/json-schema.d.cts +0 -89
  519. package/node_modules/zod/v4/core/json-schema.d.ts +0 -89
  520. package/node_modules/zod/v4/core/json-schema.js +0 -1
  521. package/node_modules/zod/v4/core/memoizer.cjs +0 -360
  522. package/node_modules/zod/v4/core/memoizer.d.cts +0 -15
  523. package/node_modules/zod/v4/core/memoizer.d.ts +0 -15
  524. package/node_modules/zod/v4/core/memoizer.js +0 -311
  525. package/node_modules/zod/v4/core/package.json +0 -7
  526. package/node_modules/zod/v4/core/parse.cjs +0 -233
  527. package/node_modules/zod/v4/core/parse.d.cts +0 -52
  528. package/node_modules/zod/v4/core/parse.d.ts +0 -52
  529. package/node_modules/zod/v4/core/parse.js +0 -175
  530. package/node_modules/zod/v4/core/regexes.cjs +0 -209
  531. package/node_modules/zod/v4/core/regexes.d.cts +0 -90
  532. package/node_modules/zod/v4/core/regexes.d.ts +0 -90
  533. package/node_modules/zod/v4/core/regexes.js +0 -156
  534. package/node_modules/zod/v4/core/registries.cjs +0 -75
  535. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  536. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  537. package/node_modules/zod/v4/core/registries.js +0 -51
  538. package/node_modules/zod/v4/core/schemas.cjs +0 -2699
  539. package/node_modules/zod/v4/core/schemas.d.cts +0 -1275
  540. package/node_modules/zod/v4/core/schemas.d.ts +0 -1275
  541. package/node_modules/zod/v4/core/schemas.js +0 -2636
  542. package/node_modules/zod/v4/core/standard-schema.cjs +0 -21
  543. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  544. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  545. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  546. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -681
  547. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -154
  548. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -154
  549. package/node_modules/zod/v4/core/to-json-schema.js +0 -651
  550. package/node_modules/zod/v4/core/util.cjs +0 -964
  551. package/node_modules/zod/v4/core/util.d.cts +0 -280
  552. package/node_modules/zod/v4/core/util.d.ts +0 -280
  553. package/node_modules/zod/v4/core/util.js +0 -873
  554. package/node_modules/zod/v4/core/versions.cjs +0 -27
  555. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  556. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  557. package/node_modules/zod/v4/core/versions.js +0 -5
  558. package/node_modules/zod/v4/core/visit.cjs +0 -214
  559. package/node_modules/zod/v4/core/visit.d.cts +0 -30
  560. package/node_modules/zod/v4/core/visit.d.ts +0 -30
  561. package/node_modules/zod/v4/core/visit.js +0 -169
  562. package/node_modules/zod/v4/index.cjs +0 -51
  563. package/node_modules/zod/v4/index.d.cts +0 -3
  564. package/node_modules/zod/v4/index.d.ts +0 -3
  565. package/node_modules/zod/v4/index.js +0 -4
  566. package/node_modules/zod/v4/locales/ar.cjs +0 -138
  567. package/node_modules/zod/v4/locales/ar.d.cts +0 -5
  568. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  569. package/node_modules/zod/v4/locales/ar.js +0 -111
  570. package/node_modules/zod/v4/locales/az.cjs +0 -137
  571. package/node_modules/zod/v4/locales/az.d.cts +0 -5
  572. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  573. package/node_modules/zod/v4/locales/az.js +0 -110
  574. package/node_modules/zod/v4/locales/be.cjs +0 -195
  575. package/node_modules/zod/v4/locales/be.d.cts +0 -5
  576. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  577. package/node_modules/zod/v4/locales/be.js +0 -168
  578. package/node_modules/zod/v4/locales/bg.cjs +0 -152
  579. package/node_modules/zod/v4/locales/bg.d.cts +0 -5
  580. package/node_modules/zod/v4/locales/bg.d.ts +0 -4
  581. package/node_modules/zod/v4/locales/bg.js +0 -125
  582. package/node_modules/zod/v4/locales/bn.cjs +0 -140
  583. package/node_modules/zod/v4/locales/bn.d.cts +0 -5
  584. package/node_modules/zod/v4/locales/bn.d.ts +0 -4
  585. package/node_modules/zod/v4/locales/bn.js +0 -113
  586. package/node_modules/zod/v4/locales/ca.cjs +0 -139
  587. package/node_modules/zod/v4/locales/ca.d.cts +0 -5
  588. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  589. package/node_modules/zod/v4/locales/ca.js +0 -112
  590. package/node_modules/zod/v4/locales/ckb.cjs +0 -160
  591. package/node_modules/zod/v4/locales/ckb.d.cts +0 -5
  592. package/node_modules/zod/v4/locales/ckb.d.ts +0 -4
  593. package/node_modules/zod/v4/locales/ckb.js +0 -133
  594. package/node_modules/zod/v4/locales/cs.cjs +0 -143
  595. package/node_modules/zod/v4/locales/cs.d.cts +0 -5
  596. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  597. package/node_modules/zod/v4/locales/cs.js +0 -116
  598. package/node_modules/zod/v4/locales/da.cjs +0 -147
  599. package/node_modules/zod/v4/locales/da.d.cts +0 -5
  600. package/node_modules/zod/v4/locales/da.d.ts +0 -4
  601. package/node_modules/zod/v4/locales/da.js +0 -120
  602. package/node_modules/zod/v4/locales/de.cjs +0 -140
  603. package/node_modules/zod/v4/locales/de.d.cts +0 -5
  604. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  605. package/node_modules/zod/v4/locales/de.js +0 -113
  606. package/node_modules/zod/v4/locales/el.cjs +0 -139
  607. package/node_modules/zod/v4/locales/el.d.cts +0 -5
  608. package/node_modules/zod/v4/locales/el.d.ts +0 -4
  609. package/node_modules/zod/v4/locales/el.js +0 -112
  610. package/node_modules/zod/v4/locales/en.cjs +0 -152
  611. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  612. package/node_modules/zod/v4/locales/en.d.ts +0 -4
  613. package/node_modules/zod/v4/locales/en.js +0 -125
  614. package/node_modules/zod/v4/locales/eo.cjs +0 -141
  615. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  616. package/node_modules/zod/v4/locales/eo.d.ts +0 -4
  617. package/node_modules/zod/v4/locales/eo.js +0 -114
  618. package/node_modules/zod/v4/locales/es.cjs +0 -163
  619. package/node_modules/zod/v4/locales/es.d.cts +0 -5
  620. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  621. package/node_modules/zod/v4/locales/es.js +0 -136
  622. package/node_modules/zod/v4/locales/fa.cjs +0 -146
  623. package/node_modules/zod/v4/locales/fa.d.cts +0 -5
  624. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  625. package/node_modules/zod/v4/locales/fa.js +0 -119
  626. package/node_modules/zod/v4/locales/fi.cjs +0 -144
  627. package/node_modules/zod/v4/locales/fi.d.cts +0 -5
  628. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  629. package/node_modules/zod/v4/locales/fi.js +0 -117
  630. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -139
  631. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  632. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  633. package/node_modules/zod/v4/locales/fr-CA.js +0 -112
  634. package/node_modules/zod/v4/locales/fr.cjs +0 -156
  635. package/node_modules/zod/v4/locales/fr.d.cts +0 -5
  636. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  637. package/node_modules/zod/v4/locales/fr.js +0 -129
  638. package/node_modules/zod/v4/locales/gu.cjs +0 -140
  639. package/node_modules/zod/v4/locales/gu.d.cts +0 -5
  640. package/node_modules/zod/v4/locales/gu.d.ts +0 -4
  641. package/node_modules/zod/v4/locales/gu.js +0 -113
  642. package/node_modules/zod/v4/locales/he.cjs +0 -248
  643. package/node_modules/zod/v4/locales/he.d.cts +0 -5
  644. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  645. package/node_modules/zod/v4/locales/he.js +0 -221
  646. package/node_modules/zod/v4/locales/hi.cjs +0 -138
  647. package/node_modules/zod/v4/locales/hi.d.cts +0 -5
  648. package/node_modules/zod/v4/locales/hi.d.ts +0 -4
  649. package/node_modules/zod/v4/locales/hi.js +0 -111
  650. package/node_modules/zod/v4/locales/hr.cjs +0 -153
  651. package/node_modules/zod/v4/locales/hr.d.cts +0 -5
  652. package/node_modules/zod/v4/locales/hr.d.ts +0 -4
  653. package/node_modules/zod/v4/locales/hr.js +0 -126
  654. package/node_modules/zod/v4/locales/hu.cjs +0 -140
  655. package/node_modules/zod/v4/locales/hu.d.cts +0 -5
  656. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  657. package/node_modules/zod/v4/locales/hu.js +0 -113
  658. package/node_modules/zod/v4/locales/hy.cjs +0 -185
  659. package/node_modules/zod/v4/locales/hy.d.cts +0 -5
  660. package/node_modules/zod/v4/locales/hy.d.ts +0 -4
  661. package/node_modules/zod/v4/locales/hy.js +0 -158
  662. package/node_modules/zod/v4/locales/id.cjs +0 -138
  663. package/node_modules/zod/v4/locales/id.d.cts +0 -5
  664. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  665. package/node_modules/zod/v4/locales/id.js +0 -111
  666. package/node_modules/zod/v4/locales/index.cjs +0 -152
  667. package/node_modules/zod/v4/locales/index.d.cts +0 -63
  668. package/node_modules/zod/v4/locales/index.d.ts +0 -63
  669. package/node_modules/zod/v4/locales/index.js +0 -63
  670. package/node_modules/zod/v4/locales/is.cjs +0 -141
  671. package/node_modules/zod/v4/locales/is.d.cts +0 -5
  672. package/node_modules/zod/v4/locales/is.d.ts +0 -4
  673. package/node_modules/zod/v4/locales/is.js +0 -114
  674. package/node_modules/zod/v4/locales/it.cjs +0 -140
  675. package/node_modules/zod/v4/locales/it.d.cts +0 -5
  676. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  677. package/node_modules/zod/v4/locales/it.js +0 -113
  678. package/node_modules/zod/v4/locales/ja.cjs +0 -139
  679. package/node_modules/zod/v4/locales/ja.d.cts +0 -5
  680. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  681. package/node_modules/zod/v4/locales/ja.js +0 -112
  682. package/node_modules/zod/v4/locales/ka.cjs +0 -144
  683. package/node_modules/zod/v4/locales/ka.d.cts +0 -5
  684. package/node_modules/zod/v4/locales/ka.d.ts +0 -4
  685. package/node_modules/zod/v4/locales/ka.js +0 -117
  686. package/node_modules/zod/v4/locales/kh.cjs +0 -12
  687. package/node_modules/zod/v4/locales/kh.d.cts +0 -5
  688. package/node_modules/zod/v4/locales/kh.d.ts +0 -5
  689. package/node_modules/zod/v4/locales/kh.js +0 -5
  690. package/node_modules/zod/v4/locales/km.cjs +0 -142
  691. package/node_modules/zod/v4/locales/km.d.cts +0 -5
  692. package/node_modules/zod/v4/locales/km.d.ts +0 -4
  693. package/node_modules/zod/v4/locales/km.js +0 -115
  694. package/node_modules/zod/v4/locales/kn.cjs +0 -143
  695. package/node_modules/zod/v4/locales/kn.d.cts +0 -5
  696. package/node_modules/zod/v4/locales/kn.d.ts +0 -4
  697. package/node_modules/zod/v4/locales/kn.js +0 -116
  698. package/node_modules/zod/v4/locales/ko.cjs +0 -143
  699. package/node_modules/zod/v4/locales/ko.d.cts +0 -5
  700. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  701. package/node_modules/zod/v4/locales/ko.js +0 -116
  702. package/node_modules/zod/v4/locales/lt.cjs +0 -234
  703. package/node_modules/zod/v4/locales/lt.d.cts +0 -5
  704. package/node_modules/zod/v4/locales/lt.d.ts +0 -4
  705. package/node_modules/zod/v4/locales/lt.js +0 -207
  706. package/node_modules/zod/v4/locales/mk.cjs +0 -141
  707. package/node_modules/zod/v4/locales/mk.d.cts +0 -5
  708. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  709. package/node_modules/zod/v4/locales/mk.js +0 -114
  710. package/node_modules/zod/v4/locales/ms.cjs +0 -139
  711. package/node_modules/zod/v4/locales/ms.d.cts +0 -5
  712. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  713. package/node_modules/zod/v4/locales/ms.js +0 -112
  714. package/node_modules/zod/v4/locales/ne.cjs +0 -138
  715. package/node_modules/zod/v4/locales/ne.d.cts +0 -5
  716. package/node_modules/zod/v4/locales/ne.d.ts +0 -4
  717. package/node_modules/zod/v4/locales/ne.js +0 -111
  718. package/node_modules/zod/v4/locales/nl.cjs +0 -142
  719. package/node_modules/zod/v4/locales/nl.d.cts +0 -5
  720. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  721. package/node_modules/zod/v4/locales/nl.js +0 -115
  722. package/node_modules/zod/v4/locales/nn.cjs +0 -140
  723. package/node_modules/zod/v4/locales/nn.d.cts +0 -5
  724. package/node_modules/zod/v4/locales/nn.d.ts +0 -4
  725. package/node_modules/zod/v4/locales/nn.js +0 -113
  726. package/node_modules/zod/v4/locales/no.cjs +0 -140
  727. package/node_modules/zod/v4/locales/no.d.cts +0 -5
  728. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  729. package/node_modules/zod/v4/locales/no.js +0 -113
  730. package/node_modules/zod/v4/locales/ota.cjs +0 -141
  731. package/node_modules/zod/v4/locales/ota.d.cts +0 -5
  732. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  733. package/node_modules/zod/v4/locales/ota.js +0 -114
  734. package/node_modules/zod/v4/locales/package.json +0 -7
  735. package/node_modules/zod/v4/locales/pl.cjs +0 -141
  736. package/node_modules/zod/v4/locales/pl.d.cts +0 -5
  737. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  738. package/node_modules/zod/v4/locales/pl.js +0 -114
  739. package/node_modules/zod/v4/locales/ps.cjs +0 -146
  740. package/node_modules/zod/v4/locales/ps.d.cts +0 -5
  741. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  742. package/node_modules/zod/v4/locales/ps.js +0 -119
  743. package/node_modules/zod/v4/locales/pt-BR.cjs +0 -170
  744. package/node_modules/zod/v4/locales/pt-BR.d.cts +0 -5
  745. package/node_modules/zod/v4/locales/pt-BR.d.ts +0 -4
  746. package/node_modules/zod/v4/locales/pt-BR.js +0 -143
  747. package/node_modules/zod/v4/locales/pt.cjs +0 -169
  748. package/node_modules/zod/v4/locales/pt.d.cts +0 -5
  749. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  750. package/node_modules/zod/v4/locales/pt.js +0 -142
  751. package/node_modules/zod/v4/locales/ro.cjs +0 -149
  752. package/node_modules/zod/v4/locales/ro.d.cts +0 -5
  753. package/node_modules/zod/v4/locales/ro.d.ts +0 -4
  754. package/node_modules/zod/v4/locales/ro.js +0 -122
  755. package/node_modules/zod/v4/locales/ru.cjs +0 -195
  756. package/node_modules/zod/v4/locales/ru.d.cts +0 -5
  757. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  758. package/node_modules/zod/v4/locales/ru.js +0 -168
  759. package/node_modules/zod/v4/locales/sk.cjs +0 -143
  760. package/node_modules/zod/v4/locales/sk.d.cts +0 -5
  761. package/node_modules/zod/v4/locales/sk.d.ts +0 -4
  762. package/node_modules/zod/v4/locales/sk.js +0 -116
  763. package/node_modules/zod/v4/locales/sl.cjs +0 -141
  764. package/node_modules/zod/v4/locales/sl.d.cts +0 -5
  765. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  766. package/node_modules/zod/v4/locales/sl.js +0 -114
  767. package/node_modules/zod/v4/locales/sv.cjs +0 -142
  768. package/node_modules/zod/v4/locales/sv.d.cts +0 -5
  769. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  770. package/node_modules/zod/v4/locales/sv.js +0 -115
  771. package/node_modules/zod/v4/locales/ta.cjs +0 -142
  772. package/node_modules/zod/v4/locales/ta.d.cts +0 -5
  773. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  774. package/node_modules/zod/v4/locales/ta.js +0 -115
  775. package/node_modules/zod/v4/locales/tg.cjs +0 -144
  776. package/node_modules/zod/v4/locales/tg.d.cts +0 -5
  777. package/node_modules/zod/v4/locales/tg.d.ts +0 -4
  778. package/node_modules/zod/v4/locales/tg.js +0 -117
  779. package/node_modules/zod/v4/locales/th.cjs +0 -142
  780. package/node_modules/zod/v4/locales/th.d.cts +0 -5
  781. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  782. package/node_modules/zod/v4/locales/th.js +0 -115
  783. package/node_modules/zod/v4/locales/tk.cjs +0 -134
  784. package/node_modules/zod/v4/locales/tk.d.cts +0 -5
  785. package/node_modules/zod/v4/locales/tk.d.ts +0 -4
  786. package/node_modules/zod/v4/locales/tk.js +0 -107
  787. package/node_modules/zod/v4/locales/tr.cjs +0 -137
  788. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  789. package/node_modules/zod/v4/locales/tr.d.ts +0 -4
  790. package/node_modules/zod/v4/locales/tr.js +0 -110
  791. package/node_modules/zod/v4/locales/ua.cjs +0 -12
  792. package/node_modules/zod/v4/locales/ua.d.cts +0 -5
  793. package/node_modules/zod/v4/locales/ua.d.ts +0 -5
  794. package/node_modules/zod/v4/locales/ua.js +0 -5
  795. package/node_modules/zod/v4/locales/uk.cjs +0 -140
  796. package/node_modules/zod/v4/locales/uk.d.cts +0 -5
  797. package/node_modules/zod/v4/locales/uk.d.ts +0 -4
  798. package/node_modules/zod/v4/locales/uk.js +0 -113
  799. package/node_modules/zod/v4/locales/ur.cjs +0 -142
  800. package/node_modules/zod/v4/locales/ur.d.cts +0 -5
  801. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  802. package/node_modules/zod/v4/locales/ur.js +0 -115
  803. package/node_modules/zod/v4/locales/uz.cjs +0 -140
  804. package/node_modules/zod/v4/locales/uz.d.cts +0 -5
  805. package/node_modules/zod/v4/locales/uz.d.ts +0 -4
  806. package/node_modules/zod/v4/locales/uz.js +0 -113
  807. package/node_modules/zod/v4/locales/vi.cjs +0 -140
  808. package/node_modules/zod/v4/locales/vi.d.cts +0 -5
  809. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  810. package/node_modules/zod/v4/locales/vi.js +0 -113
  811. package/node_modules/zod/v4/locales/yo.cjs +0 -139
  812. package/node_modules/zod/v4/locales/yo.d.cts +0 -5
  813. package/node_modules/zod/v4/locales/yo.d.ts +0 -4
  814. package/node_modules/zod/v4/locales/yo.js +0 -112
  815. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -141
  816. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  817. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  818. package/node_modules/zod/v4/locales/zh-CN.js +0 -114
  819. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -139
  820. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  821. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  822. package/node_modules/zod/v4/locales/zh-TW.js +0 -112
  823. package/node_modules/zod/v4/mini/checks.cjs +0 -54
  824. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  825. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  826. package/node_modules/zod/v4/mini/checks.js +0 -1
  827. package/node_modules/zod/v4/mini/coerce.cjs +0 -71
  828. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  829. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  830. package/node_modules/zod/v4/mini/coerce.js +0 -22
  831. package/node_modules/zod/v4/mini/deep-partial.cjs +0 -58
  832. package/node_modules/zod/v4/mini/deep-partial.d.cts +0 -14
  833. package/node_modules/zod/v4/mini/deep-partial.d.ts +0 -14
  834. package/node_modules/zod/v4/mini/deep-partial.js +0 -13
  835. package/node_modules/zod/v4/mini/external.cjs +0 -95
  836. package/node_modules/zod/v4/mini/external.d.cts +0 -16
  837. package/node_modules/zod/v4/mini/external.d.ts +0 -16
  838. package/node_modules/zod/v4/mini/external.js +0 -16
  839. package/node_modules/zod/v4/mini/in-out.cjs +0 -82
  840. package/node_modules/zod/v4/mini/in-out.d.cts +0 -8
  841. package/node_modules/zod/v4/mini/in-out.d.ts +0 -8
  842. package/node_modules/zod/v4/mini/in-out.js +0 -36
  843. package/node_modules/zod/v4/mini/index.cjs +0 -51
  844. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  845. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  846. package/node_modules/zod/v4/mini/index.js +0 -3
  847. package/node_modules/zod/v4/mini/iso.cjs +0 -83
  848. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  849. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  850. package/node_modules/zod/v4/mini/iso.js +0 -34
  851. package/node_modules/zod/v4/mini/package.json +0 -7
  852. package/node_modules/zod/v4/mini/parse.cjs +0 -37
  853. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  854. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  855. package/node_modules/zod/v4/mini/parse.js +0 -1
  856. package/node_modules/zod/v4/mini/schemas.cjs +0 -1147
  857. package/node_modules/zod/v4/mini/schemas.d.cts +0 -480
  858. package/node_modules/zod/v4/mini/schemas.d.ts +0 -480
  859. package/node_modules/zod/v4/mini/schemas.js +0 -1002
  860. package/node_modules/zod/v4/package.json +0 -7
  861. package/node_modules/zod/v4-mini/index.cjs +0 -51
  862. package/node_modules/zod/v4-mini/index.d.cts +0 -3
  863. package/node_modules/zod/v4-mini/index.d.ts +0 -3
  864. package/node_modules/zod/v4-mini/index.js +0 -3
  865. package/node_modules/zod/v4-mini/package.json +0 -7
@@ -1,1448 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/node.ts
32
- var node_exports = {};
33
- __export(node_exports, {
34
- createLinuxAccountHost: () => createLinuxAccountHost,
35
- createNodeDpopSigner: () => createNodeDpopSigner,
36
- createWindowsAccountHost: () => createWindowsAccountHost,
37
- startNativeSignIn: () => startNativeSignIn
38
- });
39
- module.exports = __toCommonJS(node_exports);
40
- var import_node_crypto4 = __toESM(require("crypto"));
41
-
42
- // src/dpop.ts
43
- function normalizeDpopHtu(value) {
44
- const url = new URL(value);
45
- if (url.protocol !== "https:") throw new Error("DPoP htu must use HTTPS");
46
- url.hash = "";
47
- url.search = "";
48
- url.username = "";
49
- url.password = "";
50
- url.hostname = url.hostname.toLowerCase();
51
- if (url.port === "443") url.port = "";
52
- return url.toString();
53
- }
54
- __name(normalizeDpopHtu, "normalizeDpopHtu");
55
-
56
- // src/nativeSignIn.ts
57
- var import_node_crypto = require("crypto");
58
- var import_node_http = require("http");
59
-
60
- // src/errors.ts
61
- var AccountError = class extends Error {
62
- static {
63
- __name(this, "AccountError");
64
- }
65
- code;
66
- httpStatus;
67
- retryable;
68
- retryAfterMs;
69
- oauthError;
70
- constructor(args) {
71
- super(args.message);
72
- this.name = "AccountError";
73
- this.code = args.code;
74
- this.httpStatus = args.httpStatus ?? null;
75
- this.retryable = args.retryable ?? defaultRetryable(args.code);
76
- this.retryAfterMs = args.retryAfterMs ?? null;
77
- this.oauthError = args.oauthError ?? null;
78
- }
79
- };
80
- function defaultRetryable(code) {
81
- return code === "UNREACHABLE" || code === "RATE_LIMITED" || code === "PLATFORM_ERROR";
82
- }
83
- __name(defaultRetryable, "defaultRetryable");
84
-
85
- // src/nativeSignIn.ts
86
- var activeClients = /* @__PURE__ */ new WeakSet();
87
- var failure = /* @__PURE__ */ __name((message) => new AccountError({
88
- code: "INVALID_TOKEN",
89
- message,
90
- retryable: false
91
- }), "failure");
92
- async function startNativeSignIn(client, options = {}) {
93
- const timeoutMs = options.timeoutMs ?? 3e5;
94
- if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 6e5) throw failure("Invalid native sign-in deadline");
95
- if (options.signal?.aborted) throw failure("Native sign-in cancelled");
96
- if (activeClients.has(client)) throw failure("Native sign-in already active");
97
- activeClients.add(client);
98
- let phase = "waiting";
99
- let expectedState;
100
- let flow;
101
- let redirectUri = "";
102
- let timer;
103
- let resolveCompletion;
104
- let rejectCompletion;
105
- const completion = new Promise((resolve, reject) => {
106
- resolveCompletion = resolve;
107
- rejectCompletion = reject;
108
- });
109
- void completion.catch(() => {
110
- });
111
- let closing;
112
- const server = (0, import_node_http.createServer)({
113
- maxHeaderSize: 8192
114
- }, (request, response) => {
115
- const reply = /* @__PURE__ */ __name((status, message) => {
116
- response.writeHead(status, {
117
- "content-type": "text/plain; charset=utf-8",
118
- "cache-control": "no-store",
119
- "content-security-policy": "default-src 'none'; frame-ancestors 'none'",
120
- "referrer-policy": "no-referrer",
121
- "x-content-type-options": "nosniff",
122
- connection: "close"
123
- });
124
- response.end(message);
125
- }, "reply");
126
- const expected = new URL(redirectUri || "http://127.0.0.1/callback");
127
- if (request.method !== "GET" || request.headers.host !== expected.host || request.headers.origin !== void 0 || request.headers["transfer-encoding"] !== void 0 || Number(request.headers["content-length"] ?? 0) !== 0 || !request.url || request.url.length > 8192 || !request.url.startsWith("/callback?")) {
128
- reply(400, "Invalid sign-in callback.");
129
- return;
130
- }
131
- const callback = new URL(request.url, expected.origin);
132
- const states = callback.searchParams.getAll("state");
133
- const codes = callback.searchParams.getAll("code");
134
- const errors = callback.searchParams.getAll("error");
135
- const sameState = states.length === 1 && expectedState !== void 0 && Buffer.byteLength(states[0]) === Buffer.byteLength(expectedState) && (0, import_node_crypto.timingSafeEqual)(Buffer.from(states[0]), Buffer.from(expectedState));
136
- if (callback.pathname !== "/callback" || !sameState || !flow || phase !== "waiting" || !(codes.length === 1 && codes[0] && errors.length === 0 || errors.length === 1 && errors[0] && codes.length === 0)) {
137
- reply(400, "Invalid or expired sign-in callback.");
138
- return;
139
- }
140
- expectedState = void 0;
141
- clearTimeout(timer);
142
- options.signal?.removeEventListener("abort", abort);
143
- if (errors.length) {
144
- reply(200, "Sign-in was not completed. Return to the application.");
145
- void finish(failure("Native sign-in was refused by the authorization service"));
146
- return;
147
- }
148
- phase = "exchanging";
149
- reply(200, "Authorization received. Return to the application to verify sign-in status.");
150
- const selected = flow;
151
- flow = void 0;
152
- void stopListener();
153
- void Promise.resolve().then(() => client.completeSignIn({
154
- code: codes[0],
155
- codeVerifier: selected.pkce.verifier,
156
- expectedNonce: selected.nonce,
157
- expectedScopes: options.scopes,
158
- redirectUri
159
- })).then(() => finish(), () => finish(failure("Native sign-in exchange or protected persistence failed; inspect account status before retrying")));
160
- });
161
- server.maxConnections = 16;
162
- server.headersTimeout = 5e3;
163
- server.requestTimeout = 5e3;
164
- server.setTimeout(5e3);
165
- server.on("timeout", (socket) => socket.destroy());
166
- function stopListener() {
167
- closing ??= new Promise((resolve) => {
168
- server.close(() => resolve());
169
- server.closeIdleConnections();
170
- setImmediate(() => server.closeAllConnections());
171
- });
172
- return closing;
173
- }
174
- __name(stopListener, "stopListener");
175
- async function finish(error) {
176
- if (phase === "settled") return;
177
- phase = "settled";
178
- expectedState = void 0;
179
- flow = void 0;
180
- clearTimeout(timer);
181
- options.signal?.removeEventListener("abort", abort);
182
- await stopListener();
183
- activeClients.delete(client);
184
- if (error) rejectCompletion(error);
185
- else resolveCompletion();
186
- }
187
- __name(finish, "finish");
188
- function abort() {
189
- if (phase === "waiting") void finish(failure("Native sign-in cancelled"));
190
- }
191
- __name(abort, "abort");
192
- try {
193
- await new Promise((resolve, reject) => {
194
- server.once("error", reject);
195
- server.listen(0, "127.0.0.1", () => {
196
- server.removeListener("error", reject);
197
- resolve();
198
- });
199
- });
200
- server.on("error", () => {
201
- if (phase === "waiting") void finish(failure("Native sign-in listener failed"));
202
- });
203
- redirectUri = `http://127.0.0.1:${server.address().port}/callback`;
204
- flow = await client.beginSignIn({
205
- redirectUri,
206
- scopes: options.scopes
207
- });
208
- if (phase !== "waiting") throw failure("Native sign-in startup was interrupted");
209
- expectedState = flow.state;
210
- const authorization = new URL(flow.url);
211
- if (authorization.protocol !== "https:" || authorization.username || authorization.password || !/^[A-Za-z0-9_-]{24,128}$/.test(expectedState) || authorization.searchParams.get("redirect_uri") !== redirectUri || authorization.searchParams.get("state") !== expectedState || authorization.searchParams.get("code_challenge_method") !== "S256") throw failure("Invalid native authorization request");
212
- const expiresAt = new Date(Date.now() + timeoutMs);
213
- timer = setTimeout(() => {
214
- if (phase === "waiting") void finish(failure("Native sign-in expired"));
215
- }, timeoutMs);
216
- options.signal?.addEventListener("abort", abort, {
217
- once: true
218
- });
219
- if (options.signal?.aborted) abort();
220
- return {
221
- authorizationUrl: flow?.url ?? authorization.toString(),
222
- expiresAt,
223
- completion,
224
- state: /* @__PURE__ */ __name(() => phase, "state"),
225
- cancel: /* @__PURE__ */ __name(() => {
226
- if (phase !== "waiting") return false;
227
- abort();
228
- return true;
229
- }, "cancel")
230
- };
231
- } catch {
232
- await finish(failure("Native sign-in could not start"));
233
- throw failure("Native sign-in could not start");
234
- }
235
- }
236
- __name(startNativeSignIn, "startNativeSignIn");
237
-
238
- // src/windows-host.ts
239
- var import_node_async_hooks = require("async_hooks");
240
- var import_node_child_process = require("child_process");
241
- var import_node_crypto2 = require("crypto");
242
- var import_node_path = require("path");
243
-
244
- // src/windows-host-helper.ts
245
- var WINDOWS_ACCOUNT_HOST_HELPER = String.raw`
246
- $ErrorActionPreference = 'Stop'
247
- [Console]::InputEncoding = New-Object System.Text.UTF8Encoding($false, $true)
248
- [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false, $true)
249
- Add-Type -TypeDefinition @'
250
- using System;
251
- using System.Text;
252
- using System.IO;
253
- using System.Threading;
254
- using System.Security.Cryptography;
255
- using System.Security.AccessControl;
256
- using System.Security.Principal;
257
- using System.Runtime.InteropServices;
258
- public static class XenoAccountWindowsHost {
259
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] struct Credential {
260
- public uint Flags; public uint Type; public string TargetName; public string Comment;
261
- public long LastWritten; public uint CredentialBlobSize; public IntPtr CredentialBlob;
262
- public uint Persist; public uint AttributeCount; public IntPtr Attributes;
263
- public string TargetAlias; public string UserName;
264
- }
265
- [DllImport("advapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)] static extern bool CredReadW(string target, uint type, uint flags, out IntPtr credential);
266
- [DllImport("advapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)] static extern bool CredWriteW(ref Credential credential, uint flags);
267
- [DllImport("advapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)] static extern bool CredDeleteW(string target, uint type, uint flags);
268
- [DllImport("advapi32.dll")] static extern void CredFree(IntPtr credential);
269
- [DllImport("kernel32.dll", SetLastError=true)] static extern IntPtr OpenProcess(uint access, bool inherit, int pid);
270
- [DllImport("kernel32.dll", SetLastError=true)] static extern bool GetProcessTimes(IntPtr process, out long creation, out long exit, out long kernel, out long user);
271
- [DllImport("kernel32.dll")] static extern uint WaitForSingleObject(IntPtr process, uint milliseconds);
272
- [DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr handle);
273
- [DllImport("kernel32.dll")] static extern IntPtr GetCurrentProcess();
274
- [DllImport("ncrypt.dll", CharSet=CharSet.Unicode)] static extern int NCryptGetProperty(IntPtr handle, string name, byte[] output, int size, out int written, int flags);
275
- static IntPtr parent;
276
- static CngKey key;
277
- static Mutex mutex;
278
- static string lease, prefix, refreshKey, keyName;
279
- static bool createdKey;
280
- static volatile bool stopping;
281
- static Thread monitor;
282
- static readonly UTF8Encoding Utf8 = new UTF8Encoding(false, true);
283
- static string Hash(string input) {
284
- using (var h = SHA256.Create()) return BitConverter.ToString(h.ComputeHash(Utf8.GetBytes(input))).Replace("-", "").ToLowerInvariant();
285
- }
286
- static void ParentCurrent() {
287
- long birth, exit, kernel, user, helperBirth;
288
- if (parent == IntPtr.Zero || !GetProcessTimes(parent, out birth, out exit, out kernel, out user)
289
- || !GetProcessTimes(GetCurrentProcess(), out helperBirth, out exit, out kernel, out user)
290
- || birth >= helperBirth || WaitForSingleObject(parent, 0) != 258) throw new IOException("parent unavailable");
291
- }
292
- static void AssertLease(string input) {
293
- ParentCurrent();
294
- if (lease == null || input != lease) throw new IOException("exclusive lease required");
295
- }
296
- static string Target(string input) {
297
- if (input != refreshKey && input != refreshKey + "/pending") throw new IOException("foreign credential namespace");
298
- return prefix + Hash(input);
299
- }
300
- static bool CredentialExists(string target) {
301
- IntPtr pointer;
302
- if (CredReadW(target, 1, 0, out pointer)) { CredFree(pointer); return true; }
303
- if (Marshal.GetLastWin32Error() == 1168) return false;
304
- throw new IOException("credential presence unavailable");
305
- }
306
- public static object Init(string clientId, string scope, int parentPid, bool create) {
307
- if (key != null || parent != IntPtr.Zero || !System.Text.RegularExpressions.Regex.IsMatch(clientId, "^xeno-[a-z0-9][a-z0-9-]{0,63}$")
308
- || !System.Text.RegularExpressions.Regex.IsMatch(scope, "^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$")) throw new IOException("invalid host identity");
309
- parent = OpenProcess(0x100000 | 0x1000, false, parentPid); ParentCurrent();
310
- var observedParent = parent;
311
- monitor = new Thread(() => {
312
- while (!stopping) {
313
- uint result = WaitForSingleObject(observedParent, 100);
314
- if (!stopping && result != 258) Environment.Exit(75);
315
- }
316
- });
317
- monitor.IsBackground = true; monitor.Start();
318
- var identity = Hash("xeno/account/windows-host/1\0" + scope + "\0" + clientId);
319
- prefix = "XENO.Account/" + identity + "/"; refreshKey = "xeno.account/" + clientId + "/refresh";
320
- var owner = WindowsIdentity.GetCurrent().User;
321
- var acl = new MutexSecurity(); acl.SetAccessRuleProtection(true, false); acl.SetOwner(owner);
322
- acl.AddAccessRule(new MutexAccessRule(owner, MutexRights.FullControl, AccessControlType.Allow));
323
- acl.AddAccessRule(new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null), MutexRights.FullControl, AccessControlType.Allow));
324
- bool created;
325
- mutex = new Mutex(false, "Global\\Xeno.Account." + Hash(owner.Value) + "." + identity, out created, acl);
326
- var rules = mutex.GetAccessControl().GetAccessRules(true, true, typeof(SecurityIdentifier));
327
- foreach (MutexAccessRule rule in rules) if (rule.AccessControlType == AccessControlType.Allow && rule.IdentityReference.Value != owner.Value
328
- && rule.IdentityReference.Value != "S-1-5-18") throw new IOException("public mutex custody");
329
- if (mutex.GetAccessControl().GetOwner(typeof(SecurityIdentifier)).Value != owner.Value) throw new IOException("foreign mutex owner");
330
- keyName = "Xeno.Account." + identity;
331
- var provider = new CngProvider("Microsoft Platform Crypto Provider");
332
- bool held = false;
333
- try {
334
- try { held = mutex.WaitOne(5000); } catch (AbandonedMutexException) { held = true; throw new IOException("abandoned init"); }
335
- if (!held) throw new IOException("init lock timeout"); ParentCurrent();
336
- if (CngKey.Exists(keyName, provider)) key = CngKey.Open(keyName, provider);
337
- else {
338
- if (!create) throw new IOException("provisioned key required");
339
- if (CredentialExists(Target(refreshKey)) || CredentialExists(Target(refreshKey + "/pending")))
340
- throw new IOException("existing credential cannot change key");
341
- var options = new CngKeyCreationParameters(); options.Provider = provider;
342
- options.KeyUsage = CngKeyUsages.Signing; options.ExportPolicy = CngExportPolicies.None;
343
- key = CngKey.Create(CngAlgorithm.ECDsaP256, keyName, options); createdKey = true;
344
- }
345
- if (key.Provider.Provider != "Microsoft Platform Crypto Provider" || key.ExportPolicy != CngExportPolicies.None
346
- || key.IsMachineKey || key.AlgorithmGroup != CngAlgorithmGroup.ECDsa || key.KeyUsage != CngKeyUsages.Signing)
347
- throw new IOException("key custody differs");
348
- var implementation = new byte[4]; int implementationSize;
349
- if (NCryptGetProperty(key.ProviderHandle.DangerousGetHandle(), "Impl Type", implementation, 4, out implementationSize, 0) != 0
350
- || implementationSize != 4 || (BitConverter.ToInt32(implementation, 0) & 1) == 0) throw new IOException("hardware provider required");
351
- var blob = key.Export(CngKeyBlobFormat.EccPublicBlob);
352
- if (blob.Length != 72 || BitConverter.ToUInt32(blob, 0) != 0x31534345 || BitConverter.ToUInt32(blob, 4) != 32) throw new IOException("wrong P256 key");
353
- ParentCurrent();
354
- return new { publicBlob = Convert.ToBase64String(blob), provider = key.Provider.Provider,
355
- exportPolicy = (int)key.ExportPolicy, hardwareImplementation = BitConverter.ToInt32(implementation, 0), createdKey = createdKey, keyName = keyName };
356
- } finally { if (held) mutex.ReleaseMutex(); }
357
- }
358
- public static void Acquire(string input, int milliseconds) {
359
- ParentCurrent(); if (lease != null || input == null || input.Length != 36 || milliseconds < 1 || milliseconds > 10000) throw new IOException("invalid lease");
360
- bool held = false;
361
- try {
362
- try { held = mutex.WaitOne(milliseconds); } catch (AbandonedMutexException) { held = true; throw new IOException("abandoned lease"); }
363
- if (!held) throw new IOException("lease timeout"); ParentCurrent(); lease = input;
364
- } catch { if (held) mutex.ReleaseMutex(); throw; }
365
- }
366
- public static void Release(string input) {
367
- AssertLease(input); lease = null; mutex.ReleaseMutex();
368
- }
369
- public static object Get(string input, string locked) {
370
- AssertLease(locked); var target = Target(input); IntPtr pointer;
371
- if (!CredReadW(target, 1, 0, out pointer)) {
372
- if (Marshal.GetLastWin32Error() == 1168) return null;
373
- throw new IOException("credential read unavailable");
374
- }
375
- byte[] bytes = null;
376
- try {
377
- var value = (Credential)Marshal.PtrToStructure(pointer, typeof(Credential));
378
- if (value.Type != 1 || value.TargetName != target || value.Persist != 2 || value.CredentialBlobSize > 2560
379
- || value.AttributeCount != 0) throw new IOException("credential profile differs");
380
- bytes = new byte[value.CredentialBlobSize]; Marshal.Copy(value.CredentialBlob, bytes, 0, bytes.Length);
381
- var result = Utf8.GetString(bytes); ParentCurrent(); return result;
382
- } finally { if (bytes != null) Array.Clear(bytes, 0, bytes.Length); CredFree(pointer); }
383
- }
384
- public static void Set(string input, string text, string locked) {
385
- AssertLease(locked); var target = Target(input); var bytes = Utf8.GetBytes(text);
386
- if (bytes.Length > 2560) throw new IOException("credential bound");
387
- IntPtr buffer = Marshal.AllocHGlobal(bytes.Length);
388
- try {
389
- Marshal.Copy(bytes, 0, buffer, bytes.Length);
390
- var value = new Credential { Type = 1, TargetName = target, CredentialBlob = buffer,
391
- CredentialBlobSize = (uint)bytes.Length, Persist = 2, UserName = "XENO Account" };
392
- if (!CredWriteW(ref value, 0)) throw new IOException("credential write unavailable"); ParentCurrent();
393
- } finally { for (int i=0;i<bytes.Length;i++) Marshal.WriteByte(buffer, i, 0); Marshal.FreeHGlobal(buffer); Array.Clear(bytes, 0, bytes.Length); }
394
- }
395
- public static void Delete(string input, string locked) {
396
- AssertLease(locked); if (!CredDeleteW(Target(input), 1, 0) && Marshal.GetLastWin32Error() != 1168) throw new IOException("credential deletion unavailable"); ParentCurrent();
397
- }
398
- public static object Sign(string encoded) {
399
- ParentCurrent(); var hash = Convert.FromBase64String(encoded); if (hash.Length != 32) throw new IOException("SHA256 bound");
400
- using (var signer = new ECDsaCng(key)) {
401
- var result = signer.SignHash(hash); if (result.Length != 64) throw new IOException("signature bound");
402
- ParentCurrent(); return Convert.ToBase64String(result);
403
- }
404
- }
405
- public static void Close(bool deleteCreated) {
406
- bool cleanupHeld = false;
407
- if (deleteCreated) {
408
- if (!createdKey || lease != null) throw new IOException("original idle cleanup owner required");
409
- try { cleanupHeld = mutex.WaitOne(5000); } catch (AbandonedMutexException) { mutex.ReleaseMutex(); throw new IOException("abandoned cleanup"); }
410
- if (!cleanupHeld) throw new IOException("cleanup timeout");
411
- try {
412
- ParentCurrent();
413
- if (CredentialExists(Target(refreshKey)) || CredentialExists(Target(refreshKey + "/pending"))) throw new IOException("qualification key cleanup requires empty vault");
414
- } catch { mutex.ReleaseMutex(); throw; }
415
- }
416
- try {
417
- stopping = true;
418
- if (monitor != null) { if (!monitor.Join(1000)) throw new IOException("parent monitor did not stop"); monitor = null; }
419
- if (lease != null) { mutex.ReleaseMutex(); lease = null; }
420
- if (key != null) { if (deleteCreated) key.Delete(); key.Dispose(); key=null; }
421
- if (mutex != null) { if (cleanupHeld) mutex.ReleaseMutex(); mutex.Dispose(); mutex=null; }
422
- if (parent != IntPtr.Zero) { CloseHandle(parent); parent=IntPtr.Zero; }
423
- } catch { Environment.Exit(76); }
424
- }
425
- }
426
- '@
427
- try {
428
- while ($null -ne ($line = [Console]::ReadLine())) {
429
- if ($line.Length -gt 50000) { break }
430
- $request = $null
431
- try {
432
- $request = $line | ConvertFrom-Json
433
- $value = $null
434
- switch ($request.op) {
435
- 'init' { $value = [XenoAccountWindowsHost]::Init($request.clientId, $request.namespace, [int]$request.parentPid, [bool]$request.createKey) }
436
- 'acquire' { [XenoAccountWindowsHost]::Acquire($request.lease, [int]$request.waitMs) }
437
- 'release' { [XenoAccountWindowsHost]::Release($request.lease) }
438
- 'get' { $value = [XenoAccountWindowsHost]::Get($request.key, $request.lease) }
439
- 'set' { [XenoAccountWindowsHost]::Set($request.key, $request.value, $request.lease) }
440
- 'delete' { [XenoAccountWindowsHost]::Delete($request.key, $request.lease) }
441
- 'sign' { $value = [XenoAccountWindowsHost]::Sign($request.hash) }
442
- 'close' { [XenoAccountWindowsHost]::Close([bool]$request.deleteCreatedKey) }
443
- default { throw 'unsupported request' }
444
- }
445
- [Console]::WriteLine((@{id=$request.id;ok=$true;value=$value} | ConvertTo-Json -Depth 4 -Compress))
446
- if ($request.op -eq 'close') { break }
447
- } catch {
448
- [Console]::WriteLine((@{id=$request.id;ok=$false;code='WINDOWS_ACCOUNT_HOST_REFUSED'} | ConvertTo-Json -Compress))
449
- if ($null -eq $request -or $request.op -eq 'init') { break }
450
- }
451
- }
452
- } finally { [XenoAccountWindowsHost]::Close($false) }
453
- `;
454
-
455
- // src/windows-host.ts
456
- var MAX_PIPE_BYTES = 65536;
457
- function refused() {
458
- return new AccountError({
459
- code: "UNREACHABLE",
460
- message: "Windows account host authority is unavailable",
461
- retryable: false
462
- });
463
- }
464
- __name(refused, "refused");
465
- async function createWindowsAccountHost(options) {
466
- if (process.platform !== "win32") throw refused();
467
- const clientId = options.clientId, namespace = options.namespace ?? clientId;
468
- const timeoutMs = options.timeoutMs ?? 15e3, waitMs = options.lockTimeoutMs ?? 5e3;
469
- const transactionTimeoutMs = options.transactionTimeoutMs ?? timeoutMs;
470
- if (typeof clientId !== "string" || typeof namespace !== "string" || !/^xeno-[a-z0-9][a-z0-9-]{0,63}$/.test(clientId) || !/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/.test(namespace) || !Number.isSafeInteger(timeoutMs) || timeoutMs < 1e3 || timeoutMs > 6e4 || !Number.isSafeInteger(waitMs) || waitMs < 1 || waitMs > 1e4 || timeoutMs <= waitMs || !Number.isSafeInteger(transactionTimeoutMs) || transactionTimeoutMs < 100 || transactionTimeoutMs > 6e4 || options.createKey !== void 0 && typeof options.createKey !== "boolean") throw refused();
471
- const systemRoot = process.env.SystemRoot ?? process.env.SYSTEMROOT;
472
- if (!systemRoot) throw refused();
473
- const executable = (0, import_node_path.join)(systemRoot, "System32/WindowsPowerShell/v1.0/powershell.exe");
474
- const child = (0, import_node_child_process.spawn)(executable, [
475
- "-NoLogo",
476
- "-NoProfile",
477
- "-NonInteractive",
478
- "-Command",
479
- WINDOWS_ACCOUNT_HOST_HELPER
480
- ], {
481
- windowsHide: true,
482
- stdio: [
483
- "pipe",
484
- "pipe",
485
- "pipe"
486
- ],
487
- cwd: systemRoot,
488
- env: {
489
- SystemRoot: systemRoot,
490
- WINDIR: systemRoot,
491
- TEMP: process.env.TEMP,
492
- TMP: process.env.TMP
493
- }
494
- });
495
- const rpc = new WindowsHostRpc(child, timeoutMs);
496
- let initialization;
497
- try {
498
- initialization = await rpc.request("init", {
499
- clientId,
500
- namespace,
501
- parentPid: process.pid,
502
- createKey: options.createKey === true
503
- });
504
- } catch {
505
- await rpc.kill();
506
- throw refused();
507
- }
508
- if (!initialization || typeof initialization !== "object") {
509
- await rpc.kill();
510
- throw refused();
511
- }
512
- const value = initialization;
513
- const identity = (0, import_node_crypto2.createHash)("sha256").update(`xeno/account/windows-host/1\0${namespace}\0${clientId}`).digest("hex");
514
- if (value.provider !== "Microsoft Platform Crypto Provider" || value.exportPolicy !== 0 || !Number.isInteger(value.hardwareImplementation) || (Number(value.hardwareImplementation) & 1) === 0 || typeof value.createdKey !== "boolean" || value.keyName !== `Xeno.Account.${identity}` || typeof value.publicBlob !== "string") {
515
- await rpc.kill();
516
- throw refused();
517
- }
518
- const blob = Buffer.from(value.publicBlob, "base64");
519
- if (blob.length !== 72 || blob.readUInt32LE(0) !== 827540293 || blob.readUInt32LE(4) !== 32) {
520
- await rpc.kill();
521
- throw refused();
522
- }
523
- const publicJwk = {
524
- kty: "EC",
525
- crv: "P-256",
526
- x: blob.subarray(8, 40).toString("base64url"),
527
- y: blob.subarray(40).toString("base64url")
528
- };
529
- const jkt = (0, import_node_crypto2.createHash)("sha256").update(JSON.stringify({
530
- crv: publicJwk.crv,
531
- kty: publicJwk.kty,
532
- x: publicJwk.x,
533
- y: publicJwk.y
534
- })).digest("base64url");
535
- const publicKey = (0, import_node_crypto2.createPublicKey)({
536
- key: publicJwk,
537
- format: "jwk"
538
- });
539
- const context = new import_node_async_hooks.AsyncLocalStorage();
540
- let tail = Promise.resolve(), locks = 0, closed = false, closing = false;
541
- const refreshKey = `xeno.account/${clientId}/refresh`;
542
- const current = /* @__PURE__ */ __name(() => {
543
- if (closed || closing || rpc.failed) throw refused();
544
- }, "current");
545
- const validKey = /* @__PURE__ */ __name((key) => {
546
- current();
547
- if (key !== refreshKey && key !== `${refreshKey}/pending`) throw refused();
548
- }, "validKey");
549
- const exclusive = /* @__PURE__ */ __name(async (key, work) => {
550
- validKey(key);
551
- if (context.getStore() || locks >= 64) throw refused();
552
- locks++;
553
- const prior = tail;
554
- let release;
555
- tail = new Promise((resolve) => {
556
- release = resolve;
557
- });
558
- await prior;
559
- const lease = {
560
- id: (0, import_node_crypto2.randomUUID)(),
561
- active: true
562
- };
563
- let acquired = false;
564
- try {
565
- current();
566
- await rpc.request("acquire", {
567
- lease: lease.id,
568
- waitMs
569
- });
570
- acquired = true;
571
- let timer;
572
- try {
573
- return await Promise.race([
574
- context.run(lease, work),
575
- new Promise((_resolve, reject) => {
576
- timer = setTimeout(() => {
577
- lease.active = false;
578
- void rpc.kill();
579
- reject(refused());
580
- }, transactionTimeoutMs);
581
- })
582
- ]);
583
- } finally {
584
- if (timer) clearTimeout(timer);
585
- }
586
- } finally {
587
- lease.active = false;
588
- try {
589
- if (acquired && !rpc.failed) await rpc.request("release", {
590
- lease: lease.id
591
- });
592
- } finally {
593
- locks--;
594
- release();
595
- }
596
- }
597
- }, "exclusive");
598
- const storageRequest = /* @__PURE__ */ __name(async (op, key, input = {}) => {
599
- validKey(key);
600
- const lease = context.getStore();
601
- if (lease) {
602
- if (!lease.active) throw refused();
603
- return rpc.request(op, {
604
- ...input,
605
- key,
606
- lease: lease.id
607
- });
608
- }
609
- return exclusive(refreshKey, () => storageRequest(op, key, input));
610
- }, "storageRequest");
611
- const store = {
612
- withExclusive: exclusive,
613
- async get(key) {
614
- const result = await storageRequest("get", key);
615
- if (result !== null && typeof result !== "string") throw refused();
616
- return result;
617
- },
618
- async set(key, text) {
619
- if (typeof text !== "string" || Buffer.byteLength(text, "utf8") > 2560) throw refused();
620
- await storageRequest("set", key, {
621
- value: text
622
- });
623
- },
624
- async delete(key) {
625
- await storageRequest("delete", key);
626
- }
627
- };
628
- const dpopSigner = {
629
- jkt,
630
- async createProof(args) {
631
- current();
632
- if (!args || typeof args.method !== "string" || typeof args.url !== "string" || args.url.length > 8192 || args.accessToken !== void 0 && (typeof args.accessToken !== "string" || args.accessToken.length > 16384 || !/^[\x21-\x7e]+$/.test(args.accessToken)) || args.nonce !== void 0 && (typeof args.nonce !== "string" || args.nonce.length > 4096 || /[\r\n]/.test(args.nonce))) throw refused();
633
- const method = args.method.toUpperCase();
634
- let url;
635
- try {
636
- url = new URL(args.url);
637
- } catch {
638
- throw refused();
639
- }
640
- if (!/^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)$/.test(method) || url.username || url.password || url.protocol !== "https:") throw refused();
641
- const header = {
642
- alg: "ES256",
643
- typ: "dpop+jwt",
644
- jwk: publicJwk
645
- };
646
- const claims = {
647
- jti: (0, import_node_crypto2.randomUUID)(),
648
- htm: method,
649
- htu: normalizeDpopHtu(args.url),
650
- iat: Math.floor(Date.now() / 1e3),
651
- ...args.accessToken ? {
652
- ath: (0, import_node_crypto2.createHash)("sha256").update(args.accessToken).digest("base64url")
653
- } : {},
654
- ...args.nonce ? {
655
- nonce: args.nonce
656
- } : {}
657
- };
658
- const a = Buffer.from(JSON.stringify(header)).toString("base64url"), b = Buffer.from(JSON.stringify(claims)).toString("base64url");
659
- const signingInput = Buffer.from(`${a}.${b}`);
660
- const signature = await rpc.request("sign", {
661
- hash: (0, import_node_crypto2.createHash)("sha256").update(signingInput).digest("base64")
662
- });
663
- if (typeof signature !== "string") throw refused();
664
- const bytes = Buffer.from(signature, "base64");
665
- if (bytes.length !== 64 || !(0, import_node_crypto2.verify)("sha256", signingInput, {
666
- key: publicKey,
667
- dsaEncoding: "ieee-p1363"
668
- }, bytes)) throw refused();
669
- current();
670
- return `${a}.${b}.${bytes.toString("base64url")}`;
671
- }
672
- };
673
- return {
674
- store,
675
- dpopSigner,
676
- custody: {
677
- kind: "windows-credential-manager+tpm",
678
- hardwareBacked: true,
679
- nonExportable: true,
680
- createdKey: value.createdKey,
681
- keyName: String(value.keyName)
682
- },
683
- async close(input = {}) {
684
- if (closed) return;
685
- if (closing || locks || rpc.activeRequests || input.deleteCreatedKey && !value.createdKey) throw refused();
686
- closing = true;
687
- try {
688
- await rpc.request("close", {
689
- deleteCreatedKey: input.deleteCreatedKey === true
690
- });
691
- closed = true;
692
- } catch (error) {
693
- if (rpc.failed) closed = true;
694
- throw error;
695
- } finally {
696
- closing = false;
697
- if (closed) await rpc.kill();
698
- }
699
- }
700
- };
701
- }
702
- __name(createWindowsAccountHost, "createWindowsAccountHost");
703
- var WindowsHostRpc = class WindowsHostRpc2 {
704
- static {
705
- __name(this, "WindowsHostRpc");
706
- }
707
- child;
708
- timeoutMs;
709
- exited;
710
- failed = false;
711
- pending = /* @__PURE__ */ new Map();
712
- buffer = Buffer.alloc(0);
713
- get activeRequests() {
714
- return this.pending.size;
715
- }
716
- constructor(child, timeoutMs) {
717
- this.child = child;
718
- this.timeoutMs = timeoutMs;
719
- this.exited = new Promise((resolve) => {
720
- child.once("exit", () => {
721
- this.fail();
722
- resolve();
723
- });
724
- child.once("error", () => {
725
- this.fail();
726
- resolve();
727
- });
728
- });
729
- child.stderr.resume();
730
- child.stdout.on("data", (chunk) => {
731
- this.buffer = Buffer.concat([
732
- this.buffer,
733
- chunk
734
- ]);
735
- if (this.buffer.byteLength > MAX_PIPE_BYTES) {
736
- this.fail();
737
- void this.kill();
738
- return;
739
- }
740
- for (let newline; (newline = this.buffer.indexOf(10)) >= 0; ) {
741
- const bytes = this.buffer.subarray(0, newline);
742
- this.buffer = this.buffer.subarray(newline + 1);
743
- let reply;
744
- try {
745
- reply = JSON.parse(new TextDecoder("utf-8", {
746
- fatal: true
747
- }).decode(bytes));
748
- } catch {
749
- this.fail();
750
- void this.kill();
751
- return;
752
- }
753
- const item = reply && this.pending.get(reply.id);
754
- if (!item || typeof reply.ok !== "boolean") {
755
- this.fail();
756
- void this.kill();
757
- return;
758
- }
759
- clearTimeout(item.timer);
760
- this.pending.delete(reply.id);
761
- if (reply.ok) item.resolve(reply.value);
762
- else item.reject(refused());
763
- }
764
- });
765
- for (const stream of [
766
- child.stdin,
767
- child.stdout,
768
- child.stderr
769
- ]) {
770
- stream.on("error", () => {
771
- this.fail();
772
- void this.kill();
773
- });
774
- }
775
- }
776
- request(op, values = {}) {
777
- if (this.failed || this.pending.size >= 128) return Promise.reject(refused());
778
- const id = (0, import_node_crypto2.randomUUID)(), line = JSON.stringify({
779
- ...values,
780
- id,
781
- op
782
- }) + "\n";
783
- if (Buffer.byteLength(line) > MAX_PIPE_BYTES) return Promise.reject(refused());
784
- return new Promise((resolve, reject) => {
785
- const timer = setTimeout(() => {
786
- this.fail();
787
- void this.kill();
788
- }, this.timeoutMs);
789
- this.pending.set(id, {
790
- resolve,
791
- reject,
792
- timer
793
- });
794
- try {
795
- this.child.stdin.write(line);
796
- } catch {
797
- this.fail();
798
- void this.kill();
799
- }
800
- });
801
- }
802
- fail() {
803
- this.failed = true;
804
- for (const item of this.pending.values()) {
805
- clearTimeout(item.timer);
806
- item.reject(refused());
807
- }
808
- this.pending.clear();
809
- }
810
- async kill() {
811
- this.fail();
812
- if (this.child.exitCode !== null || this.child.signalCode !== null) return;
813
- this.child.stdin.end();
814
- this.child.kill();
815
- await this.exited;
816
- }
817
- };
818
-
819
- // src/linux-host.ts
820
- var import_node_async_hooks2 = require("async_hooks");
821
- var import_node_child_process2 = require("child_process");
822
- var import_node_crypto3 = require("crypto");
823
- var import_node_fs = require("fs");
824
- var import_node_path2 = require("path");
825
- var import_node_os = require("os");
826
- var VALUE_PREFIX = "xa1:";
827
- var MAX_VALUE_BYTES = 2560;
828
- var MAX_KEY_BYTES = 1024;
829
- function refused2() {
830
- return new AccountError({
831
- code: "UNREACHABLE",
832
- message: "Linux account host authority is unavailable",
833
- retryable: false
834
- });
835
- }
836
- __name(refused2, "refused");
837
- async function createLinuxAccountHost(options) {
838
- if (process.platform !== "linux") throw refused2();
839
- const timeoutMs = options.timeoutMs ?? 15e3;
840
- const tool = findSecretTool();
841
- return openLinuxAccountHost(options, {
842
- secretTool: tool ? secretToolRunner(tool, timeoutMs) : null,
843
- lockDirectory: runtimeLockDirectory()
844
- });
845
- }
846
- __name(createLinuxAccountHost, "createLinuxAccountHost");
847
- async function openLinuxAccountHost(options, deps) {
848
- const clientId = options.clientId, namespace = options.namespace ?? clientId;
849
- const timeoutMs = options.timeoutMs ?? 15e3, waitMs = options.lockTimeoutMs ?? 5e3;
850
- const transactionTimeoutMs = options.transactionTimeoutMs ?? timeoutMs;
851
- if (typeof clientId !== "string" || typeof namespace !== "string" || !/^xeno-[a-z0-9][a-z0-9-]{0,63}$/.test(clientId) || !/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/.test(namespace) || !Number.isSafeInteger(timeoutMs) || timeoutMs < 1e3 || timeoutMs > 12e4 || !Number.isSafeInteger(waitMs) || waitMs < 1 || waitMs > 1e4 || !Number.isSafeInteger(transactionTimeoutMs) || transactionTimeoutMs < 100 || transactionTimeoutMs > 12e4 || options.createKey !== void 0 && typeof options.createKey !== "boolean") throw refused2();
852
- const identity = (0, import_node_crypto3.createHash)("sha256").update(`xeno/account/linux-host/1\0${namespace}\0${clientId}`).digest("hex");
853
- const keyName = `Xeno.Account.${identity}`;
854
- const refreshKey = `xeno.account/${clientId}/refresh`;
855
- const keyring = deps.secretTool ? new Keyring(deps.secretTool, identity, clientId) : null;
856
- let custody, privateKey, publicJwk;
857
- let persistent;
858
- const stored = keyring ? await keyring.read("dpop-key").catch(() => void 0) : void 0;
859
- if (typeof stored === "string") {
860
- ({ privateKey, publicJwk } = parsePrivateJwk(stored));
861
- persistent = true;
862
- custody = {
863
- kind: "linux-secret-service+software-key",
864
- hardwareBacked: false,
865
- nonExportable: false,
866
- persistent: true,
867
- createdKey: false,
868
- keyName
869
- };
870
- } else {
871
- if (options.createKey !== true) throw refused2();
872
- const generated = (0, import_node_crypto3.generateKeyPairSync)("ec", {
873
- namedCurve: "P-256"
874
- });
875
- const jwk = JSON.stringify(generated.privateKey.export({
876
- format: "jwk"
877
- }));
878
- ({ privateKey, publicJwk } = parsePrivateJwk(jwk));
879
- if (keyring && stored === null && await keyring.works()) {
880
- if (await keyring.read("refresh") !== null || await keyring.read("pending") !== null) throw refused2();
881
- await keyring.write("dpop-key", jwk);
882
- persistent = true;
883
- custody = {
884
- kind: "linux-secret-service+software-key",
885
- hardwareBacked: false,
886
- nonExportable: false,
887
- persistent: true,
888
- createdKey: true,
889
- keyName
890
- };
891
- } else {
892
- persistent = false;
893
- custody = {
894
- kind: "linux-session-memory+software-key",
895
- hardwareBacked: false,
896
- nonExportable: false,
897
- persistent: false,
898
- createdKey: true,
899
- keyName
900
- };
901
- }
902
- }
903
- const jkt = (0, import_node_crypto3.createHash)("sha256").update(JSON.stringify({
904
- crv: publicJwk.crv,
905
- kty: publicJwk.kty,
906
- x: publicJwk.x,
907
- y: publicJwk.y
908
- })).digest("base64url");
909
- const memory = /* @__PURE__ */ new Map();
910
- const lock = persistent ? new ProcessLock(deps.lockDirectory, identity) : null;
911
- const context = new import_node_async_hooks2.AsyncLocalStorage();
912
- let tail = Promise.resolve(), locks = 0, closed = false, closing = false, failed = false;
913
- const current = /* @__PURE__ */ __name(() => {
914
- if (closed || closing || failed) throw refused2();
915
- }, "current");
916
- const itemOf = /* @__PURE__ */ __name((key) => {
917
- current();
918
- if (key === refreshKey) return "refresh";
919
- if (key === `${refreshKey}/pending`) return "pending";
920
- throw refused2();
921
- }, "itemOf");
922
- const exclusive = /* @__PURE__ */ __name(async (key, work) => {
923
- itemOf(key);
924
- if (context.getStore() || locks >= 64) throw refused2();
925
- locks++;
926
- const prior = tail;
927
- let release;
928
- tail = new Promise((resolve) => {
929
- release = resolve;
930
- });
931
- await prior;
932
- const lease = {
933
- id: (0, import_node_crypto3.randomUUID)(),
934
- active: true
935
- };
936
- let acquired = false;
937
- try {
938
- current();
939
- if (lock) {
940
- await lock.acquire(waitMs);
941
- acquired = true;
942
- }
943
- let timer;
944
- try {
945
- return await Promise.race([
946
- context.run(lease, work),
947
- new Promise((_resolve, reject) => {
948
- timer = setTimeout(() => {
949
- lease.active = false;
950
- failed = true;
951
- reject(refused2());
952
- }, transactionTimeoutMs);
953
- })
954
- ]);
955
- } finally {
956
- if (timer) clearTimeout(timer);
957
- }
958
- } finally {
959
- lease.active = false;
960
- try {
961
- if (acquired && lock && !lock.release()) failed = true;
962
- } finally {
963
- locks--;
964
- release();
965
- }
966
- }
967
- }, "exclusive");
968
- const storage = /* @__PURE__ */ __name(async (key, operation) => {
969
- const item = itemOf(key);
970
- const lease = context.getStore();
971
- if (lease) {
972
- if (!lease.active) throw refused2();
973
- try {
974
- return await operation(item);
975
- } catch {
976
- if (persistent) failed = true;
977
- throw refused2();
978
- }
979
- }
980
- return exclusive(refreshKey, () => storage(key, operation));
981
- }, "storage");
982
- const store = {
983
- withExclusive: exclusive,
984
- async get(key) {
985
- return storage(key, async (item) => {
986
- if (!keyring || !persistent) return memory.get(item) ?? null;
987
- const value = await keyring.read(item);
988
- if (value !== null && typeof value !== "string") throw refused2();
989
- return value;
990
- });
991
- },
992
- async set(key, text) {
993
- if (typeof text !== "string" || Buffer.byteLength(text, "utf8") > MAX_VALUE_BYTES) throw refused2();
994
- await storage(key, async (item) => {
995
- if (!keyring || !persistent) {
996
- memory.set(item, text);
997
- return;
998
- }
999
- await keyring.write(item, text);
1000
- });
1001
- },
1002
- async delete(key) {
1003
- await storage(key, async (item) => {
1004
- if (!keyring || !persistent) {
1005
- memory.delete(item);
1006
- return;
1007
- }
1008
- await keyring.remove(item);
1009
- });
1010
- }
1011
- };
1012
- const dpopSigner = {
1013
- jkt,
1014
- async createProof(args) {
1015
- current();
1016
- if (!args || typeof args.method !== "string" || typeof args.url !== "string" || args.url.length > 8192 || args.accessToken !== void 0 && (typeof args.accessToken !== "string" || args.accessToken.length > 16384 || !/^[\x21-\x7e]+$/.test(args.accessToken)) || args.nonce !== void 0 && (typeof args.nonce !== "string" || args.nonce.length > 4096 || /[\r\n]/.test(args.nonce))) throw refused2();
1017
- const method = args.method.toUpperCase();
1018
- let url;
1019
- try {
1020
- url = new URL(args.url);
1021
- } catch {
1022
- throw refused2();
1023
- }
1024
- if (!/^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS)$/.test(method) || url.username || url.password || url.protocol !== "https:") throw refused2();
1025
- const header = {
1026
- alg: "ES256",
1027
- typ: "dpop+jwt",
1028
- jwk: publicJwk
1029
- };
1030
- const claims = {
1031
- jti: (0, import_node_crypto3.randomUUID)(),
1032
- htm: method,
1033
- htu: normalizeDpopHtu(args.url),
1034
- iat: Math.floor(Date.now() / 1e3),
1035
- ...args.accessToken ? {
1036
- ath: (0, import_node_crypto3.createHash)("sha256").update(args.accessToken).digest("base64url")
1037
- } : {},
1038
- ...args.nonce ? {
1039
- nonce: args.nonce
1040
- } : {}
1041
- };
1042
- const a = Buffer.from(JSON.stringify(header)).toString("base64url"), b = Buffer.from(JSON.stringify(claims)).toString("base64url");
1043
- const signature = (0, import_node_crypto3.sign)("sha256", Buffer.from(`${a}.${b}`), {
1044
- key: privateKey,
1045
- dsaEncoding: "ieee-p1363"
1046
- });
1047
- if (signature.length !== 64) throw refused2();
1048
- return `${a}.${b}.${signature.toString("base64url")}`;
1049
- }
1050
- };
1051
- return {
1052
- store,
1053
- dpopSigner,
1054
- custody,
1055
- async close(input = {}) {
1056
- if (closed) return;
1057
- if (closing || locks || input.deleteCreatedKey && !custody.createdKey) throw refused2();
1058
- closing = true;
1059
- try {
1060
- if (input.deleteCreatedKey && keyring && persistent) await keyring.remove("dpop-key");
1061
- memory.clear();
1062
- closed = true;
1063
- } catch {
1064
- throw refused2();
1065
- } finally {
1066
- closing = false;
1067
- }
1068
- }
1069
- };
1070
- }
1071
- __name(openLinuxAccountHost, "openLinuxAccountHost");
1072
- function parsePrivateJwk(text) {
1073
- if (Buffer.byteLength(text, "utf8") > MAX_KEY_BYTES) throw refused2();
1074
- let jwk;
1075
- try {
1076
- jwk = JSON.parse(text);
1077
- } catch {
1078
- throw refused2();
1079
- }
1080
- if (jwk.kty !== "EC" || jwk.crv !== "P-256" || typeof jwk.x !== "string" || typeof jwk.y !== "string" || typeof jwk.d !== "string") throw refused2();
1081
- try {
1082
- const privateKey = (0, import_node_crypto3.createPrivateKey)({
1083
- key: jwk,
1084
- format: "jwk"
1085
- });
1086
- return {
1087
- privateKey,
1088
- publicJwk: {
1089
- kty: "EC",
1090
- crv: "P-256",
1091
- x: jwk.x,
1092
- y: jwk.y
1093
- }
1094
- };
1095
- } catch {
1096
- throw refused2();
1097
- }
1098
- }
1099
- __name(parsePrivateJwk, "parsePrivateJwk");
1100
- var Keyring = class Keyring2 {
1101
- static {
1102
- __name(this, "Keyring");
1103
- }
1104
- run;
1105
- identity;
1106
- clientId;
1107
- constructor(run, identity, clientId) {
1108
- this.run = run;
1109
- this.identity = identity;
1110
- this.clientId = clientId;
1111
- }
1112
- attributes(item) {
1113
- return [
1114
- "xeno-account",
1115
- this.identity,
1116
- "item",
1117
- item
1118
- ];
1119
- }
1120
- /** `null` = no such item; throws when the keyring itself did not answer. */
1121
- async read(item) {
1122
- const result = await this.run([
1123
- "lookup",
1124
- ...this.attributes(item)
1125
- ]);
1126
- if (result.code === 1 && !result.stdout && !result.stderr.trim()) return null;
1127
- if (result.code !== 0) throw refused2();
1128
- const raw = result.stdout.replace(/\n$/, "");
1129
- if (!raw.startsWith(VALUE_PREFIX)) throw refused2();
1130
- const bytes = Buffer.from(raw.slice(VALUE_PREFIX.length), "base64");
1131
- try {
1132
- return new TextDecoder("utf-8", {
1133
- fatal: true
1134
- }).decode(bytes);
1135
- } catch {
1136
- throw refused2();
1137
- }
1138
- }
1139
- async write(item, value) {
1140
- const encoded = VALUE_PREFIX + Buffer.from(value, "utf8").toString("base64");
1141
- const result = await this.run([
1142
- "store",
1143
- `--label=XENO account ${this.clientId} (${item})`,
1144
- ...this.attributes(item)
1145
- ], encoded);
1146
- if (result.code !== 0 || await this.read(item) !== value) throw refused2();
1147
- }
1148
- async remove(item) {
1149
- await this.run([
1150
- "clear",
1151
- ...this.attributes(item)
1152
- ]);
1153
- if (await this.read(item) !== null) throw refused2();
1154
- }
1155
- /** Proves the keyring stores, returns and clears a value before anything is committed to it. */
1156
- async works() {
1157
- const probe = `probe-${(0, import_node_crypto3.randomUUID)()}`;
1158
- try {
1159
- await this.write("probe", probe);
1160
- await this.remove("probe");
1161
- return true;
1162
- } catch {
1163
- try {
1164
- await this.run([
1165
- "clear",
1166
- ...this.attributes("probe")
1167
- ]);
1168
- } catch {
1169
- }
1170
- return false;
1171
- }
1172
- }
1173
- };
1174
- function findSecretTool() {
1175
- for (const directory of (process.env.PATH ?? "").split(import_node_path2.delimiter)) {
1176
- if (!directory || !(0, import_node_path2.isAbsolute)(directory)) continue;
1177
- const candidate = (0, import_node_path2.join)(directory, "secret-tool");
1178
- try {
1179
- if ((0, import_node_fs.statSync)(candidate).isFile()) return candidate;
1180
- } catch {
1181
- }
1182
- }
1183
- return null;
1184
- }
1185
- __name(findSecretTool, "findSecretTool");
1186
- function secretToolRunner(executable, timeoutMs) {
1187
- const allowed = [
1188
- "PATH",
1189
- "HOME",
1190
- "USER",
1191
- "LOGNAME",
1192
- "DBUS_SESSION_BUS_ADDRESS",
1193
- "XDG_RUNTIME_DIR",
1194
- "DISPLAY",
1195
- "WAYLAND_DISPLAY",
1196
- "XAUTHORITY"
1197
- ];
1198
- const env = {
1199
- LC_ALL: "C"
1200
- };
1201
- for (const name of allowed) {
1202
- const value = process.env[name];
1203
- if (value) env[name] = value;
1204
- }
1205
- return (args, input) => new Promise((resolve, reject) => {
1206
- const child = (0, import_node_child_process2.spawn)(executable, args, {
1207
- stdio: [
1208
- "pipe",
1209
- "pipe",
1210
- "pipe"
1211
- ],
1212
- env,
1213
- windowsHide: true
1214
- });
1215
- let stdout = "", stderr = "", settled = false;
1216
- const finish = /* @__PURE__ */ __name((fn) => {
1217
- if (!settled) {
1218
- settled = true;
1219
- clearTimeout(timer);
1220
- fn();
1221
- }
1222
- }, "finish");
1223
- const timer = setTimeout(() => {
1224
- child.kill("SIGKILL");
1225
- finish(() => reject(refused2()));
1226
- }, timeoutMs);
1227
- child.stdout.setEncoding("utf8").on("data", (chunk) => {
1228
- stdout += chunk;
1229
- if (stdout.length > 16384) {
1230
- child.kill("SIGKILL");
1231
- finish(() => reject(refused2()));
1232
- }
1233
- });
1234
- child.stderr.setEncoding("utf8").on("data", (chunk) => {
1235
- stderr += chunk;
1236
- if (stderr.length > 16384) stderr = stderr.slice(-16384);
1237
- });
1238
- child.once("error", () => finish(() => reject(refused2())));
1239
- child.once("close", (code) => finish(() => resolve({
1240
- code,
1241
- stdout,
1242
- stderr
1243
- })));
1244
- child.stdin.on("error", () => {
1245
- });
1246
- child.stdin.end(input ?? "");
1247
- });
1248
- }
1249
- __name(secretToolRunner, "secretToolRunner");
1250
- function runtimeLockDirectory() {
1251
- const uid = typeof process.getuid === "function" ? process.getuid() : -1;
1252
- const runtime = process.env.XDG_RUNTIME_DIR;
1253
- if (runtime && (0, import_node_path2.isAbsolute)(runtime)) return (0, import_node_path2.join)(runtime, "xeno", "account");
1254
- return (0, import_node_path2.join)((0, import_node_os.tmpdir)(), `xeno-account-${uid}`);
1255
- }
1256
- __name(runtimeLockDirectory, "runtimeLockDirectory");
1257
- function privateDirectory(path) {
1258
- (0, import_node_fs.mkdirSync)(path, {
1259
- recursive: true,
1260
- mode: 448
1261
- });
1262
- const stat = (0, import_node_fs.lstatSync)(path);
1263
- const uid = typeof process.getuid === "function" ? process.getuid() : void 0;
1264
- if (!stat.isDirectory() || stat.isSymbolicLink() || uid !== void 0 && stat.uid !== uid || process.platform !== "win32" && (stat.mode & 63) !== 0) throw refused2();
1265
- }
1266
- __name(privateDirectory, "privateDirectory");
1267
- function readBootId() {
1268
- try {
1269
- return (0, import_node_fs.readFileSync)("/proc/sys/kernel/random/boot_id", "utf8").trim() || void 0;
1270
- } catch {
1271
- return void 0;
1272
- }
1273
- }
1274
- __name(readBootId, "readBootId");
1275
- function readStartTime(pid) {
1276
- try {
1277
- const stat = (0, import_node_fs.readFileSync)(`/proc/${pid}/stat`, "utf8");
1278
- return stat.slice(stat.lastIndexOf(")") + 2).split(" ")[19];
1279
- } catch {
1280
- return void 0;
1281
- }
1282
- }
1283
- __name(readStartTime, "readStartTime");
1284
- var ProcessLock = class ProcessLock2 {
1285
- static {
1286
- __name(this, "ProcessLock");
1287
- }
1288
- directory;
1289
- path;
1290
- token = null;
1291
- constructor(directory, identity) {
1292
- this.directory = directory;
1293
- this.path = (0, import_node_path2.join)(directory, `${identity}.lock`);
1294
- }
1295
- async acquire(waitMs) {
1296
- if (this.token) throw refused2();
1297
- privateDirectory(this.directory);
1298
- const deadline = Date.now() + waitMs;
1299
- const token = (0, import_node_crypto3.randomUUID)();
1300
- const record = {
1301
- v: 1,
1302
- token,
1303
- pid: process.pid,
1304
- host: (0, import_node_os.hostname)(),
1305
- boot: readBootId(),
1306
- start: readStartTime(process.pid)
1307
- };
1308
- for (; ; ) {
1309
- try {
1310
- const fd = (0, import_node_fs.openSync)(this.path, "wx", 384);
1311
- try {
1312
- (0, import_node_fs.writeSync)(fd, JSON.stringify(record));
1313
- (0, import_node_fs.fsyncSync)(fd);
1314
- } finally {
1315
- (0, import_node_fs.closeSync)(fd);
1316
- }
1317
- this.token = token;
1318
- return;
1319
- } catch (error) {
1320
- if (error.code !== "EEXIST") throw refused2();
1321
- }
1322
- this.breakIfGone();
1323
- if (Date.now() >= deadline) throw refused2();
1324
- await new Promise((resolve) => setTimeout(resolve, 25));
1325
- }
1326
- }
1327
- /** False when this process no longer held the lock it took, so its transaction was not exclusive. */
1328
- release() {
1329
- const token = this.token;
1330
- this.token = null;
1331
- if (!token) return false;
1332
- const holder = this.readHolder(this.path);
1333
- if (holder?.token !== token) return false;
1334
- try {
1335
- (0, import_node_fs.unlinkSync)(this.path);
1336
- return true;
1337
- } catch {
1338
- return false;
1339
- }
1340
- }
1341
- readHolder(path) {
1342
- try {
1343
- const value = JSON.parse((0, import_node_fs.readFileSync)(path, "utf8"));
1344
- return value && value.v === 1 && typeof value.token === "string" && Number.isSafeInteger(value.pid) && typeof value.host === "string" ? value : null;
1345
- } catch (error) {
1346
- return error.code === "ENOENT" ? void 0 : null;
1347
- }
1348
- }
1349
- gone(holder) {
1350
- if (holder === null) {
1351
- try {
1352
- return Date.now() - (0, import_node_fs.statSync)(this.path).mtimeMs > 3e4;
1353
- } catch {
1354
- return false;
1355
- }
1356
- }
1357
- if (holder.host !== (0, import_node_os.hostname)()) return false;
1358
- const boot = readBootId();
1359
- if (boot && holder.boot && boot !== holder.boot) return true;
1360
- try {
1361
- process.kill(holder.pid, 0);
1362
- } catch (error) {
1363
- return error.code === "ESRCH";
1364
- }
1365
- const start = readStartTime(holder.pid);
1366
- return Boolean(start && holder.start && start !== holder.start);
1367
- }
1368
- breakIfGone() {
1369
- const holder = this.readHolder(this.path);
1370
- if (holder === void 0 || !this.gone(holder)) return;
1371
- const moved = `${this.path}.stale-${(0, import_node_crypto3.randomUUID)()}`;
1372
- try {
1373
- (0, import_node_fs.renameSync)(this.path, moved);
1374
- } catch {
1375
- return;
1376
- }
1377
- const removed = this.readHolder(moved);
1378
- if (holder !== null && removed?.token !== holder.token) {
1379
- try {
1380
- (0, import_node_fs.linkSync)(moved, this.path);
1381
- } catch {
1382
- }
1383
- }
1384
- try {
1385
- (0, import_node_fs.unlinkSync)(moved);
1386
- } catch {
1387
- }
1388
- }
1389
- };
1390
-
1391
- // src/node.ts
1392
- function createNodeDpopSigner(input) {
1393
- const parsed = typeof input === "string" ? JSON.parse(input) : input;
1394
- if (parsed.kty !== "EC" || parsed.crv !== "P-256" || !parsed.x || !parsed.y || !parsed.d) {
1395
- throw new Error("DPoP private JWK must be a P-256 EC key");
1396
- }
1397
- const privateJwk = parsed;
1398
- const publicJwk = {
1399
- kty: "EC",
1400
- crv: "P-256",
1401
- x: privateJwk.x,
1402
- y: privateJwk.y
1403
- };
1404
- const jkt = import_node_crypto4.default.createHash("sha256").update(JSON.stringify({
1405
- crv: "P-256",
1406
- kty: "EC",
1407
- x: privateJwk.x,
1408
- y: privateJwk.y
1409
- })).digest("base64url");
1410
- const key = import_node_crypto4.default.createPrivateKey({
1411
- key: privateJwk,
1412
- format: "jwk"
1413
- });
1414
- return {
1415
- jkt,
1416
- async createProof(args) {
1417
- const header = {
1418
- alg: "ES256",
1419
- typ: "dpop+jwt",
1420
- jwk: publicJwk
1421
- };
1422
- const claims = {
1423
- jti: import_node_crypto4.default.randomUUID(),
1424
- htm: args.method.toUpperCase(),
1425
- htu: normalizeDpopHtu(args.url),
1426
- iat: Math.floor(Date.now() / 1e3)
1427
- };
1428
- if (args.accessToken) claims.ath = import_node_crypto4.default.createHash("sha256").update(args.accessToken).digest("base64url");
1429
- if (args.nonce) claims.nonce = args.nonce;
1430
- const a = Buffer.from(JSON.stringify(header)).toString("base64url");
1431
- const b = Buffer.from(JSON.stringify(claims)).toString("base64url");
1432
- const signature = import_node_crypto4.default.sign("sha256", Buffer.from(`${a}.${b}`), {
1433
- key,
1434
- dsaEncoding: "ieee-p1363"
1435
- }).toString("base64url");
1436
- return `${a}.${b}.${signature}`;
1437
- }
1438
- };
1439
- }
1440
- __name(createNodeDpopSigner, "createNodeDpopSigner");
1441
- // Annotate the CommonJS export names for ESM import in node:
1442
- 0 && (module.exports = {
1443
- createLinuxAccountHost,
1444
- createNodeDpopSigner,
1445
- createWindowsAccountHost,
1446
- startNativeSignIn
1447
- });
1448
- //# sourceMappingURL=node.js.map