@xenosystem/agent-cli 0.5.181 → 0.5.183

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 (864) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/index.js +2452 -2452
  3. package/dist/metafile-esm.json +1 -1
  4. package/dist/sdk-build-identity.json +11 -11
  5. package/node_modules/@xeno-corporation/account/LICENSE +39 -0
  6. package/node_modules/@xeno-corporation/account/README.md +266 -0
  7. package/node_modules/@xeno-corporation/account/dist/chunk-FELZILY4.mjs +60 -0
  8. package/node_modules/@xeno-corporation/account/dist/chunk-FELZILY4.mjs.map +1 -0
  9. package/node_modules/@xeno-corporation/account/dist/client-CVtf6u7F.d.mts +2346 -0
  10. package/node_modules/@xeno-corporation/account/dist/client-CVtf6u7F.d.ts +2346 -0
  11. package/node_modules/@xeno-corporation/account/dist/index.d.mts +110 -0
  12. package/node_modules/@xeno-corporation/account/dist/index.d.ts +110 -0
  13. package/node_modules/@xeno-corporation/account/dist/index.js +4115 -0
  14. package/node_modules/@xeno-corporation/account/dist/index.js.map +1 -0
  15. package/node_modules/@xeno-corporation/account/dist/index.mjs +3967 -0
  16. package/node_modules/@xeno-corporation/account/dist/index.mjs.map +1 -0
  17. package/node_modules/@xeno-corporation/account/dist/node.d.mts +109 -0
  18. package/node_modules/@xeno-corporation/account/dist/node.d.ts +109 -0
  19. package/node_modules/@xeno-corporation/account/dist/node.js +1448 -0
  20. package/node_modules/@xeno-corporation/account/dist/node.js.map +1 -0
  21. package/node_modules/@xeno-corporation/account/dist/node.mjs +1374 -0
  22. package/node_modules/@xeno-corporation/account/dist/node.mjs.map +1 -0
  23. package/node_modules/@xeno-corporation/account/package.json +62 -0
  24. package/node_modules/zod/LICENSE +21 -0
  25. package/node_modules/zod/README.md +218 -0
  26. package/node_modules/zod/compile.cjs +96 -0
  27. package/node_modules/zod/compile.d.cts +1 -0
  28. package/node_modules/zod/compile.d.ts +1 -0
  29. package/node_modules/zod/compile.js +52 -0
  30. package/node_modules/zod/index.cjs +52 -0
  31. package/node_modules/zod/index.d.cts +3 -0
  32. package/node_modules/zod/index.d.ts +3 -0
  33. package/node_modules/zod/index.js +7 -0
  34. package/node_modules/zod/locales/index.cjs +36 -0
  35. package/node_modules/zod/locales/index.d.cts +1 -0
  36. package/node_modules/zod/locales/index.d.ts +1 -0
  37. package/node_modules/zod/locales/index.js +1 -0
  38. package/node_modules/zod/locales/package.json +7 -0
  39. package/node_modules/zod/mini/index.cjs +51 -0
  40. package/node_modules/zod/mini/index.d.cts +3 -0
  41. package/node_modules/zod/mini/index.d.ts +3 -0
  42. package/node_modules/zod/mini/index.js +3 -0
  43. package/node_modules/zod/mini/package.json +7 -0
  44. package/node_modules/zod/package.json +147 -0
  45. package/node_modules/zod/src/compile.ts +56 -0
  46. package/node_modules/zod/src/index.ts +7 -0
  47. package/node_modules/zod/src/locales/index.ts +1 -0
  48. package/node_modules/zod/src/mini/index.ts +3 -0
  49. package/node_modules/zod/src/v3/ZodError.ts +340 -0
  50. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  51. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  52. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  53. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  54. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  55. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  56. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  57. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  58. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  59. package/node_modules/zod/src/v3/errors.ts +13 -0
  60. package/node_modules/zod/src/v3/external.ts +6 -0
  61. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  62. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  63. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  64. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  65. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  66. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  67. package/node_modules/zod/src/v3/index.ts +4 -0
  68. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  69. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  70. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  71. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  72. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  73. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  74. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  75. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  76. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  77. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  78. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  79. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  80. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  81. package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  82. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  83. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  84. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  85. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  86. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  87. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  88. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  89. package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
  90. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  91. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  92. package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  93. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  94. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  95. package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
  96. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  97. package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
  98. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  99. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  100. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  101. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  102. package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  103. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  104. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  105. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  106. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  107. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  108. package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
  109. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  110. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  111. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  112. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  113. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  114. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  115. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  116. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  117. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  118. package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
  119. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  120. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  121. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  122. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  123. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  124. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  125. package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
  126. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  127. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  128. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  129. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  130. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  131. package/node_modules/zod/src/v3/types.ts +5138 -0
  132. package/node_modules/zod/src/v4/classic/checks.ts +33 -0
  133. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  134. package/node_modules/zod/src/v4/classic/compat.ts +78 -0
  135. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  136. package/node_modules/zod/src/v4/classic/errors.ts +97 -0
  137. package/node_modules/zod/src/v4/classic/external.ts +57 -0
  138. package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
  139. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  140. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  141. package/node_modules/zod/src/v4/classic/iso.ts +20 -0
  142. package/node_modules/zod/src/v4/classic/parse.ts +88 -0
  143. package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
  144. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  145. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
  146. package/node_modules/zod/src/v4/classic/tests/array.test.ts +291 -0
  147. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
  148. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  149. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  150. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  151. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
  152. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
  153. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
  154. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  155. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
  156. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
  157. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  158. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  159. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  160. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  161. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
  162. package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
  163. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
  164. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  165. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  166. package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
  167. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  168. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  169. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
  170. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
  171. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
  172. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
  173. package/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
  174. package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  175. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  176. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  177. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
  178. package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
  179. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  180. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
  181. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
  182. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  183. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  184. package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
  185. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
  186. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
  187. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
  188. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  189. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
  190. package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  191. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
  192. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
  193. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  194. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  195. package/node_modules/zod/src/v4/classic/tests/map.test.ts +349 -0
  196. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  197. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  198. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  199. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  200. package/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
  201. package/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
  202. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  203. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
  204. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
  205. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
  206. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  207. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
  208. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
  209. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
  210. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  211. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  212. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  213. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  214. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
  215. package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
  216. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
  217. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  218. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
  219. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
  220. package/node_modules/zod/src/v4/classic/tests/set.test.ts +196 -0
  221. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
  222. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  223. package/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
  224. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
  225. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
  226. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  227. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
  228. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
  229. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
  230. package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
  231. package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  232. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  233. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  234. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  235. package/node_modules/zod/src/v4/core/api.ts +1875 -0
  236. package/node_modules/zod/src/v4/core/checks.ts +1266 -0
  237. package/node_modules/zod/src/v4/core/compile.ts +2322 -0
  238. package/node_modules/zod/src/v4/core/core.ts +230 -0
  239. package/node_modules/zod/src/v4/core/doc.ts +52 -0
  240. package/node_modules/zod/src/v4/core/errors.ts +543 -0
  241. package/node_modules/zod/src/v4/core/index.ts +19 -0
  242. package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
  243. package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
  244. package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
  245. package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
  246. package/node_modules/zod/src/v4/core/parse.ts +309 -0
  247. package/node_modules/zod/src/v4/core/regexes.ts +217 -0
  248. package/node_modules/zod/src/v4/core/registries.ts +105 -0
  249. package/node_modules/zod/src/v4/core/schemas.ts +5226 -0
  250. package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  251. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  252. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
  253. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  254. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  255. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  256. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  257. package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
  258. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  259. package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  260. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  261. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  262. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
  263. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  264. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
  265. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  266. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  267. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  268. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  269. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  270. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  271. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  272. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  273. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  274. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  275. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  276. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  277. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  278. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  279. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
  280. package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
  281. package/node_modules/zod/src/v4/core/util.ts +1293 -0
  282. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  283. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  284. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  285. package/node_modules/zod/src/v4/index.ts +4 -0
  286. package/node_modules/zod/src/v4/locales/ar.ts +120 -0
  287. package/node_modules/zod/src/v4/locales/az.ts +116 -0
  288. package/node_modules/zod/src/v4/locales/be.ts +188 -0
  289. package/node_modules/zod/src/v4/locales/bg.ts +133 -0
  290. package/node_modules/zod/src/v4/locales/bn.ts +123 -0
  291. package/node_modules/zod/src/v4/locales/ca.ts +121 -0
  292. package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
  293. package/node_modules/zod/src/v4/locales/cs.ts +123 -0
  294. package/node_modules/zod/src/v4/locales/da.ts +128 -0
  295. package/node_modules/zod/src/v4/locales/de.ts +121 -0
  296. package/node_modules/zod/src/v4/locales/el.ts +124 -0
  297. package/node_modules/zod/src/v4/locales/en.ts +136 -0
  298. package/node_modules/zod/src/v4/locales/eo.ts +123 -0
  299. package/node_modules/zod/src/v4/locales/es.ts +145 -0
  300. package/node_modules/zod/src/v4/locales/fa.ts +131 -0
  301. package/node_modules/zod/src/v4/locales/fi.ts +126 -0
  302. package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
  303. package/node_modules/zod/src/v4/locales/fr.ts +139 -0
  304. package/node_modules/zod/src/v4/locales/gu.ts +123 -0
  305. package/node_modules/zod/src/v4/locales/he.ts +253 -0
  306. package/node_modules/zod/src/v4/locales/hi.ts +126 -0
  307. package/node_modules/zod/src/v4/locales/hr.ts +135 -0
  308. package/node_modules/zod/src/v4/locales/hu.ts +122 -0
  309. package/node_modules/zod/src/v4/locales/hy.ts +175 -0
  310. package/node_modules/zod/src/v4/locales/id.ts +120 -0
  311. package/node_modules/zod/src/v4/locales/index.ts +63 -0
  312. package/node_modules/zod/src/v4/locales/is.ts +124 -0
  313. package/node_modules/zod/src/v4/locales/it.ts +121 -0
  314. package/node_modules/zod/src/v4/locales/ja.ts +119 -0
  315. package/node_modules/zod/src/v4/locales/ka.ts +128 -0
  316. package/node_modules/zod/src/v4/locales/kh.ts +7 -0
  317. package/node_modules/zod/src/v4/locales/km.ts +124 -0
  318. package/node_modules/zod/src/v4/locales/kn.ts +126 -0
  319. package/node_modules/zod/src/v4/locales/ko.ts +126 -0
  320. package/node_modules/zod/src/v4/locales/lt.ts +243 -0
  321. package/node_modules/zod/src/v4/locales/mk.ts +123 -0
  322. package/node_modules/zod/src/v4/locales/ms.ts +120 -0
  323. package/node_modules/zod/src/v4/locales/ne.ts +128 -0
  324. package/node_modules/zod/src/v4/locales/nl.ts +126 -0
  325. package/node_modules/zod/src/v4/locales/nn.ts +121 -0
  326. package/node_modules/zod/src/v4/locales/no.ts +121 -0
  327. package/node_modules/zod/src/v4/locales/ota.ts +122 -0
  328. package/node_modules/zod/src/v4/locales/pl.ts +123 -0
  329. package/node_modules/zod/src/v4/locales/ps.ts +131 -0
  330. package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
  331. package/node_modules/zod/src/v4/locales/pt.ts +159 -0
  332. package/node_modules/zod/src/v4/locales/ro.ts +132 -0
  333. package/node_modules/zod/src/v4/locales/ru.ts +188 -0
  334. package/node_modules/zod/src/v4/locales/sk.ts +123 -0
  335. package/node_modules/zod/src/v4/locales/sl.ts +123 -0
  336. package/node_modules/zod/src/v4/locales/sv.ts +124 -0
  337. package/node_modules/zod/src/v4/locales/ta.ts +123 -0
  338. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  339. package/node_modules/zod/src/v4/locales/th.ts +124 -0
  340. package/node_modules/zod/src/v4/locales/tk.ts +113 -0
  341. package/node_modules/zod/src/v4/locales/tr.ts +116 -0
  342. package/node_modules/zod/src/v4/locales/ua.ts +7 -0
  343. package/node_modules/zod/src/v4/locales/uk.ts +122 -0
  344. package/node_modules/zod/src/v4/locales/ur.ts +124 -0
  345. package/node_modules/zod/src/v4/locales/uz.ts +120 -0
  346. package/node_modules/zod/src/v4/locales/vi.ts +122 -0
  347. package/node_modules/zod/src/v4/locales/yo.ts +129 -0
  348. package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
  349. package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
  350. package/node_modules/zod/src/v4/mini/checks.ts +33 -0
  351. package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
  352. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  353. package/node_modules/zod/src/v4/mini/external.ts +52 -0
  354. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  355. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  356. package/node_modules/zod/src/v4/mini/iso.ts +66 -0
  357. package/node_modules/zod/src/v4/mini/parse.ts +16 -0
  358. package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
  359. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
  360. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
  361. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
  362. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
  363. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
  364. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
  365. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  366. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  367. package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
  368. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
  369. package/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
  370. package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
  371. package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
  372. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  373. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
  374. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  375. package/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
  376. package/node_modules/zod/src/v4-mini/index.ts +3 -0
  377. package/node_modules/zod/v3/ZodError.cjs +167 -0
  378. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  379. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  380. package/node_modules/zod/v3/ZodError.js +143 -0
  381. package/node_modules/zod/v3/errors.cjs +36 -0
  382. package/node_modules/zod/v3/errors.d.cts +5 -0
  383. package/node_modules/zod/v3/errors.d.ts +5 -0
  384. package/node_modules/zod/v3/errors.js +9 -0
  385. package/node_modules/zod/v3/external.cjs +41 -0
  386. package/node_modules/zod/v3/external.d.cts +6 -0
  387. package/node_modules/zod/v3/external.d.ts +6 -0
  388. package/node_modules/zod/v3/external.js +6 -0
  389. package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
  390. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  391. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  392. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  393. package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
  394. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  395. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  396. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  397. package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
  398. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  399. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  400. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  401. package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
  402. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  403. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  404. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  405. package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
  406. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  407. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  408. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  409. package/node_modules/zod/v3/helpers/util.cjs +156 -0
  410. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  411. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  412. package/node_modules/zod/v3/helpers/util.js +133 -0
  413. package/node_modules/zod/v3/index.cjs +52 -0
  414. package/node_modules/zod/v3/index.d.cts +4 -0
  415. package/node_modules/zod/v3/index.d.ts +4 -0
  416. package/node_modules/zod/v3/index.js +4 -0
  417. package/node_modules/zod/v3/locales/en.cjs +112 -0
  418. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  419. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  420. package/node_modules/zod/v3/locales/en.js +109 -0
  421. package/node_modules/zod/v3/package.json +7 -0
  422. package/node_modules/zod/v3/standard-schema.cjs +21 -0
  423. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  424. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  425. package/node_modules/zod/v3/standard-schema.js +1 -0
  426. package/node_modules/zod/v3/types.cjs +3798 -0
  427. package/node_modules/zod/v3/types.d.cts +1034 -0
  428. package/node_modules/zod/v3/types.d.ts +1034 -0
  429. package/node_modules/zod/v3/types.js +3697 -0
  430. package/node_modules/zod/v4/classic/checks.cjs +53 -0
  431. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  432. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  433. package/node_modules/zod/v4/classic/checks.js +1 -0
  434. package/node_modules/zod/v4/classic/coerce.cjs +66 -0
  435. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  436. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  437. package/node_modules/zod/v4/classic/coerce.js +17 -0
  438. package/node_modules/zod/v4/classic/compat.cjs +80 -0
  439. package/node_modules/zod/v4/classic/compat.d.cts +48 -0
  440. package/node_modules/zod/v4/classic/compat.d.ts +48 -0
  441. package/node_modules/zod/v4/classic/compat.js +31 -0
  442. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  443. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  444. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  445. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  446. package/node_modules/zod/v4/classic/errors.cjs +102 -0
  447. package/node_modules/zod/v4/classic/errors.d.cts +29 -0
  448. package/node_modules/zod/v4/classic/errors.d.ts +29 -0
  449. package/node_modules/zod/v4/classic/errors.js +57 -0
  450. package/node_modules/zod/v4/classic/external.cjs +97 -0
  451. package/node_modules/zod/v4/classic/external.d.cts +19 -0
  452. package/node_modules/zod/v4/classic/external.d.ts +19 -0
  453. package/node_modules/zod/v4/classic/external.js +17 -0
  454. package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
  455. package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  456. package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  457. package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
  458. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  459. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  460. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  461. package/node_modules/zod/v4/classic/in-out.js +36 -0
  462. package/node_modules/zod/v4/classic/index.cjs +52 -0
  463. package/node_modules/zod/v4/classic/index.d.cts +3 -0
  464. package/node_modules/zod/v4/classic/index.d.ts +3 -0
  465. package/node_modules/zod/v4/classic/index.js +4 -0
  466. package/node_modules/zod/v4/classic/iso.cjs +68 -0
  467. package/node_modules/zod/v4/classic/iso.d.cts +7 -0
  468. package/node_modules/zod/v4/classic/iso.d.ts +7 -0
  469. package/node_modules/zod/v4/classic/iso.js +15 -0
  470. package/node_modules/zod/v4/classic/package.json +7 -0
  471. package/node_modules/zod/v4/classic/parse.cjs +63 -0
  472. package/node_modules/zod/v4/classic/parse.d.cts +44 -0
  473. package/node_modules/zod/v4/classic/parse.d.ts +44 -0
  474. package/node_modules/zod/v4/classic/parse.js +16 -0
  475. package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
  476. package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
  477. package/node_modules/zod/v4/classic/schemas.d.ts +816 -0
  478. package/node_modules/zod/v4/classic/schemas.js +1535 -0
  479. package/node_modules/zod/v4/core/api.cjs +1269 -0
  480. package/node_modules/zod/v4/core/api.d.cts +335 -0
  481. package/node_modules/zod/v4/core/api.d.ts +335 -0
  482. package/node_modules/zod/v4/core/api.js +1107 -0
  483. package/node_modules/zod/v4/core/checks.cjs +561 -0
  484. package/node_modules/zod/v4/core/checks.d.cts +294 -0
  485. package/node_modules/zod/v4/core/checks.d.ts +294 -0
  486. package/node_modules/zod/v4/core/checks.js +516 -0
  487. package/node_modules/zod/v4/core/compile.cjs +1916 -0
  488. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  489. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  490. package/node_modules/zod/v4/core/compile.js +1866 -0
  491. package/node_modules/zod/v4/core/core.cjs +167 -0
  492. package/node_modules/zod/v4/core/core.d.cts +82 -0
  493. package/node_modules/zod/v4/core/core.d.ts +82 -0
  494. package/node_modules/zod/v4/core/core.js +141 -0
  495. package/node_modules/zod/v4/core/doc.cjs +61 -0
  496. package/node_modules/zod/v4/core/doc.d.cts +16 -0
  497. package/node_modules/zod/v4/core/doc.d.ts +16 -0
  498. package/node_modules/zod/v4/core/doc.js +38 -0
  499. package/node_modules/zod/v4/core/errors.cjs +317 -0
  500. package/node_modules/zod/v4/core/errors.d.cts +225 -0
  501. package/node_modules/zod/v4/core/errors.d.ts +225 -0
  502. package/node_modules/zod/v4/core/errors.js +267 -0
  503. package/node_modules/zod/v4/core/index.cjs +70 -0
  504. package/node_modules/zod/v4/core/index.d.cts +19 -0
  505. package/node_modules/zod/v4/core/index.d.ts +19 -0
  506. package/node_modules/zod/v4/core/index.js +19 -0
  507. package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
  508. package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  509. package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  510. package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
  511. package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
  512. package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
  513. package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
  514. package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
  515. package/node_modules/zod/v4/core/json-schema.cjs +21 -0
  516. package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
  517. package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
  518. package/node_modules/zod/v4/core/json-schema.js +1 -0
  519. package/node_modules/zod/v4/core/memoizer.cjs +360 -0
  520. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  521. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  522. package/node_modules/zod/v4/core/memoizer.js +311 -0
  523. package/node_modules/zod/v4/core/package.json +7 -0
  524. package/node_modules/zod/v4/core/parse.cjs +233 -0
  525. package/node_modules/zod/v4/core/parse.d.cts +52 -0
  526. package/node_modules/zod/v4/core/parse.d.ts +52 -0
  527. package/node_modules/zod/v4/core/parse.js +175 -0
  528. package/node_modules/zod/v4/core/regexes.cjs +209 -0
  529. package/node_modules/zod/v4/core/regexes.d.cts +90 -0
  530. package/node_modules/zod/v4/core/regexes.d.ts +90 -0
  531. package/node_modules/zod/v4/core/regexes.js +156 -0
  532. package/node_modules/zod/v4/core/registries.cjs +75 -0
  533. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  534. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  535. package/node_modules/zod/v4/core/registries.js +51 -0
  536. package/node_modules/zod/v4/core/schemas.cjs +2699 -0
  537. package/node_modules/zod/v4/core/schemas.d.cts +1275 -0
  538. package/node_modules/zod/v4/core/schemas.d.ts +1275 -0
  539. package/node_modules/zod/v4/core/schemas.js +2636 -0
  540. package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
  541. package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  542. package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  543. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  544. package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
  545. package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
  546. package/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
  547. package/node_modules/zod/v4/core/to-json-schema.js +651 -0
  548. package/node_modules/zod/v4/core/util.cjs +964 -0
  549. package/node_modules/zod/v4/core/util.d.cts +280 -0
  550. package/node_modules/zod/v4/core/util.d.ts +280 -0
  551. package/node_modules/zod/v4/core/util.js +873 -0
  552. package/node_modules/zod/v4/core/versions.cjs +27 -0
  553. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  554. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  555. package/node_modules/zod/v4/core/versions.js +5 -0
  556. package/node_modules/zod/v4/core/visit.cjs +214 -0
  557. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  558. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  559. package/node_modules/zod/v4/core/visit.js +169 -0
  560. package/node_modules/zod/v4/index.cjs +51 -0
  561. package/node_modules/zod/v4/index.d.cts +3 -0
  562. package/node_modules/zod/v4/index.d.ts +3 -0
  563. package/node_modules/zod/v4/index.js +4 -0
  564. package/node_modules/zod/v4/locales/ar.cjs +138 -0
  565. package/node_modules/zod/v4/locales/ar.d.cts +5 -0
  566. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  567. package/node_modules/zod/v4/locales/ar.js +111 -0
  568. package/node_modules/zod/v4/locales/az.cjs +137 -0
  569. package/node_modules/zod/v4/locales/az.d.cts +5 -0
  570. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  571. package/node_modules/zod/v4/locales/az.js +110 -0
  572. package/node_modules/zod/v4/locales/be.cjs +195 -0
  573. package/node_modules/zod/v4/locales/be.d.cts +5 -0
  574. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  575. package/node_modules/zod/v4/locales/be.js +168 -0
  576. package/node_modules/zod/v4/locales/bg.cjs +152 -0
  577. package/node_modules/zod/v4/locales/bg.d.cts +5 -0
  578. package/node_modules/zod/v4/locales/bg.d.ts +4 -0
  579. package/node_modules/zod/v4/locales/bg.js +125 -0
  580. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  581. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  582. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  583. package/node_modules/zod/v4/locales/bn.js +113 -0
  584. package/node_modules/zod/v4/locales/ca.cjs +139 -0
  585. package/node_modules/zod/v4/locales/ca.d.cts +5 -0
  586. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  587. package/node_modules/zod/v4/locales/ca.js +112 -0
  588. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  589. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  590. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  591. package/node_modules/zod/v4/locales/ckb.js +133 -0
  592. package/node_modules/zod/v4/locales/cs.cjs +143 -0
  593. package/node_modules/zod/v4/locales/cs.d.cts +5 -0
  594. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  595. package/node_modules/zod/v4/locales/cs.js +116 -0
  596. package/node_modules/zod/v4/locales/da.cjs +147 -0
  597. package/node_modules/zod/v4/locales/da.d.cts +5 -0
  598. package/node_modules/zod/v4/locales/da.d.ts +4 -0
  599. package/node_modules/zod/v4/locales/da.js +120 -0
  600. package/node_modules/zod/v4/locales/de.cjs +140 -0
  601. package/node_modules/zod/v4/locales/de.d.cts +5 -0
  602. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  603. package/node_modules/zod/v4/locales/de.js +113 -0
  604. package/node_modules/zod/v4/locales/el.cjs +139 -0
  605. package/node_modules/zod/v4/locales/el.d.cts +5 -0
  606. package/node_modules/zod/v4/locales/el.d.ts +4 -0
  607. package/node_modules/zod/v4/locales/el.js +112 -0
  608. package/node_modules/zod/v4/locales/en.cjs +152 -0
  609. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  610. package/node_modules/zod/v4/locales/en.d.ts +4 -0
  611. package/node_modules/zod/v4/locales/en.js +125 -0
  612. package/node_modules/zod/v4/locales/eo.cjs +141 -0
  613. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  614. package/node_modules/zod/v4/locales/eo.d.ts +4 -0
  615. package/node_modules/zod/v4/locales/eo.js +114 -0
  616. package/node_modules/zod/v4/locales/es.cjs +163 -0
  617. package/node_modules/zod/v4/locales/es.d.cts +5 -0
  618. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  619. package/node_modules/zod/v4/locales/es.js +136 -0
  620. package/node_modules/zod/v4/locales/fa.cjs +146 -0
  621. package/node_modules/zod/v4/locales/fa.d.cts +5 -0
  622. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  623. package/node_modules/zod/v4/locales/fa.js +119 -0
  624. package/node_modules/zod/v4/locales/fi.cjs +144 -0
  625. package/node_modules/zod/v4/locales/fi.d.cts +5 -0
  626. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  627. package/node_modules/zod/v4/locales/fi.js +117 -0
  628. package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
  629. package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  630. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  631. package/node_modules/zod/v4/locales/fr-CA.js +112 -0
  632. package/node_modules/zod/v4/locales/fr.cjs +156 -0
  633. package/node_modules/zod/v4/locales/fr.d.cts +5 -0
  634. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  635. package/node_modules/zod/v4/locales/fr.js +129 -0
  636. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  637. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  638. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  639. package/node_modules/zod/v4/locales/gu.js +113 -0
  640. package/node_modules/zod/v4/locales/he.cjs +248 -0
  641. package/node_modules/zod/v4/locales/he.d.cts +5 -0
  642. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  643. package/node_modules/zod/v4/locales/he.js +221 -0
  644. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  645. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  646. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  647. package/node_modules/zod/v4/locales/hi.js +111 -0
  648. package/node_modules/zod/v4/locales/hr.cjs +153 -0
  649. package/node_modules/zod/v4/locales/hr.d.cts +5 -0
  650. package/node_modules/zod/v4/locales/hr.d.ts +4 -0
  651. package/node_modules/zod/v4/locales/hr.js +126 -0
  652. package/node_modules/zod/v4/locales/hu.cjs +140 -0
  653. package/node_modules/zod/v4/locales/hu.d.cts +5 -0
  654. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  655. package/node_modules/zod/v4/locales/hu.js +113 -0
  656. package/node_modules/zod/v4/locales/hy.cjs +185 -0
  657. package/node_modules/zod/v4/locales/hy.d.cts +5 -0
  658. package/node_modules/zod/v4/locales/hy.d.ts +4 -0
  659. package/node_modules/zod/v4/locales/hy.js +158 -0
  660. package/node_modules/zod/v4/locales/id.cjs +138 -0
  661. package/node_modules/zod/v4/locales/id.d.cts +5 -0
  662. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  663. package/node_modules/zod/v4/locales/id.js +111 -0
  664. package/node_modules/zod/v4/locales/index.cjs +152 -0
  665. package/node_modules/zod/v4/locales/index.d.cts +63 -0
  666. package/node_modules/zod/v4/locales/index.d.ts +63 -0
  667. package/node_modules/zod/v4/locales/index.js +63 -0
  668. package/node_modules/zod/v4/locales/is.cjs +141 -0
  669. package/node_modules/zod/v4/locales/is.d.cts +5 -0
  670. package/node_modules/zod/v4/locales/is.d.ts +4 -0
  671. package/node_modules/zod/v4/locales/is.js +114 -0
  672. package/node_modules/zod/v4/locales/it.cjs +140 -0
  673. package/node_modules/zod/v4/locales/it.d.cts +5 -0
  674. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  675. package/node_modules/zod/v4/locales/it.js +113 -0
  676. package/node_modules/zod/v4/locales/ja.cjs +139 -0
  677. package/node_modules/zod/v4/locales/ja.d.cts +5 -0
  678. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  679. package/node_modules/zod/v4/locales/ja.js +112 -0
  680. package/node_modules/zod/v4/locales/ka.cjs +144 -0
  681. package/node_modules/zod/v4/locales/ka.d.cts +5 -0
  682. package/node_modules/zod/v4/locales/ka.d.ts +4 -0
  683. package/node_modules/zod/v4/locales/ka.js +117 -0
  684. package/node_modules/zod/v4/locales/kh.cjs +12 -0
  685. package/node_modules/zod/v4/locales/kh.d.cts +5 -0
  686. package/node_modules/zod/v4/locales/kh.d.ts +5 -0
  687. package/node_modules/zod/v4/locales/kh.js +5 -0
  688. package/node_modules/zod/v4/locales/km.cjs +142 -0
  689. package/node_modules/zod/v4/locales/km.d.cts +5 -0
  690. package/node_modules/zod/v4/locales/km.d.ts +4 -0
  691. package/node_modules/zod/v4/locales/km.js +115 -0
  692. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  693. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  694. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  695. package/node_modules/zod/v4/locales/kn.js +116 -0
  696. package/node_modules/zod/v4/locales/ko.cjs +143 -0
  697. package/node_modules/zod/v4/locales/ko.d.cts +5 -0
  698. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  699. package/node_modules/zod/v4/locales/ko.js +116 -0
  700. package/node_modules/zod/v4/locales/lt.cjs +234 -0
  701. package/node_modules/zod/v4/locales/lt.d.cts +5 -0
  702. package/node_modules/zod/v4/locales/lt.d.ts +4 -0
  703. package/node_modules/zod/v4/locales/lt.js +207 -0
  704. package/node_modules/zod/v4/locales/mk.cjs +141 -0
  705. package/node_modules/zod/v4/locales/mk.d.cts +5 -0
  706. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  707. package/node_modules/zod/v4/locales/mk.js +114 -0
  708. package/node_modules/zod/v4/locales/ms.cjs +139 -0
  709. package/node_modules/zod/v4/locales/ms.d.cts +5 -0
  710. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  711. package/node_modules/zod/v4/locales/ms.js +112 -0
  712. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  713. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  714. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  715. package/node_modules/zod/v4/locales/ne.js +111 -0
  716. package/node_modules/zod/v4/locales/nl.cjs +142 -0
  717. package/node_modules/zod/v4/locales/nl.d.cts +5 -0
  718. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  719. package/node_modules/zod/v4/locales/nl.js +115 -0
  720. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  721. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  722. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  723. package/node_modules/zod/v4/locales/nn.js +113 -0
  724. package/node_modules/zod/v4/locales/no.cjs +140 -0
  725. package/node_modules/zod/v4/locales/no.d.cts +5 -0
  726. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  727. package/node_modules/zod/v4/locales/no.js +113 -0
  728. package/node_modules/zod/v4/locales/ota.cjs +141 -0
  729. package/node_modules/zod/v4/locales/ota.d.cts +5 -0
  730. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  731. package/node_modules/zod/v4/locales/ota.js +114 -0
  732. package/node_modules/zod/v4/locales/package.json +7 -0
  733. package/node_modules/zod/v4/locales/pl.cjs +141 -0
  734. package/node_modules/zod/v4/locales/pl.d.cts +5 -0
  735. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  736. package/node_modules/zod/v4/locales/pl.js +114 -0
  737. package/node_modules/zod/v4/locales/ps.cjs +146 -0
  738. package/node_modules/zod/v4/locales/ps.d.cts +5 -0
  739. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  740. package/node_modules/zod/v4/locales/ps.js +119 -0
  741. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  742. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  743. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  744. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  745. package/node_modules/zod/v4/locales/pt.cjs +169 -0
  746. package/node_modules/zod/v4/locales/pt.d.cts +5 -0
  747. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  748. package/node_modules/zod/v4/locales/pt.js +142 -0
  749. package/node_modules/zod/v4/locales/ro.cjs +149 -0
  750. package/node_modules/zod/v4/locales/ro.d.cts +5 -0
  751. package/node_modules/zod/v4/locales/ro.d.ts +4 -0
  752. package/node_modules/zod/v4/locales/ro.js +122 -0
  753. package/node_modules/zod/v4/locales/ru.cjs +195 -0
  754. package/node_modules/zod/v4/locales/ru.d.cts +5 -0
  755. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  756. package/node_modules/zod/v4/locales/ru.js +168 -0
  757. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  758. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  759. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  760. package/node_modules/zod/v4/locales/sk.js +116 -0
  761. package/node_modules/zod/v4/locales/sl.cjs +141 -0
  762. package/node_modules/zod/v4/locales/sl.d.cts +5 -0
  763. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  764. package/node_modules/zod/v4/locales/sl.js +114 -0
  765. package/node_modules/zod/v4/locales/sv.cjs +142 -0
  766. package/node_modules/zod/v4/locales/sv.d.cts +5 -0
  767. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  768. package/node_modules/zod/v4/locales/sv.js +115 -0
  769. package/node_modules/zod/v4/locales/ta.cjs +142 -0
  770. package/node_modules/zod/v4/locales/ta.d.cts +5 -0
  771. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  772. package/node_modules/zod/v4/locales/ta.js +115 -0
  773. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  774. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  775. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  776. package/node_modules/zod/v4/locales/tg.js +117 -0
  777. package/node_modules/zod/v4/locales/th.cjs +142 -0
  778. package/node_modules/zod/v4/locales/th.d.cts +5 -0
  779. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  780. package/node_modules/zod/v4/locales/th.js +115 -0
  781. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  782. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  783. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  784. package/node_modules/zod/v4/locales/tk.js +107 -0
  785. package/node_modules/zod/v4/locales/tr.cjs +137 -0
  786. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  787. package/node_modules/zod/v4/locales/tr.d.ts +4 -0
  788. package/node_modules/zod/v4/locales/tr.js +110 -0
  789. package/node_modules/zod/v4/locales/ua.cjs +12 -0
  790. package/node_modules/zod/v4/locales/ua.d.cts +5 -0
  791. package/node_modules/zod/v4/locales/ua.d.ts +5 -0
  792. package/node_modules/zod/v4/locales/ua.js +5 -0
  793. package/node_modules/zod/v4/locales/uk.cjs +140 -0
  794. package/node_modules/zod/v4/locales/uk.d.cts +5 -0
  795. package/node_modules/zod/v4/locales/uk.d.ts +4 -0
  796. package/node_modules/zod/v4/locales/uk.js +113 -0
  797. package/node_modules/zod/v4/locales/ur.cjs +142 -0
  798. package/node_modules/zod/v4/locales/ur.d.cts +5 -0
  799. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  800. package/node_modules/zod/v4/locales/ur.js +115 -0
  801. package/node_modules/zod/v4/locales/uz.cjs +140 -0
  802. package/node_modules/zod/v4/locales/uz.d.cts +5 -0
  803. package/node_modules/zod/v4/locales/uz.d.ts +4 -0
  804. package/node_modules/zod/v4/locales/uz.js +113 -0
  805. package/node_modules/zod/v4/locales/vi.cjs +140 -0
  806. package/node_modules/zod/v4/locales/vi.d.cts +5 -0
  807. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  808. package/node_modules/zod/v4/locales/vi.js +113 -0
  809. package/node_modules/zod/v4/locales/yo.cjs +139 -0
  810. package/node_modules/zod/v4/locales/yo.d.cts +5 -0
  811. package/node_modules/zod/v4/locales/yo.d.ts +4 -0
  812. package/node_modules/zod/v4/locales/yo.js +112 -0
  813. package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
  814. package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  815. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  816. package/node_modules/zod/v4/locales/zh-CN.js +114 -0
  817. package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
  818. package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  819. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  820. package/node_modules/zod/v4/locales/zh-TW.js +112 -0
  821. package/node_modules/zod/v4/mini/checks.cjs +54 -0
  822. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  823. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  824. package/node_modules/zod/v4/mini/checks.js +1 -0
  825. package/node_modules/zod/v4/mini/coerce.cjs +71 -0
  826. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  827. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  828. package/node_modules/zod/v4/mini/coerce.js +22 -0
  829. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  830. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  831. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  832. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  833. package/node_modules/zod/v4/mini/external.cjs +95 -0
  834. package/node_modules/zod/v4/mini/external.d.cts +16 -0
  835. package/node_modules/zod/v4/mini/external.d.ts +16 -0
  836. package/node_modules/zod/v4/mini/external.js +16 -0
  837. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  838. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  839. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  840. package/node_modules/zod/v4/mini/in-out.js +36 -0
  841. package/node_modules/zod/v4/mini/index.cjs +51 -0
  842. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  843. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  844. package/node_modules/zod/v4/mini/index.js +3 -0
  845. package/node_modules/zod/v4/mini/iso.cjs +83 -0
  846. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  847. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  848. package/node_modules/zod/v4/mini/iso.js +34 -0
  849. package/node_modules/zod/v4/mini/package.json +7 -0
  850. package/node_modules/zod/v4/mini/parse.cjs +37 -0
  851. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  852. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  853. package/node_modules/zod/v4/mini/parse.js +1 -0
  854. package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
  855. package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
  856. package/node_modules/zod/v4/mini/schemas.d.ts +480 -0
  857. package/node_modules/zod/v4/mini/schemas.js +1002 -0
  858. package/node_modules/zod/v4/package.json +7 -0
  859. package/node_modules/zod/v4-mini/index.cjs +51 -0
  860. package/node_modules/zod/v4-mini/index.d.cts +3 -0
  861. package/node_modules/zod/v4-mini/index.d.ts +3 -0
  862. package/node_modules/zod/v4-mini/index.js +3 -0
  863. package/node_modules/zod/v4-mini/package.json +7 -0
  864. package/package.json +94 -94
