@openclaw/clickclack 2026.9.3 → 2026.9.5

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 (503) hide show
  1. package/assets/activity.svg +3 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/{channel-ByvJKugM.js → .setup/channel-yIQ_PUDD.mjs} +70 -37
  4. package/dist/{runtime-api-vd8TLXz1.js → .setup/runtime-api-D9Bwyc44.mjs} +13 -10
  5. package/dist/.setup/secret-contract-api-C1QwGlzF.mjs +3 -0
  6. package/dist/{setup-claim-DHkUFaSu.js → .setup/setup-claim-t5SbtvZy.mjs} +2 -2
  7. package/dist/.setup/setup-plugin-api-B19mjQvl.mjs +2 -0
  8. package/dist/.setup/setup-plugin-api-BUwBPYpy.mjs +18 -0
  9. package/dist/{setup-surface-qNPMK71w.js → .setup/setup-surface-BBl3rvVx.mjs} +1 -1
  10. package/dist/api.js +2 -2
  11. package/dist/channel-plugin-api.js +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/runtime-api.js +3 -3
  14. package/dist/secret-contract-api.js +1 -1
  15. package/dist/setup-entry.js +3 -2
  16. package/dist/setup-plugin-api.js +1 -17
  17. package/node_modules/zod/README.md +27 -0
  18. package/node_modules/zod/compile.cjs +77 -0
  19. package/node_modules/zod/compile.d.cts +1 -0
  20. package/node_modules/zod/compile.d.ts +1 -0
  21. package/node_modules/zod/compile.js +52 -0
  22. package/node_modules/zod/index.cjs +2 -2
  23. package/node_modules/zod/index.d.cts +1 -2
  24. package/node_modules/zod/index.d.ts +1 -2
  25. package/node_modules/zod/index.js +5 -2
  26. package/node_modules/zod/package.json +13 -2
  27. package/node_modules/zod/src/compile.ts +56 -0
  28. package/node_modules/zod/src/index.ts +5 -2
  29. package/node_modules/zod/src/v3/ZodError.ts +22 -12
  30. package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
  31. package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
  32. package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
  33. package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
  34. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
  35. package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
  36. package/node_modules/zod/src/v3/types.ts +5 -5
  37. package/node_modules/zod/src/v4/classic/checks.ts +1 -0
  38. package/node_modules/zod/src/v4/classic/compat.ts +26 -18
  39. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  40. package/node_modules/zod/src/v4/classic/errors.ts +59 -44
  41. package/node_modules/zod/src/v4/classic/external.ts +12 -9
  42. package/node_modules/zod/src/v4/classic/from-json-schema.ts +140 -78
  43. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  44. package/node_modules/zod/src/v4/classic/index.ts +2 -2
  45. package/node_modules/zod/src/v4/classic/iso.ts +2 -72
  46. package/node_modules/zod/src/v4/classic/parse.ts +10 -4
  47. package/node_modules/zod/src/v4/classic/schemas.ts +452 -262
  48. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
  49. package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
  50. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +135 -0
  51. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +30 -1
  52. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
  53. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
  54. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
  55. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  56. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  57. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +720 -0
  58. package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
  59. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
  60. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  61. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  62. package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
  63. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
  64. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +155 -13
  65. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +11 -0
  66. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
  67. package/node_modules/zod/src/v4/classic/tests/error.test.ts +274 -6
  68. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +425 -10
  69. package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
  70. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
  71. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
  72. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  73. package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
  74. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +281 -0
  75. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +47 -0
  76. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
  77. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +183 -0
  78. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
  79. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
  80. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
  81. package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
  82. package/node_modules/zod/src/v4/classic/tests/number.test.ts +46 -9
  83. package/node_modules/zod/src/v4/classic/tests/object.test.ts +245 -12
  84. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -0
  85. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
  86. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
  87. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
  88. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
  89. package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
  90. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +33 -2
  91. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  92. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
  93. package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
  94. package/node_modules/zod/src/v4/classic/tests/string.test.ts +127 -5
  95. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
  96. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +11 -2
  97. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1585 -173
  98. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
  99. package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
  100. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +76 -0
  101. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
  102. package/node_modules/zod/src/v4/core/api.ts +48 -12
  103. package/node_modules/zod/src/v4/core/checks.ts +57 -44
  104. package/node_modules/zod/src/v4/core/compile.ts +2188 -0
  105. package/node_modules/zod/src/v4/core/core.ts +98 -19
  106. package/node_modules/zod/src/v4/core/doc.ts +11 -7
  107. package/node_modules/zod/src/v4/core/errors.ts +115 -24
  108. package/node_modules/zod/src/v4/core/index.ts +3 -0
  109. package/node_modules/zod/src/v4/core/json-schema-generator.ts +6 -1
  110. package/node_modules/zod/src/v4/core/json-schema-processors.ts +257 -93
  111. package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
  112. package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
  113. package/node_modules/zod/src/v4/core/parse.ts +131 -38
  114. package/node_modules/zod/src/v4/core/regexes.ts +30 -13
  115. package/node_modules/zod/src/v4/core/registries.ts +2 -2
  116. package/node_modules/zod/src/v4/core/schemas.ts +759 -461
  117. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
  118. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  119. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  120. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  121. package/node_modules/zod/src/v4/core/tests/compile.test.ts +1639 -0
  122. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
  123. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
  124. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
  125. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  126. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  127. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  128. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
  129. package/node_modules/zod/src/v4/core/to-json-schema.ts +275 -42
  130. package/node_modules/zod/src/v4/core/util.ts +268 -42
  131. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  132. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  133. package/node_modules/zod/src/v4/index.ts +3 -3
  134. package/node_modules/zod/src/v4/locales/ar.ts +3 -0
  135. package/node_modules/zod/src/v4/locales/az.ts +3 -0
  136. package/node_modules/zod/src/v4/locales/be.ts +10 -0
  137. package/node_modules/zod/src/v4/locales/bg.ts +3 -0
  138. package/node_modules/zod/src/v4/locales/bn.ts +121 -0
  139. package/node_modules/zod/src/v4/locales/ca.ts +3 -0
  140. package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
  141. package/node_modules/zod/src/v4/locales/cs.ts +3 -0
  142. package/node_modules/zod/src/v4/locales/da.ts +5 -2
  143. package/node_modules/zod/src/v4/locales/de.ts +3 -0
  144. package/node_modules/zod/src/v4/locales/el.ts +1 -0
  145. package/node_modules/zod/src/v4/locales/en.ts +15 -4
  146. package/node_modules/zod/src/v4/locales/eo.ts +3 -0
  147. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  148. package/node_modules/zod/src/v4/locales/fa.ts +3 -0
  149. package/node_modules/zod/src/v4/locales/fi.ts +3 -0
  150. package/node_modules/zod/src/v4/locales/fr-CA.ts +3 -0
  151. package/node_modules/zod/src/v4/locales/fr.ts +19 -14
  152. package/node_modules/zod/src/v4/locales/gu.ts +121 -0
  153. package/node_modules/zod/src/v4/locales/he.ts +6 -1
  154. package/node_modules/zod/src/v4/locales/hi.ts +124 -0
  155. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  156. package/node_modules/zod/src/v4/locales/hu.ts +3 -0
  157. package/node_modules/zod/src/v4/locales/hy.ts +9 -0
  158. package/node_modules/zod/src/v4/locales/id.ts +3 -0
  159. package/node_modules/zod/src/v4/locales/index.ts +10 -0
  160. package/node_modules/zod/src/v4/locales/is.ts +3 -0
  161. package/node_modules/zod/src/v4/locales/it.ts +3 -0
  162. package/node_modules/zod/src/v4/locales/ja.ts +3 -0
  163. package/node_modules/zod/src/v4/locales/ka.ts +3 -0
  164. package/node_modules/zod/src/v4/locales/km.ts +3 -0
  165. package/node_modules/zod/src/v4/locales/kn.ts +124 -0
  166. package/node_modules/zod/src/v4/locales/ko.ts +3 -0
  167. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  168. package/node_modules/zod/src/v4/locales/mk.ts +3 -0
  169. package/node_modules/zod/src/v4/locales/ms.ts +3 -0
  170. package/node_modules/zod/src/v4/locales/ne.ts +126 -0
  171. package/node_modules/zod/src/v4/locales/nl.ts +3 -0
  172. package/node_modules/zod/src/v4/locales/nn.ts +119 -0
  173. package/node_modules/zod/src/v4/locales/no.ts +5 -2
  174. package/node_modules/zod/src/v4/locales/ota.ts +3 -0
  175. package/node_modules/zod/src/v4/locales/pl.ts +3 -0
  176. package/node_modules/zod/src/v4/locales/ps.ts +3 -0
  177. package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
  178. package/node_modules/zod/src/v4/locales/pt.ts +99 -58
  179. package/node_modules/zod/src/v4/locales/ro.ts +1 -0
  180. package/node_modules/zod/src/v4/locales/ru.ts +10 -0
  181. package/node_modules/zod/src/v4/locales/sk.ts +121 -0
  182. package/node_modules/zod/src/v4/locales/sl.ts +3 -0
  183. package/node_modules/zod/src/v4/locales/sv.ts +5 -2
  184. package/node_modules/zod/src/v4/locales/ta.ts +3 -0
  185. package/node_modules/zod/src/v4/locales/th.ts +3 -0
  186. package/node_modules/zod/src/v4/locales/tk.ts +111 -0
  187. package/node_modules/zod/src/v4/locales/tr.ts +3 -0
  188. package/node_modules/zod/src/v4/locales/uk.ts +3 -0
  189. package/node_modules/zod/src/v4/locales/ur.ts +3 -0
  190. package/node_modules/zod/src/v4/locales/uz.ts +1 -0
  191. package/node_modules/zod/src/v4/locales/vi.ts +3 -0
  192. package/node_modules/zod/src/v4/locales/yo.ts +3 -0
  193. package/node_modules/zod/src/v4/locales/zh-CN.ts +3 -0
  194. package/node_modules/zod/src/v4/locales/zh-TW.ts +3 -0
  195. package/node_modules/zod/src/v4/mini/checks.ts +1 -0
  196. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  197. package/node_modules/zod/src/v4/mini/external.ts +10 -1
  198. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  199. package/node_modules/zod/src/v4/mini/parse.ts +2 -0
  200. package/node_modules/zod/src/v4/mini/schemas.ts +135 -56
  201. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
  202. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
  203. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
  204. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
  205. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  206. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  207. package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
  208. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
  209. package/node_modules/zod/src/v4/mini/tests/index.test.ts +72 -5
  210. package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
  211. package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
  212. package/node_modules/zod/src/v4/mini/tests/string.test.ts +21 -0
  213. package/node_modules/zod/v3/ZodError.cjs +22 -12
  214. package/node_modules/zod/v3/ZodError.d.cts +1 -1
  215. package/node_modules/zod/v3/ZodError.d.ts +1 -1
  216. package/node_modules/zod/v3/ZodError.js +22 -12
  217. package/node_modules/zod/v3/types.cjs +7 -5
  218. package/node_modules/zod/v3/types.js +7 -5
  219. package/node_modules/zod/v4/classic/checks.cjs +2 -1
  220. package/node_modules/zod/v4/classic/checks.d.cts +1 -1
  221. package/node_modules/zod/v4/classic/checks.d.ts +1 -1
  222. package/node_modules/zod/v4/classic/checks.js +1 -1
  223. package/node_modules/zod/v4/classic/compat.d.cts +9 -11
  224. package/node_modules/zod/v4/classic/compat.d.ts +9 -11
  225. package/node_modules/zod/v4/classic/deep-partial.cjs +39 -0
  226. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  227. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  228. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  229. package/node_modules/zod/v4/classic/errors.cjs +43 -34
  230. package/node_modules/zod/v4/classic/errors.d.cts +3 -4
  231. package/node_modules/zod/v4/classic/errors.d.ts +3 -4
  232. package/node_modules/zod/v4/classic/errors.js +43 -34
  233. package/node_modules/zod/v4/classic/external.cjs +30 -27
  234. package/node_modules/zod/v4/classic/external.d.cts +5 -2
  235. package/node_modules/zod/v4/classic/external.d.ts +5 -2
  236. package/node_modules/zod/v4/classic/external.js +5 -8
  237. package/node_modules/zod/v4/classic/from-json-schema.cjs +136 -75
  238. package/node_modules/zod/v4/classic/from-json-schema.js +136 -75
  239. package/node_modules/zod/v4/classic/in-out.cjs +63 -0
  240. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  241. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  242. package/node_modules/zod/v4/classic/in-out.js +36 -0
  243. package/node_modules/zod/v4/classic/index.cjs +2 -2
  244. package/node_modules/zod/v4/classic/index.d.cts +1 -2
  245. package/node_modules/zod/v4/classic/index.d.ts +1 -2
  246. package/node_modules/zod/v4/classic/index.js +2 -2
  247. package/node_modules/zod/v4/classic/iso.cjs +11 -22
  248. package/node_modules/zod/v4/classic/iso.d.cts +2 -17
  249. package/node_modules/zod/v4/classic/iso.d.ts +2 -17
  250. package/node_modules/zod/v4/classic/iso.js +2 -17
  251. package/node_modules/zod/v4/classic/parse.cjs +4 -1
  252. package/node_modules/zod/v4/classic/parse.d.cts +17 -4
  253. package/node_modules/zod/v4/classic/parse.d.ts +17 -4
  254. package/node_modules/zod/v4/classic/parse.js +1 -0
  255. package/node_modules/zod/v4/classic/schemas.cjs +498 -398
  256. package/node_modules/zod/v4/classic/schemas.d.cts +53 -18
  257. package/node_modules/zod/v4/classic/schemas.d.ts +53 -18
  258. package/node_modules/zod/v4/classic/schemas.js +492 -396
  259. package/node_modules/zod/v4/core/api.cjs +23 -4
  260. package/node_modules/zod/v4/core/api.d.cts +13 -9
  261. package/node_modules/zod/v4/core/api.d.ts +13 -9
  262. package/node_modules/zod/v4/core/api.js +21 -4
  263. package/node_modules/zod/v4/core/checks.cjs +37 -31
  264. package/node_modules/zod/v4/core/checks.d.cts +13 -13
  265. package/node_modules/zod/v4/core/checks.d.ts +13 -13
  266. package/node_modules/zod/v4/core/checks.js +37 -31
  267. package/node_modules/zod/v4/core/compile.cjs +1813 -0
  268. package/node_modules/zod/v4/core/compile.d.cts +51 -0
  269. package/node_modules/zod/v4/core/compile.d.ts +51 -0
  270. package/node_modules/zod/v4/core/compile.js +1783 -0
  271. package/node_modules/zod/v4/core/core.cjs +81 -18
  272. package/node_modules/zod/v4/core/core.d.cts +16 -4
  273. package/node_modules/zod/v4/core/core.d.ts +16 -4
  274. package/node_modules/zod/v4/core/core.js +82 -19
  275. package/node_modules/zod/v4/core/doc.cjs +5 -7
  276. package/node_modules/zod/v4/core/doc.d.cts +3 -1
  277. package/node_modules/zod/v4/core/doc.d.ts +3 -1
  278. package/node_modules/zod/v4/core/doc.js +5 -7
  279. package/node_modules/zod/v4/core/errors.cjs +110 -25
  280. package/node_modules/zod/v4/core/errors.d.cts +4 -0
  281. package/node_modules/zod/v4/core/errors.d.ts +4 -0
  282. package/node_modules/zod/v4/core/errors.js +110 -25
  283. package/node_modules/zod/v4/core/index.cjs +5 -1
  284. package/node_modules/zod/v4/core/index.d.cts +3 -0
  285. package/node_modules/zod/v4/core/index.d.ts +3 -0
  286. package/node_modules/zod/v4/core/index.js +3 -0
  287. package/node_modules/zod/v4/core/json-schema-generator.cjs +4 -0
  288. package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
  289. package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
  290. package/node_modules/zod/v4/core/json-schema-generator.js +4 -0
  291. package/node_modules/zod/v4/core/json-schema-processors.cjs +264 -95
  292. package/node_modules/zod/v4/core/json-schema-processors.js +243 -97
  293. package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
  294. package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
  295. package/node_modules/zod/v4/core/memoizer.cjs +272 -0
  296. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  297. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  298. package/node_modules/zod/v4/core/memoizer.js +265 -0
  299. package/node_modules/zod/v4/core/parse.cjs +96 -34
  300. package/node_modules/zod/v4/core/parse.d.cts +14 -11
  301. package/node_modules/zod/v4/core/parse.d.ts +14 -11
  302. package/node_modules/zod/v4/core/parse.js +94 -33
  303. package/node_modules/zod/v4/core/regexes.cjs +27 -15
  304. package/node_modules/zod/v4/core/regexes.d.cts +2 -0
  305. package/node_modules/zod/v4/core/regexes.d.ts +2 -0
  306. package/node_modules/zod/v4/core/regexes.js +24 -13
  307. package/node_modules/zod/v4/core/registries.js +2 -2
  308. package/node_modules/zod/v4/core/schemas.cjs +537 -326
  309. package/node_modules/zod/v4/core/schemas.d.cts +100 -31
  310. package/node_modules/zod/v4/core/schemas.d.ts +100 -31
  311. package/node_modules/zod/v4/core/schemas.js +526 -325
  312. package/node_modules/zod/v4/core/to-json-schema.cjs +242 -39
  313. package/node_modules/zod/v4/core/to-json-schema.d.cts +42 -3
  314. package/node_modules/zod/v4/core/to-json-schema.d.ts +42 -3
  315. package/node_modules/zod/v4/core/to-json-schema.js +241 -39
  316. package/node_modules/zod/v4/core/util.cjs +212 -31
  317. package/node_modules/zod/v4/core/util.d.cts +58 -1
  318. package/node_modules/zod/v4/core/util.d.ts +58 -1
  319. package/node_modules/zod/v4/core/util.js +202 -30
  320. package/node_modules/zod/v4/core/versions.cjs +2 -2
  321. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  322. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  323. package/node_modules/zod/v4/core/versions.js +2 -2
  324. package/node_modules/zod/v4/core/visit.cjs +195 -0
  325. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  326. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  327. package/node_modules/zod/v4/core/visit.js +169 -0
  328. package/node_modules/zod/v4/index.cjs +15 -5
  329. package/node_modules/zod/v4/index.d.cts +2 -2
  330. package/node_modules/zod/v4/index.d.ts +2 -2
  331. package/node_modules/zod/v4/index.js +3 -2
  332. package/node_modules/zod/v4/locales/ar.cjs +3 -0
  333. package/node_modules/zod/v4/locales/ar.js +3 -0
  334. package/node_modules/zod/v4/locales/az.cjs +3 -0
  335. package/node_modules/zod/v4/locales/az.js +3 -0
  336. package/node_modules/zod/v4/locales/be.cjs +10 -0
  337. package/node_modules/zod/v4/locales/be.js +10 -0
  338. package/node_modules/zod/v4/locales/bg.cjs +3 -0
  339. package/node_modules/zod/v4/locales/bg.js +3 -0
  340. package/node_modules/zod/v4/locales/bn.cjs +138 -0
  341. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  342. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  343. package/node_modules/zod/v4/locales/bn.js +111 -0
  344. package/node_modules/zod/v4/locales/ca.cjs +3 -0
  345. package/node_modules/zod/v4/locales/ca.js +3 -0
  346. package/node_modules/zod/v4/locales/ckb.cjs +158 -0
  347. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  348. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  349. package/node_modules/zod/v4/locales/ckb.js +131 -0
  350. package/node_modules/zod/v4/locales/cs.cjs +3 -0
  351. package/node_modules/zod/v4/locales/cs.js +3 -0
  352. package/node_modules/zod/v4/locales/da.cjs +5 -2
  353. package/node_modules/zod/v4/locales/da.js +5 -2
  354. package/node_modules/zod/v4/locales/de.cjs +3 -0
  355. package/node_modules/zod/v4/locales/de.js +3 -0
  356. package/node_modules/zod/v4/locales/el.cjs +1 -0
  357. package/node_modules/zod/v4/locales/el.js +1 -0
  358. package/node_modules/zod/v4/locales/en.cjs +14 -4
  359. package/node_modules/zod/v4/locales/en.js +14 -4
  360. package/node_modules/zod/v4/locales/eo.cjs +3 -0
  361. package/node_modules/zod/v4/locales/eo.js +3 -0
  362. package/node_modules/zod/v4/locales/es.cjs +2 -0
  363. package/node_modules/zod/v4/locales/es.js +2 -0
  364. package/node_modules/zod/v4/locales/fa.cjs +3 -0
  365. package/node_modules/zod/v4/locales/fa.js +3 -0
  366. package/node_modules/zod/v4/locales/fi.cjs +3 -0
  367. package/node_modules/zod/v4/locales/fi.js +3 -0
  368. package/node_modules/zod/v4/locales/fr-CA.cjs +3 -0
  369. package/node_modules/zod/v4/locales/fr-CA.js +3 -0
  370. package/node_modules/zod/v4/locales/fr.cjs +16 -14
  371. package/node_modules/zod/v4/locales/fr.js +16 -14
  372. package/node_modules/zod/v4/locales/gu.cjs +138 -0
  373. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  374. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  375. package/node_modules/zod/v4/locales/gu.js +111 -0
  376. package/node_modules/zod/v4/locales/he.cjs +5 -0
  377. package/node_modules/zod/v4/locales/he.js +5 -0
  378. package/node_modules/zod/v4/locales/hi.cjs +136 -0
  379. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  380. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  381. package/node_modules/zod/v4/locales/hi.js +109 -0
  382. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  383. package/node_modules/zod/v4/locales/hr.js +2 -0
  384. package/node_modules/zod/v4/locales/hu.cjs +3 -0
  385. package/node_modules/zod/v4/locales/hu.js +3 -0
  386. package/node_modules/zod/v4/locales/hy.cjs +9 -0
  387. package/node_modules/zod/v4/locales/hy.js +9 -0
  388. package/node_modules/zod/v4/locales/id.cjs +3 -0
  389. package/node_modules/zod/v4/locales/id.js +3 -0
  390. package/node_modules/zod/v4/locales/index.cjs +22 -2
  391. package/node_modules/zod/v4/locales/index.d.cts +10 -0
  392. package/node_modules/zod/v4/locales/index.d.ts +10 -0
  393. package/node_modules/zod/v4/locales/index.js +10 -0
  394. package/node_modules/zod/v4/locales/is.cjs +3 -0
  395. package/node_modules/zod/v4/locales/is.js +3 -0
  396. package/node_modules/zod/v4/locales/it.cjs +3 -0
  397. package/node_modules/zod/v4/locales/it.js +3 -0
  398. package/node_modules/zod/v4/locales/ja.cjs +3 -0
  399. package/node_modules/zod/v4/locales/ja.js +3 -0
  400. package/node_modules/zod/v4/locales/ka.cjs +3 -0
  401. package/node_modules/zod/v4/locales/ka.js +3 -0
  402. package/node_modules/zod/v4/locales/km.cjs +3 -0
  403. package/node_modules/zod/v4/locales/km.js +3 -0
  404. package/node_modules/zod/v4/locales/kn.cjs +141 -0
  405. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  406. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  407. package/node_modules/zod/v4/locales/kn.js +114 -0
  408. package/node_modules/zod/v4/locales/ko.cjs +3 -0
  409. package/node_modules/zod/v4/locales/ko.js +3 -0
  410. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  411. package/node_modules/zod/v4/locales/lt.js +2 -0
  412. package/node_modules/zod/v4/locales/mk.cjs +3 -0
  413. package/node_modules/zod/v4/locales/mk.js +3 -0
  414. package/node_modules/zod/v4/locales/ms.cjs +3 -0
  415. package/node_modules/zod/v4/locales/ms.js +3 -0
  416. package/node_modules/zod/v4/locales/ne.cjs +136 -0
  417. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  418. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  419. package/node_modules/zod/v4/locales/ne.js +109 -0
  420. package/node_modules/zod/v4/locales/nl.cjs +3 -0
  421. package/node_modules/zod/v4/locales/nl.js +3 -0
  422. package/node_modules/zod/v4/locales/nn.cjs +138 -0
  423. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  424. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  425. package/node_modules/zod/v4/locales/nn.js +111 -0
  426. package/node_modules/zod/v4/locales/no.cjs +5 -2
  427. package/node_modules/zod/v4/locales/no.js +5 -2
  428. package/node_modules/zod/v4/locales/ota.cjs +3 -0
  429. package/node_modules/zod/v4/locales/ota.js +3 -0
  430. package/node_modules/zod/v4/locales/pl.cjs +3 -0
  431. package/node_modules/zod/v4/locales/pl.js +3 -0
  432. package/node_modules/zod/v4/locales/ps.cjs +3 -0
  433. package/node_modules/zod/v4/locales/ps.js +3 -0
  434. package/node_modules/zod/v4/locales/pt-BR.cjs +168 -0
  435. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  436. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  437. package/node_modules/zod/v4/locales/pt-BR.js +141 -0
  438. package/node_modules/zod/v4/locales/pt.cjs +87 -55
  439. package/node_modules/zod/v4/locales/pt.js +87 -55
  440. package/node_modules/zod/v4/locales/ro.cjs +1 -0
  441. package/node_modules/zod/v4/locales/ro.js +1 -0
  442. package/node_modules/zod/v4/locales/ru.cjs +10 -0
  443. package/node_modules/zod/v4/locales/ru.js +10 -0
  444. package/node_modules/zod/v4/locales/sk.cjs +141 -0
  445. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  446. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  447. package/node_modules/zod/v4/locales/sk.js +114 -0
  448. package/node_modules/zod/v4/locales/sl.cjs +3 -0
  449. package/node_modules/zod/v4/locales/sl.js +3 -0
  450. package/node_modules/zod/v4/locales/sv.cjs +5 -2
  451. package/node_modules/zod/v4/locales/sv.js +5 -2
  452. package/node_modules/zod/v4/locales/ta.cjs +3 -0
  453. package/node_modules/zod/v4/locales/ta.js +3 -0
  454. package/node_modules/zod/v4/locales/th.cjs +3 -0
  455. package/node_modules/zod/v4/locales/th.js +3 -0
  456. package/node_modules/zod/v4/locales/tk.cjs +132 -0
  457. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  458. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  459. package/node_modules/zod/v4/locales/tk.js +105 -0
  460. package/node_modules/zod/v4/locales/tr.cjs +3 -0
  461. package/node_modules/zod/v4/locales/tr.js +3 -0
  462. package/node_modules/zod/v4/locales/uk.cjs +3 -0
  463. package/node_modules/zod/v4/locales/uk.js +3 -0
  464. package/node_modules/zod/v4/locales/ur.cjs +3 -0
  465. package/node_modules/zod/v4/locales/ur.js +3 -0
  466. package/node_modules/zod/v4/locales/uz.cjs +1 -0
  467. package/node_modules/zod/v4/locales/uz.js +1 -0
  468. package/node_modules/zod/v4/locales/vi.cjs +3 -0
  469. package/node_modules/zod/v4/locales/vi.js +3 -0
  470. package/node_modules/zod/v4/locales/yo.cjs +3 -0
  471. package/node_modules/zod/v4/locales/yo.js +3 -0
  472. package/node_modules/zod/v4/locales/zh-CN.cjs +3 -0
  473. package/node_modules/zod/v4/locales/zh-CN.js +3 -0
  474. package/node_modules/zod/v4/locales/zh-TW.cjs +3 -0
  475. package/node_modules/zod/v4/locales/zh-TW.js +3 -0
  476. package/node_modules/zod/v4/mini/checks.cjs +2 -1
  477. package/node_modules/zod/v4/mini/checks.d.cts +1 -1
  478. package/node_modules/zod/v4/mini/checks.d.ts +1 -1
  479. package/node_modules/zod/v4/mini/checks.js +1 -1
  480. package/node_modules/zod/v4/mini/deep-partial.cjs +39 -0
  481. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  482. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  483. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  484. package/node_modules/zod/v4/mini/external.cjs +12 -1
  485. package/node_modules/zod/v4/mini/external.d.cts +5 -2
  486. package/node_modules/zod/v4/mini/external.d.ts +5 -2
  487. package/node_modules/zod/v4/mini/external.js +3 -1
  488. package/node_modules/zod/v4/mini/in-out.cjs +63 -0
  489. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  490. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  491. package/node_modules/zod/v4/mini/in-out.js +36 -0
  492. package/node_modules/zod/v4/mini/parse.cjs +3 -1
  493. package/node_modules/zod/v4/mini/parse.d.cts +1 -1
  494. package/node_modules/zod/v4/mini/parse.d.ts +1 -1
  495. package/node_modules/zod/v4/mini/parse.js +1 -1
  496. package/node_modules/zod/v4/mini/schemas.cjs +75 -47
  497. package/node_modules/zod/v4/mini/schemas.d.cts +43 -13
  498. package/node_modules/zod/v4/mini/schemas.d.ts +43 -13
  499. package/node_modules/zod/v4/mini/schemas.js +71 -45
  500. package/openclaw.plugin.json +3 -0
  501. package/package.json +8 -6
  502. package/node_modules/zod/src/v4/core/config.ts +0 -15
  503. /package/dist/{secret-contract-BKkzzjBA.js → .setup/secret-contract-BKkzzjBA.mjs} +0 -0
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 5h12v9H8l-5 4ZM10 17h6l5 4V10h-3" />
3
+ </svg>
Binary file
@@ -1,5 +1,5 @@
1
- import { _ as DEFAULT_ACCOUNT_ID, b as resolveClickClackAccount, c as resolveWorkspaceId, f as normalizeClickClackCorrelationId, g as clickClackMeta, h as clickClackConfigAdapter, l as ClickClackHttpError, m as CLICKCLACK_CHANNEL_ID, n as clickClackSetupContract, p as clickClackConfigSchema, s as resolveChannelId, t as clickClackSetupWizard, u as createClickClackClient, y as listEnabledClickClackAccounts } from "./setup-surface-qNPMK71w.js";
2
- import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-BKkzzjBA.js";
1
+ import { _ as DEFAULT_ACCOUNT_ID, b as resolveClickClackAccount, c as resolveWorkspaceId, f as normalizeClickClackCorrelationId, g as clickClackMeta, h as clickClackConfigAdapter, l as ClickClackHttpError, m as CLICKCLACK_CHANNEL_ID, n as clickClackSetupContract, p as clickClackConfigSchema, s as resolveChannelId, t as clickClackSetupWizard, u as createClickClackClient, y as listEnabledClickClackAccounts } from "./setup-surface-BBl3rvVx.mjs";
2
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-BKkzzjBA.mjs";
3
3
  import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/account-helpers";
