lightclawbot 1.1.2-beta.0 → 1.2.0-beta.0

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 (397) hide show
  1. package/README.md +0 -1
  2. package/dist/index.js +38 -31
  3. package/dist/setup-entry.js +32 -0
  4. package/dist/src/channel.js +301 -257
  5. package/dist/src/channel.setup.js +16 -0
  6. package/dist/src/config.js +31 -124
  7. package/dist/src/dedup.js +0 -1
  8. package/dist/src/download-tool.js +0 -1
  9. package/dist/src/file-storage.js +2 -2
  10. package/dist/src/gateway.js +226 -178
  11. package/dist/src/history/cron-utils.js +0 -1
  12. package/dist/src/history/index.js +0 -1
  13. package/dist/src/history/message-parser.js +0 -1
  14. package/dist/src/history/session-reader.js +3 -1
  15. package/dist/src/history/session-store.js +0 -1
  16. package/dist/src/history/text-processing.js +0 -1
  17. package/dist/src/history/types.js +0 -1
  18. package/dist/src/inbound.js +183 -234
  19. package/dist/src/media.js +0 -1
  20. package/dist/src/messaging.js +65 -0
  21. package/dist/src/outbound.js +131 -45
  22. package/dist/src/runtime.js +29 -11
  23. package/dist/src/setup-core.js +27 -0
  24. package/dist/src/shared.js +141 -0
  25. package/dist/src/socket/handlers.js +72 -49
  26. package/dist/src/socket/index.js +0 -1
  27. package/dist/src/socket/native-socket.js +385 -0
  28. package/dist/src/socket/registry.js +0 -1
  29. package/dist/src/socket/reliable-emitter.js +188 -50
  30. package/dist/src/streaming/delta-tracker.js +140 -0
  31. package/dist/src/streaming/index.js +12 -0
  32. package/dist/src/streaming/stream-reply-sink.js +387 -0
  33. package/dist/src/streaming/types.js +4 -0
  34. package/dist/src/tools.js +13 -0
  35. package/dist/src/types.js +23 -2
  36. package/dist/src/upload-tool.js +0 -1
  37. package/dist/src/utils/account.js +73 -0
  38. package/dist/src/utils/common.js +48 -0
  39. package/dist/src/utils/index.js +2 -0
  40. package/node_modules/ws/index.js +22 -0
  41. package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/constants.js +1 -0
  42. package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/permessage-deflate.js +6 -6
  43. package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/websocket-server.js +10 -6
  44. package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/websocket.js +19 -14
  45. package/node_modules/{engine.io-client/node_modules/ws → ws}/package.json +4 -3
  46. package/node_modules/ws/wrapper.mjs +21 -0
  47. package/openclaw.plugin.json +0 -7
  48. package/package.json +8 -5
  49. package/dist/index.d.ts +0 -24
  50. package/dist/index.d.ts.map +0 -1
  51. package/dist/index.js.map +0 -1
  52. package/dist/public/data/scripts/manifest.json +0 -11
  53. package/dist/public/data/scripts/upgrade.156d7999.sh +0 -384
  54. package/dist/public/data/scripts/upgrade.sh +0 -384
  55. package/dist/src/channel.d.ts +0 -11
  56. package/dist/src/channel.d.ts.map +0 -1
  57. package/dist/src/channel.js.map +0 -1
  58. package/dist/src/config.d.ts +0 -129
  59. package/dist/src/config.d.ts.map +0 -1
  60. package/dist/src/config.js.map +0 -1
  61. package/dist/src/dedup.d.ts +0 -12
  62. package/dist/src/dedup.d.ts.map +0 -1
  63. package/dist/src/dedup.js.map +0 -1
  64. package/dist/src/download-tool.d.ts +0 -32
  65. package/dist/src/download-tool.d.ts.map +0 -1
  66. package/dist/src/download-tool.js.map +0 -1
  67. package/dist/src/file-storage.d.ts +0 -74
  68. package/dist/src/file-storage.d.ts.map +0 -1
  69. package/dist/src/file-storage.js.map +0 -1
  70. package/dist/src/format-urls.d.ts +0 -26
  71. package/dist/src/format-urls.d.ts.map +0 -1
  72. package/dist/src/format-urls.js +0 -53
  73. package/dist/src/format-urls.js.map +0 -1
  74. package/dist/src/gateway.d.ts +0 -16
  75. package/dist/src/gateway.d.ts.map +0 -1
  76. package/dist/src/gateway.js.map +0 -1
  77. package/dist/src/history/cron-utils.d.ts +0 -76
  78. package/dist/src/history/cron-utils.d.ts.map +0 -1
  79. package/dist/src/history/cron-utils.js.map +0 -1
  80. package/dist/src/history/index.d.ts +0 -20
  81. package/dist/src/history/index.d.ts.map +0 -1
  82. package/dist/src/history/index.js.map +0 -1
  83. package/dist/src/history/message-parser.d.ts +0 -52
  84. package/dist/src/history/message-parser.d.ts.map +0 -1
  85. package/dist/src/history/message-parser.js.map +0 -1
  86. package/dist/src/history/session-reader.d.ts +0 -58
  87. package/dist/src/history/session-reader.d.ts.map +0 -1
  88. package/dist/src/history/session-reader.js.map +0 -1
  89. package/dist/src/history/session-store.d.ts +0 -42
  90. package/dist/src/history/session-store.d.ts.map +0 -1
  91. package/dist/src/history/session-store.js.map +0 -1
  92. package/dist/src/history/text-processing.d.ts +0 -41
  93. package/dist/src/history/text-processing.d.ts.map +0 -1
  94. package/dist/src/history/text-processing.js.map +0 -1
  95. package/dist/src/history/types.d.ts +0 -134
  96. package/dist/src/history/types.d.ts.map +0 -1
  97. package/dist/src/history/types.js.map +0 -1
  98. package/dist/src/inbound.d.ts +0 -18
  99. package/dist/src/inbound.d.ts.map +0 -1
  100. package/dist/src/inbound.js.map +0 -1
  101. package/dist/src/media.d.ts +0 -12
  102. package/dist/src/media.d.ts.map +0 -1
  103. package/dist/src/media.js.map +0 -1
  104. package/dist/src/outbound.d.ts +0 -28
  105. package/dist/src/outbound.d.ts.map +0 -1
  106. package/dist/src/outbound.js.map +0 -1
  107. package/dist/src/runtime.d.ts +0 -4
  108. package/dist/src/runtime.d.ts.map +0 -1
  109. package/dist/src/runtime.js.map +0 -1
  110. package/dist/src/socket/handlers.d.ts +0 -26
  111. package/dist/src/socket/handlers.d.ts.map +0 -1
  112. package/dist/src/socket/handlers.js.map +0 -1
  113. package/dist/src/socket/index.d.ts +0 -11
  114. package/dist/src/socket/index.d.ts.map +0 -1
  115. package/dist/src/socket/index.js.map +0 -1
  116. package/dist/src/socket/registry.d.ts +0 -59
  117. package/dist/src/socket/registry.d.ts.map +0 -1
  118. package/dist/src/socket/registry.js.map +0 -1
  119. package/dist/src/socket/reliable-emitter.d.ts +0 -79
  120. package/dist/src/socket/reliable-emitter.d.ts.map +0 -1
  121. package/dist/src/socket/reliable-emitter.js.map +0 -1
  122. package/dist/src/types.d.ts +0 -112
  123. package/dist/src/types.d.ts.map +0 -1
  124. package/dist/src/types.js.map +0 -1
  125. package/dist/src/upload-tool.d.ts +0 -27
  126. package/dist/src/upload-tool.d.ts.map +0 -1
  127. package/dist/src/upload-tool.js.map +0 -1
  128. package/node_modules/@socket.io/component-emitter/LICENSE +0 -24
  129. package/node_modules/@socket.io/component-emitter/Readme.md +0 -79
  130. package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +0 -179
  131. package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +0 -176
  132. package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +0 -4
  133. package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +0 -179
  134. package/node_modules/@socket.io/component-emitter/lib/esm/index.js +0 -169
  135. package/node_modules/@socket.io/component-emitter/lib/esm/package.json +0 -4
  136. package/node_modules/@socket.io/component-emitter/package.json +0 -28
  137. package/node_modules/debug/LICENSE +0 -20
  138. package/node_modules/debug/README.md +0 -481
  139. package/node_modules/debug/package.json +0 -64
  140. package/node_modules/debug/src/browser.js +0 -272
  141. package/node_modules/debug/src/common.js +0 -292
  142. package/node_modules/debug/src/index.js +0 -10
  143. package/node_modules/debug/src/node.js +0 -263
  144. package/node_modules/engine.io-client/LICENSE +0 -22
  145. package/node_modules/engine.io-client/README.md +0 -331
  146. package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +0 -3
  147. package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +0 -4
  148. package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +0 -1
  149. package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +0 -14
  150. package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +0 -15
  151. package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +0 -38
  152. package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +0 -1
  153. package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +0 -67
  154. package/node_modules/engine.io-client/build/cjs/globals.d.ts +0 -4
  155. package/node_modules/engine.io-client/build/cjs/globals.js +0 -26
  156. package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +0 -21
  157. package/node_modules/engine.io-client/build/cjs/globals.node.js +0 -97
  158. package/node_modules/engine.io-client/build/cjs/index.d.ts +0 -15
  159. package/node_modules/engine.io-client/build/cjs/index.js +0 -32
  160. package/node_modules/engine.io-client/build/cjs/package.json +0 -10
  161. package/node_modules/engine.io-client/build/cjs/socket.d.ts +0 -482
  162. package/node_modules/engine.io-client/build/cjs/socket.js +0 -765
  163. package/node_modules/engine.io-client/build/cjs/transport.d.ts +0 -106
  164. package/node_modules/engine.io-client/build/cjs/transport.js +0 -153
  165. package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +0 -8
  166. package/node_modules/engine.io-client/build/cjs/transports/index.js +0 -11
  167. package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +0 -15
  168. package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +0 -60
  169. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +0 -108
  170. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +0 -285
  171. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +0 -11
  172. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +0 -44
  173. package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +0 -52
  174. package/node_modules/engine.io-client/build/cjs/transports/polling.js +0 -165
  175. package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +0 -36
  176. package/node_modules/engine.io-client/build/cjs/transports/websocket.js +0 -136
  177. package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +0 -14
  178. package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +0 -68
  179. package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +0 -18
  180. package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +0 -94
  181. package/node_modules/engine.io-client/build/cjs/util.d.ts +0 -7
  182. package/node_modules/engine.io-client/build/cjs/util.js +0 -65
  183. package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +0 -3
  184. package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +0 -2
  185. package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +0 -1
  186. package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +0 -11
  187. package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +0 -15
  188. package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +0 -34
  189. package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +0 -1
  190. package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +0 -64
  191. package/node_modules/engine.io-client/build/esm/globals.d.ts +0 -4
  192. package/node_modules/engine.io-client/build/esm/globals.js +0 -22
  193. package/node_modules/engine.io-client/build/esm/globals.node.d.ts +0 -21
  194. package/node_modules/engine.io-client/build/esm/globals.node.js +0 -91
  195. package/node_modules/engine.io-client/build/esm/index.d.ts +0 -15
  196. package/node_modules/engine.io-client/build/esm/index.js +0 -15
  197. package/node_modules/engine.io-client/build/esm/package.json +0 -10
  198. package/node_modules/engine.io-client/build/esm/socket.d.ts +0 -482
  199. package/node_modules/engine.io-client/build/esm/socket.js +0 -727
  200. package/node_modules/engine.io-client/build/esm/transport.d.ts +0 -106
  201. package/node_modules/engine.io-client/build/esm/transport.js +0 -142
  202. package/node_modules/engine.io-client/build/esm/transports/index.d.ts +0 -8
  203. package/node_modules/engine.io-client/build/esm/transports/index.js +0 -8
  204. package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +0 -15
  205. package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +0 -56
  206. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +0 -108
  207. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +0 -271
  208. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +0 -11
  209. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +0 -17
  210. package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +0 -52
  211. package/node_modules/engine.io-client/build/esm/transports/polling.js +0 -145
  212. package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +0 -36
  213. package/node_modules/engine.io-client/build/esm/transports/websocket.js +0 -125
  214. package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +0 -14
  215. package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +0 -41
  216. package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +0 -18
  217. package/node_modules/engine.io-client/build/esm/transports/webtransport.js +0 -80
  218. package/node_modules/engine.io-client/build/esm/util.d.ts +0 -7
  219. package/node_modules/engine.io-client/build/esm/util.js +0 -59
  220. package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +0 -3
  221. package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +0 -2
  222. package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +0 -1
  223. package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +0 -11
  224. package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +0 -15
  225. package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +0 -34
  226. package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +0 -1
  227. package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +0 -64
  228. package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +0 -4
  229. package/node_modules/engine.io-client/build/esm-debug/globals.js +0 -22
  230. package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +0 -21
  231. package/node_modules/engine.io-client/build/esm-debug/globals.node.js +0 -91
  232. package/node_modules/engine.io-client/build/esm-debug/index.d.ts +0 -15
  233. package/node_modules/engine.io-client/build/esm-debug/index.js +0 -15
  234. package/node_modules/engine.io-client/build/esm-debug/package.json +0 -10
  235. package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +0 -482
  236. package/node_modules/engine.io-client/build/esm-debug/socket.js +0 -756
  237. package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +0 -106
  238. package/node_modules/engine.io-client/build/esm-debug/transport.js +0 -145
  239. package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +0 -8
  240. package/node_modules/engine.io-client/build/esm-debug/transports/index.js +0 -8
  241. package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +0 -15
  242. package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +0 -56
  243. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +0 -108
  244. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +0 -276
  245. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +0 -11
  246. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +0 -17
  247. package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +0 -52
  248. package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +0 -158
  249. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +0 -36
  250. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +0 -128
  251. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +0 -14
  252. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +0 -41
  253. package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +0 -18
  254. package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +0 -87
  255. package/node_modules/engine.io-client/build/esm-debug/util.d.ts +0 -7
  256. package/node_modules/engine.io-client/build/esm-debug/util.js +0 -59
  257. package/node_modules/engine.io-client/dist/engine.io.esm.min.js +0 -7
  258. package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +0 -1
  259. package/node_modules/engine.io-client/dist/engine.io.js +0 -3064
  260. package/node_modules/engine.io-client/dist/engine.io.js.map +0 -1
  261. package/node_modules/engine.io-client/dist/engine.io.min.js +0 -7
  262. package/node_modules/engine.io-client/dist/engine.io.min.js.map +0 -1
  263. package/node_modules/engine.io-client/node_modules/ws/index.js +0 -13
  264. package/node_modules/engine.io-client/node_modules/ws/wrapper.mjs +0 -8
  265. package/node_modules/engine.io-client/package.json +0 -95
  266. package/node_modules/engine.io-parser/LICENSE +0 -22
  267. package/node_modules/engine.io-parser/Readme.md +0 -158
  268. package/node_modules/engine.io-parser/build/cjs/commons.d.ts +0 -14
  269. package/node_modules/engine.io-parser/build/cjs/commons.js +0 -19
  270. package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +0 -2
  271. package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +0 -48
  272. package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +0 -2
  273. package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +0 -66
  274. package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +0 -2
  275. package/node_modules/engine.io-parser/build/cjs/decodePacket.js +0 -59
  276. package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +0 -4
  277. package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +0 -72
  278. package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +0 -3
  279. package/node_modules/engine.io-parser/build/cjs/encodePacket.js +0 -38
  280. package/node_modules/engine.io-parser/build/cjs/index.d.ts +0 -9
  281. package/node_modules/engine.io-parser/build/cjs/index.js +0 -164
  282. package/node_modules/engine.io-parser/build/cjs/package.json +0 -8
  283. package/node_modules/engine.io-parser/build/esm/commons.d.ts +0 -14
  284. package/node_modules/engine.io-parser/build/esm/commons.js +0 -14
  285. package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +0 -2
  286. package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +0 -43
  287. package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +0 -2
  288. package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +0 -62
  289. package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +0 -2
  290. package/node_modules/engine.io-parser/build/esm/decodePacket.js +0 -55
  291. package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +0 -4
  292. package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +0 -68
  293. package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +0 -3
  294. package/node_modules/engine.io-parser/build/esm/encodePacket.js +0 -33
  295. package/node_modules/engine.io-parser/build/esm/index.d.ts +0 -9
  296. package/node_modules/engine.io-parser/build/esm/index.js +0 -156
  297. package/node_modules/engine.io-parser/build/esm/package.json +0 -8
  298. package/node_modules/engine.io-parser/package.json +0 -46
  299. package/node_modules/ms/index.js +0 -162
  300. package/node_modules/ms/license.md +0 -21
  301. package/node_modules/ms/package.json +0 -38
  302. package/node_modules/ms/readme.md +0 -59
  303. package/node_modules/socket.io-client/LICENSE +0 -21
  304. package/node_modules/socket.io-client/README.md +0 -29
  305. package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +0 -2
  306. package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +0 -4
  307. package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +0 -12
  308. package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +0 -69
  309. package/node_modules/socket.io-client/build/cjs/index.d.ts +0 -29
  310. package/node_modules/socket.io-client/build/cjs/index.js +0 -76
  311. package/node_modules/socket.io-client/build/cjs/manager.d.ts +0 -295
  312. package/node_modules/socket.io-client/build/cjs/manager.js +0 -416
  313. package/node_modules/socket.io-client/build/cjs/on.d.ts +0 -2
  314. package/node_modules/socket.io-client/build/cjs/on.js +0 -9
  315. package/node_modules/socket.io-client/build/cjs/socket.d.ts +0 -593
  316. package/node_modules/socket.io-client/build/cjs/socket.js +0 -909
  317. package/node_modules/socket.io-client/build/cjs/url.d.ts +0 -33
  318. package/node_modules/socket.io-client/build/cjs/url.js +0 -69
  319. package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +0 -2
  320. package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +0 -2
  321. package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +0 -12
  322. package/node_modules/socket.io-client/build/esm/contrib/backo2.js +0 -66
  323. package/node_modules/socket.io-client/build/esm/index.d.ts +0 -29
  324. package/node_modules/socket.io-client/build/esm/index.js +0 -58
  325. package/node_modules/socket.io-client/build/esm/manager.d.ts +0 -295
  326. package/node_modules/socket.io-client/build/esm/manager.js +0 -367
  327. package/node_modules/socket.io-client/build/esm/on.d.ts +0 -2
  328. package/node_modules/socket.io-client/build/esm/on.js +0 -6
  329. package/node_modules/socket.io-client/build/esm/package.json +0 -5
  330. package/node_modules/socket.io-client/build/esm/socket.d.ts +0 -593
  331. package/node_modules/socket.io-client/build/esm/socket.js +0 -880
  332. package/node_modules/socket.io-client/build/esm/url.d.ts +0 -33
  333. package/node_modules/socket.io-client/build/esm/url.js +0 -59
  334. package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +0 -2
  335. package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +0 -2
  336. package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +0 -12
  337. package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +0 -66
  338. package/node_modules/socket.io-client/build/esm-debug/index.d.ts +0 -29
  339. package/node_modules/socket.io-client/build/esm-debug/index.js +0 -62
  340. package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +0 -295
  341. package/node_modules/socket.io-client/build/esm-debug/manager.js +0 -386
  342. package/node_modules/socket.io-client/build/esm-debug/on.d.ts +0 -2
  343. package/node_modules/socket.io-client/build/esm-debug/on.js +0 -6
  344. package/node_modules/socket.io-client/build/esm-debug/package.json +0 -5
  345. package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +0 -593
  346. package/node_modules/socket.io-client/build/esm-debug/socket.js +0 -902
  347. package/node_modules/socket.io-client/build/esm-debug/url.d.ts +0 -33
  348. package/node_modules/socket.io-client/build/esm-debug/url.js +0 -63
  349. package/node_modules/socket.io-client/dist/socket.io.esm.min.js +0 -7
  350. package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +0 -1
  351. package/node_modules/socket.io-client/dist/socket.io.js +0 -4955
  352. package/node_modules/socket.io-client/dist/socket.io.js.map +0 -1
  353. package/node_modules/socket.io-client/dist/socket.io.min.js +0 -7
  354. package/node_modules/socket.io-client/dist/socket.io.min.js.map +0 -1
  355. package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +0 -7
  356. package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +0 -1
  357. package/node_modules/socket.io-client/package.json +0 -101
  358. package/node_modules/socket.io-parser/LICENSE +0 -20
  359. package/node_modules/socket.io-parser/Readme.md +0 -81
  360. package/node_modules/socket.io-parser/build/cjs/binary.d.ts +0 -20
  361. package/node_modules/socket.io-parser/build/cjs/binary.js +0 -87
  362. package/node_modules/socket.io-parser/build/cjs/index.d.ts +0 -101
  363. package/node_modules/socket.io-parser/build/cjs/index.js +0 -367
  364. package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +0 -7
  365. package/node_modules/socket.io-parser/build/cjs/is-binary.js +0 -54
  366. package/node_modules/socket.io-parser/build/cjs/package.json +0 -3
  367. package/node_modules/socket.io-parser/build/esm/binary.d.ts +0 -20
  368. package/node_modules/socket.io-parser/build/esm/binary.js +0 -83
  369. package/node_modules/socket.io-parser/build/esm/index.d.ts +0 -101
  370. package/node_modules/socket.io-parser/build/esm/index.js +0 -356
  371. package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +0 -7
  372. package/node_modules/socket.io-parser/build/esm/is-binary.js +0 -50
  373. package/node_modules/socket.io-parser/build/esm/package.json +0 -3
  374. package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +0 -20
  375. package/node_modules/socket.io-parser/build/esm-debug/binary.js +0 -83
  376. package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +0 -101
  377. package/node_modules/socket.io-parser/build/esm-debug/index.js +0 -361
  378. package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +0 -7
  379. package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +0 -50
  380. package/node_modules/socket.io-parser/build/esm-debug/package.json +0 -3
  381. package/node_modules/socket.io-parser/package.json +0 -44
  382. package/node_modules/xmlhttprequest-ssl/LICENSE +0 -22
  383. package/node_modules/xmlhttprequest-ssl/README.md +0 -67
  384. package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +0 -689
  385. package/node_modules/xmlhttprequest-ssl/package.json +0 -40
  386. /package/node_modules/{engine.io-client/node_modules/ws → ws}/LICENSE +0 -0
  387. /package/node_modules/{engine.io-client/node_modules/ws → ws}/README.md +0 -0
  388. /package/node_modules/{engine.io-client/node_modules/ws → ws}/browser.js +0 -0
  389. /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/buffer-util.js +0 -0
  390. /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/event-target.js +0 -0
  391. /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/extension.js +0 -0
  392. /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/limiter.js +0 -0
  393. /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/receiver.js +0 -0
  394. /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/sender.js +0 -0
  395. /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/stream.js +0 -0
  396. /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/subprotocol.js +0 -0
  397. /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/validation.js +0 -0
