mioku 1.2.2 → 1.3.0

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/index.d.cts 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?: 'owner' | 'admin' | 'member' | (string & {});
437
+ readonly role?: "owner" | "admin" | "member" | (string & {});
431
438
  }
432
439
  /** 消息事件:私聊与群聊消息 */
433
440
  interface MessageEvent extends BotEventBase {
434
- readonly kind: 'message';
435
- readonly message_type: 'private' | 'group' | 'channel' | 'thread' | 'direct' | (string & {});
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: 'notice';
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: 'request';
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: 'meta_event';
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: 'adapter';
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
- dispatch(event: Event): Promise<void>;
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) => void | Promise<void>): () => void;
838
+ listen(route: string, handler: (event: Event) => EventHandlerResult | Promise<EventHandlerResult>): () => void;
831
839
  }
832
840
  /** 适配器实例:start 时建立连接并注册资源,stop 时释放 */
833
841
  interface Adapter {
@@ -1699,7 +1707,7 @@ declare const hasRight: (id: string) => boolean;
1699
1707
  //# sourceMappingURL=config.d.ts.map
1700
1708
  //#endregion
1701
1709
  //#region src/runtime/bus.d.ts
1702
- type EventHandler<E extends Event = Event> = (event: E) => void | Promise<void>;
1710
+ type EventHandler<E extends Event = Event> = (event: E) => EventHandlerResult | Promise<EventHandlerResult>;
1703
1711
  interface Registration {
1704
1712
  readonly id: number;
1705
1713
  readonly route: string;
@@ -1728,8 +1736,14 @@ declare class EventBus {
1728
1736
  priority?: number;
1729
1737
  }): () => void;
1730
1738
  clear(): void;
1731
- /** 派发一个事件给所有匹配的监听器,单个监听器出错不影响其他监听器 */
1732
- dispatch(event: Event): Promise<void>;
1739
+ /**
1740
+ * 按优先级顺序把事件交给监听器,返回是否有人认领。
1741
+ *
1742
+ * 每个优先级组内按注册顺序逐个执行。handler 返回 `true` 即结束派发;
1743
+ * 返回 `undefined` / `false` 则继续交给后续监听器,全部不认领时静默结束。
1744
+ * 单个监听器出错只记日志,不影响后续监听器。
1745
+ */
1746
+ dispatch(event: Event): Promise<boolean>;
1733
1747
  stats(): BusStats;
1734
1748
  }
1735
1749
  //# sourceMappingURL=bus.d.ts.map
@@ -1818,7 +1832,8 @@ interface CommandExecutionContext {
1818
1832
  readonly args: readonly string[];
1819
1833
  readonly match?: RegExpMatchArray;
1820
1834
  }
