@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,762 @@
1
+ /**
2
+ * The WebUI side of a plugin: the ES module named by `llbot.webui` in package.json. Its default export
3
+ * receives a WebUIContext and registers what the plugin adds to the WebUI.
4
+ *
5
+ * The WebUI hands the module its own `react`, `react/jsx-runtime`, `react-dom` and this module through an
6
+ * import map, so components share its React. Mark all four external when bundling. The `declare`d values below
7
+ * are those the WebUI supplies at runtime.
8
+ */
9
+ /**
10
+ * A React component, `React.lazy()` ones included: the WebUI renders plugin components inside Suspense.
11
+ * Typed loosely so that this SDK does not depend on @types/react.
12
+ */
13
+ export type Component<P = any> = ((props: P) => any) | (new (props: P) => any) | {
14
+ readonly $$typeof: symbol;
15
+ };
16
+ /** A function component the WebUI supplies, for use in JSX. */
17
+ export type WebUIComponent<P = {}> = (props: P) => any;
18
+ export interface PageOptions {
19
+ /** Unique within the plugin; the WebUI prefixes it with the package name to make the tab id. */
20
+ id: string;
21
+ title: string;
22
+ /** lucide icon name, from the same list as `llbot.icon`. */
23
+ icon?: string;
24
+ /** Rendered without props. */
25
+ component: Component<{}>;
26
+ /**
27
+ * Drawn above the page where the Dashboard has its title, on wide screens only; rendered without props. Without
28
+ * it that room stays empty.
29
+ */
30
+ header?: Component<{}>;
31
+ /**
32
+ * Sidebar position, lowest first, shared with the builtin pages: Dashboard 0, NTQQ 协议 5, 日志 20, 插件 40,
33
+ * WebQQ 50, 关于 1000. Defaults to 100. Only where the page goes until the user arranges the sidebar (its dialog
34
+ * in the WebUI settings), whose order is kept over this one.
35
+ */
36
+ order?: number;
37
+ /**
38
+ * A settings page: shown whatever state the plugin is in, under a notice saying what keeps it from running, e.g.
39
+ * the plugin it waits for. Once the plugin is disabled the sidebar drops the page, but the plugin card still opens
40
+ * it. Any other page is listed while the plugin is enabled too, but the WebUI shows that reason in its place until
41
+ * the plugin runs.
42
+ */
43
+ settings?: boolean;
44
+ }
45
+ /**
46
+ * How a slot shows its contributions:
47
+ * - `list` every one, in `order`
48
+ * - `single` one, the highest `priority`, and what the slot shows by itself while none is there
49
+ * - `keyed` one per key: the slot asks for a key (`match` of `Slot`), the highest `priority` among the contributions
50
+ * with that `match` shows, else the slot's own content
51
+ * - `chain` every one, wrapped around each other in `order`, the first outermost: each gets what the rest drew in
52
+ * `next`, around the slot's own content, and may wrap it, change it or pass it through
53
+ * - `hoc` wrappers receiving `children`, in `order` with the first outermost; `match` optionally selects a page
54
+ * Replacing what is there is only ever possible where a slot is `single` or `keyed`, changing it where it is `chain`.
55
+ */
56
+ export type SlotCardinality = 'list' | 'single' | 'keyed' | 'chain' | 'hoc';
57
+ /**
58
+ * The slots, by name, with the props the slot hands its contributions and the options they describe themselves
59
+ * with. Names are dotted paths of where they are: `dashboard.cards`, `webqq.chat.actions`. A plugin declaring one
60
+ * (`ctx.declareSlot`) adds it here by declaration merging, for the plugins filling it to type against:
61
+ *
62
+ * declare module '@luckylillia-dev/plugin-sdk/webui' {
63
+ * interface SlotMap { 'my-plugin.item.actions': { props: { item: Item }; options: {} } }
64
+ * }
65
+ *
66
+ * The props of a `chain` slot include `next`, which the slot passes on itself.
67
+ */
68
+ export interface SlotMap {
69
+ /** Actions beside the page title (also available in the mobile header). */
70
+ 'page.header.actions': {
71
+ props: {
72
+ page: WebUIPageInfo;
73
+ };
74
+ options: {};
75
+ };
76
+ /** Page wrappers, `hoc`: render children. `match` optionally limits a wrapper to a page key. Core management pages are excluded. */
77
+ 'page.content': {
78
+ props: {
79
+ page: WebUIPageInfo;
80
+ children: unknown;
81
+ };
82
+ options: {};
83
+ };
84
+ 'sidebar.header': {
85
+ props: {};
86
+ options: {};
87
+ };
88
+ 'sidebar.footer': {
89
+ props: {};
90
+ options: {};
91
+ };
92
+ /** Active theme owner's controls, inside a collapsed "主题设置" disclosure; return null when no controls apply. */
93
+ 'settings.appearance': {
94
+ props: {};
95
+ options: {};
96
+ };
97
+ /** Additional settings cards; the host draws the card and its optional title. */
98
+ 'settings.sections': {
99
+ props: {};
100
+ options: {
101
+ title?: string;
102
+ };
103
+ };
104
+ /** Additional actions in the plugin page's filter toolbar. */
105
+ 'plugins.toolbar': {
106
+ props: {};
107
+ options: {};
108
+ };
109
+ /** Additional views opened from the plugin page's toolbar. Catalogs use plugins.catalog. */
110
+ 'plugins.views': {
111
+ props: PluginsViewProps;
112
+ options: PluginsViewOptions;
113
+ };
114
+ /** Catalog data and package operations for the host's unified plugin list; renders no cards. */
115
+ 'plugins.catalog': {
116
+ props: PluginCatalogProps;
117
+ options: {};
118
+ };
119
+ /** Upload controls inside the host's local installation dialog. */
120
+ 'plugins.install': {
121
+ props: {
122
+ onInstalled(): void;
123
+ disabled?: boolean;
124
+ };
125
+ options: {};
126
+ };
127
+ /** Buttons on each card of the plugin page, before its own. */
128
+ 'plugins.card.actions': {
129
+ props: {
130
+ plugin: PluginEntryStatus;
131
+ };
132
+ options: {};
133
+ };
134
+ /** Cards on the Dashboard, declared by the Dashboard plugin. It draws the card, its title and width; the component, its inside. */
135
+ 'dashboard.cards': {
136
+ props: {};
137
+ options: DashboardCardOptions;
138
+ };
139
+ /** The title of the Dashboard, `single`: a contribution replaces the Dashboard's own. */
140
+ 'dashboard.header': {
141
+ props: {};
142
+ options: {};
143
+ };
144
+ /** Buttons in the header of a WebQQ chat, declared by WebQQ. */
145
+ 'webqq.chat.actions': {
146
+ props: {
147
+ chat: WebQQChat;
148
+ };
149
+ options: {};
150
+ };
151
+ /**
152
+ * How WebQQ draws a message element, `keyed` by its `elementType` (`'14'` for markdown): a contribution replaces
153
+ * WebQQ's own drawing of that type, or draws one WebQQ has none for. `message` is missing in a reply's quote.
154
+ */
155
+ 'webqq.message.element': {
156
+ props: {
157
+ element: WebQQElement;
158
+ message?: WebQQMessage;
159
+ };
160
+ options: {};
161
+ };
162
+ /** The bubble of a WebQQ message, `chain`: `next` is the bubble as drawn so far. */
163
+ 'webqq.message.bubble': {
164
+ props: {
165
+ message: WebQQMessage;
166
+ next: unknown;
167
+ };
168
+ options: {};
169
+ };
170
+ }
171
+ export interface DashboardCardOptions {
172
+ title?: string;
173
+ /** lucide icon name, from the `llbot.icon` list. */
174
+ icon?: string;
175
+ /**
176
+ * About a third of a row (default), two thirds, or the whole row; the cards of a row share out the room it has
177
+ * left, so one rendering nothing leaves no gap.
178
+ */
179
+ size?: 'normal' | 'wide' | 'full';
180
+ }
181
+ export interface PluginsViewProps {
182
+ /**
183
+ * The host's settings action for an installed entry, identified by its id from usePlugins().
184
+ * Opens the same settings page or config dialog as its plugin card, including for disabled plugins.
185
+ * Undefined if the entry is missing, busy, or has no settings.
186
+ */
187
+ configAction(id: string): {
188
+ open(): void;
189
+ label: string;
190
+ } | undefined;
191
+ /** Opens the same details dialog as a plugin card, including for packages not installed yet. */
192
+ showDetails(source: PluginDetailsSource): void;
193
+ }
194
+ export interface PluginDetailsContent {
195
+ markdown?: string;
196
+ /** URL the markdown's relative image paths resolve against, ending in a slash. */
197
+ base: string;
198
+ screenshots: LightboxImage[];
199
+ }
200
+ /** A catalog entry ready for display, without another metadata request. */
201
+ export interface PluginCatalogItem extends PluginDetailsSource {
202
+ version: string;
203
+ category?: string;
204
+ repository?: string;
205
+ /** Builtin entry name, when this package updates a bundled plugin. */
206
+ builtin?: string;
207
+ }
208
+ export interface PluginInstalledPackage {
209
+ name: string;
210
+ title?: string;
211
+ version: string;
212
+ description?: string;
213
+ managed: boolean;
214
+ root: string;
215
+ builtin?: string;
216
+ activeVersion?: string;
217
+ restartRequired?: boolean;
218
+ error?: string;
219
+ }
220
+ export interface PluginUpdateInfo {
221
+ latest?: string;
222
+ update?: string;
223
+ blocked?: string;
224
+ deprecated?: string;
225
+ error?: string;
226
+ }
227
+ export interface PluginPackageProgress {
228
+ phase: 'queued' | 'planning' | 'downloading' | 'installing';
229
+ /** 0-100 when measurable; omitted for indeterminate phases such as queued or planning. */
230
+ percent?: number;
231
+ detail: string;
232
+ }
233
+ /** Snapshot and guarded actions supplied by a catalog plugin. Installed entries remain owned by the host. */
234
+ export interface PluginCatalogState {
235
+ items: PluginCatalogItem[] | null;
236
+ loading: boolean;
237
+ error?: string;
238
+ installed: PluginInstalledPackage[] | null;
239
+ installedError?: string;
240
+ updates: Record<string, PluginUpdateInfo> | null;
241
+ updatesError?: string;
242
+ checking: boolean;
243
+ loadingInstalled: boolean;
244
+ checkedAt: number;
245
+ busy: readonly string[];
246
+ progress?: Record<string, PluginPackageProgress>;
247
+ retry(): void;
248
+ refresh(): void;
249
+ install(name: string, version: string): Promise<boolean>;
250
+ update(name: string): Promise<boolean>;
251
+ /** Retain per-entry configuration for a later reinstall when keepConfig is true. */
252
+ uninstall(name: string, options?: {
253
+ keepConfig?: boolean;
254
+ }): Promise<boolean>;
255
+ }
256
+ export interface PluginCatalogProps {
257
+ /** Fetch the catalog only when browsing uninstalled or all plugins. */
258
+ loadCatalog: boolean;
259
+ /** Publish after render; clear the snapshot on unmount. */
260
+ onChange(state: PluginCatalogState | null): void;
261
+ }
262
+ export interface PluginMetaRowProps {
263
+ title: string;
264
+ category?: string;
265
+ author?: {
266
+ name: string;
267
+ url?: string;
268
+ };
269
+ packageName?: string;
270
+ repository?: string;
271
+ /** Actions immediately after the package/repository links, e.g. a details button. */
272
+ children?: unknown;
273
+ className?: string;
274
+ }
275
+ /** The category, author and package links shared by installed plugin cards and market results. */
276
+ export declare const PluginMetaRow: WebUIComponent<PluginMetaRowProps>;
277
+ /** Known metadata and screenshots display immediately; a loader can supply additional package details. */
278
+ export interface PluginDetailsSource {
279
+ name: string;
280
+ title: string;
281
+ version?: string;
282
+ description?: string;
283
+ author?: {
284
+ name: string;
285
+ url?: string;
286
+ email?: string;
287
+ };
288
+ icon?: string;
289
+ iconUrl?: string;
290
+ /** Available before the full details load, and if loading fails. */
291
+ screenshots?: LightboxImage[];
292
+ /** Omit when the caller already has all preview data, such as a market catalog entry. */
293
+ load?(): Promise<PluginDetailsContent>;
294
+ }
295
+ export interface PluginsViewOptions {
296
+ /** The tab's name */
297
+ title: string;
298
+ /** Drawn after the name, e.g. a count of updates; rendering nothing leaves the name alone */
299
+ badge?: WebUIComponent;
300
+ }
301
+ /** The chat open in WebQQ. */
302
+ export interface WebQQChat {
303
+ /** 1 private, 2 group, 100 temporary */
304
+ chatType: number;
305
+ /** QQ number of the friend, number of the group */
306
+ peerId: string;
307
+ name: string;
308
+ }
309
+ /** A message as WebQQ shows it. */
310
+ export interface WebQQMessage {
311
+ msgId: string;
312
+ msgSeq: string;
313
+ /** 1 private, 2 group, 100 temporary */
314
+ chatType: number;
315
+ /** QQ number of the friend, number of the group */
316
+ peerId: string;
317
+ senderUin: string;
318
+ senderName: string;
319
+ /** Unix seconds */
320
+ time: number;
321
+ /** Its text elements, joined */
322
+ text: string;
323
+ /** Sent by the logged-in account */
324
+ self: boolean;
325
+ }
326
+ /** A message element as NTQQ has it: `elementType` and the field of that type, e.g. `markdownElement: { content }`. */
327
+ export interface WebQQElement {
328
+ elementType: number;
329
+ [field: string]: unknown;
330
+ }
331
+ export type SlotContribution<K extends keyof SlotMap> = SlotMap[K]['options'] & {
332
+ /**
333
+ * Unique among this plugin's contributions to the slot, and kept from version to version: the plugin page hides
334
+ * and orders them by it.
335
+ */
336
+ id: string;
337
+ /** What the plugin page calls it; defaults to its `title` option, then the id. */
338
+ label?: string;
339
+ component: Component<SlotMap[K]['props']>;
340
+ /** Lowest first in a `list` or a `chain` (outermost). Defaults to 100. */
341
+ order?: number;
342
+ /** In a `single` slot, the highest one shows, in a `keyed` slot the highest for the key. Defaults to 0. */
343
+ priority?: number;
344
+ /** In a `keyed` slot, the key this contribution draws. */
345
+ match?: string;
346
+ };
347
+ export interface SlotDeclaration {
348
+ /** What the plugin page calls it, next to what fills it. */
349
+ title: string;
350
+ description?: string;
351
+ cardinality: SlotCardinality;
352
+ /** Lets users arrange and hide this list's contributions in the declaring plugin's config dialog. */
353
+ configurable?: boolean;
354
+ }
355
+ export interface ConfigEditorProps<T = any> {
356
+ /** The whole config with defaults filled in. */
357
+ value: T;
358
+ onChange(value: T): void;
359
+ /** schemastery `toJSON()` of the plugin's Config, or null. */
360
+ schema: unknown;
361
+ defaults: unknown;
362
+ /** Messages from the last rejected save, keyed by dotted path (`''` for the root). */
363
+ errors: Record<string, string>;
364
+ }
365
+ export interface FieldProps<T = any> {
366
+ value: T;
367
+ onChange(value: T): void;
368
+ /** Meta of the schema node: description, default, role options and so on. */
369
+ meta: Record<string, any>;
370
+ error?: string;
371
+ }
372
+ export interface ApiOptions {
373
+ method?: string;
374
+ /** Sent as JSON unless it is a string or FormData. */
375
+ body?: unknown;
376
+ }
377
+ export interface WebUIPageInfo {
378
+ key: string;
379
+ owner: string;
380
+ title: string;
381
+ fullscreen: boolean;
382
+ }
383
+ export type ThemeMode = 'light' | 'dark' | 'auto';
384
+ /** Semantic CSS custom properties, e.g. --accent, --text-primary, --r-card. */
385
+ export type ThemeTokens = Record<string, string>;
386
+ export interface ThemeVariant {
387
+ tokens: ThemeTokens;
388
+ /** CSS background shorthand. When present, replaces the default animated wallpaper. Use ctx.asset() for images. */
389
+ background?: string;
390
+ }
391
+ export interface ThemeDefinition {
392
+ /** Unique within this plugin. The stored key is <package>|<id>. */
393
+ id: string;
394
+ title: string;
395
+ description?: string;
396
+ light: ThemeVariant;
397
+ dark: ThemeVariant;
398
+ /** Optional stylesheet, installed only while this theme is selected and its plugin runs. */
399
+ css?: string;
400
+ }
401
+ export interface ThemeInfo {
402
+ key: string;
403
+ owner: string;
404
+ id: string;
405
+ title: string;
406
+ description?: string;
407
+ available: boolean;
408
+ }
409
+ export interface ThemeSnapshot {
410
+ mode: ThemeMode;
411
+ isDark: boolean;
412
+ /** Saved preference; preserved while its plugin is unavailable. 'default' is the built-in theme. */
413
+ selected: string;
414
+ /** Effective theme, falling back to 'default' until the selected plugin runs. */
415
+ active: string;
416
+ background?: string;
417
+ themes: ThemeInfo[];
418
+ }
419
+ export interface ThemeController {
420
+ register(theme: ThemeDefinition): () => void;
421
+ /** Later layers win. A source replaces its previous layer; cleanup never removes a newer layer. */
422
+ overrideTokens(source: string, tokens: {
423
+ light: ThemeTokens;
424
+ dark: ThemeTokens;
425
+ }): () => void;
426
+ get(): ThemeSnapshot;
427
+ /** Selects one of this plugin's theme ids, or 'default'. Selection is saved in this browser. */
428
+ select(id: string): void;
429
+ }
430
+ export interface ThemeState extends ThemeSnapshot {
431
+ /** Selects a theme by its full key from themes, or 'default'. */
432
+ select(key: string): void;
433
+ setMode(mode: ThemeMode): void;
434
+ }
435
+ export interface StyleOptions {
436
+ /** Global CSS by default. 'plugin' limits selectors to this plugin's rendered components and portals. */
437
+ scope?: 'global' | 'plugin';
438
+ /** Active by default. Scoped component utilities can stay 'loaded' for disabled configuration pages. */
439
+ when?: 'active' | 'loaded';
440
+ }
441
+ export declare function useTheme(): ThemeState;
442
+ export interface WebUIContext {
443
+ /** The package this module belongs to. */
444
+ readonly plugin: {
445
+ readonly name: string;
446
+ };
447
+ readonly theme: ThemeController;
448
+ /** A managed stylesheet: active by default, removed on module disposal. See StyleOptions for scoped component CSS. */
449
+ style(id: string, css: string, options?: StyleOptions): () => void;
450
+ /** Resolves a file relative to this module inside its served WebUI directory. */
451
+ asset(path: string): string;
452
+ /** Adds a sidebar page, listed while the plugin is enabled; see `PageOptions.settings`. */
453
+ page(options: PageOptions): () => void;
454
+ /**
455
+ * Adds a contribution to a slot, the WebUI's or one another plugin declared; it shows while this plugin runs. One
456
+ * into a slot nobody declares waits for it, and the plugin page says so. Throws for a missing or repeated `id`.
457
+ */
458
+ slot<K extends keyof SlotMap>(name: K, contribution: SlotContribution<K>): () => void;
459
+ /**
460
+ * Declares a slot of this plugin's own UI for other plugins to fill; render it with `Slot` where it goes. Name it
461
+ * after the plugin and the place (`my-plugin.item.actions`); a name taken already throws.
462
+ */
463
+ declareSlot(name: string, declaration: SlotDeclaration): () => void;
464
+ /**
465
+ * Replaces the generated form in this plugin's config dialog, which also opens while the plugin is
466
+ * disabled. Saving still goes through the bot, which validates against the plugin's Config.
467
+ */
468
+ config(component: Component<ConfigEditorProps>): () => void;
469
+ /** Renders schema fields declared with `.role(role)` in every plugin's generated config form. */
470
+ field(role: string, component: Component<FieldProps>): () => void;
471
+ /** Calls the bot's HTTP API with the WebUI login; resolves with `data` of a `{ success, data }` reply. */
472
+ api<T = any>(path: string, options?: ApiOptions): Promise<T>;
473
+ /**
474
+ * fetch() with the WebUI login, for what `api()` does not cover (raw bodies, streams, error bodies). Asks for
475
+ * the password the way the WebUI does when its login refuses the request; any other error response, a 401 or 403
476
+ * of the route's own included, comes back as it is.
477
+ */
478
+ fetch(path: string, init?: RequestInit): Promise<Response>;
479
+ /** The path with the WebUI login in its query: for `<img>`, `<video>`, downloads and the like, which send no headers. */
480
+ authUrl(path: string): string;
481
+ /** Address of one of this plugin's pages, for links and `window.open()`; `fullscreen` opens it without the sidebar. */
482
+ pageHref(id: string, options?: {
483
+ fullscreen?: boolean;
484
+ }): string;
485
+ /**
486
+ * Listens to a server-sent event stream of the bot's API, by event name; returns the function closing it, which
487
+ * unloading the module calls as well.
488
+ */
489
+ events(path: string, listeners: Record<string, (data: any) => void>): () => void;
490
+ /** Defaults to `success`. */
491
+ toast(message: string, type?: 'success' | 'error' | 'warning'): void;
492
+ }
493
+ /**
494
+ * The module's default export. It may return a cleanup function, run when the module is replaced by a
495
+ * newer version of the plugin. Everything registered through `ctx` is removed then as well, and when the function
496
+ * throws: a module's part of the WebUI is there whole or not at all.
497
+ */
498
+ export type WebUIPlugin = (ctx: WebUIContext) => void | (() => void);
499
+ /** The WebUIContext of the plugin whose component is rendering. Supplied by the WebUI at runtime. */
500
+ export declare function usePluginContext(): WebUIContext;
501
+ export type PluginState = 'missing' | 'incompatible' | 'pending' | 'loading' | 'active' | 'failed' | 'disposed';
502
+ /** How the WebUI sees a plugin entry, from the plugin list. */
503
+ export interface PluginEntryStatus {
504
+ id: string;
505
+ name: string;
506
+ title?: string;
507
+ disabled: boolean;
508
+ state: PluginState;
509
+ error?: string;
510
+ /** Services the entry waits for while pending */
511
+ missingDeps: string[];
512
+ /** What an enabled builtin says about its settings, e.g. that something still has to be filled in */
513
+ notice?: string;
514
+ /** Metadata from the installed package; the title may be localized. */
515
+ manifest?: {
516
+ title?: string | Record<string, string>;
517
+ icon?: string;
518
+ };
519
+ iconUrl?: string;
520
+ /** This entry has active message listeners. */
521
+ messages?: boolean;
522
+ /** Its saved position in the message processing order. */
523
+ rank?: number;
524
+ scope?: {
525
+ platforms?: string[];
526
+ bots?: string[];
527
+ guilds?: {
528
+ mode: 'allow' | 'deny';
529
+ ids: string[];
530
+ };
531
+ users?: {
532
+ mode: 'allow' | 'deny';
533
+ ids: string[];
534
+ };
535
+ direct?: boolean;
536
+ };
537
+ listenerError?: {
538
+ at: number;
539
+ message: string;
540
+ count: number;
541
+ };
542
+ }
543
+ /**
544
+ * The entry of the plugin whose component is rendering, kept current; undefined until the plugin list loads.
545
+ * A package with several entries gets its first one.
546
+ */
547
+ export declare function usePluginStatus(): PluginEntryStatus | undefined;
548
+ export interface PluginConfigState<T = any> {
549
+ /** The whole config with defaults filled in, secrets masked; null until loaded. */
550
+ value: T | null;
551
+ setValue(value: T): void;
552
+ /** schemastery `toJSON()` of the plugin's Config, or null. */
553
+ schema: unknown;
554
+ /** Why loading failed. */
555
+ error: string;
556
+ /** Messages from the last rejected save, keyed by dotted path (`''` for the root). */
557
+ errors: Record<string, string>;
558
+ saving: boolean;
559
+ /**
560
+ * Saves `value` (or `next`) through the bot, which validates it against the Config and the plugin restarts
561
+ * with it. Says how it went in a toast; resolves whether it saved. A save that would clobber a newer one
562
+ * reloads instead.
563
+ */
564
+ save(next?: T, options?: {
565
+ message?: string;
566
+ }): Promise<boolean>;
567
+ /** Empties a stored secret on the next save: sending it back masked or blank keeps it. */
568
+ clearSecret(path: string): void;
569
+ }
570
+ /** The config of the plugin whose component is rendering (its first entry), loaded on mount. */
571
+ export declare function usePluginConfig<T = any>(): PluginConfigState<T>;
572
+ export interface SchemaFormProps<T = any> {
573
+ /** schemastery `toJSON()` output, as in PluginConfigState and ConfigEditorProps. */
574
+ schema: unknown;
575
+ value: T;
576
+ onChange(value: T): void;
577
+ errors?: Record<string, string>;
578
+ /** Only these top-level fields, in this order. */
579
+ fields?: string[];
580
+ /** See PluginConfigState.clearSecret; without it secret fields have no clear button. */
581
+ onClearSecret?(path: string): void;
582
+ }
583
+ /** The form the WebUI generates from a schema, or some of its fields. Field roles registered with `ctx.field()` apply. */
584
+ export declare const SchemaForm: WebUIComponent<SchemaFormProps>;
585
+ export interface SchemaSettingsProps {
586
+ /** Only these top-level fields of the Config, in this order. */
587
+ fields?: string[];
588
+ /** Top-level fields boxed under a title, after the rest; `description` sits beside it, `collapsed` starts folded. */
589
+ sections?: {
590
+ title: string;
591
+ description?: string;
592
+ fields: string[];
593
+ collapsed?: boolean;
594
+ }[];
595
+ /** Shown next to the title, e.g. the documentation. */
596
+ links?: {
597
+ label: string;
598
+ href: string;
599
+ }[];
600
+ /** Below the form, above the save button; a function gets the config being edited. */
601
+ children?: unknown | ((config: PluginConfigState) => unknown);
602
+ }
603
+ /**
604
+ * A whole settings page for `ctx.page({ settings: true })`: the plugin's title and description, the form
605
+ * generated from its Config and a save button.
606
+ */
607
+ export declare const SchemaSettings: WebUIComponent<SchemaSettingsProps>;
608
+ /** A listen address: the machine's addresses to pick from, or one typed in. The form uses it for `.role('host')`. */
609
+ export declare const HostInput: WebUIComponent<{
610
+ value: string;
611
+ onChange(value: string): void;
612
+ }>;
613
+ export interface PathInputProps {
614
+ value: string;
615
+ onChange(value: string): void;
616
+ /** A file (the default) or a directory */
617
+ select?: 'file' | 'directory';
618
+ /** Extensions of the files listed, e.g. `['.exe']`; the others show on request */
619
+ accept?: string[];
620
+ /** Where the browser opens while there is no value, e.g. what is used without one */
621
+ start?: string;
622
+ placeholder?: string;
623
+ disabled?: boolean;
624
+ /** The browser's title */
625
+ title?: string;
626
+ }
627
+ /**
628
+ * A path on the machine the bot runs on: typed, or picked in a browser of that machine's directories (the WebUI may
629
+ * be open elsewhere, so the browser's own file dialog would pick from the wrong machine). Lists names only.
630
+ */
631
+ export declare const PathInput: WebUIComponent<PathInputProps>;
632
+ export interface DurationInputProps {
633
+ /** Seconds */
634
+ value: number;
635
+ onChange(seconds: number): void;
636
+ /** Most days it takes; 0 leaves the days field out. Default 1 */
637
+ maxDays?: number;
638
+ /** Default true */
639
+ showSeconds?: boolean;
640
+ }
641
+ /** A length of time in days, hours, minutes and seconds, stored as seconds. */
642
+ export declare const DurationInput: WebUIComponent<DurationInputProps>;
643
+ export interface SelectInputProps<T = string> {
644
+ value: T;
645
+ options: readonly {
646
+ value: T;
647
+ label: string;
648
+ }[];
649
+ onChange(value: T): void;
650
+ /** Shown while the value is none of the options. Default 请选择 */
651
+ placeholder?: string;
652
+ disabled?: boolean;
653
+ /** Added to the button, e.g. a width */
654
+ className?: string;
655
+ }
656
+ /** A dropdown in the WebUI's style; a `<select>` opens a list the browser draws in the system's. Values compare with `===`. */
657
+ export declare function SelectInput<T = string>(props: SelectInputProps<T>): any;
658
+ /** Every plugin entry the WebUI lists, kept current; null until the list loads. */
659
+ export declare function usePlugins(): PluginEntryStatus[] | null;
660
+ export interface BotInfo {
661
+ sid: string;
662
+ platform: string;
663
+ selfId: string;
664
+ /** @satorijs/protocol Status: 0 offline, 1 online, 2 connecting, 3 disconnecting, 4 reconnecting */
665
+ status: number;
666
+ name?: string;
667
+ avatar?: string;
668
+ }
669
+ /** The accounts plugins chat through (`ctx.bots` on the bot), kept current; null until the first answer. */
670
+ export declare function useBots(): BotInfo[] | null;
671
+ export interface PageView {
672
+ /** Opened on its own, without the sidebar and header (`ctx.pageHref(id, { fullscreen: true })`). */
673
+ fullscreen: boolean;
674
+ }
675
+ /** How the page being rendered is shown. */
676
+ export declare function usePageView(): PageView;
677
+ /** The WebUI sidebar, e.g. for a page that wants the room. */
678
+ export declare function useSidebar(): {
679
+ collapsed: boolean;
680
+ setCollapsed(collapsed: boolean): void;
681
+ };
682
+ export interface StatusNoticeProps {
683
+ children?: unknown;
684
+ /** Label of the button. */
685
+ action?: string;
686
+ /** Id of the plugin page the button opens; no button while that page is open. */
687
+ page?: string;
688
+ }
689
+ /**
690
+ * A notice at the top of one of the plugin's own pages, looking like the one the WebUI puts there while the plugin
691
+ * waits, failed or still wants settings. The WebUI has no notice bar for plugins: what concerns a plugin is said on
692
+ * its pages and its card.
693
+ */
694
+ export declare const StatusNotice: WebUIComponent<StatusNoticeProps>;
695
+ export type SlotProps<K extends keyof SlotMap> = {
696
+ name: K;
697
+ /** For a `keyed` slot: which key to draw. */
698
+ match?: string;
699
+ /**
700
+ * What the slot shows by itself: while it has no contribution (`single`, `keyed`, or a `list` left empty), and
701
+ * innermost in a `chain`.
702
+ */
703
+ children?: unknown;
704
+ /**
705
+ * Draws what goes around each contribution, e.g. a card; the contribution's error boundary is inside it. The
706
+ * WebUI's own slots do this for you.
707
+ */
708
+ wrap?: (element: unknown, contribution: {
709
+ id: string;
710
+ plugin: string;
711
+ options: Record<string, unknown>;
712
+ }) => unknown;
713
+ } & ({} extends Omit<SlotMap[K]['props'], 'next'> ? {
714
+ props?: Omit<SlotMap[K]['props'], 'next'>;
715
+ } : {
716
+ props: Omit<SlotMap[K]['props'], 'next'>;
717
+ });
718
+ /**
719
+ * Renders a slot this plugin declared, where it goes: the contributions of running plugins in order, minus what
720
+ * the user hid, each with the context of the plugin it comes from and in its own error boundary.
721
+ */
722
+ export declare function Slot<K extends keyof SlotMap>(props: SlotProps<K>): any;
723
+ /**
724
+ * For a `keyed` slot: the keys a contribution draws right now (a running plugin's, not hidden). WebQQ uses it to
725
+ * show a message whose only elements are ones it cannot draw itself.
726
+ */
727
+ export declare function useSlotMatches(name: keyof SlotMap): string[];
728
+ /** An icon from the `llbot.icon` list by its lucide name; unknown names get the puzzle piece. */
729
+ export declare const Icon: WebUIComponent<{
730
+ name?: string;
731
+ size?: number;
732
+ className?: string;
733
+ }>;
734
+ export interface PluginIconProps {
735
+ plugin: {
736
+ iconUrl?: string;
737
+ manifest: {
738
+ icon?: string;
739
+ };
740
+ };
741
+ /** Size and corners of the image or icon tile. */
742
+ className: string;
743
+ /** Background and text classes used when the image is absent or fails to load. */
744
+ fill: string;
745
+ size: number;
746
+ /** Greys out the image of a plugin that is not running. */
747
+ muted?: boolean;
748
+ }
749
+ /** The same package image, with an icon fallback, that the plugin page uses. */
750
+ export declare const PluginIcon: WebUIComponent<PluginIconProps>;
751
+ export interface LightboxImage {
752
+ url: string;
753
+ caption?: string;
754
+ }
755
+ export interface LightboxProps {
756
+ images: LightboxImage[];
757
+ index: number;
758
+ onIndex(index: number): void;
759
+ onClose(): void;
760
+ }
761
+ /** Displays an image gallery over the page, with keyboard navigation and a close button. */
762
+ export declare const Lightbox: WebUIComponent<LightboxProps>;