@@ -1,112 +0,0 @@
1
- /**
2
- * LightClaw OpenClaw Channel Plugin — 类型定义
3
- *
4
- * 用户实际消息格式:
5
- * { msgId, from, to, content, files, timestamp }
6
- *
7
- * files 格式为 FileAttachment[],每个文件包含 name, mimeType, bytes(data URL)。
8
- */
9
- /** 用户上传的文件(files[] 数组中的元素) */
10
- export interface FileAttachment {
11
- /** 文件名 */
12
- name: string;
13
- /** MIME 类型 */
14
- mimeType: string;
15
- /** base64 data URL(如 "data:text/plain;base64,...") */
16
- bytes?: string;
17
- /** 远程文件 URI(如云端下载地址),与 bytes 二选一 */
18
- uri?: string;
19
- }
20
- /**
21
- * message:private 事件的 data 结构
22
- *
23
- * 入站(用户 → 插件):{ msgId, from, to, content, files, timestamp }
24
- * 出站(插件 → 用户):同结构,可附带 kind 用于流式/typing 控制
25
- */
26
- export interface PrivateMessageData {
27
- /** 消息唯一 ID */
28
- msgId: string;
29
- /** 发送者 ID */
30
- from: string;
31
- /** 接收者 ID */
32
- to: string;
33
- /** 消息文本内容(仅发送文件时可为空字符串) */
34
- content: string;
35
- /** 消息时间戳(ms) */
36
- timestamp: number;
37
- /** 文件列表({name, mimeType, bytes} 格式,bytes 为 data URL) */
38
- files?: FileAttachment[];
39
- /** 消息子类型:流式/typing 控制(出站使用) */
40
- kind?: "text" | "stream_chunk" | "stream_end" | "typing_start" | "typing_stop";
41
- /** 回复对应的原始消息 ID */
42
- replyToMsgId?: string;
43
- /**
44
- * 幂等键:标识每次独立的 emit 调用,前端据此去重。
45
- * 由 ReliableEmitter 在发送时自动注入,重试/重发时保持不变。
46
- */
47
- idempotencyKey?: string;
48
- }
49
- /** 原始配置(config.yaml 中的内容) */
50
- export interface AssistantAccountConfig {
51
- /** @deprecated 不再使用,配置中只有 apiKeys */
52
- apiKey?: string;
53
- /** API Keys 列表(第一个作为主 key,用于获取 botId 等) */
54
- apiKeys?: string[];
55
- /** REST API 基础地址(用于 outbound 主动发送) */
56
- apiBaseUrl?: string;
57
- /** 是否启用 */
58
- enabled?: boolean;
59
- /** 账户名称 */
60
- name?: string;
61
- /** DM 策略 */
62
- dmPolicy?: "open" | "allowlist" | "disabled";
63
- /** 允许的用户 ID 列表(* 表示所有人) */
64
- allowFrom?: string[];
65
- /** 自定义系统提示词 */
66
- systemPrompt?: string;
67
- }
68
- /** 解析后的完整账户(含默认值和环境变量 fallback) */
69
- export interface ResolvedAssistantAccount {
70
- accountId: string;
71
- /** 主 apiKey(获取 botId、默认文件操作等) */
72
- apiKey: string;
73
- /** 所有 apiKey(含主 key),用于 WS 多 key 认证 */
74
- allApiKeys: string[];
75
- apiBaseUrl: string;
76
- enabled: boolean;
77
- name?: string;
78
- dmPolicy: "open" | "allowlist" | "disabled";
79
- allowFrom: string[];
80
- systemPrompt?: string;
81
- secretSource: "config" | "env" | "none";
82
- }
83
- export interface GatewayContext {
84
- account: ResolvedAssistantAccount;
85
- abortSignal: AbortSignal;
86
- cfg: unknown;
87
- onReady?: () => void;
88
- onDisconnect?: () => void;
89
- onError?: (error: Error) => void;
90
- /** 收到任何入站事件时调用,用于通知框架更新 lastEventAt,防止 health-monitor 误判 stale-socket */
91
- onEvent?: () => void;
92
- log?: {
93
- info: (msg: string) => void;
94
- warn: (msg: string) => void;
95
- error: (msg: string) => void;
96
- debug?: (msg: string) => void;
97
- };
98
- }
99
- /** 消息队列项 — 直接使用用户的 files[] 格式 */
100
- export interface QueuedMessage {
101
- /** 发送者 ID */
102
- senderId: string;
103
- /** 消息文本 */
104
- text: string;
105
- /** 消息 ID */
106
- messageId: string;
107
- /** 文件附件({name, mimeType, bytes} 格式) */
108
- files: FileAttachment[];
109
- /** 时间戳 */
110
- timestamp: number;
111
- }
112
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,8BAA8B;AAC9B,MAAM,WAAW,cAAc;IAC7B,UAAU;IACV,IAAI,EAAE,MAAM,CAAC;IACb,cAAc;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC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— 文件上传工具
3
- *
4
- * 注册为 OpenClaw Agent Tool,允许 AI 将本地文件上传到云端存储,
5
- * 获得公网可访问的 URL,方便用户直接下载。
6
- *
7
- * 工具名: lightclaw_upload_file
8
- */
9
- import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
10
- export declare const UPLOAD_TOOL_NAME = "lightclaw_upload_file";
11
- export declare const uploadToolSchema: {
12
- type: "object";
13
- properties: {
14
- paths: {
15
- type: "array";
16
- items: {
17
- type: "string";
18
- };
19
- minItems: number;
20
- maxItems: number;
21
- description: string;
22
- };
23
- };
24
- required: readonly ["paths"];
25
- };
26
- export declare function registerUploadTool(api: OpenClawPluginApi): void;
27
- //# sourceMappingURL=upload-tool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-tool.d.ts","sourceRoot":"","sources":["../../src/upload-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAgB,MAAM,0BAA0B,CAAC;AAShF,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AAExD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;CAY5B,CAAC;AAMF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,iBAAiB,GAAG,IAAI,CA4I/D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-tool.js","sourceRoot":"","sources":["../../src/upload-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,+DAA+D;AAC/D,8BAA8B;AAC9B,+DAA+D;AAE/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;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AO,EAAE,CAAC;oBAC1C,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;iBAC9B,CAAC;YACJ,CAAC;SACyB,CAAC;IAC/B,CAAC,EACD,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAC3B,CAAC;AACJ,CAAC"}
@@ -1,24 +0,0 @@
1
- (The MIT License)
2
-
3
- Copyright (c) 2014 Component contributors <dev@component.io>
4
-
5
- Permission is hereby granted, free of charge, to any person
6
- obtaining a copy of this software and associated documentation
7
- files (the "Software"), to deal in the Software without
8
- restriction, including without limitation the rights to use,
9
- copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the
11
- Software is furnished to do so, subject to the following
12
- conditions:
13
-
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
- OTHER DEALINGS IN THE SOFTWARE.
@@ -1,79 +0,0 @@
1
- # `@socket.io/component-emitter`
2
-
3
- Event emitter component.
4
-
5
- This project is a fork of the [`component-emitter`](https://github.com/sindresorhus/component-emitter) project, with [Socket.IO](https://socket.io/)-specific TypeScript typings.
6
-
7
- ## Installation
8
-
9
- ```
10
- $ npm i @socket.io/component-emitter
11
- ```
12
-
13
- ## API
14
-
15
- ### Emitter(obj)
16
-
17
- The `Emitter` may also be used as a mixin. For example
18
- a "plain" object may become an emitter, or you may
19
- extend an existing prototype.
20
-
21
- As an `Emitter` instance:
22
-
23
- ```js
24
- import { Emitter } from '@socket.io/component-emitter';
25
-
26
- var emitter = new Emitter;
27
- emitter.emit('something');
28
- ```
29
-
30
- As a mixin:
31
-
32
- ```js
33
- import { Emitter } from '@socket.io/component-emitter';
34
-
35
- var user = { name: 'tobi' };
36
- Emitter(user);
37
-
38
- user.emit('im a user');
39
- ```
40
-
41
- As a prototype mixin:
42
-
43
- ```js
44
- import { Emitter } from '@socket.io/component-emitter';
45
-
46
- Emitter(User.prototype);
47
- ```
48
-
49
- ### Emitter#on(event, fn)
50
-
51
- Register an `event` handler `fn`.
52
-
53
- ### Emitter#once(event, fn)
54
-
55
- Register a single-shot `event` handler `fn`,
56
- removed immediately after it is invoked the
57
- first time.
58
-
59
- ### Emitter#off(event, fn)
60
-
61
- * Pass `event` and `fn` to remove a listener.
62
- * Pass `event` to remove all listeners on that event.
63
- * Pass nothing to remove all listeners on all events.
64
-
65
- ### Emitter#emit(event, ...)
66
-
67
- Emit an `event` with variable option args.
68
-
69
- ### Emitter#listeners(event)
70
-
71
- Return an array of callbacks, or an empty array.
72
-
73
- ### Emitter#hasListeners(event)
74
-
75
- Check if this emitter has `event` handlers.
76
-
77
- ## License
78
-
79
- MIT
@@ -1,179 +0,0 @@
1
- /**
2
- * An events map is an interface that maps event names to their value, which
3
- * represents the type of the `on` listener.
4
- */
5
- export interface EventsMap {
6
- [event: string]: any;
7
- }
8
-
9
- /**
10
- * The default events map, used if no EventsMap is given. Using this EventsMap
11
- * is equivalent to accepting all event names, and any data.
12
- */
13
- export interface DefaultEventsMap {
14
- [event: string]: (...args: any[]) => void;
15
- }
16
-
17
- /**
18
- * Returns a union type containing all the keys of an event map.
19
- */
20
- export type EventNames<Map extends EventsMap> = keyof Map & (string | symbol);
21
-
22
- /** The tuple type representing the parameters of an event listener */
23
- export type EventParams<
24
- Map extends EventsMap,
25
- Ev extends EventNames<Map>
26
- > = Parameters<Map[Ev]>;
27
-
28
- /**
29
- * The event names that are either in ReservedEvents or in UserEvents
30
- */
31
- export type ReservedOrUserEventNames<
32
- ReservedEventsMap extends EventsMap,
33
- UserEvents extends EventsMap
34
- > = EventNames<ReservedEventsMap> | EventNames<UserEvents>;
35
-
36
- /**
37
- * Type of a listener of a user event or a reserved event. If `Ev` is in
38
- * `ReservedEvents`, the reserved event listener is returned.
39
- */
40
- export type ReservedOrUserListener<
41
- ReservedEvents extends EventsMap,
42
- UserEvents extends EventsMap,
43
- Ev extends ReservedOrUserEventNames<ReservedEvents, UserEvents>
44
- > = FallbackToUntypedListener<
45
- Ev extends EventNames<ReservedEvents>
46
- ? ReservedEvents[Ev]
47
- : Ev extends EventNames<UserEvents>
48
- ? UserEvents[Ev]
49
- : never
50
- >;
51
-
52
- /**
53
- * Returns an untyped listener type if `T` is `never`; otherwise, returns `T`.
54
- *
55
- * This is a hack to mitigate https://github.com/socketio/socket.io/issues/3833.
56
- * Needed because of https://github.com/microsoft/TypeScript/issues/41778
57
- */
58
- type FallbackToUntypedListener<T> = [T] extends [never]
59
- ? (...args: any[]) => void | Promise<void>
60
- : T;
61
-
62
- /**
63
- * Strictly typed version of an `EventEmitter`. A `TypedEventEmitter` takes type
64
- * parameters for mappings of event names to event data types, and strictly
65
- * types method calls to the `EventEmitter` according to these event maps.
66
- *
67
- * @typeParam ListenEvents - `EventsMap` of user-defined events that can be
68
- * listened to with `on` or `once`
69
- * @typeParam EmitEvents - `EventsMap` of user-defined events that can be
70
- * emitted with `emit`
71
- * @typeParam ReservedEvents - `EventsMap` of reserved events, that can be
72
- * emitted by socket.io with `emitReserved`, and can be listened to with
73
- * `listen`.
74
- */
75
- export class Emitter<
76
- ListenEvents extends EventsMap,
77
- EmitEvents extends EventsMap,
78
- ReservedEvents extends EventsMap = {}
79
- > {
80
- /**
81
- * Adds the `listener` function as an event listener for `ev`.
82
- *
83
- * @param ev Name of the event
84
- * @param listener Callback function
85
- */
86
- on<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
87
- ev: Ev,
88
- listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
89
- ): this;
90
-
91
- /**
92
- * Adds a one-time `listener` function as an event listener for `ev`.
93
- *
94
- * @param ev Name of the event
95
- * @param listener Callback function
96
- */
97
- once<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
98
- ev: Ev,
99
- listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
100
- ): this;
101
-
102
- /**
103
- * Removes the `listener` function as an event listener for `ev`.
104
- *
105
- * @param ev Name of the event
106
- * @param listener Callback function
107
- */
108
- off<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
109
- ev?: Ev,
110
- listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
111
- ): this;
112
-
113
- /**
114
- * Emits an event.
115
- *
116
- * @param ev Name of the event
117
- * @param args Values to send to listeners of this event
118
- */
119
- emit<Ev extends EventNames<EmitEvents>>(
120
- ev: Ev,
121
- ...args: EventParams<EmitEvents, Ev>
122
- ): this;
123
-
124
- /**
125
- * Emits a reserved event.
126
- *
127
- * This method is `protected`, so that only a class extending
128
- * `StrictEventEmitter` can emit its own reserved events.
129
- *
130
- * @param ev Reserved event name
131
- * @param args Arguments to emit along with the event
132
- */
133
- protected emitReserved<Ev extends EventNames<ReservedEvents>>(
134
- ev: Ev,
135
- ...args: EventParams<ReservedEvents, Ev>
136
- ): this;
137
-
138
- /**
139
- * Returns the listeners listening to an event.
140
- *
141
- * @param event Event name
142
- * @returns Array of listeners subscribed to `event`
143
- */
144
- listeners<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
145
- event: Ev
146
- ): ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>[];
147
-
148
- /**
149
- * Returns true if there is a listener for this event.
150
- *
151
- * @param event Event name
152
- * @returns boolean
153
- */
154
- hasListeners<
155
- Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
156
- >(event: Ev): boolean;
157
-
158
- /**
159
- * Removes the `listener` function as an event listener for `ev`.
160
- *
161
- * @param ev Name of the event
162
- * @param listener Callback function
163
- */
164
- removeListener<
165
- Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
166
- >(
167
- ev?: Ev,
168
- listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
169
- ): this;
170
-
171
- /**
172
- * Removes all `listener` function as an event listener for `ev`.
173
- *
174
- * @param ev Name of the event
175
- */
176
- removeAllListeners<
177
- Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
178
- >(ev?: Ev): this;
179
- }
@@ -1,176 +0,0 @@
1
-
2
- /**
3
- * Expose `Emitter`.
4
- */
5
-
6
- exports.Emitter = Emitter;
7
-
8
- /**
9
- * Initialize a new `Emitter`.
10
- *
11
- * @api public
12
- */
13
-
14
- function Emitter(obj) {
15
- if (obj) return mixin(obj);
16
- }
17
-
18
- /**
19
- * Mixin the emitter properties.
20
- *
21
- * @param {Object} obj
22
- * @return {Object}
23
- * @api private
24
- */
25
-
26
- function mixin(obj) {
27
- for (var key in Emitter.prototype) {
28
- obj[key] = Emitter.prototype[key];
29
- }
30
- return obj;
31
- }
32
-
33
- /**
34
- * Listen on the given `event` with `fn`.
35
- *
36
- * @param {String} event
37
- * @param {Function} fn
38
- * @return {Emitter}
39
- * @api public
40
- */
41
-
42
- Emitter.prototype.on =
43
- Emitter.prototype.addEventListener = function(event, fn){
44
- this._callbacks = this._callbacks || {};
45
- (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
46
- .push(fn);
47
- return this;
48
- };
49
-
50
- /**
51
- * Adds an `event` listener that will be invoked a single
52
- * time then automatically removed.
53
- *
54
- * @param {String} event
55
- * @param {Function} fn
56
- * @return {Emitter}
57
- * @api public
58
- */
59
-
60
- Emitter.prototype.once = function(event, fn){
61
- function on() {
62
- this.off(event, on);
63
- fn.apply(this, arguments);
64
- }
65
-
66
- on.fn = fn;
67
- this.on(event, on);
68
- return this;
69
- };
70
-
71
- /**
72
- * Remove the given callback for `event` or all
73
- * registered callbacks.
74
- *
75
- * @param {String} event
76
- * @param {Function} fn
77
- * @return {Emitter}
78
- * @api public
79
- */
80
-
81
- Emitter.prototype.off =
82
- Emitter.prototype.removeListener =
83
- Emitter.prototype.removeAllListeners =
84
- Emitter.prototype.removeEventListener = function(event, fn){
85
- this._callbacks = this._callbacks || {};
86
-
87
- // all
88
- if (0 == arguments.length) {
89
- this._callbacks = {};
90
- return this;
91
- }
92
-
93
- // specific event
94
- var callbacks = this._callbacks['$' + event];
95
- if (!callbacks) return this;
96
-
97
- // remove all handlers
98
- if (1 == arguments.length) {
99
- delete this._callbacks['$' + event];
100
- return this;
101
- }
102
-
103
- // remove specific handler
104
- var cb;
105
- for (var i = 0; i < callbacks.length; i++) {
106
- cb = callbacks[i];
107
- if (cb === fn || cb.fn === fn) {
108
- callbacks.splice(i, 1);
109
- break;
110
- }
111
- }
112
-
113
- // Remove event specific arrays for event types that no
114
- // one is subscribed for to avoid memory leak.
115
- if (callbacks.length === 0) {
116
- delete this._callbacks['$' + event];
117
- }
118
-
119
- return this;
120
- };
121
-
122
- /**
123
- * Emit `event` with the given args.
124
- *
125
- * @param {String} event
126
- * @param {Mixed} ...
127
- * @return {Emitter}
128
- */
129
-
130
- Emitter.prototype.emit = function(event){
131
- this._callbacks = this._callbacks || {};
132
-
133
- var args = new Array(arguments.length - 1)
134
- , callbacks = this._callbacks['$' + event];
135
-
136
- for (var i = 1; i < arguments.length; i++) {
137
- args[i - 1] = arguments[i];
138
- }
139
-
140
- if (callbacks) {
141
- callbacks = callbacks.slice(0);
142
- for (var i = 0, len = callbacks.length; i < len; ++i) {
143
- callbacks[i].apply(this, args);
144
- }
145
- }
146
-
147
- return this;
148
- };
149
-
150
- // alias used for reserved events (protected method)
151
- Emitter.prototype.emitReserved = Emitter.prototype.emit;
152
-
153
- /**
154
- * Return array of callbacks for `event`.
155
- *
156
- * @param {String} event
157
- * @return {Array}
158
- * @api public
159
- */
160
-
161
- Emitter.prototype.listeners = function(event){
162
- this._callbacks = this._callbacks || {};
163
- return this._callbacks['$' + event] || [];
164
- };
165
-
166
- /**
167
- * Check if this emitter has `event` handlers.
168
- *
169
- * @param {String} event
170
- * @return {Boolean}
171
- * @api public
172
- */
173
-
174
- Emitter.prototype.hasListeners = function(event){
175
- return !! this.listeners(event).length;
176
- };
@@ -1,4 +0,0 @@
1
- {
2
- "name": "@socket.io/component-emitter",
3
- "type": "commonjs"
4
- }