mioku 1.2.3 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{exec-CniJOLOF.cjs → exec-BoUCPBk_.cjs} +2 -2
- package/dist/exec-BoUCPBk_.cjs.map +1 -0
- package/dist/{exec-BPj3FRdI.js → exec-C_iMY_-7.js} +2 -2
- package/dist/exec-C_iMY_-7.js.map +1 -0
- package/dist/index.cjs +962 -119
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +267 -18
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +267 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +985 -161
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/dist/exec-BPj3FRdI.js.map +0 -1
- package/dist/exec-CniJOLOF.cjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -404,6 +404,13 @@ interface EventIdentity {
|
|
|
404
404
|
readonly native_event_id?: string;
|
|
405
405
|
readonly fingerprint?: string;
|
|
406
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* 事件处理者的返回值约定
|
|
409
|
+
* @true 认领事件
|
|
410
|
+
* @false 继续传递事件
|
|
411
|
+
* @undefined 继续传递事件(默认)
|
|
412
|
+
*/
|
|
413
|
+
type EventHandlerResult = boolean | void;
|
|
407
414
|
/** 所有事件的公共基础结构 */
|
|
408
415
|
interface EventBase {
|
|
409
416
|
/** 事件大类:message / notice / request / meta_event / adapter */
|
|
@@ -427,12 +434,12 @@ interface SenderInfo {
|
|
|
427
434
|
readonly user_id?: string;
|
|
428
435
|
readonly nickname?: string;
|
|
429
436
|
readonly card?: string;
|
|
430
|
-
readonly role?:
|
|
437
|
+
readonly role?: "owner" | "admin" | "member" | (string & {});
|
|
431
438
|
}
|
|
432
439
|
/** 消息事件:私聊与群聊消息 */
|
|
433
440
|
interface MessageEvent extends BotEventBase {
|
|
434
|
-
readonly kind:
|
|
435
|
-
readonly message_type:
|
|
441
|
+
readonly kind: "message";
|
|
442
|
+
readonly message_type: "private" | "group" | "channel" | "thread" | "direct" | (string & {});
|
|
436
443
|
readonly sub_type?: string;
|
|
437
444
|
readonly user_id?: string;
|
|
438
445
|
readonly group_id?: string;
|
|
@@ -452,7 +459,7 @@ interface MessageEvent extends BotEventBase {
|
|
|
452
459
|
}
|
|
453
460
|
/** 通知事件:群成员变动、戳一戳等 */
|
|
454
461
|
interface NoticeEvent extends BotEventBase {
|
|
455
|
-
readonly kind:
|
|
462
|
+
readonly kind: "notice";
|
|
456
463
|
readonly notice_type?: string;
|
|
457
464
|
readonly sub_type?: string;
|
|
458
465
|
readonly user_id?: string;
|
|
@@ -461,7 +468,7 @@ interface NoticeEvent extends BotEventBase {
|
|
|
461
468
|
}
|
|
462
469
|
/** 请求事件:加群/好友申请,可 approve 或 reject */
|
|
463
470
|
interface RequestEvent extends BotEventBase {
|
|
464
|
-
readonly kind:
|
|
471
|
+
readonly kind: "request";
|
|
465
472
|
readonly request_type?: string;
|
|
466
473
|
readonly sub_type?: string;
|
|
467
474
|
readonly user_id?: string;
|
|
@@ -473,13 +480,13 @@ interface RequestEvent extends BotEventBase {
|
|
|
473
480
|
}
|
|
474
481
|
/** 生命周期元事件 */
|
|
475
482
|
interface MetaEvent extends BotEventBase {
|
|
476
|
-
readonly kind:
|
|
483
|
+
readonly kind: "meta_event";
|
|
477
484
|
readonly meta_event_type?: string;
|
|
478
485
|
readonly sub_type?: string;
|
|
479
486
|
}
|
|
480
487
|
/** 适配器自定义事件:不归属以上四类时使用 */
|
|
481
488
|
interface AdapterEvent extends EventBase {
|
|
482
|
-
readonly kind:
|
|
489
|
+
readonly kind: "adapter";
|
|
483
490
|
readonly payload: unknown;
|
|
484
491
|
}
|
|
485
492
|
type Event = MessageEvent | NoticeEvent | RequestEvent | MetaEvent | AdapterEvent;
|
|
@@ -821,13 +828,14 @@ interface AdapterContext {
|
|
|
821
828
|
getCapabilityRegistry(): CapabilityRegistry;
|
|
822
829
|
registerGateway(gateway: AdapterGateway): () => void;
|
|
823
830
|
registerResource(resource: AdapterResource): () => void;
|
|
824
|
-
|
|
831
|
+
/** 派发一个事件,返回是否被某个处理者认领 */
|
|
832
|
+
dispatch(event: Event): Promise<boolean>;
|
|
825
833
|
emitLifecycle(event: BotLifecycleEvent): Promise<void>;
|
|
826
834
|
/**
|
|
827
835
|
* 订阅框架事件总线上的事件
|
|
828
836
|
* 返回取消订阅函数
|
|
829
837
|
*/
|
|
830
|
-
listen(route: string, handler: (event: Event) =>
|
|
838
|
+
listen(route: string, handler: (event: Event) => EventHandlerResult | Promise<EventHandlerResult>): () => void;
|
|
831
839
|
}
|
|
832
840
|
/** 适配器实例:start 时建立连接并注册资源,stop 时释放 */
|
|
833
841
|
interface Adapter {
|
|
@@ -1474,7 +1482,9 @@ declare class ServiceManager {
|
|
|
1474
1482
|
declare const _default: ServiceManager;
|
|
1475
1483
|
//#endregion
|
|
1476
1484
|
//#region src/services/config.d.ts
|
|
1477
|
-
/**
|
|
1485
|
+
/**
|
|
1486
|
+
* 注册服务配
|
|
1487
|
+
*/
|
|
1478
1488
|
declare function registerServiceConfig(serviceName: string, configName: string, defaults: Record<string, unknown>): Promise<void>;
|
|
1479
1489
|
/** 读取服务配置,文件不存在或解析失败时返回空对象 */
|
|
1480
1490
|
declare function getServiceConfig(serviceName: string, configName: string): Promise<Record<string, unknown>>;
|
|
@@ -1699,7 +1709,7 @@ declare const hasRight: (id: string) => boolean;
|
|
|
1699
1709
|
//# sourceMappingURL=config.d.ts.map
|
|
1700
1710
|
//#endregion
|
|
1701
1711
|
//#region src/runtime/bus.d.ts
|
|
1702
|
-
type EventHandler<E extends Event = Event> = (event: E) =>
|
|
1712
|
+
type EventHandler<E extends Event = Event> = (event: E) => EventHandlerResult | Promise<EventHandlerResult>;
|
|
1703
1713
|
interface Registration {
|
|
1704
1714
|
readonly id: number;
|
|
1705
1715
|
readonly route: string;
|
|
@@ -1728,8 +1738,14 @@ declare class EventBus {
|
|
|
1728
1738
|
priority?: number;
|
|
1729
1739
|
}): () => void;
|
|
1730
1740
|
clear(): void;
|
|
1731
|
-
/**
|
|
1732
|
-
|
|
1741
|
+
/**
|
|
1742
|
+
* 按优先级顺序把事件交给监听器,返回是否有人认领。
|
|
1743
|
+
*
|
|
1744
|
+
* 每个优先级组内按注册顺序逐个执行。handler 返回 `true` 即结束派发;
|
|
1745
|
+
* 返回 `undefined` / `false` 则继续交给后续监听器,全部不认领时静默结束。
|
|
1746
|
+
* 单个监听器出错只记日志,不影响后续监听器。
|
|
1747
|
+
*/
|
|
1748
|
+
dispatch(event: Event): Promise<boolean>;
|
|
1733
1749
|
stats(): BusStats;
|
|
1734
1750
|
}
|
|
1735
1751
|
//# sourceMappingURL=bus.d.ts.map
|
|
@@ -1818,7 +1834,8 @@ interface CommandExecutionContext {
|
|
|
1818
1834
|
readonly args: readonly string[];
|
|
1819
1835
|
readonly match?: RegExpMatchArray;
|
|
1820
1836
|
}
|
|
1821
|
-
type
|
|
1837
|
+
type CommandResult = boolean | void;
|
|
1838
|
+
type CommandHandler = (context: CommandExecutionContext) => CommandResult | Promise<CommandResult>;
|
|
1822
1839
|
interface CommandDefinition {
|
|
1823
1840
|
readonly id?: string;
|
|
1824
1841
|
readonly name: string;
|
|
@@ -2047,8 +2064,11 @@ declare class MiokuContext {
|
|
|
2047
2064
|
/**
|
|
2048
2065
|
* 注册事件监听。route 支持层级路由,如 `message`、`message.group`、
|
|
2049
2066
|
* `onebotv11:message`;返回取消监听函数。
|
|
2067
|
+
*
|
|
2068
|
+
* handler 返回 `true` 表示认领该事件,总线不再交给后续监听器;
|
|
2069
|
+
* 返回 `undefined` / `false` 则继续下传。
|
|
2050
2070
|
*/
|
|
2051
|
-
handle<R extends string | readonly string[]>(route: R, handler: (event: RouteEvent<R>) =>
|
|
2071
|
+
handle<R extends string | readonly string[]>(route: R, handler: (event: RouteEvent<R>) => EventHandlerResult | Promise<EventHandlerResult>): () => void;
|
|
2052
2072
|
/** 注册消息命令;默认自动匹配框架前缀并在命中后消费消息 */
|
|
2053
2073
|
command(definition: CommandDefinition): () => void;
|
|
2054
2074
|
command(matcher: CommandMatcher, handler: CommandHandler, options?: CommandShortcutOptions): () => void;
|
|
@@ -2176,8 +2196,8 @@ declare class AdapterContextImpl implements AdapterContext {
|
|
|
2176
2196
|
registerGateway(gateway: AdapterGateway): () => void;
|
|
2177
2197
|
waitForStarts(): Promise<void>;
|
|
2178
2198
|
registerResource(resource: AdapterResource): () => void;
|
|
2179
|
-
dispatch(event: Event): Promise<
|
|
2180
|
-
listen(route: string, handler: (event: Event) =>
|
|
2199
|
+
dispatch(event: Event): Promise<boolean>;
|
|
2200
|
+
listen(route: string, handler: (event: Event) => EventHandlerResult | Promise<EventHandlerResult>): () => void;
|
|
2181
2201
|
emitLifecycle(event: BotLifecycleEvent): Promise<void>;
|
|
2182
2202
|
get adapterName(): string;
|
|
2183
2203
|
}
|
|
@@ -2379,6 +2399,18 @@ declare const loadNpmPlugin: (jiti: Jiti, candidate: PluginCandidate) => Promise
|
|
|
2379
2399
|
declare const loadLocalPlugin: (jiti: Jiti, name: string, resolvedPath: string) => Promise<MiokuPlugin>;
|
|
2380
2400
|
//# sourceMappingURL=plugin.d.ts.map
|
|
2381
2401
|
//#endregion
|
|
2402
|
+
//#region src/services/config-defaults.d.ts
|
|
2403
|
+
type ConfigScope = "plugin" | "service";
|
|
2404
|
+
/** 登记一份配置的默认值;同名重复登记以最后一次为准 */
|
|
2405
|
+
declare function registerConfigDefaults(scope: ConfigScope, owner: string, name: string, value: Record<string, unknown>): void;
|
|
2406
|
+
/** 取默认值(深拷贝,调用方随便改);没有登记时返回 undefined */
|
|
2407
|
+
declare function getConfigDefaults(scope: ConfigScope, owner: string, name: string): Record<string, unknown> | undefined;
|
|
2408
|
+
/**
|
|
2409
|
+
* 用默认值补齐一份配置
|
|
2410
|
+
*/
|
|
2411
|
+
declare function withConfigDefaults<T extends Record<string, unknown>>(stored: unknown, fallback: Record<string, unknown> | undefined): T;
|
|
2412
|
+
//# sourceMappingURL=config-defaults.d.ts.map
|
|
2413
|
+
//#endregion
|
|
2382
2414
|
//#region src/start.d.ts
|
|
2383
2415
|
/** startRuntime 的启动选项 */
|
|
2384
2416
|
interface StartOptions {
|
|
@@ -2542,6 +2574,223 @@ declare const connectedBotKey: (adapter: string, bot_id: string) => string;
|
|
|
2542
2574
|
type ExtendedNapCat = Bot;
|
|
2543
2575
|
//# sourceMappingURL=connected-bots.d.ts.map
|
|
2544
2576
|
//#endregion
|
|
2577
|
+
//#region src/skills/types.d.ts
|
|
2578
|
+
/** 技能根分类:项目内 / 用户级 / 自定义 */
|
|
2579
|
+
type SkillRootKind = "project-agents" | "project-claude" | "user-agents" | "user-claude" | "user-codex" | "custom";
|
|
2580
|
+
/** 一个技能扫描根 */
|
|
2581
|
+
interface SkillRoot {
|
|
2582
|
+
/** 分类 id,UI 按它分组 */
|
|
2583
|
+
id: string;
|
|
2584
|
+
/** 展示名,用户级用 `~` 简写 */
|
|
2585
|
+
label: string;
|
|
2586
|
+
kind: SkillRootKind;
|
|
2587
|
+
/** 绝对路径 */
|
|
2588
|
+
path: string;
|
|
2589
|
+
/** 数字小的先赢(技能重名时) */
|
|
2590
|
+
rank: number;
|
|
2591
|
+
/** 是否允许从 WebUI 安装 / 卸载 */
|
|
2592
|
+
writable: boolean;
|
|
2593
|
+
}
|
|
2594
|
+
/** 调用策略,来自 frontmatter 的 disable-model-invocation / user-invocable */
|
|
2595
|
+
interface SkillInvocationPolicy {
|
|
2596
|
+
/** 是否进入模型目录并允许 `skill` 工具加载 */
|
|
2597
|
+
modelInvocable: boolean;
|
|
2598
|
+
/** 是否允许用户显式调用 */
|
|
2599
|
+
userInvocable: boolean;
|
|
2600
|
+
}
|
|
2601
|
+
/** 技能摘要:渐进披露第一级,只有路由需要的字段 */
|
|
2602
|
+
interface SkillSummary {
|
|
2603
|
+
name: string;
|
|
2604
|
+
description: string;
|
|
2605
|
+
invoke: SkillInvocationPolicy;
|
|
2606
|
+
/** 所属根的 id */
|
|
2607
|
+
rootId: string;
|
|
2608
|
+
/** 技能根目录绝对路径 */
|
|
2609
|
+
dir: string;
|
|
2610
|
+
/** SKILL.md 绝对路径 */
|
|
2611
|
+
path: string;
|
|
2612
|
+
/** 相对技能根的附加文件 */
|
|
2613
|
+
resources: string[];
|
|
2614
|
+
}
|
|
2615
|
+
/** 完整技能定义:正文按需读取,不缓存 */
|
|
2616
|
+
interface SkillDefinition extends SkillSummary {
|
|
2617
|
+
content: string;
|
|
2618
|
+
license?: string;
|
|
2619
|
+
compatibility?: string;
|
|
2620
|
+
metadata?: Record<string, string>;
|
|
2621
|
+
/** 规范里的 allowed-tools,仅供模型参考 */
|
|
2622
|
+
allowedTools: string[];
|
|
2623
|
+
}
|
|
2624
|
+
type SkillDiagnosticCode = "INVALID_NAME" | "MISSING_FRONTMATTER" | "MISSING_FIELD" | "INVALID_YAML" | "NAME_MISMATCH" | "UNKNOWN_KEY" | "NAME_DUPLICATE" | "UNUSABLE_INVOCATION" | "READ_FAILED";
|
|
2625
|
+
interface SkillDiagnostic {
|
|
2626
|
+
level: "error" | "warn";
|
|
2627
|
+
code: SkillDiagnosticCode;
|
|
2628
|
+
message: string;
|
|
2629
|
+
/** 出问题的 SKILL.md 绝对路径 */
|
|
2630
|
+
path: string;
|
|
2631
|
+
}
|
|
2632
|
+
interface SkillLogger {
|
|
2633
|
+
info(message: string): void;
|
|
2634
|
+
warn(message: string): void;
|
|
2635
|
+
}
|
|
2636
|
+
declare const SKILL_FILE_NAME = "SKILL.md";
|
|
2637
|
+
/** 规范要求的技能名:小写字母数字,单连字符分隔 */
|
|
2638
|
+
declare const SKILL_NAME_PATTERN: RegExp;
|
|
2639
|
+
declare const SKILL_NAME_MAX = 64;
|
|
2640
|
+
declare const SKILL_DESCRIPTION_MAX = 1024;
|
|
2641
|
+
declare const SKILL_COMPATIBILITY_MAX = 500;
|
|
2642
|
+
/** 规范定义的六个字段加上两个调用控制字段 */
|
|
2643
|
+
declare const SKILL_KNOWN_KEYS: readonly string[];
|
|
2644
|
+
//# sourceMappingURL=types.d.ts.map
|
|
2645
|
+
//#endregion
|
|
2646
|
+
//#region src/skills/frontmatter.d.ts
|
|
2647
|
+
interface ParsedSkillFile {
|
|
2648
|
+
name: string;
|
|
2649
|
+
description: string;
|
|
2650
|
+
license?: string;
|
|
2651
|
+
compatibility?: string;
|
|
2652
|
+
metadata?: Record<string, string>;
|
|
2653
|
+
allowedTools: string[];
|
|
2654
|
+
invoke: SkillInvocationPolicy;
|
|
2655
|
+
/** 去掉 frontmatter 的 Markdown 正文 */
|
|
2656
|
+
content: string;
|
|
2657
|
+
}
|
|
2658
|
+
interface SkillFileParseResult {
|
|
2659
|
+
/** 缺失表示该文件必须被忽略 */
|
|
2660
|
+
skill?: ParsedSkillFile;
|
|
2661
|
+
diagnostics: SkillDiagnostic[];
|
|
2662
|
+
}
|
|
2663
|
+
/**
|
|
2664
|
+
* 解析并校验一个 `SKILL.md`。
|
|
2665
|
+
* 缺失 `skill` 表示该文件不可用:缺少 frontmatter、YAML 非法、name/description 缺失或 name 非法。
|
|
2666
|
+
*/
|
|
2667
|
+
declare function parseSkillFile(path: string, raw: string): SkillFileParseResult;
|
|
2668
|
+
//# sourceMappingURL=frontmatter.d.ts.map
|
|
2669
|
+
//#endregion
|
|
2670
|
+
//#region src/skills/roots.d.ts
|
|
2671
|
+
interface SkillRootOptions {
|
|
2672
|
+
/** 机器人根目录,默认 `process.cwd()` */
|
|
2673
|
+
botRoot?: string;
|
|
2674
|
+
/** 用户主目录,默认 `os.homedir()` */
|
|
2675
|
+
home?: string;
|
|
2676
|
+
/** 额外扫描根,可写 `~/` 简写 */
|
|
2677
|
+
extraRoots?: string[];
|
|
2678
|
+
}
|
|
2679
|
+
interface SkillRootSpec {
|
|
2680
|
+
id: string;
|
|
2681
|
+
label: string;
|
|
2682
|
+
kind: SkillRootKind;
|
|
2683
|
+
scope: "project" | "user";
|
|
2684
|
+
segments: string[];
|
|
2685
|
+
rank: number;
|
|
2686
|
+
}
|
|
2687
|
+
/** 五个标准技能根,按 rank 升序;与 Claude Code / Codex / `npx skills add` 的目录约定一致 */
|
|
2688
|
+
declare const DEFAULT_SKILL_ROOT_SPECS: readonly SkillRootSpec[];
|
|
2689
|
+
/** 展开开头的 `~/` */
|
|
2690
|
+
declare function expandHomePath(input: string, home?: string): string;
|
|
2691
|
+
/** 解析出当前机器上的技能根列表,自定义根排在项目根之后、用户根之前 */
|
|
2692
|
+
declare function resolveSkillRoots(options?: SkillRootOptions): SkillRoot[];
|
|
2693
|
+
declare function findSkillRoot(roots: readonly SkillRoot[], id: string): SkillRoot | undefined;
|
|
2694
|
+
/** 判断路径是否落在某个根内,返回该根 */
|
|
2695
|
+
declare function rootOfPath(roots: readonly SkillRoot[], target: string): SkillRoot | undefined;
|
|
2696
|
+
//#endregion
|
|
2697
|
+
//#region src/skills/discover.d.ts
|
|
2698
|
+
interface DiscoverOptions {
|
|
2699
|
+
/** 单个技能的附加文件上限 */
|
|
2700
|
+
maxResourceFiles?: number;
|
|
2701
|
+
/** 附加文件的相对深度上限 */
|
|
2702
|
+
maxResourceDepth?: number;
|
|
2703
|
+
}
|
|
2704
|
+
interface DiscoveryResult {
|
|
2705
|
+
skills: SkillSummary[];
|
|
2706
|
+
diagnostics: SkillDiagnostic[];
|
|
2707
|
+
}
|
|
2708
|
+
/** 根下的一个技能候选,尚未读盘 */
|
|
2709
|
+
interface SkillEntry {
|
|
2710
|
+
/** 目录形态时是技能目录名,扁平形态时是文件名 */
|
|
2711
|
+
entryName: string;
|
|
2712
|
+
/** 技能根目录(扁平形态等于 root.path) */
|
|
2713
|
+
skillDir: string;
|
|
2714
|
+
/** 指令文件绝对路径 */
|
|
2715
|
+
skillPath: string;
|
|
2716
|
+
}
|
|
2717
|
+
/** 枚举一个根下的技能候选:`<name>/SKILL.md` 与 `<name>.md` 两种形态 */
|
|
2718
|
+
declare function listSkillEntries(root: SkillRoot): Promise<SkillEntry[]>;
|
|
2719
|
+
/** 读盘并解析一个技能候选;缺文件、软链接断链、超大都返回空结果 */
|
|
2720
|
+
declare function readSkillEntry(root: SkillRoot, entry: SkillEntry, options?: DiscoverOptions): Promise<DiscoveryResult>;
|
|
2721
|
+
/**
|
|
2722
|
+
* 按 rank 合并各组结果;重名时先出现的(rank 小的)获胜,后来者记一条 warn。
|
|
2723
|
+
* `groups` 必须已按 rank 升序排列。
|
|
2724
|
+
*/
|
|
2725
|
+
declare function mergeSkillGroups(groups: readonly SkillSummary[][], diagnostics: SkillDiagnostic[]): SkillSummary[];
|
|
2726
|
+
/** 扫描一个技能根(无缓存) */
|
|
2727
|
+
declare function discoverRoot(root: SkillRoot, options?: DiscoverOptions): Promise<DiscoveryResult>;
|
|
2728
|
+
/** 扫描全部根(无缓存);技能重名时 rank 小的先赢 */
|
|
2729
|
+
declare function discoverSkills(roots: readonly SkillRoot[], options?: DiscoverOptions): Promise<DiscoveryResult>;
|
|
2730
|
+
//# sourceMappingURL=discover.d.ts.map
|
|
2731
|
+
//#endregion
|
|
2732
|
+
//#region src/skills/catalog.d.ts
|
|
2733
|
+
interface SkillCatalogOptions extends SkillRootOptions {
|
|
2734
|
+
/** 直接指定根,忽略 botRoot/home/extraRoots */
|
|
2735
|
+
roots?: SkillRoot[];
|
|
2736
|
+
maxResourceFiles?: number;
|
|
2737
|
+
/** 两次全量扫描之间的最小间隔,毫秒;0 表示每次都扫 */
|
|
2738
|
+
rescanIntervalMs?: number;
|
|
2739
|
+
logger?: SkillLogger;
|
|
2740
|
+
}
|
|
2741
|
+
interface SkillCatalog {
|
|
2742
|
+
roots(): SkillRoot[];
|
|
2743
|
+
/** 技能摘要列表;带 TTL 与 mtime 缓存 */
|
|
2744
|
+
snapshot(options?: {
|
|
2745
|
+
force?: boolean;
|
|
2746
|
+
}): Promise<SkillSummary[]>;
|
|
2747
|
+
/** 按需读取正文,每次重新读盘;名字变化时返回 undefined 并让下次重扫 */
|
|
2748
|
+
load(name: string): Promise<SkillDefinition | undefined>;
|
|
2749
|
+
diagnostics(): SkillDiagnostic[];
|
|
2750
|
+
/** 清空全部缓存(安装 / 卸载 / 手工改盘后调用) */
|
|
2751
|
+
invalidate(): void;
|
|
2752
|
+
}
|
|
2753
|
+
/** 技能目录:扫描五个标准根,合并去重,按需读正文 */
|
|
2754
|
+
declare function createSkillCatalog(options?: SkillCatalogOptions): SkillCatalog;
|
|
2755
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
2756
|
+
//#endregion
|
|
2757
|
+
//#region src/skills/render.d.ts
|
|
2758
|
+
/** 目录行:`- \`name\`: description` */
|
|
2759
|
+
declare function renderSkillCatalog(skills: readonly SkillSummary[], options?: {
|
|
2760
|
+
maxDescriptionLength?: number;
|
|
2761
|
+
}): string;
|
|
2762
|
+
/** 加载结果:伪 XML 包裹的资源清单与正文,模型语料里常见的形状 */
|
|
2763
|
+
declare function renderSkillContent(skill: SkillDefinition): string;
|
|
2764
|
+
//# sourceMappingURL=render.d.ts.map
|
|
2765
|
+
//#endregion
|
|
2766
|
+
//#region src/skills/locate.d.ts
|
|
2767
|
+
interface SkillLocation {
|
|
2768
|
+
/** frontmatter 里的 name;解析不可用时退回目录名 */
|
|
2769
|
+
name: string;
|
|
2770
|
+
description: string;
|
|
2771
|
+
/** 技能根目录绝对路径 */
|
|
2772
|
+
dir: string;
|
|
2773
|
+
/** SKILL.md 绝对路径 */
|
|
2774
|
+
path: string;
|
|
2775
|
+
/** 技能目录内的文件数(有上限) */
|
|
2776
|
+
files: number;
|
|
2777
|
+
/** 该候选是否可以直接安装 */
|
|
2778
|
+
valid: boolean;
|
|
2779
|
+
diagnostics: SkillDiagnostic[];
|
|
2780
|
+
}
|
|
2781
|
+
interface LocateOptions {
|
|
2782
|
+
/** 递归深度上限,默认 3 */
|
|
2783
|
+
maxDepth?: number;
|
|
2784
|
+
/** 候选数量上限,默认 50 */
|
|
2785
|
+
maxCandidates?: number;
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* 在下载/解包出来的目录里定位技能:根目录有 SKILL.md 就用它,
|
|
2789
|
+
* 否则向下(深度受限)找所有含 SKILL.md 的目录,供安装时挑选。
|
|
2790
|
+
*/
|
|
2791
|
+
declare function locateSkillRoots(root: string, options?: LocateOptions): Promise<SkillLocation[]>;
|
|
2792
|
+
//# sourceMappingURL=locate.d.ts.map
|
|
2793
|
+
//#endregion
|
|
2545
2794
|
//#region src/runtime/plugin-artifacts.d.ts
|
|
2546
2795
|
declare function registerPluginArtifacts(ctx?: MiokuContext): Promise<void>;
|
|
2547
2796
|
//# sourceMappingURL=plugin-artifacts.d.ts.map
|
|
@@ -2631,5 +2880,5 @@ declare function start(options?: MiokuStartOptions): Promise<{
|
|
|
2631
2880
|
}>;
|
|
2632
2881
|
declare const version: string;
|
|
2633
2882
|
//#endregion
|
|
2634
|
-
export { type AIInstance, type AIInstanceInfo, type AIModelCapability, type AIModelDescriptor, type AIModelRole, type AIProtocol, type AIProviderConfig, type AIService, type AISkill, type AIThinkingLevel, type AITool, type AIUsageBotOption, type AIUsageBreakdown, type AIUsageContext, type AIUsageFinalization, type AIUsageRange, type AIUsageRecordQuery, type AIUsageRecordSummary, type AIUsageScope, type AIUsageSummary, AI_GEMINI_THINKING_LEVELS, AI_THINKING_LEVELS, type AccessAction, type AccessControlConfig, type AccessHook, type AccessRuleEntry, type AccessScopeConfig, Adapter, AdapterBotBase, AdapterBotMap, AdapterCandidate, AdapterContext, AdapterContextImpl, AdapterDefinition, AdapterEvent, AdapterFactoryOptions, AdapterGateway, AdapterInstanceStatus, AdapterRegistrationConflictError, AdapterReport, AdapterReportEntry, AdapterResource, AdapterResourceScope, AdapterStartResult, type AdapterStatus, type AdapterStatusStats, AnyFunc, ArchMap, Arrayable, type Attachment, AvatarSetRequest, Awaitable, BOT_CWD, BUILTIN_PLUGINS, Bot, BotAutoFilled, BotBase, BotConfigJson, BotContext, BotEvent, BotEventBase, BotHandler, BotLifecycleEvent, BotProvidedKeys, BotRegistry, BotStatus, BotStatusResult, BuildAdapterReportOptions, BuildStatusOptions, type BuiltinServiceRef, BusStats, ButtonOptions, CORE_PLUGINS, Capability, CapabilityHandler, CapabilityRegistry, CapabilityTarget, type ChatRuntime, type ChatRuntimeBaseOptions, type ChatRuntimeCollectedInfo, type ChatRuntimeGroupTarget, type ChatRuntimeInformationRequestOptions, type ChatRuntimeNoticeOptions, type ChatRuntimePrivateTarget, type ChatRuntimePromptInjection, type ChatRuntimeResult, type ChatRuntimeSource, ChromeUA, CommandCatalogItem, CommandDefinition, CommandExecutionContext, CommandHandler, CommandManager, CommandMatcher, type CommandRole, CommandShortcutOptions, type CompleteOptions, type CompleteResponse, type ConfigService, type ConsolaInstance, ContextOptions, ConversationGetHistoryRequest, CorrelationParticipant, CorrelationRecord, CorrelationStats, CreateCmdOptions, CreateDriverOptions, CreateRuntimeOptions, CronHandler, Driver, DriverShutdownError, Event, EventBase, EventBus, EventCorrelator, EventFactoryOptions, EventHandler, EventIdentity, EventKindOfRoute, type EventMap, EventObservation, ExtendedNapCat, ForwardNode, ForwardSendNode, ForwardSendOptions, ForwardSendRequest, Friend, FriendDeleteRequest, FriendGetInfoRequest, FriendGetListRequest, FriendInfo, Gettable, Group, GroupGetInfoRequest, GroupGetListRequest, GroupGetMembersRequest, GroupInfo, GroupLeaveRequest, GroupSetNameRequest, GroupSetPortraitRequest, GroupSetWholeBanRequest, HasMessage, type HelpService, HistoryMessage, HttpClient, HttpRequestError, HttpRequestOptions, HttpResponse, LifecycleEvent, LifecycleEventMap, LifecycleHandler, LifecycleListener, LoadedAdapterDefinition, LoadedPluginDefinition, type LogLevel, type Logger, type MarkdownScreenshotOptions, MatchHandler, MatchValue, MemberBanRequest, MemberGetInfoRequest, MemberInfo, MemberKickRequest, MemberPokeRequest, MemberSetAdminRequest, MemberSetCardRequest, MemberSetTitleRequest, type Message, MessageEvent, MessageGetForwardRequest, MessageGetRequest, MessageGetResult, type MessageInput, MessageRecallRequest, MessageSegment, MessageSegmentImpl, MessageSendRequest, type MessageTarget, MetaEvent, MiokuConfig, type MiokuContext, MiokuCoreServiceContrib, type MiokuPlugin, MiokuRuntime, type MiokuRuntimeConfig, type MiokuService, MiokuServices, MiokuStartOptions, type MiokuStatus, type MultimodalContentItem, type MultimodalMessage, Noop, NoticeEvent, NoticeOptions, PackageCandidate, PackageJson, type PackageJsonLike, PlatformId, PluginCandidate, PluginCleanup, type PluginHelp, PluginManager, type PluginMetadata, type PluginPackageConfig, type PluginStateRef, ProfileSetRequest, PureObject, RegisteredCommand, Registration, RegistrationFilter, ReplyArg, type ReplyOptions, RequestEvent, RouteEvent, type RunCommandResult, RuntimeAdapterState, RuntimeMiokuConfig, ScheduledTask, type ScreenshotOptions, type ScreenshotService, SenderInfo, type SentMessage, SerializedMessageSegment, ServiceFactory, ServiceManager, type ServiceMetadata, type ServiceRef, Services, type SessionToolDefinition, type SkillPermissionRole, type SpawnPlan, StartOptions, type StatusProvider, StatusProviderContext, StatusProviderTarget, SystemMap, TOOL_RESULT_FOLLOWUP_KEY, type TextMessage, type ToolCallRecord, type ToolResultFollowup, UnsupportedCapabilityError, WebSocketClient, WebSocketConnectOptions, WebSocketConnectTimeoutError, WebSocketConnection, type WebUIService, addService, applyLogLevel, asMessage, atOf, avatarGet, avatarSet, base64Decode, base64Encode, bindCapabilities, botConfig, botStatus, box, buildAdapterReport, buildMiokuStatus, buildRoutes, buildSpawnPlan, clamp, collectBotStats, colorize, colors, commandExists, connectedBotKey, connectedBots, conversationGetHistory, createCmd, createDB, createDefaultDriver, createFriendRef, createGroupRef, createImportContext, createMessage, createMiokuLogger, createRuntime, createStore, dayjs, dedent, defineAdapter, defineCapability, definePlugin, defineService, defineState, deleteServiceConfig, discoverAdapterCandidates, discoverPluginCandidates, displayAdapterId, ensureDataDir, filesize, filter, find, findLocalPlugins, formatAdapterReport, formatDuration, formatMiokuStatus, formatMiokuStatusFn, forwardSend, friendDelete, friendGetInfo, friendGetList, fs, getActiveCommandManager, getAllPluginRuntimeStates, getBuiltinPlugins, getConfigDir, getDataDir, getGTk, getPluginConfigDir, getPluginDataDir, getPluginMetadata, getPluginMetadataList, getPluginRuntimeState, getService, getServiceConfig, getServiceConfigDir, getServiceConfigs, getServiceDataDir, getTerminalInput, groupGetInfo, groupGetList, groupGetMembers, groupLeave, groupSetName, groupSetPortrait, groupSetWholeBan, hasEventRight, hasPluginState, hasRight, hasService, isAdapterEvent, isAdmin, isBoolean, isBotEvent, isDefined, isEventAdmin, isEventAdminConfigOnly, isEventGroupAdmin, isEventGroupOwner, isEventMaster, isEventOwner, isEventOwnerOrAdmin, isFunction, isMessage, isMessageEvent, isMetaEvent, isMiokuPlugin, isNoticeEvent, isNumber, isObject, isOwner, isOwnerOrAdmin, isRequestEvent, isSegment, isString, loadAdapterDefinition, loadLocalPlugin, loadNpmPlugin, localNum, localeDate, localeTime, rootLogger as logger, match, md5, memberBan, memberGetInfo, memberKick, memberPoke, memberSetAdmin, memberSetCard, memberSetTitle, messageGet, messageGetForward, messageRecall, messageSend, mriLib as mri, noNullish, normalizeAIThinkingLevel, normalizeAdmins, normalizeOwners, normalizePlugins, normalizeSkillPermissionRole, noticeAdmins, noticeFriends, noticeGroups, noticeOwners, path, prettyMs, profileSet, qs, randomId, randomInt, randomItem, randomItems, readMiokuConfig, readPackageJson, readPackageJsonSafe, registerPluginArtifacts, registerServiceConfig, registerStatusProvider, reloadMiokuConfig, removePluginMetadata, requireService, resetPluginMetadata, resetPluginRuntimeState, resolveCommand, resolveEntry, resolveLocalPluginEntry, resolveLocalPluginPath, rootLogger, runCommand, runCommandInherit, segment, sendMessage, _default as serviceManager, servicesRegistry, setActiveCommandManager, setBotCwd, setBuiltinPlugins, setPluginMetadata, setPluginRuntimeState, setService, setWritableConfig, start, startRuntime, string2argv, stringifyError, stripAnsi, text, toArray, toId, toUserId, unique, updateMiokuConfig, updateServiceConfig, uuid, version, wait, writePackageJson };
|
|
2883
|
+
export { type AIInstance, type AIInstanceInfo, type AIModelCapability, type AIModelDescriptor, type AIModelRole, type AIProtocol, type AIProviderConfig, type AIService, type AISkill, type AIThinkingLevel, type AITool, type AIUsageBotOption, type AIUsageBreakdown, type AIUsageContext, type AIUsageFinalization, type AIUsageRange, type AIUsageRecordQuery, type AIUsageRecordSummary, type AIUsageScope, type AIUsageSummary, AI_GEMINI_THINKING_LEVELS, AI_THINKING_LEVELS, type AccessAction, type AccessControlConfig, type AccessHook, type AccessRuleEntry, type AccessScopeConfig, Adapter, AdapterBotBase, AdapterBotMap, AdapterCandidate, AdapterContext, AdapterContextImpl, AdapterDefinition, AdapterEvent, AdapterFactoryOptions, AdapterGateway, AdapterInstanceStatus, AdapterRegistrationConflictError, AdapterReport, AdapterReportEntry, AdapterResource, AdapterResourceScope, AdapterStartResult, type AdapterStatus, type AdapterStatusStats, AnyFunc, ArchMap, Arrayable, type Attachment, AvatarSetRequest, Awaitable, BOT_CWD, BUILTIN_PLUGINS, Bot, BotAutoFilled, BotBase, BotConfigJson, BotContext, BotEvent, BotEventBase, BotHandler, BotLifecycleEvent, BotProvidedKeys, BotRegistry, BotStatus, BotStatusResult, BuildAdapterReportOptions, BuildStatusOptions, type BuiltinServiceRef, BusStats, ButtonOptions, CORE_PLUGINS, Capability, CapabilityHandler, CapabilityRegistry, CapabilityTarget, type ChatRuntime, type ChatRuntimeBaseOptions, type ChatRuntimeCollectedInfo, type ChatRuntimeGroupTarget, type ChatRuntimeInformationRequestOptions, type ChatRuntimeNoticeOptions, type ChatRuntimePrivateTarget, type ChatRuntimePromptInjection, type ChatRuntimeResult, type ChatRuntimeSource, ChromeUA, CommandCatalogItem, CommandDefinition, CommandExecutionContext, CommandHandler, CommandManager, CommandMatcher, CommandResult, type CommandRole, CommandShortcutOptions, type CompleteOptions, type CompleteResponse, ConfigScope, type ConfigService, type ConsolaInstance, ContextOptions, ConversationGetHistoryRequest, CorrelationParticipant, CorrelationRecord, CorrelationStats, CreateCmdOptions, CreateDriverOptions, CreateRuntimeOptions, CronHandler, DEFAULT_SKILL_ROOT_SPECS, DiscoverOptions, DiscoveryResult, Driver, DriverShutdownError, Event, EventBase, EventBus, EventCorrelator, EventFactoryOptions, EventHandler, type EventHandlerResult, EventIdentity, EventKindOfRoute, type EventMap, EventObservation, ExtendedNapCat, ForwardNode, ForwardSendNode, ForwardSendOptions, ForwardSendRequest, Friend, FriendDeleteRequest, FriendGetInfoRequest, FriendGetListRequest, FriendInfo, Gettable, Group, GroupGetInfoRequest, GroupGetListRequest, GroupGetMembersRequest, GroupInfo, GroupLeaveRequest, GroupSetNameRequest, GroupSetPortraitRequest, GroupSetWholeBanRequest, HasMessage, type HelpService, HistoryMessage, HttpClient, HttpRequestError, HttpRequestOptions, HttpResponse, LifecycleEvent, LifecycleEventMap, LifecycleHandler, LifecycleListener, LoadedAdapterDefinition, LoadedPluginDefinition, LocateOptions, type LogLevel, type Logger, type MarkdownScreenshotOptions, MatchHandler, MatchValue, MemberBanRequest, MemberGetInfoRequest, MemberInfo, MemberKickRequest, MemberPokeRequest, MemberSetAdminRequest, MemberSetCardRequest, MemberSetTitleRequest, type Message, MessageEvent, MessageGetForwardRequest, MessageGetRequest, MessageGetResult, type MessageInput, MessageRecallRequest, MessageSegment, MessageSegmentImpl, MessageSendRequest, type MessageTarget, MetaEvent, MiokuConfig, type MiokuContext, MiokuCoreServiceContrib, type MiokuPlugin, MiokuRuntime, type MiokuRuntimeConfig, type MiokuService, MiokuServices, MiokuStartOptions, type MiokuStatus, type MultimodalContentItem, type MultimodalMessage, Noop, NoticeEvent, NoticeOptions, PackageCandidate, PackageJson, type PackageJsonLike, ParsedSkillFile, PlatformId, PluginCandidate, PluginCleanup, type PluginHelp, PluginManager, type PluginMetadata, type PluginPackageConfig, type PluginStateRef, ProfileSetRequest, PureObject, RegisteredCommand, Registration, RegistrationFilter, ReplyArg, type ReplyOptions, RequestEvent, RouteEvent, type RunCommandResult, RuntimeAdapterState, RuntimeMiokuConfig, SKILL_COMPATIBILITY_MAX, SKILL_DESCRIPTION_MAX, SKILL_FILE_NAME, SKILL_KNOWN_KEYS, SKILL_NAME_MAX, SKILL_NAME_PATTERN, ScheduledTask, type ScreenshotOptions, type ScreenshotService, SenderInfo, type SentMessage, SerializedMessageSegment, ServiceFactory, ServiceManager, type ServiceMetadata, type ServiceRef, Services, type SessionToolDefinition, SkillCatalog, SkillCatalogOptions, SkillDefinition, SkillDiagnostic, SkillDiagnosticCode, SkillEntry, SkillFileParseResult, SkillInvocationPolicy, SkillLocation, SkillLogger, type SkillPermissionRole, SkillRoot, SkillRootKind, SkillRootOptions, SkillSummary, type SpawnPlan, StartOptions, type StatusProvider, StatusProviderContext, StatusProviderTarget, SystemMap, TOOL_RESULT_FOLLOWUP_KEY, type TextMessage, type ToolCallRecord, type ToolResultFollowup, UnsupportedCapabilityError, WebSocketClient, WebSocketConnectOptions, WebSocketConnectTimeoutError, WebSocketConnection, type WebUIService, addService, applyLogLevel, asMessage, atOf, avatarGet, avatarSet, base64Decode, base64Encode, bindCapabilities, botConfig, botStatus, box, buildAdapterReport, buildMiokuStatus, buildRoutes, buildSpawnPlan, clamp, collectBotStats, colorize, colors, commandExists, connectedBotKey, connectedBots, conversationGetHistory, createCmd, createDB, createDefaultDriver, createFriendRef, createGroupRef, createImportContext, createMessage, createMiokuLogger, createRuntime, createSkillCatalog, createStore, dayjs, dedent, defineAdapter, defineCapability, definePlugin, defineService, defineState, deleteServiceConfig, discoverAdapterCandidates, discoverPluginCandidates, discoverRoot, discoverSkills, displayAdapterId, ensureDataDir, expandHomePath, filesize, filter, find, findLocalPlugins, findSkillRoot, formatAdapterReport, formatDuration, formatMiokuStatus, formatMiokuStatusFn, forwardSend, friendDelete, friendGetInfo, friendGetList, fs, getActiveCommandManager, getAllPluginRuntimeStates, getBuiltinPlugins, getConfigDefaults, getConfigDir, getDataDir, getGTk, getPluginConfigDir, getPluginDataDir, getPluginMetadata, getPluginMetadataList, getPluginRuntimeState, getService, getServiceConfig, getServiceConfigDir, getServiceConfigs, getServiceDataDir, getTerminalInput, groupGetInfo, groupGetList, groupGetMembers, groupLeave, groupSetName, groupSetPortrait, groupSetWholeBan, hasEventRight, hasPluginState, hasRight, hasService, isAdapterEvent, isAdmin, isBoolean, isBotEvent, isDefined, isEventAdmin, isEventAdminConfigOnly, isEventGroupAdmin, isEventGroupOwner, isEventMaster, isEventOwner, isEventOwnerOrAdmin, isFunction, isMessage, isMessageEvent, isMetaEvent, isMiokuPlugin, isNoticeEvent, isNumber, isObject, isOwner, isOwnerOrAdmin, isRequestEvent, isSegment, isString, listSkillEntries, loadAdapterDefinition, loadLocalPlugin, loadNpmPlugin, localNum, localeDate, localeTime, locateSkillRoots, rootLogger as logger, match, md5, memberBan, memberGetInfo, memberKick, memberPoke, memberSetAdmin, memberSetCard, memberSetTitle, mergeSkillGroups, messageGet, messageGetForward, messageRecall, messageSend, mriLib as mri, noNullish, normalizeAIThinkingLevel, normalizeAdmins, normalizeOwners, normalizePlugins, normalizeSkillPermissionRole, noticeAdmins, noticeFriends, noticeGroups, noticeOwners, parseSkillFile, path, prettyMs, profileSet, qs, randomId, randomInt, randomItem, randomItems, readMiokuConfig, readPackageJson, readPackageJsonSafe, readSkillEntry, registerConfigDefaults, registerPluginArtifacts, registerServiceConfig, registerStatusProvider, reloadMiokuConfig, removePluginMetadata, renderSkillCatalog, renderSkillContent, requireService, resetPluginMetadata, resetPluginRuntimeState, resolveCommand, resolveEntry, resolveLocalPluginEntry, resolveLocalPluginPath, resolveSkillRoots, rootLogger, rootOfPath, runCommand, runCommandInherit, segment, sendMessage, _default as serviceManager, servicesRegistry, setActiveCommandManager, setBotCwd, setBuiltinPlugins, setPluginMetadata, setPluginRuntimeState, setService, setWritableConfig, start, startRuntime, string2argv, stringifyError, stripAnsi, text, toArray, toId, toUserId, unique, updateMiokuConfig, updateServiceConfig, uuid, version, wait, withConfigDefaults, writePackageJson };
|
|
2635
2884
|
//# sourceMappingURL=index.d.ts.map
|