lightclaw2 0.0.1
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.
- package/README.md +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/src/channel.d.ts +11 -0
- package/dist/src/channel.d.ts.map +1 -0
- package/dist/src/channel.js +255 -0
- package/dist/src/channel.js.map +1 -0
- package/dist/src/config.d.ts +29 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +99 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/dedup.d.ts +7 -0
- package/dist/src/dedup.d.ts.map +1 -0
- package/dist/src/dedup.js +52 -0
- package/dist/src/dedup.js.map +1 -0
- package/dist/src/gateway.d.ts +16 -0
- package/dist/src/gateway.d.ts.map +1 -0
- package/dist/src/gateway.js +283 -0
- package/dist/src/gateway.js.map +1 -0
- package/dist/src/inbound.d.ts +18 -0
- package/dist/src/inbound.d.ts.map +1 -0
- package/dist/src/inbound.js +252 -0
- package/dist/src/inbound.js.map +1 -0
- package/dist/src/media.d.ts +12 -0
- package/dist/src/media.d.ts.map +1 -0
- package/dist/src/media.js +87 -0
- package/dist/src/media.js.map +1 -0
- package/dist/src/outbound.d.ts +28 -0
- package/dist/src/outbound.d.ts.map +1 -0
- package/dist/src/outbound.js +172 -0
- package/dist/src/outbound.js.map +1 -0
- package/dist/src/runtime.d.ts +4 -0
- package/dist/src/runtime.d.ts.map +1 -0
- package/dist/src/runtime.js +11 -0
- package/dist/src/runtime.js.map +1 -0
- package/dist/src/session-history.d.ts +88 -0
- package/dist/src/session-history.d.ts.map +1 -0
- package/dist/src/session-history.js +545 -0
- package/dist/src/session-history.js.map +1 -0
- package/dist/src/socket-handlers.d.ts +21 -0
- package/dist/src/socket-handlers.d.ts.map +1 -0
- package/dist/src/socket-handlers.js +120 -0
- package/dist/src/socket-handlers.js.map +1 -0
- package/dist/src/socket-registry.d.ts +53 -0
- package/dist/src/socket-registry.d.ts.map +1 -0
- package/dist/src/socket-registry.js +115 -0
- package/dist/src/socket-registry.js.map +1 -0
- package/dist/src/types.d.ts +100 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +10 -0
- package/dist/src/types.js.map +1 -0
- package/node_modules/@socket.io/component-emitter/LICENSE +24 -0
- package/node_modules/@socket.io/component-emitter/Readme.md +79 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +176 -0
- package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +179 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/index.js +169 -0
- package/node_modules/@socket.io/component-emitter/lib/esm/package.json +4 -0
- package/node_modules/@socket.io/component-emitter/package.json +28 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/engine.io-client/LICENSE +22 -0
- package/node_modules/engine.io-client/README.md +331 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +14 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +38 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +67 -0
- package/node_modules/engine.io-client/build/cjs/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/cjs/globals.js +26 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/cjs/globals.node.js +97 -0
- package/node_modules/engine.io-client/build/cjs/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/index.js +32 -0
- package/node_modules/engine.io-client/build/cjs/package.json +10 -0
- package/node_modules/engine.io-client/build/cjs/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/cjs/socket.js +765 -0
- package/node_modules/engine.io-client/build/cjs/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/cjs/transport.js +153 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/cjs/transports/index.js +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +60 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +285 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +44 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/cjs/transports/polling.js +165 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.js +136 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +68 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +94 -0
- package/node_modules/engine.io-client/build/cjs/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/cjs/util.js +65 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/index.js +15 -0
- package/node_modules/engine.io-client/build/esm/package.json +10 -0
- package/node_modules/engine.io-client/build/esm/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm/socket.js +727 -0
- package/node_modules/engine.io-client/build/esm/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm/transport.js +142 -0
- package/node_modules/engine.io-client/build/esm/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +271 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm/transports/polling.js +145 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.js +125 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm/transports/webtransport.js +80 -0
- package/node_modules/engine.io-client/build/esm/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm/util.js +59 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +3 -0
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +11 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +34 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +1 -0
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +64 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +4 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.js +22 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +21 -0
- package/node_modules/engine.io-client/build/esm-debug/globals.node.js +91 -0
- package/node_modules/engine.io-client/build/esm-debug/index.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/index.js +15 -0
- package/node_modules/engine.io-client/build/esm-debug/package.json +10 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +482 -0
- package/node_modules/engine.io-client/build/esm-debug/socket.js +756 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +106 -0
- package/node_modules/engine.io-client/build/esm-debug/transport.js +145 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/index.js +8 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +15 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +56 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +108 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +276 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +11 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +17 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +52 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +158 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +36 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +128 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +14 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +41 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +18 -0
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +87 -0
- package/node_modules/engine.io-client/build/esm-debug/util.d.ts +7 -0
- package/node_modules/engine.io-client/build/esm-debug/util.js +59 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.js +3064 -0
- package/node_modules/engine.io-client/dist/engine.io.js.map +1 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js +7 -0
- package/node_modules/engine.io-client/dist/engine.io.min.js.map +1 -0
- package/node_modules/engine.io-client/node_modules/ws/LICENSE +20 -0
- package/node_modules/engine.io-client/node_modules/ws/README.md +548 -0
- package/node_modules/engine.io-client/node_modules/ws/browser.js +8 -0
- package/node_modules/engine.io-client/node_modules/ws/index.js +13 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/constants.js +18 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/sender.js +602 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/websocket-server.js +550 -0
- package/node_modules/engine.io-client/node_modules/ws/lib/websocket.js +1388 -0
- package/node_modules/engine.io-client/node_modules/ws/package.json +69 -0
- package/node_modules/engine.io-client/node_modules/ws/wrapper.mjs +8 -0
- package/node_modules/engine.io-client/package.json +95 -0
- package/node_modules/engine.io-parser/LICENSE +22 -0
- package/node_modules/engine.io-parser/Readme.md +158 -0
- package/node_modules/engine.io-parser/build/cjs/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/cjs/commons.js +19 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +48 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +66 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/cjs/decodePacket.js +59 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +72 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/cjs/encodePacket.js +38 -0
- package/node_modules/engine.io-parser/build/cjs/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/cjs/index.js +164 -0
- package/node_modules/engine.io-parser/build/cjs/package.json +8 -0
- package/node_modules/engine.io-parser/build/esm/commons.d.ts +14 -0
- package/node_modules/engine.io-parser/build/esm/commons.js +14 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +43 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +62 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +2 -0
- package/node_modules/engine.io-parser/build/esm/decodePacket.js +55 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +4 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +68 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +3 -0
- package/node_modules/engine.io-parser/build/esm/encodePacket.js +33 -0
- package/node_modules/engine.io-parser/build/esm/index.d.ts +9 -0
- package/node_modules/engine.io-parser/build/esm/index.js +156 -0
- package/node_modules/engine.io-parser/build/esm/package.json +8 -0
- package/node_modules/engine.io-parser/package.json +46 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/socket.io-client/LICENSE +21 -0
- package/node_modules/socket.io-client/README.md +29 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +4 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +69 -0
- package/node_modules/socket.io-client/build/cjs/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/cjs/index.js +76 -0
- package/node_modules/socket.io-client/build/cjs/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/cjs/manager.js +416 -0
- package/node_modules/socket.io-client/build/cjs/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/cjs/on.js +9 -0
- package/node_modules/socket.io-client/build/cjs/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/cjs/socket.js +909 -0
- package/node_modules/socket.io-client/build/cjs/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/cjs/url.js +69 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm/index.js +58 -0
- package/node_modules/socket.io-client/build/esm/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm/manager.js +367 -0
- package/node_modules/socket.io-client/build/esm/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm/on.js +6 -0
- package/node_modules/socket.io-client/build/esm/package.json +5 -0
- package/node_modules/socket.io-client/build/esm/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm/socket.js +880 -0
- package/node_modules/socket.io-client/build/esm/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm/url.js +59 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +2 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +12 -0
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +66 -0
- package/node_modules/socket.io-client/build/esm-debug/index.d.ts +29 -0
- package/node_modules/socket.io-client/build/esm-debug/index.js +62 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +295 -0
- package/node_modules/socket.io-client/build/esm-debug/manager.js +386 -0
- package/node_modules/socket.io-client/build/esm-debug/on.d.ts +2 -0
- package/node_modules/socket.io-client/build/esm-debug/on.js +6 -0
- package/node_modules/socket.io-client/build/esm-debug/package.json +5 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +593 -0
- package/node_modules/socket.io-client/build/esm-debug/socket.js +902 -0
- package/node_modules/socket.io-client/build/esm-debug/url.d.ts +33 -0
- package/node_modules/socket.io-client/build/esm-debug/url.js +63 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.js +4955 -0
- package/node_modules/socket.io-client/dist/socket.io.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +7 -0
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -0
- package/node_modules/socket.io-client/package.json +101 -0
- package/node_modules/socket.io-parser/LICENSE +20 -0
- package/node_modules/socket.io-parser/Readme.md +81 -0
- package/node_modules/socket.io-parser/build/cjs/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/cjs/binary.js +87 -0
- package/node_modules/socket.io-parser/build/cjs/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/cjs/index.js +359 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/cjs/is-binary.js +54 -0
- package/node_modules/socket.io-parser/build/cjs/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/esm/index.js +348 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm/package.json +3 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +20 -0
- package/node_modules/socket.io-parser/build/esm-debug/binary.js +83 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +91 -0
- package/node_modules/socket.io-parser/build/esm-debug/index.js +353 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +7 -0
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +50 -0
- package/node_modules/socket.io-parser/build/esm-debug/package.json +3 -0
- package/node_modules/socket.io-parser/package.json +44 -0
- package/node_modules/xmlhttprequest-ssl/LICENSE +22 -0
- package/node_modules/xmlhttprequest-ssl/README.md +67 -0
- package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +689 -0
- package/node_modules/xmlhttprequest-ssl/package.json +40 -0
- package/openclaw.plugin.json +17 -0
- package/package.json +61 -0
- package/skills/lightclaw-cron/SKILL.md +381 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { Socket as Engine, installTimerFunctions, nextTick, } from "engine.io-client";
|
|
2
|
+
import { Socket } from "./socket.js";
|
|
3
|
+
import * as parser from "socket.io-parser";
|
|
4
|
+
import { on } from "./on.js";
|
|
5
|
+
import { Backoff } from "./contrib/backo2.js";
|
|
6
|
+
import { Emitter, } from "@socket.io/component-emitter";
|
|
7
|
+
import debugModule from "debug"; // debug()
|
|
8
|
+
const debug = debugModule("socket.io-client:manager"); // debug()
|
|
9
|
+
export class Manager extends Emitter {
|
|
10
|
+
constructor(uri, opts) {
|
|
11
|
+
var _a;
|
|
12
|
+
super();
|
|
13
|
+
this.nsps = {};
|
|
14
|
+
this.subs = [];
|
|
15
|
+
if (uri && "object" === typeof uri) {
|
|
16
|
+
opts = uri;
|
|
17
|
+
uri = undefined;
|
|
18
|
+
}
|
|
19
|
+
opts = opts || {};
|
|
20
|
+
opts.path = opts.path || "/socket.io";
|
|
21
|
+
this.opts = opts;
|
|
22
|
+
installTimerFunctions(this, opts);
|
|
23
|
+
this.reconnection(opts.reconnection !== false);
|
|
24
|
+
this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
|
|
25
|
+
this.reconnectionDelay(opts.reconnectionDelay || 1000);
|
|
26
|
+
this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);
|
|
27
|
+
this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
|
|
28
|
+
this.backoff = new Backoff({
|
|
29
|
+
min: this.reconnectionDelay(),
|
|
30
|
+
max: this.reconnectionDelayMax(),
|
|
31
|
+
jitter: this.randomizationFactor(),
|
|
32
|
+
});
|
|
33
|
+
this.timeout(null == opts.timeout ? 20000 : opts.timeout);
|
|
34
|
+
this._readyState = "closed";
|
|
35
|
+
this.uri = uri;
|
|
36
|
+
const _parser = opts.parser || parser;
|
|
37
|
+
this.encoder = new _parser.Encoder();
|
|
38
|
+
this.decoder = new _parser.Decoder();
|
|
39
|
+
this._autoConnect = opts.autoConnect !== false;
|
|
40
|
+
if (this._autoConnect)
|
|
41
|
+
this.open();
|
|
42
|
+
}
|
|
43
|
+
reconnection(v) {
|
|
44
|
+
if (!arguments.length)
|
|
45
|
+
return this._reconnection;
|
|
46
|
+
this._reconnection = !!v;
|
|
47
|
+
if (!v) {
|
|
48
|
+
this.skipReconnect = true;
|
|
49
|
+
}
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
reconnectionAttempts(v) {
|
|
53
|
+
if (v === undefined)
|
|
54
|
+
return this._reconnectionAttempts;
|
|
55
|
+
this._reconnectionAttempts = v;
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
reconnectionDelay(v) {
|
|
59
|
+
var _a;
|
|
60
|
+
if (v === undefined)
|
|
61
|
+
return this._reconnectionDelay;
|
|
62
|
+
this._reconnectionDelay = v;
|
|
63
|
+
(_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
randomizationFactor(v) {
|
|
67
|
+
var _a;
|
|
68
|
+
if (v === undefined)
|
|
69
|
+
return this._randomizationFactor;
|
|
70
|
+
this._randomizationFactor = v;
|
|
71
|
+
(_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
reconnectionDelayMax(v) {
|
|
75
|
+
var _a;
|
|
76
|
+
if (v === undefined)
|
|
77
|
+
return this._reconnectionDelayMax;
|
|
78
|
+
this._reconnectionDelayMax = v;
|
|
79
|
+
(_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
timeout(v) {
|
|
83
|
+
if (!arguments.length)
|
|
84
|
+
return this._timeout;
|
|
85
|
+
this._timeout = v;
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Starts trying to reconnect if reconnection is enabled and we have not
|
|
90
|
+
* started reconnecting yet
|
|
91
|
+
*
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
maybeReconnectOnOpen() {
|
|
95
|
+
// Only try to reconnect if it's the first time we're connecting
|
|
96
|
+
if (!this._reconnecting &&
|
|
97
|
+
this._reconnection &&
|
|
98
|
+
this.backoff.attempts === 0) {
|
|
99
|
+
// keeps reconnection from firing twice for the same reconnection loop
|
|
100
|
+
this.reconnect();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Sets the current transport `socket`.
|
|
105
|
+
*
|
|
106
|
+
* @param {Function} fn - optional, callback
|
|
107
|
+
* @return self
|
|
108
|
+
* @public
|
|
109
|
+
*/
|
|
110
|
+
open(fn) {
|
|
111
|
+
debug("readyState %s", this._readyState);
|
|
112
|
+
if (~this._readyState.indexOf("open"))
|
|
113
|
+
return this;
|
|
114
|
+
debug("opening %s", this.uri);
|
|
115
|
+
this.engine = new Engine(this.uri, this.opts);
|
|
116
|
+
const socket = this.engine;
|
|
117
|
+
const self = this;
|
|
118
|
+
this._readyState = "opening";
|
|
119
|
+
this.skipReconnect = false;
|
|
120
|
+
// emit `open`
|
|
121
|
+
const openSubDestroy = on(socket, "open", function () {
|
|
122
|
+
self.onopen();
|
|
123
|
+
fn && fn();
|
|
124
|
+
});
|
|
125
|
+
const onError = (err) => {
|
|
126
|
+
debug("error");
|
|
127
|
+
this.cleanup();
|
|
128
|
+
this._readyState = "closed";
|
|
129
|
+
this.emitReserved("error", err);
|
|
130
|
+
if (fn) {
|
|
131
|
+
fn(err);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
// Only do this if there is no fn to handle the error
|
|
135
|
+
this.maybeReconnectOnOpen();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
// emit `error`
|
|
139
|
+
const errorSub = on(socket, "error", onError);
|
|
140
|
+
if (false !== this._timeout) {
|
|
141
|
+
const timeout = this._timeout;
|
|
142
|
+
debug("connect attempt will timeout after %d", timeout);
|
|
143
|
+
// set timer
|
|
144
|
+
const timer = this.setTimeoutFn(() => {
|
|
145
|
+
debug("connect attempt timed out after %d", timeout);
|
|
146
|
+
openSubDestroy();
|
|
147
|
+
onError(new Error("timeout"));
|
|
148
|
+
socket.close();
|
|
149
|
+
}, timeout);
|
|
150
|
+
if (this.opts.autoUnref) {
|
|
151
|
+
timer.unref();
|
|
152
|
+
}
|
|
153
|
+
this.subs.push(() => {
|
|
154
|
+
this.clearTimeoutFn(timer);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
this.subs.push(openSubDestroy);
|
|
158
|
+
this.subs.push(errorSub);
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Alias for open()
|
|
163
|
+
*
|
|
164
|
+
* @return self
|
|
165
|
+
* @public
|
|
166
|
+
*/
|
|
167
|
+
connect(fn) {
|
|
168
|
+
return this.open(fn);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Called upon transport open.
|
|
172
|
+
*
|
|
173
|
+
* @private
|
|
174
|
+
*/
|
|
175
|
+
onopen() {
|
|
176
|
+
debug("open");
|
|
177
|
+
// clear old subs
|
|
178
|
+
this.cleanup();
|
|
179
|
+
// mark as open
|
|
180
|
+
this._readyState = "open";
|
|
181
|
+
this.emitReserved("open");
|
|
182
|
+
// add new subs
|
|
183
|
+
const socket = this.engine;
|
|
184
|
+
this.subs.push(on(socket, "ping", this.onping.bind(this)), on(socket, "data", this.ondata.bind(this)), on(socket, "error", this.onerror.bind(this)), on(socket, "close", this.onclose.bind(this)),
|
|
185
|
+
// @ts-ignore
|
|
186
|
+
on(this.decoder, "decoded", this.ondecoded.bind(this)));
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Called upon a ping.
|
|
190
|
+
*
|
|
191
|
+
* @private
|
|
192
|
+
*/
|
|
193
|
+
onping() {
|
|
194
|
+
this.emitReserved("ping");
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Called with data.
|
|
198
|
+
*
|
|
199
|
+
* @private
|
|
200
|
+
*/
|
|
201
|
+
ondata(data) {
|
|
202
|
+
try {
|
|
203
|
+
this.decoder.add(data);
|
|
204
|
+
}
|
|
205
|
+
catch (e) {
|
|
206
|
+
this.onclose("parse error", e);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Called when parser fully decodes a packet.
|
|
211
|
+
*
|
|
212
|
+
* @private
|
|
213
|
+
*/
|
|
214
|
+
ondecoded(packet) {
|
|
215
|
+
// the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a "parse error"
|
|
216
|
+
nextTick(() => {
|
|
217
|
+
this.emitReserved("packet", packet);
|
|
218
|
+
}, this.setTimeoutFn);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Called upon socket error.
|
|
222
|
+
*
|
|
223
|
+
* @private
|
|
224
|
+
*/
|
|
225
|
+
onerror(err) {
|
|
226
|
+
debug("error", err);
|
|
227
|
+
this.emitReserved("error", err);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Creates a new socket for the given `nsp`.
|
|
231
|
+
*
|
|
232
|
+
* @return {Socket}
|
|
233
|
+
* @public
|
|
234
|
+
*/
|
|
235
|
+
socket(nsp, opts) {
|
|
236
|
+
let socket = this.nsps[nsp];
|
|
237
|
+
if (!socket) {
|
|
238
|
+
socket = new Socket(this, nsp, opts);
|
|
239
|
+
this.nsps[nsp] = socket;
|
|
240
|
+
}
|
|
241
|
+
else if (this._autoConnect && !socket.active) {
|
|
242
|
+
socket.connect();
|
|
243
|
+
}
|
|
244
|
+
return socket;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Called upon a socket close.
|
|
248
|
+
*
|
|
249
|
+
* @param socket
|
|
250
|
+
* @private
|
|
251
|
+
*/
|
|
252
|
+
_destroy(socket) {
|
|
253
|
+
const nsps = Object.keys(this.nsps);
|
|
254
|
+
for (const nsp of nsps) {
|
|
255
|
+
const socket = this.nsps[nsp];
|
|
256
|
+
if (socket.active) {
|
|
257
|
+
debug("socket %s is still active, skipping close", nsp);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
this._close();
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Writes a packet.
|
|
265
|
+
*
|
|
266
|
+
* @param packet
|
|
267
|
+
* @private
|
|
268
|
+
*/
|
|
269
|
+
_packet(packet) {
|
|
270
|
+
debug("writing packet %j", packet);
|
|
271
|
+
const encodedPackets = this.encoder.encode(packet);
|
|
272
|
+
for (let i = 0; i < encodedPackets.length; i++) {
|
|
273
|
+
this.engine.write(encodedPackets[i], packet.options);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Clean up transport subscriptions and packet buffer.
|
|
278
|
+
*
|
|
279
|
+
* @private
|
|
280
|
+
*/
|
|
281
|
+
cleanup() {
|
|
282
|
+
debug("cleanup");
|
|
283
|
+
this.subs.forEach((subDestroy) => subDestroy());
|
|
284
|
+
this.subs.length = 0;
|
|
285
|
+
this.decoder.destroy();
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Close the current socket.
|
|
289
|
+
*
|
|
290
|
+
* @private
|
|
291
|
+
*/
|
|
292
|
+
_close() {
|
|
293
|
+
debug("disconnect");
|
|
294
|
+
this.skipReconnect = true;
|
|
295
|
+
this._reconnecting = false;
|
|
296
|
+
this.onclose("forced close");
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Alias for close()
|
|
300
|
+
*
|
|
301
|
+
* @private
|
|
302
|
+
*/
|
|
303
|
+
disconnect() {
|
|
304
|
+
return this._close();
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Called when:
|
|
308
|
+
*
|
|
309
|
+
* - the low-level engine is closed
|
|
310
|
+
* - the parser encountered a badly formatted packet
|
|
311
|
+
* - all sockets are disconnected
|
|
312
|
+
*
|
|
313
|
+
* @private
|
|
314
|
+
*/
|
|
315
|
+
onclose(reason, description) {
|
|
316
|
+
var _a;
|
|
317
|
+
debug("closed due to %s", reason);
|
|
318
|
+
this.cleanup();
|
|
319
|
+
(_a = this.engine) === null || _a === void 0 ? void 0 : _a.close();
|
|
320
|
+
this.backoff.reset();
|
|
321
|
+
this._readyState = "closed";
|
|
322
|
+
this.emitReserved("close", reason, description);
|
|
323
|
+
if (this._reconnection && !this.skipReconnect) {
|
|
324
|
+
this.reconnect();
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Attempt a reconnection.
|
|
329
|
+
*
|
|
330
|
+
* @private
|
|
331
|
+
*/
|
|
332
|
+
reconnect() {
|
|
333
|
+
if (this._reconnecting || this.skipReconnect)
|
|
334
|
+
return this;
|
|
335
|
+
const self = this;
|
|
336
|
+
if (this.backoff.attempts >= this._reconnectionAttempts) {
|
|
337
|
+
debug("reconnect failed");
|
|
338
|
+
this.backoff.reset();
|
|
339
|
+
this.emitReserved("reconnect_failed");
|
|
340
|
+
this._reconnecting = false;
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
const delay = this.backoff.duration();
|
|
344
|
+
debug("will wait %dms before reconnect attempt", delay);
|
|
345
|
+
this._reconnecting = true;
|
|
346
|
+
const timer = this.setTimeoutFn(() => {
|
|
347
|
+
if (self.skipReconnect)
|
|
348
|
+
return;
|
|
349
|
+
debug("attempting reconnect");
|
|
350
|
+
this.emitReserved("reconnect_attempt", self.backoff.attempts);
|
|
351
|
+
// check again for the case socket closed in above events
|
|
352
|
+
if (self.skipReconnect)
|
|
353
|
+
return;
|
|
354
|
+
self.open((err) => {
|
|
355
|
+
if (err) {
|
|
356
|
+
debug("reconnect attempt error");
|
|
357
|
+
self._reconnecting = false;
|
|
358
|
+
self.reconnect();
|
|
359
|
+
this.emitReserved("reconnect_error", err);
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
debug("reconnect success");
|
|
363
|
+
self.onreconnect();
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}, delay);
|
|
367
|
+
if (this.opts.autoUnref) {
|
|
368
|
+
timer.unref();
|
|
369
|
+
}
|
|
370
|
+
this.subs.push(() => {
|
|
371
|
+
this.clearTimeoutFn(timer);
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Called upon successful reconnect.
|
|
377
|
+
*
|
|
378
|
+
* @private
|
|
379
|
+
*/
|
|
380
|
+
onreconnect() {
|
|
381
|
+
const attempt = this.backoff.attempts;
|
|
382
|
+
this._reconnecting = false;
|
|
383
|
+
this.backoff.reset();
|
|
384
|
+
this.emitReserved("reconnect", attempt);
|
|
385
|
+
}
|
|
386
|
+
}
|