@luckylillia-dev/luckylillia 9.0.2 → 9.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{coreUpdate-BQLZsgRG.js → coreUpdate-FeEAjxU_.js} +78 -238
- package/chunks/coreUpdate-FeEAjxU_.js.map +1 -0
- package/llbot-core.js +277 -13
- package/llbot-core.js.map +1 -1
- package/llbot-manager.js +24 -44
- package/llbot-manager.js.map +1 -1
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/index.d.ts +1 -1
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/manifest.d.ts +26 -0
- package/node_modules/@luckylillia-dev/plugin-sdk/lib/storage.d.ts +5 -3
- package/package.json +1 -1
- package/webui/assets/index-zYO4ACTl.js +30 -0
- package/webui/index.html +1 -1
- package//346/233/264/346/226/260/346/227/245/345/277/227.txt +13 -0
- package/chunks/coreUpdate-BQLZsgRG.js.map +0 -1
- package/webui/assets/index-DTvzDdGT.js +0 -30
- package//344/275/277/347/224/250/350/257/264/346/230/216.txt +0 -6
|
@@ -5,7 +5,7 @@ export { default as h } from '@satorijs/element';
|
|
|
5
5
|
export type * as Universal from '@satorijs/protocol';
|
|
6
6
|
export type { Database, Tables } from '@cordisjs/plugin-database';
|
|
7
7
|
export type { TimerService } from '@cordisjs/plugin-timer';
|
|
8
|
-
export type { LLBotManifest, PluginCategory } from './manifest.js';
|
|
8
|
+
export type { LaunchSetting, LLBotManifest, PluginCategory } from './manifest.js';
|
|
9
9
|
export type * from './universal.js';
|
|
10
10
|
export type * from './commands.js';
|
|
11
11
|
export type * from './http.js';
|
|
@@ -9,6 +9,30 @@
|
|
|
9
9
|
* - `other` 其他: the rest, and plugins that declare none
|
|
10
10
|
*/
|
|
11
11
|
export type PluginCategory = 'protocol' | 'adapter' | 'chat' | 'tool' | 'service' | 'theme' | 'other';
|
|
12
|
+
/**
|
|
13
|
+
* A setting a plugin takes at launch (`llbot.launch`), from a flag, an environment variable or both, e.g.
|
|
14
|
+
* `{ field: 'port', arg: '--satori-port', env: 'SATORI_PORT' }`: `--satori-port=5500`, `--satori-port 5500` or
|
|
15
|
+
* `SATORI_PORT=5500` saves 5500 as the entry's `port`, as `--plugin-config` would, and enables the plugin.
|
|
16
|
+
*/
|
|
17
|
+
export interface LaunchSetting {
|
|
18
|
+
/**
|
|
19
|
+
* The config field the value goes to, as a path such as `port` or `http.port`. A segment `name[key=value]` picks
|
|
20
|
+
* the first item of the list `name` whose `key` is `value`, adding `{ key: value }` when there is none, e.g.
|
|
21
|
+
* `connect[type=ws].port`.
|
|
22
|
+
*/
|
|
23
|
+
field: string;
|
|
24
|
+
/** The flag: `--` and lower case letters, digits and `-`, none of LLBot's own (`--plugin*`, `--instance`, ...). */
|
|
25
|
+
arg?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The environment variable: upper case letters, digits and `_`, not LLBot's (`LLBOT_*`), Node's or the system's.
|
|
28
|
+
* An empty one counts as unset; a flag wins over a variable for the same field.
|
|
29
|
+
*/
|
|
30
|
+
env?: string;
|
|
31
|
+
/** Short names for values of the config, e.g. `{ mac: 'macos' }`; values without one go as they are. */
|
|
32
|
+
aliases?: Record<string, string>;
|
|
33
|
+
/** Other fields it sets as well, by path, e.g. `{ 'connect[type=ws].enable': true }`. */
|
|
34
|
+
set?: Record<string, string | number | boolean>;
|
|
35
|
+
}
|
|
12
36
|
/** The `llbot` field of a plugin's package.json. Its presence is what marks a package as a plugin. */
|
|
13
37
|
export interface LLBotManifest {
|
|
14
38
|
/** Its name in the WebUI, e.g. `关键词回复`; the package name without `luckylillia-plugin-` otherwise. Like `description`. */
|
|
@@ -65,4 +89,6 @@ export interface LLBotManifest {
|
|
|
65
89
|
* WebUI build in a folder of its own.
|
|
66
90
|
*/
|
|
67
91
|
webui?: string;
|
|
92
|
+
/** Settings taken at launch from flags and environment variables; only installed plugins' are known. */
|
|
93
|
+
launch?: LaunchSetting[];
|
|
68
94
|
}
|
|
@@ -3,11 +3,13 @@ export interface PluginStorage {
|
|
|
3
3
|
/**
|
|
4
4
|
* Created on first use, shared by every entry of the package, kept when the plugin is uninstalled.
|
|
5
5
|
*
|
|
6
|
-
* - `'global'` (default): `plugin-data/<package>/shared/`
|
|
6
|
+
* - `'global'` (default): `data/instances/<instance>/plugin-data/<package>/shared/` (isolated per Bot instance).
|
|
7
|
+
* - `'host'`: `data/plugin-data/<package>/` (shared across all Bot instances under the same `data/` directory,
|
|
8
|
+
* isolated per plugin package). Use for cross-instance credentials, per-account protocol databases, or large shared caches.
|
|
7
9
|
*/
|
|
8
|
-
dir(scope?: 'global'): Promise<string>;
|
|
10
|
+
dir(scope?: 'global' | 'host'): Promise<string>;
|
|
9
11
|
/**
|
|
10
|
-
* `plugin-data/<package>/bots/<platform>+<selfId>/`, one per bot, the QQ official bot's too; `bot` is the bot or
|
|
12
|
+
* `data/instances/<instance>/plugin-data/<package>/bots/<platform>+<selfId>/`, one per bot, the QQ official bot's too; `bot` is the bot or
|
|
11
13
|
* its sid. Needs no login. Existing legacy QQ directories are reused if no bot directory exists.
|
|
12
14
|
*/
|
|
13
15
|
dir(scope: 'bot', bot: string | {
|