language-operator 0.1.81 → 0.1.82

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 (427) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/agents/README.md +16 -0
  3. data/.claude/agents/changelog-writer.md +181 -0
  4. data/.claude/hooks/README.md +43 -0
  5. data/.claude/hooks/node_modules/.bin/esbuild +1 -0
  6. data/.claude/hooks/node_modules/.bin/tsc +1 -0
  7. data/.claude/hooks/node_modules/.bin/tsserver +1 -0
  8. data/.claude/hooks/node_modules/.bin/tsx +1 -0
  9. data/.claude/hooks/node_modules/.package-lock.json +136 -0
  10. data/.claude/hooks/node_modules/@esbuild/linux-x64/README.md +3 -0
  11. data/.claude/hooks/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  12. data/.claude/hooks/node_modules/@esbuild/linux-x64/package.json +20 -0
  13. data/.claude/hooks/node_modules/@types/node/LICENSE +21 -0
  14. data/.claude/hooks/node_modules/@types/node/README.md +15 -0
  15. data/.claude/hooks/node_modules/@types/node/assert/strict.d.ts +105 -0
  16. data/.claude/hooks/node_modules/@types/node/assert.d.ts +955 -0
  17. data/.claude/hooks/node_modules/@types/node/async_hooks.d.ts +623 -0
  18. data/.claude/hooks/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  19. data/.claude/hooks/node_modules/@types/node/buffer.d.ts +1810 -0
  20. data/.claude/hooks/node_modules/@types/node/child_process.d.ts +1428 -0
  21. data/.claude/hooks/node_modules/@types/node/cluster.d.ts +486 -0
  22. data/.claude/hooks/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  23. data/.claude/hooks/node_modules/@types/node/console.d.ts +151 -0
  24. data/.claude/hooks/node_modules/@types/node/constants.d.ts +20 -0
  25. data/.claude/hooks/node_modules/@types/node/crypto.d.ts +4065 -0
  26. data/.claude/hooks/node_modules/@types/node/dgram.d.ts +564 -0
  27. data/.claude/hooks/node_modules/@types/node/diagnostics_channel.d.ts +576 -0
  28. data/.claude/hooks/node_modules/@types/node/dns/promises.d.ts +503 -0
  29. data/.claude/hooks/node_modules/@types/node/dns.d.ts +922 -0
  30. data/.claude/hooks/node_modules/@types/node/domain.d.ts +166 -0
  31. data/.claude/hooks/node_modules/@types/node/events.d.ts +1054 -0
  32. data/.claude/hooks/node_modules/@types/node/fs/promises.d.ts +1316 -0
  33. data/.claude/hooks/node_modules/@types/node/fs.d.ts +4676 -0
  34. data/.claude/hooks/node_modules/@types/node/globals.d.ts +150 -0
  35. data/.claude/hooks/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  36. data/.claude/hooks/node_modules/@types/node/http.d.ts +2143 -0
  37. data/.claude/hooks/node_modules/@types/node/http2.d.ts +2480 -0
  38. data/.claude/hooks/node_modules/@types/node/https.d.ts +399 -0
  39. data/.claude/hooks/node_modules/@types/node/index.d.ts +115 -0
  40. data/.claude/hooks/node_modules/@types/node/inspector/promises.d.ts +41 -0
  41. data/.claude/hooks/node_modules/@types/node/inspector.d.ts +224 -0
  42. data/.claude/hooks/node_modules/@types/node/inspector.generated.d.ts +4226 -0
  43. data/.claude/hooks/node_modules/@types/node/module.d.ts +819 -0
  44. data/.claude/hooks/node_modules/@types/node/net.d.ts +933 -0
  45. data/.claude/hooks/node_modules/@types/node/os.d.ts +507 -0
  46. data/.claude/hooks/node_modules/@types/node/package.json +155 -0
  47. data/.claude/hooks/node_modules/@types/node/path/posix.d.ts +8 -0
  48. data/.claude/hooks/node_modules/@types/node/path/win32.d.ts +8 -0
  49. data/.claude/hooks/node_modules/@types/node/path.d.ts +187 -0
  50. data/.claude/hooks/node_modules/@types/node/perf_hooks.d.ts +621 -0
  51. data/.claude/hooks/node_modules/@types/node/process.d.ts +2097 -0
  52. data/.claude/hooks/node_modules/@types/node/punycode.d.ts +117 -0
  53. data/.claude/hooks/node_modules/@types/node/querystring.d.ts +152 -0
  54. data/.claude/hooks/node_modules/@types/node/quic.d.ts +910 -0
  55. data/.claude/hooks/node_modules/@types/node/readline/promises.d.ts +161 -0
  56. data/.claude/hooks/node_modules/@types/node/readline.d.ts +541 -0
  57. data/.claude/hooks/node_modules/@types/node/repl.d.ts +415 -0
  58. data/.claude/hooks/node_modules/@types/node/sea.d.ts +162 -0
  59. data/.claude/hooks/node_modules/@types/node/sqlite.d.ts +937 -0
  60. data/.claude/hooks/node_modules/@types/node/stream/consumers.d.ts +38 -0
  61. data/.claude/hooks/node_modules/@types/node/stream/promises.d.ts +211 -0
  62. data/.claude/hooks/node_modules/@types/node/stream/web.d.ts +296 -0
  63. data/.claude/hooks/node_modules/@types/node/stream.d.ts +1760 -0
  64. data/.claude/hooks/node_modules/@types/node/string_decoder.d.ts +67 -0
  65. data/.claude/hooks/node_modules/@types/node/test/reporters.d.ts +96 -0
  66. data/.claude/hooks/node_modules/@types/node/test.d.ts +2239 -0
  67. data/.claude/hooks/node_modules/@types/node/timers/promises.d.ts +108 -0
  68. data/.claude/hooks/node_modules/@types/node/timers.d.ts +159 -0
  69. data/.claude/hooks/node_modules/@types/node/tls.d.ts +1194 -0
  70. data/.claude/hooks/node_modules/@types/node/trace_events.d.ts +197 -0
  71. data/.claude/hooks/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  72. data/.claude/hooks/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  73. data/.claude/hooks/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  74. data/.claude/hooks/node_modules/@types/node/ts5.6/index.d.ts +117 -0
  75. data/.claude/hooks/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  76. data/.claude/hooks/node_modules/@types/node/ts5.7/index.d.ts +117 -0
  77. data/.claude/hooks/node_modules/@types/node/tty.d.ts +250 -0
  78. data/.claude/hooks/node_modules/@types/node/url.d.ts +519 -0
  79. data/.claude/hooks/node_modules/@types/node/util/types.d.ts +558 -0
  80. data/.claude/hooks/node_modules/@types/node/util.d.ts +1653 -0
  81. data/.claude/hooks/node_modules/@types/node/v8.d.ts +979 -0
  82. data/.claude/hooks/node_modules/@types/node/vm.d.ts +1180 -0
  83. data/.claude/hooks/node_modules/@types/node/wasi.d.ts +202 -0
  84. data/.claude/hooks/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  85. data/.claude/hooks/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  86. data/.claude/hooks/node_modules/@types/node/web-globals/console.d.ts +9 -0
  87. data/.claude/hooks/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  88. data/.claude/hooks/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  89. data/.claude/hooks/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  90. data/.claude/hooks/node_modules/@types/node/web-globals/events.d.ts +106 -0
  91. data/.claude/hooks/node_modules/@types/node/web-globals/fetch.d.ts +54 -0
  92. data/.claude/hooks/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  93. data/.claude/hooks/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  94. data/.claude/hooks/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  95. data/.claude/hooks/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  96. data/.claude/hooks/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  97. data/.claude/hooks/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  98. data/.claude/hooks/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  99. data/.claude/hooks/node_modules/@types/node/web-globals/url.d.ts +24 -0
  100. data/.claude/hooks/node_modules/@types/node/worker_threads.d.ts +714 -0
  101. data/.claude/hooks/node_modules/@types/node/zlib.d.ts +618 -0
  102. data/.claude/hooks/node_modules/esbuild/LICENSE.md +21 -0
  103. data/.claude/hooks/node_modules/esbuild/README.md +3 -0
  104. data/.claude/hooks/node_modules/esbuild/bin/esbuild +0 -0
  105. data/.claude/hooks/node_modules/esbuild/install.js +289 -0
  106. data/.claude/hooks/node_modules/esbuild/lib/main.d.ts +716 -0
  107. data/.claude/hooks/node_modules/esbuild/lib/main.js +2242 -0
  108. data/.claude/hooks/node_modules/esbuild/package.json +49 -0
  109. data/.claude/hooks/node_modules/get-tsconfig/LICENSE +21 -0
  110. data/.claude/hooks/node_modules/get-tsconfig/README.md +235 -0
  111. data/.claude/hooks/node_modules/get-tsconfig/dist/index.cjs +7 -0
  112. data/.claude/hooks/node_modules/get-tsconfig/dist/index.d.cts +2088 -0
  113. data/.claude/hooks/node_modules/get-tsconfig/dist/index.d.mts +2088 -0
  114. data/.claude/hooks/node_modules/get-tsconfig/dist/index.mjs +7 -0
  115. data/.claude/hooks/node_modules/get-tsconfig/package.json +46 -0
  116. data/.claude/hooks/node_modules/resolve-pkg-maps/LICENSE +21 -0
  117. data/.claude/hooks/node_modules/resolve-pkg-maps/README.md +216 -0
  118. data/.claude/hooks/node_modules/resolve-pkg-maps/dist/index.cjs +1 -0
  119. data/.claude/hooks/node_modules/resolve-pkg-maps/dist/index.d.cts +11 -0
  120. data/.claude/hooks/node_modules/resolve-pkg-maps/dist/index.d.mts +11 -0
  121. data/.claude/hooks/node_modules/resolve-pkg-maps/dist/index.mjs +1 -0
  122. data/.claude/hooks/node_modules/resolve-pkg-maps/package.json +42 -0
  123. data/.claude/hooks/node_modules/tsx/LICENSE +21 -0
  124. data/.claude/hooks/node_modules/tsx/README.md +32 -0
  125. data/.claude/hooks/node_modules/tsx/dist/cjs/api/index.cjs +1 -0
  126. data/.claude/hooks/node_modules/tsx/dist/cjs/api/index.d.cts +35 -0
  127. data/.claude/hooks/node_modules/tsx/dist/cjs/api/index.d.mts +35 -0
  128. data/.claude/hooks/node_modules/tsx/dist/cjs/api/index.mjs +1 -0
  129. data/.claude/hooks/node_modules/tsx/dist/cjs/index.cjs +1 -0
  130. data/.claude/hooks/node_modules/tsx/dist/cjs/index.mjs +1 -0
  131. data/.claude/hooks/node_modules/tsx/dist/cli.cjs +54 -0
  132. data/.claude/hooks/node_modules/tsx/dist/cli.mjs +55 -0
  133. data/.claude/hooks/node_modules/tsx/dist/client-BQVF1NaW.mjs +1 -0
  134. data/.claude/hooks/node_modules/tsx/dist/client-D6NvIMSC.cjs +1 -0
  135. data/.claude/hooks/node_modules/tsx/dist/esm/api/index.cjs +1 -0
  136. data/.claude/hooks/node_modules/tsx/dist/esm/api/index.d.cts +35 -0
  137. data/.claude/hooks/node_modules/tsx/dist/esm/api/index.d.mts +35 -0
  138. data/.claude/hooks/node_modules/tsx/dist/esm/api/index.mjs +1 -0
  139. data/.claude/hooks/node_modules/tsx/dist/esm/index.cjs +2 -0
  140. data/.claude/hooks/node_modules/tsx/dist/esm/index.mjs +2 -0
  141. data/.claude/hooks/node_modules/tsx/dist/get-pipe-path-BHW2eJdv.mjs +1 -0
  142. data/.claude/hooks/node_modules/tsx/dist/get-pipe-path-BoR10qr8.cjs +1 -0
  143. data/.claude/hooks/node_modules/tsx/dist/index-7AaEi15b.mjs +14 -0
  144. data/.claude/hooks/node_modules/tsx/dist/index-BWFBUo6r.cjs +1 -0
  145. data/.claude/hooks/node_modules/tsx/dist/index-gbaejti9.mjs +1 -0
  146. data/.claude/hooks/node_modules/tsx/dist/index-gckBtVBf.cjs +14 -0
  147. data/.claude/hooks/node_modules/tsx/dist/lexer-DQCqS3nf.mjs +3 -0
  148. data/.claude/hooks/node_modules/tsx/dist/lexer-DgIbo0BU.cjs +3 -0
  149. data/.claude/hooks/node_modules/tsx/dist/loader.cjs +1 -0
  150. data/.claude/hooks/node_modules/tsx/dist/loader.mjs +1 -0
  151. data/.claude/hooks/node_modules/tsx/dist/node-features-_8ZFwP_x.mjs +1 -0
  152. data/.claude/hooks/node_modules/tsx/dist/node-features-roYmp9jK.cjs +1 -0
  153. data/.claude/hooks/node_modules/tsx/dist/package-CeBgXWuR.mjs +1 -0
  154. data/.claude/hooks/node_modules/tsx/dist/package-Dxt5kIHw.cjs +1 -0
  155. data/.claude/hooks/node_modules/tsx/dist/patch-repl.cjs +1 -0
  156. data/.claude/hooks/node_modules/tsx/dist/patch-repl.mjs +1 -0
  157. data/.claude/hooks/node_modules/tsx/dist/preflight.cjs +1 -0
  158. data/.claude/hooks/node_modules/tsx/dist/preflight.mjs +1 -0
  159. data/.claude/hooks/node_modules/tsx/dist/register-2sWVXuRQ.cjs +1 -0
  160. data/.claude/hooks/node_modules/tsx/dist/register-B7jrtLTO.mjs +1 -0
  161. data/.claude/hooks/node_modules/tsx/dist/register-CFH5oNdT.mjs +4 -0
  162. data/.claude/hooks/node_modules/tsx/dist/register-D46fvsV_.cjs +4 -0
  163. data/.claude/hooks/node_modules/tsx/dist/repl.cjs +3 -0
  164. data/.claude/hooks/node_modules/tsx/dist/repl.mjs +3 -0
  165. data/.claude/hooks/node_modules/tsx/dist/require-D4F1Lv60.cjs +1 -0
  166. data/.claude/hooks/node_modules/tsx/dist/require-DQxpCAr4.mjs +1 -0
  167. data/.claude/hooks/node_modules/tsx/dist/suppress-warnings.cjs +1 -0
  168. data/.claude/hooks/node_modules/tsx/dist/suppress-warnings.mjs +1 -0
  169. data/.claude/hooks/node_modules/tsx/dist/temporary-directory-B83uKxJF.cjs +1 -0
  170. data/.claude/hooks/node_modules/tsx/dist/temporary-directory-CwHp0_NW.mjs +1 -0
  171. data/.claude/hooks/node_modules/tsx/dist/types-Cxp8y2TL.d.ts +5 -0
  172. data/.claude/hooks/node_modules/tsx/package.json +68 -0
  173. data/.claude/hooks/node_modules/typescript/LICENSE.txt +55 -0
  174. data/.claude/hooks/node_modules/typescript/README.md +50 -0
  175. data/.claude/hooks/node_modules/typescript/SECURITY.md +41 -0
  176. data/.claude/hooks/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  177. data/.claude/hooks/node_modules/typescript/bin/tsc +2 -0
  178. data/.claude/hooks/node_modules/typescript/bin/tsserver +2 -0
  179. data/.claude/hooks/node_modules/typescript/lib/_tsc.js +133818 -0
  180. data/.claude/hooks/node_modules/typescript/lib/_tsserver.js +659 -0
  181. data/.claude/hooks/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  182. data/.claude/hooks/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  183. data/.claude/hooks/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  184. data/.claude/hooks/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  185. data/.claude/hooks/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  186. data/.claude/hooks/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  187. data/.claude/hooks/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  188. data/.claude/hooks/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  189. data/.claude/hooks/node_modules/typescript/lib/lib.d.ts +22 -0
  190. data/.claude/hooks/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
  191. data/.claude/hooks/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  192. data/.claude/hooks/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  193. data/.claude/hooks/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
  194. data/.claude/hooks/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
  195. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  196. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  197. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  198. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  199. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
  200. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  201. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  202. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  203. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  204. data/.claude/hooks/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  205. data/.claude/hooks/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  206. data/.claude/hooks/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  207. data/.claude/hooks/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  208. data/.claude/hooks/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  209. data/.claude/hooks/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
  210. data/.claude/hooks/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
  211. data/.claude/hooks/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  212. data/.claude/hooks/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  213. data/.claude/hooks/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  214. data/.claude/hooks/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  215. data/.claude/hooks/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  216. data/.claude/hooks/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  217. data/.claude/hooks/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  218. data/.claude/hooks/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  219. data/.claude/hooks/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  220. data/.claude/hooks/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  221. data/.claude/hooks/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  222. data/.claude/hooks/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  223. data/.claude/hooks/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  224. data/.claude/hooks/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  225. data/.claude/hooks/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  226. data/.claude/hooks/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  227. data/.claude/hooks/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  228. data/.claude/hooks/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  229. data/.claude/hooks/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  230. data/.claude/hooks/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  231. data/.claude/hooks/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  232. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
  233. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  234. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  235. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  236. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  237. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  238. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  239. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
  240. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
  241. data/.claude/hooks/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  242. data/.claude/hooks/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  243. data/.claude/hooks/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  244. data/.claude/hooks/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  245. data/.claude/hooks/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  246. data/.claude/hooks/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  247. data/.claude/hooks/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
  248. data/.claude/hooks/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  249. data/.claude/hooks/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
  250. data/.claude/hooks/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
  251. data/.claude/hooks/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  252. data/.claude/hooks/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
  253. data/.claude/hooks/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  254. data/.claude/hooks/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  255. data/.claude/hooks/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  256. data/.claude/hooks/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  257. data/.claude/hooks/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  258. data/.claude/hooks/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  259. data/.claude/hooks/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  260. data/.claude/hooks/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  261. data/.claude/hooks/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
  262. data/.claude/hooks/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
  263. data/.claude/hooks/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
  264. data/.claude/hooks/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
  265. data/.claude/hooks/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
  266. data/.claude/hooks/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
  267. data/.claude/hooks/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
  268. data/.claude/hooks/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
  269. data/.claude/hooks/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
  270. data/.claude/hooks/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
  271. data/.claude/hooks/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  272. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  273. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
  274. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  275. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  276. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  277. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
  278. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
  279. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  280. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  281. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  282. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
  283. data/.claude/hooks/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
  284. data/.claude/hooks/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  285. data/.claude/hooks/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  286. data/.claude/hooks/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
  287. data/.claude/hooks/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  288. data/.claude/hooks/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
  289. data/.claude/hooks/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  290. data/.claude/hooks/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  291. data/.claude/hooks/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  292. data/.claude/hooks/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  293. data/.claude/hooks/node_modules/typescript/lib/tsc.js +8 -0
  294. data/.claude/hooks/node_modules/typescript/lib/tsserver.js +8 -0
  295. data/.claude/hooks/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  296. data/.claude/hooks/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  297. data/.claude/hooks/node_modules/typescript/lib/typesMap.json +497 -0
  298. data/.claude/hooks/node_modules/typescript/lib/typescript.d.ts +11437 -0
  299. data/.claude/hooks/node_modules/typescript/lib/typescript.js +200276 -0
  300. data/.claude/hooks/node_modules/typescript/lib/typingsInstaller.js +8 -0
  301. data/.claude/hooks/node_modules/typescript/lib/watchGuard.js +53 -0
  302. data/.claude/hooks/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  303. data/.claude/hooks/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  304. data/.claude/hooks/node_modules/typescript/package.json +120 -0
  305. data/.claude/hooks/node_modules/undici-types/LICENSE +21 -0
  306. data/.claude/hooks/node_modules/undici-types/README.md +6 -0
  307. data/.claude/hooks/node_modules/undici-types/agent.d.ts +32 -0
  308. data/.claude/hooks/node_modules/undici-types/api.d.ts +43 -0
  309. data/.claude/hooks/node_modules/undici-types/balanced-pool.d.ts +29 -0
  310. data/.claude/hooks/node_modules/undici-types/cache-interceptor.d.ts +172 -0
  311. data/.claude/hooks/node_modules/undici-types/cache.d.ts +36 -0
  312. data/.claude/hooks/node_modules/undici-types/client-stats.d.ts +15 -0
  313. data/.claude/hooks/node_modules/undici-types/client.d.ts +108 -0
  314. data/.claude/hooks/node_modules/undici-types/connector.d.ts +34 -0
  315. data/.claude/hooks/node_modules/undici-types/content-type.d.ts +21 -0
  316. data/.claude/hooks/node_modules/undici-types/cookies.d.ts +30 -0
  317. data/.claude/hooks/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  318. data/.claude/hooks/node_modules/undici-types/dispatcher.d.ts +276 -0
  319. data/.claude/hooks/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  320. data/.claude/hooks/node_modules/undici-types/errors.d.ts +161 -0
  321. data/.claude/hooks/node_modules/undici-types/eventsource.d.ts +66 -0
  322. data/.claude/hooks/node_modules/undici-types/fetch.d.ts +211 -0
  323. data/.claude/hooks/node_modules/undici-types/formdata.d.ts +108 -0
  324. data/.claude/hooks/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  325. data/.claude/hooks/node_modules/undici-types/global-origin.d.ts +7 -0
  326. data/.claude/hooks/node_modules/undici-types/h2c-client.d.ts +73 -0
  327. data/.claude/hooks/node_modules/undici-types/handlers.d.ts +15 -0
  328. data/.claude/hooks/node_modules/undici-types/header.d.ts +160 -0
  329. data/.claude/hooks/node_modules/undici-types/index.d.ts +80 -0
  330. data/.claude/hooks/node_modules/undici-types/interceptors.d.ts +39 -0
  331. data/.claude/hooks/node_modules/undici-types/mock-agent.d.ts +68 -0
  332. data/.claude/hooks/node_modules/undici-types/mock-call-history.d.ts +111 -0
  333. data/.claude/hooks/node_modules/undici-types/mock-client.d.ts +27 -0
  334. data/.claude/hooks/node_modules/undici-types/mock-errors.d.ts +12 -0
  335. data/.claude/hooks/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  336. data/.claude/hooks/node_modules/undici-types/mock-pool.d.ts +27 -0
  337. data/.claude/hooks/node_modules/undici-types/package.json +55 -0
  338. data/.claude/hooks/node_modules/undici-types/patch.d.ts +29 -0
  339. data/.claude/hooks/node_modules/undici-types/pool-stats.d.ts +19 -0
  340. data/.claude/hooks/node_modules/undici-types/pool.d.ts +41 -0
  341. data/.claude/hooks/node_modules/undici-types/proxy-agent.d.ts +29 -0
  342. data/.claude/hooks/node_modules/undici-types/readable.d.ts +68 -0
  343. data/.claude/hooks/node_modules/undici-types/retry-agent.d.ts +8 -0
  344. data/.claude/hooks/node_modules/undici-types/retry-handler.d.ts +125 -0
  345. data/.claude/hooks/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  346. data/.claude/hooks/node_modules/undici-types/util.d.ts +18 -0
  347. data/.claude/hooks/node_modules/undici-types/utility.d.ts +7 -0
  348. data/.claude/hooks/node_modules/undici-types/webidl.d.ts +341 -0
  349. data/.claude/hooks/node_modules/undici-types/websocket.d.ts +186 -0
  350. data/.claude/hooks/package-lock.json +562 -0
  351. data/.claude/hooks/package.json +19 -0
  352. data/.claude/hooks/skill-activation-prompt.sh +11 -0
  353. data/.claude/hooks/skill-activation-prompt.ts +185 -0
  354. data/.claude/hooks/tsconfig.json +12 -0
  355. data/.claude/settings.json +33 -0
  356. data/.claude/skills/README.md +29 -0
  357. data/.claude/skills/ruby-gem-development/SKILL.md +293 -0
  358. data/.claude/skills/skill-rules.json +117 -0
  359. data/.claude/skills/thor-cli-development/SKILL.md +431 -0
  360. data/CHANGELOG.md +7 -0
  361. data/Gemfile.lock +3 -1
  362. data/completions/{_aictl → _langop} +37 -37
  363. data/completions/{aictl.bash → langop.bash} +16 -16
  364. data/completions/langop.fish +114 -0
  365. data/components/agent/Gemfile +1 -1
  366. data/components/tool/Gemfile +1 -1
  367. data/docs/README.md +10 -10
  368. data/docs/agent-internals.md +1 -1
  369. data/docs/cheat-sheet.md +76 -76
  370. data/docs/cli-reference.md +71 -71
  371. data/docs/how-agents-work.md +1 -1
  372. data/docs/installation.md +30 -30
  373. data/docs/quickstart.md +30 -30
  374. data/docs/using-tools.md +11 -11
  375. data/docs/webhooks.md +6 -6
  376. data/examples/ux_helpers_demo.rb +4 -4
  377. data/lib/language_operator/agent/task_executor.rb +0 -37
  378. data/lib/language_operator/agent/web_server.rb +311 -323
  379. data/lib/language_operator/cli/commands/agent/base.rb +16 -15
  380. data/lib/language_operator/cli/commands/agent/code_operations.rb +6 -6
  381. data/lib/language_operator/cli/commands/agent/helpers/synthesis_watcher.rb +1 -1
  382. data/lib/language_operator/cli/commands/agent/lifecycle.rb +2 -2
  383. data/lib/language_operator/cli/commands/agent/logs.rb +2 -2
  384. data/lib/language_operator/cli/commands/agent/workspace.rb +8 -8
  385. data/lib/language_operator/cli/commands/cluster.rb +172 -158
  386. data/lib/language_operator/cli/commands/install.rb +878 -81
  387. data/lib/language_operator/cli/commands/model/base.rb +7 -6
  388. data/lib/language_operator/cli/commands/organization.rb +61 -0
  389. data/lib/language_operator/cli/commands/persona.rb +10 -8
  390. data/lib/language_operator/cli/commands/status.rb +83 -13
  391. data/lib/language_operator/cli/commands/system/exec.rb +10 -10
  392. data/lib/language_operator/cli/commands/system/schema.rb +6 -6
  393. data/lib/language_operator/cli/commands/system/synthesis_template.rb +6 -6
  394. data/lib/language_operator/cli/commands/system/synthesize.rb +14 -14
  395. data/lib/language_operator/cli/commands/system/validate_template.rb +4 -4
  396. data/lib/language_operator/cli/commands/tool/base.rb +1 -1
  397. data/lib/language_operator/cli/commands/tool/install.rb +2 -2
  398. data/lib/language_operator/cli/commands/tool/search.rb +3 -3
  399. data/lib/language_operator/cli/commands/ui.rb +173 -0
  400. data/lib/language_operator/cli/commands/use.rb +80 -9
  401. data/lib/language_operator/cli/errors/suggestions.rb +21 -21
  402. data/lib/language_operator/cli/formatters/progress_formatter.rb +2 -1
  403. data/lib/language_operator/cli/formatters/table_formatter.rb +21 -1
  404. data/lib/language_operator/cli/helpers/cluster_validator.rb +2 -2
  405. data/lib/language_operator/cli/helpers/health_checker.rb +263 -0
  406. data/lib/language_operator/cli/helpers/kubeconfig_validator.rb +3 -3
  407. data/lib/language_operator/cli/helpers/ux_helper.rb +4 -3
  408. data/lib/language_operator/cli/main.rb +30 -21
  409. data/lib/language_operator/cli/wizards/model_wizard.rb +7 -5
  410. data/lib/language_operator/config/cluster_config.rb +3 -3
  411. data/lib/language_operator/constants/kubernetes_labels.rb +1 -1
  412. data/lib/language_operator/kubernetes/client.rb +53 -109
  413. data/lib/language_operator/kubernetes/resource_builder.rb +46 -14
  414. data/lib/language_operator/templates/schema/agent_dsl_openapi.yaml +1 -1
  415. data/lib/language_operator/templates/schema/agent_dsl_schema.json +1 -1
  416. data/lib/language_operator/utils/org_context.rb +100 -0
  417. data/lib/language_operator/version.rb +1 -1
  418. data/synth/001/Makefile +1 -1
  419. data/synth/002/Makefile +1 -1
  420. data/synth/003/Makefile +1 -1
  421. data/synth/004/Makefile +1 -1
  422. metadata +384 -11
  423. data/completions/aictl.fish +0 -114
  424. data/lib/language_operator/agent/event_config.rb +0 -172
  425. data/lib/language_operator/cli/commands/quickstart.rb +0 -22
  426. data/lib/language_operator/cli/wizards/quickstart_wizard.rb +0 -561
  427. /data/bin/{aictl → langop} +0 -0
