@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.
Files changed (333) hide show
  1. package/chunks/preload-helper-D5R8FHQt.js +342 -0
  2. package/chunks/preload-helper-D5R8FHQt.js.map +1 -0
  3. package/default_config.json +83 -0
  4. package/llbot-core.js +35013 -0
  5. package/llbot-core.js.map +1 -0
  6. package/llbot.js +138 -0
  7. package/llbot.js.map +1 -0
  8. package/node_modules/@luckylillia-dev/plugin-sdk/lib/commands.d.ts +86 -0
  9. package/node_modules/@luckylillia-dev/plugin-sdk/lib/commands.js +1 -0
  10. package/node_modules/@luckylillia-dev/plugin-sdk/lib/config.d.ts +14 -0
  11. package/node_modules/@luckylillia-dev/plugin-sdk/lib/config.js +1 -0
  12. package/node_modules/@luckylillia-dev/plugin-sdk/lib/ffmpeg.d.ts +41 -0
  13. package/node_modules/@luckylillia-dev/plugin-sdk/lib/ffmpeg.js +1 -0
  14. package/node_modules/@luckylillia-dev/plugin-sdk/lib/http.d.ts +88 -0
  15. package/node_modules/@luckylillia-dev/plugin-sdk/lib/http.js +1 -0
  16. package/node_modules/@luckylillia-dev/plugin-sdk/lib/index.d.ts +17 -0
  17. package/node_modules/@luckylillia-dev/plugin-sdk/lib/index.js +6 -0
  18. package/node_modules/@luckylillia-dev/plugin-sdk/lib/internal.d.ts +430 -0
  19. package/node_modules/@luckylillia-dev/plugin-sdk/lib/internal.js +7 -0
  20. package/node_modules/@luckylillia-dev/plugin-sdk/lib/manifest.d.ts +68 -0
  21. package/node_modules/@luckylillia-dev/plugin-sdk/lib/manifest.js +1 -0
  22. package/node_modules/@luckylillia-dev/plugin-sdk/lib/server.d.ts +23 -0
  23. package/node_modules/@luckylillia-dev/plugin-sdk/lib/server.js +1 -0
  24. package/node_modules/@luckylillia-dev/plugin-sdk/lib/storage.d.ts +21 -0
  25. package/node_modules/@luckylillia-dev/plugin-sdk/lib/storage.js +1 -0
  26. package/node_modules/@luckylillia-dev/plugin-sdk/lib/testing.d.ts +71 -0
  27. package/node_modules/@luckylillia-dev/plugin-sdk/lib/testing.js +1123 -0
  28. package/node_modules/@luckylillia-dev/plugin-sdk/lib/universal.d.ts +299 -0
  29. package/node_modules/@luckylillia-dev/plugin-sdk/lib/universal.js +1 -0
  30. package/node_modules/@luckylillia-dev/plugin-sdk/lib/webui.d.ts +762 -0
  31. package/node_modules/@luckylillia-dev/plugin-sdk/lib/webui.js +9 -0
  32. package/node_modules/@luckylillia-dev/plugin-sdk/package.json +63 -0
  33. package/node_modules/@satorijs/element/jsx-dev-runtime.d.ts +3 -0
  34. package/node_modules/@satorijs/element/jsx-runtime.d.ts +3 -0
  35. package/node_modules/@satorijs/element/lib/index.cjs +447 -0
  36. package/node_modules/@satorijs/element/lib/index.d.ts +116 -0
  37. package/node_modules/@satorijs/element/lib/index.mjs +455 -0
  38. package/node_modules/@satorijs/element/package.json +60 -0
  39. package/node_modules/@satorijs/element/src/index.ts +559 -0
  40. package/node_modules/@satorijs/protocol/lib/index.cjs +187 -0
  41. package/node_modules/@satorijs/protocol/lib/index.d.ts +328 -0
  42. package/node_modules/@satorijs/protocol/lib/index.mjs +148 -0
  43. package/node_modules/@satorijs/protocol/package.json +44 -0
  44. package/node_modules/@satorijs/protocol/src/index.ts +513 -0
  45. package/node_modules/@standard-schema/spec/LICENSE +21 -0
  46. package/node_modules/@standard-schema/spec/README.md +198 -0
  47. package/node_modules/@standard-schema/spec/dist/index.cjs +18 -0
  48. package/node_modules/@standard-schema/spec/dist/index.d.cts +119 -0
  49. package/node_modules/@standard-schema/spec/dist/index.d.ts +119 -0
  50. package/node_modules/@standard-schema/spec/dist/index.js +0 -0
  51. package/node_modules/@standard-schema/spec/package.json +52 -0
  52. package/node_modules/cordis/README.md +10 -0
  53. package/node_modules/cordis/bin.js +16 -0
  54. package/node_modules/cordis/lib/context.d.ts +32 -0
  55. package/node_modules/cordis/lib/events.d.ts +62 -0
  56. package/node_modules/cordis/lib/fiber.d.ts +85 -0
  57. package/node_modules/cordis/lib/index.d.ts +7 -0
  58. package/node_modules/cordis/lib/index.js +1577 -0
  59. package/node_modules/cordis/lib/logger.d.ts +74 -0
  60. package/node_modules/cordis/lib/reflect.d.ts +54 -0
  61. package/node_modules/cordis/lib/registry.d.ts +78 -0
  62. package/node_modules/cordis/lib/service.d.ts +19 -0
  63. package/node_modules/cordis/lib/utils.d.ts +50 -0
  64. package/node_modules/cordis/package.json +49 -0
  65. package/node_modules/cosmokit/LICENSE +21 -0
  66. package/node_modules/cosmokit/README.md +24 -0
  67. package/node_modules/cosmokit/lib/index.cjs +419 -0
  68. package/node_modules/cosmokit/lib/index.cjs.map +6 -0
  69. package/node_modules/cosmokit/lib/index.d.ts +142 -0
  70. package/node_modules/cosmokit/lib/index.mjs +357 -0
  71. package/node_modules/cosmokit/lib/index.mjs.map +6 -0
  72. package/node_modules/cosmokit/package.json +57 -0
  73. package/node_modules/cosmokit/src/array.ts +35 -0
  74. package/node_modules/cosmokit/src/index.ts +5 -0
  75. package/node_modules/cosmokit/src/misc.ts +57 -0
  76. package/node_modules/cosmokit/src/string.ts +101 -0
  77. package/node_modules/cosmokit/src/time.ts +91 -0
  78. package/node_modules/cosmokit/src/types.ts +131 -0
  79. package/node_modules/schemastery/README.md +342 -0
  80. package/node_modules/schemastery/lib/index.cjs +648 -0
  81. package/node_modules/schemastery/lib/index.cjs.map +6 -0
  82. package/node_modules/schemastery/lib/index.d.ts +138 -0
  83. package/node_modules/schemastery/lib/index.mjs +656 -0
  84. package/node_modules/schemastery/lib/index.mjs.map +6 -0
  85. package/node_modules/schemastery/package.json +32 -0
  86. package/node_modules/schemastery/src/index.ts +841 -0
  87. package/node_modules/undici/LICENSE +21 -0
  88. package/node_modules/undici/README.md +741 -0
  89. package/node_modules/undici/docs/docs/api/Agent.md +84 -0
  90. package/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
  91. package/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
  92. package/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
  93. package/node_modules/undici/docs/docs/api/Client.md +290 -0
  94. package/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
  95. package/node_modules/undici/docs/docs/api/Connector.md +115 -0
  96. package/node_modules/undici/docs/docs/api/ContentType.md +57 -0
  97. package/node_modules/undici/docs/docs/api/Cookies.md +128 -0
  98. package/node_modules/undici/docs/docs/api/Debug.md +62 -0
  99. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +317 -0
  100. package/node_modules/undici/docs/docs/api/Dispatcher.md +1393 -0
  101. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
  102. package/node_modules/undici/docs/docs/api/Errors.md +49 -0
  103. package/node_modules/undici/docs/docs/api/EventSource.md +45 -0
  104. package/node_modules/undici/docs/docs/api/Fetch.md +60 -0
  105. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
  106. package/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
  107. package/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
  108. package/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
  109. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
  110. package/node_modules/undici/docs/docs/api/MockClient.md +81 -0
  111. package/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
  112. package/node_modules/undici/docs/docs/api/MockPool.md +555 -0
  113. package/node_modules/undici/docs/docs/api/Pool.md +84 -0
  114. package/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
  115. package/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
  116. package/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
  117. package/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
  118. package/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
  119. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
  120. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
  121. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +275 -0
  122. package/node_modules/undici/docs/docs/api/Util.md +25 -0
  123. package/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
  124. package/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
  125. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
  126. package/node_modules/undici/docs/docs/best-practices/crawling.md +58 -0
  127. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
  128. package/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
  129. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +224 -0
  130. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
  131. package/node_modules/undici/index-fetch.js +65 -0
  132. package/node_modules/undici/index.d.ts +3 -0
  133. package/node_modules/undici/index.js +234 -0
  134. package/node_modules/undici/lib/api/abort-signal.js +59 -0
  135. package/node_modules/undici/lib/api/api-connect.js +110 -0
  136. package/node_modules/undici/lib/api/api-pipeline.js +252 -0
  137. package/node_modules/undici/lib/api/api-request.js +214 -0
  138. package/node_modules/undici/lib/api/api-stream.js +209 -0
  139. package/node_modules/undici/lib/api/api-upgrade.js +111 -0
  140. package/node_modules/undici/lib/api/index.js +7 -0
  141. package/node_modules/undici/lib/api/readable.js +580 -0
  142. package/node_modules/undici/lib/cache/memory-cache-store.js +279 -0
  143. package/node_modules/undici/lib/cache/sqlite-cache-store.js +467 -0
  144. package/node_modules/undici/lib/core/connect.js +159 -0
  145. package/node_modules/undici/lib/core/constants.js +143 -0
  146. package/node_modules/undici/lib/core/diagnostics.js +227 -0
  147. package/node_modules/undici/lib/core/errors.js +477 -0
  148. package/node_modules/undici/lib/core/request.js +485 -0
  149. package/node_modules/undici/lib/core/socks5-client.js +422 -0
  150. package/node_modules/undici/lib/core/socks5-utils.js +212 -0
  151. package/node_modules/undici/lib/core/symbols.js +76 -0
  152. package/node_modules/undici/lib/core/tree.js +160 -0
  153. package/node_modules/undici/lib/core/util.js +992 -0
  154. package/node_modules/undici/lib/dispatcher/agent.js +162 -0
  155. package/node_modules/undici/lib/dispatcher/balanced-pool.js +221 -0
  156. package/node_modules/undici/lib/dispatcher/client-h1.js +1744 -0
  157. package/node_modules/undici/lib/dispatcher/client-h2.js +1056 -0
  158. package/node_modules/undici/lib/dispatcher/client.js +669 -0
  159. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +196 -0
  160. package/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
  161. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
  162. package/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
  163. package/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
  164. package/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
  165. package/node_modules/undici/lib/dispatcher/pool.js +118 -0
  166. package/node_modules/undici/lib/dispatcher/proxy-agent.js +319 -0
  167. package/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
  168. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +137 -0
  169. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +260 -0
  170. package/node_modules/undici/lib/encoding/index.js +33 -0
  171. package/node_modules/undici/lib/global.js +59 -0
  172. package/node_modules/undici/lib/handler/cache-handler.js +824 -0
  173. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +124 -0
  174. package/node_modules/undici/lib/handler/decorator-handler.js +67 -0
  175. package/node_modules/undici/lib/handler/deduplication-handler.js +504 -0
  176. package/node_modules/undici/lib/handler/redirect-handler.js +245 -0
  177. package/node_modules/undici/lib/handler/retry-handler.js +504 -0
  178. package/node_modules/undici/lib/handler/unwrap-handler.js +106 -0
  179. package/node_modules/undici/lib/handler/wrap-handler.js +105 -0
  180. package/node_modules/undici/lib/interceptor/cache.js +621 -0
  181. package/node_modules/undici/lib/interceptor/decompress.js +561 -0
  182. package/node_modules/undici/lib/interceptor/deduplicate.js +117 -0
  183. package/node_modules/undici/lib/interceptor/dns.js +571 -0
  184. package/node_modules/undici/lib/interceptor/dump.js +99 -0
  185. package/node_modules/undici/lib/interceptor/redirect.js +21 -0
  186. package/node_modules/undici/lib/interceptor/response-error.js +95 -0
  187. package/node_modules/undici/lib/interceptor/retry.js +19 -0
  188. package/node_modules/undici/lib/llhttp/constants.d.ts +195 -0
  189. package/node_modules/undici/lib/llhttp/constants.js +531 -0
  190. package/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
  191. package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
  192. package/node_modules/undici/lib/llhttp/utils.d.ts +2 -0
  193. package/node_modules/undici/lib/llhttp/utils.js +12 -0
  194. package/node_modules/undici/lib/mock/mock-agent.js +232 -0
  195. package/node_modules/undici/lib/mock/mock-call-history.js +248 -0
  196. package/node_modules/undici/lib/mock/mock-client.js +68 -0
  197. package/node_modules/undici/lib/mock/mock-errors.js +29 -0
  198. package/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
  199. package/node_modules/undici/lib/mock/mock-pool.js +68 -0
  200. package/node_modules/undici/lib/mock/mock-symbols.js +32 -0
  201. package/node_modules/undici/lib/mock/mock-utils.js +486 -0
  202. package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
  203. package/node_modules/undici/lib/mock/snapshot-agent.js +353 -0
  204. package/node_modules/undici/lib/mock/snapshot-recorder.js +588 -0
  205. package/node_modules/undici/lib/mock/snapshot-utils.js +158 -0
  206. package/node_modules/undici/lib/util/cache.js +676 -0
  207. package/node_modules/undici/lib/util/date.js +670 -0
  208. package/node_modules/undici/lib/util/promise.js +28 -0
  209. package/node_modules/undici/lib/util/runtime-features.js +124 -0
  210. package/node_modules/undici/lib/util/stats.js +32 -0
  211. package/node_modules/undici/lib/util/timers.js +425 -0
  212. package/node_modules/undici/lib/web/cache/cache.js +864 -0
  213. package/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
  214. package/node_modules/undici/lib/web/cache/util.js +45 -0
  215. package/node_modules/undici/lib/web/cookies/constants.js +12 -0
  216. package/node_modules/undici/lib/web/cookies/index.js +201 -0
  217. package/node_modules/undici/lib/web/cookies/parse.js +315 -0
  218. package/node_modules/undici/lib/web/cookies/util.js +371 -0
  219. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +575 -0
  220. package/node_modules/undici/lib/web/eventsource/eventsource.js +504 -0
  221. package/node_modules/undici/lib/web/eventsource/util.js +29 -0
  222. package/node_modules/undici/lib/web/fetch/LICENSE +21 -0
  223. package/node_modules/undici/lib/web/fetch/body.js +509 -0
  224. package/node_modules/undici/lib/web/fetch/constants.js +131 -0
  225. package/node_modules/undici/lib/web/fetch/data-url.js +596 -0
  226. package/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
  227. package/node_modules/undici/lib/web/fetch/formdata.js +259 -0
  228. package/node_modules/undici/lib/web/fetch/global.js +40 -0
  229. package/node_modules/undici/lib/web/fetch/headers.js +719 -0
  230. package/node_modules/undici/lib/web/fetch/index.js +2413 -0
  231. package/node_modules/undici/lib/web/fetch/request.js +1115 -0
  232. package/node_modules/undici/lib/web/fetch/response.js +641 -0
  233. package/node_modules/undici/lib/web/fetch/util.js +1522 -0
  234. package/node_modules/undici/lib/web/infra/index.js +243 -0
  235. package/node_modules/undici/lib/web/subresource-integrity/Readme.md +9 -0
  236. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
  237. package/node_modules/undici/lib/web/webidl/index.js +1006 -0
  238. package/node_modules/undici/lib/web/websocket/connection.js +339 -0
  239. package/node_modules/undici/lib/web/websocket/constants.js +126 -0
  240. package/node_modules/undici/lib/web/websocket/events.js +331 -0
  241. package/node_modules/undici/lib/web/websocket/frame.js +133 -0
  242. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +105 -0
  243. package/node_modules/undici/lib/web/websocket/receiver.js +520 -0
  244. package/node_modules/undici/lib/web/websocket/sender.js +109 -0
  245. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +104 -0
  246. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +496 -0
  247. package/node_modules/undici/lib/web/websocket/util.js +347 -0
  248. package/node_modules/undici/lib/web/websocket/websocket.js +758 -0
  249. package/node_modules/undici/package.json +152 -0
  250. package/node_modules/undici/scripts/strip-comments.js +10 -0
  251. package/node_modules/undici/types/README.md +6 -0
  252. package/node_modules/undici/types/agent.d.ts +32 -0
  253. package/node_modules/undici/types/api.d.ts +43 -0
  254. package/node_modules/undici/types/balanced-pool.d.ts +30 -0
  255. package/node_modules/undici/types/cache-interceptor.d.ts +179 -0
  256. package/node_modules/undici/types/cache.d.ts +36 -0
  257. package/node_modules/undici/types/client-stats.d.ts +15 -0
  258. package/node_modules/undici/types/client.d.ts +153 -0
  259. package/node_modules/undici/types/connector.d.ts +36 -0
  260. package/node_modules/undici/types/content-type.d.ts +21 -0
  261. package/node_modules/undici/types/cookies.d.ts +30 -0
  262. package/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
  263. package/node_modules/undici/types/dispatcher.d.ts +275 -0
  264. package/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
  265. package/node_modules/undici/types/errors.d.ts +177 -0
  266. package/node_modules/undici/types/eventsource.d.ts +66 -0
  267. package/node_modules/undici/types/fetch.d.ts +231 -0
  268. package/node_modules/undici/types/formdata.d.ts +114 -0
  269. package/node_modules/undici/types/global-dispatcher.d.ts +9 -0
  270. package/node_modules/undici/types/global-origin.d.ts +7 -0
  271. package/node_modules/undici/types/h2c-client.d.ts +73 -0
  272. package/node_modules/undici/types/handlers.d.ts +14 -0
  273. package/node_modules/undici/types/header.d.ts +160 -0
  274. package/node_modules/undici/types/index.d.ts +91 -0
  275. package/node_modules/undici/types/interceptors.d.ts +82 -0
  276. package/node_modules/undici/types/mock-agent.d.ts +68 -0
  277. package/node_modules/undici/types/mock-call-history.d.ts +111 -0
  278. package/node_modules/undici/types/mock-client.d.ts +27 -0
  279. package/node_modules/undici/types/mock-errors.d.ts +12 -0
  280. package/node_modules/undici/types/mock-interceptor.d.ts +94 -0
  281. package/node_modules/undici/types/mock-pool.d.ts +27 -0
  282. package/node_modules/undici/types/patch.d.ts +29 -0
  283. package/node_modules/undici/types/pool-stats.d.ts +19 -0
  284. package/node_modules/undici/types/pool.d.ts +41 -0
  285. package/node_modules/undici/types/proxy-agent.d.ts +29 -0
  286. package/node_modules/undici/types/readable.d.ts +68 -0
  287. package/node_modules/undici/types/retry-agent.d.ts +8 -0
  288. package/node_modules/undici/types/retry-handler.d.ts +125 -0
  289. package/node_modules/undici/types/round-robin-pool.d.ts +41 -0
  290. package/node_modules/undici/types/snapshot-agent.d.ts +109 -0
  291. package/node_modules/undici/types/socks5-proxy-agent.d.ts +25 -0
  292. package/node_modules/undici/types/util.d.ts +18 -0
  293. package/node_modules/undici/types/utility.d.ts +7 -0
  294. package/node_modules/undici/types/webidl.d.ts +347 -0
  295. package/node_modules/undici/types/websocket.d.ts +188 -0
  296. package/node_modules/ws/LICENSE +20 -0
  297. package/node_modules/ws/README.md +548 -0
  298. package/node_modules/ws/browser.js +8 -0
  299. package/node_modules/ws/index.js +22 -0
  300. package/node_modules/ws/lib/buffer-util.js +131 -0
  301. package/node_modules/ws/lib/constants.js +19 -0
  302. package/node_modules/ws/lib/event-target.js +292 -0
  303. package/node_modules/ws/lib/extension.js +203 -0
  304. package/node_modules/ws/lib/limiter.js +55 -0
  305. package/node_modules/ws/lib/permessage-deflate.js +530 -0
  306. package/node_modules/ws/lib/receiver.js +743 -0
  307. package/node_modules/ws/lib/sender.js +607 -0
  308. package/node_modules/ws/lib/stream.js +161 -0
  309. package/node_modules/ws/lib/subprotocol.js +62 -0
  310. package/node_modules/ws/lib/validation.js +152 -0
  311. package/node_modules/ws/lib/websocket-server.js +562 -0
  312. package/node_modules/ws/lib/websocket.js +1407 -0
  313. package/node_modules/ws/package.json +74 -0
  314. package/node_modules/ws/wrapper.mjs +21 -0
  315. package/package.json +17 -4
  316. package/webui/assets/group-bot-profile-CYK81678.jpg +0 -0
  317. package/webui/assets/group-bot-settings-BBQBbfgh.jpg +0 -0
  318. package/webui/assets/index-CuH0UYYo.js +28 -0
  319. package/webui/assets/index-DjbPiYmB.css +2 -0
  320. package/webui/favicon.ico +0 -0
  321. package/webui/index.html +26 -0
  322. package/webui/logo-128.webp +0 -0
  323. package/webui/logo-192.webp +0 -0
  324. package/webui/logo-256.webp +0 -0
  325. package/webui/logo-64.webp +0 -0
  326. package/webui/logo.jpg +0 -0
  327. package/webui/plugin-shared/plugin-sdk-webui.js +3 -0
  328. package/webui/plugin-shared/react-dom.js +3 -0
  329. package/webui/plugin-shared/react-jsx-runtime.js +3 -0
  330. package/webui/plugin-shared/react.js +3 -0
  331. package//344/275/277/347/224/250/350/257/264/346/230/216.txt +6 -0
  332. package//346/233/264/346/226/260/346/227/245/345/277/227.txt +1091 -0
  333. package/README.md +0 -3
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@satorijs/protocol",
3
+ "description": "Protocol types for Satori protocol",
4
+ "version": "1.7.0",
5
+ "type": "module",
6
+ "main": "lib/index.cjs",
7
+ "module": "lib/index.mjs",
8
+ "types": "lib/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./lib/index.d.ts",
12
+ "require": "./lib/index.cjs",
13
+ "import": "./lib/index.mjs"
14
+ },
15
+ "./src/*": "./src/*",
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "lib",
20
+ "src"
21
+ ],
22
+ "author": "Shigma <shigma10826@gmail.com>",
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/satorijs/satori.git",
27
+ "directory": "packages/protocol"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/satorijs/satori/issues"
31
+ },
32
+ "homepage": "https://github.com/satorijs/satori/tree/master/packages/protocol",
33
+ "keywords": [
34
+ "satori",
35
+ "protocol",
36
+ "server",
37
+ "basic",
38
+ "api"
39
+ ],
40
+ "dependencies": {
41
+ "@satorijs/element": "^3.2.0",
42
+ "cosmokit": "^1.8.1"
43
+ }
44
+ }
@@ -0,0 +1,513 @@
1
+ import Element from '@satorijs/element'
2
+ import { Dict, isNullable, pick } from 'cosmokit'
3
+
4
+ type PartialWithPick<T, K extends keyof T> = Partial<T> & Pick<T, K>
5
+
6
+ export interface SendOptions {
7
+ linkPreview?: boolean
8
+ }
9
+
10
+ export interface Upload {
11
+ type: string
12
+ filename?: string
13
+ data: ArrayBuffer
14
+ }
15
+
16
+ export interface Response {
17
+ status: number
18
+ statusText?: string
19
+ body?: ArrayBuffer
20
+ headers?: Headers
21
+ }
22
+
23
+ export interface Field {
24
+ name: string
25
+ }
26
+
27
+ function Field(name: string): Field {
28
+ return { name }
29
+ }
30
+
31
+ export interface Method {
32
+ name: string
33
+ fields: Field[]
34
+ isForm: boolean
35
+ }
36
+
37
+ function Method(name: string, fields: string[], isForm = false): Method {
38
+ return { name, fields: fields.map(Field), isForm }
39
+ }
40
+
41
+ export const Methods: Dict<Method> = {
42
+ 'channel.get': Method('getChannel', ['channel_id', 'guild_id']),
43
+ 'channel.list': Method('getChannelList', ['guild_id', 'next']),
44
+ 'channel.create': Method('createChannel', ['guild_id', 'data']),
45
+ 'channel.update': Method('updateChannel', ['channel_id', 'data']),
46
+ 'channel.delete': Method('deleteChannel', ['channel_id']),
47
+ 'channel.mute': Method('muteChannel', ['channel_id', 'guild_id', 'enable']),
48
+
49
+ 'message.create': Method('createMessage', ['channel_id', 'content', 'referrer']),
50
+ 'message.update': Method('editMessage', ['channel_id', 'message_id', 'content']),
51
+ 'message.delete': Method('deleteMessage', ['channel_id', 'message_id']),
52
+ 'message.get': Method('getMessage', ['channel_id', 'message_id']),
53
+ 'message.list': Method('getMessageList', ['channel_id', 'next', 'direction', 'limit', 'order']),
54
+
55
+ 'reaction.create': Method('createReaction', ['channel_id', 'message_id', 'emoji_id']),
56
+ 'reaction.delete': Method('deleteReaction', ['channel_id', 'message_id', 'emoji_id', 'user_id']),
57
+ 'reaction.clear': Method('clearReaction', ['channel_id', 'message_id', 'emoji_id']),
58
+ 'reaction.list': Method('getReactionList', ['channel_id', 'message_id', 'emoji_id', 'next']),
59
+
60
+ 'upload.create': Method('createUpload', [], true),
61
+
62
+ 'guild.get': Method('getGuild', ['guild_id']),
63
+ 'guild.list': Method('getGuildList', ['next']),
64
+
65
+ 'guild.member.get': Method('getGuildMember', ['guild_id', 'user_id']),
66
+ 'guild.member.list': Method('getGuildMemberList', ['guild_id', 'next']),
67
+ 'guild.member.kick': Method('kickGuildMember', ['guild_id', 'user_id', 'permanent']),
68
+ 'guild.member.mute': Method('muteGuildMember', ['guild_id', 'user_id', 'duration', 'reason']),
69
+ 'guild.member.role.set': Method('setGuildMemberRole', ['guild_id', 'user_id', 'role_id']),
70
+ 'guild.member.role.unset': Method('unsetGuildMemberRole', ['guild_id', 'user_id', 'role_id']),
71
+ 'guild.member.role.list': Method('getGuildMemberRoleList', ['guild_id', 'user_id', 'next']),
72
+
73
+ 'guild.role.list': Method('getGuildRoleList', ['guild_id', 'next']),
74
+ 'guild.role.create': Method('createGuildRole', ['guild_id', 'data']),
75
+ 'guild.role.update': Method('updateGuildRole', ['guild_id', 'role_id', 'data']),
76
+ 'guild.role.delete': Method('deleteGuildRole', ['guild_id', 'role_id']),
77
+
78
+ 'login.get': Method('getLogin', []),
79
+ 'user.get': Method('getUser', ['user_id']),
80
+ 'user.channel.create': Method('createDirectChannel', ['user_id', 'guild_id']),
81
+ 'friend.list': Method('getFriendList', ['next']),
82
+ 'friend.delete': Method('deleteFriend', ['user_id']),
83
+
84
+ 'friend.approve': Method('handleFriendRequest', ['message_id', 'approve', 'comment']),
85
+ 'guild.approve': Method('handleGuildRequest', ['message_id', 'approve', 'comment']),
86
+ 'guild.member.approve': Method('handleGuildMemberRequest', ['message_id', 'approve', 'comment']),
87
+ }
88
+
89
+ export interface List<T = any> {
90
+ data: T[]
91
+ next?: string
92
+ }
93
+
94
+ export interface BidiList<T = any> {
95
+ data: T[]
96
+ prev?: string
97
+ next?: string
98
+ }
99
+
100
+ export type Direction = 'before' | 'after' | 'around'
101
+
102
+ export type Order = 'asc' | 'desc'
103
+
104
+ export interface Methods {
105
+ // message
106
+ createMessage(channelId: string, content: Element.Fragment, referrer?: any, options?: SendOptions): Promise<Message[]>
107
+ sendMessage(channelId: string, content: Element.Fragment, referrer?: any, options?: SendOptions): Promise<string[]>
108
+ sendPrivateMessage(userId: string, content: Element.Fragment, guildId?: string, options?: SendOptions): Promise<string[]>
109
+ getMessage(channelId: string, messageId: string): Promise<Message>
110
+ getMessageList(channelId: string, next?: string, direction?: Direction, limit?: number, order?: Order): Promise<BidiList<Message>>
111
+ getMessageIter(channelId: string): AsyncIterable<Message>
112
+ editMessage(channelId: string, messageId: string, content: Element.Fragment): Promise<void>
113
+ deleteMessage(channelId: string, messageId: string): Promise<void>
114
+
115
+ // reaction
116
+ createReaction(channelId: string, messageId: string, emojiId: string): Promise<void>
117
+ deleteReaction(channelId: string, messageId: string, emojiId: string, userId?: string): Promise<void>
118
+ clearReaction(channelId: string, messageId: string, emojiId?: string): Promise<void>
119
+ getReactionList(channelId: string, messageId: string, emojiId: string, next?: string): Promise<List<User>>
120
+ getReactionIter(channelId: string, messageId: string, emojiId: string): AsyncIterable<User>
121
+
122
+ // upload
123
+ createUpload(...uploads: Upload[]): Promise<string[]>
124
+
125
+ // user
126
+ getLogin(): Promise<Login>
127
+ getUser(userId: string, guildId?: string): Promise<User>
128
+ getFriendList(next?: string): Promise<List<Friend>>
129
+ getFriendIter(): AsyncIterable<Friend>
130
+ deleteFriend(userId: string): Promise<void>
131
+
132
+ // guild
133
+ getGuild(guildId: string): Promise<Guild>
134
+ getGuildList(next?: string): Promise<List<Guild>>
135
+ getGuildIter(): AsyncIterable<Guild>
136
+
137
+ // guild member
138
+ getGuildMember(guildId: string, userId: string): Promise<GuildMember>
139
+ getGuildMemberList(guildId: string, next?: string): Promise<List<GuildMember>>
140
+ getGuildMemberIter(guildId: string): AsyncIterable<GuildMember>
141
+ kickGuildMember(guildId: string, userId: string, permanent?: boolean): Promise<void>
142
+ muteGuildMember(guildId: string, userId: string, duration: number, reason?: string): Promise<void>
143
+ setGuildMemberRole(guildId: string, userId: string, roleId: string): Promise<void>
144
+ unsetGuildMemberRole(guildId: string, userId: string, roleId: string): Promise<void>
145
+ getGuildMemberRoleList(guildId: string, userId: string, next?: string): Promise<List<PartialWithPick<GuildRole, 'id'>>>
146
+
147
+ // role
148
+ getGuildRoleList(guildId: string, next?: string): Promise<List<GuildRole>>
149
+ getGuildRoleIter(guildId: string): AsyncIterable<GuildRole>
150
+ createGuildRole(guildId: string, data: Partial<GuildRole>): Promise<GuildRole>
151
+ updateGuildRole(guildId: string, roleId: string, data: Partial<GuildRole>): Promise<void>
152
+ deleteGuildRole(guildId: string, roleId: string): Promise<void>
153
+
154
+ // channel
155
+ getChannel(channelId: string, guildId?: string): Promise<Channel>
156
+ getChannelList(guildId: string, next?: string): Promise<List<Channel>>
157
+ getChannelIter(guildId: string): AsyncIterable<Channel>
158
+ createDirectChannel(userId: string, guildId?: string): Promise<Channel>
159
+ createChannel(guildId: string, data: Partial<Channel>): Promise<Channel>
160
+ updateChannel(channelId: string, data: Partial<Channel>): Promise<void>
161
+ deleteChannel(channelId: string): Promise<void>
162
+ muteChannel(channelId: string, guildId?: string, enable?: boolean): Promise<void>
163
+
164
+ // request
165
+ handleFriendRequest(messageId: string, approve: boolean, comment?: string): Promise<void>
166
+ handleGuildRequest(messageId: string, approve: boolean, comment?: string): Promise<void>
167
+ handleGuildMemberRequest(messageId: string, approve: boolean, comment?: string): Promise<void>
168
+
169
+ // commands
170
+ updateCommands(commands: Command[]): Promise<void>
171
+ }
172
+
173
+ export interface Channel {
174
+ id: string
175
+ type: Channel.Type
176
+ name?: string
177
+ parentId?: string
178
+ position?: number
179
+ }
180
+
181
+ export namespace Channel {
182
+ export const enum Type {
183
+ TEXT = 0,
184
+ DIRECT = 1,
185
+ CATEGORY = 2,
186
+ VOICE = 3,
187
+ }
188
+ }
189
+
190
+ export interface Guild {
191
+ id: string
192
+ name?: string
193
+ avatar?: string
194
+ }
195
+
196
+ export interface GuildRole {
197
+ id: string
198
+ name?: string
199
+ color?: number
200
+ position?: number
201
+ permissions?: bigint
202
+ hoist?: boolean
203
+ mentionable?: boolean
204
+ }
205
+
206
+ export interface Emoji {
207
+ id: string
208
+ name?: string
209
+ }
210
+
211
+ export interface User {
212
+ id: string
213
+ name?: string
214
+ nick?: string
215
+ /** @deprecated */
216
+ userId?: string
217
+ /** @deprecated */
218
+ username?: string
219
+ /** @deprecated */
220
+ nickname?: string
221
+ avatar?: string
222
+ discriminator?: string
223
+ isBot?: boolean
224
+ }
225
+
226
+ export interface Resource<K = any> {
227
+ attrs: (keyof K)[]
228
+ children: (keyof K)[]
229
+ content?: keyof K
230
+ }
231
+
232
+ export function Resource<K>(attrs: (keyof K)[] = [], children: (keyof K)[] = [], content?: keyof K): Resource<K> {
233
+ return { attrs, children, content }
234
+ }
235
+
236
+ export namespace Resource {
237
+ export interface Definitions {
238
+ user: User
239
+ member: GuildMember
240
+ channel: Channel
241
+ guild: Guild
242
+ quote: Message
243
+ }
244
+
245
+ const Definitions: { [K in keyof Definitions]: Resource<Definitions[K]> } = {
246
+ user: Resource(['id', 'name', 'nick', 'avatar', 'isBot']),
247
+ member: Resource(['name', 'nick', 'avatar']),
248
+ channel: Resource(['id', 'type', 'name']),
249
+ guild: Resource(['id', 'name', 'avatar']),
250
+ quote: Resource(['id'], ['quote', 'user', 'member', 'channel'], 'content'),
251
+ }
252
+
253
+ export function encode<K extends keyof Definitions>(type: K, data: Definitions[K]) {
254
+ const resource = Definitions[type]
255
+ const element = Element(type, pick(data, resource.attrs as any))
256
+ for (const key of resource.children) {
257
+ if (isNullable(data[key])) continue
258
+ element.children.push(encode(key as any, data[key]))
259
+ }
260
+ if (resource.content && !isNullable(data[resource.content])) {
261
+ element.children.push(...Element.parse(data[resource.content] as string))
262
+ }
263
+ return element
264
+ }
265
+
266
+ export function decode(element: Element) {
267
+ const data: any = element.attrs
268
+ const resource = Definitions[element.type]
269
+ for (const key of resource.children) {
270
+ const index = element.children.findIndex((el) => el.type === key)
271
+ if (index === -1) continue
272
+ const [child] = element.children.splice(index, 1)
273
+ data[key] = decode(child)
274
+ }
275
+ if (resource.content && element.children.length) {
276
+ data[resource.content] = element.children.join('')
277
+ }
278
+ return data
279
+ }
280
+ }
281
+
282
+ export function transformKey(source: any, callback: (key: string) => string) {
283
+ if (!source || typeof source !== 'object') return source
284
+ if (Array.isArray(source)) return source.map(value => transformKey(value, callback))
285
+ return Object.fromEntries(Object.entries(source).map(([key, value]) => {
286
+ if (key.startsWith('_') || key === 'referrer') return [key, value]
287
+ return [callback(key), transformKey(value, callback)]
288
+ }))
289
+ }
290
+
291
+ export interface Friend {
292
+ user?: User
293
+ nick?: string
294
+ }
295
+
296
+ export interface GuildMember {
297
+ user?: User
298
+ name?: string
299
+ nick?: string
300
+ avatar?: string
301
+ title?: string
302
+ roles?: GuildRole[]
303
+ joinedAt?: number
304
+ }
305
+
306
+ export interface Login {
307
+ sn: number
308
+ adapter: string
309
+ user?: User
310
+ platform?: string
311
+ /** @deprecated use `login.user.id` instead */
312
+ selfId?: string
313
+ hidden?: boolean
314
+ status: Status
315
+ features: string[]
316
+ }
317
+
318
+ export const enum Status {
319
+ OFFLINE = 0,
320
+ ONLINE = 1,
321
+ CONNECT = 2,
322
+ DISCONNECT = 3,
323
+ RECONNECT = 4,
324
+ }
325
+
326
+ export interface Message {
327
+ id?: string
328
+ /** @deprecated */
329
+ messageId?: string
330
+ channel?: Channel
331
+ guild?: Guild
332
+ user?: User
333
+ member?: GuildMember
334
+ content?: string
335
+ elements?: Element[]
336
+ timestamp?: number
337
+ quote?: Message
338
+ createdAt?: number
339
+ updatedAt?: number
340
+ }
341
+
342
+ export interface Button {
343
+ id: string
344
+ }
345
+
346
+ export interface Command {
347
+ name: string
348
+ description: Dict<string>
349
+ arguments: Command.Declaration[]
350
+ options: Command.Declaration[]
351
+ children: Command[]
352
+ }
353
+
354
+ export namespace Command {
355
+ export interface Declaration {
356
+ name: string
357
+ description: Dict<string>
358
+ type: string
359
+ required: boolean
360
+ }
361
+ }
362
+
363
+ export interface Argv {
364
+ name: string
365
+ arguments: any[]
366
+ options: Dict
367
+ }
368
+
369
+ type Genres = 'friend' | 'channel' | 'guild' | 'guild-member' | 'guild-role' | 'guild-file' | 'guild-emoji'
370
+ type Actions = 'added' | 'deleted' | 'updated'
371
+
372
+ export type EventName =
373
+ | `${Genres}-${Actions}`
374
+ | 'message'
375
+ | 'message-deleted'
376
+ | 'message-updated'
377
+ | 'message-pinned'
378
+ | 'message-unpinned'
379
+ | 'interaction/command'
380
+ | 'reaction-added'
381
+ | 'reaction-deleted'
382
+ | 'reaction-deleted/one'
383
+ | 'reaction-deleted/all'
384
+ | 'reaction-deleted/emoji'
385
+ | 'send'
386
+ | 'friend-request'
387
+ | 'guild-request'
388
+ | 'guild-member-request'
389
+
390
+ export interface Event {
391
+ sn: number
392
+ type: string
393
+ login: Login
394
+ selfId: string
395
+ platform: string
396
+ timestamp: number
397
+ argv?: Argv
398
+ channel?: Channel
399
+ guild?: Guild
400
+ friend?: Friend
401
+ member?: GuildMember
402
+ message?: Message
403
+ operator?: User
404
+ emoji?: Emoji
405
+ role?: GuildRole
406
+ user?: User
407
+ button?: Button
408
+ referrer: any
409
+ _type?: string
410
+ _data?: any
411
+ /** @deprecated */
412
+ subtype?: string
413
+ }
414
+
415
+ export interface Meta {
416
+ logins: Login[]
417
+ proxyUrls: string[]
418
+ }
419
+
420
+ export type MessageLike = Message | Event
421
+
422
+ export const enum Opcode {
423
+ EVENT = 0,
424
+ PING = 1,
425
+ PONG = 2,
426
+ IDENTIFY = 3,
427
+ READY = 4,
428
+ META = 5,
429
+ }
430
+
431
+ export interface GatewayPayloadStructure<O extends Opcode> {
432
+ op: O
433
+ body: GatewayBody[O]
434
+ }
435
+
436
+ export type ServerPayload = {
437
+ [O in Opcode]: GatewayPayloadStructure<O>
438
+ }[Opcode.EVENT | Opcode.PONG | Opcode.READY | Opcode.META]
439
+
440
+ export type ClientPayload = {
441
+ [O in Opcode]: GatewayPayloadStructure<O>
442
+ }[Opcode.PING | Opcode.IDENTIFY]
443
+
444
+ export interface GatewayBody {
445
+ [Opcode.EVENT]: Event
446
+ [Opcode.PING]: {}
447
+ [Opcode.PONG]: {}
448
+ [Opcode.IDENTIFY]: {
449
+ token?: string
450
+ sn?: number
451
+ }
452
+ [Opcode.READY]: Meta
453
+ [Opcode.META]: {
454
+ proxyUrls: string[]
455
+ }
456
+ }
457
+
458
+ export namespace WebSocket {
459
+ /** The connection is not yet open. */
460
+ export const CONNECTING = 0
461
+ /** The connection is open and ready to communicate. */
462
+ export const OPEN = 1
463
+ /** The connection is in the process of closing. */
464
+ export const CLOSING = 2
465
+ /** The connection is closed. */
466
+ export const CLOSED = 3
467
+
468
+ export type ReadyState =
469
+ | typeof CONNECTING
470
+ | typeof OPEN
471
+ | typeof CLOSING
472
+ | typeof CLOSED
473
+
474
+ export interface EventMap {
475
+ open: Event
476
+ error: ErrorEvent
477
+ message: MessageEvent
478
+ close: CloseEvent
479
+ }
480
+
481
+ export interface EventListener {
482
+ (event: Event): void
483
+ }
484
+
485
+ export interface Event {
486
+ type: string
487
+ target: WebSocket
488
+ }
489
+
490
+ export interface CloseEvent extends Event {
491
+ code: number
492
+ reason: string
493
+ }
494
+
495
+ export interface MessageEvent extends Event {
496
+ data: string
497
+ }
498
+
499
+ export interface ErrorEvent extends Event {
500
+ message?: string
501
+ }
502
+ }
503
+
504
+ export interface WebSocket {
505
+ readonly url: string
506
+ readonly protocol?: string
507
+ readonly readyState?: number
508
+ close(code?: number, reason?: string): void
509
+ send(data: string): void
510
+ dispatchEvent?(event: any): boolean
511
+ addEventListener<K extends keyof WebSocket.EventMap>(type: K, listener: (event: WebSocket.EventMap[K]) => void): void
512
+ removeEventListener<K extends keyof WebSocket.EventMap>(type: K, listener: (event: WebSocket.EventMap[K]) => void): void
513
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Colin McDonnell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.