@luckylillia-dev/luckylillia 0.0.0-stage → 9.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/chunks/preload-helper-D5R8FHQt.js +342 -0
- package/chunks/preload-helper-D5R8FHQt.js.map +1 -0
- package/default_config.json +83 -0
- package/llbot-core.js +35013 -0
- package/llbot-core.js.map +1 -0
- package/llbot.js +138 -0
- package/llbot.js.map +1 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/commands.d.ts +86 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/commands.js +1 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/config.d.ts +14 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/config.js +1 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/ffmpeg.d.ts +41 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/ffmpeg.js +1 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/http.d.ts +88 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/http.js +1 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/index.d.ts +17 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/index.js +6 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/internal.d.ts +430 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/internal.js +7 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/manifest.d.ts +68 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/manifest.js +1 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/server.d.ts +23 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/server.js +1 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/storage.d.ts +21 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/storage.js +1 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/testing.d.ts +71 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/testing.js +1123 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/universal.d.ts +299 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/universal.js +1 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/webui.d.ts +762 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/webui.js +9 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/package.json +63 -0
- package/node_modules/@satorijs/element/jsx-dev-runtime.d.ts +3 -0
- package/node_modules/@satorijs/element/jsx-runtime.d.ts +3 -0
- package/node_modules/@satorijs/element/lib/index.cjs +447 -0
- package/node_modules/@satorijs/element/lib/index.d.ts +116 -0
- package/node_modules/@satorijs/element/lib/index.mjs +455 -0
- package/node_modules/@satorijs/element/package.json +60 -0
- package/node_modules/@satorijs/element/src/index.ts +559 -0
- package/node_modules/@satorijs/protocol/lib/index.cjs +187 -0
- package/node_modules/@satorijs/protocol/lib/index.d.ts +328 -0
- package/node_modules/@satorijs/protocol/lib/index.mjs +148 -0
- package/node_modules/@satorijs/protocol/package.json +44 -0
- package/node_modules/@satorijs/protocol/src/index.ts +513 -0
- package/node_modules/@standard-schema/spec/LICENSE +21 -0
- package/node_modules/@standard-schema/spec/README.md +198 -0
- package/node_modules/@standard-schema/spec/dist/index.cjs +18 -0
- package/node_modules/@standard-schema/spec/dist/index.d.cts +119 -0
- package/node_modules/@standard-schema/spec/dist/index.d.ts +119 -0
- package/node_modules/@standard-schema/spec/dist/index.js +0 -0
- package/node_modules/@standard-schema/spec/package.json +52 -0
- package/node_modules/cordis/README.md +10 -0
- package/node_modules/cordis/bin.js +16 -0
- package/node_modules/cordis/lib/context.d.ts +32 -0
- package/node_modules/cordis/lib/events.d.ts +62 -0
- package/node_modules/cordis/lib/fiber.d.ts +85 -0
- package/node_modules/cordis/lib/index.d.ts +7 -0
- package/node_modules/cordis/lib/index.js +1577 -0
- package/node_modules/cordis/lib/logger.d.ts +74 -0
- package/node_modules/cordis/lib/reflect.d.ts +54 -0
- package/node_modules/cordis/lib/registry.d.ts +78 -0
- package/node_modules/cordis/lib/service.d.ts +19 -0
- package/node_modules/cordis/lib/utils.d.ts +50 -0
- package/node_modules/cordis/package.json +49 -0
- package/node_modules/cosmokit/LICENSE +21 -0
- package/node_modules/cosmokit/README.md +24 -0
- package/node_modules/cosmokit/lib/index.cjs +419 -0
- package/node_modules/cosmokit/lib/index.cjs.map +6 -0
- package/node_modules/cosmokit/lib/index.d.ts +142 -0
- package/node_modules/cosmokit/lib/index.mjs +357 -0
- package/node_modules/cosmokit/lib/index.mjs.map +6 -0
- package/node_modules/cosmokit/package.json +57 -0
- package/node_modules/cosmokit/src/array.ts +35 -0
- package/node_modules/cosmokit/src/index.ts +5 -0
- package/node_modules/cosmokit/src/misc.ts +57 -0
- package/node_modules/cosmokit/src/string.ts +101 -0
- package/node_modules/cosmokit/src/time.ts +91 -0
- package/node_modules/cosmokit/src/types.ts +131 -0
- package/node_modules/schemastery/README.md +342 -0
- package/node_modules/schemastery/lib/index.cjs +648 -0
- package/node_modules/schemastery/lib/index.cjs.map +6 -0
- package/node_modules/schemastery/lib/index.d.ts +138 -0
- package/node_modules/schemastery/lib/index.mjs +656 -0
- package/node_modules/schemastery/lib/index.mjs.map +6 -0
- package/node_modules/schemastery/package.json +32 -0
- package/node_modules/schemastery/src/index.ts +841 -0
- package/node_modules/undici/LICENSE +21 -0
- package/node_modules/undici/README.md +741 -0
- package/node_modules/undici/docs/docs/api/Agent.md +84 -0
- package/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
- package/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
- package/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
- package/node_modules/undici/docs/docs/api/Client.md +290 -0
- package/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
- package/node_modules/undici/docs/docs/api/Connector.md +115 -0
- package/node_modules/undici/docs/docs/api/ContentType.md +57 -0
- package/node_modules/undici/docs/docs/api/Cookies.md +128 -0
- package/node_modules/undici/docs/docs/api/Debug.md +62 -0
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +317 -0
- package/node_modules/undici/docs/docs/api/Dispatcher.md +1393 -0
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
- package/node_modules/undici/docs/docs/api/Errors.md +49 -0
- package/node_modules/undici/docs/docs/api/EventSource.md +45 -0
- package/node_modules/undici/docs/docs/api/Fetch.md +60 -0
- package/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
- package/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
- package/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
- package/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
- package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
- package/node_modules/undici/docs/docs/api/MockClient.md +81 -0
- package/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
- package/node_modules/undici/docs/docs/api/MockPool.md +555 -0
- package/node_modules/undici/docs/docs/api/Pool.md +84 -0
- package/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
- package/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
- package/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
- package/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
- package/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
- package/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +275 -0
- package/node_modules/undici/docs/docs/api/Util.md +25 -0
- package/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
- package/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
- package/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
- package/node_modules/undici/docs/docs/best-practices/crawling.md +58 -0
- package/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
- package/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
- package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +224 -0
- package/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
- package/node_modules/undici/index-fetch.js +65 -0
- package/node_modules/undici/index.d.ts +3 -0
- package/node_modules/undici/index.js +234 -0
- package/node_modules/undici/lib/api/abort-signal.js +59 -0
- package/node_modules/undici/lib/api/api-connect.js +110 -0
- package/node_modules/undici/lib/api/api-pipeline.js +252 -0
- package/node_modules/undici/lib/api/api-request.js +214 -0
- package/node_modules/undici/lib/api/api-stream.js +209 -0
- package/node_modules/undici/lib/api/api-upgrade.js +111 -0
- package/node_modules/undici/lib/api/index.js +7 -0
- package/node_modules/undici/lib/api/readable.js +580 -0
- package/node_modules/undici/lib/cache/memory-cache-store.js +279 -0
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +467 -0
- package/node_modules/undici/lib/core/connect.js +159 -0
- package/node_modules/undici/lib/core/constants.js +143 -0
- package/node_modules/undici/lib/core/diagnostics.js +227 -0
- package/node_modules/undici/lib/core/errors.js +477 -0
- package/node_modules/undici/lib/core/request.js +485 -0
- package/node_modules/undici/lib/core/socks5-client.js +422 -0
- package/node_modules/undici/lib/core/socks5-utils.js +212 -0
- package/node_modules/undici/lib/core/symbols.js +76 -0
- package/node_modules/undici/lib/core/tree.js +160 -0
- package/node_modules/undici/lib/core/util.js +992 -0
- package/node_modules/undici/lib/dispatcher/agent.js +162 -0
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +221 -0
- package/node_modules/undici/lib/dispatcher/client-h1.js +1744 -0
- package/node_modules/undici/lib/dispatcher/client-h2.js +1056 -0
- package/node_modules/undici/lib/dispatcher/client.js +669 -0
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +196 -0
- package/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
- package/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
- package/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
- package/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
- package/node_modules/undici/lib/dispatcher/pool.js +118 -0
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +319 -0
- package/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +137 -0
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +260 -0
- package/node_modules/undici/lib/encoding/index.js +33 -0
- package/node_modules/undici/lib/global.js +59 -0
- package/node_modules/undici/lib/handler/cache-handler.js +824 -0
- package/node_modules/undici/lib/handler/cache-revalidation-handler.js +124 -0
- package/node_modules/undici/lib/handler/decorator-handler.js +67 -0
- package/node_modules/undici/lib/handler/deduplication-handler.js +504 -0
- package/node_modules/undici/lib/handler/redirect-handler.js +245 -0
- package/node_modules/undici/lib/handler/retry-handler.js +504 -0
- package/node_modules/undici/lib/handler/unwrap-handler.js +106 -0
- package/node_modules/undici/lib/handler/wrap-handler.js +105 -0
- package/node_modules/undici/lib/interceptor/cache.js +621 -0
- package/node_modules/undici/lib/interceptor/decompress.js +561 -0
- package/node_modules/undici/lib/interceptor/deduplicate.js +117 -0
- package/node_modules/undici/lib/interceptor/dns.js +571 -0
- package/node_modules/undici/lib/interceptor/dump.js +99 -0
- package/node_modules/undici/lib/interceptor/redirect.js +21 -0
- package/node_modules/undici/lib/interceptor/response-error.js +95 -0
- package/node_modules/undici/lib/interceptor/retry.js +19 -0
- package/node_modules/undici/lib/llhttp/constants.d.ts +195 -0
- package/node_modules/undici/lib/llhttp/constants.js +531 -0
- package/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
- package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
- package/node_modules/undici/lib/llhttp/utils.d.ts +2 -0
- package/node_modules/undici/lib/llhttp/utils.js +12 -0
- package/node_modules/undici/lib/mock/mock-agent.js +232 -0
- package/node_modules/undici/lib/mock/mock-call-history.js +248 -0
- package/node_modules/undici/lib/mock/mock-client.js +68 -0
- package/node_modules/undici/lib/mock/mock-errors.js +29 -0
- package/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
- package/node_modules/undici/lib/mock/mock-pool.js +68 -0
- package/node_modules/undici/lib/mock/mock-symbols.js +32 -0
- package/node_modules/undici/lib/mock/mock-utils.js +486 -0
- package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
- package/node_modules/undici/lib/mock/snapshot-agent.js +353 -0
- package/node_modules/undici/lib/mock/snapshot-recorder.js +588 -0
- package/node_modules/undici/lib/mock/snapshot-utils.js +158 -0
- package/node_modules/undici/lib/util/cache.js +676 -0
- package/node_modules/undici/lib/util/date.js +670 -0
- package/node_modules/undici/lib/util/promise.js +28 -0
- package/node_modules/undici/lib/util/runtime-features.js +124 -0
- package/node_modules/undici/lib/util/stats.js +32 -0
- package/node_modules/undici/lib/util/timers.js +425 -0
- package/node_modules/undici/lib/web/cache/cache.js +864 -0
- package/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
- package/node_modules/undici/lib/web/cache/util.js +45 -0
- package/node_modules/undici/lib/web/cookies/constants.js +12 -0
- package/node_modules/undici/lib/web/cookies/index.js +201 -0
- package/node_modules/undici/lib/web/cookies/parse.js +315 -0
- package/node_modules/undici/lib/web/cookies/util.js +371 -0
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +575 -0
- package/node_modules/undici/lib/web/eventsource/eventsource.js +504 -0
- package/node_modules/undici/lib/web/eventsource/util.js +29 -0
- package/node_modules/undici/lib/web/fetch/LICENSE +21 -0
- package/node_modules/undici/lib/web/fetch/body.js +509 -0
- package/node_modules/undici/lib/web/fetch/constants.js +131 -0
- package/node_modules/undici/lib/web/fetch/data-url.js +596 -0
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
- package/node_modules/undici/lib/web/fetch/formdata.js +259 -0
- package/node_modules/undici/lib/web/fetch/global.js +40 -0
- package/node_modules/undici/lib/web/fetch/headers.js +719 -0
- package/node_modules/undici/lib/web/fetch/index.js +2413 -0
- package/node_modules/undici/lib/web/fetch/request.js +1115 -0
- package/node_modules/undici/lib/web/fetch/response.js +641 -0
- package/node_modules/undici/lib/web/fetch/util.js +1522 -0
- package/node_modules/undici/lib/web/infra/index.js +243 -0
- package/node_modules/undici/lib/web/subresource-integrity/Readme.md +9 -0
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
- package/node_modules/undici/lib/web/webidl/index.js +1006 -0
- package/node_modules/undici/lib/web/websocket/connection.js +339 -0
- package/node_modules/undici/lib/web/websocket/constants.js +126 -0
- package/node_modules/undici/lib/web/websocket/events.js +331 -0
- package/node_modules/undici/lib/web/websocket/frame.js +133 -0
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +105 -0
- package/node_modules/undici/lib/web/websocket/receiver.js +520 -0
- package/node_modules/undici/lib/web/websocket/sender.js +109 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +104 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +496 -0
- package/node_modules/undici/lib/web/websocket/util.js +347 -0
- package/node_modules/undici/lib/web/websocket/websocket.js +758 -0
- package/node_modules/undici/package.json +152 -0
- package/node_modules/undici/scripts/strip-comments.js +10 -0
- package/node_modules/undici/types/README.md +6 -0
- package/node_modules/undici/types/agent.d.ts +32 -0
- package/node_modules/undici/types/api.d.ts +43 -0
- package/node_modules/undici/types/balanced-pool.d.ts +30 -0
- package/node_modules/undici/types/cache-interceptor.d.ts +179 -0
- package/node_modules/undici/types/cache.d.ts +36 -0
- package/node_modules/undici/types/client-stats.d.ts +15 -0
- package/node_modules/undici/types/client.d.ts +153 -0
- package/node_modules/undici/types/connector.d.ts +36 -0
- package/node_modules/undici/types/content-type.d.ts +21 -0
- package/node_modules/undici/types/cookies.d.ts +30 -0
- package/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
- package/node_modules/undici/types/dispatcher.d.ts +275 -0
- package/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/undici/types/errors.d.ts +177 -0
- package/node_modules/undici/types/eventsource.d.ts +66 -0
- package/node_modules/undici/types/fetch.d.ts +231 -0
- package/node_modules/undici/types/formdata.d.ts +114 -0
- package/node_modules/undici/types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici/types/global-origin.d.ts +7 -0
- package/node_modules/undici/types/h2c-client.d.ts +73 -0
- package/node_modules/undici/types/handlers.d.ts +14 -0
- package/node_modules/undici/types/header.d.ts +160 -0
- package/node_modules/undici/types/index.d.ts +91 -0
- package/node_modules/undici/types/interceptors.d.ts +82 -0
- package/node_modules/undici/types/mock-agent.d.ts +68 -0
- package/node_modules/undici/types/mock-call-history.d.ts +111 -0
- package/node_modules/undici/types/mock-client.d.ts +27 -0
- package/node_modules/undici/types/mock-errors.d.ts +12 -0
- package/node_modules/undici/types/mock-interceptor.d.ts +94 -0
- package/node_modules/undici/types/mock-pool.d.ts +27 -0
- package/node_modules/undici/types/patch.d.ts +29 -0
- package/node_modules/undici/types/pool-stats.d.ts +19 -0
- package/node_modules/undici/types/pool.d.ts +41 -0
- package/node_modules/undici/types/proxy-agent.d.ts +29 -0
- package/node_modules/undici/types/readable.d.ts +68 -0
- package/node_modules/undici/types/retry-agent.d.ts +8 -0
- package/node_modules/undici/types/retry-handler.d.ts +125 -0
- package/node_modules/undici/types/round-robin-pool.d.ts +41 -0
- package/node_modules/undici/types/snapshot-agent.d.ts +109 -0
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/undici/types/util.d.ts +18 -0
- package/node_modules/undici/types/utility.d.ts +7 -0
- package/node_modules/undici/types/webidl.d.ts +347 -0
- package/node_modules/undici/types/websocket.d.ts +188 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +530 -0
- package/node_modules/ws/lib/receiver.js +743 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1407 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/package.json +17 -4
- package/webui/assets/group-bot-profile-CYK81678.jpg +0 -0
- package/webui/assets/group-bot-settings-BBQBbfgh.jpg +0 -0
- package/webui/assets/index-CuH0UYYo.js +28 -0
- package/webui/assets/index-DjbPiYmB.css +2 -0
- package/webui/favicon.ico +0 -0
- package/webui/index.html +26 -0
- package/webui/logo-128.webp +0 -0
- package/webui/logo-192.webp +0 -0
- package/webui/logo-256.webp +0 -0
- package/webui/logo-64.webp +0 -0
- package/webui/logo.jpg +0 -0
- package/webui/plugin-shared/plugin-sdk-webui.js +3 -0
- package/webui/plugin-shared/react-dom.js +3 -0
- package/webui/plugin-shared/react-jsx-runtime.js +3 -0
- package/webui/plugin-shared/react.js +3 -0
- package//344/275/277/347/224/250/350/257/264/346/230/216.txt +6 -0
- package//346/233/264/346/226/260/346/227/245/345/277/227.txt +1091 -0
- package/README.md +0 -3
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { existsSync, readFileSync, renameSync, rmSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
//#region node_modules/compare-versions/lib/esm/utils.js
|
|
4
|
+
var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
|
5
|
+
var validateAndParse = (version) => {
|
|
6
|
+
if (typeof version !== "string") throw new TypeError("Invalid argument expected string");
|
|
7
|
+
const match = version.match(semver);
|
|
8
|
+
if (!match) throw new Error(`Invalid argument not valid semver ('${version}' received)`);
|
|
9
|
+
match.shift();
|
|
10
|
+
return match;
|
|
11
|
+
};
|
|
12
|
+
var isWildcard = (s) => s === "*" || s === "x" || s === "X";
|
|
13
|
+
var tryParse = (v) => {
|
|
14
|
+
const n = parseInt(v, 10);
|
|
15
|
+
return isNaN(n) ? v : n;
|
|
16
|
+
};
|
|
17
|
+
var forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];
|
|
18
|
+
var compareStrings = (a, b) => {
|
|
19
|
+
if (isWildcard(a) || isWildcard(b)) return 0;
|
|
20
|
+
const [ap, bp] = forceType(tryParse(a), tryParse(b));
|
|
21
|
+
if (ap > bp) return 1;
|
|
22
|
+
if (ap < bp) return -1;
|
|
23
|
+
return 0;
|
|
24
|
+
};
|
|
25
|
+
var compareSegments = (a, b) => {
|
|
26
|
+
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
|
27
|
+
const r = compareStrings(a[i] || "0", b[i] || "0");
|
|
28
|
+
if (r !== 0) return r;
|
|
29
|
+
}
|
|
30
|
+
return 0;
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region node_modules/compare-versions/lib/esm/compareVersions.js
|
|
34
|
+
/**
|
|
35
|
+
* Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
|
|
36
|
+
* This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
|
|
37
|
+
* @param v1 - First version to compare
|
|
38
|
+
* @param v2 - Second version to compare
|
|
39
|
+
* @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).
|
|
40
|
+
*/
|
|
41
|
+
var compareVersions = (v1, v2) => {
|
|
42
|
+
const n1 = validateAndParse(v1);
|
|
43
|
+
const n2 = validateAndParse(v2);
|
|
44
|
+
const p1 = n1.pop();
|
|
45
|
+
const p2 = n2.pop();
|
|
46
|
+
const r = compareSegments(n1, n2);
|
|
47
|
+
if (r !== 0) return r;
|
|
48
|
+
if (p1 && p2) return compareSegments(p1.split("."), p2.split("."));
|
|
49
|
+
else if (p1 || p2) return p1 ? -1 : 1;
|
|
50
|
+
return 0;
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region node_modules/compare-versions/lib/esm/compare.js
|
|
54
|
+
/**
|
|
55
|
+
* Compare [semver](https://semver.org/) version strings using the specified operator.
|
|
56
|
+
*
|
|
57
|
+
* @param v1 First version to compare
|
|
58
|
+
* @param v2 Second version to compare
|
|
59
|
+
* @param operator Allowed arithmetic operator to use
|
|
60
|
+
* @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```
|
|
64
|
+
* compare('10.1.8', '10.0.4', '>'); // return true
|
|
65
|
+
* compare('10.0.1', '10.0.1', '='); // return true
|
|
66
|
+
* compare('10.1.1', '10.2.2', '<'); // return true
|
|
67
|
+
* compare('10.1.1', '10.2.2', '<='); // return true
|
|
68
|
+
* compare('10.1.1', '10.2.2', '>='); // return false
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
var compare = (v1, v2, operator) => {
|
|
72
|
+
assertValidOperator(operator);
|
|
73
|
+
const res = compareVersions(v1, v2);
|
|
74
|
+
return operatorResMap[operator].includes(res);
|
|
75
|
+
};
|
|
76
|
+
var operatorResMap = {
|
|
77
|
+
">": [1],
|
|
78
|
+
">=": [0, 1],
|
|
79
|
+
"=": [0],
|
|
80
|
+
"<=": [-1, 0],
|
|
81
|
+
"<": [-1],
|
|
82
|
+
"!=": [-1, 1]
|
|
83
|
+
};
|
|
84
|
+
var allowedOperators = Object.keys(operatorResMap);
|
|
85
|
+
var assertValidOperator = (op) => {
|
|
86
|
+
if (typeof op !== "string") throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);
|
|
87
|
+
if (allowedOperators.indexOf(op) === -1) throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`);
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region node_modules/compare-versions/lib/esm/satisfies.js
|
|
91
|
+
/**
|
|
92
|
+
* Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
|
|
93
|
+
*
|
|
94
|
+
* @param version Version number to match
|
|
95
|
+
* @param range Range pattern for version
|
|
96
|
+
* @returns `true` if the version number is within the range, `false` otherwise.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```
|
|
100
|
+
* satisfies('1.1.0', '^1.0.0'); // return true
|
|
101
|
+
* satisfies('1.1.0', '~1.0.0'); // return false
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
var satisfies = (version, range) => {
|
|
105
|
+
range = range.replace(/([><=]+)\s+/g, "$1");
|
|
106
|
+
if (range.includes("||")) return range.split("||").some((r) => satisfies(version, r));
|
|
107
|
+
else if (range.includes(" - ")) {
|
|
108
|
+
const [a, b] = range.split(" - ", 2);
|
|
109
|
+
return satisfies(version, `>=${a} <=${b}`);
|
|
110
|
+
} else if (range.includes(" ")) return range.trim().replace(/\s{2,}/g, " ").split(" ").every((r) => satisfies(version, r));
|
|
111
|
+
const m = range.match(/^([<>=~^]+)/);
|
|
112
|
+
const op = m ? m[1] : "=";
|
|
113
|
+
if (op !== "^" && op !== "~") return compare(version, range, op);
|
|
114
|
+
const [v1, v2, v3, , vp] = validateAndParse(version);
|
|
115
|
+
const [r1, r2, r3, , rp] = validateAndParse(range);
|
|
116
|
+
const v = [
|
|
117
|
+
v1,
|
|
118
|
+
v2,
|
|
119
|
+
v3
|
|
120
|
+
];
|
|
121
|
+
const r = [
|
|
122
|
+
r1,
|
|
123
|
+
r2 !== null && r2 !== void 0 ? r2 : "x",
|
|
124
|
+
r3 !== null && r3 !== void 0 ? r3 : "x"
|
|
125
|
+
];
|
|
126
|
+
if (rp) {
|
|
127
|
+
if (!vp) return false;
|
|
128
|
+
if (compareSegments(v, r) !== 0) return false;
|
|
129
|
+
if (compareSegments(vp.split("."), rp.split(".")) === -1) return false;
|
|
130
|
+
}
|
|
131
|
+
const nonZero = r.findIndex((v) => v !== "0") + 1;
|
|
132
|
+
const i = op === "~" ? 2 : nonZero > 1 ? nonZero : 1;
|
|
133
|
+
if (compareSegments(v.slice(0, i), r.slice(0, i)) !== 0) return false;
|
|
134
|
+
if (compareSegments(v.slice(i), r.slice(i)) === -1) return false;
|
|
135
|
+
return true;
|
|
136
|
+
};
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/main/runtime.ts
|
|
139
|
+
/**
|
|
140
|
+
* Where a container keeps a self-installed release, and which release starts. Shared by the supervisor
|
|
141
|
+
* (llbot.js) and the updater, so it imports nothing of the bot.
|
|
142
|
+
*
|
|
143
|
+
* A container's program files belong to its image and are gone when the container is recreated. A release the
|
|
144
|
+
* bot installs itself therefore goes to the data volume, data/llbot-runtime/, and the supervisor of the image
|
|
145
|
+
* starts it instead of the image's own when it is newer. A newer image wins again, and the leftover is removed.
|
|
146
|
+
*/
|
|
147
|
+
var RUNTIME_DIR_NAME = "llbot-runtime";
|
|
148
|
+
/** Where a release that kept crashing at startup is set aside, for a look or a manual rename back */
|
|
149
|
+
var FAILED_RUNTIME_DIR_NAME = "llbot-runtime.failed";
|
|
150
|
+
/** What the package.json of an installation may be called: the package releases are published as, or the name before */
|
|
151
|
+
var RELEASE_NAMES = ["@luckylillia-dev/luckylillia", "llonebot-dist"];
|
|
152
|
+
/** data/ is relative to the working directory, as everywhere in the bot (common/globalVars.ts) */
|
|
153
|
+
var runtimeDir = (cwd = process.cwd()) => path.join(cwd, "data", RUNTIME_DIR_NAME);
|
|
154
|
+
var failedRuntimeDir = (cwd = process.cwd()) => path.join(cwd, "data", FAILED_RUNTIME_DIR_NAME);
|
|
155
|
+
/**
|
|
156
|
+
* In a container: Docker's /.dockerenv, Podman's /run/.containerenv, or LLBOT_CONTAINER=1 (Kubernetes and other
|
|
157
|
+
* runtimes leave no marker; the official images set it). LLBOT_CONTAINER=0 says it is not one.
|
|
158
|
+
*/
|
|
159
|
+
function inContainer(env = process.env, exists = existsSync) {
|
|
160
|
+
if (env.LLBOT_CONTAINER === "1") return true;
|
|
161
|
+
if (env.LLBOT_CONTAINER === "0") return false;
|
|
162
|
+
return exists("/.dockerenv") || exists("/run/.containerenv");
|
|
163
|
+
}
|
|
164
|
+
/** The release in `dir`, if it is a whole one: a known package with a version, and both entries */
|
|
165
|
+
function readRelease(dir) {
|
|
166
|
+
try {
|
|
167
|
+
const manifest = JSON.parse(readFileSync(path.join(dir, "package.json"), "utf8"));
|
|
168
|
+
if (!RELEASE_NAMES.includes(manifest.name) || typeof manifest.version !== "string") return;
|
|
169
|
+
if (!existsSync(path.join(dir, "llbot.js")) || !existsSync(path.join(dir, "llbot-core.js"))) return;
|
|
170
|
+
return {
|
|
171
|
+
dir,
|
|
172
|
+
version: manifest.version,
|
|
173
|
+
node: typeof manifest.engines?.node === "string" ? manifest.engines.node : void 0
|
|
174
|
+
};
|
|
175
|
+
} catch {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function newer(version, than) {
|
|
180
|
+
try {
|
|
181
|
+
return compareVersions(version, than) > 0;
|
|
182
|
+
} catch {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/** Whether `node` satisfies an engines range such as ">=22.15"; a range compare-versions cannot read does not block */
|
|
187
|
+
function nodeSatisfies(range, node = process.versions.node) {
|
|
188
|
+
if (!range) return true;
|
|
189
|
+
try {
|
|
190
|
+
return satisfies(node, range);
|
|
191
|
+
} catch {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* The core to start now: the data volume's release when this is a container, it is a whole release newer than
|
|
197
|
+
* the program's own and it runs on this Node.js; the program's own otherwise. A release in the volume that is not
|
|
198
|
+
* newer is removed: a newer image superseded it.
|
|
199
|
+
*/
|
|
200
|
+
function chooseCore(options) {
|
|
201
|
+
const own = { core: path.join(options.installDir, "llbot-core.js") };
|
|
202
|
+
const env = options.env ?? process.env;
|
|
203
|
+
if (!(options.container ?? inContainer(env))) return own;
|
|
204
|
+
const dir = runtimeDir(options.cwd);
|
|
205
|
+
if (!existsSync(dir)) return own;
|
|
206
|
+
const runtime = readRelease(dir);
|
|
207
|
+
if (!runtime) return {
|
|
208
|
+
...own,
|
|
209
|
+
note: `${dir} 不是完整的发布包,使用镜像自带的版本`
|
|
210
|
+
};
|
|
211
|
+
const image = readRelease(options.installDir);
|
|
212
|
+
if (image && !newer(runtime.version, image.version)) try {
|
|
213
|
+
rmSync(dir, {
|
|
214
|
+
recursive: true,
|
|
215
|
+
force: true
|
|
216
|
+
});
|
|
217
|
+
return {
|
|
218
|
+
...own,
|
|
219
|
+
note: `镜像自带的 ${image.version} 不比自动更新的 ${runtime.version} 旧,已删除 ${dir}`
|
|
220
|
+
};
|
|
221
|
+
} catch (error) {
|
|
222
|
+
return {
|
|
223
|
+
...own,
|
|
224
|
+
note: `镜像自带的版本更新,但删除 ${dir} 失败:${error.message}`
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
if (!nodeSatisfies(runtime.node, options.node)) return {
|
|
228
|
+
...own,
|
|
229
|
+
note: `自动更新的 ${runtime.version} 需要 Node.js ${runtime.node},当前是 ${options.node ?? process.versions.node},使用镜像自带的版本`
|
|
230
|
+
};
|
|
231
|
+
return {
|
|
232
|
+
core: path.join(dir, "llbot-core.js"),
|
|
233
|
+
runtime
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/** Sets a release that keeps crashing at startup aside, replacing one set aside before */
|
|
237
|
+
function setRuntimeAside(cwd = process.cwd()) {
|
|
238
|
+
const failed = failedRuntimeDir(cwd);
|
|
239
|
+
rmSync(failed, {
|
|
240
|
+
recursive: true,
|
|
241
|
+
force: true
|
|
242
|
+
});
|
|
243
|
+
renameSync(runtimeDir(cwd), failed);
|
|
244
|
+
return failed;
|
|
245
|
+
}
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/main/restart.ts
|
|
248
|
+
/** Set in the bot's environment when a supervisor runs it, so it may ask for a restart. */
|
|
249
|
+
var SUPERVISED_ENV = "LLBOT_SUPERVISED";
|
|
250
|
+
var isSupervised = (env = process.env) => env[SUPERVISED_ENV] === "1";
|
|
251
|
+
/** The first --parent-pid wins, as --parent-pid=<pid> or --parent-pid <pid>; NaN without a valid one. */
|
|
252
|
+
function parentPidOf(argv) {
|
|
253
|
+
const index = argv.findIndex((arg) => arg === "--parent-pid" || arg.startsWith("--parent-pid="));
|
|
254
|
+
const arg = argv[index];
|
|
255
|
+
const value = arg === "--parent-pid" ? argv[index + 1] : arg?.slice(13);
|
|
256
|
+
const pid = value && /^\d+$/.test(value) ? Number(value) : NaN;
|
|
257
|
+
return Number.isSafeInteger(pid) && pid > 0 ? pid : NaN;
|
|
258
|
+
}
|
|
259
|
+
/** The arguments without any --parent-pid, in either form */
|
|
260
|
+
function withoutParentPid(argv) {
|
|
261
|
+
const result = [];
|
|
262
|
+
for (let i = 0; i < argv.length; i++) {
|
|
263
|
+
if (argv[i] === "--parent-pid") {
|
|
264
|
+
i++;
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
if (argv[i].startsWith("--parent-pid=")) continue;
|
|
268
|
+
result.push(argv[i]);
|
|
269
|
+
}
|
|
270
|
+
return result;
|
|
271
|
+
}
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region \0vite/preload-helper.js
|
|
274
|
+
var scriptRel = "modulepreload";
|
|
275
|
+
var assetsURL = function(dep) {
|
|
276
|
+
return "/" + dep;
|
|
277
|
+
};
|
|
278
|
+
var seen = {};
|
|
279
|
+
var __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
280
|
+
let promise = Promise.resolve();
|
|
281
|
+
if (deps && deps.length > 0) {
|
|
282
|
+
const links = document.getElementsByTagName("link");
|
|
283
|
+
const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
|
|
284
|
+
const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
|
|
285
|
+
function allSettled(promises) {
|
|
286
|
+
return Promise.all(promises.map((p) => Promise.resolve(p).then((value) => ({
|
|
287
|
+
status: "fulfilled",
|
|
288
|
+
value
|
|
289
|
+
}), (reason) => ({
|
|
290
|
+
status: "rejected",
|
|
291
|
+
reason
|
|
292
|
+
}))));
|
|
293
|
+
}
|
|
294
|
+
function importMetaResolve(specifier) {
|
|
295
|
+
if (import.meta.resolve) return import.meta.resolve(specifier);
|
|
296
|
+
return new URL(
|
|
297
|
+
specifier,
|
|
298
|
+
/** #__KEEP__ */
|
|
299
|
+
import.meta.url
|
|
300
|
+
).href;
|
|
301
|
+
}
|
|
302
|
+
promise = allSettled(deps.map((dep) => {
|
|
303
|
+
dep = assetsURL(dep, importerUrl);
|
|
304
|
+
dep = importMetaResolve(dep);
|
|
305
|
+
if (dep in seen) return;
|
|
306
|
+
seen[dep] = true;
|
|
307
|
+
const isCss = dep.endsWith(".css");
|
|
308
|
+
for (let i = links.length - 1; i >= 0; i--) {
|
|
309
|
+
const link = links[i];
|
|
310
|
+
if (link.href === dep && (!isCss || link.rel === "stylesheet")) return;
|
|
311
|
+
}
|
|
312
|
+
const link = document.createElement("link");
|
|
313
|
+
link.rel = isCss ? "stylesheet" : scriptRel;
|
|
314
|
+
if (!isCss) link.as = "script";
|
|
315
|
+
link.crossOrigin = "";
|
|
316
|
+
link.href = dep;
|
|
317
|
+
if (cspNonce) link.setAttribute("nonce", cspNonce);
|
|
318
|
+
document.head.appendChild(link);
|
|
319
|
+
if (isCss) return new Promise((res, rej) => {
|
|
320
|
+
link.addEventListener("load", res);
|
|
321
|
+
link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
|
|
322
|
+
});
|
|
323
|
+
}));
|
|
324
|
+
}
|
|
325
|
+
function handlePreloadError(err) {
|
|
326
|
+
const e = new Event("vite:preloadError", { cancelable: true });
|
|
327
|
+
e.payload = err;
|
|
328
|
+
window.dispatchEvent(e);
|
|
329
|
+
if (!e.defaultPrevented) throw err;
|
|
330
|
+
}
|
|
331
|
+
return promise.then((res) => {
|
|
332
|
+
for (const item of res || []) {
|
|
333
|
+
if (item.status !== "rejected") continue;
|
|
334
|
+
handlePreloadError(item.reason);
|
|
335
|
+
}
|
|
336
|
+
return baseModule().catch(handlePreloadError);
|
|
337
|
+
});
|
|
338
|
+
};
|
|
339
|
+
//#endregion
|
|
340
|
+
export { withoutParentPid as a, RUNTIME_DIR_NAME as c, runtimeDir as d, setRuntimeAside as f, parentPidOf as i, chooseCore as l, compareVersions as m, SUPERVISED_ENV as n, FAILED_RUNTIME_DIR_NAME as o, satisfies as p, isSupervised as r, RELEASE_NAMES as s, __vitePreload as t, inContainer as u };
|
|
341
|
+
|
|
342
|
+
//# sourceMappingURL=preload-helper-D5R8FHQt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preload-helper-D5R8FHQt.js","names":[],"sources":["../../node_modules/compare-versions/lib/esm/utils.js","../../node_modules/compare-versions/lib/esm/compareVersions.js","../../node_modules/compare-versions/lib/esm/compare.js","../../node_modules/compare-versions/lib/esm/satisfies.js","../../src/main/runtime.ts","../../src/main/restart.ts"],"sourcesContent":["export const semver = /^[v^~<>=]*?(\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+))?(?:-([\\da-z\\-]+(?:\\.[\\da-z\\-]+)*))?(?:\\+[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?)?)?$/i;\nexport const validateAndParse = (version) => {\n if (typeof version !== 'string') {\n throw new TypeError('Invalid argument expected string');\n }\n const match = version.match(semver);\n if (!match) {\n throw new Error(`Invalid argument not valid semver ('${version}' received)`);\n }\n match.shift();\n return match;\n};\nconst isWildcard = (s) => s === '*' || s === 'x' || s === 'X';\nconst tryParse = (v) => {\n const n = parseInt(v, 10);\n return isNaN(n) ? v : n;\n};\nconst forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];\nconst compareStrings = (a, b) => {\n if (isWildcard(a) || isWildcard(b))\n return 0;\n const [ap, bp] = forceType(tryParse(a), tryParse(b));\n if (ap > bp)\n return 1;\n if (ap < bp)\n return -1;\n return 0;\n};\nexport const compareSegments = (a, b) => {\n for (let i = 0; i < Math.max(a.length, b.length); i++) {\n const r = compareStrings(a[i] || '0', b[i] || '0');\n if (r !== 0)\n return r;\n }\n return 0;\n};\n//# sourceMappingURL=utils.js.map","import { compareSegments, validateAndParse } from './utils.js';\n/**\n * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.\n * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.\n * @param v1 - First version to compare\n * @param v2 - Second version to compare\n * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).\n */\nexport const compareVersions = (v1, v2) => {\n // validate input and split into segments\n const n1 = validateAndParse(v1);\n const n2 = validateAndParse(v2);\n // pop off the patch\n const p1 = n1.pop();\n const p2 = n2.pop();\n // validate numbers\n const r = compareSegments(n1, n2);\n if (r !== 0)\n return r;\n // validate pre-release\n if (p1 && p2) {\n return compareSegments(p1.split('.'), p2.split('.'));\n }\n else if (p1 || p2) {\n return p1 ? -1 : 1;\n }\n return 0;\n};\n//# sourceMappingURL=compareVersions.js.map","import { compareVersions } from './compareVersions.js';\n/**\n * Compare [semver](https://semver.org/) version strings using the specified operator.\n *\n * @param v1 First version to compare\n * @param v2 Second version to compare\n * @param operator Allowed arithmetic operator to use\n * @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.\n *\n * @example\n * ```\n * compare('10.1.8', '10.0.4', '>'); // return true\n * compare('10.0.1', '10.0.1', '='); // return true\n * compare('10.1.1', '10.2.2', '<'); // return true\n * compare('10.1.1', '10.2.2', '<='); // return true\n * compare('10.1.1', '10.2.2', '>='); // return false\n * ```\n */\nexport const compare = (v1, v2, operator) => {\n // validate input operator\n assertValidOperator(operator);\n // since result of compareVersions can only be -1 or 0 or 1\n // a simple map can be used to replace switch\n const res = compareVersions(v1, v2);\n return operatorResMap[operator].includes(res);\n};\nconst operatorResMap = {\n '>': [1],\n '>=': [0, 1],\n '=': [0],\n '<=': [-1, 0],\n '<': [-1],\n '!=': [-1, 1],\n};\nconst allowedOperators = Object.keys(operatorResMap);\nconst assertValidOperator = (op) => {\n if (typeof op !== 'string') {\n throw new TypeError(`Invalid operator type, expected string but got ${typeof op}`);\n }\n if (allowedOperators.indexOf(op) === -1) {\n throw new Error(`Invalid operator, expected one of ${allowedOperators.join('|')}`);\n }\n};\n//# sourceMappingURL=compare.js.map","import { compare } from './compare.js';\nimport { compareSegments, validateAndParse } from './utils.js';\n/**\n * Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.\n *\n * @param version Version number to match\n * @param range Range pattern for version\n * @returns `true` if the version number is within the range, `false` otherwise.\n *\n * @example\n * ```\n * satisfies('1.1.0', '^1.0.0'); // return true\n * satisfies('1.1.0', '~1.0.0'); // return false\n * ```\n */\nexport const satisfies = (version, range) => {\n // clean input\n range = range.replace(/([><=]+)\\s+/g, '$1');\n // handle multiple comparators\n if (range.includes('||')) {\n return range.split('||').some((r) => satisfies(version, r));\n }\n else if (range.includes(' - ')) {\n const [a, b] = range.split(' - ', 2);\n return satisfies(version, `>=${a} <=${b}`);\n }\n else if (range.includes(' ')) {\n return range\n .trim()\n .replace(/\\s{2,}/g, ' ')\n .split(' ')\n .every((r) => satisfies(version, r));\n }\n // if no range operator then \"=\"\n const m = range.match(/^([<>=~^]+)/);\n const op = m ? m[1] : '=';\n // if gt/lt/eq then operator compare\n if (op !== '^' && op !== '~')\n return compare(version, range, op);\n // else range of either \"~\" or \"^\" is assumed\n const [v1, v2, v3, , vp] = validateAndParse(version);\n const [r1, r2, r3, , rp] = validateAndParse(range);\n const v = [v1, v2, v3];\n const r = [r1, r2 !== null && r2 !== void 0 ? r2 : 'x', r3 !== null && r3 !== void 0 ? r3 : 'x'];\n // validate pre-release\n if (rp) {\n if (!vp)\n return false;\n if (compareSegments(v, r) !== 0)\n return false;\n if (compareSegments(vp.split('.'), rp.split('.')) === -1)\n return false;\n }\n // first non-zero number\n const nonZero = r.findIndex((v) => v !== '0') + 1;\n // pointer to where segments can be >=\n const i = op === '~' ? 2 : nonZero > 1 ? nonZero : 1;\n // before pointer must be equal\n if (compareSegments(v.slice(0, i), r.slice(0, i)) !== 0)\n return false;\n // after pointer must be >=\n if (compareSegments(v.slice(i), r.slice(i)) === -1)\n return false;\n return true;\n};\n//# sourceMappingURL=satisfies.js.map","/**\n * Where a container keeps a self-installed release, and which release starts. Shared by the supervisor\n * (llbot.js) and the updater, so it imports nothing of the bot.\n *\n * A container's program files belong to its image and are gone when the container is recreated. A release the\n * bot installs itself therefore goes to the data volume, data/llbot-runtime/, and the supervisor of the image\n * starts it instead of the image's own when it is newer. A newer image wins again, and the leftover is removed.\n */\nimport { existsSync, readFileSync, renameSync, rmSync } from 'node:fs'\nimport path from 'node:path'\nimport { compareVersions, satisfies } from 'compare-versions'\n\nexport const RUNTIME_DIR_NAME = 'llbot-runtime'\n/** Where a release that kept crashing at startup is set aside, for a look or a manual rename back */\nexport const FAILED_RUNTIME_DIR_NAME = 'llbot-runtime.failed'\n\n/** What the package.json of an installation may be called: the package releases are published as, or the name before */\nexport const RELEASE_NAMES = ['@luckylillia-dev/luckylillia', 'llonebot-dist']\n\n/** data/ is relative to the working directory, as everywhere in the bot (common/globalVars.ts) */\nexport const runtimeDir = (cwd = process.cwd()) => path.join(cwd, 'data', RUNTIME_DIR_NAME)\nexport const failedRuntimeDir = (cwd = process.cwd()) => path.join(cwd, 'data', FAILED_RUNTIME_DIR_NAME)\n\n/**\n * In a container: Docker's /.dockerenv, Podman's /run/.containerenv, or LLBOT_CONTAINER=1 (Kubernetes and other\n * runtimes leave no marker; the official images set it). LLBOT_CONTAINER=0 says it is not one.\n */\nexport function inContainer(env: NodeJS.ProcessEnv = process.env, exists: (file: string) => boolean = existsSync): boolean {\n if (env.LLBOT_CONTAINER === '1') return true\n if (env.LLBOT_CONTAINER === '0') return false\n return exists('/.dockerenv') || exists('/run/.containerenv')\n}\n\nexport interface Release {\n dir: string\n version: string\n /** Node.js the release needs, from its package.json engines */\n node?: string\n}\n\n/** The release in `dir`, if it is a whole one: a known package with a version, and both entries */\nexport function readRelease(dir: string): Release | undefined {\n try {\n const manifest = JSON.parse(readFileSync(path.join(dir, 'package.json'), 'utf8'))\n if (!RELEASE_NAMES.includes(manifest.name) || typeof manifest.version !== 'string') return\n if (!existsSync(path.join(dir, 'llbot.js')) || !existsSync(path.join(dir, 'llbot-core.js'))) return\n return { dir, version: manifest.version, node: typeof manifest.engines?.node === 'string' ? manifest.engines.node : undefined }\n } catch {\n return undefined\n }\n}\n\nexport function newer(version: string, than: string): boolean {\n try {\n return compareVersions(version, than) > 0\n } catch {\n return false\n }\n}\n\n/** Whether `node` satisfies an engines range such as \">=22.15\"; a range compare-versions cannot read does not block */\nexport function nodeSatisfies(range: string | undefined, node = process.versions.node): boolean {\n if (!range) return true\n try {\n return satisfies(node, range)\n } catch {\n return true\n }\n}\n\nexport interface CoreChoice {\n /** llbot-core.js to start */\n core: string\n /** Set when it is the release in the data volume rather than the program's own */\n runtime?: Release\n /** Why the release in the data volume is not started, for the log */\n note?: string\n}\n\nexport interface ChooseOptions {\n /** Where llbot.js runs from: the image's program directory in a container */\n installDir: string\n cwd?: string\n env?: NodeJS.ProcessEnv\n node?: string\n container?: boolean\n}\n\n/**\n * The core to start now: the data volume's release when this is a container, it is a whole release newer than\n * the program's own and it runs on this Node.js; the program's own otherwise. A release in the volume that is not\n * newer is removed: a newer image superseded it.\n */\nexport function chooseCore(options: ChooseOptions): CoreChoice {\n const own: CoreChoice = { core: path.join(options.installDir, 'llbot-core.js') }\n const env = options.env ?? process.env\n if (!(options.container ?? inContainer(env))) return own\n const dir = runtimeDir(options.cwd)\n if (!existsSync(dir)) return own\n const runtime = readRelease(dir)\n if (!runtime) return { ...own, note: `${dir} 不是完整的发布包,使用镜像自带的版本` }\n const image = readRelease(options.installDir)\n if (image && !newer(runtime.version, image.version)) {\n try {\n rmSync(dir, { recursive: true, force: true })\n return { ...own, note: `镜像自带的 ${image.version} 不比自动更新的 ${runtime.version} 旧,已删除 ${dir}` }\n } catch (error) {\n return { ...own, note: `镜像自带的版本更新,但删除 ${dir} 失败:${(error as Error).message}` }\n }\n }\n if (!nodeSatisfies(runtime.node, options.node)) {\n return { ...own, note: `自动更新的 ${runtime.version} 需要 Node.js ${runtime.node},当前是 ${options.node ?? process.versions.node},使用镜像自带的版本` }\n }\n return { core: path.join(dir, 'llbot-core.js'), runtime }\n}\n\n/** Sets a release that keeps crashing at startup aside, replacing one set aside before */\nexport function setRuntimeAside(cwd = process.cwd()): string {\n const failed = failedRuntimeDir(cwd)\n rmSync(failed, { recursive: true, force: true })\n renameSync(runtimeDir(cwd), failed)\n return failed\n}\n","/**\n * What the supervisor (llbot.js) and the bot it runs (llbot-core.js) agree on. No imports: the supervisor bundle\n * must stay small, and this module is all it shares with the bot.\n */\n\n/** The bot exits with this to be started again, e.g. after its files were updated. EX_TEMPFAIL. */\nexport const RESTART_EXIT_CODE = 75\n\n/** Set in the bot's environment when a supervisor runs it, so it may ask for a restart. */\nexport const SUPERVISED_ENV = 'LLBOT_SUPERVISED'\n\nexport const isSupervised = (env: NodeJS.ProcessEnv = process.env): boolean => env[SUPERVISED_ENV] === '1'\n\n/** The first --parent-pid wins, as --parent-pid=<pid> or --parent-pid <pid>; NaN without a valid one. */\nexport function parentPidOf(argv: readonly string[]): number {\n const index = argv.findIndex(arg => arg === '--parent-pid' || arg.startsWith('--parent-pid='))\n const arg = argv[index]\n const value = arg === '--parent-pid' ? argv[index + 1] : arg?.slice('--parent-pid='.length)\n const pid = value && /^\\d+$/.test(value) ? Number(value) : NaN\n return Number.isSafeInteger(pid) && pid > 0 ? pid : NaN\n}\n\n/** The arguments without any --parent-pid, in either form */\nexport function withoutParentPid(argv: readonly string[]): string[] {\n const result: string[] = []\n for (let i = 0; i < argv.length; i++) {\n if (argv[i] === '--parent-pid') {\n i++\n continue\n }\n if (argv[i].startsWith('--parent-pid=')) continue\n result.push(argv[i])\n }\n return result\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;AAAA,IAAa,SAAS;AACtB,IAAa,oBAAoB,YAAY;CACzC,IAAI,OAAO,YAAY,UACnB,MAAM,IAAI,UAAU,kCAAkC;CAE1D,MAAM,QAAQ,QAAQ,MAAM,MAAM;CAClC,IAAI,CAAC,OACD,MAAM,IAAI,MAAM,uCAAuC,QAAQ,YAAY;CAE/E,MAAM,MAAM;CACZ,OAAO;AACX;AACA,IAAM,cAAc,MAAM,MAAM,OAAO,MAAM,OAAO,MAAM;AAC1D,IAAM,YAAY,MAAM;CACpB,MAAM,IAAI,SAAS,GAAG,EAAE;CACxB,OAAO,MAAM,CAAC,IAAI,IAAI;AAC1B;AACA,IAAM,aAAa,GAAG,MAAM,OAAO,MAAM,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAClF,IAAM,kBAAkB,GAAG,MAAM;CAC7B,IAAI,WAAW,CAAC,KAAK,WAAW,CAAC,GAC7B,OAAO;CACX,MAAM,CAAC,IAAI,MAAM,UAAU,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC;CACnD,IAAI,KAAK,IACL,OAAO;CACX,IAAI,KAAK,IACL,OAAO;CACX,OAAO;AACX;AACA,IAAa,mBAAmB,GAAG,MAAM;CACrC,KAAK,IAAI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Aa,gBAAgB,MAAA,QAAA,QAAkD,IAAI,oBAAoB;;AAGvG,SAAgB,YAAY,MAAiC;CAC3D,MAAM,QAAQ,KAAK,WAAU,QAAO,QAAQ,kBAAkB,IAAI,WAAW,eAAe,CAAC;CAC7F,MAAM,MAAM,KAAK;CACjB,MAAM,QAAQ,QAAQ,iBAAiB,KAAK,QAAQ,KAAK,KAAK,MAAM,EAAsB;CAC1F,MAAM,MAAM,SAAS,QAAQ,KAAK,KAAK,IAAI,OAAO,KAAK,IAAI;CAC3D,OAAO,OAAO,cAAc,GAAG,KAAK,MAAM,IAAI,MAAM;AACtD;;AAGA,SAAgB,iBAAiB,MAAmC;CAClE,MAAM,SAAmB,CAAC;CAC1B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,IAAI,KAAK,OAAO,gBAAgB;GAC9B;GACA;EACF;EACA,IAAI,KAAK,EAAE,CAAC,WAAW,eAAe,GAAG;EACzC,OAAO,KAAK,KAAK,EAAE;CACrB;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"webui": {
|
|
3
|
+
"enable": true,
|
|
4
|
+
"host": "127.0.0.1",
|
|
5
|
+
"port": 3080
|
|
6
|
+
},
|
|
7
|
+
"milky": {
|
|
8
|
+
"enable": false,
|
|
9
|
+
"reportSelfMessage": false,
|
|
10
|
+
"http": {
|
|
11
|
+
"host": "127.0.0.1",
|
|
12
|
+
"port": 3010,
|
|
13
|
+
"prefix": "",
|
|
14
|
+
"accessToken": ""
|
|
15
|
+
},
|
|
16
|
+
"webhook": {
|
|
17
|
+
"urls": [],
|
|
18
|
+
"accessToken": ""
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"satori": {
|
|
22
|
+
"enable": false,
|
|
23
|
+
"host": "127.0.0.1",
|
|
24
|
+
"port": 5600,
|
|
25
|
+
"token": ""
|
|
26
|
+
},
|
|
27
|
+
"ob11": {
|
|
28
|
+
"enable": true,
|
|
29
|
+
"connect": [
|
|
30
|
+
{
|
|
31
|
+
"type": "ws",
|
|
32
|
+
"enable": false,
|
|
33
|
+
"host": "127.0.0.1",
|
|
34
|
+
"port": 3001,
|
|
35
|
+
"heartInterval": 60000,
|
|
36
|
+
"token": "",
|
|
37
|
+
"reportSelfMessage": false,
|
|
38
|
+
"reportOfflineMessage": false,
|
|
39
|
+
"messageFormat": "array",
|
|
40
|
+
"debug": false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "ws-reverse",
|
|
44
|
+
"enable": false,
|
|
45
|
+
"url": "",
|
|
46
|
+
"heartInterval": 60000,
|
|
47
|
+
"token": "",
|
|
48
|
+
"reportSelfMessage": false,
|
|
49
|
+
"reportOfflineMessage": false,
|
|
50
|
+
"messageFormat": "array",
|
|
51
|
+
"debug": false
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "http",
|
|
55
|
+
"enable": false,
|
|
56
|
+
"host": "127.0.0.1",
|
|
57
|
+
"port": 3000,
|
|
58
|
+
"token": "",
|
|
59
|
+
"reportSelfMessage": false,
|
|
60
|
+
"reportOfflineMessage": false,
|
|
61
|
+
"messageFormat": "array",
|
|
62
|
+
"debug": false
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "http-post",
|
|
66
|
+
"enable": false,
|
|
67
|
+
"url": "",
|
|
68
|
+
"enableHeart": false,
|
|
69
|
+
"heartInterval": 60000,
|
|
70
|
+
"token": "",
|
|
71
|
+
"reportSelfMessage": false,
|
|
72
|
+
"reportOfflineMessage": false,
|
|
73
|
+
"messageFormat": "array",
|
|
74
|
+
"debug": false
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"log": true,
|
|
79
|
+
"logLevel": "info",
|
|
80
|
+
"musicCardSignUrl": "https://ss.xingzhige.com/music_card/card",
|
|
81
|
+
"msgCacheExpire": 120,
|
|
82
|
+
"ffmpeg": ""
|
|
83
|
+
}
|