@openclaw/irc 0.0.0 → 2026.6.11-beta.2

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 (735) hide show
  1. package/README.md +12 -2
  2. package/dist/api.js +3 -0
  3. package/dist/channel-config-api.js +2 -0
  4. package/dist/channel-plugin-api.js +2 -0
  5. package/dist/channel-runtime-DFIO_jtC.js +405 -0
  6. package/dist/channel-wk_lzdJy.js +1544 -0
  7. package/dist/config-schema-BPKZaah-.js +112 -0
  8. package/dist/configured-state.js +6 -0
  9. package/dist/index.js +22 -0
  10. package/dist/runtime-DZfYm3vY.js +8 -0
  11. package/dist/runtime-api.js +2 -0
  12. package/dist/secret-contract-DdKIs_mx.js +82 -0
  13. package/dist/secret-contract-api.js +2 -0
  14. package/dist/setup-entry.js +15 -0
  15. package/node_modules/zod/LICENSE +21 -0
  16. package/node_modules/zod/README.md +191 -0
  17. package/node_modules/zod/index.cjs +33 -0
  18. package/node_modules/zod/index.d.cts +4 -0
  19. package/node_modules/zod/index.d.ts +4 -0
  20. package/node_modules/zod/index.js +4 -0
  21. package/node_modules/zod/locales/index.cjs +17 -0
  22. package/node_modules/zod/locales/index.d.cts +1 -0
  23. package/node_modules/zod/locales/index.d.ts +1 -0
  24. package/node_modules/zod/locales/index.js +1 -0
  25. package/node_modules/zod/locales/package.json +7 -0
  26. package/node_modules/zod/mini/index.cjs +32 -0
  27. package/node_modules/zod/mini/index.d.cts +3 -0
  28. package/node_modules/zod/mini/index.d.ts +3 -0
  29. package/node_modules/zod/mini/index.js +3 -0
  30. package/node_modules/zod/mini/package.json +7 -0
  31. package/node_modules/zod/package.json +135 -0
  32. package/node_modules/zod/src/index.ts +4 -0
  33. package/node_modules/zod/src/locales/index.ts +1 -0
  34. package/node_modules/zod/src/mini/index.ts +3 -0
  35. package/node_modules/zod/src/v3/ZodError.ts +330 -0
  36. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  37. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  38. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  39. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  40. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  41. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  42. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  43. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  44. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  45. package/node_modules/zod/src/v3/errors.ts +13 -0
  46. package/node_modules/zod/src/v3/external.ts +6 -0
  47. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  48. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  49. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  50. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  51. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  52. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  53. package/node_modules/zod/src/v3/index.ts +4 -0
  54. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  55. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  56. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  57. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  58. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  59. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  60. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  61. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  62. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  63. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  64. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  65. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  66. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  67. package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  68. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  69. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  70. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  71. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  72. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  73. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  74. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  75. package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
  76. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  77. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  78. package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  79. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  80. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  81. package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
  82. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  83. package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
  84. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  85. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  86. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  87. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  88. package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  89. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  90. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  91. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  92. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  93. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  94. package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
  95. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  96. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  97. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  98. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  99. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  100. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  101. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  102. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  103. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  104. package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
  105. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  106. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  107. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  108. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  109. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  110. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  111. package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
  112. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  113. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  114. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  115. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  116. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  117. package/node_modules/zod/src/v3/types.ts +5138 -0
  118. package/node_modules/zod/src/v4/classic/checks.ts +32 -0
  119. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  120. package/node_modules/zod/src/v4/classic/compat.ts +70 -0
  121. package/node_modules/zod/src/v4/classic/errors.ts +82 -0
  122. package/node_modules/zod/src/v4/classic/external.ts +52 -0
  123. package/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
  124. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  125. package/node_modules/zod/src/v4/classic/iso.ts +90 -0
  126. package/node_modules/zod/src/v4/classic/parse.ts +82 -0
  127. package/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
  128. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  129. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
  130. package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  131. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +216 -0
  132. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  133. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  134. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  135. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
  136. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
  137. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
  138. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  139. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
  140. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -0
  141. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  142. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  143. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  144. package/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
  145. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
  146. package/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
  147. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  148. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  149. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
  150. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
  151. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
  152. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
  153. package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
  154. package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  155. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  156. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  157. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
  158. package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
  159. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  160. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
  161. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
  162. package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
  163. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
  164. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
  165. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
  166. package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  167. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
  168. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
  169. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  170. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  171. package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
  172. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  173. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  174. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  175. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  176. package/node_modules/zod/src/v4/classic/tests/number.test.ts +325 -0
  177. package/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
  178. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
  179. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
  180. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
  181. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  182. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
  183. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
  184. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
  185. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  186. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  187. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  188. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
  189. package/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
  190. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
  191. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
  192. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
  193. package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
  194. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
  195. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  196. package/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
  197. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
  198. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
  199. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  200. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
  201. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
  202. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
  203. package/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
  204. package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  205. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  206. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  207. package/node_modules/zod/src/v4/core/api.ts +1823 -0
  208. package/node_modules/zod/src/v4/core/checks.ts +1293 -0
  209. package/node_modules/zod/src/v4/core/config.ts +15 -0
  210. package/node_modules/zod/src/v4/core/core.ts +153 -0
  211. package/node_modules/zod/src/v4/core/doc.ts +44 -0
  212. package/node_modules/zod/src/v4/core/errors.ts +455 -0
  213. package/node_modules/zod/src/v4/core/index.ts +16 -0
  214. package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
  215. package/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
  216. package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
  217. package/node_modules/zod/src/v4/core/parse.ts +195 -0
  218. package/node_modules/zod/src/v4/core/regexes.ts +190 -0
  219. package/node_modules/zod/src/v4/core/registries.ts +105 -0
  220. package/node_modules/zod/src/v4/core/schemas.ts +4730 -0
  221. package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  222. package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  223. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  224. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  225. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
  226. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  227. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
  228. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  229. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  230. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  231. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  232. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  233. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  234. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  235. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  236. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  237. package/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
  238. package/node_modules/zod/src/v4/core/util.ts +983 -0
  239. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  240. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  241. package/node_modules/zod/src/v4/index.ts +4 -0
  242. package/node_modules/zod/src/v4/locales/ar.ts +115 -0
  243. package/node_modules/zod/src/v4/locales/az.ts +111 -0
  244. package/node_modules/zod/src/v4/locales/be.ts +176 -0
  245. package/node_modules/zod/src/v4/locales/bg.ts +128 -0
  246. package/node_modules/zod/src/v4/locales/ca.ts +116 -0
  247. package/node_modules/zod/src/v4/locales/cs.ts +118 -0
  248. package/node_modules/zod/src/v4/locales/da.ts +123 -0
  249. package/node_modules/zod/src/v4/locales/de.ts +116 -0
  250. package/node_modules/zod/src/v4/locales/el.ts +121 -0
  251. package/node_modules/zod/src/v4/locales/en.ts +123 -0
  252. package/node_modules/zod/src/v4/locales/eo.ts +118 -0
  253. package/node_modules/zod/src/v4/locales/es.ts +141 -0
  254. package/node_modules/zod/src/v4/locales/fa.ts +126 -0
  255. package/node_modules/zod/src/v4/locales/fi.ts +121 -0
  256. package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
  257. package/node_modules/zod/src/v4/locales/fr.ts +132 -0
  258. package/node_modules/zod/src/v4/locales/he.ts +246 -0
  259. package/node_modules/zod/src/v4/locales/hr.ts +131 -0
  260. package/node_modules/zod/src/v4/locales/hu.ts +117 -0
  261. package/node_modules/zod/src/v4/locales/hy.ts +164 -0
  262. package/node_modules/zod/src/v4/locales/id.ts +115 -0
  263. package/node_modules/zod/src/v4/locales/index.ts +52 -0
  264. package/node_modules/zod/src/v4/locales/is.ts +119 -0
  265. package/node_modules/zod/src/v4/locales/it.ts +116 -0
  266. package/node_modules/zod/src/v4/locales/ja.ts +114 -0
  267. package/node_modules/zod/src/v4/locales/ka.ts +123 -0
  268. package/node_modules/zod/src/v4/locales/kh.ts +7 -0
  269. package/node_modules/zod/src/v4/locales/km.ts +119 -0
  270. package/node_modules/zod/src/v4/locales/ko.ts +121 -0
  271. package/node_modules/zod/src/v4/locales/lt.ts +239 -0
  272. package/node_modules/zod/src/v4/locales/mk.ts +118 -0
  273. package/node_modules/zod/src/v4/locales/ms.ts +115 -0
  274. package/node_modules/zod/src/v4/locales/nl.ts +121 -0
  275. package/node_modules/zod/src/v4/locales/no.ts +116 -0
  276. package/node_modules/zod/src/v4/locales/ota.ts +117 -0
  277. package/node_modules/zod/src/v4/locales/pl.ts +118 -0
  278. package/node_modules/zod/src/v4/locales/ps.ts +126 -0
  279. package/node_modules/zod/src/v4/locales/pt.ts +116 -0
  280. package/node_modules/zod/src/v4/locales/ro.ts +129 -0
  281. package/node_modules/zod/src/v4/locales/ru.ts +176 -0
  282. package/node_modules/zod/src/v4/locales/sl.ts +118 -0
  283. package/node_modules/zod/src/v4/locales/sv.ts +119 -0
  284. package/node_modules/zod/src/v4/locales/ta.ts +118 -0
  285. package/node_modules/zod/src/v4/locales/th.ts +119 -0
  286. package/node_modules/zod/src/v4/locales/tr.ts +111 -0
  287. package/node_modules/zod/src/v4/locales/ua.ts +7 -0
  288. package/node_modules/zod/src/v4/locales/uk.ts +117 -0
  289. package/node_modules/zod/src/v4/locales/ur.ts +119 -0
  290. package/node_modules/zod/src/v4/locales/uz.ts +117 -0
  291. package/node_modules/zod/src/v4/locales/vi.ts +117 -0
  292. package/node_modules/zod/src/v4/locales/yo.ts +124 -0
  293. package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
  294. package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
  295. package/node_modules/zod/src/v4/mini/checks.ts +32 -0
  296. package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
  297. package/node_modules/zod/src/v4/mini/external.ts +41 -0
  298. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  299. package/node_modules/zod/src/v4/mini/iso.ts +66 -0
  300. package/node_modules/zod/src/v4/mini/parse.ts +14 -0
  301. package/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
  302. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
  303. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
  304. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
  305. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
  306. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
  307. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  308. package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
  309. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
  310. package/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
  311. package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
  312. package/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
  313. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  314. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
  315. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  316. package/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
  317. package/node_modules/zod/src/v4-mini/index.ts +3 -0
  318. package/node_modules/zod/v3/ZodError.cjs +138 -0
  319. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  320. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  321. package/node_modules/zod/v3/ZodError.js +133 -0
  322. package/node_modules/zod/v3/errors.cjs +17 -0
  323. package/node_modules/zod/v3/errors.d.cts +5 -0
  324. package/node_modules/zod/v3/errors.d.ts +5 -0
  325. package/node_modules/zod/v3/errors.js +9 -0
  326. package/node_modules/zod/v3/external.cjs +22 -0
  327. package/node_modules/zod/v3/external.d.cts +6 -0
  328. package/node_modules/zod/v3/external.d.ts +6 -0
  329. package/node_modules/zod/v3/external.js +6 -0
  330. package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  331. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  332. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  333. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  334. package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  335. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  336. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  337. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  338. package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  339. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  340. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  341. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  342. package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  343. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  344. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  345. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  346. package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  347. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  348. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  349. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  350. package/node_modules/zod/v3/helpers/util.cjs +137 -0
  351. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  352. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  353. package/node_modules/zod/v3/helpers/util.js +133 -0
  354. package/node_modules/zod/v3/index.cjs +33 -0
  355. package/node_modules/zod/v3/index.d.cts +4 -0
  356. package/node_modules/zod/v3/index.d.ts +4 -0
  357. package/node_modules/zod/v3/index.js +4 -0
  358. package/node_modules/zod/v3/locales/en.cjs +112 -0
  359. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  360. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  361. package/node_modules/zod/v3/locales/en.js +109 -0
  362. package/node_modules/zod/v3/package.json +7 -0
  363. package/node_modules/zod/v3/standard-schema.cjs +2 -0
  364. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  365. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  366. package/node_modules/zod/v3/standard-schema.js +1 -0
  367. package/node_modules/zod/v3/types.cjs +3777 -0
  368. package/node_modules/zod/v3/types.d.cts +1034 -0
  369. package/node_modules/zod/v3/types.d.ts +1034 -0
  370. package/node_modules/zod/v3/types.js +3695 -0
  371. package/node_modules/zod/v4/classic/checks.cjs +33 -0
  372. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  373. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  374. package/node_modules/zod/v4/classic/checks.js +1 -0
  375. package/node_modules/zod/v4/classic/coerce.cjs +47 -0
  376. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  377. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  378. package/node_modules/zod/v4/classic/coerce.js +17 -0
  379. package/node_modules/zod/v4/classic/compat.cjs +61 -0
  380. package/node_modules/zod/v4/classic/compat.d.cts +50 -0
  381. package/node_modules/zod/v4/classic/compat.d.ts +50 -0
  382. package/node_modules/zod/v4/classic/compat.js +31 -0
  383. package/node_modules/zod/v4/classic/errors.cjs +74 -0
  384. package/node_modules/zod/v4/classic/errors.d.cts +30 -0
  385. package/node_modules/zod/v4/classic/errors.d.ts +30 -0
  386. package/node_modules/zod/v4/classic/errors.js +48 -0
  387. package/node_modules/zod/v4/classic/external.cjs +73 -0
  388. package/node_modules/zod/v4/classic/external.d.cts +16 -0
  389. package/node_modules/zod/v4/classic/external.d.ts +16 -0
  390. package/node_modules/zod/v4/classic/external.js +20 -0
  391. package/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
  392. package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  393. package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  394. package/node_modules/zod/v4/classic/from-json-schema.js +599 -0
  395. package/node_modules/zod/v4/classic/index.cjs +33 -0
  396. package/node_modules/zod/v4/classic/index.d.cts +4 -0
  397. package/node_modules/zod/v4/classic/index.d.ts +4 -0
  398. package/node_modules/zod/v4/classic/index.js +4 -0
  399. package/node_modules/zod/v4/classic/iso.cjs +60 -0
  400. package/node_modules/zod/v4/classic/iso.d.cts +22 -0
  401. package/node_modules/zod/v4/classic/iso.d.ts +22 -0
  402. package/node_modules/zod/v4/classic/iso.js +30 -0
  403. package/node_modules/zod/v4/classic/package.json +7 -0
  404. package/node_modules/zod/v4/classic/parse.cjs +41 -0
  405. package/node_modules/zod/v4/classic/parse.d.cts +31 -0
  406. package/node_modules/zod/v4/classic/parse.d.ts +31 -0
  407. package/node_modules/zod/v4/classic/parse.js +15 -0
  408. package/node_modules/zod/v4/classic/schemas.cjs +1511 -0
  409. package/node_modules/zod/v4/classic/schemas.d.cts +767 -0
  410. package/node_modules/zod/v4/classic/schemas.d.ts +767 -0
  411. package/node_modules/zod/v4/classic/schemas.js +1395 -0
  412. package/node_modules/zod/v4/core/api.cjs +1227 -0
  413. package/node_modules/zod/v4/core/api.d.cts +325 -0
  414. package/node_modules/zod/v4/core/api.d.ts +325 -0
  415. package/node_modules/zod/v4/core/api.js +1087 -0
  416. package/node_modules/zod/v4/core/checks.cjs +601 -0
  417. package/node_modules/zod/v4/core/checks.d.cts +278 -0
  418. package/node_modules/zod/v4/core/checks.d.ts +278 -0
  419. package/node_modules/zod/v4/core/checks.js +575 -0
  420. package/node_modules/zod/v4/core/core.cjs +85 -0
  421. package/node_modules/zod/v4/core/core.d.cts +70 -0
  422. package/node_modules/zod/v4/core/core.d.ts +70 -0
  423. package/node_modules/zod/v4/core/core.js +78 -0
  424. package/node_modules/zod/v4/core/doc.cjs +39 -0
  425. package/node_modules/zod/v4/core/doc.d.cts +14 -0
  426. package/node_modules/zod/v4/core/doc.d.ts +14 -0
  427. package/node_modules/zod/v4/core/doc.js +35 -0
  428. package/node_modules/zod/v4/core/errors.cjs +216 -0
  429. package/node_modules/zod/v4/core/errors.d.cts +221 -0
  430. package/node_modules/zod/v4/core/errors.d.ts +221 -0
  431. package/node_modules/zod/v4/core/errors.js +185 -0
  432. package/node_modules/zod/v4/core/index.cjs +47 -0
  433. package/node_modules/zod/v4/core/index.d.cts +16 -0
  434. package/node_modules/zod/v4/core/index.d.ts +16 -0
  435. package/node_modules/zod/v4/core/index.js +16 -0
  436. package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
  437. package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  438. package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  439. package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
  440. package/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
  441. package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
  442. package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
  443. package/node_modules/zod/v4/core/json-schema-processors.js +601 -0
  444. package/node_modules/zod/v4/core/json-schema.cjs +2 -0
  445. package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
  446. package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
  447. package/node_modules/zod/v4/core/json-schema.js +1 -0
  448. package/node_modules/zod/v4/core/package.json +7 -0
  449. package/node_modules/zod/v4/core/parse.cjs +131 -0
  450. package/node_modules/zod/v4/core/parse.d.cts +49 -0
  451. package/node_modules/zod/v4/core/parse.d.ts +49 -0
  452. package/node_modules/zod/v4/core/parse.js +93 -0
  453. package/node_modules/zod/v4/core/regexes.cjs +172 -0
  454. package/node_modules/zod/v4/core/regexes.d.cts +85 -0
  455. package/node_modules/zod/v4/core/regexes.d.ts +85 -0
  456. package/node_modules/zod/v4/core/regexes.js +139 -0
  457. package/node_modules/zod/v4/core/registries.cjs +56 -0
  458. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  459. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  460. package/node_modules/zod/v4/core/registries.js +51 -0
  461. package/node_modules/zod/v4/core/schemas.cjs +2270 -0
  462. package/node_modules/zod/v4/core/schemas.d.cts +1184 -0
  463. package/node_modules/zod/v4/core/schemas.d.ts +1184 -0
  464. package/node_modules/zod/v4/core/schemas.js +2239 -0
  465. package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
  466. package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  467. package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  468. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  469. package/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
  470. package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
  471. package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
  472. package/node_modules/zod/v4/core/to-json-schema.js +448 -0
  473. package/node_modules/zod/v4/core/util.cjs +734 -0
  474. package/node_modules/zod/v4/core/util.d.cts +200 -0
  475. package/node_modules/zod/v4/core/util.d.ts +200 -0
  476. package/node_modules/zod/v4/core/util.js +674 -0
  477. package/node_modules/zod/v4/core/versions.cjs +8 -0
  478. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  479. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  480. package/node_modules/zod/v4/core/versions.js +5 -0
  481. package/node_modules/zod/v4/index.cjs +22 -0
  482. package/node_modules/zod/v4/index.d.cts +3 -0
  483. package/node_modules/zod/v4/index.d.ts +3 -0
  484. package/node_modules/zod/v4/index.js +3 -0
  485. package/node_modules/zod/v4/locales/ar.cjs +133 -0
  486. package/node_modules/zod/v4/locales/ar.d.cts +5 -0
  487. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  488. package/node_modules/zod/v4/locales/ar.js +106 -0
  489. package/node_modules/zod/v4/locales/az.cjs +132 -0
  490. package/node_modules/zod/v4/locales/az.d.cts +5 -0
  491. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  492. package/node_modules/zod/v4/locales/az.js +105 -0
  493. package/node_modules/zod/v4/locales/be.cjs +183 -0
  494. package/node_modules/zod/v4/locales/be.d.cts +5 -0
  495. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  496. package/node_modules/zod/v4/locales/be.js +156 -0
  497. package/node_modules/zod/v4/locales/bg.cjs +147 -0
  498. package/node_modules/zod/v4/locales/bg.d.cts +5 -0
  499. package/node_modules/zod/v4/locales/bg.d.ts +4 -0
  500. package/node_modules/zod/v4/locales/bg.js +120 -0
  501. package/node_modules/zod/v4/locales/ca.cjs +134 -0
  502. package/node_modules/zod/v4/locales/ca.d.cts +5 -0
  503. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  504. package/node_modules/zod/v4/locales/ca.js +107 -0
  505. package/node_modules/zod/v4/locales/cs.cjs +138 -0
  506. package/node_modules/zod/v4/locales/cs.d.cts +5 -0
  507. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  508. package/node_modules/zod/v4/locales/cs.js +111 -0
  509. package/node_modules/zod/v4/locales/da.cjs +142 -0
  510. package/node_modules/zod/v4/locales/da.d.cts +5 -0
  511. package/node_modules/zod/v4/locales/da.d.ts +4 -0
  512. package/node_modules/zod/v4/locales/da.js +115 -0
  513. package/node_modules/zod/v4/locales/de.cjs +135 -0
  514. package/node_modules/zod/v4/locales/de.d.cts +5 -0
  515. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  516. package/node_modules/zod/v4/locales/de.js +108 -0
  517. package/node_modules/zod/v4/locales/el.cjs +136 -0
  518. package/node_modules/zod/v4/locales/el.d.cts +5 -0
  519. package/node_modules/zod/v4/locales/el.d.ts +4 -0
  520. package/node_modules/zod/v4/locales/el.js +109 -0
  521. package/node_modules/zod/v4/locales/en.cjs +140 -0
  522. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  523. package/node_modules/zod/v4/locales/en.d.ts +4 -0
  524. package/node_modules/zod/v4/locales/en.js +113 -0
  525. package/node_modules/zod/v4/locales/eo.cjs +136 -0
  526. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  527. package/node_modules/zod/v4/locales/eo.d.ts +4 -0
  528. package/node_modules/zod/v4/locales/eo.js +109 -0
  529. package/node_modules/zod/v4/locales/es.cjs +159 -0
  530. package/node_modules/zod/v4/locales/es.d.cts +5 -0
  531. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  532. package/node_modules/zod/v4/locales/es.js +132 -0
  533. package/node_modules/zod/v4/locales/fa.cjs +141 -0
  534. package/node_modules/zod/v4/locales/fa.d.cts +5 -0
  535. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  536. package/node_modules/zod/v4/locales/fa.js +114 -0
  537. package/node_modules/zod/v4/locales/fi.cjs +139 -0
  538. package/node_modules/zod/v4/locales/fi.d.cts +5 -0
  539. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  540. package/node_modules/zod/v4/locales/fi.js +112 -0
  541. package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
  542. package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  543. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  544. package/node_modules/zod/v4/locales/fr-CA.js +107 -0
  545. package/node_modules/zod/v4/locales/fr.cjs +152 -0
  546. package/node_modules/zod/v4/locales/fr.d.cts +5 -0
  547. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  548. package/node_modules/zod/v4/locales/fr.js +125 -0
  549. package/node_modules/zod/v4/locales/he.cjs +241 -0
  550. package/node_modules/zod/v4/locales/he.d.cts +5 -0
  551. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  552. package/node_modules/zod/v4/locales/he.js +214 -0
  553. package/node_modules/zod/v4/locales/hr.cjs +149 -0
  554. package/node_modules/zod/v4/locales/hr.d.cts +5 -0
  555. package/node_modules/zod/v4/locales/hr.d.ts +4 -0
  556. package/node_modules/zod/v4/locales/hr.js +122 -0
  557. package/node_modules/zod/v4/locales/hu.cjs +135 -0
  558. package/node_modules/zod/v4/locales/hu.d.cts +5 -0
  559. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  560. package/node_modules/zod/v4/locales/hu.js +108 -0
  561. package/node_modules/zod/v4/locales/hy.cjs +174 -0
  562. package/node_modules/zod/v4/locales/hy.d.cts +5 -0
  563. package/node_modules/zod/v4/locales/hy.d.ts +4 -0
  564. package/node_modules/zod/v4/locales/hy.js +147 -0
  565. package/node_modules/zod/v4/locales/id.cjs +133 -0
  566. package/node_modules/zod/v4/locales/id.d.cts +5 -0
  567. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  568. package/node_modules/zod/v4/locales/id.js +106 -0
  569. package/node_modules/zod/v4/locales/index.cjs +111 -0
  570. package/node_modules/zod/v4/locales/index.d.cts +52 -0
  571. package/node_modules/zod/v4/locales/index.d.ts +52 -0
  572. package/node_modules/zod/v4/locales/index.js +52 -0
  573. package/node_modules/zod/v4/locales/is.cjs +136 -0
  574. package/node_modules/zod/v4/locales/is.d.cts +5 -0
  575. package/node_modules/zod/v4/locales/is.d.ts +4 -0
  576. package/node_modules/zod/v4/locales/is.js +109 -0
  577. package/node_modules/zod/v4/locales/it.cjs +135 -0
  578. package/node_modules/zod/v4/locales/it.d.cts +5 -0
  579. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  580. package/node_modules/zod/v4/locales/it.js +108 -0
  581. package/node_modules/zod/v4/locales/ja.cjs +134 -0
  582. package/node_modules/zod/v4/locales/ja.d.cts +5 -0
  583. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  584. package/node_modules/zod/v4/locales/ja.js +107 -0
  585. package/node_modules/zod/v4/locales/ka.cjs +139 -0
  586. package/node_modules/zod/v4/locales/ka.d.cts +5 -0
  587. package/node_modules/zod/v4/locales/ka.d.ts +4 -0
  588. package/node_modules/zod/v4/locales/ka.js +112 -0
  589. package/node_modules/zod/v4/locales/kh.cjs +12 -0
  590. package/node_modules/zod/v4/locales/kh.d.cts +5 -0
  591. package/node_modules/zod/v4/locales/kh.d.ts +5 -0
  592. package/node_modules/zod/v4/locales/kh.js +5 -0
  593. package/node_modules/zod/v4/locales/km.cjs +137 -0
  594. package/node_modules/zod/v4/locales/km.d.cts +5 -0
  595. package/node_modules/zod/v4/locales/km.d.ts +4 -0
  596. package/node_modules/zod/v4/locales/km.js +110 -0
  597. package/node_modules/zod/v4/locales/ko.cjs +138 -0
  598. package/node_modules/zod/v4/locales/ko.d.cts +5 -0
  599. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  600. package/node_modules/zod/v4/locales/ko.js +111 -0
  601. package/node_modules/zod/v4/locales/lt.cjs +230 -0
  602. package/node_modules/zod/v4/locales/lt.d.cts +5 -0
  603. package/node_modules/zod/v4/locales/lt.d.ts +4 -0
  604. package/node_modules/zod/v4/locales/lt.js +203 -0
  605. package/node_modules/zod/v4/locales/mk.cjs +136 -0
  606. package/node_modules/zod/v4/locales/mk.d.cts +5 -0
  607. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  608. package/node_modules/zod/v4/locales/mk.js +109 -0
  609. package/node_modules/zod/v4/locales/ms.cjs +134 -0
  610. package/node_modules/zod/v4/locales/ms.d.cts +5 -0
  611. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  612. package/node_modules/zod/v4/locales/ms.js +107 -0
  613. package/node_modules/zod/v4/locales/nl.cjs +137 -0
  614. package/node_modules/zod/v4/locales/nl.d.cts +5 -0
  615. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  616. package/node_modules/zod/v4/locales/nl.js +110 -0
  617. package/node_modules/zod/v4/locales/no.cjs +135 -0
  618. package/node_modules/zod/v4/locales/no.d.cts +5 -0
  619. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  620. package/node_modules/zod/v4/locales/no.js +108 -0
  621. package/node_modules/zod/v4/locales/ota.cjs +136 -0
  622. package/node_modules/zod/v4/locales/ota.d.cts +5 -0
  623. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  624. package/node_modules/zod/v4/locales/ota.js +109 -0
  625. package/node_modules/zod/v4/locales/package.json +7 -0
  626. package/node_modules/zod/v4/locales/pl.cjs +136 -0
  627. package/node_modules/zod/v4/locales/pl.d.cts +5 -0
  628. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  629. package/node_modules/zod/v4/locales/pl.js +109 -0
  630. package/node_modules/zod/v4/locales/ps.cjs +141 -0
  631. package/node_modules/zod/v4/locales/ps.d.cts +5 -0
  632. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  633. package/node_modules/zod/v4/locales/ps.js +114 -0
  634. package/node_modules/zod/v4/locales/pt.cjs +135 -0
  635. package/node_modules/zod/v4/locales/pt.d.cts +5 -0
  636. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  637. package/node_modules/zod/v4/locales/pt.js +108 -0
  638. package/node_modules/zod/v4/locales/ro.cjs +146 -0
  639. package/node_modules/zod/v4/locales/ro.d.cts +5 -0
  640. package/node_modules/zod/v4/locales/ro.d.ts +4 -0
  641. package/node_modules/zod/v4/locales/ro.js +119 -0
  642. package/node_modules/zod/v4/locales/ru.cjs +183 -0
  643. package/node_modules/zod/v4/locales/ru.d.cts +5 -0
  644. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  645. package/node_modules/zod/v4/locales/ru.js +156 -0
  646. package/node_modules/zod/v4/locales/sl.cjs +136 -0
  647. package/node_modules/zod/v4/locales/sl.d.cts +5 -0
  648. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  649. package/node_modules/zod/v4/locales/sl.js +109 -0
  650. package/node_modules/zod/v4/locales/sv.cjs +137 -0
  651. package/node_modules/zod/v4/locales/sv.d.cts +5 -0
  652. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  653. package/node_modules/zod/v4/locales/sv.js +110 -0
  654. package/node_modules/zod/v4/locales/ta.cjs +137 -0
  655. package/node_modules/zod/v4/locales/ta.d.cts +5 -0
  656. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  657. package/node_modules/zod/v4/locales/ta.js +110 -0
  658. package/node_modules/zod/v4/locales/th.cjs +137 -0
  659. package/node_modules/zod/v4/locales/th.d.cts +5 -0
  660. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  661. package/node_modules/zod/v4/locales/th.js +110 -0
  662. package/node_modules/zod/v4/locales/tr.cjs +132 -0
  663. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  664. package/node_modules/zod/v4/locales/tr.d.ts +4 -0
  665. package/node_modules/zod/v4/locales/tr.js +105 -0
  666. package/node_modules/zod/v4/locales/ua.cjs +12 -0
  667. package/node_modules/zod/v4/locales/ua.d.cts +5 -0
  668. package/node_modules/zod/v4/locales/ua.d.ts +5 -0
  669. package/node_modules/zod/v4/locales/ua.js +5 -0
  670. package/node_modules/zod/v4/locales/uk.cjs +135 -0
  671. package/node_modules/zod/v4/locales/uk.d.cts +5 -0
  672. package/node_modules/zod/v4/locales/uk.d.ts +4 -0
  673. package/node_modules/zod/v4/locales/uk.js +108 -0
  674. package/node_modules/zod/v4/locales/ur.cjs +137 -0
  675. package/node_modules/zod/v4/locales/ur.d.cts +5 -0
  676. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  677. package/node_modules/zod/v4/locales/ur.js +110 -0
  678. package/node_modules/zod/v4/locales/uz.cjs +137 -0
  679. package/node_modules/zod/v4/locales/uz.d.cts +5 -0
  680. package/node_modules/zod/v4/locales/uz.d.ts +4 -0
  681. package/node_modules/zod/v4/locales/uz.js +110 -0
  682. package/node_modules/zod/v4/locales/vi.cjs +135 -0
  683. package/node_modules/zod/v4/locales/vi.d.cts +5 -0
  684. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  685. package/node_modules/zod/v4/locales/vi.js +108 -0
  686. package/node_modules/zod/v4/locales/yo.cjs +134 -0
  687. package/node_modules/zod/v4/locales/yo.d.cts +5 -0
  688. package/node_modules/zod/v4/locales/yo.d.ts +4 -0
  689. package/node_modules/zod/v4/locales/yo.js +107 -0
  690. package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
  691. package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  692. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  693. package/node_modules/zod/v4/locales/zh-CN.js +109 -0
  694. package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
  695. package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  696. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  697. package/node_modules/zod/v4/locales/zh-TW.js +107 -0
  698. package/node_modules/zod/v4/mini/checks.cjs +34 -0
  699. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  700. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  701. package/node_modules/zod/v4/mini/checks.js +1 -0
  702. package/node_modules/zod/v4/mini/coerce.cjs +52 -0
  703. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  704. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  705. package/node_modules/zod/v4/mini/coerce.js +22 -0
  706. package/node_modules/zod/v4/mini/external.cjs +63 -0
  707. package/node_modules/zod/v4/mini/external.d.cts +13 -0
  708. package/node_modules/zod/v4/mini/external.d.ts +13 -0
  709. package/node_modules/zod/v4/mini/external.js +14 -0
  710. package/node_modules/zod/v4/mini/index.cjs +32 -0
  711. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  712. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  713. package/node_modules/zod/v4/mini/index.js +3 -0
  714. package/node_modules/zod/v4/mini/iso.cjs +64 -0
  715. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  716. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  717. package/node_modules/zod/v4/mini/iso.js +34 -0
  718. package/node_modules/zod/v4/mini/package.json +7 -0
  719. package/node_modules/zod/v4/mini/parse.cjs +16 -0
  720. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  721. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  722. package/node_modules/zod/v4/mini/parse.js +1 -0
  723. package/node_modules/zod/v4/mini/schemas.cjs +1083 -0
  724. package/node_modules/zod/v4/mini/schemas.d.cts +445 -0
  725. package/node_modules/zod/v4/mini/schemas.d.ts +445 -0
  726. package/node_modules/zod/v4/mini/schemas.js +961 -0
  727. package/node_modules/zod/v4/package.json +7 -0
  728. package/node_modules/zod/v4-mini/index.cjs +32 -0
  729. package/node_modules/zod/v4-mini/index.d.cts +3 -0
  730. package/node_modules/zod/v4-mini/index.d.ts +3 -0
  731. package/node_modules/zod/v4-mini/index.js +3 -0
  732. package/node_modules/zod/v4-mini/package.json +7 -0
  733. package/npm-shrinkwrap.json +24 -0
  734. package/openclaw.plugin.json +708 -0
  735. package/package.json +75 -7