1821
- type CommandHandler = (context: CommandExecutionContext) => void | Promise<void>;
1835
+ type CommandResult = boolean | void;
1836
+ type CommandHandler = (context: CommandExecutionContext) => CommandResult | Promise<CommandResult>;
1822
1837
  interface CommandDefinition {
1823
1838
  readonly id?: string;
1824
1839
  readonly name: string;
@@ -2047,8 +2062,11 @@ declare class MiokuContext {
2047
2062
  /**
2048
2063
  * 注册事件监听。route 支持层级路由,如 `message`、`message.group`、
2049
2064
  * `onebotv11:message`;返回取消监听函数。
2065
+ *
2066
+ * handler 返回 `true` 表示认领该事件,总线不再交给后续监听器;
2067
+ * 返回 `undefined` / `false` 则继续下传。
2050
2068
  */
2051
- handle<R extends string | readonly string[]>(route: R, handler: (event: RouteEvent<R>) => void | Promise<void>): () => void;
2069
+ handle<R extends string | readonly string[]>(route: R, handler: (event: RouteEvent<R>) => EventHandlerResult | Promise<EventHandlerResult>): () => void;
2052
2070
  /** 注册消息命令;默认自动匹配框架前缀并在命中后消费消息 */
2053
2071
  command(definition: CommandDefinition): () => void;
2054
2072
  command(matcher: CommandMatcher, handler: CommandHandler, options?: CommandShortcutOptions): () => void;
@@ -2176,8 +2194,8 @@ declare class AdapterContextImpl implements AdapterContext {
2176
2194
  registerGateway(gateway: AdapterGateway): () => void;
2177
2195
  waitForStarts(): Promise<void>;
2178
2196
  registerResource(resource: AdapterResource): () => void;
2179
- dispatch(event: Event): Promise<void>;
2180
- listen(route: string, handler: (event: Event) => void | Promise<void>): () => void;
2197
+ dispatch(event: Event): Promise<boolean>;
2198
+ listen(route: string, handler: (event: Event) => EventHandlerResult | Promise<EventHandlerResult>): () => void;
2181
2199
  emitLifecycle(event: BotLifecycleEvent): Promise<void>;
2182
2200
  get adapterName(): string;
2183
2201
  }
@@ -2542,6 +2560,223 @@ declare const connectedBotKey: (adapter: string, bot_id: string) => string;
2542
2560
  type ExtendedNapCat = Bot;
2543
2561
  //# sourceMappingURL=connected-bots.d.ts.map
2544
2562
  //#endregion
2563
+ //#region src/skills/types.d.ts
2564
+ /** 技能根分类:项目内 / 用户级 / 自定义 */
2565
+ type SkillRootKind = "project-agents" | "project-claude" | "user-agents" | "user-claude" | "user-codex" | "custom";
2566
+ /** 一个技能扫描根 */
2567
+ interface SkillRoot {
2568
+ /** 分类 id,UI 按它分组 */
2569
+ id: string;
2570
+ /** 展示名,用户级用 `~` 简写 */
2571
+ label: string;
2572
+ kind: SkillRootKind;
2573
+ /** 绝对路径 */
2574
+ path: string;
2575
+ /** 数字小的先赢(技能重名时) */
2576
+ rank: number;
2577
+ /** 是否允许从 WebUI 安装 / 卸载 */
2578
+ writable: boolean;
2579
+ }
2580
+ /** 调用策略,来自 frontmatter 的 disable-model-invocation / user-invocable */
2581
+ interface SkillInvocationPolicy {
2582
+ /** 是否进入模型目录并允许 `skill` 工具加载 */
2583
+ modelInvocable: boolean;
2584
+ /** 是否允许用户显式调用 */
2585
+ userInvocable: boolean;
2586
+ }
2587
+ /** 技能摘要:渐进披露第一级,只有路由需要的字段 */
2588
+ interface SkillSummary {
2589
+ name: string;
2590
+ description: string;
2591
+ invoke: SkillInvocationPolicy;
2592
+ /** 所属根的 id */
2593
+ rootId: string;
2594
+ /** 技能根目录绝对路径 */
2595
+ dir: string;
2596
+ /** SKILL.md 绝对路径 */
2597
+ path: string;
2598
+ /** 相对技能根的附加文件 */
2599
+ resources: string[];
2600
+ }
2601
+ /** 完整技能定义:正文按需读取,不缓存 */
2602
+ interface SkillDefinition extends SkillSummary {
2603
+ content: string;
2604
+ license?: string;
2605
+ compatibility?: string;
2606
+ metadata?: Record<string, string>;
2607
+ /** 规范里的 allowed-tools,仅供模型参考 */
2608
+ allowedTools: string[];
2609
+ }
2610
+ type SkillDiagnosticCode = "INVALID_NAME" | "MISSING_FRONTMATTER" | "MISSING_FIELD" | "INVALID_YAML" | "NAME_MISMATCH" | "UNKNOWN_KEY" | "NAME_DUPLICATE" | "UNUSABLE_INVOCATION" | "READ_FAILED";
2611
+ interface SkillDiagnostic {
2612
+ level: "error" | "warn";
2613
+ code: SkillDiagnosticCode;
2614
+ message: string;
2615
+ /** 出问题的 SKILL.md 绝对路径 */
2616
+ path: string;
2617
+ }
2618
+ interface SkillLogger {
2619
+ info(message: string): void;
2620
+ warn(message: string): void;
2621
+ }
2622
+ declare const SKILL_FILE_NAME = "SKILL.md";
2623
+ /** 规范要求的技能名:小写字母数字,单连字符分隔 */
2624
+ declare const SKILL_NAME_PATTERN: RegExp;
2625
+ declare const SKILL_NAME_MAX = 64;
2626
+ declare const SKILL_DESCRIPTION_MAX = 1024;
2627
+ declare const SKILL_COMPATIBILITY_MAX = 500;
2628
+ /** 规范定义的六个字段加上两个调用控制字段 */
2629
+ declare const SKILL_KNOWN_KEYS: readonly string[];
2630
+ //# sourceMappingURL=types.d.ts.map
2631
+ //#endregion
2632
+ //#region src/skills/frontmatter.d.ts
2633
+ interface ParsedSkillFile {
2634
+ name: string;
2635
+ description: string;
2636
+ license?: string;
2637
+ compatibility?: string;
2638
+ metadata?: Record<string, string>;
2639
+ allowedTools: string[];
2640
+ invoke: SkillInvocationPolicy;
2641
+ /** 去掉 frontmatter 的 Markdown 正文 */
2642
+ content: string;
2643
+ }
2644
+ interface SkillFileParseResult {
2645
+ /** 缺失表示该文件必须被忽略 */
2646
+ skill?: ParsedSkillFile;
2647
+ diagnostics: SkillDiagnostic[];
2648
+ }
2649
+ /**
2650
+ * 解析并校验一个 `SKILL.md`。
2651
+ * 缺失 `skill` 表示该文件不可用:缺少 frontmatter、YAML 非法、name/description 缺失或 name 非法。
2652
+ */
2653
+ declare function parseSkillFile(path: string, raw: string): SkillFileParseResult;
2654
+ //# sourceMappingURL=frontmatter.d.ts.map
2655
+ //#endregion
2656
+ //#region src/skills/roots.d.ts
2657
+ interface SkillRootOptions {
2658
+ /** 机器人根目录,默认 `process.cwd()` */
2659
+ botRoot?: string;
2660
+ /** 用户主目录,默认 `os.homedir()` */
2661
+ home?: string;
2662
+ /** 额外扫描根,可写 `~/` 简写 */
2663
+ extraRoots?: string[];
2664
+ }
2665
+ interface SkillRootSpec {
2666
+ id: string;
2667
+ label: string;
2668
+ kind: SkillRootKind;
2669
+ scope: "project" | "user";
2670
+ segments: string[];
2671
+ rank: number;
2672
+ }
2673
+ /** 五个标准技能根,按 rank 升序;与 Claude Code / Codex / `npx skills add` 的目录约定一致 */
2674
+ declare const DEFAULT_SKILL_ROOT_SPECS: readonly SkillRootSpec[];
2675
+ /** 展开开头的 `~/` */
2676
+ declare function expandHomePath(input: string, home?: string): string;
2677
+ /** 解析出当前机器上的技能根列表,自定义根排在项目根之后、用户根之前 */
2678
+ declare function resolveSkillRoots(options?: SkillRootOptions): SkillRoot[];
2679
+ declare function findSkillRoot(roots: readonly SkillRoot[], id: string): SkillRoot | undefined;
2680
+ /** 判断路径是否落在某个根内,返回该根 */
2681
+ declare function rootOfPath(roots: readonly SkillRoot[], target: string): SkillRoot | undefined;
2682
+ //#endregion
2683
+ //#region src/skills/discover.d.ts
2684
+ interface DiscoverOptions {
2685
+ /** 单个技能的附加文件上限 */
2686
+ maxResourceFiles?: number;
2687
+ /** 附加文件的相对深度上限 */
2688
+ maxResourceDepth?: number;
2689
+ }
2690
+ interface DiscoveryResult {
2691
+ skills: SkillSummary[];
2692
+ diagnostics: SkillDiagnostic[];
2693
+ }
2694
+ /** 根下的一个技能候选,尚未读盘 */
2695
+ interface SkillEntry {
2696
+ /** 目录形态时是技能目录名,扁平形态时是文件名 */
2697
+ entryName: string;
2698
+ /** 技能根目录(扁平形态等于 root.path) */
2699
+ skillDir: string;
2700
+ /** 指令文件绝对路径 */
2701
+ skillPath: string;
2702
+ }
2703
+ /** 枚举一个根下的技能候选:`<name>/SKILL.md` 与 `<name>.md` 两种形态 */
2704
+ declare function listSkillEntries(root: SkillRoot): Promise<SkillEntry[]>;
2705
+ /** 读盘并解析一个技能候选;缺文件、软链接断链、超大都返回空结果 */
2706
+ declare function readSkillEntry(root: SkillRoot, entry: SkillEntry, options?: DiscoverOptions): Promise<DiscoveryResult>;
2707
+ /**
2708
+ * 按 rank 合并各组结果;重名时先出现的(rank 小的)获胜,后来者记一条 warn。
2709
+ * `groups` 必须已按 rank 升序排列。
2710
+ */
2711
+ declare function mergeSkillGroups(groups: readonly SkillSummary[][], diagnostics: SkillDiagnostic[]): SkillSummary[];
2712
+ /** 扫描一个技能根(无缓存) */
2713
+ declare function discoverRoot(root: SkillRoot, options?: DiscoverOptions): Promise<DiscoveryResult>;
2714
+ /** 扫描全部根(无缓存);技能重名时 rank 小的先赢 */
2715
+ declare function discoverSkills(roots: readonly SkillRoot[], options?: DiscoverOptions): Promise<DiscoveryResult>;
2716
+ //# sourceMappingURL=discover.d.ts.map
2717
+ //#endregion
2718
+ //#region src/skills/catalog.d.ts
2719
+ interface SkillCatalogOptions extends SkillRootOptions {
2720
+ /** 直接指定根,忽略 botRoot/home/extraRoots */
2721
+ roots?: SkillRoot[];
2722
+ maxResourceFiles?: number;
2723
+ /** 两次全量扫描之间的最小间隔,毫秒;0 表示每次都扫 */
2724
+ rescanIntervalMs?: number;
2725
+ logger?: SkillLogger;
2726
+ }
2727
+ interface SkillCatalog {
2728
+ roots(): SkillRoot[];
2729
+ /** 技能摘要列表;带 TTL 与 mtime 缓存 */
2730
+ snapshot(options?: {
2731
+ force?: boolean;
2732
+ }): Promise<SkillSummary[]>;
2733
+ /** 按需读取正文,每次重新读盘;名字变化时返回 undefined 并让下次重扫 */
2734
+ load(name: string): Promise<SkillDefinition | undefined>;
2735
+ diagnostics(): SkillDiagnostic[];
2736
+ /** 清空全部缓存(安装 / 卸载 / 手工改盘后调用) */
2737
+ invalidate(): void;
2738
+ }
2739
+ /** 技能目录:扫描五个标准根,合并去重,按需读正文 */
2740
+ declare function createSkillCatalog(options?: SkillCatalogOptions): SkillCatalog;
2741
+ //# sourceMappingURL=catalog.d.ts.map
2742
+ //#endregion
2743
+ //#region src/skills/render.d.ts
2744
+ /** 目录行:`- \`name\`: description` */
2745
+ declare function renderSkillCatalog(skills: readonly SkillSummary[], options?: {
2746
+ maxDescriptionLength?: number;
2747
+ }): string;
2748
+ /** 加载结果:伪 XML 包裹的资源清单与正文,模型语料里常见的形状 */
2749
+ declare function renderSkillContent(skill: SkillDefinition): string;
2750
+ //# sourceMappingURL=render.d.ts.map
2751
+ //#endregion
2752
+ //#region src/skills/locate.d.ts
2753
+ interface SkillLocation {
2754
+ /** frontmatter 里的 name;解析不可用时退回目录名 */
2755
+ name: string;
2756
+ description: string;
2757
+ /** 技能根目录绝对路径 */
2758
+ dir: string;
2759
+ /** SKILL.md 绝对路径 */
2760
+ path: string;
2761
+ /** 技能目录内的文件数(有上限) */
2762
+ files: number;
2763
+ /** 该候选是否可以直接安装 */
2764
+ valid: boolean;
2765
+ diagnostics: SkillDiagnostic[];
2766
+ }
2767
+ interface LocateOptions {
2768
+ /** 递归深度上限,默认 3 */
2769
+ maxDepth?: number;
2770
+ /** 候选数量上限,默认 50 */
2771
+ maxCandidates?: number;
2772
+ }
2773
+ /**
2774
+ * 在下载/解包出来的目录里定位技能:根目录有 SKILL.md 就用它,
2775
+ * 否则向下(深度受限)找所有含 SKILL.md 的目录,供安装时挑选。
2776
+ */
2777
+ declare function locateSkillRoots(root: string, options?: LocateOptions): Promise<SkillLocation[]>;
2778
+ //# sourceMappingURL=locate.d.ts.map
2779
+ //#endregion
2545
2780
  //#region src/runtime/plugin-artifacts.d.ts
2546
2781
  declare function registerPluginArtifacts(ctx?: MiokuContext): Promise<void>;
2547
2782
  //# sourceMappingURL=plugin-artifacts.d.ts.map
@@ -2631,5 +2866,5 @@ declare function start(options?: MiokuStartOptions): Promise<{
2631
2866
  }>;
2632
2867
  declare const version: string;
2633
2868
  //#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 };
2869
+ 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, 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, 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, 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, writePackageJson };
2635
2870
  //# sourceMappingURL=index.d.cts.map