4
4
  import { parseDateStringTimestampMs } from "openclaw/plugin-sdk/number-runtime";
5
5
  import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
@@ -14,10 +14,11 @@ import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress";
14
14
  import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
15
15
  import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
16
16
  import { createHash, randomUUID } from "node:crypto";
17
+ import { truncateCodePoints } from "openclaw/plugin-sdk/text-utility-runtime";
17
18
  import { buildMentionRegexes, normalizeMentionText } from "openclaw/plugin-sdk/channel-mention-gating";
18
19
  import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
19
20
  import { listNativeCommandSpecsForConfig } from "openclaw/plugin-sdk/native-command-registry";
20
- import { buildChannelInboundEventContext, createChannelInboundEnvelopeBuilder, recordChannelBotPairLoopAndCheckSuppression } from "openclaw/plugin-sdk/channel-inbound";
21
+ import { buildChannelInboundEventContext, createChannelInboundEnvelopeBuilder, createChannelPartialDeliveryError, recordChannelBotPairLoopAndCheckSuppression } from "openclaw/plugin-sdk/channel-inbound";
21
22
  import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
22
23
  import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
23
24
  import { FormatCapabilityProfile, renderMarkdownWithMarkers, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
@@ -118,7 +119,7 @@ function resolveDiscussionLabel(entry, sessionKey, agentId) {
118
119
  return entry.label?.trim() || entry.displayName?.trim() || entry.subject?.trim() || fallbackDiscussionLabel(sessionKey, agentId);
119
120
  }
120
121
  function truncateDiscussionDisplayTitle(label) {
121
- return Array.from(label).slice(0, 200).join("").trim();
122
+ return truncateCodePoints(label, 200).trim();
122
123
  }
123
124
  function slugifyDiscussionLabel(label, sessionKey) {
124
125
  return slugifyLabel(label) || fallbackDiscussionLabel(sessionKey);
@@ -217,7 +218,7 @@ var ClickClackDiscussionBindingStore = class {
217
218
  return this.#store.lookup(sessionKey);
218
219
  }
219
220
  hasCapacity(sessionKey) {
220
- return this.get(sessionKey) !== void 0 || this.#store.entries().length < MAX_DISCUSSION_BINDINGS;
221
+ return this.get(sessionKey) !== void 0 || this.count() < MAX_DISCUSSION_BINDINGS;
221
222
  }
222
223
  getByChannel(serverBaseUrl, channelId) {
223
224
  const key = channelKey(serverBaseUrl, channelId);
@@ -260,6 +261,9 @@ var ClickClackDiscussionBindingStore = class {
260
261
  binding: entry.value
261
262
  }));
262
263
  }