@@ -0,0 +1,1544 @@
1
+ import { t as IrcChannelConfigSchema } from "./config-schema-BPKZaah-.js";
2
+ import { t as getIrcRuntime } from "./runtime-DZfYm3vY.js";
3
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DdKIs_mx.js";
4
+ import { createAccountListHelpers, describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
5
+ import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
6
+ import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
7
+ import { createChatChannelPlugin, parseOptionalDelimitedEntries, tryReadSecretFileSync } from "openclaw/plugin-sdk/channel-core";
8
+ import { composeAccountWarningCollectors, createAllowlistProviderOpenWarningCollector, createDangerousNameMatchingMutableAllowlistWarningCollector } from "openclaw/plugin-sdk/channel-policy";
9
+ import { createChannelDirectoryAdapter, createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-runtime";
10
+ import { buildBaseChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
11
+ import { DEFAULT_ACCOUNT_ID, DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
12
+ import { resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
13
+ import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
14
+ import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
15
+ import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, normalizeStringifiedOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
16
+ import { createAccountStatusSink, createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, sanitizeForPlainText } from "openclaw/plugin-sdk/channel-outbound";
17
+ import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
18
+ import { chunkTextForOutbound, convertMarkdownTables } from "openclaw/plugin-sdk/text-chunking";
19
+ import { runStoppablePassiveMonitor } from "openclaw/plugin-sdk/extension-shared";
20
+ import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
21
+ import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
22
+ import net from "node:net";
23
+ import tls from "node:tls";
24
+ import { withTimeout } from "openclaw/plugin-sdk/security-runtime";
25
+ import { randomUUID } from "node:crypto";
26
+ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/routing";
27
+ import { applyAccountNameToChannelSection, createAllowFromSection, createPromptParsedAllowFromForAccount, createSetupInputPresenceValidator, createSetupTranslator, createStandardChannelSetupStatus, createTopLevelChannelAllowFromSetter, createTopLevelChannelDmPolicySetter, formatDocsLink, patchScopedAccountConfig, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
28
+ //#region extensions/irc/src/accounts.ts
29
+ const TRUTHY_ENV = new Set([
30
+ "true",
31
+ "1",
32
+ "yes",
33
+ "on"
34
+ ]);
35
+ function parseTruthy(value) {
36
+ if (!value) return false;
37
+ return TRUTHY_ENV.has(normalizeLowercaseStringOrEmpty(value));
38
+ }
39
+ function parseIntEnv(value) {
40
+ if (!value?.trim()) return;
41
+ const parsed = parseStrictPositiveInteger(value);
42
+ if (parsed === void 0 || parsed > 65535) return;
43
+ return parsed;
44
+ }
45
+ const { listAccountIds: listIrcAccountIds, resolveDefaultAccountId: resolveDefaultIrcAccountId } = createAccountListHelpers("irc", {
46
+ normalizeAccountId,
47
+ hasImplicitDefaultAccount: (cfg) => Boolean((cfg.channels?.irc?.host?.trim() || process.env.IRC_HOST?.trim()) && (cfg.channels?.irc?.nick?.trim() || process.env.IRC_NICK?.trim()))
48
+ });
49
+ function mergeIrcAccountConfig(cfg, accountId) {
50
+ return resolveMergedAccountConfig({
51
+ channelConfig: cfg.channels?.irc,
52
+ accounts: cfg.channels?.irc?.accounts,
53
+ accountId,
54
+ omitKeys: ["defaultAccount"],
55
+ normalizeAccountId,
56
+ nestedObjectKeys: ["nickserv"]
57
+ });
58
+ }
59
+ function resolvePassword(accountId, merged) {
60
+ if (accountId === DEFAULT_ACCOUNT_ID) {
61
+ const envPassword = process.env.IRC_PASSWORD?.trim();
62
+ if (envPassword) return {
63
+ password: envPassword,
64
+ source: "env"
65
+ };
66
+ }
67
+ if (merged.passwordFile?.trim()) {
68
+ const filePassword = tryReadSecretFileSync(merged.passwordFile, "IRC password file", { rejectSymlink: true });
69
+ if (filePassword) return {
70
+ password: filePassword,
71
+ source: "passwordFile"
72
+ };
73
+ }
74
+ const configPassword = normalizeResolvedSecretInputString({
75
+ value: merged.password,
76
+ path: `channels.irc.accounts.${accountId}.password`
77
+ });
78
+ if (configPassword) return {
79
+ password: configPassword,
80
+ source: "config"
81
+ };
82
+ return {
83
+ password: "",
84
+ source: "none"
85
+ };
86
+ }
87
+ function resolveNickServConfig(accountId, nickserv) {
88
+ const base = nickserv ?? {};
89
+ const envPassword = accountId === DEFAULT_ACCOUNT_ID ? process.env.IRC_NICKSERV_PASSWORD?.trim() : void 0;
90
+ const envRegisterEmail = accountId === DEFAULT_ACCOUNT_ID ? process.env.IRC_NICKSERV_REGISTER_EMAIL?.trim() : void 0;
91
+ const passwordFile = base.passwordFile?.trim();
92
+ let resolvedPassword = normalizeResolvedSecretInputString({
93
+ value: base.password,
94
+ path: `channels.irc.accounts.${accountId}.nickserv.password`
95
+ }) || envPassword || "";
96
+ if (!resolvedPassword && passwordFile) resolvedPassword = tryReadSecretFileSync(passwordFile, "IRC NickServ password file", { rejectSymlink: true }) ?? "";
97
+ return {
98
+ ...base,
99
+ service: normalizeOptionalString(base.service),
100
+ passwordFile: passwordFile || void 0,
101
+ password: resolvedPassword || void 0,
102
+ registerEmail: base.registerEmail?.trim() || envRegisterEmail || void 0
103
+ };
104
+ }
105
+ function resolveIrcAccount(params) {
106
+ const hasExplicitAccountId = Boolean(params.accountId?.trim());
107
+ const baseEnabled = params.cfg.channels?.irc?.enabled !== false;
108
+ const resolve = (accountId) => {
109
+ const merged = mergeIrcAccountConfig(params.cfg, accountId);
110
+ const accountEnabled = merged.enabled !== false;
111
+ const enabled = baseEnabled && accountEnabled;
112
+ const tls = typeof merged.tls === "boolean" ? merged.tls : accountId === DEFAULT_ACCOUNT_ID && process.env.IRC_TLS ? parseTruthy(process.env.IRC_TLS) : true;
113
+ const envPort = accountId === DEFAULT_ACCOUNT_ID ? parseIntEnv(process.env.IRC_PORT) : void 0;
114
+ const port = merged.port ?? envPort ?? (tls ? 6697 : 6667);
115
+ const envChannels = accountId === DEFAULT_ACCOUNT_ID ? parseOptionalDelimitedEntries(process.env.IRC_CHANNELS) : void 0;
116
+ const host = (merged.host?.trim() || (accountId === DEFAULT_ACCOUNT_ID ? process.env.IRC_HOST?.trim() : "") || "").trim();
117
+ const nick = (merged.nick?.trim() || (accountId === DEFAULT_ACCOUNT_ID ? process.env.IRC_NICK?.trim() : "") || "").trim();
118
+ const username = (merged.username?.trim() || (accountId === DEFAULT_ACCOUNT_ID ? process.env.IRC_USERNAME?.trim() : "") || nick || "openclaw").trim();
119
+ const realname = (merged.realname?.trim() || (accountId === DEFAULT_ACCOUNT_ID ? process.env.IRC_REALNAME?.trim() : "") || "OpenClaw").trim();
120
+ const passwordResolution = resolvePassword(accountId, merged);
121
+ const nickserv = resolveNickServConfig(accountId, merged.nickserv);
122
+ const config = {
123
+ ...merged,
124
+ channels: merged.channels ?? envChannels,
125
+ tls,
126
+ port,
127
+ host,
128
+ nick,
129
+ username,
130
+ realname,
131
+ nickserv
132
+ };
133
+ return {
134
+ accountId,
135
+ enabled,
136
+ name: normalizeOptionalString(merged.name),
137
+ configured: Boolean(host && nick),
138
+ host,
139
+ port,
140
+ tls,
141
+ nick,
142
+ username,
143
+ realname,
144
+ password: passwordResolution.password,
145
+ passwordSource: passwordResolution.source,
146
+ config
147
+ };
148
+ };
149
+ const primary = resolve(normalizeAccountId(params.accountId));
150
+ if (hasExplicitAccountId) return primary;
151
+ if (primary.configured) return primary;
152
+ const fallbackId = resolveDefaultIrcAccountId(params.cfg);
153
+ if (fallbackId === primary.accountId) return primary;
154
+ const fallback = resolve(fallbackId);
155
+ if (!fallback.configured) return primary;
156
+ return fallback;
157
+ }
158
+ function listEnabledIrcAccounts(cfg) {
159
+ return listIrcAccountIds(cfg).map((accountId) => resolveIrcAccount({
160
+ cfg,
161
+ accountId
162
+ })).filter((account) => account.enabled);
163
+ }
164
+ //#endregion
165
+ //#region extensions/irc/src/doctor.ts
166
+ function asObjectRecord(value) {
167
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
168
+ }
169
+ function isIrcMutableAllowEntry(raw) {
170
+ const text = normalizeLowercaseStringOrEmpty(raw);
171
+ if (!text || text === "*") return false;
172
+ const normalized = text.replace(/^irc:/, "").replace(/^user:/, "").trim();
173
+ return !normalized.includes("!") && !normalized.includes("@");
174
+ }
175
+ const collectIrcMutableAllowlistWarnings = createDangerousNameMatchingMutableAllowlistWarningCollector({
176
+ channel: "irc",
177
+ detector: isIrcMutableAllowEntry,
178
+ collectLists: (scope) => {
179
+ const lists = [{
180
+ pathLabel: `${scope.prefix}.allowFrom`,
181
+ list: scope.account.allowFrom
182
+ }, {
183
+ pathLabel: `${scope.prefix}.groupAllowFrom`,
184
+ list: scope.account.groupAllowFrom
185
+ }];
186
+ const groups = asObjectRecord(scope.account.groups);
187
+ if (groups) for (const [groupKey, groupRaw] of Object.entries(groups)) {
188
+ const group = asObjectRecord(groupRaw);
189
+ if (!group) continue;
190
+ lists.push({
191
+ pathLabel: `${scope.prefix}.groups.${groupKey}.allowFrom`,
192
+ list: group.allowFrom
193
+ });
194
+ }
195
+ return lists;
196
+ }
197
+ });
198
+ //#endregion
199
+ //#region extensions/irc/src/gateway.ts
200
+ let ircChannelRuntimePromise$1;
201
+ async function loadIrcChannelRuntime$1() {
202
+ ircChannelRuntimePromise$1 ??= import("./channel-runtime-DFIO_jtC.js");
203
+ return await ircChannelRuntimePromise$1;
204
+ }
205
+ async function startIrcGatewayAccount(ctx) {
206
+ const account = ctx.account;
207
+ const statusSink = createAccountStatusSink({
208
+ accountId: ctx.accountId,
209
+ setStatus: ctx.setStatus
210
+ });
211
+ if (!account.configured) throw new Error(`IRC is not configured for account "${account.accountId}" (need host and nick in channels.irc).`);
212
+ ctx.log?.info?.(`[${account.accountId}] starting IRC provider (${account.host}:${account.port}${account.tls ? " tls" : ""})`);
213
+ const { monitorIrcProvider } = await loadIrcChannelRuntime$1();
214
+ await runStoppablePassiveMonitor({
215
+ abortSignal: ctx.abortSignal,
216
+ start: async () => await monitorIrcProvider({
217
+ accountId: account.accountId,
218
+ config: ctx.cfg,
219
+ runtime: ctx.runtime,
220
+ abortSignal: ctx.abortSignal,
221
+ statusSink
222
+ })
223
+ });
224
+ }
225
+ //#endregion
226
+ //#region extensions/irc/src/control-chars.ts
227
+ function isIrcControlChar(charCode) {
228
+ return charCode <= 31 || charCode === 127;
229
+ }
230
+ function hasIrcControlChars(value) {
231
+ for (const char of value) if (isIrcControlChar(char.charCodeAt(0))) return true;
232
+ return false;
233
+ }
234
+ function stripIrcControlChars(value) {
235
+ let out = "";
236
+ for (const char of value) if (!isIrcControlChar(char.charCodeAt(0))) out += char;
237
+ return out;
238
+ }
239
+ //#endregion
240
+ //#region extensions/irc/src/protocol.ts
241
+ const IRC_TARGET_PATTERN$1 = /^[^\s:]+$/u;
242
+ function parseIrcLine(line) {
243
+ const raw = line.replace(/[\r\n]+/g, "").trim();
244
+ if (!raw) return null;
245
+ let cursor = raw;
246
+ let prefix;
247
+ if (cursor.startsWith(":")) {
248
+ const idx = cursor.indexOf(" ");
249
+ if (idx <= 1) return null;
250
+ prefix = cursor.slice(1, idx);
251
+ cursor = cursor.slice(idx + 1).trimStart();
252
+ }
253
+ if (!cursor) return null;
254
+ const firstSpace = cursor.indexOf(" ");
255
+ const command = (firstSpace === -1 ? cursor : cursor.slice(0, firstSpace)).trim();
256
+ if (!command) return null;
257
+ cursor = firstSpace === -1 ? "" : cursor.slice(firstSpace + 1);
258
+ const params = [];
259
+ let trailing;
260
+ while (cursor.length > 0) {
261
+ cursor = cursor.trimStart();
262
+ if (!cursor) break;
263
+ if (cursor.startsWith(":")) {
264
+ trailing = cursor.slice(1);
265
+ break;
266
+ }
267
+ const spaceIdx = cursor.indexOf(" ");
268
+ if (spaceIdx === -1) {
269
+ params.push(cursor);
270
+ break;
271
+ }
272
+ params.push(cursor.slice(0, spaceIdx));
273
+ cursor = cursor.slice(spaceIdx + 1);
274
+ }
275
+ return {
276
+ raw,
277
+ prefix,
278
+ command: command.toUpperCase(),
279
+ params,
280
+ trailing
281
+ };
282
+ }
283
+ function parseIrcPrefix(prefix) {
284
+ if (!prefix) return {};
285
+ const nickPart = prefix.match(/^([^!@]+)!([^@]+)@(.+)$/);
286
+ if (nickPart) return {
287
+ nick: nickPart[1],
288
+ user: nickPart[2],
289
+ host: nickPart[3]
290
+ };
291
+ const nickHostPart = prefix.match(/^([^@]+)@(.+)$/);
292
+ if (nickHostPart) return {
293
+ nick: nickHostPart[1],
294
+ host: nickHostPart[2]
295
+ };
296
+ if (prefix.includes("!")) {
297
+ const [nick, user] = prefix.split("!", 2);
298
+ return {
299
+ nick,
300
+ user
301
+ };
302
+ }
303
+ if (prefix.includes(".")) return { server: prefix };
304
+ return { nick: prefix };
305
+ }
306
+ function decodeLiteralEscapes(input) {
307
+ return input.replace(/\\r/g, "\r").replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\0/g, "\0").replace(/\\x([0-9a-fA-F]{2})/g, (_, hex) => String.fromCharCode(Number.parseInt(hex, 16))).replace(/\\u([0-9a-fA-F]{4})/g, (_, hex) => String.fromCharCode(Number.parseInt(hex, 16)));
308
+ }
309
+ function sanitizeIrcOutboundText(text) {
310
+ return stripIrcControlChars(decodeLiteralEscapes(text).replace(/\r?\n/g, " ")).trim();
311
+ }
312
+ function sanitizeIrcTarget(raw) {
313
+ const decoded = decodeLiteralEscapes(raw);
314
+ if (!decoded) throw new Error("IRC target is required");
315
+ if (decoded !== decoded.trim()) throw new Error(`Invalid IRC target: ${raw}`);
316
+ if (hasIrcControlChars(decoded)) throw new Error(`Invalid IRC target: ${raw}`);
317
+ if (!IRC_TARGET_PATTERN$1.test(decoded)) throw new Error(`Invalid IRC target: ${raw}`);
318
+ return decoded;
319
+ }
320
+ function makeIrcMessageId() {
321
+ return randomUUID();
322
+ }
323
+ //#endregion
324
+ //#region extensions/irc/src/client.ts
325
+ const IRC_ERROR_CODES = new Set([
326
+ "432",
327
+ "464",
328
+ "465"
329
+ ]);
330
+ const IRC_NICK_COLLISION_CODES = new Set(["433", "436"]);
331
+ function toError(err) {
332
+ if (err instanceof Error) return err;
333
+ return new Error(typeof err === "string" ? err : JSON.stringify(err));
334
+ }
335
+ function buildFallbackNick(nick) {
336
+ const base = nick.replace(/\s+/g, "").replace(/[^A-Za-z0-9_\-[\]\\`^{}|]/g, "") || "openclaw";
337
+ const suffix = "_";
338
+ const maxNickLen = 30;
339
+ if (base.length >= maxNickLen) return `${base.slice(0, maxNickLen - 1)}${suffix}`;
340
+ return `${base}${suffix}`;
341
+ }
342
+ function normalizeIrcNick(value) {
343
+ return normalizeLowercaseStringOrEmpty(value);
344
+ }
345
+ function buildIrcNickServCommands(options) {
346
+ if (!options || options.enabled === false) return [];
347
+ const password = sanitizeIrcOutboundText(options.password ?? "");
348
+ if (!password) return [];
349
+ const service = sanitizeIrcTarget(options.service?.trim() || "NickServ");
350
+ const commands = [`PRIVMSG ${service} :IDENTIFY ${password}`];
351
+ if (options.register) {
352
+ const registerEmail = sanitizeIrcOutboundText(options.registerEmail ?? "");
353
+ if (!registerEmail) throw new Error("IRC NickServ register requires registerEmail");
354
+ commands.push(`PRIVMSG ${service} :REGISTER ${password} ${registerEmail}`);
355
+ }
356
+ return commands;
357
+ }
358
+ async function connectIrcClient(options) {
359
+ const timeoutMs = options.connectTimeoutMs != null ? options.connectTimeoutMs : 15e3;
360
+ const messageChunkMaxChars = options.messageChunkMaxChars != null ? options.messageChunkMaxChars : 350;
361
+ if (!options.host.trim()) throw new Error("IRC host is required");
362
+ if (!options.nick.trim()) throw new Error("IRC nick is required");
363
+ const desiredNick = options.nick.trim();
364
+ let currentNick = desiredNick;
365
+ let ready = false;
366
+ let closed = false;
367
+ let nickServRecoverAttempted = false;
368
+ let fallbackNickAttempted = false;
369
+ let removeAbortListener = null;
370
+ const socket = options.tls ? tls.connect({
371
+ host: options.host,
372
+ port: options.port,
373
+ servername: options.host
374
+ }) : net.connect({
375
+ host: options.host,
376
+ port: options.port
377
+ });
378
+ socket.setEncoding("utf8");
379
+ let resolveReady = null;
380
+ let rejectReady = null;
381
+ const readyPromise = new Promise((resolve, reject) => {
382
+ resolveReady = resolve;
383
+ rejectReady = reject;
384
+ });
385
+ const fail = (err) => {
386
+ const error = toError(err);
387
+ if (options.onError) options.onError(error);
388
+ if (!ready && rejectReady) {
389
+ rejectReady(error);
390
+ rejectReady = null;
391
+ resolveReady = null;
392
+ }
393
+ };
394
+ const failAndClose = (err) => {
395
+ fail(err);
396
+ close();
397
+ };
398
+ const sendRaw = (line) => {
399
+ const cleaned = line.replace(/[\r\n]+/g, "").trim();
400
+ if (!cleaned) throw new Error("IRC command cannot be empty");
401
+ socket.write(`${cleaned}\r\n`);
402
+ };
403
+ const tryRecoverNickCollision = () => {
404
+ const nickServEnabled = options.nickserv?.enabled !== false;
405
+ const nickservPassword = sanitizeIrcOutboundText(options.nickserv?.password ?? "");
406
+ if (nickServEnabled && !nickServRecoverAttempted && nickservPassword) {
407
+ nickServRecoverAttempted = true;
408
+ try {
409
+ sendRaw(`PRIVMSG ${sanitizeIrcTarget(options.nickserv?.service?.trim() || "NickServ")} :GHOST ${desiredNick} ${nickservPassword}`);
410
+ sendRaw(`NICK ${desiredNick}`);
411
+ return true;
412
+ } catch (err) {
413
+ fail(err);
414
+ }
415
+ }
416
+ if (!fallbackNickAttempted) {
417
+ fallbackNickAttempted = true;
418
+ const fallbackNick = buildFallbackNick(desiredNick);
419
+ if (normalizeIrcNick(fallbackNick) !== normalizeIrcNick(currentNick)) try {
420
+ sendRaw(`NICK ${fallbackNick}`);
421
+ currentNick = fallbackNick;
422
+ return true;
423
+ } catch (err) {
424
+ fail(err);
425
+ }
426
+ }
427
+ return false;
428
+ };
429
+ const join = (channel) => {
430
+ const target = sanitizeIrcTarget(channel);
431
+ if (!target.startsWith("#") && !target.startsWith("&")) throw new Error(`IRC JOIN target must be a channel: ${channel}`);
432
+ sendRaw(`JOIN ${target}`);
433
+ };
434
+ const sendPrivmsg = (target, text) => {
435
+ const normalizedTarget = sanitizeIrcTarget(target);
436
+ const cleaned = sanitizeIrcOutboundText(text);
437
+ if (!cleaned) return;
438
+ let remaining = cleaned;
439
+ while (remaining.length > 0) {
440
+ let chunk = remaining;
441
+ if (chunk.length > messageChunkMaxChars) {
442
+ let splitAt = chunk.lastIndexOf(" ", messageChunkMaxChars);
443
+ if (splitAt < Math.floor(messageChunkMaxChars / 2)) splitAt = messageChunkMaxChars;
444
+ chunk = chunk.slice(0, splitAt).trim();
445
+ }
446
+ if (!chunk) break;
447
+ sendRaw(`PRIVMSG ${normalizedTarget} :${chunk}`);
448
+ remaining = remaining.slice(chunk.length).trimStart();
449
+ }
450
+ };
451
+ const quit = (reason) => {
452
+ if (closed) return;
453
+ closed = true;
454
+ removeAbortListener?.();
455
+ removeAbortListener = null;
456
+ const safeReason = sanitizeIrcOutboundText(reason != null ? reason : "bye");
457
+ try {
458
+ if (safeReason) sendRaw(`QUIT :${safeReason}`);
459
+ else sendRaw("QUIT");
460
+ } catch {}
461
+ socket.end();
462
+ };
463
+ const close = () => {
464
+ if (closed) return;
465
+ closed = true;
466
+ removeAbortListener?.();
467
+ removeAbortListener = null;
468
+ socket.destroy();
469
+ };
470
+ let buffer = "";
471
+ socket.on("data", (chunk) => {
472
+ buffer += chunk;
473
+ let idx = buffer.indexOf("\n");
474
+ while (idx !== -1) {
475
+ const rawLine = buffer.slice(0, idx).replace(/\r$/, "");
476
+ buffer = buffer.slice(idx + 1);
477
+ idx = buffer.indexOf("\n");
478
+ if (!rawLine) continue;
479
+ if (options.onLine) options.onLine(rawLine);
480
+ const line = parseIrcLine(rawLine);
481
+ if (!line) continue;
482
+ if (line.command === "PING") {
483
+ sendRaw(`PONG :${line.trailing != null ? line.trailing : line.params[0] != null ? line.params[0] : ""}`);
484
+ continue;
485
+ }
486
+ if (line.command === "NICK") {
487
+ const prefix = parseIrcPrefix(line.prefix);
488
+ if (prefix.nick && normalizeIrcNick(prefix.nick) === normalizeIrcNick(currentNick)) currentNick = (line.trailing != null ? line.trailing : line.params[0] != null ? line.params[0] : currentNick).trim();
489
+ continue;
490
+ }
491
+ if (!ready && IRC_NICK_COLLISION_CODES.has(line.command)) {
492
+ if (tryRecoverNickCollision()) continue;
493
+ const detail = line.trailing != null ? line.trailing : line.params.join(" ") || "nickname in use";
494
+ fail(/* @__PURE__ */ new Error(`IRC login failed (${line.command}): ${detail}`));
495
+ close();
496
+ return;
497
+ }
498
+ if (!ready && IRC_ERROR_CODES.has(line.command)) {
499
+ const detail = line.trailing != null ? line.trailing : line.params.join(" ") || "login rejected";
500
+ fail(/* @__PURE__ */ new Error(`IRC login failed (${line.command}): ${detail}`));
501
+ close();
502
+ return;
503
+ }
504
+ if (line.command === "001") {
505
+ ready = true;
506
+ const nickParam = line.params[0];
507
+ if (nickParam && nickParam.trim()) currentNick = nickParam.trim();
508
+ try {
509
+ const nickServCommands = buildIrcNickServCommands(options.nickserv);
510
+ for (const command of nickServCommands) sendRaw(command);
511
+ } catch (err) {
512
+ fail(err);
513
+ }
514
+ for (const channel of options.channels || []) {
515
+ const trimmed = channel.trim();
516
+ if (!trimmed) continue;
517
+ try {
518
+ join(trimmed);
519
+ } catch (err) {
520
+ fail(err);
521
+ }
522
+ }
523
+ if (resolveReady) resolveReady();
524
+ resolveReady = null;
525
+ rejectReady = null;
526
+ continue;
527
+ }
528
+ if (line.command === "NOTICE") {
529
+ if (options.onNotice) options.onNotice(line.trailing != null ? line.trailing : "", line.params[0]);
530
+ continue;
531
+ }
532
+ if (line.command === "PRIVMSG") {
533
+ const targetParam = line.params[0];
534
+ const target = targetParam ? targetParam.trim() : "";
535
+ const text = line.trailing != null ? line.trailing : "";
536
+ const prefix = parseIrcPrefix(line.prefix);
537
+ const senderNick = prefix.nick ? prefix.nick.trim() : "";
538
+ if (!target || !senderNick || !text.trim()) continue;
539
+ if (options.onPrivmsg) Promise.resolve(options.onPrivmsg({
540
+ senderNick,
541
+ senderUser: prefix.user ? prefix.user.trim() : void 0,
542
+ senderHost: prefix.host ? prefix.host.trim() : void 0,
543
+ target,
544
+ text,
545
+ rawLine
546
+ })).catch((error) => {
547
+ fail(error);
548
+ });
549
+ }
550
+ }
551
+ });
552
+ socket.once("connect", () => {
553
+ try {
554
+ if (options.password && options.password.trim()) sendRaw(`PASS ${options.password.trim()}`);
555
+ sendRaw(`NICK ${options.nick.trim()}`);
556
+ sendRaw(`USER ${options.username.trim()} 0 * :${sanitizeIrcOutboundText(options.realname)}`);
557
+ } catch (err) {
558
+ fail(err);
559
+ close();
560
+ }
561
+ });
562
+ socket.once("error", (err) => {
563
+ fail(err);
564
+ });
565
+ socket.once("close", () => {
566
+ if (!closed) {
567
+ closed = true;
568
+ if (!ready) fail(/* @__PURE__ */ new Error("IRC connection closed before ready"));
569
+ }
570
+ });
571
+ if (options.abortSignal) {
572
+ const abort = () => {
573
+ if (!ready) {
574
+ failAndClose(/* @__PURE__ */ new Error("IRC connect aborted"));
575
+ return;
576
+ }
577
+ quit("shutdown");
578
+ };
579
+ if (options.abortSignal.aborted) abort();
580
+ else {
581
+ options.abortSignal.addEventListener("abort", abort, { once: true });
582
+ removeAbortListener = () => options.abortSignal?.removeEventListener("abort", abort);
583
+ }
584
+ }
585
+ await withTimeout(readyPromise, timeoutMs, "IRC connect");
586
+ return {
587
+ get nick() {
588
+ return currentNick;
589
+ },
590
+ isReady: () => ready && !closed,
591
+ sendRaw,
592
+ join,
593
+ sendPrivmsg,
594
+ quit,
595
+ close
596
+ };
597
+ }
598
+ //#endregion
599
+ //#region extensions/irc/src/connect-options.ts
600
+ function buildIrcConnectOptions(account, overrides = {}) {
601
+ return {
602
+ host: account.host,
603
+ port: account.port,
604
+ tls: account.tls,
605
+ nick: account.nick,
606
+ username: account.username,
607
+ realname: account.realname,
608
+ password: account.password,
609
+ nickserv: {
610
+ enabled: account.config.nickserv?.enabled,
611
+ service: account.config.nickserv?.service,
612
+ password: account.config.nickserv?.password,
613
+ register: account.config.nickserv?.register,
614
+ registerEmail: account.config.nickserv?.registerEmail
615
+ },
616
+ ...overrides
617
+ };
618
+ }
619
+ //#endregion
620
+ //#region extensions/irc/src/normalize.ts
621
+ const IRC_TARGET_PATTERN = /^[^\s:]+$/u;
622
+ function isChannelTarget(target) {
623
+ return target.startsWith("#") || target.startsWith("&");
624
+ }
625
+ function normalizeIrcMessagingTarget(raw) {
626
+ const trimmed = raw.trim();
627
+ if (!trimmed) return;
628
+ let target = trimmed;
629
+ if (normalizeLowercaseStringOrEmpty(target).startsWith("irc:")) target = target.slice(4).trim();
630
+ if (normalizeLowercaseStringOrEmpty(target).startsWith("channel:")) {
631
+ target = target.slice(8).trim();
632
+ if (!target.startsWith("#") && !target.startsWith("&")) target = `#${target}`;
633
+ }
634
+ if (normalizeLowercaseStringOrEmpty(target).startsWith("user:")) target = target.slice(5).trim();
635
+ if (!target || !looksLikeIrcTargetId(target)) return;
636
+ return target;
637
+ }
638
+ function looksLikeIrcTargetId(raw) {
639
+ const trimmed = raw.trim();
640
+ if (!trimmed) return false;
641
+ if (hasIrcControlChars(trimmed)) return false;
642
+ return IRC_TARGET_PATTERN.test(trimmed);
643
+ }
644
+ function normalizeIrcAllowEntry(raw) {
645
+ let value = normalizeLowercaseStringOrEmpty(raw);
646
+ if (!value) return "";
647
+ if (value.startsWith("irc:")) value = value.slice(4);
648
+ if (value.startsWith("user:")) value = value.slice(5);
649
+ return value.trim();
650
+ }
651
+ function buildIrcAllowlistCandidates(message, params) {
652
+ const nick = normalizeLowercaseStringOrEmpty(message.senderNick);
653
+ const user = normalizeOptionalLowercaseString(message.senderUser);
654
+ const host = normalizeOptionalLowercaseString(message.senderHost);
655
+ const candidates = /* @__PURE__ */ new Set();
656
+ if (nick && params?.allowNameMatching === true) candidates.add(nick);
657
+ if (nick && user) candidates.add(`${nick}!${user}`);
658
+ if (nick && host) candidates.add(`${nick}@${host}`);
659
+ if (nick && user && host) candidates.add(`${nick}!${user}@${host}`);
660
+ return [...candidates];
661
+ }
662
+ //#endregion
663
+ //#region extensions/irc/src/send.ts
664
+ function recordIrcOutboundActivity(accountId) {
665
+ try {
666
+ getIrcRuntime().channel.activity.record({
667
+ channel: "irc",
668
+ accountId,
669
+ direction: "outbound"
670
+ });
671
+ } catch (error) {
672
+ if (!(error instanceof Error) || error.message !== "IRC runtime not initialized") throw error;
673
+ }
674
+ }
675
+ function resolveTarget(to, opts) {
676
+ const fromArg = normalizeIrcMessagingTarget(to);
677
+ if (fromArg) return fromArg;
678
+ const fromOpt = normalizeIrcMessagingTarget(opts?.target ?? "");
679
+ if (fromOpt) return fromOpt;
680
+ throw new Error(`Invalid IRC target: ${to}`);
681
+ }
682
+ async function sendMessageIrc(to, text, opts) {
683
+ const cfg = requireRuntimeConfig(opts.cfg, "IRC send");
684
+ const account = resolveIrcAccount({
685
+ cfg,
686
+ accountId: opts.accountId
687
+ });
688
+ if (!account.configured) throw new Error(`IRC is not configured for account "${account.accountId}" (need host and nick in channels.irc).`);
689
+ const target = resolveTarget(to, opts);
690
+ const tableMode = resolveMarkdownTableMode({
691
+ cfg,
692
+ channel: "irc",
693
+ accountId: account.accountId
694
+ });
695
+ const prepared = convertMarkdownTables(text.trim(), tableMode);
696
+ const payload = opts.replyTo ? `${prepared}\n\n[reply:${opts.replyTo}]` : prepared;
697
+ if (!payload.trim()) throw new Error("Message must be non-empty for IRC sends");
698
+ const client = opts.client;
699
+ if (client?.isReady()) client.sendPrivmsg(target, payload);
700
+ else {
701
+ const transient = await connectIrcClient(buildIrcConnectOptions(account, { connectTimeoutMs: 12e3 }));
702
+ if (target.startsWith("#") || target.startsWith("&")) transient.join(target);
703
+ transient.sendPrivmsg(target, payload);
704
+ transient.quit("sent");
705
+ }
706
+ recordIrcOutboundActivity(account.accountId);
707
+ const messageId = makeIrcMessageId();
708
+ return {
709
+ messageId,
710
+ target,
711
+ receipt: createMessageReceiptFromOutboundResults({
712
+ results: [{
713
+ channel: "irc",
714
+ messageId,
715
+ conversationId: target
716
+ }],
717
+ kind: "text",
718
+ ...opts.replyTo ? { replyToId: opts.replyTo } : {}
719
+ })
720
+ };
721
+ }
722
+ //#endregion
723
+ //#region extensions/irc/src/message-adapter.ts
724
+ const ircMessageAdapter = defineChannelMessageAdapter({
725
+ id: "irc",
726
+ durableFinal: { capabilities: {
727
+ text: true,
728
+ media: true,
729
+ replyTo: true
730
+ } },
731
+ send: {
732
+ text: async ({ cfg, to, text, accountId, replyToId }) => await sendMessageIrc(to, text, {
733
+ cfg,
734
+ accountId: accountId ?? void 0,
735
+ replyTo: replyToId ?? void 0
736
+ }),
737
+ media: async ({ cfg, to, text, mediaUrl, accountId, replyToId }) => await sendMessageIrc(to, mediaUrl ? `${text}\n\nAttachment: ${mediaUrl}` : text, {
738
+ cfg,
739
+ accountId: accountId ?? void 0,
740
+ replyTo: replyToId ?? void 0
741
+ })
742
+ }
743
+ });
744
+ //#endregion
745
+ //#region extensions/irc/src/outbound-base.ts
746
+ const ircOutboundBaseAdapter = {
747
+ deliveryMode: "direct",
748
+ chunker: chunkTextForOutbound,
749
+ chunkerMode: "markdown",
750
+ textChunkLimit: 350,
751
+ sanitizeText: ({ text }) => sanitizeForPlainText(text)
752
+ };
753
+ //#endregion
754
+ //#region extensions/irc/src/policy.ts
755
+ function resolveIrcGroupMatch(params) {
756
+ const groups = params.groups ?? {};
757
+ const hasConfiguredGroups = Object.keys(groups).length > 0;
758
+ const direct = groups[params.target];
759
+ if (direct) return {
760
+ allowed: true,
761
+ groupConfig: direct,
762
+ wildcardConfig: groups["*"],
763
+ hasConfiguredGroups
764
+ };
765
+ const targetLower = normalizeLowercaseStringOrEmpty(params.target);
766
+ const directKey = Object.keys(groups).find((key) => normalizeLowercaseStringOrEmpty(key) === targetLower);
767
+ if (directKey) {
768
+ const matched = groups[directKey];
769
+ if (matched) return {
770
+ allowed: true,
771
+ groupConfig: matched,
772
+ wildcardConfig: groups["*"],
773
+ hasConfiguredGroups
774
+ };
775
+ }
776
+ const wildcard = groups["*"];
777
+ if (wildcard) return {
778
+ allowed: true,
779
+ wildcardConfig: wildcard,
780
+ hasConfiguredGroups
781
+ };
782
+ return {
783
+ allowed: false,
784
+ hasConfiguredGroups
785
+ };
786
+ }
787
+ function resolveIrcRequireMention(params) {
788
+ if (params.groupConfig?.requireMention !== void 0) return params.groupConfig.requireMention;
789
+ if (params.wildcardConfig?.requireMention !== void 0) return params.wildcardConfig.requireMention;
790
+ return true;
791
+ }
792
+ //#endregion
793
+ //#region extensions/irc/src/probe.ts
794
+ function formatError(err) {
795
+ if (err instanceof Error) return err.message;
796
+ return typeof err === "string" ? err : JSON.stringify(err);
797
+ }
798
+ async function probeIrc(cfg, opts) {
799
+ const account = resolveIrcAccount({
800
+ cfg,
801
+ accountId: opts?.accountId
802
+ });
803
+ const base = {
804
+ ok: false,
805
+ host: account.host,
806
+ port: account.port,
807
+ tls: account.tls,
808
+ nick: account.nick
809
+ };
810
+ if (!account.configured) return {
811
+ ...base,
812
+ error: "missing host or nick"
813
+ };
814
+ const started = Date.now();
815
+ try {
816
+ const client = await connectIrcClient(buildIrcConnectOptions(account, { connectTimeoutMs: opts?.timeoutMs ?? 8e3 }));
817
+ const elapsed = Date.now() - started;
818
+ client.quit("probe");
819
+ return {
820
+ ...base,
821
+ ok: true,
822
+ latencyMs: elapsed
823
+ };
824
+ } catch (err) {
825
+ return {
826
+ ...base,
827
+ error: formatError(err)
828
+ };
829
+ }
830
+ }
831
+ //#endregion
832
+ //#region extensions/irc/src/setup-core.ts
833
+ const channel$1 = "irc";
834
+ const setIrcTopLevelDmPolicy = createTopLevelChannelDmPolicySetter({ channel: channel$1 });
835
+ const setIrcTopLevelAllowFrom = createTopLevelChannelAllowFromSetter({ channel: channel$1 });
836
+ const validateIrcRequiredSetupInput = createSetupInputPresenceValidator({ whenNotUseEnv: [{
837
+ someOf: ["host"],
838
+ message: "IRC requires host."
839
+ }, {
840
+ someOf: ["nick"],
841
+ message: "IRC requires nick."
842
+ }] });
843
+ function parsePort(raw, fallback) {
844
+ const trimmed = raw.trim();
845
+ if (!trimmed) return fallback;
846
+ const parsed = parseStrictPositiveInteger(trimmed);
847
+ if (parsed === void 0 || parsed > 65535) return fallback;
848
+ return parsed;
849
+ }
850
+ function validateIrcPortInput(input) {
851
+ const raw = input.port;
852
+ if (raw === void 0 || raw === null || raw === "") return null;
853
+ const parsed = parseStrictPositiveInteger(String(raw));
854
+ return parsed !== void 0 && parsed <= 65535 ? null : "IRC port must be between 1 and 65535.";
855
+ }
856
+ function updateIrcAccountConfig(cfg, accountId, patch) {
857
+ return patchScopedAccountConfig({
858
+ cfg,
859
+ channelKey: channel$1,
860
+ accountId,
861
+ patch,
862
+ ensureChannelEnabled: false,
863
+ ensureAccountEnabled: false
864
+ });
865
+ }
866
+ function setIrcDmPolicy(cfg, dmPolicy) {
867
+ return setIrcTopLevelDmPolicy(cfg, dmPolicy);
868
+ }
869
+ function setIrcAllowFrom(cfg, allowFrom) {
870
+ return setIrcTopLevelAllowFrom(cfg, allowFrom);
871
+ }
872
+ function setIrcNickServ(cfg, accountId, nickserv) {
873
+ return updateIrcAccountConfig(cfg, accountId, { nickserv });
874
+ }
875
+ function setIrcGroupAccess(cfg, accountId, policy, entries, normalizeGroupEntry) {
876
+ if (policy !== "allowlist") return updateIrcAccountConfig(cfg, accountId, {
877
+ enabled: true,
878
+ groupPolicy: policy
879
+ });
880
+ const normalizedEntries = [...new Set(entries.flatMap((entry) => normalizeGroupEntry(entry) ?? []))];
881
+ return updateIrcAccountConfig(cfg, accountId, {
882
+ enabled: true,
883
+ groupPolicy: "allowlist",
884
+ groups: Object.fromEntries(normalizedEntries.map((entry) => [entry, {}]))
885
+ });
886
+ }
887
+ const ircSetupAdapter = {
888
+ resolveAccountId: ({ accountId }) => normalizeAccountId$1(accountId),
889
+ applyAccountName: ({ cfg, accountId, name }) => applyAccountNameToChannelSection({
890
+ cfg,
891
+ channelKey: channel$1,
892
+ accountId,
893
+ name
894
+ }),
895
+ validateInput: (params) => validateIrcRequiredSetupInput(params) ?? validateIrcPortInput(params.input),
896
+ applyAccountConfig: ({ cfg, accountId, input }) => {
897
+ const setupInput = input;
898
+ const namedConfig = applyAccountNameToChannelSection({
899
+ cfg,
900
+ channelKey: channel$1,
901
+ accountId,
902
+ name: setupInput.name
903
+ });
904
+ const portInput = typeof setupInput.port === "number" ? String(setupInput.port) : setupInput.port ?? "";
905
+ return patchScopedAccountConfig({
906
+ cfg: namedConfig,
907
+ channelKey: channel$1,
908
+ accountId,
909
+ patch: {
910
+ enabled: true,
911
+ host: setupInput.host?.trim(),
912
+ port: portInput ? parsePort(portInput, setupInput.tls === false ? 6667 : 6697) : void 0,
913
+ tls: setupInput.tls,
914
+ nick: setupInput.nick?.trim(),
915
+ username: setupInput.username?.trim(),
916
+ realname: setupInput.realname?.trim(),
917
+ password: setupInput.password?.trim(),
918
+ channels: setupInput.channels
919
+ }
920
+ });
921
+ }
922
+ };
923
+ //#endregion
924
+ //#region extensions/irc/src/setup-surface.ts
925
+ const t = createSetupTranslator();
926
+ const channel = "irc";
927
+ const USE_ENV_FLAG = "__ircUseEnv";
928
+ const TLS_FLAG = "__ircTls";
929
+ function parseListInput(raw) {
930
+ return normalizeStringEntries(raw.split(/[\n,;]+/g));
931
+ }
932
+ function normalizeGroupEntry(raw) {
933
+ const trimmed = raw.trim();
934
+ if (!trimmed) return null;
935
+ if (trimmed === "*") return "*";
936
+ const normalized = normalizeIrcMessagingTarget(trimmed) ?? trimmed;
937
+ if (isChannelTarget(normalized)) return normalized;
938
+ return `#${normalized.replace(/^#+/, "")}`;
939
+ }
940
+ const promptIrcAllowFrom = createPromptParsedAllowFromForAccount({
941
+ defaultAccountId: (cfg) => resolveDefaultIrcAccountId(cfg),
942
+ noteTitle: t("wizard.irc.allowlistTitle"),
943
+ noteLines: [
944
+ t("wizard.irc.allowlistIntro"),
945
+ t("wizard.irc.examples"),
946
+ "- alice",
947
+ "- alice!ident@example.org",
948
+ t("wizard.irc.multipleEntries")
949
+ ],
950
+ message: t("wizard.irc.allowFromPrompt"),
951
+ placeholder: "alice, bob!ident@example.org",
952
+ parseEntries: (raw) => ({ entries: normalizeStringEntries(parseListInput(raw).map((entry) => normalizeIrcAllowEntry(entry))) }),
953
+ getExistingAllowFrom: ({ cfg }) => cfg.channels?.irc?.allowFrom ?? [],
954
+ applyAllowFrom: ({ cfg, allowFrom }) => setIrcAllowFrom(cfg, allowFrom)
955
+ });
956
+ async function promptIrcNickServConfig(params) {
957
+ const existing = resolveIrcAccount({
958
+ cfg: params.cfg,
959
+ accountId: params.accountId
960
+ }).config.nickserv;
961
+ const hasExisting = Boolean(existing?.password || existing?.passwordFile);
962
+ if (!await params.prompter.confirm({
963
+ message: hasExisting ? t("wizard.irc.nickServUpdatePrompt") : t("wizard.irc.nickServConfigurePrompt"),
964
+ initialValue: hasExisting
965
+ })) return params.cfg;
966
+ const service = (await params.prompter.text({
967
+ message: t("wizard.irc.nickServServicePrompt"),
968
+ initialValue: existing?.service || "NickServ",
969
+ validate: (value) => normalizeStringifiedOptionalString(value) ? void 0 : "Required"
970
+ })).trim();
971
+ const useEnvPassword = params.accountId === DEFAULT_ACCOUNT_ID$1 && Boolean(process.env.IRC_NICKSERV_PASSWORD?.trim()) && !(existing?.password || existing?.passwordFile) ? await params.prompter.confirm({
972
+ message: t("wizard.irc.nickServPasswordEnvPrompt"),
973
+ initialValue: true
974
+ }) : false;
975
+ const password = useEnvPassword ? void 0 : (await params.prompter.text({
976
+ message: t("wizard.irc.nickServPasswordPrompt"),
977
+ validate: () => void 0
978
+ })).trim();
979
+ if (!password && !useEnvPassword) return setIrcNickServ(params.cfg, params.accountId, {
980
+ enabled: false,
981
+ service
982
+ });
983
+ const register = await params.prompter.confirm({
984
+ message: t("wizard.irc.nickServRegisterPrompt"),
985
+ initialValue: existing?.register ?? false
986
+ });
987
+ const registerEmail = register ? (await params.prompter.text({
988
+ message: t("wizard.irc.nickServRegisterEmailPrompt"),
989
+ initialValue: existing?.registerEmail || (params.accountId === DEFAULT_ACCOUNT_ID$1 ? process.env.IRC_NICKSERV_REGISTER_EMAIL : void 0),
990
+ validate: (value) => normalizeStringifiedOptionalString(value) ? void 0 : "Required"
991
+ })).trim() : void 0;
992
+ return setIrcNickServ(params.cfg, params.accountId, {
993
+ enabled: true,
994
+ service,
995
+ ...password ? { password } : {},
996
+ register,
997
+ ...registerEmail ? { registerEmail } : {}
998
+ });
999
+ }
1000
+ const ircDmPolicy = {
1001
+ label: "IRC",
1002
+ channel,
1003
+ policyKey: "channels.irc.dmPolicy",
1004
+ allowFromKey: "channels.irc.allowFrom",
1005
+ getCurrent: (cfg) => cfg.channels?.irc?.dmPolicy ?? "pairing",
1006
+ setPolicy: (cfg, policy) => setIrcDmPolicy(cfg, policy),
1007
+ promptAllowFrom: async ({ cfg, prompter, accountId }) => await promptIrcAllowFrom({
1008
+ cfg,
1009
+ prompter,
1010
+ accountId
1011
+ })
1012
+ };
1013
+ const ircSetupWizard = {
1014
+ channel,
1015
+ status: createStandardChannelSetupStatus({
1016
+ channelLabel: "IRC",
1017
+ configuredLabel: t("wizard.channels.statusConfigured"),
1018
+ unconfiguredLabel: t("wizard.channels.statusNeedsHostNick"),
1019
+ configuredHint: t("wizard.channels.statusConfigured"),
1020
+ unconfiguredHint: t("wizard.channels.statusNeedsHostNick"),
1021
+ configuredScore: 1,
1022
+ unconfiguredScore: 0,
1023
+ includeStatusLine: true,
1024
+ resolveConfigured: ({ cfg, accountId }) => resolveIrcAccount({
1025
+ cfg,
1026
+ accountId
1027
+ }).configured
1028
+ }),
1029
+ introNote: {
1030
+ title: t("wizard.irc.setupTitle"),
1031
+ lines: [
1032
+ t("wizard.irc.helpNeedsHostNick"),
1033
+ t("wizard.irc.helpRecommendedTls"),
1034
+ t("wizard.irc.helpNickServOptional"),
1035
+ t("wizard.irc.helpGroupControl"),
1036
+ t("wizard.irc.helpMentionGate"),
1037
+ t("wizard.irc.helpEnvVars"),
1038
+ `Docs: ${formatDocsLink("/channels/irc", "channels/irc")}`
1039
+ ],
1040
+ shouldShow: ({ cfg, accountId }) => !resolveIrcAccount({
1041
+ cfg,
1042
+ accountId
1043
+ }).configured
1044
+ },
1045
+ prepare: async ({ cfg, accountId, credentialValues, prompter }) => {
1046
+ const resolved = resolveIrcAccount({
1047
+ cfg,
1048
+ accountId
1049
+ });
1050
+ const isDefaultAccount = accountId === DEFAULT_ACCOUNT_ID$1;
1051
+ const envHost = isDefaultAccount ? normalizeOptionalString(process.env.IRC_HOST) ?? "" : "";
1052
+ const envNick = isDefaultAccount ? normalizeOptionalString(process.env.IRC_NICK) ?? "" : "";
1053
+ if (Boolean(envHost && envNick && !resolved.config.host && !resolved.config.nick)) {
1054
+ if (await prompter.confirm({
1055
+ message: t("wizard.irc.envPrompt"),
1056
+ initialValue: true
1057
+ })) return {
1058
+ cfg: updateIrcAccountConfig(cfg, accountId, { enabled: true }),
1059
+ credentialValues: {
1060
+ ...credentialValues,
1061
+ [USE_ENV_FLAG]: "1"
1062
+ }
1063
+ };
1064
+ }
1065
+ const tls = await prompter.confirm({
1066
+ message: t("wizard.irc.tlsPrompt"),
1067
+ initialValue: resolved.config.tls ?? true
1068
+ });
1069
+ return {
1070
+ cfg: updateIrcAccountConfig(cfg, accountId, {
1071
+ enabled: true,
1072
+ tls
1073
+ }),
1074
+ credentialValues: {
1075
+ ...credentialValues,
1076
+ [USE_ENV_FLAG]: "0",
1077
+ [TLS_FLAG]: tls ? "1" : "0"
1078
+ }
1079
+ };
1080
+ },
1081
+ credentials: [],
1082
+ textInputs: [
1083
+ {
1084
+ inputKey: "httpHost",
1085
+ message: t("wizard.irc.serverHostPrompt"),
1086
+ currentValue: ({ cfg, accountId }) => resolveIrcAccount({
1087
+ cfg,
1088
+ accountId
1089
+ }).config.host || void 0,
1090
+ shouldPrompt: ({ credentialValues }) => credentialValues[USE_ENV_FLAG] !== "1",
1091
+ validate: ({ value }) => normalizeStringifiedOptionalString(value) ? void 0 : "Required",
1092
+ normalizeValue: ({ value }) => normalizeStringifiedOptionalString(value) ?? "",
1093
+ applySet: async ({ cfg, accountId, value }) => updateIrcAccountConfig(cfg, accountId, {
1094
+ enabled: true,
1095
+ host: value
1096
+ })
1097
+ },
1098
+ {
1099
+ inputKey: "httpPort",
1100
+ message: t("wizard.irc.serverPortPrompt"),
1101
+ currentValue: ({ cfg, accountId }) => String(resolveIrcAccount({
1102
+ cfg,
1103
+ accountId
1104
+ }).config.port ?? ""),
1105
+ shouldPrompt: ({ credentialValues }) => credentialValues[USE_ENV_FLAG] !== "1",
1106
+ initialValue: ({ cfg, accountId, credentialValues }) => {
1107
+ const resolved = resolveIrcAccount({
1108
+ cfg,
1109
+ accountId
1110
+ });
1111
+ const tls = credentialValues[TLS_FLAG] !== "0";
1112
+ const defaultPort = resolved.config.port ?? (tls ? 6697 : 6667);
1113
+ return String(defaultPort);
1114
+ },
1115
+ validate: ({ value }) => {
1116
+ const parsed = parseStrictPositiveInteger(normalizeStringifiedOptionalString(value) ?? "");
1117
+ return parsed !== void 0 && parsed <= 65535 ? void 0 : "Use a port between 1 and 65535";
1118
+ },
1119
+ normalizeValue: ({ value }) => String(parsePort(value, 6697)),
1120
+ applySet: async ({ cfg, accountId, value }) => updateIrcAccountConfig(cfg, accountId, {
1121
+ enabled: true,
1122
+ port: parsePort(value, 6697)
1123
+ })
1124
+ },
1125
+ {
1126
+ inputKey: "token",
1127
+ message: t("wizard.irc.nickPrompt"),
1128
+ currentValue: ({ cfg, accountId }) => resolveIrcAccount({
1129
+ cfg,
1130
+ accountId
1131
+ }).config.nick || void 0,
1132
+ shouldPrompt: ({ credentialValues }) => credentialValues[USE_ENV_FLAG] !== "1",
1133
+ validate: ({ value }) => normalizeStringifiedOptionalString(value) ? void 0 : "Required",
1134
+ normalizeValue: ({ value }) => normalizeStringifiedOptionalString(value) ?? "",
1135
+ applySet: async ({ cfg, accountId, value }) => updateIrcAccountConfig(cfg, accountId, {
1136
+ enabled: true,
1137
+ nick: value
1138
+ })
1139
+ },
1140
+ {
1141
+ inputKey: "userId",
1142
+ message: t("wizard.irc.usernamePrompt"),
1143
+ currentValue: ({ cfg, accountId }) => resolveIrcAccount({
1144
+ cfg,
1145
+ accountId
1146
+ }).config.username || void 0,
1147
+ shouldPrompt: ({ credentialValues }) => credentialValues[USE_ENV_FLAG] !== "1",
1148
+ initialValue: ({ cfg, accountId, credentialValues }) => resolveIrcAccount({
1149
+ cfg,
1150
+ accountId
1151
+ }).config.username || credentialValues.token || "openclaw",
1152
+ validate: ({ value }) => normalizeStringifiedOptionalString(value) ? void 0 : "Required",
1153
+ normalizeValue: ({ value }) => normalizeStringifiedOptionalString(value) ?? "",
1154
+ applySet: async ({ cfg, accountId, value }) => updateIrcAccountConfig(cfg, accountId, {
1155
+ enabled: true,
1156
+ username: value
1157
+ })
1158
+ },
1159
+ {
1160
+ inputKey: "deviceName",
1161
+ message: t("wizard.irc.realNamePrompt"),
1162
+ currentValue: ({ cfg, accountId }) => resolveIrcAccount({
1163
+ cfg,
1164
+ accountId
1165
+ }).config.realname || void 0,
1166
+ shouldPrompt: ({ credentialValues }) => credentialValues[USE_ENV_FLAG] !== "1",
1167
+ initialValue: ({ cfg, accountId }) => resolveIrcAccount({
1168
+ cfg,
1169
+ accountId
1170
+ }).config.realname || "OpenClaw",
1171
+ validate: ({ value }) => normalizeStringifiedOptionalString(value) ? void 0 : "Required",
1172
+ normalizeValue: ({ value }) => normalizeStringifiedOptionalString(value) ?? "",
1173
+ applySet: async ({ cfg, accountId, value }) => updateIrcAccountConfig(cfg, accountId, {
1174
+ enabled: true,
1175
+ realname: value
1176
+ })
1177
+ },
1178
+ {
1179
+ inputKey: "groupChannels",
1180
+ message: t("wizard.irc.autoJoinPrompt"),
1181
+ placeholder: "#openclaw, #ops",
1182
+ required: false,
1183
+ applyEmptyValue: true,
1184
+ currentValue: ({ cfg, accountId }) => resolveIrcAccount({
1185
+ cfg,
1186
+ accountId
1187
+ }).config.channels?.join(", "),
1188
+ shouldPrompt: ({ credentialValues }) => credentialValues[USE_ENV_FLAG] !== "1",
1189
+ normalizeValue: ({ value }) => parseListInput(value).map((entry) => normalizeGroupEntry(entry)).filter((entry) => Boolean(entry && entry !== "*")).filter((entry) => isChannelTarget(entry)).join(", "),
1190
+ applySet: async ({ cfg, accountId, value }) => {
1191
+ const channels = parseListInput(value).map((entry) => normalizeGroupEntry(entry)).filter((entry) => Boolean(entry && entry !== "*")).filter((entry) => isChannelTarget(entry));
1192
+ return updateIrcAccountConfig(cfg, accountId, {
1193
+ enabled: true,
1194
+ channels: channels.length > 0 ? channels : void 0
1195
+ });
1196
+ }
1197
+ }
1198
+ ],
1199
+ groupAccess: {
1200
+ label: "IRC channels",
1201
+ placeholder: "#openclaw, #ops, *",
1202
+ currentPolicy: ({ cfg, accountId }) => resolveIrcAccount({
1203
+ cfg,
1204
+ accountId
1205
+ }).config.groupPolicy ?? "allowlist",
1206
+ currentEntries: ({ cfg, accountId }) => Object.keys(resolveIrcAccount({
1207
+ cfg,
1208
+ accountId
1209
+ }).config.groups ?? {}),
1210
+ updatePrompt: ({ cfg, accountId }) => Boolean(resolveIrcAccount({
1211
+ cfg,
1212
+ accountId
1213
+ }).config.groups),
1214
+ setPolicy: ({ cfg, accountId, policy }) => setIrcGroupAccess(cfg, accountId, policy, [], normalizeGroupEntry),
1215
+ resolveAllowlist: async ({ entries }) => uniqueStrings(entries.map((entry) => normalizeGroupEntry(entry)).filter((entry) => Boolean(entry))),
1216
+ applyAllowlist: ({ cfg, accountId, resolved }) => setIrcGroupAccess(cfg, accountId, "allowlist", resolved, normalizeGroupEntry)
1217
+ },
1218
+ allowFrom: createAllowFromSection({
1219
+ helpTitle: t("wizard.irc.allowlistTitle"),
1220
+ helpLines: [
1221
+ t("wizard.irc.allowlistIntro"),
1222
+ t("wizard.irc.examples"),
1223
+ "- alice",
1224
+ "- alice!ident@example.org",
1225
+ t("wizard.irc.multipleEntries")
1226
+ ],
1227
+ message: t("wizard.irc.allowFromPrompt"),
1228
+ placeholder: "alice, bob!ident@example.org",
1229
+ invalidWithoutCredentialNote: t("wizard.irc.allowFromInvalid"),
1230
+ parseId: (raw) => {
1231
+ return normalizeIrcAllowEntry(raw) || null;
1232
+ },
1233
+ apply: async ({ cfg, allowFrom }) => setIrcAllowFrom(cfg, allowFrom)
1234
+ }),
1235
+ finalize: async ({ cfg, accountId, prompter }) => {
1236
+ let next = cfg;
1237
+ const resolvedAfterGroups = resolveIrcAccount({
1238
+ cfg: next,
1239
+ accountId
1240
+ });
1241
+ if (resolvedAfterGroups.config.groupPolicy === "allowlist") {
1242
+ if (Object.keys(resolvedAfterGroups.config.groups ?? {}).length > 0) {
1243
+ if (!await prompter.confirm({
1244
+ message: t("wizard.irc.requireMentionPrompt"),
1245
+ initialValue: true
1246
+ })) {
1247
+ const groups = resolvedAfterGroups.config.groups ?? {};
1248
+ const patched = Object.fromEntries(Object.entries(groups).map(([key, value]) => [key, {
1249
+ ...value,
1250
+ requireMention: false
1251
+ }]));
1252
+ next = updateIrcAccountConfig(next, accountId, { groups: patched });
1253
+ }
1254
+ }
1255
+ }
1256
+ next = await promptIrcNickServConfig({
1257
+ cfg: next,
1258
+ prompter,
1259
+ accountId
1260
+ });
1261
+ return { cfg: next };
1262
+ },
1263
+ completionNote: {
1264
+ title: t("wizard.irc.nextStepsTitle"),
1265
+ lines: [
1266
+ t("wizard.irc.nextRestartGateway"),
1267
+ t("wizard.irc.nextStatusCommand"),
1268
+ `Docs: ${formatDocsLink("/channels/irc", "channels/irc")}`
1269
+ ]
1270
+ },
1271
+ dmPolicy: ircDmPolicy,
1272
+ disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
1273
+ };
1274
+ //#endregion
1275
+ //#region extensions/irc/src/channel.ts
1276
+ const meta = {
1277
+ id: "irc",
1278
+ label: "IRC",
1279
+ selectionLabel: "IRC (Server + Nick)",
1280
+ docsPath: "/channels/irc",
1281
+ docsLabel: "irc",
1282
+ blurb: "classic IRC networks; host, nick, channels.",
1283
+ order: 80,
1284
+ detailLabel: "IRC",
1285
+ systemImage: "number",
1286
+ markdownCapable: true
1287
+ };
1288
+ let ircChannelRuntimePromise;
1289
+ async function loadIrcChannelRuntime() {
1290
+ ircChannelRuntimePromise ??= import("./channel-runtime-DFIO_jtC.js");
1291
+ return await ircChannelRuntimePromise;
1292
+ }
1293
+ function normalizePairingTarget(raw) {
1294
+ const normalized = normalizeIrcAllowEntry(raw);
1295
+ if (!normalized) return "";
1296
+ return normalized.split(/[!@]/, 1)[0]?.trim() ?? "";
1297
+ }
1298
+ const listIrcDirectoryPeersFromConfig = createResolvedDirectoryEntriesLister({
1299
+ kind: "user",
1300
+ resolveAccount: adaptScopedAccountAccessor(resolveIrcAccount),
1301
+ resolveSources: (account) => [
1302
+ account.config.allowFrom ?? [],
1303
+ account.config.groupAllowFrom ?? [],
1304
+ ...Object.values(account.config.groups ?? {}).map((group) => group.allowFrom ?? [])
1305
+ ],
1306
+ normalizeId: (entry) => normalizePairingTarget(entry) || null
1307
+ });
1308
+ const listIrcDirectoryGroupsFromConfig = createResolvedDirectoryEntriesLister({
1309
+ kind: "group",
1310
+ resolveAccount: adaptScopedAccountAccessor(resolveIrcAccount),
1311
+ resolveSources: (account) => [account.config.channels ?? [], Object.keys(account.config.groups ?? {})],
1312
+ normalizeId: (entry) => {
1313
+ const normalized = normalizeIrcMessagingTarget(entry);
1314
+ return normalized && isChannelTarget(normalized) ? normalized : null;
1315
+ }
1316
+ });
1317
+ const ircConfigAdapter = createScopedChannelConfigAdapter({
1318
+ sectionKey: "irc",
1319
+ listAccountIds: listIrcAccountIds,
1320
+ resolveAccount: adaptScopedAccountAccessor(resolveIrcAccount),
1321
+ defaultAccountId: resolveDefaultIrcAccountId,
1322
+ clearBaseFields: [
1323
+ "name",
1324
+ "host",
1325
+ "port",
1326
+ "tls",
1327
+ "nick",
1328
+ "username",
1329
+ "realname",
1330
+ "password",
1331
+ "passwordFile",
1332
+ "channels"
1333
+ ],
1334
+ resolveAllowFrom: (account) => account.config.allowFrom,
1335
+ formatAllowFrom: (allowFrom) => formatNormalizedAllowFromEntries({
1336
+ allowFrom,
1337
+ normalizeEntry: normalizeIrcAllowEntry
1338
+ }),
1339
+ resolveDefaultTo: (account) => account.config.defaultTo
1340
+ });
1341
+ const resolveIrcDmPolicy = createScopedDmSecurityResolver({
1342
+ channelKey: "irc",
1343
+ resolvePolicy: (account) => account.config.dmPolicy,
1344
+ resolveAllowFrom: (account) => account.config.allowFrom,
1345
+ policyPathSuffix: "dmPolicy",
1346
+ normalizeEntry: (raw) => normalizeIrcAllowEntry(raw)
1347
+ });
1348
+ const collectIrcSecurityWarnings = composeAccountWarningCollectors(createAllowlistProviderOpenWarningCollector({
1349
+ providerConfigPresent: (cfg) => cfg.channels?.irc !== void 0,
1350
+ resolveGroupPolicy: (account) => account.config.groupPolicy,
1351
+ buildOpenWarning: {
1352
+ surface: "IRC channels",
1353
+ openBehavior: "allows all channels and senders (mention-gated)",
1354
+ remediation: "Prefer channels.irc.groupPolicy=\"allowlist\" with channels.irc.groups"
1355
+ }
1356
+ }), (account) => !account.config.tls && "- IRC TLS is disabled (channels.irc.tls=false); traffic and credentials are plaintext.", (account) => account.config.nickserv?.register && "- IRC NickServ registration is enabled (channels.irc.nickserv.register=true); this sends \"REGISTER\" on every connect. Disable after first successful registration.", (account) => account.config.nickserv?.register && !account.config.nickserv.password?.trim() && "- IRC NickServ registration is enabled but no NickServ password is resolved; set channels.irc.nickserv.password, channels.irc.nickserv.passwordFile, or IRC_NICKSERV_PASSWORD.");
1357
+ const ircPlugin = createChatChannelPlugin({
1358
+ base: {
1359
+ id: "irc",
1360
+ meta: {
1361
+ ...meta,
1362
+ quickstartAllowFrom: true
1363
+ },
1364
+ setup: ircSetupAdapter,
1365
+ setupWizard: ircSetupWizard,
1366
+ capabilities: {
1367
+ chatTypes: ["direct", "group"],
1368
+ media: true,
1369
+ blockStreaming: true
1370
+ },
1371
+ reload: { configPrefixes: ["channels.irc"] },
1372
+ configSchema: IrcChannelConfigSchema,
1373
+ config: {
1374
+ ...ircConfigAdapter,
1375
+ hasConfiguredState: ({ env }) => typeof env?.IRC_HOST === "string" && env.IRC_HOST.trim().length > 0 && typeof env?.IRC_NICK === "string" && env.IRC_NICK.trim().length > 0,
1376
+ isConfigured: (account) => account.configured,
1377
+ describeAccount: (account) => describeAccountSnapshot({
1378
+ account,
1379
+ configured: account.configured,
1380
+ extra: {
1381
+ host: account.host,
1382
+ port: account.port,
1383
+ tls: account.tls,
1384
+ nick: account.nick,
1385
+ passwordSource: account.passwordSource
1386
+ }
1387
+ })
1388
+ },
1389
+ secrets: {
1390
+ secretTargetRegistryEntries,
1391
+ collectRuntimeConfigAssignments
1392
+ },
1393
+ doctor: {
1394
+ groupAllowFromFallbackToAllowFrom: false,
1395
+ collectMutableAllowlistWarnings: collectIrcMutableAllowlistWarnings
1396
+ },
1397
+ groups: {
1398
+ resolveRequireMention: ({ cfg, accountId, groupId }) => {
1399
+ const account = resolveIrcAccount({
1400
+ cfg,
1401
+ accountId
1402
+ });
1403
+ if (!groupId) return true;
1404
+ const match = resolveIrcGroupMatch({
1405
+ groups: account.config.groups,
1406
+ target: groupId
1407
+ });
1408
+ return resolveIrcRequireMention({
1409
+ groupConfig: match.groupConfig,
1410
+ wildcardConfig: match.wildcardConfig
1411
+ });
1412
+ },
1413
+ resolveToolPolicy: ({ cfg, accountId, groupId }) => {
1414
+ const account = resolveIrcAccount({
1415
+ cfg,
1416
+ accountId
1417
+ });
1418
+ if (!groupId) return;
1419
+ const match = resolveIrcGroupMatch({
1420
+ groups: account.config.groups,
1421
+ target: groupId
1422
+ });
1423
+ return match.groupConfig?.tools ?? match.wildcardConfig?.tools;
1424
+ }
1425
+ },
1426
+ messaging: {
1427
+ targetPrefixes: ["irc"],
1428
+ normalizeTarget: normalizeIrcMessagingTarget,
1429
+ targetResolver: {
1430
+ looksLikeId: looksLikeIrcTargetId,
1431
+ hint: "<#channel|nick>"
1432
+ }
1433
+ },
1434
+ message: ircMessageAdapter,
1435
+ resolver: { resolveTargets: async ({ inputs, kind }) => {
1436
+ return inputs.map((input) => {
1437
+ const normalized = normalizeIrcMessagingTarget(input);
1438
+ if (!normalized) return {
1439
+ input,
1440
+ resolved: false,
1441
+ note: "invalid IRC target"
1442
+ };
1443
+ if (kind === "group") {
1444
+ const groupId = isChannelTarget(normalized) ? normalized : `#${normalized}`;
1445
+ return {
1446
+ input,
1447
+ resolved: true,
1448
+ id: groupId,
1449
+ name: groupId
1450
+ };
1451
+ }
1452
+ if (isChannelTarget(normalized)) return {
1453
+ input,
1454
+ resolved: false,
1455
+ note: "expected user target"
1456
+ };
1457
+ return {
1458
+ input,
1459
+ resolved: true,
1460
+ id: normalized,
1461
+ name: normalized
1462
+ };
1463
+ });
1464
+ } },
1465
+ directory: createChannelDirectoryAdapter({
1466
+ listPeers: async (params) => listIrcDirectoryPeersFromConfig(params),
1467
+ listGroups: async (params) => {
1468
+ return (await listIrcDirectoryGroupsFromConfig(params)).map((entry) => Object.assign({}, entry, { name: entry.id }));
1469
+ }
1470
+ }),
1471
+ status: createComputedAccountStatusAdapter({
1472
+ defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID$2),
1473
+ buildChannelSummary: ({ account, snapshot }) => ({
1474
+ ...buildBaseChannelStatusSummary(snapshot),
1475
+ host: account.host,
1476
+ port: snapshot.port,
1477
+ tls: account.tls,
1478
+ nick: account.nick,
1479
+ probe: snapshot.probe,
1480
+ lastProbeAt: snapshot.lastProbeAt ?? null
1481
+ }),
1482
+ probeAccount: async ({ cfg, account, timeoutMs }) => probeIrc(cfg, {
1483
+ accountId: account.accountId,
1484
+ timeoutMs
1485
+ }),
1486
+ resolveAccountSnapshot: ({ account }) => ({
1487
+ accountId: account.accountId,
1488
+ name: account.name,
1489
+ enabled: account.enabled,
1490
+ configured: account.configured,
1491
+ extra: {
1492
+ host: account.host,
1493
+ port: account.port,
1494
+ tls: account.tls,
1495
+ nick: account.nick,
1496
+ passwordSource: account.passwordSource
1497
+ }
1498
+ })
1499
+ }),
1500
+ gateway: { startAccount: async (ctx) => await startIrcGatewayAccount({
1501
+ ...ctx,
1502
+ cfg: ctx.cfg
1503
+ }) }
1504
+ },
1505
+ pairing: { text: {
1506
+ idLabel: "ircUser",
1507
+ message: PAIRING_APPROVED_MESSAGE,
1508
+ normalizeAllowEntry: (entry) => normalizeIrcAllowEntry(entry),
1509
+ notify: async ({ cfg, id, message }) => {
1510
+ const target = normalizePairingTarget(id);
1511
+ if (!target) throw new Error(`invalid IRC pairing id: ${id}`);
1512
+ const { sendMessageIrc } = await loadIrcChannelRuntime();
1513
+ await sendMessageIrc(target, message, { cfg });
1514
+ }
1515
+ } },
1516
+ security: {
1517
+ resolveDmPolicy: resolveIrcDmPolicy,
1518
+ collectWarnings: collectIrcSecurityWarnings
1519
+ },
1520
+ outbound: {
1521
+ base: ircOutboundBaseAdapter,
1522
+ attachedResults: {
1523
+ channel: "irc",
1524
+ sendText: async ({ cfg, to, text, accountId, replyToId }) => {
1525
+ const { sendMessageIrc } = await loadIrcChannelRuntime();
1526
+ return await sendMessageIrc(to, text, {
1527
+ cfg,
1528
+ accountId: accountId ?? void 0,
1529
+ replyTo: replyToId ?? void 0
1530
+ });
1531
+ },
1532
+ sendMedia: async ({ cfg, to, text, mediaUrl, accountId, replyToId }) => {
1533
+ const { sendMessageIrc } = await loadIrcChannelRuntime();
1534
+ return await sendMessageIrc(to, mediaUrl ? `${text}\n\nAttachment: ${mediaUrl}` : text, {
1535
+ cfg,
1536
+ accountId: accountId ?? void 0,
1537
+ replyTo: replyToId ?? void 0
1538
+ });
1539
+ }
1540
+ }
1541
+ }
1542
+ });
1543
+ //#endregion
1544
+ export { resolveIrcRequireMention as a, isChannelTarget as c, connectIrcClient as d, makeIrcMessageId as f, resolveIrcAccount as g, resolveDefaultIrcAccountId as h, resolveIrcGroupMatch as i, normalizeIrcAllowEntry as l, listIrcAccountIds as m, ircSetupWizard as n, sendMessageIrc as o, listEnabledIrcAccounts as p, ircSetupAdapter as r, buildIrcAllowlistCandidates as s, ircPlugin as t, buildIrcConnectOptions as u };