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.
- package/README.md +0 -1
- package/dist/index.js +38 -31
- package/dist/setup-entry.js +32 -0
- package/dist/src/channel.js +301 -257
- package/dist/src/channel.setup.js +16 -0
- package/dist/src/config.js +31 -124
- package/dist/src/dedup.js +0 -1
- package/dist/src/download-tool.js +0 -1
- package/dist/src/file-storage.js +2 -2
- package/dist/src/gateway.js +226 -178
- package/dist/src/history/cron-utils.js +0 -1
- package/dist/src/history/index.js +0 -1
- package/dist/src/history/message-parser.js +0 -1
- package/dist/src/history/session-reader.js +3 -1
- package/dist/src/history/session-store.js +0 -1
- package/dist/src/history/text-processing.js +0 -1
- package/dist/src/history/types.js +0 -1
- package/dist/src/inbound.js +183 -234
- package/dist/src/media.js +0 -1
- package/dist/src/messaging.js +65 -0
- package/dist/src/outbound.js +131 -45
- package/dist/src/runtime.js +29 -11
- package/dist/src/setup-core.js +27 -0
- package/dist/src/shared.js +141 -0
- package/dist/src/socket/handlers.js +72 -49
- package/dist/src/socket/index.js +0 -1
- package/dist/src/socket/native-socket.js +385 -0
- package/dist/src/socket/registry.js +0 -1
- package/dist/src/socket/reliable-emitter.js +188 -50
- package/dist/src/streaming/delta-tracker.js +140 -0
- package/dist/src/streaming/index.js +12 -0
- package/dist/src/streaming/stream-reply-sink.js +387 -0
- package/dist/src/streaming/types.js +4 -0
- package/dist/src/tools.js +13 -0
- package/dist/src/types.js +23 -2
- package/dist/src/upload-tool.js +0 -1
- package/dist/src/utils/account.js +73 -0
- package/dist/src/utils/common.js +48 -0
- package/dist/src/utils/index.js +2 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/constants.js +1 -0
- package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/permessage-deflate.js +6 -6
- package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/websocket-server.js +10 -6
- package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/websocket.js +19 -14
- package/node_modules/{engine.io-client/node_modules/ws → ws}/package.json +4 -3
- package/node_modules/ws/wrapper.mjs +21 -0
- package/openclaw.plugin.json +0 -7
- package/package.json +8 -5
- package/dist/index.d.ts +0 -24
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/public/data/scripts/manifest.json +0 -11
- package/dist/public/data/scripts/upgrade.156d7999.sh +0 -384
- package/dist/public/data/scripts/upgrade.sh +0 -384
- package/dist/src/channel.d.ts +0 -11
- package/dist/src/channel.d.ts.map +0 -1
- package/dist/src/channel.js.map +0 -1
- package/dist/src/config.d.ts +0 -129
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js.map +0 -1
- package/dist/src/dedup.d.ts +0 -12
- package/dist/src/dedup.d.ts.map +0 -1
- package/dist/src/dedup.js.map +0 -1
- package/dist/src/download-tool.d.ts +0 -32
- package/dist/src/download-tool.d.ts.map +0 -1
- package/dist/src/download-tool.js.map +0 -1
- package/dist/src/file-storage.d.ts +0 -74
- package/dist/src/file-storage.d.ts.map +0 -1
- package/dist/src/file-storage.js.map +0 -1
- package/dist/src/format-urls.d.ts +0 -26
- package/dist/src/format-urls.d.ts.map +0 -1
- package/dist/src/format-urls.js +0 -53
- package/dist/src/format-urls.js.map +0 -1
- package/dist/src/gateway.d.ts +0 -16
- package/dist/src/gateway.d.ts.map +0 -1
- package/dist/src/gateway.js.map +0 -1
- package/dist/src/history/cron-utils.d.ts +0 -76
- package/dist/src/history/cron-utils.d.ts.map +0 -1
- package/dist/src/history/cron-utils.js.map +0 -1
- package/dist/src/history/index.d.ts +0 -20
- package/dist/src/history/index.d.ts.map +0 -1
- package/dist/src/history/index.js.map +0 -1
- package/dist/src/history/message-parser.d.ts +0 -52
- package/dist/src/history/message-parser.d.ts.map +0 -1
- package/dist/src/history/message-parser.js.map +0 -1
- package/dist/src/history/session-reader.d.ts +0 -58
- package/dist/src/history/session-reader.d.ts.map +0 -1
- package/dist/src/history/session-reader.js.map +0 -1
- package/dist/src/history/session-store.d.ts +0 -42
- package/dist/src/history/session-store.d.ts.map +0 -1
- package/dist/src/history/session-store.js.map +0 -1
- package/dist/src/history/text-processing.d.ts +0 -41
- package/dist/src/history/text-processing.d.ts.map +0 -1
- package/dist/src/history/text-processing.js.map +0 -1
- package/dist/src/history/types.d.ts +0 -134
- package/dist/src/history/types.d.ts.map +0 -1
- package/dist/src/history/types.js.map +0 -1
- package/dist/src/inbound.d.ts +0 -18
- package/dist/src/inbound.d.ts.map +0 -1
- package/dist/src/inbound.js.map +0 -1
- package/dist/src/media.d.ts +0 -12
- package/dist/src/media.d.ts.map +0 -1
- package/dist/src/media.js.map +0 -1
- package/dist/src/outbound.d.ts +0 -28
- package/dist/src/outbound.d.ts.map +0 -1
- package/dist/src/outbound.js.map +0 -1
- package/dist/src/runtime.d.ts +0 -4
- package/dist/src/runtime.d.ts.map +0 -1
- package/dist/src/runtime.js.map +0 -1
- package/dist/src/socket/handlers.d.ts +0 -26
- package/dist/src/socket/handlers.d.ts.map +0 -1
- package/dist/src/socket/handlers.js.map +0 -1
- package/dist/src/socket/index.d.ts +0 -11
- package/dist/src/socket/index.d.ts.map +0 -1
- package/dist/src/socket/index.js.map +0 -1
- package/dist/src/socket/registry.d.ts +0 -59
- package/dist/src/socket/registry.d.ts.map +0 -1
- package/dist/src/socket/registry.js.map +0 -1
- package/dist/src/socket/reliable-emitter.d.ts +0 -79
- package/dist/src/socket/reliable-emitter.d.ts.map +0 -1
- package/dist/src/socket/reliable-emitter.js.map +0 -1
- package/dist/src/types.d.ts +0 -112
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js.map +0 -1
- package/dist/src/upload-tool.d.ts +0 -27
- package/dist/src/upload-tool.d.ts.map +0 -1
- package/dist/src/upload-tool.js.map +0 -1
- package/node_modules/@socket.io/component-emitter/LICENSE +0 -24
- package/node_modules/@socket.io/component-emitter/Readme.md +0 -79
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +0 -179
- package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +0 -176
- package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +0 -4
- package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +0 -179
- package/node_modules/@socket.io/component-emitter/lib/esm/index.js +0 -169
- package/node_modules/@socket.io/component-emitter/lib/esm/package.json +0 -4
- package/node_modules/@socket.io/component-emitter/package.json +0 -28
- package/node_modules/debug/LICENSE +0 -20
- package/node_modules/debug/README.md +0 -481
- package/node_modules/debug/package.json +0 -64
- package/node_modules/debug/src/browser.js +0 -272
- package/node_modules/debug/src/common.js +0 -292
- package/node_modules/debug/src/index.js +0 -10
- package/node_modules/debug/src/node.js +0 -263
- package/node_modules/engine.io-client/LICENSE +0 -22
- package/node_modules/engine.io-client/README.md +0 -331
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +0 -3
- package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +0 -4
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +0 -1
- package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +0 -14
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +0 -15
- package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +0 -38
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +0 -1
- package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +0 -67
- package/node_modules/engine.io-client/build/cjs/globals.d.ts +0 -4
- package/node_modules/engine.io-client/build/cjs/globals.js +0 -26
- package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +0 -21
- package/node_modules/engine.io-client/build/cjs/globals.node.js +0 -97
- package/node_modules/engine.io-client/build/cjs/index.d.ts +0 -15
- package/node_modules/engine.io-client/build/cjs/index.js +0 -32
- package/node_modules/engine.io-client/build/cjs/package.json +0 -10
- package/node_modules/engine.io-client/build/cjs/socket.d.ts +0 -482
- package/node_modules/engine.io-client/build/cjs/socket.js +0 -765
- package/node_modules/engine.io-client/build/cjs/transport.d.ts +0 -106
- package/node_modules/engine.io-client/build/cjs/transport.js +0 -153
- package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +0 -8
- package/node_modules/engine.io-client/build/cjs/transports/index.js +0 -11
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +0 -15
- package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +0 -60
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +0 -108
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +0 -285
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +0 -11
- package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +0 -44
- package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +0 -52
- package/node_modules/engine.io-client/build/cjs/transports/polling.js +0 -165
- package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +0 -36
- package/node_modules/engine.io-client/build/cjs/transports/websocket.js +0 -136
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +0 -14
- package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +0 -68
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +0 -18
- package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +0 -94
- package/node_modules/engine.io-client/build/cjs/util.d.ts +0 -7
- package/node_modules/engine.io-client/build/cjs/util.js +0 -65
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +0 -3
- package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +0 -2
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +0 -1
- package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +0 -11
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +0 -15
- package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +0 -34
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +0 -1
- package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +0 -64
- package/node_modules/engine.io-client/build/esm/globals.d.ts +0 -4
- package/node_modules/engine.io-client/build/esm/globals.js +0 -22
- package/node_modules/engine.io-client/build/esm/globals.node.d.ts +0 -21
- package/node_modules/engine.io-client/build/esm/globals.node.js +0 -91
- package/node_modules/engine.io-client/build/esm/index.d.ts +0 -15
- package/node_modules/engine.io-client/build/esm/index.js +0 -15
- package/node_modules/engine.io-client/build/esm/package.json +0 -10
- package/node_modules/engine.io-client/build/esm/socket.d.ts +0 -482
- package/node_modules/engine.io-client/build/esm/socket.js +0 -727
- package/node_modules/engine.io-client/build/esm/transport.d.ts +0 -106
- package/node_modules/engine.io-client/build/esm/transport.js +0 -142
- package/node_modules/engine.io-client/build/esm/transports/index.d.ts +0 -8
- package/node_modules/engine.io-client/build/esm/transports/index.js +0 -8
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +0 -15
- package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +0 -56
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +0 -108
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +0 -271
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +0 -11
- package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +0 -17
- package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +0 -52
- package/node_modules/engine.io-client/build/esm/transports/polling.js +0 -145
- package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +0 -36
- package/node_modules/engine.io-client/build/esm/transports/websocket.js +0 -125
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +0 -14
- package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +0 -41
- package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +0 -18
- package/node_modules/engine.io-client/build/esm/transports/webtransport.js +0 -80
- package/node_modules/engine.io-client/build/esm/util.d.ts +0 -7
- package/node_modules/engine.io-client/build/esm/util.js +0 -59
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +0 -3
- package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +0 -2
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +0 -1
- package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +0 -11
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +0 -15
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +0 -34
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +0 -1
- package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +0 -64
- package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +0 -4
- package/node_modules/engine.io-client/build/esm-debug/globals.js +0 -22
- package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +0 -21
- package/node_modules/engine.io-client/build/esm-debug/globals.node.js +0 -91
- package/node_modules/engine.io-client/build/esm-debug/index.d.ts +0 -15
- package/node_modules/engine.io-client/build/esm-debug/index.js +0 -15
- package/node_modules/engine.io-client/build/esm-debug/package.json +0 -10
- package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +0 -482
- package/node_modules/engine.io-client/build/esm-debug/socket.js +0 -756
- package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +0 -106
- package/node_modules/engine.io-client/build/esm-debug/transport.js +0 -145
- package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +0 -8
- package/node_modules/engine.io-client/build/esm-debug/transports/index.js +0 -8
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +0 -15
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +0 -56
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +0 -108
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +0 -276
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +0 -11
- package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +0 -17
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +0 -52
- package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +0 -158
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +0 -36
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +0 -128
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +0 -14
- package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +0 -41
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +0 -18
- package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +0 -87
- package/node_modules/engine.io-client/build/esm-debug/util.d.ts +0 -7
- package/node_modules/engine.io-client/build/esm-debug/util.js +0 -59
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js +0 -7
- package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +0 -1
- package/node_modules/engine.io-client/dist/engine.io.js +0 -3064
- package/node_modules/engine.io-client/dist/engine.io.js.map +0 -1
- package/node_modules/engine.io-client/dist/engine.io.min.js +0 -7
- package/node_modules/engine.io-client/dist/engine.io.min.js.map +0 -1
- package/node_modules/engine.io-client/node_modules/ws/index.js +0 -13
- package/node_modules/engine.io-client/node_modules/ws/wrapper.mjs +0 -8
- package/node_modules/engine.io-client/package.json +0 -95
- package/node_modules/engine.io-parser/LICENSE +0 -22
- package/node_modules/engine.io-parser/Readme.md +0 -158
- package/node_modules/engine.io-parser/build/cjs/commons.d.ts +0 -14
- package/node_modules/engine.io-parser/build/cjs/commons.js +0 -19
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +0 -2
- package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +0 -48
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +0 -2
- package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +0 -66
- package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +0 -2
- package/node_modules/engine.io-parser/build/cjs/decodePacket.js +0 -59
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +0 -4
- package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +0 -72
- package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +0 -3
- package/node_modules/engine.io-parser/build/cjs/encodePacket.js +0 -38
- package/node_modules/engine.io-parser/build/cjs/index.d.ts +0 -9
- package/node_modules/engine.io-parser/build/cjs/index.js +0 -164
- package/node_modules/engine.io-parser/build/cjs/package.json +0 -8
- package/node_modules/engine.io-parser/build/esm/commons.d.ts +0 -14
- package/node_modules/engine.io-parser/build/esm/commons.js +0 -14
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +0 -2
- package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +0 -43
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +0 -2
- package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +0 -62
- package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +0 -2
- package/node_modules/engine.io-parser/build/esm/decodePacket.js +0 -55
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +0 -4
- package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +0 -68
- package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +0 -3
- package/node_modules/engine.io-parser/build/esm/encodePacket.js +0 -33
- package/node_modules/engine.io-parser/build/esm/index.d.ts +0 -9
- package/node_modules/engine.io-parser/build/esm/index.js +0 -156
- package/node_modules/engine.io-parser/build/esm/package.json +0 -8
- package/node_modules/engine.io-parser/package.json +0 -46
- package/node_modules/ms/index.js +0 -162
- package/node_modules/ms/license.md +0 -21
- package/node_modules/ms/package.json +0 -38
- package/node_modules/ms/readme.md +0 -59
- package/node_modules/socket.io-client/LICENSE +0 -21
- package/node_modules/socket.io-client/README.md +0 -29
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +0 -2
- package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +0 -4
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +0 -12
- package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +0 -69
- package/node_modules/socket.io-client/build/cjs/index.d.ts +0 -29
- package/node_modules/socket.io-client/build/cjs/index.js +0 -76
- package/node_modules/socket.io-client/build/cjs/manager.d.ts +0 -295
- package/node_modules/socket.io-client/build/cjs/manager.js +0 -416
- package/node_modules/socket.io-client/build/cjs/on.d.ts +0 -2
- package/node_modules/socket.io-client/build/cjs/on.js +0 -9
- package/node_modules/socket.io-client/build/cjs/socket.d.ts +0 -593
- package/node_modules/socket.io-client/build/cjs/socket.js +0 -909
- package/node_modules/socket.io-client/build/cjs/url.d.ts +0 -33
- package/node_modules/socket.io-client/build/cjs/url.js +0 -69
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +0 -2
- package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +0 -2
- package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +0 -12
- package/node_modules/socket.io-client/build/esm/contrib/backo2.js +0 -66
- package/node_modules/socket.io-client/build/esm/index.d.ts +0 -29
- package/node_modules/socket.io-client/build/esm/index.js +0 -58
- package/node_modules/socket.io-client/build/esm/manager.d.ts +0 -295
- package/node_modules/socket.io-client/build/esm/manager.js +0 -367
- package/node_modules/socket.io-client/build/esm/on.d.ts +0 -2
- package/node_modules/socket.io-client/build/esm/on.js +0 -6
- package/node_modules/socket.io-client/build/esm/package.json +0 -5
- package/node_modules/socket.io-client/build/esm/socket.d.ts +0 -593
- package/node_modules/socket.io-client/build/esm/socket.js +0 -880
- package/node_modules/socket.io-client/build/esm/url.d.ts +0 -33
- package/node_modules/socket.io-client/build/esm/url.js +0 -59
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +0 -2
- package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +0 -2
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +0 -12
- package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +0 -66
- package/node_modules/socket.io-client/build/esm-debug/index.d.ts +0 -29
- package/node_modules/socket.io-client/build/esm-debug/index.js +0 -62
- package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +0 -295
- package/node_modules/socket.io-client/build/esm-debug/manager.js +0 -386
- package/node_modules/socket.io-client/build/esm-debug/on.d.ts +0 -2
- package/node_modules/socket.io-client/build/esm-debug/on.js +0 -6
- package/node_modules/socket.io-client/build/esm-debug/package.json +0 -5
- package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +0 -593
- package/node_modules/socket.io-client/build/esm-debug/socket.js +0 -902
- package/node_modules/socket.io-client/build/esm-debug/url.d.ts +0 -33
- package/node_modules/socket.io-client/build/esm-debug/url.js +0 -63
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js +0 -7
- package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +0 -1
- package/node_modules/socket.io-client/dist/socket.io.js +0 -4955
- package/node_modules/socket.io-client/dist/socket.io.js.map +0 -1
- package/node_modules/socket.io-client/dist/socket.io.min.js +0 -7
- package/node_modules/socket.io-client/dist/socket.io.min.js.map +0 -1
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +0 -7
- package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +0 -1
- package/node_modules/socket.io-client/package.json +0 -101
- package/node_modules/socket.io-parser/LICENSE +0 -20
- package/node_modules/socket.io-parser/Readme.md +0 -81
- package/node_modules/socket.io-parser/build/cjs/binary.d.ts +0 -20
- package/node_modules/socket.io-parser/build/cjs/binary.js +0 -87
- package/node_modules/socket.io-parser/build/cjs/index.d.ts +0 -101
- package/node_modules/socket.io-parser/build/cjs/index.js +0 -367
- package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +0 -7
- package/node_modules/socket.io-parser/build/cjs/is-binary.js +0 -54
- package/node_modules/socket.io-parser/build/cjs/package.json +0 -3
- package/node_modules/socket.io-parser/build/esm/binary.d.ts +0 -20
- package/node_modules/socket.io-parser/build/esm/binary.js +0 -83
- package/node_modules/socket.io-parser/build/esm/index.d.ts +0 -101
- package/node_modules/socket.io-parser/build/esm/index.js +0 -356
- package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +0 -7
- package/node_modules/socket.io-parser/build/esm/is-binary.js +0 -50
- package/node_modules/socket.io-parser/build/esm/package.json +0 -3
- package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +0 -20
- package/node_modules/socket.io-parser/build/esm-debug/binary.js +0 -83
- package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +0 -101
- package/node_modules/socket.io-parser/build/esm-debug/index.js +0 -361
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +0 -7
- package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +0 -50
- package/node_modules/socket.io-parser/build/esm-debug/package.json +0 -3
- package/node_modules/socket.io-parser/package.json +0 -44
- package/node_modules/xmlhttprequest-ssl/LICENSE +0 -22
- package/node_modules/xmlhttprequest-ssl/README.md +0 -67
- package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +0 -689
- package/node_modules/xmlhttprequest-ssl/package.json +0 -40
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/LICENSE +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/README.md +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/browser.js +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/buffer-util.js +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/event-target.js +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/extension.js +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/limiter.js +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/receiver.js +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/sender.js +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/stream.js +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/subprotocol.js +0 -0
- /package/node_modules/{engine.io-client/node_modules/ws → ws}/lib/validation.js +0 -0
package/dist/src/config.js
CHANGED
|
@@ -6,24 +6,27 @@
|
|
|
6
6
|
*
|
|
7
7
|
* 配置示例 (~/.openclaw/openclaw.json):
|
|
8
8
|
* ```json
|
|
9
|
-
"channels": {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
9
|
+
* "channels": {
|
|
10
|
+
* "lightclawbot": {
|
|
11
|
+
* "enabled": true,
|
|
12
|
+
* "accounts": {
|
|
13
|
+
* "100013456706": { "apiKey": "key-1" },
|
|
14
|
+
* "100013456707": { "apiKey": "key-2" }
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
15
18
|
* ```
|
|
19
|
+
*
|
|
20
|
+
* @format
|
|
16
21
|
*/
|
|
17
|
-
export const CHANNEL_KEY =
|
|
18
|
-
export const DEFAULT_ACCOUNT_ID =
|
|
19
|
-
|
|
20
|
-
const ENV_API_KEY = "LIGHTCLAW_API_KEY";
|
|
21
|
-
const ENV_API_BASE_URL = "LIGHTCLAW_API_BASE_URL";
|
|
22
|
+
export const CHANNEL_KEY = 'lightclawbot';
|
|
23
|
+
export const DEFAULT_ACCOUNT_ID = 'default';
|
|
24
|
+
export const DEFAULT_AGENT_ID = 'main';
|
|
22
25
|
// ============================================================
|
|
23
26
|
// 域名 & URL 配置
|
|
24
27
|
// ============================================================
|
|
25
28
|
/** 核心服务域名 */
|
|
26
|
-
export const DOMAIN =
|
|
29
|
+
export const DOMAIN = 'lightai.cloud.tencent.com';
|
|
27
30
|
/** WebSocket 连接地址 */
|
|
28
31
|
export const WS_URL = `wss://${DOMAIN}`;
|
|
29
32
|
/** HTTP API 基础地址 */
|
|
@@ -31,11 +34,11 @@ export const API_BASE_URL = `https://${DOMAIN}`;
|
|
|
31
34
|
/** 文件存储相关配置 */
|
|
32
35
|
export const COS_BASE_URL = `https://${DOMAIN}`;
|
|
33
36
|
// ============================================================
|
|
34
|
-
//
|
|
37
|
+
// WebSocket 配置
|
|
35
38
|
// ============================================================
|
|
36
|
-
/**
|
|
37
|
-
export const SOCKET_PATH =
|
|
38
|
-
/**
|
|
39
|
+
/** WebSocket 连接路径 */
|
|
40
|
+
export const SOCKET_PATH = '/ws/agent';
|
|
41
|
+
/** WebSocket 重连策略 */
|
|
39
42
|
export const SOCKET_RECONNECTION_DELAY = 1000;
|
|
40
43
|
export const SOCKET_RECONNECTION_DELAY_MAX = 30000;
|
|
41
44
|
export const SOCKET_RECONNECTION_ATTEMPTS = Infinity;
|
|
@@ -43,27 +46,13 @@ export const SOCKET_RECONNECTION_ATTEMPTS = Infinity;
|
|
|
43
46
|
// HTTP Header 配置
|
|
44
47
|
// ============================================================
|
|
45
48
|
/** 产品标识 header 值,用于 x-product header */
|
|
46
|
-
export const X_PRODUCT =
|
|
47
|
-
/** 构建通用认证 headers */
|
|
48
|
-
export function buildAuthHeaders(apiKey) {
|
|
49
|
-
return {
|
|
50
|
-
authorization: `Bearer ${apiKey}`,
|
|
51
|
-
"x-product": X_PRODUCT,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/** WS 多 key 认证 headers(authorizations 为 JSON 数组字符串,不带 Bearer) */
|
|
55
|
-
export function buildMultiAuthHeaders(apiKeys) {
|
|
56
|
-
return {
|
|
57
|
-
authorizations: apiKeys.map(key => `Bearer ${key}`),
|
|
58
|
-
"x-product": X_PRODUCT,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
49
|
+
export const X_PRODUCT = 'channel';
|
|
61
50
|
// ============================================================
|
|
62
51
|
// 全局 uin → apiKey 映射管理
|
|
63
52
|
// ============================================================
|
|
64
53
|
/** 全局 uin→apiKey 映射(gateway 启动时构建,工具执行时读取) */
|
|
65
54
|
let globalApiKeyMap = new Map();
|
|
66
|
-
let globalDefaultApiKey =
|
|
55
|
+
let globalDefaultApiKey = '';
|
|
67
56
|
/** sessionKey → apiKey 直接映射(inbound 处理时写入,tool 执行时读取) */
|
|
68
57
|
const sessionKeyToApiKey = new Map();
|
|
69
58
|
/** 设置 apiKeyMap(gateway 启动时调用) */
|
|
@@ -127,11 +116,11 @@ export function extractUinFromSessionKey(sessionKey) {
|
|
|
127
116
|
return undefined;
|
|
128
117
|
const lower = sessionKey.toLowerCase();
|
|
129
118
|
// 新格式:查找 ":direct:<peerId>" 片段
|
|
130
|
-
const directIdx = lower.indexOf(
|
|
119
|
+
const directIdx = lower.indexOf(':direct:');
|
|
131
120
|
if (directIdx >= 0) {
|
|
132
|
-
const afterDirect = sessionKey.slice(directIdx +
|
|
121
|
+
const afterDirect = sessionKey.slice(directIdx + ':direct:'.length);
|
|
133
122
|
// peerId 可能后面还跟着 ":thread:xxx" 等后缀,取第一段
|
|
134
|
-
const peerId = afterDirect.split(
|
|
123
|
+
const peerId = afterDirect.split(':')[0];
|
|
135
124
|
return peerId || undefined;
|
|
136
125
|
}
|
|
137
126
|
// 旧格式兼容:lightclawbot:dm:<peerId>
|
|
@@ -145,38 +134,25 @@ export function extractUinFromSessionKey(sessionKey) {
|
|
|
145
134
|
// API 路径配置
|
|
146
135
|
// ============================================================
|
|
147
136
|
/** 获取当前用户信息(用于提取 botId) */
|
|
148
|
-
export const API_PATH_USER_CURRENT =
|
|
137
|
+
export const API_PATH_USER_CURRENT = '/cgi/ticket';
|
|
149
138
|
/** 文件上传接口 */
|
|
150
|
-
export const API_PATH_UPLOAD =
|
|
139
|
+
export const API_PATH_UPLOAD = '/drive/save';
|
|
151
140
|
/** 文件下载接口 */
|
|
152
|
-
export const API_PATH_DOWNLOAD =
|
|
141
|
+
export const API_PATH_DOWNLOAD = '/drive/preview';
|
|
153
142
|
// ============================================================
|
|
154
|
-
//
|
|
143
|
+
// WebSocket 事件名
|
|
155
144
|
// ============================================================
|
|
156
|
-
export const EVENT_MESSAGE_PRIVATE =
|
|
157
|
-
export const EVENT_HISTORY_REQUEST =
|
|
158
|
-
export const EVENT_HISTORY_RESPONSE =
|
|
159
|
-
export const EVENT_SESSIONS_REQUEST = "sessions:request";
|
|
160
|
-
export const EVENT_SESSIONS_RESPONSE = "sessions:response";
|
|
145
|
+
export const EVENT_MESSAGE_PRIVATE = 'message:private';
|
|
146
|
+
export const EVENT_HISTORY_REQUEST = 'message:history:request';
|
|
147
|
+
export const EVENT_HISTORY_RESPONSE = 'message:history:response';
|
|
161
148
|
// ============================================================
|
|
162
149
|
// 超时 & 限制配置
|
|
163
150
|
// ============================================================
|
|
164
|
-
/** AI 回复超时时间(ms) */
|
|
165
|
-
export const REPLY_TIMEOUT = 120_000;
|
|
166
151
|
/** 文件上传超时时间(ms) */
|
|
167
152
|
export const UPLOAD_TIMEOUT = 120_000;
|
|
168
153
|
/** 媒体文件最大字节数(100MB) */
|
|
169
154
|
export const MEDIA_MAX_BYTES = 100 * 1024 * 1024;
|
|
170
155
|
// ============================================================
|
|
171
|
-
// 消息队列配置
|
|
172
|
-
// ============================================================
|
|
173
|
-
/** 消息队列最大容量 */
|
|
174
|
-
export const MESSAGE_QUEUE_SIZE = 1000;
|
|
175
|
-
/** 队列警告阈值 */
|
|
176
|
-
export const MESSAGE_QUEUE_WARN_THRESHOLD = 800;
|
|
177
|
-
/** 队列轮询间隔(ms) */
|
|
178
|
-
export const QUEUE_POLL_INTERVAL = 200;
|
|
179
|
-
// ============================================================
|
|
180
156
|
// 去重 & 节流配置
|
|
181
157
|
// ============================================================
|
|
182
158
|
/** 消息去重 TTL(ms) */
|
|
@@ -211,74 +187,6 @@ export const EMIT_RETRY_BASE_DELAY = 2_000;
|
|
|
211
187
|
export const EMIT_RETRY_MAX_DELAY = 15_000;
|
|
212
188
|
/** 最大待确认消息数,超出时丢弃最早的 */
|
|
213
189
|
export const EMIT_PENDING_MAX = 500;
|
|
214
|
-
/** 获取 channel 配置段 */
|
|
215
|
-
function getChannelSection(cfg) {
|
|
216
|
-
return (cfg.channels?.[CHANNEL_KEY] ?? {});
|
|
217
|
-
}
|
|
218
|
-
/** 列出所有账户 ID */
|
|
219
|
-
export function listAccountIds(cfg) {
|
|
220
|
-
const section = getChannelSection(cfg);
|
|
221
|
-
if (!section)
|
|
222
|
-
return [];
|
|
223
|
-
const ids = [];
|
|
224
|
-
// 默认账户:顶层有 apiKeys 即视为存在
|
|
225
|
-
const keys = section.apiKeys;
|
|
226
|
-
if (Array.isArray(keys) && keys.length > 0) {
|
|
227
|
-
ids.push(DEFAULT_ACCOUNT_ID);
|
|
228
|
-
}
|
|
229
|
-
// 命名账户
|
|
230
|
-
const accounts = section.accounts;
|
|
231
|
-
if (accounts && typeof accounts === "object") {
|
|
232
|
-
ids.push(...Object.keys(accounts));
|
|
233
|
-
}
|
|
234
|
-
return ids;
|
|
235
|
-
}
|
|
236
|
-
/** 解析单个账户 */
|
|
237
|
-
export function resolveAccount(cfg, accountId) {
|
|
238
|
-
const section = getChannelSection(cfg);
|
|
239
|
-
const id = accountId?.trim() || DEFAULT_ACCOUNT_ID;
|
|
240
|
-
// 获取原始配置
|
|
241
|
-
let raw;
|
|
242
|
-
if (id === DEFAULT_ACCOUNT_ID) {
|
|
243
|
-
raw = section;
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
const accounts = section.accounts;
|
|
247
|
-
raw = accounts?.[id] ?? {};
|
|
248
|
-
}
|
|
249
|
-
// 解析 apiKeys(配置中只有 apiKeys,不会有 apiKey)
|
|
250
|
-
const allApiKeys = Array.isArray(raw.apiKeys) ? raw.apiKeys.filter(Boolean) : [];
|
|
251
|
-
// 主 key = apiKeys[0],环境变量作为兜底
|
|
252
|
-
const apiKey = allApiKeys[0] || process.env[ENV_API_KEY] || "";
|
|
253
|
-
const apiBaseUrl = raw.apiBaseUrl || process.env[ENV_API_BASE_URL] || "";
|
|
254
|
-
// 如果环境变量提供了 key 且 allApiKeys 为空,补入
|
|
255
|
-
if (!allApiKeys.length && apiKey) {
|
|
256
|
-
allApiKeys.push(apiKey);
|
|
257
|
-
}
|
|
258
|
-
let secretSource = "none";
|
|
259
|
-
if (allApiKeys.length > 0) {
|
|
260
|
-
secretSource = "config";
|
|
261
|
-
}
|
|
262
|
-
else if (process.env[ENV_API_KEY]) {
|
|
263
|
-
secretSource = "env";
|
|
264
|
-
}
|
|
265
|
-
return {
|
|
266
|
-
accountId: id,
|
|
267
|
-
apiKey,
|
|
268
|
-
allApiKeys,
|
|
269
|
-
apiBaseUrl,
|
|
270
|
-
enabled: raw.enabled ?? true,
|
|
271
|
-
name: raw.name,
|
|
272
|
-
dmPolicy: raw.dmPolicy ?? "open",
|
|
273
|
-
allowFrom: raw.allowFrom ?? ["*"],
|
|
274
|
-
systemPrompt: raw.systemPrompt,
|
|
275
|
-
secretSource,
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
/** 获取默认账户 ID */
|
|
279
|
-
export function defaultAccountId(_cfg) {
|
|
280
|
-
return DEFAULT_ACCOUNT_ID;
|
|
281
|
-
}
|
|
282
190
|
/** 应用账户配置(setup 命令使用) */
|
|
283
191
|
export function applyAccountConfig(cfg, accountId, updates) {
|
|
284
192
|
const nextCfg = { ...cfg };
|
|
@@ -296,4 +204,3 @@ export function applyAccountConfig(cfg, accountId, updates) {
|
|
|
296
204
|
nextCfg.channels = nextChannels;
|
|
297
205
|
return nextCfg;
|
|
298
206
|
}
|
|
299
|
-
//# sourceMappingURL=config.js.map
|
package/dist/src/dedup.js
CHANGED
package/dist/src/file-storage.js
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
import * as fs from "node:fs";
|
|
11
11
|
import * as path from "node:path";
|
|
12
12
|
import { guessMimeByExt } from "./media.js";
|
|
13
|
-
import { COS_BASE_URL, API_PATH_UPLOAD, API_PATH_DOWNLOAD, UPLOAD_TIMEOUT,
|
|
13
|
+
import { COS_BASE_URL, API_PATH_UPLOAD, API_PATH_DOWNLOAD, UPLOAD_TIMEOUT, } from "./config.js";
|
|
14
|
+
import { buildAuthHeaders } from './utils/index.js';
|
|
14
15
|
// ============================================================
|
|
15
16
|
// 核心方法
|
|
16
17
|
// ============================================================
|
|
@@ -156,4 +157,3 @@ export async function uploadAndGetPublicUrl(localPath, config = {}) {
|
|
|
156
157
|
const result = await uploadFileToCos(localPath, config);
|
|
157
158
|
return result.url || '';
|
|
158
159
|
}
|
|
159
|
-
//# sourceMappingURL=file-storage.js.map
|