@@ -0,0 +1,2346 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * The XENO Account & Ledger contract — canonical types.
5
+ *
6
+ * These Zod schemas ARE the contract every branch (app) and the origin
7
+ * (xeno-platform) speak. See `XENO ACCOUNT - ARCHITECTURE.md`. Money is always
8
+ * integer **micro-credits** (1 credit = 1_000_000 µcr) — never a float.
9
+ */
10
+ /** 1 credit expressed in the integer base unit. */
11
+ declare const MICRO_PER_CREDIT = 1000000;
12
+ /** A surface = the originating app/branch, the "from where" attribution. */
13
+ declare const surfaceSchema: z.ZodString;
14
+ type Surface = z.infer<typeof surfaceSchema>;
15
+ /**
16
+ * The canonical XENO account as a branch sees it. `id` is the canonical
17
+ * `platform_user_id`; identity is keyed on (provider, subject) upstream, never
18
+ * on the email — `email` here is contact/display only.
19
+ */
20
+ declare const accountSchema: z.ZodObject<{
21
+ id: z.ZodString;
22
+ email: z.ZodString;
23
+ username: z.ZodDefault<z.ZodNullable<z.ZodString>>;
24
+ displayName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
25
+ avatarUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
26
+ emailVerified: z.ZodDefault<z.ZodBoolean>;
27
+ linkedSurfaces: z.ZodDefault<z.ZodArray<z.ZodString>>;
28
+ }, z.core.$strip>;
29
+ type Account = z.infer<typeof accountSchema>;
30
+ declare const tokenSetSchema: z.ZodObject<{
31
+ accessToken: z.ZodString;
32
+ tokenType: z.ZodDefault<z.ZodString>;
33
+ expiresAt: z.ZodDefault<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
34
+ refreshToken: z.ZodDefault<z.ZodNullable<z.ZodString>>;
35
+ idToken: z.ZodDefault<z.ZodNullable<z.ZodString>>;
36
+ scope: z.ZodDefault<z.ZodArray<z.ZodString>>;
37
+ sid: z.ZodDefault<z.ZodNullable<z.ZodString>>;
38
+ accessClaims: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
39
+ idClaims: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
40
+ }, z.core.$strip>;
41
+ type TokenSet = z.infer<typeof tokenSetSchema>;
42
+ /** Raw OAuth 2.0 token endpoint response (snake_case, as servers emit it). */
43
+ declare const oauthTokenResponseSchema: z.ZodObject<{
44
+ access_token: z.ZodString;
45
+ token_type: z.ZodDefault<z.ZodString>;
46
+ expires_in: z.ZodOptional<z.ZodNumber>;
47
+ refresh_token: z.ZodOptional<z.ZodString>;
48
+ id_token: z.ZodOptional<z.ZodString>;
49
+ scope: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>;
51
+ type OAuthTokenResponse = z.infer<typeof oauthTokenResponseSchema>;
52
+ /**
53
+ * The three balances every double-entry wallet exposes. Gate spend decisions
54
+ * on `availableMicro` (most conservative). All values are integer micro-credits.
55
+ */
56
+ declare const balanceSchema: z.ZodObject<{
57
+ postedMicro: z.ZodNumber;
58
+ pendingMicro: z.ZodNumber;
59
+ availableMicro: z.ZodNumber;
60
+ currency: z.ZodDefault<z.ZodLiteral<"credits">>;
61
+ asOf: z.ZodDefault<z.ZodCoercedDate<unknown>>;
62
+ }, z.core.$strip>;
63
+ type Balance = z.infer<typeof balanceSchema>;
64
+ declare const meterAggregationSchema: z.ZodEnum<{
65
+ sum: "sum";
66
+ count: "count";
67
+ max: "max";
68
+ min: "min";
69
+ unique_count: "unique_count";
70
+ latest: "latest";
71
+ }>;
72
+ type MeterAggregation = z.infer<typeof meterAggregationSchema>;
73
+ /**
74
+ * A usage event posted to the meter. `transactionId` MUST be deterministic
75
+ * (a hash of the business event), never a random id minted at send time — it
76
+ * is the dedup key (32–34 day window) that makes metering exactly-once.
77
+ */
78
+ declare const usageEventSchema: z.ZodObject<{
79
+ surface: z.ZodString;
80
+ transactionId: z.ZodString;
81
+ operation: z.ZodString;
82
+ model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
83
+ provider: z.ZodDefault<z.ZodNullable<z.ZodString>>;
84
+ costMicro: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
85
+ inputTokens: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
86
+ outputTokens: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
87
+ dimensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
88
+ occurredAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
89
+ }, z.core.$strip>;
90
+ type UsageEvent = z.infer<typeof usageEventSchema>;
91
+ declare const usageResultSchema: z.ZodObject<{
92
+ accepted: z.ZodBoolean;
93
+ duplicate: z.ZodDefault<z.ZodBoolean>;
94
+ costMicro: z.ZodNumber;
95
+ transactionId: z.ZodString;
96
+ balance: z.ZodDefault<z.ZodNullable<z.ZodObject<{
97
+ postedMicro: z.ZodNumber;
98
+ pendingMicro: z.ZodNumber;
99
+ availableMicro: z.ZodNumber;
100
+ currency: z.ZodDefault<z.ZodLiteral<"credits">>;
101
+ asOf: z.ZodDefault<z.ZodCoercedDate<unknown>>;
102
+ }, z.core.$strip>>>;
103
+ }, z.core.$strip>;
104
+ type UsageResult = z.infer<typeof usageResultSchema>;
105
+ /** A two-phase hold (reserve → settle/void) for hard per-use gating. */
106
+ declare const holdRequestSchema: z.ZodObject<{
107
+ surface: z.ZodString;
108
+ holdId: z.ZodString;
109
+ amountMicro: z.ZodNumber;
110
+ operation: z.ZodString;
111
+ expiresInSeconds: z.ZodDefault<z.ZodNumber>;
112
+ dimensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
113
+ }, z.core.$strip>;
114
+ type HoldRequest = z.infer<typeof holdRequestSchema>;
115
+ declare const holdSchema: z.ZodObject<{
116
+ holdId: z.ZodString;
117
+ state: z.ZodEnum<{
118
+ held: "held";
119
+ settled: "settled";
120
+ voided: "voided";
121
+ expired: "expired";
122
+ }>;
123
+ amountMicro: z.ZodNumber;
124
+ settledMicro: z.ZodDefault<z.ZodNumber>;
125
+ balance: z.ZodDefault<z.ZodNullable<z.ZodObject<{
126
+ postedMicro: z.ZodNumber;
127
+ pendingMicro: z.ZodNumber;
128
+ availableMicro: z.ZodNumber;
129
+ currency: z.ZodDefault<z.ZodLiteral<"credits">>;
130
+ asOf: z.ZodDefault<z.ZodCoercedDate<unknown>>;
131
+ }, z.core.$strip>>>;
132
+ }, z.core.$strip>;
133
+ type Hold = z.infer<typeof holdSchema>;
134
+ declare const authzCheckSchema: z.ZodObject<{
135
+ subject: z.ZodString;
136
+ relation: z.ZodString;
137
+ object: z.ZodString;
138
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
139
+ }, z.core.$strip>;
140
+ type AuthzCheck = z.infer<typeof authzCheckSchema>;
141
+ declare const authzResultSchema: z.ZodObject<{
142
+ allowed: z.ZodBoolean;
143
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
144
+ }, z.core.$strip>;
145
+ type AuthzResult = z.infer<typeof authzResultSchema>;
146
+ /** Convert whole credits → integer micro-credits. */
147
+ declare function toMicro(credits: number): number;
148
+ /** Convert integer micro-credits → whole credits (may be fractional). */
149
+ declare function fromMicro(micro: number): number;
150
+
151
+ /**
152
+ * Normalised error taxonomy for the account client. Every failure a branch can
153
+ * see maps to one of these codes so callers branch on `code`, never on strings.
154
+ */
155
+ type AccountErrorCode = 'DISABLED' | 'UNREACHABLE' | 'INVALID_TOKEN' | 'INSUFFICIENT_CREDITS' | 'CONFLICT' | 'INVALID_RESPONSE' | 'BAD_REQUEST' | 'NOT_FOUND' | 'RATE_LIMITED' | 'PLATFORM_ERROR';
156
+ declare class AccountError extends Error {
157
+ readonly code: AccountErrorCode;
158
+ readonly httpStatus: number | null;
159
+ readonly retryable: boolean;
160
+ readonly retryAfterMs: number | null;
161
+ readonly oauthError: string | null;
162
+ constructor(args: {
163
+ code: AccountErrorCode;
164
+ message: string;
165
+ httpStatus?: number | null;
166
+ retryable?: boolean;
167
+ retryAfterMs?: number | null;
168
+ oauthError?: string | null;
169
+ });
170
+ }
171
+ /** Map an HTTP status to the right error code. */
172
+ declare function codeForStatus(status: number): AccountErrorCode;
173
+
174
+ /**
175
+ * Minimal, dependency-free HTTP transport for the account client.
176
+ *
177
+ * Design rules (from `XENO ACCOUNT - ARCHITECTURE.md` §4.4):
178
+ * - Mutations carry an `Idempotency-Key`; the SDK NEVER auto-retries a mutation
179
+ * without one (would risk a double-charge). With a key, retrying is safe
180
+ * because the origin replays the first response.
181
+ * - GETs are safely retried on network/5xx with capped backoff.
182
+ * - The bearer token is sent in the Authorization header, never logged.
183
+ */
184
+ interface TransportOptions {
185
+ /** Injectable for tests; defaults to global fetch. */
186
+ fetchImpl?: typeof fetch;
187
+ timeoutMs?: number;
188
+ /** Retry attempts for idempotent requests (GET, or mutation with a key). */
189
+ maxRetries?: number;
190
+ userAgent?: string;
191
+ /** Maximum decoded response bytes. Oversized responses fail, never truncate. */
192
+ maxResponseBytes?: number;
193
+ }
194
+ interface RequestArgs {
195
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
196
+ url: string;
197
+ token?: string | null;
198
+ tokenType?: 'Bearer' | 'DPoP';
199
+ body?: unknown;
200
+ /** Required to make a mutation retry-safe. */
201
+ idempotencyKey?: string;
202
+ /** Extra headers (e.g. DPoP proof). */
203
+ headers?: Record<string, string>;
204
+ /** Host-owned authorization refreshed for each attempt; DPoP proofs are single use. */
205
+ authorization?: RequestAuthorizationProvider;
206
+ /** Only canonical OAuth grant endpoints opt into safe error-code extraction. */
207
+ oauthErrorResponse?: boolean;
208
+ /** Caller cancellation is nonretryable and covers authorization/body as well as fetch. */
209
+ signal?: AbortSignal;
210
+ }
211
+ interface RequestAuthorization {
212
+ token: string;
213
+ tokenType: 'Bearer' | 'DPoP';
214
+ headers?: Record<string, string>;
215
+ }
216
+ type RequestAuthorizationProvider = (method: RequestArgs['method'], url: string) => Promise<RequestAuthorization>;
217
+ type AuthorizationInput = string | RequestAuthorization | RequestAuthorizationProvider;
218
+ declare class Transport {
219
+ private readonly fetchImpl;
220
+ private readonly timeoutMs;
221
+ private readonly maxRetries;
222
+ private readonly userAgent;
223
+ private readonly maxResponseBytes;
224
+ constructor(opts?: TransportOptions);
225
+ /** Perform a request and return parsed JSON (or null for empty bodies). */
226
+ request<T = unknown>(args: RequestArgs): Promise<T>;
227
+ private once;
228
+ }
229
+
230
+ /**
231
+ * Account client — the identity-read side. Resolves a token to its canonical
232
+ * XENO account.
233
+ *
234
+ * Targets the v2 `/api/v2/me`, with a graceful fall-back to the legacy
235
+ * `/api/auth/me` envelope (`{ success, user: {...} }`) so it works against the
236
+ * live platform today, before the v2 surface ships.
237
+ */
238
+ declare class AccountClient {
239
+ private readonly base;
240
+ private readonly transport;
241
+ constructor(base: string, transport: Transport);
242
+ /** Resolve a token to its account, or throw an AccountError. */
243
+ me(auth: AuthorizationInput): Promise<Account>;
244
+ }
245
+ /**
246
+ * Normalise either a v2 account or the legacy `{ user }` envelope into the
247
+ * canonical {@link Account}. Tolerant of snake/camel; null only if no id+email.
248
+ */
249
+ declare function normalize(body: unknown): Account | null;
250
+
251
+ /** Caller-facing input types (defaults not yet applied). */
252
+ type UsageEventInput = z.input<typeof usageEventSchema>;
253
+ type HoldRequestInput = z.input<typeof holdRequestSchema>;
254
+ /**
255
+ * Ledger client — the spend side of the contract. Targets the origin's
256
+ * `/api/v2/ledger/*` surface. Every mutation is idempotent: usage events key on
257
+ * a deterministic `transactionId`, holds on a `holdId`, and both are sent as the
258
+ * `Idempotency-Key` so a retry can never double-charge.
259
+ *
260
+ * Spend decisions gate on `balance.availableMicro` (the most conservative of the
261
+ * three balances). All amounts are integer micro-credits.
262
+ */
263
+ declare class LedgerClient {
264
+ private readonly apiBase;
265
+ private readonly transport;
266
+ constructor(apiBase: string, transport: Transport);
267
+ /** Posted / pending / available balance for the token's account. */
268
+ getBalance(auth: AuthorizationInput): Promise<Balance>;
269
+ /**
270
+ * Record a usage event (the meter). Idempotent on `transactionId`; a duplicate
271
+ * returns `{ duplicate: true }` and does not charge again.
272
+ */
273
+ recordUsage(auth: AuthorizationInput, event: UsageEventInput): Promise<UsageResult>;
274
+ /**
275
+ * Reserve credits for a per-use action (phase 1 of two-phase spend). Rejected
276
+ * with `INSUFFICIENT_CREDITS` if `available < amount`. Idempotent on `holdId`.
277
+ */
278
+ hold(auth: AuthorizationInput, req: HoldRequestInput): Promise<Hold>;
279
+ /**
280
+ * Settle a hold for the actual cost (phase 2). Posting less than the held
281
+ * amount auto-restores the remainder. Idempotent on `holdId`.
282
+ */
283
+ settle(auth: AuthorizationInput, holdId: string, actualCostMicro: number): Promise<Hold>;
284
+ /** Release a hold without charging (failure/cancel). Idempotent on `holdId`. */
285
+ void(auth: AuthorizationInput, holdId: string): Promise<Hold>;
286
+ }
287
+
288
+ /**
289
+ * Authorization client — ReBAC checks against the origin's central authz
290
+ * service (OpenFGA-backed). A branch asks "may this subject perform this
291
+ * relation on this object?"; the origin is the single source of truth so
292
+ * cross-app permission inheritance works without per-app role sync.
293
+ *
294
+ * Fail-closed: any transport error surfaces as an AccountError; callers must
295
+ * treat a non-`allowed` result (or an error) as deny.
296
+ */
297
+ declare class AuthzClient {
298
+ private readonly apiBase;
299
+ private readonly transport;
300
+ constructor(apiBase: string, transport: Transport);
301
+ check(auth: AuthorizationInput, check: AuthzCheck): Promise<AuthzResult>;
302
+ }
303
+
304
+ declare const membershipMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
305
+ action: z.ZodLiteral<"invite.create">;
306
+ email: z.ZodString;
307
+ role: z.ZodEnum<{
308
+ admin: "admin";
309
+ member: "member";
310
+ viewer: "viewer";
311
+ }>;
312
+ }, z.core.$strict>, z.ZodObject<{
313
+ action: z.ZodLiteral<"invite.revoke">;
314
+ inviteId: z.ZodString;
315
+ }, z.core.$strict>, z.ZodObject<{
316
+ action: z.ZodLiteral<"invite.resend">;
317
+ inviteId: z.ZodString;
318
+ }, z.core.$strict>, z.ZodObject<{
319
+ action: z.ZodLiteral<"member.role">;
320
+ memberId: z.ZodString;
321
+ role: z.ZodEnum<{
322
+ admin: "admin";
323
+ member: "member";
324
+ viewer: "viewer";
325
+ }>;
326
+ }, z.core.$strict>, z.ZodObject<{
327
+ action: z.ZodLiteral<"member.remove">;
328
+ memberId: z.ZodString;
329
+ }, z.core.$strict>, z.ZodObject<{
330
+ action: z.ZodLiteral<"owner.transfer">;
331
+ newOwnerId: z.ZodString;
332
+ }, z.core.$strict>], "action">;
333
+ type WorkspaceMembershipMutation = z.infer<typeof membershipMutationSchema>;
334
+ declare const membershipCommittedSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
335
+ action: z.ZodLiteral<"invite.create">;
336
+ result: z.ZodObject<{
337
+ invite: z.ZodObject<{
338
+ id: z.ZodString;
339
+ workspace_id: z.ZodString;
340
+ invited_email: z.ZodString;
341
+ role: z.ZodEnum<{
342
+ admin: "admin";
343
+ member: "member";
344
+ viewer: "viewer";
345
+ }>;
346
+ status: z.ZodEnum<{
347
+ pending: "pending";
348
+ revoked: "revoked";
349
+ }>;
350
+ expires_at: z.ZodString;
351
+ }, z.core.$strict>;
352
+ delivery: z.ZodObject<{
353
+ id: z.ZodString;
354
+ state: z.ZodLiteral<"queued">;
355
+ }, z.core.$strict>;
356
+ }, z.core.$strict>;
357
+ operation_id: z.ZodString;
358
+ workspace_id: z.ZodString;
359
+ actor_user_id: z.ZodString;
360
+ client_id: z.ZodString;
361
+ committed_at: z.ZodString;
362
+ }, z.core.$strict>, z.ZodObject<{
363
+ action: z.ZodLiteral<"invite.resend">;
364
+ result: z.ZodObject<{
365
+ invite: z.ZodObject<{
366
+ id: z.ZodString;
367
+ workspace_id: z.ZodString;
368
+ invited_email: z.ZodString;
369
+ role: z.ZodEnum<{
370
+ admin: "admin";
371
+ member: "member";
372
+ viewer: "viewer";
373
+ }>;
374
+ status: z.ZodEnum<{
375
+ pending: "pending";
376
+ revoked: "revoked";
377
+ }>;
378
+ expires_at: z.ZodString;
379
+ }, z.core.$strict>;
380
+ delivery: z.ZodObject<{
381
+ id: z.ZodString;
382
+ state: z.ZodLiteral<"queued">;
383
+ }, z.core.$strict>;
384
+ }, z.core.$strict>;
385
+ operation_id: z.ZodString;
386
+ workspace_id: z.ZodString;
387
+ actor_user_id: z.ZodString;
388
+ client_id: z.ZodString;
389
+ committed_at: z.ZodString;
390
+ }, z.core.$strict>, z.ZodObject<{
391
+ action: z.ZodLiteral<"invite.revoke">;
392
+ result: z.ZodObject<{
393
+ invite: z.ZodObject<{
394
+ id: z.ZodString;
395
+ workspace_id: z.ZodString;
396
+ invited_email: z.ZodString;
397
+ role: z.ZodEnum<{
398
+ admin: "admin";
399
+ member: "member";
400
+ viewer: "viewer";
401
+ }>;
402
+ status: z.ZodEnum<{
403
+ pending: "pending";
404
+ revoked: "revoked";
405
+ }>;
406
+ expires_at: z.ZodString;
407
+ }, z.core.$strict>;
408
+ }, z.core.$strict>;
409
+ operation_id: z.ZodString;
410
+ workspace_id: z.ZodString;
411
+ actor_user_id: z.ZodString;
412
+ client_id: z.ZodString;
413
+ committed_at: z.ZodString;
414
+ }, z.core.$strict>, z.ZodObject<{
415
+ action: z.ZodLiteral<"member.role">;
416
+ result: z.ZodObject<{
417
+ memberId: z.ZodString;
418
+ role: z.ZodEnum<{
419
+ admin: "admin";
420
+ member: "member";
421
+ viewer: "viewer";
422
+ }>;
423
+ }, z.core.$strict>;
424
+ operation_id: z.ZodString;
425
+ workspace_id: z.ZodString;
426
+ actor_user_id: z.ZodString;
427
+ client_id: z.ZodString;
428
+ committed_at: z.ZodString;
429
+ }, z.core.$strict>, z.ZodObject<{
430
+ action: z.ZodLiteral<"member.remove">;
431
+ result: z.ZodObject<{
432
+ memberId: z.ZodString;
433
+ }, z.core.$strict>;
434
+ operation_id: z.ZodString;
435
+ workspace_id: z.ZodString;
436
+ actor_user_id: z.ZodString;
437
+ client_id: z.ZodString;
438
+ committed_at: z.ZodString;
439
+ }, z.core.$strict>, z.ZodObject<{
440
+ action: z.ZodLiteral<"owner.transfer">;
441
+ result: z.ZodObject<{
442
+ memberId: z.ZodString;
443
+ previousOwnerId: z.ZodString;
444
+ }, z.core.$strict>;
445
+ operation_id: z.ZodString;
446
+ workspace_id: z.ZodString;
447
+ actor_user_id: z.ZodString;
448
+ client_id: z.ZodString;
449
+ committed_at: z.ZodString;
450
+ }, z.core.$strict>], "action">;
451
+ declare const membershipRejectedSchema: z.ZodObject<{
452
+ action: z.ZodEnum<{
453
+ "invite.create": "invite.create";
454
+ "invite.revoke": "invite.revoke";
455
+ "invite.resend": "invite.resend";
456
+ "member.role": "member.role";
457
+ "member.remove": "member.remove";
458
+ "owner.transfer": "owner.transfer";
459
+ }>;
460
+ rejection: z.ZodEnum<{
461
+ invalid_membership_request: "invalid_membership_request";
462
+ member_not_found: "member_not_found";
463
+ owner_transfer_required: "owner_transfer_required";
464
+ owner_target_not_member: "owner_target_not_member";
465
+ invite_not_found: "invite_not_found";
466
+ invite_already_pending: "invite_already_pending";
467
+ already_member: "already_member";
468
+ seat_limit: "seat_limit";
469
+ }>;
470
+ operation_id: z.ZodString;
471
+ workspace_id: z.ZodString;
472
+ actor_user_id: z.ZodString;
473
+ client_id: z.ZodString;
474
+ committed_at: z.ZodString;
475
+ }, z.core.$strict>;
476
+ declare const membershipAbandonedSchema: z.ZodObject<{
477
+ action: z.ZodEnum<{
478
+ "invite.create": "invite.create";
479
+ "invite.revoke": "invite.revoke";
480
+ "invite.resend": "invite.resend";
481
+ "member.role": "member.role";
482
+ "member.remove": "member.remove";
483
+ "owner.transfer": "owner.transfer";
484
+ }>;
485
+ workspace_id: z.ZodString;
486
+ operation_id: z.ZodString;
487
+ actor_user_id: z.ZodString;
488
+ client_id: z.ZodString;
489
+ committed_at: z.ZodString;
490
+ abandoned: z.ZodLiteral<true>;
491
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
492
+ action: z.ZodLiteral<"invite.create">;
493
+ email: z.ZodString;
494
+ role: z.ZodEnum<{
495
+ admin: "admin";
496
+ member: "member";
497
+ viewer: "viewer";
498
+ }>;
499
+ }, z.core.$strict>, z.ZodObject<{
500
+ action: z.ZodLiteral<"invite.revoke">;
501
+ inviteId: z.ZodString;
502
+ }, z.core.$strict>, z.ZodObject<{
503
+ action: z.ZodLiteral<"invite.resend">;
504
+ inviteId: z.ZodString;
505
+ }, z.core.$strict>, z.ZodObject<{
506
+ action: z.ZodLiteral<"member.role">;
507
+ memberId: z.ZodString;
508
+ role: z.ZodEnum<{
509
+ admin: "admin";
510
+ member: "member";
511
+ viewer: "viewer";
512
+ }>;
513
+ }, z.core.$strict>, z.ZodObject<{
514
+ action: z.ZodLiteral<"member.remove">;
515
+ memberId: z.ZodString;
516
+ }, z.core.$strict>, z.ZodObject<{
517
+ action: z.ZodLiteral<"owner.transfer">;
518
+ newOwnerId: z.ZodString;
519
+ }, z.core.$strict>], "action">;
520
+ }, z.core.$strict>;
521
+ declare const membershipOperationSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
522
+ action: z.ZodLiteral<"invite.create">;
523
+ result: z.ZodObject<{
524
+ invite: z.ZodObject<{
525
+ id: z.ZodString;
526
+ workspace_id: z.ZodString;
527
+ invited_email: z.ZodString;
528
+ role: z.ZodEnum<{
529
+ admin: "admin";
530
+ member: "member";
531
+ viewer: "viewer";
532
+ }>;
533
+ status: z.ZodEnum<{
534
+ pending: "pending";
535
+ revoked: "revoked";
536
+ }>;
537
+ expires_at: z.ZodString;
538
+ }, z.core.$strict>;
539
+ delivery: z.ZodObject<{
540
+ id: z.ZodString;
541
+ state: z.ZodLiteral<"queued">;
542
+ }, z.core.$strict>;
543
+ }, z.core.$strict>;
544
+ operation_id: z.ZodString;
545
+ workspace_id: z.ZodString;
546
+ actor_user_id: z.ZodString;
547
+ client_id: z.ZodString;
548
+ committed_at: z.ZodString;
549
+ }, z.core.$strict>, z.ZodObject<{
550
+ action: z.ZodLiteral<"invite.resend">;
551
+ result: z.ZodObject<{
552
+ invite: z.ZodObject<{
553
+ id: z.ZodString;
554
+ workspace_id: z.ZodString;
555
+ invited_email: z.ZodString;
556
+ role: z.ZodEnum<{
557
+ admin: "admin";
558
+ member: "member";
559
+ viewer: "viewer";
560
+ }>;
561
+ status: z.ZodEnum<{
562
+ pending: "pending";
563
+ revoked: "revoked";
564
+ }>;
565
+ expires_at: z.ZodString;
566
+ }, z.core.$strict>;
567
+ delivery: z.ZodObject<{
568
+ id: z.ZodString;
569
+ state: z.ZodLiteral<"queued">;
570
+ }, z.core.$strict>;
571
+ }, z.core.$strict>;
572
+ operation_id: z.ZodString;
573
+ workspace_id: z.ZodString;
574
+ actor_user_id: z.ZodString;
575
+ client_id: z.ZodString;
576
+ committed_at: z.ZodString;
577
+ }, z.core.$strict>, z.ZodObject<{
578
+ action: z.ZodLiteral<"invite.revoke">;
579
+ result: z.ZodObject<{
580
+ invite: z.ZodObject<{
581
+ id: z.ZodString;
582
+ workspace_id: z.ZodString;
583
+ invited_email: z.ZodString;
584
+ role: z.ZodEnum<{
585
+ admin: "admin";
586
+ member: "member";
587
+ viewer: "viewer";
588
+ }>;
589
+ status: z.ZodEnum<{
590
+ pending: "pending";
591
+ revoked: "revoked";
592
+ }>;
593
+ expires_at: z.ZodString;
594
+ }, z.core.$strict>;
595
+ }, z.core.$strict>;
596
+ operation_id: z.ZodString;
597
+ workspace_id: z.ZodString;
598
+ actor_user_id: z.ZodString;
599
+ client_id: z.ZodString;
600
+ committed_at: z.ZodString;
601
+ }, z.core.$strict>, z.ZodObject<{
602
+ action: z.ZodLiteral<"member.role">;
603
+ result: z.ZodObject<{
604
+ memberId: z.ZodString;
605
+ role: z.ZodEnum<{
606
+ admin: "admin";
607
+ member: "member";
608
+ viewer: "viewer";
609
+ }>;
610
+ }, z.core.$strict>;
611
+ operation_id: z.ZodString;
612
+ workspace_id: z.ZodString;
613
+ actor_user_id: z.ZodString;
614
+ client_id: z.ZodString;
615
+ committed_at: z.ZodString;
616
+ }, z.core.$strict>, z.ZodObject<{
617
+ action: z.ZodLiteral<"member.remove">;
618
+ result: z.ZodObject<{
619
+ memberId: z.ZodString;
620
+ }, z.core.$strict>;
621
+ operation_id: z.ZodString;
622
+ workspace_id: z.ZodString;
623
+ actor_user_id: z.ZodString;
624
+ client_id: z.ZodString;
625
+ committed_at: z.ZodString;
626
+ }, z.core.$strict>, z.ZodObject<{
627
+ action: z.ZodLiteral<"owner.transfer">;
628
+ result: z.ZodObject<{
629
+ memberId: z.ZodString;
630
+ previousOwnerId: z.ZodString;
631
+ }, z.core.$strict>;
632
+ operation_id: z.ZodString;
633
+ workspace_id: z.ZodString;
634
+ actor_user_id: z.ZodString;
635
+ client_id: z.ZodString;
636
+ committed_at: z.ZodString;
637
+ }, z.core.$strict>], "action">, z.ZodObject<{
638
+ action: z.ZodEnum<{
639
+ "invite.create": "invite.create";
640
+ "invite.revoke": "invite.revoke";
641
+ "invite.resend": "invite.resend";
642
+ "member.role": "member.role";
643
+ "member.remove": "member.remove";
644
+ "owner.transfer": "owner.transfer";
645
+ }>;
646
+ rejection: z.ZodEnum<{
647
+ invalid_membership_request: "invalid_membership_request";
648
+ member_not_found: "member_not_found";
649
+ owner_transfer_required: "owner_transfer_required";
650
+ owner_target_not_member: "owner_target_not_member";
651
+ invite_not_found: "invite_not_found";
652
+ invite_already_pending: "invite_already_pending";
653
+ already_member: "already_member";
654
+ seat_limit: "seat_limit";
655
+ }>;
656
+ operation_id: z.ZodString;
657
+ workspace_id: z.ZodString;
658
+ actor_user_id: z.ZodString;
659
+ client_id: z.ZodString;
660
+ committed_at: z.ZodString;
661
+ }, z.core.$strict>, z.ZodObject<{
662
+ action: z.ZodEnum<{
663
+ "invite.create": "invite.create";
664
+ "invite.revoke": "invite.revoke";
665
+ "invite.resend": "invite.resend";
666
+ "member.role": "member.role";
667
+ "member.remove": "member.remove";
668
+ "owner.transfer": "owner.transfer";
669
+ }>;
670
+ workspace_id: z.ZodString;
671
+ operation_id: z.ZodString;
672
+ actor_user_id: z.ZodString;
673
+ client_id: z.ZodString;
674
+ committed_at: z.ZodString;
675
+ abandoned: z.ZodLiteral<true>;
676
+ request: z.ZodDiscriminatedUnion<[z.ZodObject<{
677
+ action: z.ZodLiteral<"invite.create">;
678
+ email: z.ZodString;
679
+ role: z.ZodEnum<{
680
+ admin: "admin";
681
+ member: "member";
682
+ viewer: "viewer";
683
+ }>;
684
+ }, z.core.$strict>, z.ZodObject<{
685
+ action: z.ZodLiteral<"invite.revoke">;
686
+ inviteId: z.ZodString;
687
+ }, z.core.$strict>, z.ZodObject<{
688
+ action: z.ZodLiteral<"invite.resend">;
689
+ inviteId: z.ZodString;
690
+ }, z.core.$strict>, z.ZodObject<{
691
+ action: z.ZodLiteral<"member.role">;
692
+ memberId: z.ZodString;
693
+ role: z.ZodEnum<{
694
+ admin: "admin";
695
+ member: "member";
696
+ viewer: "viewer";
697
+ }>;
698
+ }, z.core.$strict>, z.ZodObject<{
699
+ action: z.ZodLiteral<"member.remove">;
700
+ memberId: z.ZodString;
701
+ }, z.core.$strict>, z.ZodObject<{
702
+ action: z.ZodLiteral<"owner.transfer">;
703
+ newOwnerId: z.ZodString;
704
+ }, z.core.$strict>], "action">;
705
+ }, z.core.$strict>]>;
706
+ type WorkspaceMembershipOperation = z.infer<typeof membershipOperationSchema>;
707
+ declare const membershipDeliverySchema: z.ZodObject<{
708
+ id: z.ZodString;
709
+ state: z.ZodEnum<{
710
+ unknown: "unknown";
711
+ accepted: "accepted";
712
+ queued: "queued";
713
+ skipped: "skipped";
714
+ }>;
715
+ }, z.core.$strict>;
716
+ type WorkspaceMembershipOperationState = {
717
+ state: 'not-observed';
718
+ operation: null;
719
+ } | {
720
+ state: 'committed';
721
+ operation: z.infer<typeof membershipCommittedSchema>;
722
+ delivery?: z.infer<typeof membershipDeliverySchema>;
723
+ } | {
724
+ state: 'rejected';
725
+ operation: z.infer<typeof membershipRejectedSchema>;
726
+ } | {
727
+ state: 'abandoned';
728
+ operation: z.infer<typeof membershipAbandonedSchema>;
729
+ };
730
+ declare class WorkspaceMembershipMutationError extends AccountError {
731
+ readonly operationId: string;
732
+ readonly outcome: "uncertain";
733
+ constructor(operationId: string);
734
+ }
735
+ declare function assertMembershipOperation(workspaceId: string, operationId: string, operation: WorkspaceMembershipOperation, request?: WorkspaceMembershipMutation): void;
736
+
737
+ /**
738
+ * Workspace authority — the person's workspaces, their members and invitations,
739
+ * workspace API keys, and the account-level operations (create a workspace,
740
+ * accept or decline an invitation).
741
+ *
742
+ * Every call is authorised per request through the host's `authorize` callback, so
743
+ * a DPoP proof is minted for the exact method and URL of each attempt. Every
744
+ * response is schema-checked and every receipt is checked against the request
745
+ * that produced it; a receipt for another workspace, key or operation is refused.
746
+ *
747
+ * Mutations that name an operation id are UNCERTAIN when their acknowledgement is
748
+ * lost or malformed: they throw a `*MutationError` carrying that id. Read the
749
+ * operation back by the same id; never retry under a fresh one.
750
+ */
751
+ declare const workspaceRoleSchema: z.ZodEnum<{
752
+ admin: "admin";
753
+ member: "member";
754
+ viewer: "viewer";
755
+ owner: "owner";
756
+ }>;
757
+ declare const workspaceInviteRoleSchema: z.ZodEnum<{
758
+ admin: "admin";
759
+ member: "member";
760
+ viewer: "viewer";
761
+ }>;
762
+ declare const workspaceSchema: z.ZodObject<{
763
+ id: z.ZodString;
764
+ owner_user_id: z.ZodString;
765
+ workspace_type: z.ZodEnum<{
766
+ personal: "personal";
767
+ team: "team";
768
+ }>;
769
+ name: z.ZodString;
770
+ slug: z.ZodString;
771
+ status: z.ZodString;
772
+ created_at: z.ZodString;
773
+ updated_at: z.ZodString;
774
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
775
+ member_role: z.ZodOptional<z.ZodEnum<{
776
+ admin: "admin";
777
+ member: "member";
778
+ viewer: "viewer";
779
+ owner: "owner";
780
+ }>>;
781
+ member_count: z.ZodOptional<z.ZodNumber>;
782
+ }, z.core.$strip>;
783
+ declare const workspaceMemberSchema: z.ZodObject<{
784
+ id: z.ZodString;
785
+ user_id: z.ZodString;
786
+ member_role: z.ZodEnum<{
787
+ admin: "admin";
788
+ member: "member";
789
+ viewer: "viewer";
790
+ owner: "owner";
791
+ }>;
792
+ member_status: z.ZodLiteral<"active">;
793
+ created_at: z.ZodString;
794
+ user: z.ZodOptional<z.ZodObject<{
795
+ username: z.ZodNullable<z.ZodString>;
796
+ email: z.ZodString;
797
+ display_name: z.ZodNullable<z.ZodString>;
798
+ avatar_url: z.ZodNullable<z.ZodString>;
799
+ }, z.core.$strip>>;
800
+ }, z.core.$strip>;
801
+ declare const workspaceInviteSchema: z.ZodObject<{
802
+ id: z.ZodString;
803
+ workspace_id: z.ZodString;
804
+ invited_by_user_id: z.ZodString;
805
+ invited_user_id: z.ZodNullable<z.ZodString>;
806
+ invited_email: z.ZodString;
807
+ role: z.ZodEnum<{
808
+ admin: "admin";
809
+ member: "member";
810
+ viewer: "viewer";
811
+ }>;
812
+ status: z.ZodEnum<{
813
+ accepted: "accepted";
814
+ expired: "expired";
815
+ pending: "pending";
816
+ revoked: "revoked";
817
+ declined: "declined";
818
+ }>;
819
+ created_at: z.ZodString;
820
+ expires_at: z.ZodNullable<z.ZodString>;
821
+ workspace_name: z.ZodOptional<z.ZodString>;
822
+ invited_by_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
823
+ }, z.core.$strip>;
824
+ type AccountWorkspace = z.infer<typeof workspaceSchema>;
825
+ type WorkspaceMember = z.infer<typeof workspaceMemberSchema>;
826
+ type WorkspaceInvite = z.infer<typeof workspaceInviteSchema>;
827
+ type WorkspaceRole = z.infer<typeof workspaceRoleSchema>;
828
+ type WorkspaceInviteRole = z.infer<typeof workspaceInviteRoleSchema>;
829
+ declare const accountOperationIntentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
830
+ action: z.ZodLiteral<"workspace.create">;
831
+ name: z.ZodString;
832
+ type: z.ZodLiteral<"team">;
833
+ }, z.core.$strict>, z.ZodObject<{
834
+ action: z.ZodLiteral<"invite.accept">;
835
+ inviteId: z.ZodString;
836
+ }, z.core.$strict>, z.ZodObject<{
837
+ action: z.ZodLiteral<"invite.decline">;
838
+ inviteId: z.ZodString;
839
+ }, z.core.$strict>], "action">;
840
+ type AccountOperationIntent = z.infer<typeof accountOperationIntentSchema>;
841
+ declare const accountOperationSchema: z.ZodObject<{
842
+ operation_id: z.ZodString;
843
+ actor_user_id: z.ZodString;
844
+ client_id: z.ZodString;
845
+ action: z.ZodEnum<{
846
+ "workspace.create": "workspace.create";
847
+ "invite.accept": "invite.accept";
848
+ "invite.decline": "invite.decline";
849
+ }>;
850
+ committed_at: z.ZodString;
851
+ result: z.ZodUnion<readonly [z.ZodObject<{
852
+ workspace: z.ZodObject<{
853
+ id: z.ZodString;
854
+ owner_user_id: z.ZodString;
855
+ workspace_type: z.ZodEnum<{
856
+ personal: "personal";
857
+ team: "team";
858
+ }>;
859
+ name: z.ZodString;
860
+ slug: z.ZodString;
861
+ status: z.ZodString;
862
+ created_at: z.ZodString;
863
+ updated_at: z.ZodString;
864
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
865
+ member_role: z.ZodOptional<z.ZodEnum<{
866
+ admin: "admin";
867
+ member: "member";
868
+ viewer: "viewer";
869
+ owner: "owner";
870
+ }>>;
871
+ member_count: z.ZodOptional<z.ZodNumber>;
872
+ }, z.core.$strip>;
873
+ }, z.core.$strict>, z.ZodObject<{
874
+ invite: z.ZodObject<{
875
+ id: z.ZodString;
876
+ workspace_id: z.ZodString;
877
+ invited_by_user_id: z.ZodString;
878
+ invited_user_id: z.ZodNullable<z.ZodString>;
879
+ invited_email: z.ZodString;
880
+ role: z.ZodEnum<{
881
+ admin: "admin";
882
+ member: "member";
883
+ viewer: "viewer";
884
+ }>;
885
+ status: z.ZodEnum<{
886
+ accepted: "accepted";
887
+ expired: "expired";
888
+ pending: "pending";
889
+ revoked: "revoked";
890
+ declined: "declined";
891
+ }>;
892
+ created_at: z.ZodString;
893
+ expires_at: z.ZodNullable<z.ZodString>;
894
+ workspace_name: z.ZodOptional<z.ZodString>;
895
+ invited_by_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
896
+ }, z.core.$strip>;
897
+ }, z.core.$strict>]>;
898
+ }, z.core.$strict>;
899
+ type AccountOperation = z.infer<typeof accountOperationSchema>;
900
+ type AccountOperationState = {
901
+ state: 'not-observed';
902
+ operation: null;
903
+ } | {
904
+ state: 'committed';
905
+ operation: AccountOperation;
906
+ };
907
+ declare class AccountMutationError extends AccountError {
908
+ readonly operationId: string;
909
+ readonly outcome: "uncertain";
910
+ constructor(operationId: string);
911
+ }
912
+ declare const workspaceKeyScopeSchema: z.ZodEnum<{
913
+ "workspace:read": "workspace:read";
914
+ "workspace:members:read": "workspace:members:read";
915
+ }>;
916
+ declare const workspaceKeySchema: z.ZodObject<{
917
+ id: z.ZodString;
918
+ workspace_id: z.ZodString;
919
+ created_by_user_id: z.ZodString;
920
+ name: z.ZodString;
921
+ prefix: z.ZodString;
922
+ scopes: z.ZodArray<z.ZodEnum<{
923
+ "workspace:read": "workspace:read";
924
+ "workspace:members:read": "workspace:members:read";
925
+ }>>;
926
+ revision: z.ZodNumber;
927
+ created_at: z.ZodString;
928
+ expires_at: z.ZodString;
929
+ revoked_at: z.ZodNullable<z.ZodString>;
930
+ replaced_by: z.ZodNullable<z.ZodString>;
931
+ }, z.core.$strip>;
932
+ type WorkspaceKey = z.infer<typeof workspaceKeySchema>;
933
+ declare const workspaceKeyInputSchema: z.ZodObject<{
934
+ name: z.ZodString;
935
+ scopes: z.ZodArray<z.ZodEnum<{
936
+ "workspace:read": "workspace:read";
937
+ "workspace:members:read": "workspace:members:read";
938
+ }>>;
939
+ expires_at: z.ZodString;
940
+ }, z.core.$strict>;
941
+ type WorkspaceKeyInput = z.infer<typeof workspaceKeyInputSchema>;
942
+ /** Returned only on successful creation/rotation to the privileged caller. Never
943
+ * persist this receipt in renderer settings, audit events or session history. */
944
+ type WorkspaceKeyReceipt = {
945
+ key: WorkspaceKey;
946
+ secret: string;
947
+ };
948
+ type WorkspaceKeyPage = {
949
+ keys: WorkspaceKey[];
950
+ next_cursor: string | null;
951
+ };
952
+ declare const committedKeyOperationSchema: z.ZodObject<{
953
+ operation_id: z.ZodString;
954
+ workspace_id: z.ZodString;
955
+ actor_user_id: z.ZodString;
956
+ client_id: z.ZodString;
957
+ action: z.ZodEnum<{
958
+ create: "create";
959
+ rotate: "rotate";
960
+ revoke: "revoke";
961
+ }>;
962
+ key: z.ZodObject<{
963
+ id: z.ZodString;
964
+ workspace_id: z.ZodString;
965
+ created_by_user_id: z.ZodString;
966
+ name: z.ZodString;
967
+ prefix: z.ZodString;
968
+ scopes: z.ZodArray<z.ZodEnum<{
969
+ "workspace:read": "workspace:read";
970
+ "workspace:members:read": "workspace:members:read";
971
+ }>>;
972
+ revision: z.ZodNumber;
973
+ created_at: z.ZodString;
974
+ expires_at: z.ZodString;
975
+ revoked_at: z.ZodNullable<z.ZodString>;
976
+ replaced_by: z.ZodNullable<z.ZodString>;
977
+ }, z.core.$strip>;
978
+ previous_key_id: z.ZodNullable<z.ZodString>;
979
+ committed_at: z.ZodString;
980
+ }, z.core.$strict>;
981
+ declare const workspaceKeyRejectionSchema: z.ZodEnum<{
982
+ invalid_workspace_key_request: "invalid_workspace_key_request";
983
+ invalid_workspace_key_revision: "invalid_workspace_key_revision";
984
+ workspace_key_not_found: "workspace_key_not_found";
985
+ workspace_key_conflict: "workspace_key_conflict";
986
+ }>;
987
+ declare const rejectedKeyOperationSchema: z.ZodObject<{
988
+ action: z.ZodEnum<{
989
+ create: "create";
990
+ rotate: "rotate";
991
+ revoke: "revoke";
992
+ }>;
993
+ workspace_id: z.ZodString;
994
+ operation_id: z.ZodString;
995
+ actor_user_id: z.ZodString;
996
+ client_id: z.ZodString;
997
+ committed_at: z.ZodString;
998
+ previous_key_id: z.ZodNullable<z.ZodString>;
999
+ rejection: z.ZodEnum<{
1000
+ invalid_workspace_key_request: "invalid_workspace_key_request";
1001
+ invalid_workspace_key_revision: "invalid_workspace_key_revision";
1002
+ workspace_key_not_found: "workspace_key_not_found";
1003
+ workspace_key_conflict: "workspace_key_conflict";
1004
+ }>;
1005
+ }, z.core.$strict>;
1006
+ declare const abandonedKeyOperationSchema: z.ZodObject<{
1007
+ action: z.ZodEnum<{
1008
+ create: "create";
1009
+ rotate: "rotate";
1010
+ revoke: "revoke";
1011
+ }>;
1012
+ workspace_id: z.ZodString;
1013
+ operation_id: z.ZodString;
1014
+ actor_user_id: z.ZodString;
1015
+ client_id: z.ZodString;
1016
+ committed_at: z.ZodString;
1017
+ previous_key_id: z.ZodNullable<z.ZodString>;
1018
+ abandoned: z.ZodLiteral<true>;
1019
+ }, z.core.$strict>;
1020
+ declare const workspaceKeyOperationSchema: z.ZodUnion<readonly [z.ZodObject<{
1021
+ operation_id: z.ZodString;
1022
+ workspace_id: z.ZodString;
1023
+ actor_user_id: z.ZodString;
1024
+ client_id: z.ZodString;
1025
+ action: z.ZodEnum<{
1026
+ create: "create";
1027
+ rotate: "rotate";
1028
+ revoke: "revoke";
1029
+ }>;
1030
+ key: z.ZodObject<{
1031
+ id: z.ZodString;
1032
+ workspace_id: z.ZodString;
1033
+ created_by_user_id: z.ZodString;
1034
+ name: z.ZodString;
1035
+ prefix: z.ZodString;
1036
+ scopes: z.ZodArray<z.ZodEnum<{
1037
+ "workspace:read": "workspace:read";
1038
+ "workspace:members:read": "workspace:members:read";
1039
+ }>>;
1040
+ revision: z.ZodNumber;
1041
+ created_at: z.ZodString;
1042
+ expires_at: z.ZodString;
1043
+ revoked_at: z.ZodNullable<z.ZodString>;
1044
+ replaced_by: z.ZodNullable<z.ZodString>;
1045
+ }, z.core.$strip>;
1046
+ previous_key_id: z.ZodNullable<z.ZodString>;
1047
+ committed_at: z.ZodString;
1048
+ }, z.core.$strict>, z.ZodObject<{
1049
+ action: z.ZodEnum<{
1050
+ create: "create";
1051
+ rotate: "rotate";
1052
+ revoke: "revoke";
1053
+ }>;
1054
+ workspace_id: z.ZodString;
1055
+ operation_id: z.ZodString;
1056
+ actor_user_id: z.ZodString;
1057
+ client_id: z.ZodString;
1058
+ committed_at: z.ZodString;
1059
+ previous_key_id: z.ZodNullable<z.ZodString>;
1060
+ rejection: z.ZodEnum<{
1061
+ invalid_workspace_key_request: "invalid_workspace_key_request";
1062
+ invalid_workspace_key_revision: "invalid_workspace_key_revision";
1063
+ workspace_key_not_found: "workspace_key_not_found";
1064
+ workspace_key_conflict: "workspace_key_conflict";
1065
+ }>;
1066
+ }, z.core.$strict>, z.ZodObject<{
1067
+ action: z.ZodEnum<{
1068
+ create: "create";
1069
+ rotate: "rotate";
1070
+ revoke: "revoke";
1071
+ }>;
1072
+ workspace_id: z.ZodString;
1073
+ operation_id: z.ZodString;
1074
+ actor_user_id: z.ZodString;
1075
+ client_id: z.ZodString;
1076
+ committed_at: z.ZodString;
1077
+ previous_key_id: z.ZodNullable<z.ZodString>;
1078
+ abandoned: z.ZodLiteral<true>;
1079
+ }, z.core.$strict>]>;
1080
+ type WorkspaceKeyOperation = z.infer<typeof workspaceKeyOperationSchema>;
1081
+ declare const keyMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1082
+ action: z.ZodLiteral<"create">;
1083
+ input: z.ZodObject<{
1084
+ name: z.ZodString;
1085
+ scopes: z.ZodArray<z.ZodEnum<{
1086
+ "workspace:read": "workspace:read";
1087
+ "workspace:members:read": "workspace:members:read";
1088
+ }>>;
1089
+ expires_at: z.ZodString;
1090
+ }, z.core.$strict>;
1091
+ }, z.core.$strict>, z.ZodObject<{
1092
+ action: z.ZodLiteral<"rotate">;
1093
+ keyId: z.ZodString;
1094
+ expectedRevision: z.ZodNumber;
1095
+ input: z.ZodOptional<z.ZodObject<{
1096
+ name: z.ZodOptional<z.ZodString>;
1097
+ scopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1098
+ "workspace:read": "workspace:read";
1099
+ "workspace:members:read": "workspace:members:read";
1100
+ }>>>;
1101
+ expires_at: z.ZodOptional<z.ZodString>;
1102
+ }, z.core.$strict>>;
1103
+ }, z.core.$strict>, z.ZodObject<{
1104
+ action: z.ZodLiteral<"revoke">;
1105
+ keyId: z.ZodString;
1106
+ expectedRevision: z.ZodNumber;
1107
+ }, z.core.$strict>], "action">;
1108
+ type WorkspaceKeyMutation = z.infer<typeof keyMutationSchema>;
1109
+ type WorkspaceKeyOperationResult = {
1110
+ operation: WorkspaceKeyOperation;
1111
+ replayed: boolean;
1112
+ secret?: string;
1113
+ };
1114
+ type WorkspaceKeyOperationState = {
1115
+ state: 'not-observed';
1116
+ operation: null;
1117
+ } | {
1118
+ state: 'committed';
1119
+ operation: z.infer<typeof committedKeyOperationSchema>;
1120
+ } | {
1121
+ state: 'rejected';
1122
+ operation: z.infer<typeof rejectedKeyOperationSchema>;
1123
+ } | {
1124
+ state: 'abandoned';
1125
+ operation: z.infer<typeof abandonedKeyOperationSchema>;
1126
+ };
1127
+ /** A mutation may have committed before transport/schema validation failed.
1128
+ * Retain this operationId; never replace it with a fresh create to retry. */
1129
+ declare class WorkspaceKeyMutationError extends AccountError {
1130
+ readonly operationId: string;
1131
+ readonly outcome: "uncertain";
1132
+ constructor(operationId: string);
1133
+ }
1134
+ type WorkspaceAuthorization = (method: string, url: string, opts: {
1135
+ scopes: string[];
1136
+ silent: true;
1137
+ }) => Promise<RequestAuthorization | null>;
1138
+ declare const membersResponse: z.ZodObject<{
1139
+ success: z.ZodLiteral<true>;
1140
+ workspace: z.ZodObject<{
1141
+ id: z.ZodString;
1142
+ owner_user_id: z.ZodString;
1143
+ workspace_type: z.ZodEnum<{
1144
+ personal: "personal";
1145
+ team: "team";
1146
+ }>;
1147
+ name: z.ZodString;
1148
+ slug: z.ZodString;
1149
+ status: z.ZodString;
1150
+ created_at: z.ZodString;
1151
+ updated_at: z.ZodString;
1152
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1153
+ member_role: z.ZodOptional<z.ZodEnum<{
1154
+ admin: "admin";
1155
+ member: "member";
1156
+ viewer: "viewer";
1157
+ owner: "owner";
1158
+ }>>;
1159
+ member_count: z.ZodOptional<z.ZodNumber>;
1160
+ }, z.core.$strip>;
1161
+ members: z.ZodArray<z.ZodObject<{
1162
+ id: z.ZodString;
1163
+ user_id: z.ZodString;
1164
+ member_role: z.ZodEnum<{
1165
+ admin: "admin";
1166
+ member: "member";
1167
+ viewer: "viewer";
1168
+ owner: "owner";
1169
+ }>;
1170
+ member_status: z.ZodLiteral<"active">;
1171
+ created_at: z.ZodString;
1172
+ user: z.ZodOptional<z.ZodObject<{
1173
+ username: z.ZodNullable<z.ZodString>;
1174
+ email: z.ZodString;
1175
+ display_name: z.ZodNullable<z.ZodString>;
1176
+ avatar_url: z.ZodNullable<z.ZodString>;
1177
+ }, z.core.$strip>>;
1178
+ }, z.core.$strip>>;
1179
+ }, z.core.$strip>;
1180
+ declare class WorkspaceClient {
1181
+ private readonly transport;
1182
+ private readonly authorize;
1183
+ private readonly base;
1184
+ constructor(base: string, transport: Transport, authorize: WorkspaceAuthorization);
1185
+ private call;
1186
+ list(): Promise<AccountWorkspace[]>;
1187
+ keys(workspaceId: string, options?: {
1188
+ cursor?: string;
1189
+ limit?: number;
1190
+ }): Promise<WorkspaceKeyPage>;
1191
+ createKey(workspaceId: string, input: WorkspaceKeyInput): Promise<WorkspaceKeyReceipt>;
1192
+ keyOperation(workspaceId: string, operationId: string): Promise<WorkspaceKeyOperationState>;
1193
+ mutateKey(workspaceId: string, operationId: string, request: WorkspaceKeyMutation): Promise<WorkspaceKeyOperationResult>;
1194
+ private assertOperation;
1195
+ rotateKey(workspaceId: string, keyId: string, expectedRevision: number, input?: Partial<WorkspaceKeyInput>): Promise<WorkspaceKeyReceipt>;
1196
+ revokeKey(workspaceId: string, keyId: string, expectedRevision: number): Promise<WorkspaceKey>;
1197
+ private assertKeyReceipt;
1198
+ create(name: string, type?: 'personal' | 'team'): Promise<AccountWorkspace>;
1199
+ accountOperation(operationId: string): Promise<AccountOperationState>;
1200
+ mutateAccount(operationId: string, request: AccountOperationIntent): Promise<{
1201
+ operation: AccountOperation;
1202
+ replayed: boolean;
1203
+ }>;
1204
+ select(workspaceId: string): Promise<void>;
1205
+ members(workspaceId: string): Promise<z.infer<typeof membersResponse>>;
1206
+ updateMember(workspaceId: string, memberId: string, role: WorkspaceInviteRole): Promise<void>;
1207
+ membershipOperation(workspaceId: string, operationId: string): Promise<WorkspaceMembershipOperationState>;
1208
+ mutateMembership(workspaceId: string, operationId: string, request: WorkspaceMembershipMutation): Promise<{
1209
+ operation: WorkspaceMembershipOperation;
1210
+ replayed: boolean;
1211
+ }>;
1212
+ /** Explicit user-requested settlement only. A lost ACK remains uncertain; never
1213
+ * synthesize abandonment locally or automatically retry with a new ID. */
1214
+ abandonMembershipOperation(workspaceId: string, operationId: string, request: WorkspaceMembershipMutation): Promise<{
1215
+ operation: WorkspaceMembershipOperation;
1216
+ replayed: boolean;
1217
+ }>;
1218
+ abandonKeyOperation(workspaceId: string, operationId: string, request: WorkspaceKeyMutation): Promise<{
1219
+ operation: WorkspaceKeyOperation;
1220
+ replayed: boolean;
1221
+ }>;
1222
+ removeMember(workspaceId: string, memberId: string): Promise<void>;
1223
+ transferOwnership(workspaceId: string, newOwnerUserId: string): Promise<void>;
1224
+ invites(workspaceId: string): Promise<WorkspaceInvite[]>;
1225
+ invite(workspaceId: string, email: string, role?: WorkspaceInviteRole): Promise<WorkspaceInvite>;
1226
+ revokeInvite(workspaceId: string, inviteId: string): Promise<void>;
1227
+ resendInvite(workspaceId: string, inviteId: string): Promise<void>;
1228
+ pendingInvites(): Promise<WorkspaceInvite[]>;
1229
+ acceptInvite(inviteId: string): Promise<void>;
1230
+ declineInvite(inviteId: string): Promise<void>;
1231
+ }
1232
+
1233
+ declare const workforceOwnerSchema: z.ZodObject<{
1234
+ type: z.ZodEnum<{
1235
+ user: "user";
1236
+ workspace: "workspace";
1237
+ }>;
1238
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1239
+ }, z.core.$strict>;
1240
+ type WorkforceOwner = z.infer<typeof workforceOwnerSchema>;
1241
+ declare const workforceDefinitionSchema: z.ZodObject<{
1242
+ secretReferences: z.ZodOptional<z.ZodArray<z.ZodObject<{
1243
+ name: z.ZodString;
1244
+ ref: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1245
+ }, z.core.$strict>>>;
1246
+ provenance: z.ZodOptional<z.ZodObject<{
1247
+ source: z.ZodEnum<{
1248
+ authored: "authored";
1249
+ imported: "imported";
1250
+ }>;
1251
+ sourceVersion: z.ZodOptional<z.ZodString>;
1252
+ }, z.core.$strict>>;
1253
+ license: z.ZodOptional<z.ZodObject<{
1254
+ identifier: z.ZodString;
1255
+ }, z.core.$strict>>;
1256
+ instructions: z.ZodString;
1257
+ skills: z.ZodArray<z.ZodObject<{
1258
+ id: z.ZodString;
1259
+ version: z.ZodString;
1260
+ hash: z.ZodString;
1261
+ }, z.core.$strict>>;
1262
+ requestedCapabilities: z.ZodArray<z.ZodString>;
1263
+ schemaVersion: z.ZodLiteral<1>;
1264
+ }, z.core.$strict>;
1265
+ declare const workforceCreateResourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1266
+ kind: z.ZodLiteral<"agent">;
1267
+ definition: z.ZodObject<{
1268
+ secretReferences: z.ZodOptional<z.ZodArray<z.ZodObject<{
1269
+ name: z.ZodString;
1270
+ ref: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1271
+ }, z.core.$strict>>>;
1272
+ provenance: z.ZodOptional<z.ZodObject<{
1273
+ source: z.ZodEnum<{
1274
+ authored: "authored";
1275
+ imported: "imported";
1276
+ }>;
1277
+ sourceVersion: z.ZodOptional<z.ZodString>;
1278
+ }, z.core.$strict>>;
1279
+ license: z.ZodOptional<z.ZodObject<{
1280
+ identifier: z.ZodString;
1281
+ }, z.core.$strict>>;
1282
+ instructions: z.ZodString;
1283
+ skills: z.ZodArray<z.ZodObject<{
1284
+ id: z.ZodString;
1285
+ version: z.ZodString;
1286
+ hash: z.ZodString;
1287
+ }, z.core.$strict>>;
1288
+ requestedCapabilities: z.ZodArray<z.ZodString>;
1289
+ schemaVersion: z.ZodLiteral<1>;
1290
+ }, z.core.$strict>;
1291
+ operationId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1292
+ owner: z.ZodObject<{
1293
+ type: z.ZodEnum<{
1294
+ user: "user";
1295
+ workspace: "workspace";
1296
+ }>;
1297
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1298
+ }, z.core.$strict>;
1299
+ expectedActorAccountId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
1300
+ name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1301
+ description: z.ZodOptional<z.ZodString>;
1302
+ }, z.core.$strict>, z.ZodObject<{
1303
+ kind: z.ZodLiteral<"team">;
1304
+ operationId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1305
+ owner: z.ZodObject<{
1306
+ type: z.ZodEnum<{
1307
+ user: "user";
1308
+ workspace: "workspace";
1309
+ }>;
1310
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1311
+ }, z.core.$strict>;
1312
+ expectedActorAccountId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
1313
+ name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1314
+ description: z.ZodOptional<z.ZodString>;
1315
+ }, z.core.$strict>], "kind">;
1316
+ declare const workforceReadOperationSchema: z.ZodObject<{
1317
+ operationId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1318
+ owner: z.ZodObject<{
1319
+ type: z.ZodEnum<{
1320
+ user: "user";
1321
+ workspace: "workspace";
1322
+ }>;
1323
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1324
+ }, z.core.$strict>;
1325
+ expectedActorAccountId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
1326
+ }, z.core.$strict>;
1327
+ type WorkforceCreateResourceInput = z.input<typeof workforceCreateResourceSchema>;
1328
+ type WorkforceReadOperationInput = z.input<typeof workforceReadOperationSchema>;
1329
+ type WorkforceDefinition = z.input<typeof workforceDefinitionSchema>;
1330
+ declare const workforceListOwnedResourcesSchema: z.ZodObject<{
1331
+ owner: z.ZodObject<{
1332
+ type: z.ZodEnum<{
1333
+ user: "user";
1334
+ workspace: "workspace";
1335
+ }>;
1336
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1337
+ }, z.core.$strict>;
1338
+ expectedActorAccountId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1339
+ limit: z.ZodOptional<z.ZodNumber>;
1340
+ kind: z.ZodOptional<z.ZodEnum<{
1341
+ team: "team";
1342
+ agent: "agent";
1343
+ }>>;
1344
+ status: z.ZodOptional<z.ZodEnum<{
1345
+ active: "active";
1346
+ archived: "archived";
1347
+ }>>;
1348
+ cursor: z.ZodOptional<z.ZodString>;
1349
+ }, z.core.$strict>;
1350
+ type WorkforceListOwnedResourcesInput = z.input<typeof workforceListOwnedResourcesSchema>;
1351
+ declare const resource: z.ZodObject<{
1352
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1353
+ kind: z.ZodEnum<{
1354
+ team: "team";
1355
+ agent: "agent";
1356
+ }>;
1357
+ owner: z.ZodObject<{
1358
+ type: z.ZodEnum<{
1359
+ user: "user";
1360
+ workspace: "workspace";
1361
+ }>;
1362
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1363
+ }, z.core.$strict>;
1364
+ createdByUserId: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
1365
+ name: z.ZodString;
1366
+ description: z.ZodString;
1367
+ status: z.ZodEnum<{
1368
+ active: "active";
1369
+ archived: "archived";
1370
+ }>;
1371
+ revision: z.ZodString;
1372
+ createdAt: z.ZodString;
1373
+ updatedAt: z.ZodString;
1374
+ }, z.core.$strict>;
1375
+ declare const ownedCatalog: z.ZodObject<{
1376
+ success: z.ZodLiteral<true>;
1377
+ schemaVersion: z.ZodLiteral<1>;
1378
+ scope: z.ZodLiteral<"owned">;
1379
+ owner: z.ZodObject<{
1380
+ type: z.ZodEnum<{
1381
+ user: "user";
1382
+ workspace: "workspace";
1383
+ }>;
1384
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1385
+ }, z.core.$strict>;
1386
+ items: z.ZodArray<z.ZodObject<{
1387
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1388
+ kind: z.ZodEnum<{
1389
+ team: "team";
1390
+ agent: "agent";
1391
+ }>;
1392
+ owner: z.ZodObject<{
1393
+ type: z.ZodEnum<{
1394
+ user: "user";
1395
+ workspace: "workspace";
1396
+ }>;
1397
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1398
+ }, z.core.$strict>;
1399
+ createdByUserId: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
1400
+ name: z.ZodString;
1401
+ description: z.ZodString;
1402
+ status: z.ZodEnum<{
1403
+ active: "active";
1404
+ archived: "archived";
1405
+ }>;
1406
+ revision: z.ZodString;
1407
+ createdAt: z.ZodString;
1408
+ updatedAt: z.ZodString;
1409
+ }, z.core.$strict>>;
1410
+ nextCursor: z.ZodNullable<z.ZodString>;
1411
+ }, z.core.$strict>;
1412
+ type WorkforceOwnedCatalog = z.infer<typeof ownedCatalog>;
1413
+ type WorkforceResourceMetadata = z.infer<typeof resource>;
1414
+ declare const committed: z.ZodObject<{
1415
+ success: z.ZodLiteral<true>;
1416
+ state: z.ZodLiteral<"committed">;
1417
+ operation: z.ZodObject<{
1418
+ schemaVersion: z.ZodLiteral<1>;
1419
+ operationId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1420
+ action: z.ZodLiteral<"agent.resource.create">;
1421
+ state: z.ZodLiteral<"committed">;
1422
+ owner: z.ZodObject<{
1423
+ type: z.ZodEnum<{
1424
+ user: "user";
1425
+ workspace: "workspace";
1426
+ }>;
1427
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1428
+ }, z.core.$strict>;
1429
+ resourceId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1430
+ resourceRevision: z.ZodString;
1431
+ agentVersion: z.ZodNullable<z.ZodNumber>;
1432
+ committedAt: z.ZodString;
1433
+ }, z.core.$strict>;
1434
+ resource: z.ZodNullable<z.ZodObject<{
1435
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1436
+ kind: z.ZodEnum<{
1437
+ team: "team";
1438
+ agent: "agent";
1439
+ }>;
1440
+ owner: z.ZodObject<{
1441
+ type: z.ZodEnum<{
1442
+ user: "user";
1443
+ workspace: "workspace";
1444
+ }>;
1445
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1446
+ }, z.core.$strict>;
1447
+ createdByUserId: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
1448
+ name: z.ZodString;
1449
+ description: z.ZodString;
1450
+ status: z.ZodEnum<{
1451
+ active: "active";
1452
+ archived: "archived";
1453
+ }>;
1454
+ revision: z.ZodString;
1455
+ createdAt: z.ZodString;
1456
+ updatedAt: z.ZodString;
1457
+ }, z.core.$strict>>;
1458
+ version: z.ZodNullable<z.ZodObject<{
1459
+ resourceId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1460
+ version: z.ZodNumber;
1461
+ schemaVersion: z.ZodLiteral<1>;
1462
+ content: z.ZodObject<{
1463
+ instructions: z.ZodString;
1464
+ skills: z.ZodArray<z.ZodObject<{
1465
+ id: z.ZodString;
1466
+ version: z.ZodString;
1467
+ hash: z.ZodString;
1468
+ }, z.core.$strict>>;
1469
+ requestedCapabilities: z.ZodArray<z.ZodString>;
1470
+ secretReferences: z.ZodArray<z.ZodObject<{
1471
+ name: z.ZodString;
1472
+ ref: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1473
+ }, z.core.$strict>>;
1474
+ }, z.core.$strict>;
1475
+ contentHash: z.ZodString;
1476
+ provenance: z.ZodUnion<readonly [z.ZodObject<{
1477
+ source: z.ZodEnum<{
1478
+ authored: "authored";
1479
+ imported: "imported";
1480
+ }>;
1481
+ sourceVersion: z.ZodOptional<z.ZodString>;
1482
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
1483
+ license: z.ZodUnion<readonly [z.ZodObject<{
1484
+ identifier: z.ZodString;
1485
+ }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
1486
+ createdByUserId: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
1487
+ createdAt: z.ZodString;
1488
+ }, z.core.$strict>>;
1489
+ replayed: z.ZodBoolean;
1490
+ resourceAccess: z.ZodDiscriminatedUnion<[z.ZodObject<{
1491
+ allowed: z.ZodLiteral<true>;
1492
+ }, z.core.$strict>, z.ZodObject<{
1493
+ allowed: z.ZodLiteral<false>;
1494
+ reason: z.ZodLiteral<"no_access">;
1495
+ }, z.core.$strict>], "allowed">;
1496
+ }, z.core.$strict>;
1497
+ declare const notObserved: z.ZodObject<{
1498
+ success: z.ZodLiteral<true>;
1499
+ state: z.ZodLiteral<"not-observed">;
1500
+ operation: z.ZodNull;
1501
+ resource: z.ZodNull;
1502
+ version: z.ZodNull;
1503
+ replayed: z.ZodLiteral<false>;
1504
+ }, z.core.$strict>;
1505
+ type WorkforceResourceResult = z.infer<typeof committed>;
1506
+ type WorkforceOperationResult = WorkforceResourceResult | z.infer<typeof notObserved>;
1507
+ /** Client-observed uncertainty, not a claim that the server committed or rejected.
1508
+ * Persist this identity and read it back. Never generate a new ID to retry. */
1509
+ declare class WorkforceResourceMutationError extends AccountError {
1510
+ readonly operationId: string;
1511
+ readonly outcome: "uncertain";
1512
+ readonly reason: "mutation_outcome_unverified";
1513
+ readonly source: "client-observation";
1514
+ readonly owner: Readonly<WorkforceOwner>;
1515
+ constructor(operationId: string, owner: WorkforceOwner, cause: unknown);
1516
+ }
1517
+ type WorkforceAuthorization = (method: string, url: string, options: {
1518
+ scopes: string[];
1519
+ silent: true;
1520
+ }) => Promise<RequestAuthorization | null>;
1521
+ /** Canonical account transport only. Definitions request capabilities; creating
1522
+ * one does not establish a principal, team membership or execution permission. */
1523
+ declare class WorkforceClient {
1524
+ private readonly transport;
1525
+ private readonly authorize;
1526
+ private readonly base;
1527
+ constructor(base: string, transport: Transport, authorize: WorkforceAuthorization);
1528
+ /** This catalog lists one explicitly owned scope only. It is not an aggregate
1529
+ * of assigned, shared or rented resources and contains no agent definitions. */
1530
+ listOwnedResources(value: WorkforceListOwnedResourcesInput): Promise<WorkforceOwnedCatalog>;
1531
+ private validate;
1532
+ createResource(value: WorkforceCreateResourceInput): Promise<WorkforceResourceResult>;
1533
+ readOperation(value: WorkforceReadOperationInput): Promise<WorkforceOperationResult>;
1534
+ }
1535
+
1536
+ declare const notificationEventSchema: z.ZodEnum<{
1537
+ "agent.finished": "agent.finished";
1538
+ "agent.failed": "agent.failed";
1539
+ "agent.cancelled": "agent.cancelled";
1540
+ }>;
1541
+ declare const notificationChannelSchema: z.ZodEnum<{
1542
+ webhook: "webhook";
1543
+ slack: "slack";
1544
+ discord: "discord";
1545
+ }>;
1546
+ declare const notificationScopeSchema: z.ZodObject<{
1547
+ workspaceId: z.ZodString;
1548
+ workspaceCreatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1549
+ teamId: z.ZodOptional<z.ZodString>;
1550
+ agentId: z.ZodOptional<z.ZodString>;
1551
+ }, z.core.$strict>;
1552
+ declare const notificationRuleSchema: z.ZodObject<{
1553
+ id: z.ZodOptional<z.ZodString>;
1554
+ event: z.ZodEnum<{
1555
+ "agent.finished": "agent.finished";
1556
+ "agent.failed": "agent.failed";
1557
+ "agent.cancelled": "agent.cancelled";
1558
+ }>;
1559
+ channel: z.ZodEnum<{
1560
+ webhook: "webhook";
1561
+ slack: "slack";
1562
+ discord: "discord";
1563
+ }>;
1564
+ destinationId: z.ZodString;
1565
+ enabled: z.ZodBoolean;
1566
+ }, z.core.$strict>;
1567
+ declare const notificationSettingsSchema: z.ZodObject<{
1568
+ success: z.ZodLiteral<true>;
1569
+ channelVersion: z.ZodLiteral<2>;
1570
+ revision: z.ZodUnion<readonly [z.ZodLiteral<"0">, z.ZodString]>;
1571
+ rules: z.ZodArray<z.ZodObject<{
1572
+ id: z.ZodOptional<z.ZodString>;
1573
+ event: z.ZodEnum<{
1574
+ "agent.finished": "agent.finished";
1575
+ "agent.failed": "agent.failed";
1576
+ "agent.cancelled": "agent.cancelled";
1577
+ }>;
1578
+ channel: z.ZodEnum<{
1579
+ webhook: "webhook";
1580
+ slack: "slack";
1581
+ discord: "discord";
1582
+ }>;
1583
+ destinationId: z.ZodString;
1584
+ enabled: z.ZodBoolean;
1585
+ }, z.core.$strict>>;
1586
+ destinations: z.ZodArray<z.ZodPipe<z.ZodObject<{
1587
+ id: z.ZodString;
1588
+ label: z.ZodString;
1589
+ channel: z.ZodEnum<{
1590
+ webhook: "webhook";
1591
+ slack: "slack";
1592
+ discord: "discord";
1593
+ }>;
1594
+ ready: z.ZodBoolean;
1595
+ enabled: z.ZodBoolean;
1596
+ updated_at: z.ZodString;
1597
+ }, z.core.$strict>, z.ZodTransform<{
1598
+ updatedAt: string;
1599
+ id: string;
1600
+ label: string;
1601
+ channel: "webhook" | "slack" | "discord";
1602
+ ready: boolean;
1603
+ enabled: boolean;
1604
+ }, {
1605
+ id: string;
1606
+ label: string;
1607
+ channel: "webhook" | "slack" | "discord";
1608
+ ready: boolean;
1609
+ enabled: boolean;
1610
+ updated_at: string;
1611
+ }>>>;
1612
+ deliveries: z.ZodArray<z.ZodObject<{
1613
+ id: z.ZodString;
1614
+ destination_id: z.ZodString;
1615
+ event: z.ZodEnum<{
1616
+ "agent.finished": "agent.finished";
1617
+ "agent.failed": "agent.failed";
1618
+ "agent.cancelled": "agent.cancelled";
1619
+ }>;
1620
+ state: z.ZodEnum<{
1621
+ queued: "queued";
1622
+ leased: "leased";
1623
+ delivered: "delivered";
1624
+ failed: "failed";
1625
+ cancelled: "cancelled";
1626
+ }>;
1627
+ attempt: z.ZodNumber;
1628
+ max_attempts: z.ZodNumber;
1629
+ status_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1630
+ error_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1631
+ created_at: z.ZodString;
1632
+ delivered_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1633
+ next_retry_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1634
+ cancelled_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1635
+ }, z.core.$strip>>;
1636
+ channels: z.ZodArray<z.ZodObject<{
1637
+ id: z.ZodEnum<{
1638
+ email: "email";
1639
+ webhook: "webhook";
1640
+ slack: "slack";
1641
+ discord: "discord";
1642
+ }>;
1643
+ available: z.ZodBoolean;
1644
+ }, z.core.$strip>>;
1645
+ digestFrequencies: z.ZodTuple<[z.ZodLiteral<"realtime">], null>;
1646
+ }, z.core.$strip>;
1647
+ declare const eventInputSchema: z.ZodObject<{
1648
+ eventId: z.ZodString;
1649
+ event: z.ZodEnum<{
1650
+ "agent.finished": "agent.finished";
1651
+ "agent.failed": "agent.failed";
1652
+ "agent.cancelled": "agent.cancelled";
1653
+ }>;
1654
+ occurredAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1655
+ scope: z.ZodObject<{
1656
+ workspaceId: z.ZodString;
1657
+ workspaceCreatedAt: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1658
+ teamId: z.ZodOptional<z.ZodString>;
1659
+ agentId: z.ZodOptional<z.ZodString>;
1660
+ }, z.core.$strict>;
1661
+ conversationId: z.ZodString;
1662
+ requestId: z.ZodString;
1663
+ }, z.core.$strict>;
1664
+ type NotificationScope = z.input<typeof notificationScopeSchema>;
1665
+ type NotificationRule = z.infer<typeof notificationRuleSchema>;
1666
+ type NotificationSettings = z.infer<typeof notificationSettingsSchema>;
1667
+ type AgentNotificationInput = z.input<typeof eventInputSchema>;
1668
+ type NotificationAdmission = {
1669
+ success: true;
1670
+ admitted: true;
1671
+ duplicate: boolean;
1672
+ };
1673
+ declare const notificationDestinationActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1674
+ action: z.ZodLiteral<"create">;
1675
+ url: z.ZodString;
1676
+ }, z.core.$strict>, z.ZodObject<{
1677
+ action: z.ZodLiteral<"update">;
1678
+ destination_id: z.ZodString;
1679
+ expected_updated_at: z.ZodString;
1680
+ url: z.ZodOptional<z.ZodString>;
1681
+ enabled: z.ZodOptional<z.ZodBoolean>;
1682
+ }, z.core.$strict>, z.ZodObject<{
1683
+ action: z.ZodLiteral<"delete">;
1684
+ destination_id: z.ZodString;
1685
+ expected_updated_at: z.ZodString;
1686
+ }, z.core.$strict>, z.ZodObject<{
1687
+ action: z.ZodLiteral<"delivery-control">;
1688
+ destination_id: z.ZodString;
1689
+ delivery_id: z.ZodString;
1690
+ operation: z.ZodEnum<{
1691
+ retry: "retry";
1692
+ cancel: "cancel";
1693
+ }>;
1694
+ }, z.core.$strict>], "action">;
1695
+ declare const notificationDestinationOperationSchema: z.ZodObject<{
1696
+ operation_id: z.ZodString;
1697
+ workspace_id: z.ZodString;
1698
+ actor_user_id: z.ZodString;
1699
+ client_id: z.ZodString;
1700
+ action: z.ZodEnum<{
1701
+ create: "create";
1702
+ update: "update";
1703
+ delete: "delete";
1704
+ "delivery-control": "delivery-control";
1705
+ }>;
1706
+ state: z.ZodEnum<{
1707
+ committed: "committed";
1708
+ rejected: "rejected";
1709
+ prepared: "prepared";
1710
+ }>;
1711
+ prepared_at: z.ZodString;
1712
+ committed_at: z.ZodOptional<z.ZodString>;
1713
+ destination: z.ZodOptional<z.ZodObject<{
1714
+ id: z.ZodString;
1715
+ label: z.ZodString;
1716
+ channel: z.ZodLiteral<"webhook">;
1717
+ ready: z.ZodBoolean;
1718
+ enabled: z.ZodBoolean;
1719
+ updated_at: z.ZodString;
1720
+ }, z.core.$strict>>;
1721
+ delivery: z.ZodOptional<z.ZodObject<{
1722
+ id: z.ZodString;
1723
+ state: z.ZodString;
1724
+ attempt: z.ZodNumber;
1725
+ max_attempts: z.ZodNumber;
1726
+ }, z.core.$strict>>;
1727
+ rejection: z.ZodOptional<z.ZodEnum<{
1728
+ notification_destination_not_found: "notification_destination_not_found";
1729
+ notification_destination_generation_conflict: "notification_destination_generation_conflict";
1730
+ notification_delivery_transition_unavailable: "notification_delivery_transition_unavailable";
1731
+ }>>;
1732
+ }, z.core.$strict>;
1733
+ declare const destinationOperationMutationResponseSchema: z.ZodObject<{
1734
+ state: z.ZodEnum<{
1735
+ committed: "committed";
1736
+ rejected: "rejected";
1737
+ prepared: "prepared";
1738
+ }>;
1739
+ operation: z.ZodObject<{
1740
+ operation_id: z.ZodString;
1741
+ workspace_id: z.ZodString;
1742
+ actor_user_id: z.ZodString;
1743
+ client_id: z.ZodString;
1744
+ action: z.ZodEnum<{
1745
+ create: "create";
1746
+ update: "update";
1747
+ delete: "delete";
1748
+ "delivery-control": "delivery-control";
1749
+ }>;
1750
+ state: z.ZodEnum<{
1751
+ committed: "committed";
1752
+ rejected: "rejected";
1753
+ prepared: "prepared";
1754
+ }>;
1755
+ prepared_at: z.ZodString;
1756
+ committed_at: z.ZodOptional<z.ZodString>;
1757
+ destination: z.ZodOptional<z.ZodObject<{
1758
+ id: z.ZodString;
1759
+ label: z.ZodString;
1760
+ channel: z.ZodLiteral<"webhook">;
1761
+ ready: z.ZodBoolean;
1762
+ enabled: z.ZodBoolean;
1763
+ updated_at: z.ZodString;
1764
+ }, z.core.$strict>>;
1765
+ delivery: z.ZodOptional<z.ZodObject<{
1766
+ id: z.ZodString;
1767
+ state: z.ZodString;
1768
+ attempt: z.ZodNumber;
1769
+ max_attempts: z.ZodNumber;
1770
+ }, z.core.$strict>>;
1771
+ rejection: z.ZodOptional<z.ZodEnum<{
1772
+ notification_destination_not_found: "notification_destination_not_found";
1773
+ notification_destination_generation_conflict: "notification_destination_generation_conflict";
1774
+ notification_delivery_transition_unavailable: "notification_delivery_transition_unavailable";
1775
+ }>>;
1776
+ }, z.core.$strict>;
1777
+ replayed: z.ZodBoolean;
1778
+ }, z.core.$strict>;
1779
+ declare const destinationOperationLookupResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
1780
+ state: z.ZodLiteral<"not-observed">;
1781
+ operation: z.ZodNull;
1782
+ }, z.core.$strict>, z.ZodObject<{
1783
+ state: z.ZodEnum<{
1784
+ committed: "committed";
1785
+ rejected: "rejected";
1786
+ prepared: "prepared";
1787
+ }>;
1788
+ operation: z.ZodObject<{
1789
+ operation_id: z.ZodString;
1790
+ workspace_id: z.ZodString;
1791
+ actor_user_id: z.ZodString;
1792
+ client_id: z.ZodString;
1793
+ action: z.ZodEnum<{
1794
+ create: "create";
1795
+ update: "update";
1796
+ delete: "delete";
1797
+ "delivery-control": "delivery-control";
1798
+ }>;
1799
+ state: z.ZodEnum<{
1800
+ committed: "committed";
1801
+ rejected: "rejected";
1802
+ prepared: "prepared";
1803
+ }>;
1804
+ prepared_at: z.ZodString;
1805
+ committed_at: z.ZodOptional<z.ZodString>;
1806
+ destination: z.ZodOptional<z.ZodObject<{
1807
+ id: z.ZodString;
1808
+ label: z.ZodString;
1809
+ channel: z.ZodLiteral<"webhook">;
1810
+ ready: z.ZodBoolean;
1811
+ enabled: z.ZodBoolean;
1812
+ updated_at: z.ZodString;
1813
+ }, z.core.$strict>>;
1814
+ delivery: z.ZodOptional<z.ZodObject<{
1815
+ id: z.ZodString;
1816
+ state: z.ZodString;
1817
+ attempt: z.ZodNumber;
1818
+ max_attempts: z.ZodNumber;
1819
+ }, z.core.$strict>>;
1820
+ rejection: z.ZodOptional<z.ZodEnum<{
1821
+ notification_destination_not_found: "notification_destination_not_found";
1822
+ notification_destination_generation_conflict: "notification_destination_generation_conflict";
1823
+ notification_delivery_transition_unavailable: "notification_delivery_transition_unavailable";
1824
+ }>>;
1825
+ }, z.core.$strict>;
1826
+ }, z.core.$strict>]>;
1827
+ declare const destinationOperationExecuteResponseSchema: z.ZodObject<{
1828
+ state: z.ZodEnum<{
1829
+ committed: "committed";
1830
+ rejected: "rejected";
1831
+ prepared: "prepared";
1832
+ }>;
1833
+ operation: z.ZodObject<{
1834
+ operation_id: z.ZodString;
1835
+ workspace_id: z.ZodString;
1836
+ actor_user_id: z.ZodString;
1837
+ client_id: z.ZodString;
1838
+ action: z.ZodEnum<{
1839
+ create: "create";
1840
+ update: "update";
1841
+ delete: "delete";
1842
+ "delivery-control": "delivery-control";
1843
+ }>;
1844
+ state: z.ZodEnum<{
1845
+ committed: "committed";
1846
+ rejected: "rejected";
1847
+ prepared: "prepared";
1848
+ }>;
1849
+ prepared_at: z.ZodString;
1850
+ committed_at: z.ZodOptional<z.ZodString>;
1851
+ destination: z.ZodOptional<z.ZodObject<{
1852
+ id: z.ZodString;
1853
+ label: z.ZodString;
1854
+ channel: z.ZodLiteral<"webhook">;
1855
+ ready: z.ZodBoolean;
1856
+ enabled: z.ZodBoolean;
1857
+ updated_at: z.ZodString;
1858
+ }, z.core.$strict>>;
1859
+ delivery: z.ZodOptional<z.ZodObject<{
1860
+ id: z.ZodString;
1861
+ state: z.ZodString;
1862
+ attempt: z.ZodNumber;
1863
+ max_attempts: z.ZodNumber;
1864
+ }, z.core.$strict>>;
1865
+ rejection: z.ZodOptional<z.ZodEnum<{
1866
+ notification_destination_not_found: "notification_destination_not_found";
1867
+ notification_destination_generation_conflict: "notification_destination_generation_conflict";
1868
+ notification_delivery_transition_unavailable: "notification_delivery_transition_unavailable";
1869
+ }>>;
1870
+ }, z.core.$strict>;
1871
+ replayed: z.ZodBoolean;
1872
+ secret: z.ZodOptional<z.ZodString>;
1873
+ }, z.core.$strict>;
1874
+ type NotificationDestinationAction = z.infer<typeof notificationDestinationActionSchema>;
1875
+ type NotificationDestinationOperation = z.infer<typeof notificationDestinationOperationSchema>;
1876
+ type NotificationDestinationMutationResult = z.infer<typeof destinationOperationMutationResponseSchema>;
1877
+ type NotificationDestinationLookupResult = z.infer<typeof destinationOperationLookupResponseSchema>;
1878
+ type NotificationDestinationExecuteResult = z.infer<typeof destinationOperationExecuteResponseSchema>;
1879
+ /** Canonical account-authorized notification ingress. A configured webhook UUID
1880
+ * is a destination reference, never permission to submit arbitrary URLs/secrets.
1881
+ * Scope is a local hierarchy reference within an explicitly bound cloud workspace.
1882
+ */
1883
+ declare class NotificationsClient {
1884
+ private readonly transport;
1885
+ private readonly authorize;
1886
+ private readonly origin;
1887
+ constructor(origin: string, transport: Transport, authorize: WorkspaceAuthorization);
1888
+ private call;
1889
+ read(workspaceId: string, scope: NotificationScope): Promise<NotificationSettings>;
1890
+ save(workspaceId: string, input: {
1891
+ scope: NotificationScope;
1892
+ expectedRevision: string;
1893
+ rules: NotificationRule[];
1894
+ }): Promise<NotificationSettings>;
1895
+ emit(workspaceId: string, input: AgentNotificationInput): Promise<NotificationAdmission>;
1896
+ prepareDestinationOperation(workspaceId: string, operationId: string, action: NotificationDestinationAction): Promise<NotificationDestinationMutationResult>;
1897
+ lookupDestinationOperation(workspaceId: string, operationId: string): Promise<NotificationDestinationLookupResult>;
1898
+ executeDestinationOperation(workspaceId: string, operationId: string): Promise<NotificationDestinationExecuteResult>;
1899
+ }
1900
+
1901
+ declare const provider: z.ZodEnum<{
1902
+ google: "google";
1903
+ github: "github";
1904
+ twitter: "twitter";
1905
+ }>;
1906
+ declare const integration: z.ZodObject<{
1907
+ provider: z.ZodEnum<{
1908
+ google: "google";
1909
+ github: "github";
1910
+ twitter: "twitter";
1911
+ }>;
1912
+ available: z.ZodBoolean;
1913
+ scopes: z.ZodArray<z.ZodString>;
1914
+ linked: z.ZodNullable<z.ZodObject<{
1915
+ provider: z.ZodEnum<{
1916
+ google: "google";
1917
+ github: "github";
1918
+ twitter: "twitter";
1919
+ }>;
1920
+ email: z.ZodNullable<z.ZodString>;
1921
+ username: z.ZodNullable<z.ZodString>;
1922
+ created_at: z.ZodOptional<z.ZodString>;
1923
+ }, z.core.$loose>>;
1924
+ }, z.core.$strict>;
1925
+ declare const operation: z.ZodObject<{
1926
+ operationId: z.ZodString;
1927
+ actorAccountId: z.ZodOptional<z.ZodString>;
1928
+ clientId: z.ZodOptional<z.ZodString>;
1929
+ provider: z.ZodOptional<z.ZodEnum<{
1930
+ google: "google";
1931
+ github: "github";
1932
+ twitter: "twitter";
1933
+ }>>;
1934
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1935
+ state: z.ZodEnum<{
1936
+ "not-observed": "not-observed";
1937
+ committed: "committed";
1938
+ rejected: "rejected";
1939
+ cancelled: "cancelled";
1940
+ waiting: "waiting";
1941
+ exchanging: "exchanging";
1942
+ }>;
1943
+ authorizationUrl: z.ZodOptional<z.ZodString>;
1944
+ expiresAt: z.ZodOptional<z.ZodString>;
1945
+ linked: z.ZodOptional<z.ZodObject<{
1946
+ provider: z.ZodEnum<{
1947
+ google: "google";
1948
+ github: "github";
1949
+ twitter: "twitter";
1950
+ }>;
1951
+ email: z.ZodNullable<z.ZodString>;
1952
+ username: z.ZodNullable<z.ZodString>;
1953
+ created_at: z.ZodOptional<z.ZodString>;
1954
+ }, z.core.$loose>>;
1955
+ rejection: z.ZodOptional<z.ZodString>;
1956
+ replayed: z.ZodOptional<z.ZodBoolean>;
1957
+ }, z.core.$strict>;
1958
+ type AccountIntegration = z.infer<typeof integration>;
1959
+ type AccountIntegrationOperation = z.infer<typeof operation>;
1960
+ type AccountIntegrationProvider = z.infer<typeof provider>;
1961
+ type Authorize = (method: string, url: string, options: {
1962
+ scopes: string[];
1963
+ silent: true;
1964
+ }) => Promise<RequestAuthorization | null>;
1965
+ declare class AccountIntegrationClient {
1966
+ private transport;
1967
+ private authorize;
1968
+ private base;
1969
+ constructor(base: string, transport: Transport, authorize: Authorize);
1970
+ private call;
1971
+ list(): Promise<AccountIntegration[]>;
1972
+ operation(operationId: string): Promise<AccountIntegrationOperation>;
1973
+ start(operationId: string, value: AccountIntegrationProvider): Promise<AccountIntegrationOperation>;
1974
+ cancel(operationId: string): Promise<AccountIntegrationOperation>;
1975
+ }
1976
+
1977
+ interface DpopProofArgs {
1978
+ method: string;
1979
+ url: string;
1980
+ accessToken?: string;
1981
+ nonce?: string;
1982
+ }
1983
+ /**
1984
+ * Host-owned sender-constraint key. Desktop/CLI implementations keep the
1985
+ * private key in the OS keystore/TPM; the SDK receives signing capability, not
1986
+ * exportable private material.
1987
+ */
1988
+ interface DpopSigner {
1989
+ readonly jkt: string;
1990
+ createProof(args: DpopProofArgs): Promise<string>;
1991
+ }
1992
+ declare function normalizeDpopHtu(value: string): string;
1993
+
1994
+ /**
1995
+ * OIDC relying-party flows (OAuth 2.1 / RFC 9700 compliant):
1996
+ * - Authorization Code + PKCE (S256) for web + native (RFC 8252).
1997
+ * - Device Authorization Grant (RFC 8628) for CLI / headless.
1998
+ *
1999
+ * No implicit flow, no ROPC — both are forbidden. PKCE is always used, even for
2000
+ * confidential clients.
2001
+ */
2002
+ interface OidcConfig {
2003
+ /** Issuer base, e.g. https://xenostudio.ai (endpoints derived or overridden). */
2004
+ issuer: string;
2005
+ clientId: string;
2006
+ /** Confidential clients only; public clients (SPA/CLI/native) omit it. */
2007
+ clientSecret?: string;
2008
+ redirectUri?: string;
2009
+ scopes?: string[];
2010
+ authorizeUrl?: string;
2011
+ tokenUrl?: string;
2012
+ deviceAuthorizationUrl?: string;
2013
+ jwksUrl?: string;
2014
+ /** Required for every public-client token. The private key remains host-owned. */
2015
+ dpopSigner: DpopSigner;
2016
+ }
2017
+ interface PkcePair {
2018
+ verifier: string;
2019
+ challenge: string;
2020
+ }
2021
+ /**
2022
+ * RFC 7636 PKCE pair (S256). Browser-safe: uses Web Crypto (`globalThis.crypto`),
2023
+ * available in Node 20+ AND every browser — no `node:crypto`, so this build
2024
+ * imports cleanly in a web SPA and an Electron renderer (XENO AUTH §11, §14.3).
2025
+ * Async because Web Crypto's SHA-256 (`subtle.digest`) is async.
2026
+ */
2027
+ declare function generatePkce(): Promise<PkcePair>;
2028
+ declare function generateState(): string;
2029
+ /**
2030
+ * Build the authorize URL for the Authorization Code + PKCE flow. The caller
2031
+ * persists `{ state, verifier }` (e.g. encrypted in a cookie/flow token) and
2032
+ * passes the verifier back to {@link exchangeCode}.
2033
+ */
2034
+ declare function buildAuthorizeUrl(cfg: OidcConfig, args: {
2035
+ state: string;
2036
+ codeChallenge: string;
2037
+ redirectUri?: string;
2038
+ scopes?: string[];
2039
+ nonce?: string;
2040
+ prompt?: 'login';
2041
+ maxAge?: number;
2042
+ acrValues?: 'urn:xeno:acr:fresh';
2043
+ }): string;
2044
+ /** Exchange an authorization code for tokens (carries the PKCE verifier). */
2045
+ declare function exchangeCode(cfg: OidcConfig, transport: Transport, args: {
2046
+ code: string;
2047
+ codeVerifier: string;
2048
+ redirectUri?: string;
2049
+ expectedNonce: string;
2050
+ expectedScopes?: string[];
2051
+ signal?: AbortSignal;
2052
+ }): Promise<TokenSet>;
2053
+ /**
2054
+ * Refresh tokens. The origin rotates the refresh token on every use
2055
+ * (RFC 9700 §2.2.2) — always persist the returned `refreshToken`, and treat a
2056
+ * confirmed invalid_grant as re-auth required. A lost reply is retried only with
2057
+ * the same `rotationId`, which lets the origin tell an honest retry from a replay.
2058
+ */
2059
+ declare function refreshTokens(cfg: OidcConfig, transport: Transport, refreshToken: string, rotationId?: string): Promise<TokenSet>;
2060
+ interface DeviceAuthorization {
2061
+ deviceCode: string;
2062
+ userCode: string;
2063
+ verificationUri: string;
2064
+ verificationUriComplete: string | null;
2065
+ expiresAt: Date;
2066
+ intervalSeconds: number;
2067
+ }
2068
+ declare function startDeviceAuthorization(cfg: OidcConfig, transport: Transport, scopes?: string[]): Promise<DeviceAuthorization>;
2069
+ /**
2070
+ * Poll the token endpoint for a device grant, honouring `authorization_pending`
2071
+ * / `slow_down` per RFC 8628. Resolves when the user approves, rejects on
2072
+ * expiry/denial. `onPending` lets a CLI print progress.
2073
+ */
2074
+ declare function pollDeviceToken(cfg: OidcConfig, transport: Transport, device: DeviceAuthorization, opts?: {
2075
+ sleep?: (ms: number) => Promise<void>;
2076
+ signal?: AbortSignal;
2077
+ }): Promise<TokenSet>;
2078
+
2079
+ /**
2080
+ * TokenStore — pluggable persistence for the (rotating) refresh token
2081
+ * (XENO AUTH §11). The SDK ships the interface + a `memoryStore`; the host
2082
+ * provides the OS-keystore primitive (Electron `safeStorage` / OS keychain) via
2083
+ * `keychainStore`, so a cleartext refresh token never touches disk (L9). Web uses
2084
+ * an httpOnly cookie (host-provided); server RPs use Redis+Postgres (host-provided).
2085
+ */
2086
+ interface TokenStore {
2087
+ get(key: string): Promise<string | null>;
2088
+ set(key: string, value: string): Promise<void>;
2089
+ delete(key: string): Promise<void>;
2090
+ /** Exclusion for this secure-store entry, including other host processes.
2091
+ * Work must not call withExclusive recursively. Required for session writes. */
2092
+ withExclusive?<T>(key: string, work: () => Promise<T>): Promise<T>;
2093
+ }
2094
+ /** In-memory store: web access tokens, degraded desktop, and agent/CI contexts. */
2095
+ declare function memoryStore(): TokenStore;
2096
+ /** The encrypt-at-rest primitive a desktop/CLI host injects (Electron safeStorage,
2097
+ * OS keychain via git-credential-helper). Sync or async both accepted. */
2098
+ interface Keychain {
2099
+ get(key: string): Promise<string | null> | string | null;
2100
+ set(key: string, value: string): Promise<void> | void;
2101
+ delete(key: string): Promise<void> | void;
2102
+ withExclusive?<T>(key: string, work: () => Promise<T>): Promise<T>;
2103
+ }
2104
+ /** OS-keystore-backed store (DEFAULT for desktop + CLI). The refresh token is only
2105
+ * ever held encrypted by the host keychain; the SDK never writes it to disk. */
2106
+ declare function keychainStore(kc: Keychain): TokenStore;
2107
+
2108
+ interface BrokerTokenRequest {
2109
+ clientId: string;
2110
+ scopes: string[];
2111
+ resource: 'https://api.xenostudio.ai';
2112
+ childDpopJkt: string;
2113
+ }
2114
+ /** Transport is supplied by Hub/Electron main after OS peer verification. */
2115
+ interface BrokerAdapter {
2116
+ getToken(request: BrokerTokenRequest): Promise<TokenSet | null>;
2117
+ logout?(): Promise<void>;
2118
+ }
2119
+
2120
+ interface VerifiedAccessClaims {
2121
+ iss: string;
2122
+ sub: string;
2123
+ aud: string | string[];
2124
+ exp: number;
2125
+ iat: number;
2126
+ sid: string;
2127
+ client_id: string;
2128
+ azp: string;
2129
+ scope: string;
2130
+ typ: 'at+jwt';
2131
+ auth_epoch: number;
2132
+ auth_time?: number;
2133
+ acr?: string;
2134
+ amr?: string[];
2135
+ cnf: {
2136
+ jkt: string;
2137
+ };
2138
+ act?: {
2139
+ client_id: 'xeno-hub';
2140
+ installation_id_hash: string;
2141
+ sub?: string;
2142
+ };
2143
+ }
2144
+ interface VerifiedIdClaims {
2145
+ iss: string;
2146
+ sub: string;
2147
+ aud: string | string[];
2148
+ exp: number;
2149
+ iat: number;
2150
+ sid: string;
2151
+ auth_time: number;
2152
+ nonce?: string;
2153
+ email?: string;
2154
+ email_verified?: boolean;
2155
+ preferred_username?: string;
2156
+ name?: string;
2157
+ picture?: string;
2158
+ }
2159
+ interface VerifiedLogoutClaims {
2160
+ iss: string;
2161
+ aud: string | string[];
2162
+ exp: number;
2163
+ iat: number;
2164
+ jti: string;
2165
+ sid?: string;
2166
+ sub?: string;
2167
+ events: {
2168
+ 'http://schemas.openid.net/event/backchannel-logout': Record<string, never>;
2169
+ };
2170
+ }
2171
+ declare function verifyAccessToken(args: {
2172
+ token: string;
2173
+ transport: Transport;
2174
+ issuer: string;
2175
+ clientId: string;
2176
+ dpopJkt: string;
2177
+ jwksUrl?: string;
2178
+ expectedScopes?: string[];
2179
+ requireBrokerActor?: boolean;
2180
+ }): Promise<VerifiedAccessClaims>;
2181
+ declare function verifyIdToken(args: {
2182
+ token: string;
2183
+ transport: Transport;
2184
+ issuer: string;
2185
+ clientId: string;
2186
+ jwksUrl?: string;
2187
+ expectedNonce?: string;
2188
+ expectedSubject?: string;
2189
+ }): Promise<VerifiedIdClaims>;
2190
+ /** Verify an OpenID Connect Back-Channel Logout Token before local revocation. */
2191
+ declare function verifyLogoutToken(args: {
2192
+ token: string;
2193
+ transport: Transport;
2194
+ issuer: string;
2195
+ clientId: string;
2196
+ jwksUrl?: string;
2197
+ }): Promise<VerifiedLogoutClaims>;
2198
+
2199
+ /**
2200
+ * Configuration for a branch (app) wiring into the XENO account origin.
2201
+ *
2202
+ * issuer — the origin's auth base (e.g. https://xenostudio.ai)
2203
+ * apiBase — the origin's private API base for ledger/authz
2204
+ * (e.g. https://api.xenostudio.ai)
2205
+ * surface — this app's attribution tag, e.g. 'xeno_post'
2206
+ */
2207
+ interface XenoAccountClientConfig {
2208
+ issuer: string;
2209
+ apiBase: string;
2210
+ surface: Surface;
2211
+ oidc: Omit<OidcConfig, 'issuer'>;
2212
+ transport?: TransportOptions;
2213
+ /** Where the rotating refresh token lives (default: memory). Desktop/CLI pass
2214
+ * a keychainStore; web passes a cookie/memory store (XENO AUTH §11). */
2215
+ store?: TokenStore;
2216
+ /** Explicit credential override — chain step 2 (XENO_API_KEY / provisioned key /
2217
+ * remote-run token). Bypasses interactive paths. Defaults to env XENO_API_KEY. */
2218
+ apiKey?: string;
2219
+ /** Optional Hub broker. Failure falls through to this app's own refresh. */
2220
+ broker?: BrokerAdapter;
2221
+ }
2222
+ /**
2223
+ * The one client every XENO branch uses. Composes identity (OIDC + /me),
2224
+ * ledger (idempotent metering + two-phase holds) and authz (ReBAC) behind a
2225
+ * single, framework-agnostic facade.
2226
+ *
2227
+ * Standalone-first: a branch only constructs this in cloud mode (when a
2228
+ * platform URL is configured). With it absent, the app runs on its own auth.
2229
+ */
2230
+ declare class XenoAccountClient {
2231
+ readonly surface: Surface;
2232
+ readonly account: AccountClient;
2233
+ readonly ledger: LedgerClient;
2234
+ readonly authz: AuthzClient;
2235
+ private readonly oidcConfig;
2236
+ private readonly issuer;
2237
+ private authorities;
2238
+ private readonly transport;
2239
+ private readonly store;
2240
+ private readonly apiKey?;
2241
+ private readonly broker?;
2242
+ private readonly refreshStoreKey;
2243
+ private readonly refreshPendingKey;
2244
+ private access;
2245
+ private user;
2246
+ private interactive?;
2247
+ private resolutionFlight;
2248
+ private generation;
2249
+ private locallySignedOut;
2250
+ private readonly listeners;
2251
+ constructor(cfg: XenoAccountClientConfig);
2252
+ get workspaces(): WorkspaceClient;
2253
+ get workforce(): WorkforceClient;
2254
+ get notifications(): NotificationsClient;
2255
+ get integrations(): AccountIntegrationClient;
2256
+ /**
2257
+ * Return a valid Bearer for the gate, walking the chain:
2258
+ * 1 in-memory access token → 2 explicit override (apiKey/XENO_API_KEY) →
2259
+ * 3 [broker — host-wired] → 4 this product's own refresh token →
2260
+ * 5 interactive sign-in (host-provided; skipped when `silent`) → null.
2261
+ */
2262
+ getAccessToken(opts?: {
2263
+ scopes?: string[];
2264
+ silent?: boolean;
2265
+ }): Promise<string | null>;
2266
+ private resolveSession;
2267
+ /** Register the host's interactive sign-in (loopback PKCE / device grant). */
2268
+ setInteractiveSignIn(fn: (scopes?: string[]) => Promise<TokenSet>): void;
2269
+ isAuthenticated(): boolean;
2270
+ currentUser(): Account | null;
2271
+ /** Subscribe to login/refresh/logout/backchannel. Returns an unsubscribe fn. */
2272
+ onAuthChanged(cb: (a: Account | null) => void): () => void;
2273
+ /** Local wipe only, used after durable host-side invalidation/reconciliation. */
2274
+ signOutLocal(): Promise<void>;
2275
+ /** Revoke this subject-owned session, then always clear local state. */
2276
+ signOut(): Promise<{
2277
+ serverRevoked: boolean;
2278
+ }>;
2279
+ /** Step-up protected, subject-keyed global logout. Only authorized clients can call it. */
2280
+ signOutEverywhere(): Promise<void>;
2281
+ private setUnauthenticated;
2282
+ private emit;
2283
+ /**
2284
+ * The 0.2.0 workforce builds (shipped vendored, never published) marked an in-flight refresh at
2285
+ * `<refresh key>-uncertain` and never named the rotation. An install upgrading with that marker
2286
+ * present may hold a token the origin already rotated, so sending it would be a replay — the
2287
+ * zero-grace reuse that revokes the whole family. It is therefore an unconfirmed transition like any
2288
+ * other v1 marker: refused silently, recoverable only by explicit sign-in (which writes this
2289
+ * version's own marker, after which the legacy one is never consulted again).
2290
+ */
2291
+ private legacyRefreshMarker;
2292
+ private storeRead;
2293
+ private cacheCurrent;
2294
+ private exclusiveStore;
2295
+ private reserveSignIn;
2296
+ private resolveInteractive;
2297
+ /** Cache the access token, persist the rotated refresh token, update the user. */
2298
+ private applyTokenSet;
2299
+ private cancelCommittedSignIn;
2300
+ /**
2301
+ * Begin "Continue with XENO". Returns the authorize URL to redirect to, plus
2302
+ * the `{ state, verifier }` the caller MUST persist (encrypted) to complete
2303
+ * the flow in {@link completeSignIn}.
2304
+ */
2305
+ beginSignIn(args?: {
2306
+ redirectUri?: string;
2307
+ scopes?: string[];
2308
+ fresh?: boolean;
2309
+ }): Promise<{
2310
+ url: string;
2311
+ state: string;
2312
+ nonce: string;
2313
+ pkce: PkcePair;
2314
+ }>;
2315
+ /** Complete the code flow: exchange `code` (with the saved verifier) for tokens,
2316
+ * then cache the access token + persist the refresh token + set the user. */
2317
+ completeSignIn(args: {
2318
+ code: string;
2319
+ codeVerifier: string;
2320
+ expectedNonce: string;
2321
+ expectedScopes?: string[];
2322
+ redirectUri?: string;
2323
+ signal?: AbortSignal;
2324
+ }): Promise<TokenSet>;
2325
+ private bindSignInCancellation;
2326
+ /** Headers for one sender-constrained resource request. */
2327
+ authorization(method: string, url: string, opts?: {
2328
+ scopes?: string[];
2329
+ silent?: boolean;
2330
+ }): Promise<RequestAuthorization | null>;
2331
+ /** Verify and sender-constrain a previously persisted access token. Server
2332
+ * consumers use this for encrypted per-workspace sessions without placing
2333
+ * those tokens into the process-global client cache. */
2334
+ authorizationForToken(token: string, method: string, url: string, expectedScopes?: string[]): Promise<RequestAuthorization>;
2335
+ /** Verify a provider-originated Back-Channel Logout Token. */
2336
+ verifyBackchannelLogout(token: string): Promise<VerifiedLogoutClaims>;
2337
+ private createProof;
2338
+ /** Rotate tokens. Persist the returned refreshToken; a failure means re-auth. */
2339
+ refresh(refreshToken: string, rotationId?: string): Promise<TokenSet>;
2340
+ startDeviceLogin(scopes?: string[]): Promise<DeviceAuthorization>;
2341
+ awaitDeviceLogin(device: Awaited<ReturnType<XenoAccountClient['startDeviceLogin']>>, opts?: {
2342
+ signal?: AbortSignal;
2343
+ }): Promise<TokenSet>;
2344
+ }
2345
+
2346
+ export { type UsageEventInput as $, type Account as A, type Balance as B, type NotificationDestinationLookupResult as C, type DeviceAuthorization as D, type NotificationDestinationMutationResult as E, type NotificationDestinationOperation as F, type NotificationRule as G, type Hold as H, type NotificationScope as I, type NotificationSettings as J, type Keychain as K, LedgerClient as L, MICRO_PER_CREDIT as M, type NotificationAdmission as N, NotificationsClient as O, type OAuthTokenResponse as P, type OidcConfig as Q, type PkcePair as R, type RequestArgs as S, type RequestAuthorization as T, type RequestAuthorizationProvider as U, type Surface as V, type TokenSet as W, type TokenStore as X, Transport as Y, type TransportOptions as Z, type UsageEvent as _, AccountClient as a, notificationDestinationActionSchema as a$, type UsageResult as a0, type VerifiedAccessClaims as a1, type VerifiedIdClaims as a2, type VerifiedLogoutClaims as a3, type WorkforceAuthorization as a4, WorkforceClient as a5, type WorkforceCreateResourceInput as a6, type WorkforceDefinition as a7, type WorkforceListOwnedResourcesInput as a8, type WorkforceOperationResult as a9, type XenoAccountClientConfig as aA, accountOperationIntentSchema as aB, accountSchema as aC, assertMembershipOperation as aD, authzCheckSchema as aE, authzResultSchema as aF, balanceSchema as aG, buildAuthorizeUrl as aH, codeForStatus as aI, exchangeCode as aJ, fromMicro as aK, generatePkce as aL, generateState as aM, holdRequestSchema as aN, holdSchema as aO, keychainStore as aP, membershipAbandonedSchema as aQ, membershipCommittedSchema as aR, membershipDeliverySchema as aS, membershipMutationSchema as aT, membershipOperationSchema as aU, membershipRejectedSchema as aV, memoryStore as aW, meterAggregationSchema as aX, normalize as aY, normalizeDpopHtu as aZ, notificationChannelSchema as a_, type WorkforceOwnedCatalog as aa, type WorkforceOwner as ab, type WorkforceReadOperationInput as ac, type WorkforceResourceMetadata as ad, WorkforceResourceMutationError as ae, type WorkforceResourceResult as af, type WorkspaceAuthorization as ag, WorkspaceClient as ah, type WorkspaceInvite as ai, type WorkspaceInviteRole as aj, type WorkspaceKey as ak, type WorkspaceKeyInput as al, type WorkspaceKeyMutation as am, WorkspaceKeyMutationError as an, type WorkspaceKeyOperation as ao, type WorkspaceKeyOperationResult as ap, type WorkspaceKeyOperationState as aq, type WorkspaceKeyPage as ar, type WorkspaceKeyReceipt as as, type WorkspaceMember as at, type WorkspaceMembershipMutation as au, WorkspaceMembershipMutationError as av, type WorkspaceMembershipOperation as aw, type WorkspaceMembershipOperationState as ax, type WorkspaceRole as ay, XenoAccountClient as az, AccountError as b, notificationDestinationOperationSchema as b0, notificationEventSchema as b1, notificationRuleSchema as b2, notificationScopeSchema as b3, notificationSettingsSchema as b4, oauthTokenResponseSchema as b5, pollDeviceToken as b6, refreshTokens as b7, startDeviceAuthorization as b8, surfaceSchema as b9, toMicro as ba, tokenSetSchema as bb, usageEventSchema as bc, usageResultSchema as bd, verifyAccessToken as be, verifyIdToken as bf, verifyLogoutToken as bg, workforceCreateResourceSchema as bh, workforceDefinitionSchema as bi, workforceListOwnedResourcesSchema as bj, workforceOwnerSchema as bk, workforceReadOperationSchema as bl, workspaceInviteRoleSchema as bm, workspaceInviteSchema as bn, workspaceKeyOperationSchema as bo, workspaceKeyRejectionSchema as bp, workspaceKeySchema as bq, workspaceKeyScopeSchema as br, workspaceMemberSchema as bs, workspaceRoleSchema as bt, workspaceSchema as bu, type AccountErrorCode as c, type AccountIntegration as d, AccountIntegrationClient as e, type AccountIntegrationOperation as f, type AccountIntegrationProvider as g, AccountMutationError as h, type AccountOperation as i, type AccountOperationIntent as j, type AccountOperationState as k, type AccountWorkspace as l, type AgentNotificationInput as m, type AuthorizationInput as n, type AuthzCheck as o, AuthzClient as p, type AuthzResult as q, type BrokerAdapter as r, type BrokerTokenRequest as s, type DpopProofArgs as t, type DpopSigner as u, type HoldRequest as v, type HoldRequestInput as w, type MeterAggregation as x, type NotificationDestinationAction as y, type NotificationDestinationExecuteResult as z };