@zhin.js/core 1.1.35 → 1.1.38
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/README.md +79 -193
- package/lib/built/ai-outbound/index.d.ts +0 -1
- package/lib/built/ai-outbound/index.js +0 -1
- package/lib/built/ai-outbound/types.d.ts +0 -9
- package/lib/built/ai-trigger.d.ts +0 -5
- package/lib/built/ai-trigger.js +1 -27
- package/lib/built/common-adapter-tools.d.ts +0 -2
- package/lib/built/common-adapter-tools.js +0 -4
- package/lib/built/html-segment-fallback.d.ts +2 -5
- package/lib/built/html-segment-fallback.js +0 -15
- package/lib/built/interactive-segments/index.d.ts +0 -2
- package/lib/built/interactive-segments/index.js +0 -2
- package/lib/built/interactive-segments/keyboard-segment.d.ts +0 -1
- package/lib/built/interactive-segments/keyboard-segment.js +0 -1
- package/lib/built/interactive-segments/onebot-keyboard.d.ts +0 -1
- package/lib/built/interactive-segments/onebot-keyboard.js +0 -2
- package/lib/built/interactive-segments/resolve.d.ts +0 -1
- package/lib/built/interactive-segments/resolve.js +0 -1
- package/lib/built/interactive-segments/types.d.ts +0 -5
- package/lib/built/login-assist.d.ts +1 -8
- package/lib/built/message-enrich.d.ts +2 -8
- package/lib/built/message-enrich.js +3 -11
- package/lib/built/segment-contract/assert.js +2 -1
- package/lib/built/segment-contract/delivery.js +1 -0
- package/lib/built/segment-contract/index.d.ts +2 -2
- package/lib/built/segment-contract/index.js +1 -1
- package/lib/built/segment-contract/json-schema.d.ts +1 -1
- package/lib/built/segment-contract/json-schema.js +33 -2
- package/lib/built/segment-contract/preview.js +7 -0
- package/lib/built/segment-contract/types.d.ts +2 -2
- package/lib/built/segment-contract/validate.d.ts +43 -2
- package/lib/built/segment-contract/validate.js +37 -3
- package/lib/built/tool-access.d.ts +5 -0
- package/lib/built/tool-access.js +17 -0
- package/lib/built/user-interaction.js +0 -4
- package/lib/feature/handler.d.ts +1 -5
- package/lib/index.d.ts +4 -45
- package/lib/index.js +3 -39
- package/lib/message.d.ts +1 -2
- package/lib/models/system-log.d.ts +0 -2
- package/lib/models/system-log.js +1 -8
- package/lib/models/user.d.ts +0 -2
- package/lib/models/user.js +1 -7
- package/lib/notice.d.ts +1 -2
- package/lib/plugin-runtime/im/conversation-runtime.d.ts +19 -0
- package/lib/plugin-runtime/im/conversation-runtime.js +312 -0
- package/lib/plugin-runtime/im/endpoint-runtime.d.ts +79 -0
- package/lib/plugin-runtime/im/endpoint-runtime.js +162 -0
- package/lib/plugin-runtime/im/im-runtime.d.ts +13 -106
- package/lib/plugin-runtime/im/im-runtime.js +58 -1061
- package/lib/plugin-runtime/im/inbound-runtime.d.ts +31 -0
- package/lib/plugin-runtime/im/inbound-runtime.js +252 -0
- package/lib/plugin-runtime/im/index.d.ts +4 -2
- package/lib/plugin-runtime/im/index.js +2 -2
- package/lib/plugin-runtime/im/ingress-route.d.ts +10 -0
- package/lib/plugin-runtime/im/ingress-route.js +10 -0
- package/lib/plugin-runtime/im/interaction-runtime.d.ts +23 -0
- package/lib/plugin-runtime/im/interaction-runtime.js +181 -0
- package/lib/plugin-runtime/im/interactive-router.d.ts +17 -0
- package/lib/plugin-runtime/im/interactive-router.js +98 -0
- package/lib/plugin-runtime/im/message-bus.d.ts +3 -3
- package/lib/plugin-runtime/im/message-bus.js +3 -3
- package/lib/plugin-runtime/im/message-events.d.ts +26 -0
- package/lib/plugin-runtime/im/message-events.js +61 -0
- package/lib/plugin-runtime/im/outbound-delivery-runtime.d.ts +19 -0
- package/lib/plugin-runtime/im/outbound-delivery-runtime.js +165 -0
- package/lib/plugin-runtime/im/outbound-segments.d.ts +2 -3
- package/lib/plugin-runtime/im/outbound-segments.js +3 -4
- package/lib/plugin-runtime/im/runtime-middleware.d.ts +3 -0
- package/lib/plugin-runtime/im/runtime-middleware.js +13 -0
- package/lib/request.d.ts +1 -2
- package/lib/side-event/base.d.ts +1 -2
- package/lib/side-event/normalize.d.ts +1 -5
- package/lib/side-event/normalize.js +1 -11
- package/lib/system-event.d.ts +1 -2
- package/lib/types.d.ts +9 -116
- package/lib/utils.d.ts +51 -24
- package/lib/utils.js +11 -23
- package/package.json +18 -28
- package/lib/adapter.d.ts +0 -145
- package/lib/adapter.js +0 -377
- package/lib/built/adapter-process.d.ts +0 -58
- package/lib/built/adapter-process.js +0 -128
- package/lib/built/agent-preset.d.ts +0 -64
- package/lib/built/agent-preset.js +0 -79
- package/lib/built/ai-outbound/adapter-access.d.ts +0 -3
- package/lib/built/ai-outbound/adapter-access.js +0 -9
- package/lib/built/authorization.d.ts +0 -10
- package/lib/built/authorization.js +0 -76
- package/lib/built/command.d.ts +0 -72
- package/lib/built/command.js +0 -105
- package/lib/built/component.d.ts +0 -67
- package/lib/built/component.js +0 -97
- package/lib/built/config.d.ts +0 -98
- package/lib/built/config.js +0 -372
- package/lib/built/connect-endpoint-instance.d.ts +0 -17
- package/lib/built/connect-endpoint-instance.js +0 -42
- package/lib/built/database.d.ts +0 -68
- package/lib/built/database.js +0 -106
- package/lib/built/dispatcher.d.ts +0 -141
- package/lib/built/dispatcher.js +0 -383
- package/lib/built/endpoint-commands.d.ts +0 -3
- package/lib/built/endpoint-commands.js +0 -99
- package/lib/built/endpoint-lifecycle-service.d.ts +0 -28
- package/lib/built/endpoint-lifecycle-service.js +0 -242
- package/lib/built/endpoint-lifecycle.d.ts +0 -27
- package/lib/built/endpoint-lifecycle.js +0 -36
- package/lib/built/endpoint-manager.d.ts +0 -34
- package/lib/built/endpoint-manager.js +0 -1
- package/lib/built/html-renderer-loader.d.ts +0 -13
- package/lib/built/html-renderer-loader.js +0 -33
- package/lib/built/inbound-pipeline.d.ts +0 -37
- package/lib/built/inbound-pipeline.js +0 -63
- package/lib/built/inbound-runner.d.ts +0 -22
- package/lib/built/inbound-runner.js +0 -34
- package/lib/built/interactive-segment-contract.d.ts +0 -6
- package/lib/built/interactive-segment-contract.js +0 -9
- package/lib/built/interactive-segments/fallback-store.d.ts +0 -29
- package/lib/built/interactive-segments/fallback-store.js +0 -63
- package/lib/built/interactive-segments/handlers.d.ts +0 -16
- package/lib/built/interactive-segments/handlers.js +0 -74
- package/lib/built/introspection-format.d.ts +0 -10
- package/lib/built/introspection-format.js +0 -28
- package/lib/built/management-command-guard.d.ts +0 -15
- package/lib/built/management-command-guard.js +0 -25
- package/lib/built/message-filter.d.ts +0 -176
- package/lib/built/message-filter.js +0 -239
- package/lib/built/optional-peer-import.d.ts +0 -3
- package/lib/built/optional-peer-import.js +0 -33
- package/lib/built/outbound-media-contract.d.ts +0 -22
- package/lib/built/outbound-media-contract.js +0 -10
- package/lib/built/permission.d.ts +0 -51
- package/lib/built/permission.js +0 -99
- package/lib/built/permit-check.d.ts +0 -7
- package/lib/built/permit-check.js +0 -35
- package/lib/built/permit-parse.d.ts +0 -16
- package/lib/built/permit-parse.js +0 -32
- package/lib/built/platform-permit.d.ts +0 -20
- package/lib/built/platform-permit.js +0 -91
- package/lib/built/rich-segments/adapter-policies.d.ts +0 -9
- package/lib/built/rich-segments/adapter-policies.js +0 -27
- package/lib/built/rich-segments/base.d.ts +0 -11
- package/lib/built/rich-segments/base.js +0 -24
- package/lib/built/rich-segments/builtins.d.ts +0 -4
- package/lib/built/rich-segments/builtins.js +0 -40
- package/lib/built/rich-segments/capabilities.d.ts +0 -6
- package/lib/built/rich-segments/capabilities.js +0 -38
- package/lib/built/rich-segments/html-segment.d.ts +0 -15
- package/lib/built/rich-segments/html-segment.js +0 -62
- package/lib/built/rich-segments/index.d.ts +0 -13
- package/lib/built/rich-segments/index.js +0 -13
- package/lib/built/rich-segments/markdown-segment.d.ts +0 -14
- package/lib/built/rich-segments/markdown-segment.js +0 -58
- package/lib/built/rich-segments/qrcode-segment.d.ts +0 -18
- package/lib/built/rich-segments/qrcode-segment.js +0 -73
- package/lib/built/rich-segments/registry.d.ts +0 -16
- package/lib/built/rich-segments/registry.js +0 -52
- package/lib/built/rich-segments/resolve.d.ts +0 -5
- package/lib/built/rich-segments/resolve.js +0 -87
- package/lib/built/rich-segments/tts-segment.d.ts +0 -13
- package/lib/built/rich-segments/tts-segment.js +0 -51
- package/lib/built/rich-segments/types.d.ts +0 -79
- package/lib/built/rich-segments/types.js +0 -17
- package/lib/built/runtime-io.d.ts +0 -9
- package/lib/built/runtime-io.js +0 -67
- package/lib/built/schedule.d.ts +0 -54
- package/lib/built/schedule.js +0 -112
- package/lib/built/schema-endpoint-manager.d.ts +0 -17
- package/lib/built/schema-endpoint-manager.js +0 -73
- package/lib/built/schema-feature.d.ts +0 -77
- package/lib/built/schema-feature.js +0 -130
- package/lib/built/skill.d.ts +0 -120
- package/lib/built/skill.js +0 -151
- package/lib/built/speech-loader.d.ts +0 -14
- package/lib/built/speech-loader.js +0 -32
- package/lib/built/tool.d.ts +0 -151
- package/lib/built/tool.js +0 -388
- package/lib/command.d.ts +0 -50
- package/lib/command.js +0 -106
- package/lib/endpoint-capabilities.d.ts +0 -46
- package/lib/endpoint-capabilities.js +0 -55
- package/lib/endpoint.d.ts +0 -19
- package/lib/endpoint.js +0 -3
- package/lib/host-plugin-registry.d.ts +0 -8
- package/lib/host-plugin-registry.js +0 -12
- package/lib/plugin-context.d.ts +0 -27
- package/lib/plugin-context.js +0 -64
- package/lib/plugin-runtime/im/interactive.d.ts +0 -26
- package/lib/plugin-runtime/im/interactive.js +0 -46
- package/lib/plugin-runtime/im/service-tokens.d.ts +0 -18
- package/lib/plugin-runtime/im/service-tokens.js +0 -13
- package/lib/plugin.d.ts +0 -268
- package/lib/plugin.js +0 -583
- package/lib/schema-interaction.d.ts +0 -117
- package/lib/schema-interaction.js +0 -247
- package/lib/tool-zod.d.ts +0 -43
- package/lib/tool-zod.js +0 -184
package/lib/plugin.d.ts
DELETED
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin 类 — IM 特化插件,继承 PluginBase
|
|
3
|
-
*
|
|
4
|
-
* 在 PluginBase 的 DI/生命周期/事件基础上增加:
|
|
5
|
-
* - Context 类型安全(Plugin.Contexts 映射)
|
|
6
|
-
* - 生命周期事件类型安全(Plugin.Lifecycle)
|
|
7
|
-
* - 中间件系统、适配器管理、useContext 等
|
|
8
|
-
*/
|
|
9
|
-
import { MessageMiddleware, RegisteredAdapter, MaybePromise, ArrayItem, SendOptions, MessageSendPayload, type PluginManifest } from './types.js';
|
|
10
|
-
import type { InteractiveHandler } from "./built/interactive-segments/types.js";
|
|
11
|
-
import { Adapter, Adapters } from "./adapter.js";
|
|
12
|
-
import { PluginBase, PluginBaseLifecycle, type PluginLike } from '@zhin.js/kernel';
|
|
13
|
-
export { getPlugin, markPluginRuntimeActive, isPluginRuntimeActive, resetPluginRuntimeFlag } from "./plugin-context.js";
|
|
14
|
-
export { storage, getCurrentFile } from "./plugin-context.js";
|
|
15
|
-
export { setHostRootPlugin, getHostRootPlugin } from "./host-plugin-registry.js";
|
|
16
|
-
declare const contextsKey: unique symbol;
|
|
17
|
-
export type SideEffect<A extends (keyof Plugin.Contexts)[]> = {
|
|
18
|
-
(...args: ContextList<A>): MaybePromise<void | DisposeFn<ContextList<A>>>;
|
|
19
|
-
finished?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export type DisposeFn<A> = (context: ArrayItem<A>) => MaybePromise<void>;
|
|
22
|
-
export type ContextList<CS extends (keyof Plugin.Contexts)[]> = CS extends [infer L, ...infer R] ? R extends (keyof Plugin.Contexts)[] ? [ContextItem<L>, ...ContextList<R>] : never[] : never[];
|
|
23
|
-
type ContextItem<L> = L extends keyof Plugin.Contexts ? Plugin.Contexts[L] : never;
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated **已删除**。请使用 `definePlugin` + 约定目录(`zhin runtime start`)。
|
|
26
|
-
* @throws 总是抛出——仅保留签名供编译期过渡。
|
|
27
|
-
*/
|
|
28
|
-
export declare function usePlugin(): Plugin;
|
|
29
|
-
export interface Plugin extends Plugin.Extensions {
|
|
30
|
-
on<K extends keyof Plugin.Lifecycle>(name: K, listener: (...args: Plugin.Lifecycle[K]) => void): this;
|
|
31
|
-
on(name: string | symbol, listener: (...args: any[]) => void): this;
|
|
32
|
-
off<K extends keyof Plugin.Lifecycle>(name: K, listener: (...args: Plugin.Lifecycle[K]) => void): this;
|
|
33
|
-
off(name: string | symbol, listener: (...args: any[]) => void): this;
|
|
34
|
-
once<K extends keyof Plugin.Lifecycle>(name: K, listener: (...args: Plugin.Lifecycle[K]) => void): this;
|
|
35
|
-
once(name: string | symbol, listener: (...args: any[]) => void): this;
|
|
36
|
-
emit<K extends keyof Plugin.Lifecycle>(name: K, ...args: Plugin.Lifecycle[K]): boolean;
|
|
37
|
-
emit(name: string | symbol, ...args: any[]): boolean;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Plugin 类 - IM 特化插件,继承 PluginBase
|
|
41
|
-
*
|
|
42
|
-
* 类型窄化:
|
|
43
|
-
* - children: Plugin[] (而非 PluginBase[])
|
|
44
|
-
* - parent: Plugin | undefined
|
|
45
|
-
* - root: Plugin
|
|
46
|
-
* - $contexts: Map<string, Context<any>>
|
|
47
|
-
* - dispatch/broadcast: Plugin.Lifecycle 类型安全
|
|
48
|
-
*/
|
|
49
|
-
export declare class Plugin extends PluginBase implements PluginLike {
|
|
50
|
-
#private;
|
|
51
|
-
static [contextsKey]: string[];
|
|
52
|
-
adapters: (keyof Plugin.Contexts)[];
|
|
53
|
-
started: boolean;
|
|
54
|
-
get root(): Plugin;
|
|
55
|
-
get middleware(): MessageMiddleware<RegisteredAdapter>;
|
|
56
|
-
/**
|
|
57
|
-
* 构造函数
|
|
58
|
-
*/
|
|
59
|
-
constructor(filePath?: string, parent?: Plugin);
|
|
60
|
-
/**
|
|
61
|
-
* 添加中间件
|
|
62
|
-
* 中间件用于处理消息流转
|
|
63
|
-
*/
|
|
64
|
-
addMiddleware<T extends RegisteredAdapter>(middleware: MessageMiddleware<T>, name?: string): () => void;
|
|
65
|
-
/**
|
|
66
|
-
* 注册交互式 action 回调处理器(自动安装根中间件,优先于 Dispatcher)
|
|
67
|
-
*/
|
|
68
|
-
registerInteractiveHandler(prefix: string, handler: InteractiveHandler): () => void;
|
|
69
|
-
/**
|
|
70
|
-
* 插件名称
|
|
71
|
-
*/
|
|
72
|
-
get name(): string;
|
|
73
|
-
/**
|
|
74
|
-
* 插件清单(从 plugin.yml 或 package.json 延迟读取)
|
|
75
|
-
*/
|
|
76
|
-
get manifest(): PluginManifest | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* 上下文收集 — 使用类型窄化的 inject 替代直接 Map 访问
|
|
79
|
-
*/
|
|
80
|
-
useContext<T extends (keyof Plugin.Contexts)[]>(...args: [...T, SideEffect<T>]): void;
|
|
81
|
-
inject<T extends keyof Plugin.Contexts>(name: T): Plugin.Contexts[T] | undefined;
|
|
82
|
-
inject(name: string): unknown;
|
|
83
|
-
injectAdapter(name: string): Adapter | undefined;
|
|
84
|
-
contextIsReady<T extends keyof Plugin.Contexts>(name: T): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* 启动插件
|
|
87
|
-
* 覆盖 PluginBase.start() 以支持 Context 挂载失败回滚
|
|
88
|
-
*/
|
|
89
|
-
start(t?: number): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* 覆盖 mountAllContexts:支持部分失败回滚
|
|
92
|
-
*/
|
|
93
|
-
protected mountAllContexts(): Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* 获取插件提供的功能
|
|
96
|
-
* 从各个服务中获取数据
|
|
97
|
-
*/
|
|
98
|
-
get features(): Plugin.Features;
|
|
99
|
-
/**
|
|
100
|
-
* 获取插件功能摘要(数组形式)
|
|
101
|
-
* 返回各功能类型的名称和数量
|
|
102
|
-
*/
|
|
103
|
-
getFeatures(): Array<{
|
|
104
|
-
name: string;
|
|
105
|
-
count: number;
|
|
106
|
-
}>;
|
|
107
|
-
info(): Record<string, any>;
|
|
108
|
-
/**
|
|
109
|
-
* 停止插件
|
|
110
|
-
* 委托 PluginBase.stop() 处理通用清理,仅补充 IM 特化逻辑
|
|
111
|
-
*/
|
|
112
|
-
stop(): Promise<void>;
|
|
113
|
-
onMounted(callback: () => void | Promise<void>): void;
|
|
114
|
-
/**
|
|
115
|
-
* dispatch - 向上冒泡到父插件,或者在根节点广播(类型安全版本)
|
|
116
|
-
*/
|
|
117
|
-
dispatch<K extends keyof Plugin.Lifecycle>(name: K, ...args: Plugin.Lifecycle[K]): Promise<void>;
|
|
118
|
-
/**
|
|
119
|
-
* broadcast - 向下广播到所有子插件(类型安全版本)
|
|
120
|
-
*/
|
|
121
|
-
broadcast<K extends keyof Plugin.Lifecycle>(name: K, ...args: Plugin.Lifecycle[K]): Promise<void>;
|
|
122
|
-
/**
|
|
123
|
-
* 注册上下文(类型安全版本)
|
|
124
|
-
*/
|
|
125
|
-
provide(target: any): this;
|
|
126
|
-
/**
|
|
127
|
-
* 导入插件(Plugin 类型窄化版本)
|
|
128
|
-
*/
|
|
129
|
-
import(entry: string, t?: number): Promise<Plugin>;
|
|
130
|
-
/**
|
|
131
|
-
* 重载插件(Plugin 类型窄化版本)
|
|
132
|
-
*/
|
|
133
|
-
reload(plugin?: PluginBase): Promise<void>;
|
|
134
|
-
/**
|
|
135
|
-
* 监听文件变化(Plugin 类型窄化版本)
|
|
136
|
-
*/
|
|
137
|
-
watch(callback: (p: PluginBase) => void | Promise<void>, recursive?: boolean): void;
|
|
138
|
-
/**
|
|
139
|
-
* 自动绑定核心方法(只在构造函数中调用一次)
|
|
140
|
-
*/
|
|
141
|
-
$bindMethods(): void;
|
|
142
|
-
/**
|
|
143
|
-
* 创建插件实例(异步加载)
|
|
144
|
-
*/
|
|
145
|
-
static create(entry: string, parent?: Plugin): Promise<Plugin>;
|
|
146
|
-
}
|
|
147
|
-
export declare function defineContext<T extends keyof Plugin.Contexts, E extends Partial<Plugin.Extensions> = {}>(options: Context<T, E>): Context<T, E>;
|
|
148
|
-
export interface Context<T extends keyof Plugin.Contexts = keyof Plugin.Contexts, E extends Partial<Plugin.Extensions> = {}> {
|
|
149
|
-
name: T;
|
|
150
|
-
description: string;
|
|
151
|
-
value?: Plugin.Contexts[T];
|
|
152
|
-
mounted?: (parent: Plugin) => Plugin.Contexts[T] | Promise<Plugin.Contexts[T]>;
|
|
153
|
-
dispose?: (value: Plugin.Contexts[T]) => void;
|
|
154
|
-
/** 扩展方法,会自动挂载到 Plugin.prototype 上 */
|
|
155
|
-
extensions?: E;
|
|
156
|
-
}
|
|
157
|
-
export declare namespace Plugin {
|
|
158
|
-
/**
|
|
159
|
-
* 插件提供的功能
|
|
160
|
-
*/
|
|
161
|
-
interface Features {
|
|
162
|
-
commands: string[];
|
|
163
|
-
components: string[];
|
|
164
|
-
schedules: string[];
|
|
165
|
-
middlewares: string[];
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* 生命周期事件
|
|
169
|
-
*
|
|
170
|
-
* 必须包含索引签名以满足 PluginBaseLifecycle 结构子类型约束。
|
|
171
|
-
*/
|
|
172
|
-
interface Lifecycle extends PluginBaseLifecycle {
|
|
173
|
-
"before-mount": [Plugin];
|
|
174
|
-
"before-dispose": [Plugin];
|
|
175
|
-
"context.mounted": [keyof Plugin.Contexts];
|
|
176
|
-
"context.dispose": [keyof Plugin.Contexts];
|
|
177
|
-
"call.recallMessage": [string, string, string];
|
|
178
|
-
'before.sendMessage': [SendOptions];
|
|
179
|
-
'message.send': [MessageSendPayload];
|
|
180
|
-
"message.receive": [import('./message.js').Message];
|
|
181
|
-
"endpoint.login.pending": [import('./built/login-assist.js').PendingLoginTask];
|
|
182
|
-
"endpoint.login.expired": [import('./built/login-assist.js').PendingLoginTask];
|
|
183
|
-
'endpoint.connect': [import('./built/endpoint-lifecycle.js').EndpointLifecyclePayload];
|
|
184
|
-
'endpoint.disconnect': [import('./built/endpoint-lifecycle.js').EndpointLifecyclePayload];
|
|
185
|
-
'endpoint.error': [import('./built/endpoint-lifecycle.js').EndpointLifecyclePayload];
|
|
186
|
-
"request.receive": [import('./request.js').Request];
|
|
187
|
-
"notice.receive": [import('./notice.js').Notice];
|
|
188
|
-
"system.receive": [import('./system-event.js').SystemEvent];
|
|
189
|
-
"ai.processing.start": [Plugin.AIEventPayload];
|
|
190
|
-
"ai.processing.finish": [Plugin.AIEventPayload];
|
|
191
|
-
"ai.processing.error": [Plugin.AIEventPayload];
|
|
192
|
-
"ai.agent.start": [Plugin.AIEventPayload];
|
|
193
|
-
"ai.agent.finish": [Plugin.AIEventPayload];
|
|
194
|
-
"ai.thinking": [Plugin.AIEventPayload];
|
|
195
|
-
"ai.tool.call": [Plugin.AIEventPayload];
|
|
196
|
-
"ai.tool.result": [Plugin.AIEventPayload];
|
|
197
|
-
"ai.response": [Plugin.AIEventPayload];
|
|
198
|
-
"ai.typing.start": [Plugin.AIEventPayload];
|
|
199
|
-
"ai.typing.stop": [Plugin.AIEventPayload];
|
|
200
|
-
"ai.activity.queued.start": [Plugin.AIEventPayload];
|
|
201
|
-
"ai.activity.queued.clear": [Plugin.AIEventPayload];
|
|
202
|
-
"ai.subagent.spawn": [Plugin.AIEventPayload];
|
|
203
|
-
"ai.subagent.start": [Plugin.AIEventPayload];
|
|
204
|
-
"ai.subagent.finish": [Plugin.AIEventPayload];
|
|
205
|
-
"ai.deferred.start": [Plugin.AIEventPayload];
|
|
206
|
-
"ai.deferred.finish": [Plugin.AIEventPayload];
|
|
207
|
-
"ai.mcp.connect.start": [Plugin.AIEventPayload];
|
|
208
|
-
"ai.mcp.connect.finish": [Plugin.AIEventPayload];
|
|
209
|
-
"ai.mcp.connect.error": [Plugin.AIEventPayload];
|
|
210
|
-
"ai.session.new": [Plugin.AIEventPayload];
|
|
211
|
-
"ai.session.compact": [Plugin.AIEventPayload];
|
|
212
|
-
"ai.hook": [Plugin.AIEventPayload];
|
|
213
|
-
"schedule.start": [Plugin.AIEventPayload];
|
|
214
|
-
"schedule.finish": [Plugin.AIEventPayload];
|
|
215
|
-
"schedule.error": [Plugin.AIEventPayload];
|
|
216
|
-
}
|
|
217
|
-
interface AIEventPayload {
|
|
218
|
-
sessionId: string;
|
|
219
|
-
source: 'zhin-agent' | 'subagent' | 'ai-hook' | 'orchestrator-hook';
|
|
220
|
-
mode?: 'text' | 'multimodal';
|
|
221
|
-
path?: 'chat' | 'fast' | 'agent' | 'multimodal' | 'rate_limited';
|
|
222
|
-
userId?: string;
|
|
223
|
-
platform?: string;
|
|
224
|
-
endpointKey?: string;
|
|
225
|
-
sceneId?: string;
|
|
226
|
-
messageId?: string;
|
|
227
|
-
scope?: string;
|
|
228
|
-
content?: string;
|
|
229
|
-
reply?: string;
|
|
230
|
-
thinking?: string;
|
|
231
|
-
toolName?: string;
|
|
232
|
-
args?: Record<string, unknown>;
|
|
233
|
-
result?: unknown;
|
|
234
|
-
error?: string;
|
|
235
|
-
model?: string;
|
|
236
|
-
iterations?: number;
|
|
237
|
-
reason?: string;
|
|
238
|
-
taskId?: string;
|
|
239
|
-
label?: string;
|
|
240
|
-
status?: 'ok' | 'partial' | 'error';
|
|
241
|
-
serverName?: string;
|
|
242
|
-
loadedToolNames?: string[];
|
|
243
|
-
hookType?: string;
|
|
244
|
-
hookAction?: string;
|
|
245
|
-
hookContext?: Record<string, unknown>;
|
|
246
|
-
messages?: string[];
|
|
247
|
-
agentId?: string;
|
|
248
|
-
compactedCount?: number;
|
|
249
|
-
savedTokens?: number;
|
|
250
|
-
totalTokensBefore?: number;
|
|
251
|
-
totalTokensAfter?: number;
|
|
252
|
-
/** 为 true 时 processing.finish 不撤回 typing(route 子 agent → 主 agent 摘要续接) */
|
|
253
|
-
keepTyping?: boolean;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* 服务类型扩展点
|
|
257
|
-
* 各个 Context 通过 declare module 扩展此接口
|
|
258
|
-
*/
|
|
259
|
-
interface Contexts extends Adapters {
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Service 扩展方法类型
|
|
263
|
-
* 这些方法由各个 Context 的 extensions 提供
|
|
264
|
-
* 在 Plugin.start() 时自动注册到 Plugin.prototype
|
|
265
|
-
*/
|
|
266
|
-
interface Extensions {
|
|
267
|
-
}
|
|
268
|
-
}
|