264
+ count() {
265
+ return this.#store.count?.() ?? this.#store.entries().length;
266
+ }
263
267
  detachedCount() {
264
268
  return this.#detachedAtBySession.size;
265
269
  }
@@ -827,9 +831,6 @@ const CLICKCLACK_COMMAND_PATTERN = /^[a-z0-9_-]{1,32}$/u;
827
831
  const CLICKCLACK_MAX_COMMANDS = 100;
828
832
  const CLICKCLACK_MAX_DESCRIPTION_LENGTH = 100;
829
833
  const CLICKCLACK_MAX_ARGS_HINT_LENGTH = 100;
830
- function truncateCodePoints(value, maxLength) {
831
- return Array.from(value).slice(0, maxLength).join("");
832
- }
833
834
  function commandArgsHint(spec) {
834
835
  if (spec.args?.length) return truncateCodePoints(spec.args.map((arg) => arg.required ? `<${arg.name}>` : `[${arg.name}]`).join(" "), CLICKCLACK_MAX_ARGS_HINT_LENGTH);
835
836
  return spec.acceptsArgs ? "[args]" : "";
@@ -1107,6 +1108,7 @@ async function createTargetMessage(params) {
1107
1108
  const replyToId = params.replyToId == null ? "" : String(params.replyToId);
1108
1109
  if (explicitThreadId || parsed.kind === "thread") {
1109
1110
  const rootId = explicitThreadId || parsed.id;
1111
+ params.assertDirectAdapterHandoff?.();
1110
1112
  await params.onPlatformSendDispatch?.();
1111
1113
  return await params.client.createThreadReply(rootId, params.text, {
1112
1114
  provenance: params.provenance,
@@ -1114,14 +1116,16 @@ async function createTargetMessage(params) {
1114
1116
  });
1115
1117
  }
1116
1118
  if (parsed.kind === "dm") {
1117
- await params.onPlatformSendDispatch?.();
1118
1119
  const dm = await params.client.createDirectConversation(params.workspaceId, [parsed.id]);
1120
+ params.assertDirectAdapterHandoff?.();
1121
+ await params.onPlatformSendDispatch?.();
1119
1122
  return await params.client.createDirectMessage(dm.id, params.text, {
1120
1123
  quotedMessageId: replyToId || void 0,
1121
1124
  nonce: params.nonce
1122
1125
  });
1123
1126
  }
1124
1127
  const channelId = await resolveChannelId(params.client, params.workspaceId, parsed.id);
1128
+ params.assertDirectAdapterHandoff?.();
1125
1129
  await params.onPlatformSendDispatch?.();
1126
1130
  return await params.client.createChannelMessage(channelId, params.text, {
1127
1131
  provenance: params.provenance,
@@ -1146,21 +1150,15 @@ function textDeliveryNonce(params) {
1146
1150
  const digest = durableDeliveryDigest(params);
1147
1151
  return digest ? `openclaw-text:${digest}` : void 0;
1148
1152
  }
1149
- function createDispatchOnce(onPlatformSendDispatch) {
1150
- let dispatched = false;
1151
- return async () => {
1152
- if (dispatched) return;
1153
- await onPlatformSendDispatch?.();
1154
- dispatched = true;
1155
- };
1156
- }
1157
1153
  async function attachUploadRetrySafe(params) {
1158
1154
  try {
1159
1155
  await params.client.attachUpload(params.messageId, params.uploadId);
1160
1156
  } catch (firstError) {
1157
+ params.assertDirectAdapterHandoff?.();
1161
1158
  try {
1162
1159
  if ((await params.client.message(params.messageId)).attachments?.some((attachment) => attachment.id === params.uploadId)) return;
1163
1160
  } catch {}
1161
+ params.assertDirectAdapterHandoff?.();
1164
1162
  try {
1165
1163
  await params.client.attachUpload(params.messageId, params.uploadId);
1166
1164
  } catch {
@@ -1173,12 +1171,18 @@ function createOutboundContext(params) {
1173
1171
  cfg: params.cfg,
1174
1172
  accountId: params.accountId
1175
1173
  });
1174
+ const assertDirectAdapterHandoff = params.assertDirectAdapterHandoff;
1175
+ const fetcher = fetch;
1176
1176
  return {
1177
1177
  account,
1178
1178
  client: createClickClackClient({
1179
1179
  baseUrl: account.apiEndpoint,
1180
1180
  token: account.token,
1181
- correlationId: params.correlationId
1181
+ correlationId: params.correlationId,
1182
+ fetch: assertDirectAdapterHandoff ? (input, init) => {
1183
+ assertDirectAdapterHandoff();
1184
+ return fetcher(input, init);
1185
+ } : void 0
1182
1186
  })
1183
1187
  };
1184
1188
  }
@@ -1190,11 +1194,9 @@ async function sendClickClackText(params) {
1190
1194
  const text = renderClickClackMarkdown(sanitizeAssistantVisibleText(params.text));
1191
1195
  if (!text) return;
1192
1196
  const { account, client } = createOutboundContext(params);
1193
- const workspaceId = await resolveWorkspaceId(client, account.workspace);
1194
- const dispatch = createDispatchOnce(params.onPlatformSendDispatch);
1195
1197
  return (await createTargetMessage({
1196
1198
  client,
1197
- workspaceId,
1199
+ workspaceId: await resolveWorkspaceId(client, account.workspace),
1198
1200
  to: params.to,
1199
1201
  text,
1200
1202
  threadId: params.threadId,
@@ -1204,7 +1206,8 @@ async function sendClickClackText(params) {
1204
1206
  deliveryQueueId: params.deliveryQueueId,
1205
1207
  deliveryPartIndex: params.deliveryPartIndex
1206
1208
  }),
1207
- onPlatformSendDispatch: dispatch
1209
+ onPlatformSendDispatch: params.onPlatformSendDispatch,
1210
+ assertDirectAdapterHandoff: params.assertDirectAdapterHandoff
1208
1211
  })).id;
1209
1212
  }
1210
1213
  /** Resolves, uploads, sends, then attaches one file to a ClickClack message. */
@@ -1226,12 +1229,10 @@ async function sendClickClackMedia(params) {
1226
1229
  mediaReadFile: params.mediaReadFile
1227
1230
  });
1228
1231
  const workspaceId = await resolveWorkspaceId(client, account.workspace);
1229
- const persistedUpload = nonces.upload ? await client.findUploadByNonce({
1232
+ let upload = nonces.upload ? await client.findUploadByNonce({
1230
1233
  workspaceId,
1231
1234
  nonce: nonces.upload
1232
1235
  }) : void 0;
1233
- const dispatch = createDispatchOnce(params.onPlatformSendDispatch);
1234
- let upload = persistedUpload;
1235
1236
  let mediaFilename = preloadedMedia?.fileName?.trim();
1236
1237
  if (!upload) {
1237
1238
  const media = preloadedMedia ?? await loadOutboundMediaFromUrl(params.mediaUrl, {
@@ -1243,7 +1244,6 @@ async function sendClickClackMedia(params) {
1243
1244
  const contentType = media.contentType?.trim() || "application/octet-stream";
1244
1245
  const filename = media.fileName?.trim() || `attachment${extensionForMime(contentType) ?? ""}`;
1245
1246
  mediaFilename = filename;
1246
- await dispatch();
1247
1247
  upload = await client.createUpload({
1248
1248
  workspaceId,
1249
1249
  buffer: media.buffer,
@@ -1261,13 +1261,36 @@ async function sendClickClackMedia(params) {
1261
1261
  threadId: params.threadId,
1262
1262
  replyToId: params.replyToId,
1263
1263
  nonce: nonces.message,
1264
- onPlatformSendDispatch: dispatch
1264
+ onPlatformSendDispatch: params.onPlatformSendDispatch,
1265
+ assertDirectAdapterHandoff: params.assertDirectAdapterHandoff
1265
1266
  });
1266
- await attachUploadRetrySafe({
1267
- client,
1268
- messageId: message.id,
1269
- uploadId: upload.id
1267
+ const receipt = createMessageReceiptFromOutboundResults({
1268
+ results: [{
1269
+ channel: "clickclack",
1270
+ messageId: message.id
1271
+ }],
1272
+ threadId: params.threadId == null ? void 0 : String(params.threadId),
1273
+ replyToId: params.replyToId == null ? void 0 : String(params.replyToId),
1274
+ kind: "text"
1270
1275
  });
1276
+ try {
1277
+ await params.onDeliveryResult?.({
1278
+ messageId: message.id,
1279
+ receipt
1280
+ });
1281
+ await attachUploadRetrySafe({
1282
+ client,
1283
+ messageId: message.id,
1284
+ uploadId: upload.id,
1285
+ assertDirectAdapterHandoff: params.assertDirectAdapterHandoff
1286
+ });
1287
+ } catch (error) {
1288
+ throw createChannelPartialDeliveryError(error, {
1289
+ visibleReplySent: true,
1290
+ messageIds: [message.id],
1291
+ receipt
1292
+ });
1293
+ }
1271
1294
  return message.id;
1272
1295
  }
1273
1296
  function collectReconciliationMediaUrls(ctx) {
@@ -2122,7 +2145,8 @@ const clickClackMessageAdapter = defineChannelMessageAdapter({
2122
2145
  replyToId: ctx.replyToId,
2123
2146
  deliveryQueueId: ctx.deliveryQueueId,
2124
2147
  deliveryPartIndex: ctx.deliveryPartIndex,
2125
- onPlatformSendDispatch: ctx.onPlatformSendDispatch
2148
+ onPlatformSendDispatch: ctx.onPlatformSendDispatch,
2149
+ assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff
2126
2150
  });
2127
2151
  const threadId = ctx.threadId == null ? void 0 : String(ctx.threadId);
2128
2152
  const replyToId = ctx.replyToId ?? void 0;
@@ -2153,7 +2177,9 @@ const clickClackMessageAdapter = defineChannelMessageAdapter({
2153
2177
  replyToId: ctx.replyToId,
2154
2178
  deliveryQueueId: ctx.deliveryQueueId,
2155
2179
  deliveryPartIndex: ctx.deliveryPartIndex,
2156
- onPlatformSendDispatch: ctx.onPlatformSendDispatch
2180
+ onPlatformSendDispatch: ctx.onPlatformSendDispatch,
2181
+ assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
2182
+ onDeliveryResult: ctx.onDeliveryResult
2157
2183
  });
2158
2184
  const threadId = ctx.threadId == null ? void 0 : String(ctx.threadId);
2159
2185
  const replyToId = ctx.replyToId ?? void 0;
@@ -2264,7 +2290,7 @@ const clickClackPlugin = createChatChannelPlugin({
2264
2290
  base: { deliveryMode: "direct" },
2265
2291
  attachedResults: {
2266
2292
  channel: CHANNEL_ID,
2267
- sendText: async ({ cfg, to, text, accountId, threadId, replyToId, deliveryQueueId, deliveryPartIndex, onPlatformSendDispatch }) => {
2293
+ sendText: async ({ cfg, to, text, accountId, threadId, replyToId, deliveryQueueId, deliveryPartIndex, onPlatformSendDispatch, assertDirectAdapterHandoff }) => {
2268
2294
  return { messageId: await sendClickClackText({
2269
2295
  cfg,
2270
2296
  accountId,
@@ -2274,10 +2300,11 @@ const clickClackPlugin = createChatChannelPlugin({
2274
2300
  replyToId,
2275
2301
  deliveryQueueId,
2276
2302
  deliveryPartIndex,
2277
- onPlatformSendDispatch
2303
+ onPlatformSendDispatch,
2304
+ assertDirectAdapterHandoff
2278
2305
  }) ?? "" };
2279
2306
  },
2280
- sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, threadId, replyToId, deliveryQueueId, deliveryPartIndex, onPlatformSendDispatch }) => {
2307
+ sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, threadId, replyToId, deliveryQueueId, deliveryPartIndex, onPlatformSendDispatch, assertDirectAdapterHandoff, onDeliveryResult }) => {
2281
2308
  if (!mediaUrl) throw new Error("ClickClack media send requires mediaUrl");
2282
2309
  return { messageId: await sendClickClackMedia({
2283
2310
  cfg,
@@ -2292,7 +2319,13 @@ const clickClackPlugin = createChatChannelPlugin({
2292
2319
  replyToId,
2293
2320
  deliveryQueueId,
2294
2321
  deliveryPartIndex,
2295
- onPlatformSendDispatch
2322
+ onPlatformSendDispatch,
2323
+ assertDirectAdapterHandoff,
2324
+ onDeliveryResult: onDeliveryResult ? ({ messageId: acceptedMessageId, receipt }) => onDeliveryResult({
2325
+ channel: CHANNEL_ID,
2326
+ messageId: acceptedMessageId,
2327
+ receipt
2328
+ }) : void 0
2296
2329
  }) };
2297
2330
  }
2298
2331
  }
@@ -1,6 +1,6 @@
1
- import { b as resolveClickClackAccount, d as isClickClackChannelNameConflict, l as ClickClackHttpError, u as createClickClackClient, v as listClickClackAccountIds } from "./setup-surface-qNPMK71w.js";
2
- import { C as slugifyDiscussionLabel, D as listPendingDiscussionOpens, E as clearPendingDiscussionOpen, O as recordPendingDiscussionOpen, S as resolveDiscussionLabel, T as clearDiscussionBindingGeneration, _ as getClickClackDiscussionBindingStore, b as fallbackDiscussionLabel, c as markClickClackDiscussionChannelIdentityRevoked, d as discussionInfoForBinding, f as normalizedServerBaseUrl, g as bindingMatchesActiveSessionIncarnation, h as attachBindingToCurrentActiveSession, k as reserveDiscussionBindingGeneration, l as markClickClackDiscussionChannelRevoked, o as clearClickClackDiscussionChannelRevoked, p as resolveDiscussionBindingAccount, s as isClickClackDiscussionChannelRevoked, u as discussionAccounts, v as discussionCredentialFingerprint, w as truncateDiscussionDisplayTitle, x as isDiscussionSessionKey, y as discussionExternalRef } from "./channel-ByvJKugM.js";
3
- import "./api.js";
1
+ import { b as resolveClickClackAccount, d as isClickClackChannelNameConflict, l as ClickClackHttpError, u as createClickClackClient, v as listClickClackAccountIds } from "./setup-surface-BBl3rvVx.mjs";
2
+ import { C as slugifyDiscussionLabel, D as listPendingDiscussionOpens, E as clearPendingDiscussionOpen, O as recordPendingDiscussionOpen, S as resolveDiscussionLabel, T as clearDiscussionBindingGeneration, _ as getClickClackDiscussionBindingStore, b as fallbackDiscussionLabel, c as markClickClackDiscussionChannelIdentityRevoked, d as discussionInfoForBinding, f as normalizedServerBaseUrl, g as bindingMatchesActiveSessionIncarnation, h as attachBindingToCurrentActiveSession, k as reserveDiscussionBindingGeneration, l as markClickClackDiscussionChannelRevoked, o as clearClickClackDiscussionChannelRevoked, p as resolveDiscussionBindingAccount, s as isClickClackDiscussionChannelRevoked, u as discussionAccounts, v as discussionCredentialFingerprint, w as truncateDiscussionDisplayTitle, x as isDiscussionSessionKey, y as discussionExternalRef } from "./channel-yIQ_PUDD.mjs";
3
+ import "../api.js";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { buildControlUiSessionPath, registerSessionDiscussionProvider } from "openclaw/plugin-sdk/session-discussion";
6
6
  import { createSessionVisibilityChecker } from "openclaw/plugin-sdk/session-visibility";
@@ -95,17 +95,19 @@ function formatDiscussionHistory(history) {
95
95
  const INSTALLATION_NAMESPACE = "discussion-installation";
96
96
  const INSTALLATION_KEY = "current";
97
97
  /** Returns the durable installation namespace used in server-visible ownership refs. */
98
- function getClickClackDiscussionInstallationId(runtime) {
99
- const store = runtime.state.openSyncKeyedStore({
98
+ async function getClickClackDiscussionInstallationId(runtime) {
99
+ const store = runtime.state.openKeyedStore({
100
100
  namespace: INSTALLATION_NAMESPACE,
101
101
  maxEntries: 1,
102
102
  overflowPolicy: "reject-new"
103
103
  });
104
- const existing = store.lookup(INSTALLATION_KEY)?.id;
104
+ const existing = (await store.lookup(INSTALLATION_KEY))?.id;
105
105
  if (existing) return existing;
106
106
  const id = randomUUID();
107
- store.registerIfAbsent(INSTALLATION_KEY, { id });
108
- return store.lookup(INSTALLATION_KEY)?.id ?? id;
107
+ await store.registerIfAbsent(INSTALLATION_KEY, { id });
108
+ const persisted = (await store.lookup(INSTALLATION_KEY))?.id;
109
+ if (!persisted) throw new Error("ClickClack discussion installation identity is unavailable; retry opening the discussion");
110
+ return persisted;
109
111
  }
110
112
  //#endregion
111
113
  //#region extensions/clickclack/src/discussions/reconcile-scheduler.ts
@@ -517,7 +519,7 @@ var ClickClackDiscussionService = class {
517
519
  baseUrl: account.apiEndpoint,
518
520
  token: account.token
519
521
  }));
520
- this.#installationId = options.installationId ?? getClickClackDiscussionInstallationId(runtime);
522
+ this.#installationId = options.installationId;
521
523
  this.#bindingGenerationFactory = options.bindingGenerationFactory ?? randomUUID;
522
524
  this.#detachedBindings = new DetachedDiscussionBindingRetention({
523
525
  runtime,
@@ -572,6 +574,7 @@ var ClickClackDiscussionService = class {
572
574
  }
573
575
  async open(sessionKey) {
574
576
  return await this.#withSessionLock(sessionKey, async () => {
577
+ this.#installationId ??= await getClickClackDiscussionInstallationId(this.#runtime);
575
578
  const accounts = discussionAccounts(this.#currentConfig());
576
579
  if (accounts.length > 1) throw new Error("ClickClack discussions require exactly one enabled discussion account");
577
580
  const account = accounts[0];
@@ -854,7 +857,7 @@ var ClickClackDiscussionService = class {
854
857
  }
855
858
  #ensureTimer() {
856
859
  const hasPendingOpens = listPendingDiscussionOpens(this.#runtime).length > 0;
857
- const needsBindingPoll = this.#unsubscribeSessionsChanged === void 0 && this.#store.entries().length > 0;
860
+ const needsBindingPoll = this.#unsubscribeSessionsChanged === void 0 && this.#store.count() > 0;
858
861
  if (this.#closed || !hasPendingOpens && !needsBindingPoll) {
859
862
  if (this.#timer) {
860
863
  clearInterval(this.#timer);
@@ -0,0 +1,3 @@
1
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-BKkzzjBA.mjs";
2
+ import "../secret-contract-api.js";
3
+ export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
@@ -1,7 +1,7 @@
1
- import { a as isClickClackSetupLoopbackHost, i as buildClickClackSetupClaimUrl, o as requireClickClackSetupApiBaseUrl } from "./setup-surface-qNPMK71w.js";
1
+ import { a as isClickClackSetupLoopbackHost, i as buildClickClackSetupClaimUrl, o as requireClickClackSetupApiBaseUrl } from "./setup-surface-BBl3rvVx.mjs";
2
+ import { withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
2
3
  import { createProviderOperationDeadline, readProviderJsonResponse, readResponseTextLimited, resolveProviderOperationTimeoutMs } from "openclaw/plugin-sdk/provider-http";
3
4
  import { fetchWithSsrFGuard, resolvePinnedHostnameWithPolicy, ssrfPolicyFromHttpBaseUrlAllowedHostname } from "openclaw/plugin-sdk/ssrf-runtime";
4
- import { withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
5
5
  //#region extensions/clickclack/src/setup-claim.ts
6
6
  const CLICKCLACK_ERROR_BODY_LIMIT_BYTES = 8192;
7
7
  const CLICKCLACK_SETUP_CODE_CLAIM_JSON_LIMIT_BYTES = 65536;
@@ -0,0 +1,2 @@
1
+ import { t as clickClackSetupPlugin } from "./setup-plugin-api-BUwBPYpy.mjs";
2
+ export { clickClackSetupPlugin };
@@ -0,0 +1,18 @@
1
+ import { g as clickClackMeta, h as clickClackConfigAdapter, n as clickClackSetupContract, p as clickClackConfigSchema, t as clickClackSetupWizard } from "./setup-surface-BBl3rvVx.mjs";
2
+ //#region extensions/clickclack/src/channel.setup.ts
3
+ const clickClackSetupPlugin = {
4
+ id: "clickclack",
5
+ meta: clickClackMeta,
6
+ capabilities: {
7
+ chatTypes: ["direct", "group"],
8
+ threads: true,
9
+ blockStreaming: true
10
+ },
11
+ reload: { configPrefixes: ["channels.clickclack"] },
12
+ configSchema: clickClackConfigSchema,
13
+ config: clickClackConfigAdapter,
14
+ setupContract: clickClackSetupContract,
15
+ setupWizard: clickClackSetupWizard
16
+ };
17
+ //#endregion
18
+ export { clickClackSetupPlugin as t };
@@ -827,7 +827,7 @@ const clickClackSetupAdapter = {
827
827
  const claimUrl = setup.exactClaimUrl && !privateApiBaseUrl ? setup.exactClaimUrl : buildClickClackSetupClaimUrl(privateApiBaseUrl ?? setup.baseUrl);
828
828
  let claim;
829
829
  try {
830
- const { claimClickClackSetupCode } = await import("./setup-claim-DHkUFaSu.js");
830
+ const { claimClickClackSetupCode } = await import("./setup-claim-t5SbtvZy.mjs");
831
831
  claim = await claimClickClackSetupCode({
832
832
  claimUrl,
833
833
  code: setup.code,
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as DEFAULT_ACCOUNT_ID, b as resolveClickClackAccount, p as clickClackConfigSchema, u as createClickClackClient, v as listClickClackAccountIds, x as resolveDefaultClickClackAccountId, y as listEnabledClickClackAccounts } from "./setup-surface-qNPMK71w.js";
2
- import { a as setClickClackRuntime, i as getClickClackRuntime, n as buildClickClackTarget, r as parseClickClackTarget, t as clickClackPlugin } from "./channel-ByvJKugM.js";
1
+ import { _ as DEFAULT_ACCOUNT_ID, b as resolveClickClackAccount, p as clickClackConfigSchema, u as createClickClackClient, v as listClickClackAccountIds, x as resolveDefaultClickClackAccountId, y as listEnabledClickClackAccounts } from "./.setup/setup-surface-BBl3rvVx.mjs";
2
+ import { a as setClickClackRuntime, i as getClickClackRuntime, n as buildClickClackTarget, r as parseClickClackTarget, t as clickClackPlugin } from "./.setup/channel-yIQ_PUDD.mjs";
3
3
  export { DEFAULT_ACCOUNT_ID, buildClickClackTarget, clickClackConfigSchema, clickClackPlugin, createClickClackClient, getClickClackRuntime, listClickClackAccountIds, listEnabledClickClackAccounts, parseClickClackTarget, resolveClickClackAccount, resolveDefaultClickClackAccountId, setClickClackRuntime };
@@ -1,2 +1,2 @@
1
- import { t as clickClackPlugin } from "./channel-ByvJKugM.js";
1
+ import { t as clickClackPlugin } from "./.setup/channel-yIQ_PUDD.mjs";
2
2
  export { clickClackPlugin };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as registerClickClackDiscussions } from "./runtime-api-vd8TLXz1.js";
1
+ import { t as registerClickClackDiscussions } from "./.setup/runtime-api-D9Bwyc44.mjs";
2
2
  import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
3
3
  //#region extensions/clickclack/index.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { b as resolveClickClackAccount, u as createClickClackClient } from "./setup-surface-qNPMK71w.js";
2
- import { a as setClickClackRuntime, r as parseClickClackTarget } from "./channel-ByvJKugM.js";
3
- import { t as registerClickClackDiscussions } from "./runtime-api-vd8TLXz1.js";
1
+ import { b as resolveClickClackAccount, u as createClickClackClient } from "./.setup/setup-surface-BBl3rvVx.mjs";
2
+ import { a as setClickClackRuntime, r as parseClickClackTarget } from "./.setup/channel-yIQ_PUDD.mjs";
3
+ import { t as registerClickClackDiscussions } from "./.setup/runtime-api-D9Bwyc44.mjs";
4
4
  export { createClickClackClient, parseClickClackTarget, registerClickClackDiscussions, resolveClickClackAccount, setClickClackRuntime };
@@ -1,2 +1,2 @@
1
- import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-BKkzzjBA.js";
1
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./.setup/secret-contract-BKkzzjBA.mjs";
2
2
  export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
@@ -1,13 +1,14 @@
1
1
  import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
2
+ import { fileURLToPath } from "node:url";
2
3
  //#region extensions/clickclack/setup-entry.ts
3
4
  var setup_entry_default = defineBundledChannelSetupEntry({
4
5
  importMetaUrl: import.meta.url,
5
6
  plugin: {
6
- specifier: "./setup-plugin-api.js",
7
+ specifier: fileURLToPath(new URL(".setup/setup-plugin-api-B19mjQvl.mjs", import.meta.url).href),
7
8
  exportName: "clickClackSetupPlugin"
8
9
  },
9
10
  secrets: {
10
- specifier: "./secret-contract-api.js",
11
+ specifier: fileURLToPath(new URL(".setup/secret-contract-api-C1QwGlzF.mjs", import.meta.url).href),
11
12
  exportName: "channelSecrets"
12
13
  }
13
14
  });
@@ -1,18 +1,2 @@
1
- import { g as clickClackMeta, h as clickClackConfigAdapter, n as clickClackSetupContract, p as clickClackConfigSchema, t as clickClackSetupWizard } from "./setup-surface-qNPMK71w.js";
2
- //#region extensions/clickclack/src/channel.setup.ts
3
- const clickClackSetupPlugin = {
4
- id: "clickclack",
5
- meta: clickClackMeta,
6
- capabilities: {
7
- chatTypes: ["direct", "group"],
8
- threads: true,
9
- blockStreaming: true
10
- },
11
- reload: { configPrefixes: ["channels.clickclack"] },
12
- configSchema: clickClackConfigSchema,
13
- config: clickClackConfigAdapter,
14
- setupContract: clickClackSetupContract,
15
- setupWizard: clickClackSetupWizard
16
- };
17
- //#endregion
1
+ import { t as clickClackSetupPlugin } from "./.setup/setup-plugin-api-BUwBPYpy.mjs";
18
2
  export { clickClackSetupPlugin };
@@ -113,6 +113,33 @@ await schema.parseAsync("hello");
113
113
  // => "hello"
114
114
  ```
115
115
 
116
+ ### AOT compilation
117
+
118
+ For hot validation paths, `z.compile(schema)` returns a schema clone with an ahead-of-time compiled fast path. Valid inputs take the compiled path; invalid inputs fall back to the regular parser so error reporting stays identical.
119
+
120
+ Across a 55-schema benchmark the median speedup is **2.4x**, and it scales with how much work the schema does per parse: a large array of objects is ~9x, a 20-key object ~9x, a nested object ~4.5x, while a bare `z.string()` gains nothing — compilation removes per-node dispatch and allocation, and a single `typeof` has none to remove.
121
+
122
+ ```ts
123
+ const CompiledPlayer = z.compile(Player);
124
+
125
+ CompiledPlayer.parse({ username: "billie", xp: 100 });
126
+ ```
127
+
128
+ To enable compilation globally for schemas constructed after import:
129
+
130
+ ```ts
131
+ import "zod/compile"; // place before modules that define schemas
132
+ ```
133
+
134
+ Things to know:
135
+
136
+ - Compilation uses `new Function`. Global mode is automatically disabled when `z.config({ jitless: true })` is set (e.g. CSP environments); calling `z.compile()` directly is an explicit opt-in.
137
+ - Schemas with async refinements or transforms can't be compiled, and neither can a few other constructs. That is not an error: `z.compile()` hands the schema back unchanged and it keeps using the regular parser, exactly as global mode leaves it. Pass `{ strict: true }` to throw `ZodCompileAsyncError` / `ZodCompileUnsupportedError` instead.
138
+ - On invalid input, refinements and transforms may run twice (fast path, then fallback).
139
+ - Deriving a new schema from a compiled one (`.refine()`, `.extend()`, etc.) returns an uncompiled schema — compile the final schema.
140
+
141
+ See [`compile` docs](https://zod.dev/compile) for details.
142
+
116
143
  ### Handling errors
117
144
 
118
145
  When validation fails, the `.parse()` method will throw a `ZodError` instance with granular information about the validation issues.
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ // Side-effect-only: installs the post-processor on `globalConfig`. Listed in `package.json`'s `sideEffects`, and nothing else references it, so apps that never import it drop the compiler.
3
+ //
4
+ // Usage:
5
+ //
6
+ // import "zod/compile";
7
+ // import * as z from "zod";
8
+ // // every schema constructed below this is compiled on first parse
9
+ //
10
+ // Module evaluation order matters: schemas constructed in modules that evaluate before this import will not be compiled. Place this import in the app entry point, before any module that constructs schemas at top level.
11
+ //
12
+ // Failure handling: if the compiler refuses a schema (async refinement, unsupported feature, etc.) the shim permanently restores the runtime `_zod.run` for that schema. The schema continues to work via the regular runtime parser — no observable difference to the caller.
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ const compile_js_1 = require("./v4/core/compile.cjs");
38
+ const core = __importStar(require("./v4/core/index.cjs"));
39
+ let compiling = false;
40
+ core.globalConfig.postProcessor = (inst) => {
41
+ if (compiling)
42
+ return;
43
+ const originalRun = inst._zod?.run;
44
+ if (typeof originalRun !== "function")
45
+ return;
46
+ const shim = (payload, ctx) => {
47
+ // Bypass the fast path for any non-forward / non-sync / check-skipping call. The runtime owns those contracts.
48
+ if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks) {
49
+ return originalRun(payload, ctx);
50
+ }
51
+ compiling = true;
52
+ try {
53
+ // Respect the jitless config: it exists precisely so CSP/no-eval environments never reach `new Function`. Global mode must not bypass it (explicit z.compile calls remain an explicit opt-in).
54
+ if (core.globalConfig.jitless) {
55
+ inst._zod.run = originalRun;
56
+ return originalRun(payload, ctx);
57
+ }
58
+ // Strict: the shim owns its own fallback below, and a non-strict compile would hand back `inst` — whose run is this shim — and reinstall it on itself.
59
+ const compiled = (0, compile_js_1.compile)(inst, { strict: true });
60
+ // Only the run wrapper. Copying the compiled parse/safeParse closures would make their fallback re-enter this instance and run user callbacks a third time.
61
+ inst._zod.run = compiled._zod.run;
62
+ inst._zod.bag.fallbackRun = compiled._zod.bag.fallbackRun;
63
+ inst._zod.bag.validator = compiled._zod.bag.validator;
64
+ }
65
+ catch {
66
+ // Permanent fallback for unsupported schemas.
67
+ inst._zod.run = originalRun;
68
+ }
69
+ finally {
70
+ compiling = false;
71
+ }
72
+ return inst._zod.run(payload, ctx);
73
+ };
74
+ // Expose the pre-shim runtime so `compile()` invoked elsewhere can unwrap past the shim and capture the source-of-truth runtime. Without this, a user calling `z.compile(s)` after global mode is enabled would capture the shim itself, which would feed the wrapper into itself on fallback.
75
+ shim.__originalRun = originalRun;
76
+ inst._zod.run = shim;
77
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,52 @@
1
+ // Side-effect-only: installs the post-processor on `globalConfig`. Listed in `package.json`'s `sideEffects`, and nothing else references it, so apps that never import it drop the compiler.
2
+ //
3
+ // Usage:
4
+ //
5
+ // import "zod/compile";
6
+ // import * as z from "zod";
7
+ // // every schema constructed below this is compiled on first parse
8
+ //
9
+ // Module evaluation order matters: schemas constructed in modules that evaluate before this import will not be compiled. Place this import in the app entry point, before any module that constructs schemas at top level.
10
+ //
11
+ // Failure handling: if the compiler refuses a schema (async refinement, unsupported feature, etc.) the shim permanently restores the runtime `_zod.run` for that schema. The schema continues to work via the regular runtime parser — no observable difference to the caller.
12
+ import { compile } from "./v4/core/compile.js";
13
+ import * as core from "./v4/core/index.js";
14
+ let compiling = false;
15
+ core.globalConfig.postProcessor = (inst) => {
16
+ if (compiling)
17
+ return;
18
+ const originalRun = inst._zod?.run;
19
+ if (typeof originalRun !== "function")
20
+ return;
21
+ const shim = (payload, ctx) => {
22
+ // Bypass the fast path for any non-forward / non-sync / check-skipping call. The runtime owns those contracts.
23
+ if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks) {
24
+ return originalRun(payload, ctx);
25
+ }
26
+ compiling = true;
27
+ try {
28
+ // Respect the jitless config: it exists precisely so CSP/no-eval environments never reach `new Function`. Global mode must not bypass it (explicit z.compile calls remain an explicit opt-in).
29
+ if (core.globalConfig.jitless) {
30
+ inst._zod.run = originalRun;
31
+ return originalRun(payload, ctx);
32
+ }
33
+ // Strict: the shim owns its own fallback below, and a non-strict compile would hand back `inst` — whose run is this shim — and reinstall it on itself.
34
+ const compiled = compile(inst, { strict: true });
35
+ // Only the run wrapper. Copying the compiled parse/safeParse closures would make their fallback re-enter this instance and run user callbacks a third time.
36
+ inst._zod.run = compiled._zod.run;
37
+ inst._zod.bag.fallbackRun = compiled._zod.bag.fallbackRun;
38
+ inst._zod.bag.validator = compiled._zod.bag.validator;
39
+ }
40
+ catch {
41
+ // Permanent fallback for unsupported schemas.
42
+ inst._zod.run = originalRun;
43
+ }
44
+ finally {
45
+ compiling = false;
46
+ }
47
+ return inst._zod.run(payload, ctx);
48
+ };
49
+ // Expose the pre-shim runtime so `compile()` invoked elsewhere can unwrap past the shim and capture the source-of-truth runtime. Without this, a user calling `z.compile(s)` after global mode is enabled would capture the shim itself, which would feed the wrapper into itself on fallback.
50
+ shim.__originalRun = originalRun;
51
+ inst._zod.run = shim;
52
+ };