@@ -0,0 +1,1054 @@
1
+ /**
2
+ * Much of the Node.js core API is built around an idiomatic asynchronous
3
+ * event-driven architecture in which certain kinds of objects (called "emitters")
4
+ * emit named events that cause `Function` objects ("listeners") to be called.
5
+ *
6
+ * For instance: a `net.Server` object emits an event each time a peer
7
+ * connects to it; a `fs.ReadStream` emits an event when the file is opened;
8
+ * a `stream` emits an event whenever data is available to be read.
9
+ *
10
+ * All objects that emit events are instances of the `EventEmitter` class. These
11
+ * objects expose an `eventEmitter.on()` function that allows one or more
12
+ * functions to be attached to named events emitted by the object. Typically,
13
+ * event names are camel-cased strings but any valid JavaScript property key
14
+ * can be used.
15
+ *
16
+ * When the `EventEmitter` object emits an event, all of the functions attached
17
+ * to that specific event are called _synchronously_. Any values returned by the
18
+ * called listeners are _ignored_ and discarded.
19
+ *
20
+ * The following example shows a simple `EventEmitter` instance with a single
21
+ * listener. The `eventEmitter.on()` method is used to register listeners, while
22
+ * the `eventEmitter.emit()` method is used to trigger the event.
23
+ *
24
+ * ```js
25
+ * import { EventEmitter } from 'node:events';
26
+ *
27
+ * class MyEmitter extends EventEmitter {}
28
+ *
29
+ * const myEmitter = new MyEmitter();
30
+ * myEmitter.on('event', () => {
31
+ * console.log('an event occurred!');
32
+ * });
33
+ * myEmitter.emit('event');
34
+ * ```
35
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/events.js)
36
+ */
37
+ declare module "node:events" {
38
+ import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
39
+ // #region Event map helpers
40
+ type EventMap<T> = Record<keyof T, any[]>;
41
+ type IfEventMap<Events extends EventMap<Events>, True, False> = {} extends Events ? False : True;
42
+ type Args<Events extends EventMap<Events>, EventName extends string | symbol> = IfEventMap<
43
+ Events,
44
+ EventName extends keyof Events ? Events[EventName]
45
+ : EventName extends keyof EventEmitterEventMap ? EventEmitterEventMap[EventName]
46
+ : any[],
47
+ any[]
48
+ >;
49
+ type EventNames<Events extends EventMap<Events>, EventName extends string | symbol> = IfEventMap<
50
+ Events,
51
+ EventName | (keyof Events & (string | symbol)) | keyof EventEmitterEventMap,
52
+ string | symbol
53
+ >;
54
+ type Listener<Events extends EventMap<Events>, EventName extends string | symbol> = IfEventMap<
55
+ Events,
56
+ (
57
+ ...args: EventName extends keyof Events ? Events[EventName]
58
+ : EventName extends keyof EventEmitterEventMap ? EventEmitterEventMap[EventName]
59
+ : any[]
60
+ ) => void,
61
+ (...args: any[]) => void
62
+ >;
63
+ interface EventEmitterEventMap {
64
+ newListener: [eventName: string | symbol, listener: (...args: any[]) => void];
65
+ removeListener: [eventName: string | symbol, listener: (...args: any[]) => void];
66
+ }
67
+ // #endregion
68
+ interface EventEmitterOptions {
69
+ /**
70
+ * It enables
71
+ * [automatic capturing of promise rejection](https://nodejs.org/docs/latest-v25.x/api/events.html#capture-rejections-of-promises).
72
+ * @default false
73
+ */
74
+ captureRejections?: boolean | undefined;
75
+ }
76
+ /**
77
+ * The `EventEmitter` class is defined and exposed by the `node:events` module:
78
+ *
79
+ * ```js
80
+ * import { EventEmitter } from 'node:events';
81
+ * ```
82
+ *
83
+ * All `EventEmitter`s emit the event `'newListener'` when new listeners are
84
+ * added and `'removeListener'` when existing listeners are removed.
85
+ *
86
+ * It supports the following option:
87
+ * @since v0.1.26
88
+ */
89
+ class EventEmitter<T extends EventMap<T> = any> {
90
+ constructor(options?: EventEmitterOptions);
91
+ }
92
+ interface EventEmitter<T extends EventMap<T> = any> extends NodeJS.EventEmitter<T> {}
93
+ global {
94
+ namespace NodeJS {
95
+ interface EventEmitter<T extends EventMap<T> = any> {
96
+ /**
97
+ * The `Symbol.for('nodejs.rejection')` method is called in case a
98
+ * promise rejection happens when emitting an event and
99
+ * `captureRejections` is enabled on the emitter.
100
+ * It is possible to use `events.captureRejectionSymbol` in
101
+ * place of `Symbol.for('nodejs.rejection')`.
102
+ *
103
+ * ```js
104
+ * import { EventEmitter, captureRejectionSymbol } from 'node:events';
105
+ *
106
+ * class MyClass extends EventEmitter {
107
+ * constructor() {
108
+ * super({ captureRejections: true });
109
+ * }
110
+ *
111
+ * [captureRejectionSymbol](err, event, ...args) {
112
+ * console.log('rejection happened for', event, 'with', err, ...args);
113
+ * this.destroy(err);
114
+ * }
115
+ *
116
+ * destroy(err) {
117
+ * // Tear the resource down here.
118
+ * }
119
+ * }
120
+ * ```
121
+ * @since v13.4.0, v12.16.0
122
+ */
123
+ [EventEmitter.captureRejectionSymbol]?(error: Error, event: string | symbol, ...args: any[]): void;
124
+ /**
125
+ * Alias for `emitter.on(eventName, listener)`.
126
+ * @since v0.1.26
127
+ */
128
+ addListener<E extends string | symbol>(eventName: EventNames<T, E>, listener: Listener<T, E>): this;
129
+ /**
130
+ * Synchronously calls each of the listeners registered for the event named
131
+ * `eventName`, in the order they were registered, passing the supplied arguments
132
+ * to each.
133
+ *
134
+ * Returns `true` if the event had listeners, `false` otherwise.
135
+ *
136
+ * ```js
137
+ * import { EventEmitter } from 'node:events';
138
+ * const myEmitter = new EventEmitter();
139
+ *
140
+ * // First listener
141
+ * myEmitter.on('event', function firstListener() {
142
+ * console.log('Helloooo! first listener');
143
+ * });
144
+ * // Second listener
145
+ * myEmitter.on('event', function secondListener(arg1, arg2) {
146
+ * console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
147
+ * });
148
+ * // Third listener
149
+ * myEmitter.on('event', function thirdListener(...args) {
150
+ * const parameters = args.join(', ');
151
+ * console.log(`event with parameters ${parameters} in third listener`);
152
+ * });
153
+ *
154
+ * console.log(myEmitter.listeners('event'));
155
+ *
156
+ * myEmitter.emit('event', 1, 2, 3, 4, 5);
157
+ *
158
+ * // Prints:
159
+ * // [
160
+ * // [Function: firstListener],
161
+ * // [Function: secondListener],
162
+ * // [Function: thirdListener]
163
+ * // ]
164
+ * // Helloooo! first listener
165
+ * // event with parameters 1, 2 in second listener
166
+ * // event with parameters 1, 2, 3, 4, 5 in third listener
167
+ * ```
168
+ * @since v0.1.26
169
+ */
170
+ emit<E extends string | symbol>(eventName: EventNames<T, E>, ...args: Args<T, E>): boolean;
171
+ /**
172
+ * Returns an array listing the events for which the emitter has registered
173
+ * listeners.
174
+ *
175
+ * ```js
176
+ * import { EventEmitter } from 'node:events';
177
+ *
178
+ * const myEE = new EventEmitter();
179
+ * myEE.on('foo', () => {});
180
+ * myEE.on('bar', () => {});
181
+ *
182
+ * const sym = Symbol('symbol');
183
+ * myEE.on(sym, () => {});
184
+ *
185
+ * console.log(myEE.eventNames());
186
+ * // Prints: [ 'foo', 'bar', Symbol(symbol) ]
187
+ * ```
188
+ * @since v6.0.0
189
+ */
190
+ eventNames(): (string | symbol)[];
191
+ /**
192
+ * Returns the current max listener value for the `EventEmitter` which is either
193
+ * set by `emitter.setMaxListeners(n)` or defaults to
194
+ * `events.defaultMaxListeners`.
195
+ * @since v1.0.0
196
+ */
197
+ getMaxListeners(): number;
198
+ /**
199
+ * Returns the number of listeners listening for the event named `eventName`.
200
+ * If `listener` is provided, it will return how many times the listener is found
201
+ * in the list of the listeners of the event.
202
+ * @since v3.2.0
203
+ * @param eventName The name of the event being listened for
204
+ * @param listener The event handler function
205
+ */
206
+ listenerCount<E extends string | symbol>(
207
+ eventName: EventNames<T, E>,
208
+ listener?: Listener<T, E>,
209
+ ): number;
210
+ /**
211
+ * Returns a copy of the array of listeners for the event named `eventName`.
212
+ *
213
+ * ```js
214
+ * server.on('connection', (stream) => {
215
+ * console.log('someone connected!');
216
+ * });
217
+ * console.log(util.inspect(server.listeners('connection')));
218
+ * // Prints: [ [Function] ]
219
+ * ```
220
+ * @since v0.1.26
221
+ */
222
+ listeners<E extends string | symbol>(eventName: EventNames<T, E>): Listener<T, E>[];
223
+ /**
224
+ * Alias for `emitter.removeListener()`.
225
+ * @since v10.0.0
226
+ */
227
+ off<E extends string | symbol>(eventName: EventNames<T, E>, listener: Listener<T, E>): this;
228
+ /**
229
+ * Adds the `listener` function to the end of the listeners array for the
230
+ * event named `eventName`. No checks are made to see if the `listener` has
231
+ * already been added. Multiple calls passing the same combination of `eventName`
232
+ * and `listener` will result in the `listener` being added, and called, multiple
233
+ * times.
234
+ *
235
+ * ```js
236
+ * server.on('connection', (stream) => {
237
+ * console.log('someone connected!');
238
+ * });
239
+ * ```
240
+ *
241
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
242
+ *
243
+ * By default, event listeners are invoked in the order they are added. The
244
+ * `emitter.prependListener()` method can be used as an alternative to add the
245
+ * event listener to the beginning of the listeners array.
246
+ *
247
+ * ```js
248
+ * import { EventEmitter } from 'node:events';
249
+ * const myEE = new EventEmitter();
250
+ * myEE.on('foo', () => console.log('a'));
251
+ * myEE.prependListener('foo', () => console.log('b'));
252
+ * myEE.emit('foo');
253
+ * // Prints:
254
+ * // b
255
+ * // a
256
+ * ```
257
+ * @since v0.1.101
258
+ * @param eventName The name of the event.
259
+ * @param listener The callback function
260
+ */
261
+ on<E extends string | symbol>(eventName: EventNames<T, E>, listener: Listener<T, E>): this;
262
+ /**
263
+ * Adds a **one-time** `listener` function for the event named `eventName`. The
264
+ * next time `eventName` is triggered, this listener is removed and then invoked.
265
+ *
266
+ * ```js
267
+ * server.once('connection', (stream) => {
268
+ * console.log('Ah, we have our first user!');
269
+ * });
270
+ * ```
271
+ *
272
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
273
+ *
274
+ * By default, event listeners are invoked in the order they are added. The
275
+ * `emitter.prependOnceListener()` method can be used as an alternative to add the
276
+ * event listener to the beginning of the listeners array.
277
+ *
278
+ * ```js
279
+ * import { EventEmitter } from 'node:events';
280
+ * const myEE = new EventEmitter();
281
+ * myEE.once('foo', () => console.log('a'));
282
+ * myEE.prependOnceListener('foo', () => console.log('b'));
283
+ * myEE.emit('foo');
284
+ * // Prints:
285
+ * // b
286
+ * // a
287
+ * ```
288
+ * @since v0.3.0
289
+ * @param eventName The name of the event.
290
+ * @param listener The callback function
291
+ */
292
+ once<E extends string | symbol>(eventName: EventNames<T, E>, listener: Listener<T, E>): this;
293
+ /**
294
+ * Adds the `listener` function to the _beginning_ of the listeners array for the
295
+ * event named `eventName`. No checks are made to see if the `listener` has
296
+ * already been added. Multiple calls passing the same combination of `eventName`
297
+ * and `listener` will result in the `listener` being added, and called, multiple
298
+ * times.
299
+ *
300
+ * ```js
301
+ * server.prependListener('connection', (stream) => {
302
+ * console.log('someone connected!');
303
+ * });
304
+ * ```
305
+ *
306
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
307
+ * @since v6.0.0
308
+ * @param eventName The name of the event.
309
+ * @param listener The callback function
310
+ */
311
+ prependListener<E extends string | symbol>(eventName: EventNames<T, E>, listener: Listener<T, E>): this;
312
+ /**
313
+ * Adds a **one-time** `listener` function for the event named `eventName` to the
314
+ * _beginning_ of the listeners array. The next time `eventName` is triggered, this
315
+ * listener is removed, and then invoked.
316
+ *
317
+ * ```js
318
+ * server.prependOnceListener('connection', (stream) => {
319
+ * console.log('Ah, we have our first user!');
320
+ * });
321
+ * ```
322
+ *
323
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
324
+ * @since v6.0.0
325
+ * @param eventName The name of the event.
326
+ * @param listener The callback function
327
+ */
328
+ prependOnceListener<E extends string | symbol>(
329
+ eventName: EventNames<T, E>,
330
+ listener: Listener<T, E>,
331
+ ): this;
332
+ /**
333
+ * Returns a copy of the array of listeners for the event named `eventName`,
334
+ * including any wrappers (such as those created by `.once()`).
335
+ *
336
+ * ```js
337
+ * import { EventEmitter } from 'node:events';
338
+ * const emitter = new EventEmitter();
339
+ * emitter.once('log', () => console.log('log once'));
340
+ *
341
+ * // Returns a new Array with a function `onceWrapper` which has a property
342
+ * // `listener` which contains the original listener bound above
343
+ * const listeners = emitter.rawListeners('log');
344
+ * const logFnWrapper = listeners[0];
345
+ *
346
+ * // Logs "log once" to the console and does not unbind the `once` event
347
+ * logFnWrapper.listener();
348
+ *
349
+ * // Logs "log once" to the console and removes the listener
350
+ * logFnWrapper();
351
+ *
352
+ * emitter.on('log', () => console.log('log persistently'));
353
+ * // Will return a new Array with a single function bound by `.on()` above
354
+ * const newListeners = emitter.rawListeners('log');
355
+ *
356
+ * // Logs "log persistently" twice
357
+ * newListeners[0]();
358
+ * emitter.emit('log');
359
+ * ```
360
+ * @since v9.4.0
361
+ */
362
+ rawListeners<E extends string | symbol>(eventName: EventNames<T, E>): Listener<T, E>[];
363
+ /**
364
+ * Removes all listeners, or those of the specified `eventName`.
365
+ *
366
+ * It is bad practice to remove listeners added elsewhere in the code,
367
+ * particularly when the `EventEmitter` instance was created by some other
368
+ * component or module (e.g. sockets or file streams).
369
+ *
370
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
371
+ * @since v0.1.26
372
+ */
373
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
374
+ removeAllListeners<E extends string | symbol>(eventName?: EventNames<T, E>): this;
375
+ /**
376
+ * Removes the specified `listener` from the listener array for the event named
377
+ * `eventName`.
378
+ *
379
+ * ```js
380
+ * const callback = (stream) => {
381
+ * console.log('someone connected!');
382
+ * };
383
+ * server.on('connection', callback);
384
+ * // ...
385
+ * server.removeListener('connection', callback);
386
+ * ```
387
+ *
388
+ * `removeListener()` will remove, at most, one instance of a listener from the
389
+ * listener array. If any single listener has been added multiple times to the
390
+ * listener array for the specified `eventName`, then `removeListener()` must be
391
+ * called multiple times to remove each instance.
392
+ *
393
+ * Once an event is emitted, all listeners attached to it at the
394
+ * time of emitting are called in order. This implies that any
395
+ * `removeListener()` or `removeAllListeners()` calls _after_ emitting and
396
+ * _before_ the last listener finishes execution will not remove them from
397
+ * `emit()` in progress. Subsequent events behave as expected.
398
+ *
399
+ * ```js
400
+ * import { EventEmitter } from 'node:events';
401
+ * class MyEmitter extends EventEmitter {}
402
+ * const myEmitter = new MyEmitter();
403
+ *
404
+ * const callbackA = () => {
405
+ * console.log('A');
406
+ * myEmitter.removeListener('event', callbackB);
407
+ * };
408
+ *
409
+ * const callbackB = () => {
410
+ * console.log('B');
411
+ * };
412
+ *
413
+ * myEmitter.on('event', callbackA);
414
+ *
415
+ * myEmitter.on('event', callbackB);
416
+ *
417
+ * // callbackA removes listener callbackB but it will still be called.
418
+ * // Internal listener array at time of emit [callbackA, callbackB]
419
+ * myEmitter.emit('event');
420
+ * // Prints:
421
+ * // A
422
+ * // B
423
+ *
424
+ * // callbackB is now removed.
425
+ * // Internal listener array [callbackA]
426
+ * myEmitter.emit('event');
427
+ * // Prints:
428
+ * // A
429
+ * ```
430
+ *
431
+ * Because listeners are managed using an internal array, calling this will
432
+ * change the position indexes of any listener registered _after_ the listener
433
+ * being removed. This will not impact the order in which listeners are called,
434
+ * but it means that any copies of the listener array as returned by
435
+ * the `emitter.listeners()` method will need to be recreated.
436
+ *
437
+ * When a single function has been added as a handler multiple times for a single
438
+ * event (as in the example below), `removeListener()` will remove the most
439
+ * recently added instance. In the example the `once('ping')`
440
+ * listener is removed:
441
+ *
442
+ * ```js
443
+ * import { EventEmitter } from 'node:events';
444
+ * const ee = new EventEmitter();
445
+ *
446
+ * function pong() {
447
+ * console.log('pong');
448
+ * }
449
+ *
450
+ * ee.on('ping', pong);
451
+ * ee.once('ping', pong);
452
+ * ee.removeListener('ping', pong);
453
+ *
454
+ * ee.emit('ping');
455
+ * ee.emit('ping');
456
+ * ```
457
+ *
458
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
459
+ * @since v0.1.26
460
+ */
461
+ removeListener<E extends string | symbol>(eventName: EventNames<T, E>, listener: Listener<T, E>): this;
462
+ /**
463
+ * By default `EventEmitter`s will print a warning if more than `10` listeners are
464
+ * added for a particular event. This is a useful default that helps finding
465
+ * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be
466
+ * modified for this specific `EventEmitter` instance. The value can be set to
467
+ * `Infinity` (or `0`) to indicate an unlimited number of listeners.
468
+ *
469
+ * Returns a reference to the `EventEmitter`, so that calls can be chained.
470
+ * @since v0.3.5
471
+ */
472
+ setMaxListeners(n: number): this;
473
+ }
474
+ }
475
+ }
476
+ namespace EventEmitter {
477
+ export { EventEmitter, EventEmitterEventMap, EventEmitterOptions };
478
+ }
479
+ namespace EventEmitter {
480
+ interface Abortable {
481
+ signal?: AbortSignal | undefined;
482
+ }
483
+ /**
484
+ * See how to write a custom [rejection handler](https://nodejs.org/docs/latest-v25.x/api/events.html#emittersymbolfornodejsrejectionerr-eventname-args).
485
+ * @since v13.4.0, v12.16.0
486
+ */
487
+ const captureRejectionSymbol: unique symbol;
488
+ /**
489
+ * Change the default `captureRejections` option on all new `EventEmitter` objects.
490
+ * @since v13.4.0, v12.16.0
491
+ */
492
+ let captureRejections: boolean;
493
+ /**
494
+ * By default, a maximum of `10` listeners can be registered for any single
495
+ * event. This limit can be changed for individual `EventEmitter` instances
496
+ * using the `emitter.setMaxListeners(n)` method. To change the default
497
+ * for _all_ `EventEmitter` instances, the `events.defaultMaxListeners`
498
+ * property can be used. If this value is not a positive number, a `RangeError`
499
+ * is thrown.
500
+ *
501
+ * Take caution when setting the `events.defaultMaxListeners` because the
502
+ * change affects _all_ `EventEmitter` instances, including those created before
503
+ * the change is made. However, calling `emitter.setMaxListeners(n)` still has
504
+ * precedence over `events.defaultMaxListeners`.
505
+ *
506
+ * This is not a hard limit. The `EventEmitter` instance will allow
507
+ * more listeners to be added but will output a trace warning to stderr indicating
508
+ * that a "possible EventEmitter memory leak" has been detected. For any single
509
+ * `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`
510
+ * methods can be used to temporarily avoid this warning:
511
+ *
512
+ * `defaultMaxListeners` has no effect on `AbortSignal` instances. While it is
513
+ * still possible to use `emitter.setMaxListeners(n)` to set a warning limit
514
+ * for individual `AbortSignal` instances, per default `AbortSignal` instances will not warn.
515
+ *
516
+ * ```js
517
+ * import { EventEmitter } from 'node:events';
518
+ * const emitter = new EventEmitter();
519
+ * emitter.setMaxListeners(emitter.getMaxListeners() + 1);
520
+ * emitter.once('event', () => {
521
+ * // do stuff
522
+ * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
523
+ * });
524
+ * ```
525
+ *
526
+ * The `--trace-warnings` command-line flag can be used to display the
527
+ * stack trace for such warnings.
528
+ *
529
+ * The emitted warning can be inspected with `process.on('warning')` and will
530
+ * have the additional `emitter`, `type`, and `count` properties, referring to
531
+ * the event emitter instance, the event's name and the number of attached
532
+ * listeners, respectively.
533
+ * Its `name` property is set to `'MaxListenersExceededWarning'`.
534
+ * @since v0.11.2
535
+ */
536
+ let defaultMaxListeners: number;
537
+ /**
538
+ * This symbol shall be used to install a listener for only monitoring `'error'`
539
+ * events. Listeners installed using this symbol are called before the regular
540
+ * `'error'` listeners are called.
541
+ *
542
+ * Installing a listener using this symbol does not change the behavior once an
543
+ * `'error'` event is emitted. Therefore, the process will still crash if no
544
+ * regular `'error'` listener is installed.
545
+ * @since v13.6.0, v12.17.0
546
+ */
547
+ const errorMonitor: unique symbol;
548
+ /**
549
+ * Listens once to the `abort` event on the provided `signal`.
550
+ *
551
+ * Listening to the `abort` event on abort signals is unsafe and may
552
+ * lead to resource leaks since another third party with the signal can
553
+ * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change
554
+ * this since it would violate the web standard. Additionally, the original
555
+ * API makes it easy to forget to remove listeners.
556
+ *
557
+ * This API allows safely using `AbortSignal`s in Node.js APIs by solving these
558
+ * two issues by listening to the event such that `stopImmediatePropagation` does
559
+ * not prevent the listener from running.
560
+ *
561
+ * Returns a disposable so that it may be unsubscribed from more easily.
562
+ *
563
+ * ```js
564
+ * import { addAbortListener } from 'node:events';
565
+ *
566
+ * function example(signal) {
567
+ * let disposable;
568
+ * try {
569
+ * signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
570
+ * disposable = addAbortListener(signal, (e) => {
571
+ * // Do something when signal is aborted.
572
+ * });
573
+ * } finally {
574
+ * disposable?.[Symbol.dispose]();
575
+ * }
576
+ * }
577
+ * ```
578
+ * @since v20.5.0
579
+ * @return Disposable that removes the `abort` listener.
580
+ */
581
+ function addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
582
+ /**
583
+ * Returns a copy of the array of listeners for the event named `eventName`.
584
+ *
585
+ * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on
586
+ * the emitter.
587
+ *
588
+ * For `EventTarget`s this is the only way to get the event listeners for the
589
+ * event target. This is useful for debugging and diagnostic purposes.
590
+ *
591
+ * ```js
592
+ * import { getEventListeners, EventEmitter } from 'node:events';
593
+ *
594
+ * {
595
+ * const ee = new EventEmitter();
596
+ * const listener = () => console.log('Events are fun');
597
+ * ee.on('foo', listener);
598
+ * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
599
+ * }
600
+ * {
601
+ * const et = new EventTarget();
602
+ * const listener = () => console.log('Events are fun');
603
+ * et.addEventListener('foo', listener);
604
+ * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
605
+ * }
606
+ * ```
607
+ * @since v15.2.0, v14.17.0
608
+ */
609
+ function getEventListeners(emitter: EventEmitter, name: string | symbol): ((...args: any[]) => void)[];
610
+ function getEventListeners(emitter: EventTarget, name: string): ((...args: any[]) => void)[];
611
+ /**
612
+ * Returns the currently set max amount of listeners.
613
+ *
614
+ * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on
615
+ * the emitter.
616
+ *
617
+ * For `EventTarget`s this is the only way to get the max event listeners for the
618
+ * event target. If the number of event handlers on a single EventTarget exceeds
619
+ * the max set, the EventTarget will print a warning.
620
+ *
621
+ * ```js
622
+ * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';
623
+ *
624
+ * {
625
+ * const ee = new EventEmitter();
626
+ * console.log(getMaxListeners(ee)); // 10
627
+ * setMaxListeners(11, ee);
628
+ * console.log(getMaxListeners(ee)); // 11
629
+ * }
630
+ * {
631
+ * const et = new EventTarget();
632
+ * console.log(getMaxListeners(et)); // 10
633
+ * setMaxListeners(11, et);
634
+ * console.log(getMaxListeners(et)); // 11
635
+ * }
636
+ * ```
637
+ * @since v19.9.0
638
+ */
639
+ function getMaxListeners(emitter: EventEmitter | EventTarget): number;
640
+ /**
641
+ * A class method that returns the number of listeners for the given `eventName`
642
+ * registered on the given `emitter`.
643
+ *
644
+ * ```js
645
+ * import { EventEmitter, listenerCount } from 'node:events';
646
+ *
647
+ * const myEmitter = new EventEmitter();
648
+ * myEmitter.on('event', () => {});
649
+ * myEmitter.on('event', () => {});
650
+ * console.log(listenerCount(myEmitter, 'event'));
651
+ * // Prints: 2
652
+ * ```
653
+ * @since v0.9.12
654
+ * @deprecated Use `emitter.listenerCount()` instead.
655
+ * @param emitter The emitter to query
656
+ * @param eventName The event name
657
+ */
658
+ function listenerCount(emitter: EventEmitter, eventName: string | symbol): number;
659
+ interface OnOptions extends Abortable {
660
+ /**
661
+ * Names of events that will end the iteration.
662
+ */
663
+ close?: readonly string[] | undefined;
664
+ /**
665
+ * The high watermark. The emitter is paused every time the size of events
666
+ * being buffered is higher than it. Supported only on emitters implementing
667
+ * `pause()` and `resume()` methods.
668
+ * @default Number.MAX_SAFE_INTEGER
669
+ */
670
+ highWaterMark?: number | undefined;
671
+ /**
672
+ * The low watermark. The emitter is resumed every time the size of events
673
+ * being buffered is lower than it. Supported only on emitters implementing
674
+ * `pause()` and `resume()` methods.
675
+ * @default 1
676
+ */
677
+ lowWaterMark?: number | undefined;
678
+ }
679
+ /**
680
+ * ```js
681
+ * import { on, EventEmitter } from 'node:events';
682
+ * import process from 'node:process';
683
+ *
684
+ * const ee = new EventEmitter();
685
+ *
686
+ * // Emit later on
687
+ * process.nextTick(() => {
688
+ * ee.emit('foo', 'bar');
689
+ * ee.emit('foo', 42);
690
+ * });
691
+ *
692
+ * for await (const event of on(ee, 'foo')) {
693
+ * // The execution of this inner block is synchronous and it
694
+ * // processes one event at a time (even with await). Do not use
695
+ * // if concurrent execution is required.
696
+ * console.log(event); // prints ['bar'] [42]
697
+ * }
698
+ * // Unreachable here
699
+ * ```
700
+ *
701
+ * Returns an `AsyncIterator` that iterates `eventName` events. It will throw
702
+ * if the `EventEmitter` emits `'error'`. It removes all listeners when
703
+ * exiting the loop. The `value` returned by each iteration is an array
704
+ * composed of the emitted event arguments.
705
+ *
706
+ * An `AbortSignal` can be used to cancel waiting on events:
707
+ *
708
+ * ```js
709
+ * import { on, EventEmitter } from 'node:events';
710
+ * import process from 'node:process';
711
+ *
712
+ * const ac = new AbortController();
713
+ *
714
+ * (async () => {
715
+ * const ee = new EventEmitter();
716
+ *
717
+ * // Emit later on
718
+ * process.nextTick(() => {
719
+ * ee.emit('foo', 'bar');
720
+ * ee.emit('foo', 42);
721
+ * });
722
+ *
723
+ * for await (const event of on(ee, 'foo', { signal: ac.signal })) {
724
+ * // The execution of this inner block is synchronous and it
725
+ * // processes one event at a time (even with await). Do not use
726
+ * // if concurrent execution is required.
727
+ * console.log(event); // prints ['bar'] [42]
728
+ * }
729
+ * // Unreachable here
730
+ * })();
731
+ *
732
+ * process.nextTick(() => ac.abort());
733
+ * ```
734
+ * @since v13.6.0, v12.16.0
735
+ * @returns `AsyncIterator` that iterates `eventName` events emitted by the `emitter`
736
+ */
737
+ function on(
738
+ emitter: EventEmitter,
739
+ eventName: string | symbol,
740
+ options?: OnOptions,
741
+ ): NodeJS.AsyncIterator<any[]>;
742
+ function on(
743
+ emitter: EventTarget,
744
+ eventName: string,
745
+ options?: OnOptions,
746
+ ): NodeJS.AsyncIterator<any[]>;
747
+ interface OnceOptions extends Abortable {}
748
+ /**
749
+ * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
750
+ * event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
751
+ * The `Promise` will resolve with an array of all the arguments emitted to the
752
+ * given event.
753
+ *
754
+ * This method is intentionally generic and works with the web platform
755
+ * [EventTarget][WHATWG-EventTarget] interface, which has no special
756
+ * `'error'` event semantics and does not listen to the `'error'` event.
757
+ *
758
+ * ```js
759
+ * import { once, EventEmitter } from 'node:events';
760
+ * import process from 'node:process';
761
+ *
762
+ * const ee = new EventEmitter();
763
+ *
764
+ * process.nextTick(() => {
765
+ * ee.emit('myevent', 42);
766
+ * });
767
+ *
768
+ * const [value] = await once(ee, 'myevent');
769
+ * console.log(value);
770
+ *
771
+ * const err = new Error('kaboom');
772
+ * process.nextTick(() => {
773
+ * ee.emit('error', err);
774
+ * });
775
+ *
776
+ * try {
777
+ * await once(ee, 'myevent');
778
+ * } catch (err) {
779
+ * console.error('error happened', err);
780
+ * }
781
+ * ```
782
+ *
783
+ * The special handling of the `'error'` event is only used when `events.once()`
784
+ * is used to wait for another event. If `events.once()` is used to wait for the
785
+ * '`error'` event itself, then it is treated as any other kind of event without
786
+ * special handling:
787
+ *
788
+ * ```js
789
+ * import { EventEmitter, once } from 'node:events';
790
+ *
791
+ * const ee = new EventEmitter();
792
+ *
793
+ * once(ee, 'error')
794
+ * .then(([err]) => console.log('ok', err.message))
795
+ * .catch((err) => console.error('error', err.message));
796
+ *
797
+ * ee.emit('error', new Error('boom'));
798
+ *
799
+ * // Prints: ok boom
800
+ * ```
801
+ *
802
+ * An `AbortSignal` can be used to cancel waiting for the event:
803
+ *
804
+ * ```js
805
+ * import { EventEmitter, once } from 'node:events';
806
+ *
807
+ * const ee = new EventEmitter();
808
+ * const ac = new AbortController();
809
+ *
810
+ * async function foo(emitter, event, signal) {
811
+ * try {
812
+ * await once(emitter, event, { signal });
813
+ * console.log('event emitted!');
814
+ * } catch (error) {
815
+ * if (error.name === 'AbortError') {
816
+ * console.error('Waiting for the event was canceled!');
817
+ * } else {
818
+ * console.error('There was an error', error.message);
819
+ * }
820
+ * }
821
+ * }
822
+ *
823
+ * foo(ee, 'foo', ac.signal);
824
+ * ac.abort(); // Prints: Waiting for the event was canceled!
825
+ * ```
826
+ * @since v11.13.0, v10.16.0
827
+ */
828
+ function once(
829
+ emitter: EventEmitter,
830
+ eventName: string | symbol,
831
+ options?: OnceOptions,
832
+ ): Promise<any[]>;
833
+ function once(emitter: EventTarget, eventName: string, options?: OnceOptions): Promise<any[]>;
834
+ /**
835
+ * ```js
836
+ * import { setMaxListeners, EventEmitter } from 'node:events';
837
+ *
838
+ * const target = new EventTarget();
839
+ * const emitter = new EventEmitter();
840
+ *
841
+ * setMaxListeners(5, target, emitter);
842
+ * ```
843
+ * @since v15.4.0
844
+ * @param n A non-negative number. The maximum number of listeners per `EventTarget` event.
845
+ * @param eventTargets Zero or more `EventTarget`
846
+ * or `EventEmitter` instances. If none are specified, `n` is set as the default
847
+ * max for all newly created `EventTarget` and `EventEmitter` objects.
848
+ * objects.
849
+ */
850
+ function setMaxListeners(n: number, ...eventTargets: ReadonlyArray<EventEmitter | EventTarget>): void;
851
+ /**
852
+ * This is the interface from which event-emitting Node.js APIs inherit in the types package.
853
+ * **It is not intended for consumer use.**
854
+ *
855
+ * It provides event-mapped definitions similar to EventEmitter, except that its signatures
856
+ * are deliberately permissive: they provide type _hinting_, but not rigid type-checking,
857
+ * for compatibility reasons.
858
+ *
859
+ * Classes that inherit directly from EventEmitter in JavaScript can inherit directly from
860
+ * this interface in the type definitions. Classes that are more than one inheritance level
861
+ * away from EventEmitter (eg. `net.Socket` > `stream.Duplex` > `EventEmitter`) must instead
862
+ * copy these method definitions into the derived class. Search "#region InternalEventEmitter"
863
+ * for examples.
864
+ * @internal
865
+ */
866
+ interface InternalEventEmitter<T extends EventMap<T>> extends EventEmitter {
867
+ addListener<E extends keyof T>(eventName: E, listener: (...args: T[E]) => void): this;
868
+ addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
869
+ emit<E extends keyof T>(eventName: E, ...args: T[E]): boolean;
870
+ emit(eventName: string | symbol, ...args: any[]): boolean;
871
+ listenerCount<E extends keyof T>(eventName: E, listener?: (...args: T[E]) => void): number;
872
+ listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
873
+ listeners<E extends keyof T>(eventName: E): ((...args: T[E]) => void)[];
874
+ listeners(eventName: string | symbol): ((...args: any[]) => void)[];
875
+ off<E extends keyof T>(eventName: E, listener: (...args: T[E]) => void): this;
876
+ off(eventName: string | symbol, listener: (...args: any[]) => void): this;
877
+ on<E extends keyof T>(eventName: E, listener: (...args: T[E]) => void): this;
878
+ on(eventName: string | symbol, listener: (...args: any[]) => void): this;
879
+ once<E extends keyof T>(eventName: E, listener: (...args: T[E]) => void): this;
880
+ once(eventName: string | symbol, listener: (...args: any[]) => void): this;
881
+ prependListener<E extends keyof T>(eventName: E, listener: (...args: T[E]) => void): this;
882
+ prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
883
+ prependOnceListener<E extends keyof T>(eventName: E, listener: (...args: T[E]) => void): this;
884
+ prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
885
+ rawListeners<E extends keyof T>(eventName: E): ((...args: T[E]) => void)[];
886
+ rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
887
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
888
+ removeAllListeners<E extends keyof T>(eventName?: E): this;
889
+ removeAllListeners(eventName?: string | symbol): this;
890
+ removeListener<E extends keyof T>(eventName: E, listener: (...args: T[E]) => void): this;
891
+ removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
892
+ }
893
+ interface EventEmitterReferencingAsyncResource extends AsyncResource {
894
+ readonly eventEmitter: EventEmitterAsyncResource;
895
+ }
896
+ interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions {
897
+ /**
898
+ * The type of async event.
899
+ * @default new.target.name
900
+ */
901
+ name?: string | undefined;
902
+ }
903
+ /**
904
+ * Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that
905
+ * require manual async tracking. Specifically, all events emitted by instances
906
+ * of `events.EventEmitterAsyncResource` will run within its [async context](https://nodejs.org/docs/latest-v25.x/api/async_context.html).
907
+ *
908
+ * ```js
909
+ * import { EventEmitterAsyncResource, EventEmitter } from 'node:events';
910
+ * import { notStrictEqual, strictEqual } from 'node:assert';
911
+ * import { executionAsyncId, triggerAsyncId } from 'node:async_hooks';
912
+ *
913
+ * // Async tracking tooling will identify this as 'Q'.
914
+ * const ee1 = new EventEmitterAsyncResource({ name: 'Q' });
915
+ *
916
+ * // 'foo' listeners will run in the EventEmitters async context.
917
+ * ee1.on('foo', () => {
918
+ * strictEqual(executionAsyncId(), ee1.asyncId);
919
+ * strictEqual(triggerAsyncId(), ee1.triggerAsyncId);
920
+ * });
921
+ *
922
+ * const ee2 = new EventEmitter();
923
+ *
924
+ * // 'foo' listeners on ordinary EventEmitters that do not track async
925
+ * // context, however, run in the same async context as the emit().
926
+ * ee2.on('foo', () => {
927
+ * notStrictEqual(executionAsyncId(), ee2.asyncId);
928
+ * notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId);
929
+ * });
930
+ *
931
+ * Promise.resolve().then(() => {
932
+ * ee1.emit('foo');
933
+ * ee2.emit('foo');
934
+ * });
935
+ * ```
936
+ *
937
+ * The `EventEmitterAsyncResource` class has the same methods and takes the
938
+ * same options as `EventEmitter` and `AsyncResource` themselves.
939
+ * @since v17.4.0, v16.14.0
940
+ */
941
+ class EventEmitterAsyncResource extends EventEmitter {
942
+ constructor(options?: EventEmitterAsyncResourceOptions);
943
+ /**
944
+ * The unique `asyncId` assigned to the resource.
945
+ */
946
+ readonly asyncId: number;
947
+ /**
948
+ * The returned `AsyncResource` object has an additional `eventEmitter` property
949
+ * that provides a reference to this `EventEmitterAsyncResource`.
950
+ */
951
+ readonly asyncResource: EventEmitterReferencingAsyncResource;
952
+ /**
953
+ * Call all `destroy` hooks. This should only ever be called once. An error will
954
+ * be thrown if it is called more than once. This **must** be manually called. If
955
+ * the resource is left to be collected by the GC then the `destroy` hooks will
956
+ * never be called.
957
+ */
958
+ emitDestroy(): void;
959
+ /**
960
+ * The same `triggerAsyncId` that is passed to the
961
+ * `AsyncResource` constructor.
962
+ */
963
+ readonly triggerAsyncId: number;
964
+ }
965
+ /**
966
+ * The `NodeEventTarget` is a Node.js-specific extension to `EventTarget`
967
+ * that emulates a subset of the `EventEmitter` API.
968
+ * @since v14.5.0
969
+ */
970
+ interface NodeEventTarget extends EventTarget {
971
+ /**
972
+ * Node.js-specific extension to the `EventTarget` class that emulates the
973
+ * equivalent `EventEmitter` API. The only difference between `addListener()` and
974
+ * `addEventListener()` is that `addListener()` will return a reference to the
975
+ * `EventTarget`.
976
+ * @since v14.5.0
977
+ */
978
+ addListener(type: string, listener: (arg: any) => void): this;
979
+ /**
980
+ * Node.js-specific extension to the `EventTarget` class that dispatches the
981
+ * `arg` to the list of handlers for `type`.
982
+ * @since v15.2.0
983
+ * @returns `true` if event listeners registered for the `type` exist,
984
+ * otherwise `false`.
985
+ */
986
+ emit(type: string, arg: any): boolean;
987
+ /**
988
+ * Node.js-specific extension to the `EventTarget` class that returns an array
989
+ * of event `type` names for which event listeners are registered.
990
+ * @since 14.5.0
991
+ */
992
+ eventNames(): string[];
993
+ /**
994
+ * Node.js-specific extension to the `EventTarget` class that returns the number
995
+ * of event listeners registered for the `type`.
996
+ * @since v14.5.0
997
+ */
998
+ listenerCount(type: string): number;
999
+ /**
1000
+ * Node.js-specific extension to the `EventTarget` class that sets the number
1001
+ * of max event listeners as `n`.
1002
+ * @since v14.5.0
1003
+ */
1004
+ setMaxListeners(n: number): void;
1005
+ /**
1006
+ * Node.js-specific extension to the `EventTarget` class that returns the number
1007
+ * of max event listeners.
1008
+ * @since v14.5.0
1009
+ */
1010
+ getMaxListeners(): number;
1011
+ /**
1012
+ * Node.js-specific alias for `eventTarget.removeEventListener()`.
1013
+ * @since v14.5.0
1014
+ */
1015
+ off(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
1016
+ /**
1017
+ * Node.js-specific alias for `eventTarget.addEventListener()`.
1018
+ * @since v14.5.0
1019
+ */
1020
+ on(type: string, listener: (arg: any) => void): this;
1021
+ /**
1022
+ * Node.js-specific extension to the `EventTarget` class that adds a `once`
1023
+ * listener for the given event `type`. This is equivalent to calling `on`
1024
+ * with the `once` option set to `true`.
1025
+ * @since v14.5.0
1026
+ */
1027
+ once(type: string, listener: (arg: any) => void): this;
1028
+ /**
1029
+ * Node.js-specific extension to the `EventTarget` class. If `type` is specified,
1030
+ * removes all registered listeners for `type`, otherwise removes all registered
1031
+ * listeners.
1032
+ * @since v14.5.0
1033
+ */
1034
+ removeAllListeners(type?: string): this;
1035
+ /**
1036
+ * Node.js-specific extension to the `EventTarget` class that removes the
1037
+ * `listener` for the given `type`. The only difference between `removeListener()`
1038
+ * and `removeEventListener()` is that `removeListener()` will return a reference
1039
+ * to the `EventTarget`.
1040
+ * @since v14.5.0
1041
+ */
1042
+ removeListener(type: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
1043
+ }
1044
+ /** @internal */
1045
+ type InternalEventTargetEventProperties<T> = {
1046
+ [K in keyof T & string as `on${K}`]: ((ev: T[K]) => void) | null;
1047
+ };
1048
+ }
1049
+ export = EventEmitter;
1050
+ }
1051
+ declare module "events" {
1052
+ import events = require("node:events");
1053
+ export = events;
1054
+ }