clickgo 6.9.0 → 6.11.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/AGENTS.md +21 -0
- package/README.md +4 -0
- package/dist/app/demo.cga +0 -0
- package/dist/app/task.cga +0 -0
- package/dist/clickgo.d.ts +8 -1
- package/dist/index.js +1 -1
- package/dist/lib/command/guide.d.ts +7 -0
- package/dist/lib/command/native.d.ts +18 -0
- package/dist/lib/command/palette.d.ts +10 -0
- package/dist/lib/command/schema.d.ts +31 -0
- package/dist/lib/command.d.ts +271 -0
- package/dist/lib/core.d.ts +8 -1
- package/dist/lib/form.d.ts +7 -0
- package/dist/lib/native.d.ts +29 -0
- package/dist/lib/task.d.ts +2 -0
- package/doc/clickgo-rag.md +4637 -2263
- package/package.json +8 -3
- package/test/core-module-loading.mjs +0 -169
- package/test/desktop.mjs +0 -715
- package/test/dock-lifecycle.mjs +0 -280
- package/test/dom-style.mjs +0 -261
- package/test/form-launcher.mjs +0 -177
- package/test/form-modal-layer.mjs +0 -75
- package/test/form-native-regions.mjs +0 -115
- package/test/form-native-style.mjs +0 -80
- package/test/form-native.mjs +0 -68
- package/test/form-notify-animation.mjs +0 -102
- package/test/form-notify.mjs +0 -90
- package/test/form-viewport.mjs +0 -127
- package/test/iconview.mjs +0 -70
- package/test/jodit-lifecycle.mjs +0 -212
- package/test/locale-integrity.mjs +0 -189
- package/test/pop-max-size.mjs +0 -66
- package/test/rtl-archive.mjs +0 -440
- package/test/rtl-direction.mjs +0 -193
- package/test/scroll.mjs +0 -145
- package/test/select.mjs +0 -885
- package/test/sidebar-toggle.mjs +0 -75
- package/test/task-package-loading.mjs +0 -94
- package/test/task-start.mjs +0 -141
- package/test/task-tray.mjs +0 -331
- package/test/tool-assets.mjs +0 -64
- package/test/tool-clone.mjs +0 -42
- package/test/toolbox.mjs +0 -88
- package/test/tuieditor-locale.mjs +0 -175
- package/test/vflow.mjs +0 -122
- package/test/web-drag-mask.mjs +0 -96
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as lCommand from '../command';
|
|
2
|
+
/** --- 主进程只发送这四种操作,不接受任意代码或函数名 --- */
|
|
3
|
+
export interface IRequest {
|
|
4
|
+
'method': 'listTasks' | 'list' | 'execute' | 'cancel';
|
|
5
|
+
'id': string;
|
|
6
|
+
'taskId'?: string;
|
|
7
|
+
'name'?: string;
|
|
8
|
+
'args'?: Record<string, lCommand.TJson>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* --- 接收 Native MCP 请求,按目标 taskId 直接读取或执行公开命令 ---
|
|
12
|
+
* @param request 主进程发来的操作
|
|
13
|
+
* @returns 共享命令结果或发现列表
|
|
14
|
+
*/
|
|
15
|
+
export declare function invoke(request: IRequest): Promise<lCommand.TResult | {
|
|
16
|
+
'ok': true;
|
|
17
|
+
'data': lCommand.IInfo[] | ReturnType<typeof lCommand.listTasks>;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as lForm from '../form';
|
|
2
|
+
/**
|
|
3
|
+
* --- 打开原生命令调试面板,也可作为界面操作型代理的可选入口 ---
|
|
4
|
+
* @param current 发起操作的 Form,创建阶段使用其原生 Loading
|
|
5
|
+
* @param options 是否只显示应用允许代理调用的命令,默认显示全部内部命令
|
|
6
|
+
* @returns 面板关闭后完成;所属实例失效或正在创建时直接返回
|
|
7
|
+
*/
|
|
8
|
+
export declare function showPalette(current: lForm.AbstractForm, options?: {
|
|
9
|
+
'exposedOnly'?: boolean;
|
|
10
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ISchema, TJson } from '../command';
|
|
2
|
+
/**
|
|
3
|
+
* --- 检查可序列化值,拒绝循环、非有限数和类实例;限制嵌套深度 ---
|
|
4
|
+
* @param value 待检查值
|
|
5
|
+
* @param seen 当前路径上的对象
|
|
6
|
+
* @param depth 当前深度
|
|
7
|
+
* @returns 是否为合法 JSON
|
|
8
|
+
*/
|
|
9
|
+
export declare function isJson(value: unknown, seen?: Set<object>, depth?: number): value is TJson;
|
|
10
|
+
/**
|
|
11
|
+
* --- 注册时检查 schema,错误约束不能静默放行 ---
|
|
12
|
+
* @param schema 当前 schema
|
|
13
|
+
* @param root 根 schema
|
|
14
|
+
* @param seen 已检查的节点
|
|
15
|
+
* @returns 错误说明,合法时返回 null
|
|
16
|
+
*/
|
|
17
|
+
export declare function check(schema: ISchema | boolean, root?: ISchema, seen?: Set<ISchema>): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* --- 校验数据,不转换类型、不补默认值、不删除额外参数 ---
|
|
20
|
+
* @param value 待校验数据
|
|
21
|
+
* @param schema 当前 schema
|
|
22
|
+
* @param root 根 schema
|
|
23
|
+
* @param path 错误字段路径
|
|
24
|
+
* @param depth 递归深度
|
|
25
|
+
* @param ancestors 当前校验路径上的 schema,防止不推进数据的循环引用
|
|
26
|
+
* @returns 错误说明,匹配时返回 null
|
|
27
|
+
*/
|
|
28
|
+
export declare function validate(value: TJson, schema: ISchema | boolean, root?: ISchema, path?: string, depth?: number, ancestors?: Array<{
|
|
29
|
+
'schema': ISchema;
|
|
30
|
+
'path': string;
|
|
31
|
+
}>): string | null;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import * as lCore from './core';
|
|
2
|
+
import * as lNative from './native';
|
|
3
|
+
export { showPalette } from './command/palette';
|
|
4
|
+
/** --- 命令输入与输出可跨浏览器、Native 和协议传输的 JSON 值 --- */
|
|
5
|
+
export type TJson = null | boolean | number | string | TJson[] | {
|
|
6
|
+
[key: string]: TJson;
|
|
7
|
+
};
|
|
8
|
+
/** --- JSON Schema 2020-12 的命令校验子集;不支持的关键字在注册时拒绝 --- */
|
|
9
|
+
export interface ISchema {
|
|
10
|
+
'$schema'?: string;
|
|
11
|
+
'$ref'?: string;
|
|
12
|
+
'$defs'?: Record<string, ISchema | boolean>;
|
|
13
|
+
'title'?: string;
|
|
14
|
+
'description'?: string;
|
|
15
|
+
'default'?: TJson;
|
|
16
|
+
'examples'?: TJson[];
|
|
17
|
+
'type'?: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
|
|
18
|
+
'properties'?: Record<string, ISchema | boolean>;
|
|
19
|
+
'required'?: string[];
|
|
20
|
+
'additionalProperties'?: ISchema | boolean;
|
|
21
|
+
'items'?: ISchema | boolean;
|
|
22
|
+
'minItems'?: number;
|
|
23
|
+
'maxItems'?: number;
|
|
24
|
+
'uniqueItems'?: boolean;
|
|
25
|
+
'minLength'?: number;
|
|
26
|
+
'maxLength'?: number;
|
|
27
|
+
'pattern'?: string;
|
|
28
|
+
'minimum'?: number;
|
|
29
|
+
'maximum'?: number;
|
|
30
|
+
'exclusiveMinimum'?: number;
|
|
31
|
+
'exclusiveMaximum'?: number;
|
|
32
|
+
'enum'?: TJson[];
|
|
33
|
+
'const'?: TJson;
|
|
34
|
+
'allOf'?: Array<ISchema | boolean>;
|
|
35
|
+
'anyOf'?: Array<ISchema | boolean>;
|
|
36
|
+
'oneOf'?: Array<ISchema | boolean>;
|
|
37
|
+
'not'?: ISchema | boolean;
|
|
38
|
+
}
|
|
39
|
+
/** --- 所有入口共用的结果;错误码用于程序判断,message 用于说明 --- */
|
|
40
|
+
export type TResult<T extends TJson = TJson> = {
|
|
41
|
+
'ok': true;
|
|
42
|
+
'data': T;
|
|
43
|
+
} | {
|
|
44
|
+
'ok': false;
|
|
45
|
+
'error': {
|
|
46
|
+
'code': string;
|
|
47
|
+
'message': string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
/** --- 执行来源仅用于展示与记录,不是授权凭证 --- */
|
|
51
|
+
export interface IContext {
|
|
52
|
+
'taskId': string;
|
|
53
|
+
'formId': string;
|
|
54
|
+
'panelId': string;
|
|
55
|
+
'source': 'user' | 'agent';
|
|
56
|
+
'signal': AbortSignal;
|
|
57
|
+
}
|
|
58
|
+
/** --- 与 MCP 工具描述对齐的公开命令元数据 --- */
|
|
59
|
+
export interface IMetadata {
|
|
60
|
+
'name': string;
|
|
61
|
+
'title'?: string;
|
|
62
|
+
'description': string;
|
|
63
|
+
'inputSchema': ISchema & {
|
|
64
|
+
'type': 'object';
|
|
65
|
+
};
|
|
66
|
+
'outputSchema'?: ISchema;
|
|
67
|
+
/** --- 行为说明,不代替校验或授权 --- */
|
|
68
|
+
'annotations'?: {
|
|
69
|
+
'readOnlyHint'?: boolean;
|
|
70
|
+
'destructiveHint'?: boolean;
|
|
71
|
+
'idempotentHint'?: boolean;
|
|
72
|
+
'openWorldHint'?: boolean;
|
|
73
|
+
/** --- WebMCP 的重要或不可逆现实效果说明 --- */
|
|
74
|
+
'consequentialHint'?: boolean;
|
|
75
|
+
'untrustedContentHint'?: boolean;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** --- 应用声明一次,界面、浏览器代理和 Native 适配器共享执行函数 --- */
|
|
79
|
+
export interface IDefinition<T extends Record<string, TJson> = Record<string, TJson>> extends IMetadata {
|
|
80
|
+
/** --- 明确允许代理发现并调用;默认只允许应用内部调用 --- */
|
|
81
|
+
'exposed'?: boolean;
|
|
82
|
+
/** --- 默认拒绝同一命令并发;业务确认可并行时才开启 --- */
|
|
83
|
+
'concurrent'?: boolean;
|
|
84
|
+
/** --- 必须已经取得的框架权限;执行入口不弹授权窗 --- */
|
|
85
|
+
'permissions'?: string[];
|
|
86
|
+
/** --- true 为可用,false 或原因文本为不可用;每次执行重新检查 --- */
|
|
87
|
+
'enabled'?: () => boolean | string;
|
|
88
|
+
'execute': (args: T, context: IContext) => TResult | Promise<TResult>;
|
|
89
|
+
}
|
|
90
|
+
/** --- 不包含函数或内部对象的独立快照 --- */
|
|
91
|
+
export interface IInfo extends IMetadata {
|
|
92
|
+
'taskId': string;
|
|
93
|
+
'formId': string;
|
|
94
|
+
'panelId': string;
|
|
95
|
+
'exposed': boolean;
|
|
96
|
+
'enabled': boolean;
|
|
97
|
+
'disabledReason': string;
|
|
98
|
+
'running': number;
|
|
99
|
+
}
|
|
100
|
+
/** --- 绑定一个应用实例,只能调用该实例明确公开的命令 --- */
|
|
101
|
+
export interface IBridge {
|
|
102
|
+
'taskId': string;
|
|
103
|
+
'list': () => IInfo[];
|
|
104
|
+
'execute': (name: string, args?: Record<string, TJson>, options?: {
|
|
105
|
+
'signal'?: AbortSignal;
|
|
106
|
+
}) => Promise<TResult>;
|
|
107
|
+
}
|
|
108
|
+
/** --- 框架向网页发布的统一入口;按任务选择应用,只访问明确公开的命令 --- */
|
|
109
|
+
export interface IPageBridge {
|
|
110
|
+
'getAgentInfo': (taskId?: string) => Promise<IAgentInfo | null | false>;
|
|
111
|
+
'getAgentGuide': (taskId?: string) => Promise<string | null | false>;
|
|
112
|
+
'listTasks': () => Array<{
|
|
113
|
+
'id': string;
|
|
114
|
+
'name': string;
|
|
115
|
+
}>;
|
|
116
|
+
'list': (taskId: string) => IInfo[];
|
|
117
|
+
'execute': (taskId: string, name: string, args?: Record<string, TJson>, options?: {
|
|
118
|
+
'signal'?: AbortSignal;
|
|
119
|
+
}) => Promise<TResult>;
|
|
120
|
+
}
|
|
121
|
+
/** --- 统一接入说明的生成选项;默认不读取或包含 HTTP 凭据 --- */
|
|
122
|
+
export interface IAgentOptions {
|
|
123
|
+
/** --- 仅供应用主动导出 HTTP 连接设置,仍要求当前 App 已有 root 权限 --- */
|
|
124
|
+
'includeMcpCredentials'?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/** --- 页面级 WebMCP 接入状态;ready 表示浏览器接口可用,不表示某个 App 的工具已发布 --- */
|
|
127
|
+
export type TWebMcpStatus = 'unsupported' | 'ready';
|
|
128
|
+
/** --- 工具发布诊断状态,不参与页面级接入事件 --- */
|
|
129
|
+
export type TWebMcpRegistrationStatus = 'idle' | 'registering' | 'ready' | 'failed';
|
|
130
|
+
/** --- 可展示或导出的接入信息;命令列表始终从对应入口实时查询 --- */
|
|
131
|
+
export interface IAgentInfo {
|
|
132
|
+
'schemaVersion': 1;
|
|
133
|
+
'apps': ReturnType<typeof listTasks>;
|
|
134
|
+
'targetTaskId': string | null;
|
|
135
|
+
'browser': {
|
|
136
|
+
'url': string | null;
|
|
137
|
+
'api': string;
|
|
138
|
+
};
|
|
139
|
+
'webMcp': {
|
|
140
|
+
'supported': boolean;
|
|
141
|
+
/** --- 全页面共用的浏览器接入状态,不受目标 App 或工具数量影响 --- */
|
|
142
|
+
'status': TWebMcpStatus;
|
|
143
|
+
/** --- 所选 App 的发布诊断;多个 App 时优先报告失败及进行中的注册,不支持时为 null --- */
|
|
144
|
+
'registrationStatus': TWebMcpRegistrationStatus | null;
|
|
145
|
+
/** --- 已完成工具发布的 App,不表示这些 App 分别建立了浏览器连接 --- */
|
|
146
|
+
'publishedTaskIds': string[];
|
|
147
|
+
};
|
|
148
|
+
'native': lNative.ICommandEntry | null;
|
|
149
|
+
/** --- 只有显式导出且通过 root 检查时才包含 HTTP 凭据 --- */
|
|
150
|
+
'http': lNative.IMcpInfo | null;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* --- 初始化页面级 WebMCP 接入状态,由框架在执行 Boot.main 前自动调用 ---
|
|
154
|
+
* @returns 无返回值
|
|
155
|
+
*/
|
|
156
|
+
export declare function init(): void;
|
|
157
|
+
/**
|
|
158
|
+
* --- 构造成功结果 ---
|
|
159
|
+
* @param data 可跨入口传输的 JSON 数据
|
|
160
|
+
* @returns 成功结果
|
|
161
|
+
*/
|
|
162
|
+
export declare function success<T extends TJson>(data: T): TResult<T>;
|
|
163
|
+
/**
|
|
164
|
+
* --- 构造业务失败结果,不抛异常 ---
|
|
165
|
+
* @param code 稳定的业务错误码
|
|
166
|
+
* @param message 可公开的错误说明
|
|
167
|
+
* @returns 失败结果
|
|
168
|
+
*/
|
|
169
|
+
export declare function failure(code: string, message: string): TResult<never>;
|
|
170
|
+
/**
|
|
171
|
+
* --- 注册命令;重复名称、不支持的 schema 或已销毁的实例返回 false ---
|
|
172
|
+
* @param current 所属任务/Form/Panel;销毁时自动移除其命令
|
|
173
|
+
* @param definition 元数据、可用条件与唯一业务执行函数
|
|
174
|
+
* @returns 是否注册成功
|
|
175
|
+
*/
|
|
176
|
+
export declare function register<T extends Record<string, TJson>>(current: lCore.TCurrent, definition: IDefinition<T>): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* --- 取消尚在执行的命令并解除注册;取消是协作式,不回滚已产生的业务效果 ---
|
|
179
|
+
* @param current 所属任务/Form/Panel
|
|
180
|
+
* @param name 命令名称
|
|
181
|
+
* @returns 是否找到并移除命令
|
|
182
|
+
*/
|
|
183
|
+
export declare function unregister(current: lCore.TCurrent, name: string): boolean;
|
|
184
|
+
/**
|
|
185
|
+
* --- 清理所属 Panel、Form 或整个任务的命令 ---
|
|
186
|
+
* @param current 所属任务/Form/Panel
|
|
187
|
+
* @returns 无返回值
|
|
188
|
+
*/
|
|
189
|
+
export declare function clear(current: lCore.TCurrent): void;
|
|
190
|
+
/**
|
|
191
|
+
* --- 框架生命周期使用的按所属范围清理入口 ---
|
|
192
|
+
* @internal
|
|
193
|
+
* @param taskId 所属任务
|
|
194
|
+
* @param formId 所属 Form,不传时清理任务
|
|
195
|
+
* @param panelId 所属 Panel,不传时清理整个 Form
|
|
196
|
+
* @returns 无返回值
|
|
197
|
+
*/
|
|
198
|
+
export declare function clearOwner(taskId: string, formId?: string, panelId?: string): void;
|
|
199
|
+
/**
|
|
200
|
+
* --- 获取独立元数据和当前状态,不导出业务函数 ---
|
|
201
|
+
* @param current 所属应用
|
|
202
|
+
* @returns 命令列表
|
|
203
|
+
*/
|
|
204
|
+
export declare function list(current: lCore.TCurrent): IInfo[];
|
|
205
|
+
/**
|
|
206
|
+
* --- 获取仍可调用的 App 标识与名称,供网页及 Native 代理发现目标 ---
|
|
207
|
+
* @returns 未开始退出的 App 列表
|
|
208
|
+
*/
|
|
209
|
+
export declare function listTasks(): Array<{
|
|
210
|
+
'id': string;
|
|
211
|
+
'name': string;
|
|
212
|
+
}>;
|
|
213
|
+
/**
|
|
214
|
+
* --- 获取当前环境的统一接入信息,不另行维护命令清单或启用服务 ---
|
|
215
|
+
* @param current 限定目标 App;省略时由代理发现并选择 App
|
|
216
|
+
* @param options 是否主动导出 HTTP 连接凭据,默认不包含
|
|
217
|
+
* @returns 独立信息;目标已退出为 null,无权限导出凭据为 false
|
|
218
|
+
*/
|
|
219
|
+
export declare function getAgentInfo(current?: lCore.TCurrent, options?: IAgentOptions): Promise<IAgentInfo | null | false>;
|
|
220
|
+
/**
|
|
221
|
+
* --- 生成简短英文接入说明,不嵌入临时 App ID;代理通过接口实时发现 ---
|
|
222
|
+
* @param current 校验当前 App 生命周期与凭据导出权限;省略时生成页面通用说明
|
|
223
|
+
* @param options 是否主动导出 HTTP 连接凭据,默认不包含
|
|
224
|
+
* @returns Markdown 说明;目标已退出为 null,无权限导出凭据为 false
|
|
225
|
+
*/
|
|
226
|
+
export declare function getAgentGuide(current?: lCore.TCurrent, options?: IAgentOptions): Promise<string | null | false>;
|
|
227
|
+
/**
|
|
228
|
+
* --- 应用界面直接执行已注册的业务命令 ---
|
|
229
|
+
* @param current 所属任务/Form
|
|
230
|
+
* @param name 命令名称
|
|
231
|
+
* @param args 参数,默认空对象
|
|
232
|
+
* @param options 取消信号
|
|
233
|
+
* @returns 业务结果
|
|
234
|
+
*/
|
|
235
|
+
export declare function execute(current: lCore.TCurrent, name: string, args?: Record<string, TJson>, options?: {
|
|
236
|
+
'signal'?: AbortSignal;
|
|
237
|
+
}): Promise<TResult>;
|
|
238
|
+
/**
|
|
239
|
+
* --- 代理直接按 taskId 执行公开命令,与界面共用校验和业务执行器 ---
|
|
240
|
+
* @param taskId 目标 App
|
|
241
|
+
* @param name 命令名称
|
|
242
|
+
* @param args 参数,默认空对象
|
|
243
|
+
* @param options 取消信号
|
|
244
|
+
* @returns 结构化结果;未公开或不存在的命令返回 not-found
|
|
245
|
+
*/
|
|
246
|
+
export declare function executeAgent(taskId: string, name: string, args?: Record<string, TJson>, options?: {
|
|
247
|
+
'signal'?: AbortSignal;
|
|
248
|
+
}): Promise<TResult>;
|
|
249
|
+
/**
|
|
250
|
+
* --- 创建绑定单个 App 的可复用代理接口,调用方无需反复传入 taskId ---
|
|
251
|
+
* @param current 所属应用
|
|
252
|
+
* @returns 不可修改的桥接接口
|
|
253
|
+
*/
|
|
254
|
+
export declare function createBridge(current: lCore.TCurrent): IBridge;
|
|
255
|
+
/**
|
|
256
|
+
* --- 网页入口直接读取框架的任务及命令状态,无需应用或宿主重复发布与清理 ---
|
|
257
|
+
* @returns 不可修改的网页命令接口
|
|
258
|
+
*/
|
|
259
|
+
export declare function createPageBridge(): IPageBridge;
|
|
260
|
+
/**
|
|
261
|
+
* --- 显式重同步或重试当前 App 的工具发布;页面接入由框架自动管理 ---
|
|
262
|
+
* @param current 所属应用
|
|
263
|
+
* @returns 是否同步成功;浏览器不支持、App 已退出或注册失败时返回 false
|
|
264
|
+
*/
|
|
265
|
+
export declare function connectWebMcp(current: lCore.TCurrent): Promise<boolean>;
|
|
266
|
+
/**
|
|
267
|
+
* --- 撤销当前 App 的 WebMCP 工具;不改变页面级接入状态,下次公开命令注册时自动发布 ---
|
|
268
|
+
* @param current 所属应用
|
|
269
|
+
* @returns 无返回值
|
|
270
|
+
*/
|
|
271
|
+
export declare function disconnectWebMcp(current: lCore.TCurrent): void;
|
package/dist/lib/core.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import * as mpegts from 'mpegts.js';
|
|
|
18
18
|
import * as clickgo from '../clickgo';
|
|
19
19
|
import * as lForm from './form';
|
|
20
20
|
import * as lControl from './control';
|
|
21
|
+
import type * as lCommand from './command';
|
|
21
22
|
import * as lCore from './core';
|
|
22
23
|
/**
|
|
23
24
|
* --- 初始化系统级 ID,仅能设置一次 ---
|
|
@@ -107,6 +108,12 @@ export declare abstract class AbstractApp {
|
|
|
107
108
|
onTaskStarted(taskId: string): void | Promise<void>;
|
|
108
109
|
/** --- 任务结束事件 --- */
|
|
109
110
|
onTaskEnded(taskId: string): void | Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* --- 页面级 WebMCP 接入状态变化,所有 App 共用同一状态 ---
|
|
113
|
+
* @param status 浏览器接入状态,与 command.getAgentInfo 的 webMcp.status 一致
|
|
114
|
+
* @returns 无返回值
|
|
115
|
+
*/
|
|
116
|
+
onWebMcpStatusChanged(status: lCommand.TWebMcpStatus): void | Promise<void>;
|
|
110
117
|
/**
|
|
111
118
|
* --- Launcher 显示状态改变事件 ---
|
|
112
119
|
* @param state 是否显示
|
|
@@ -244,7 +251,7 @@ export interface IAvailArea {
|
|
|
244
251
|
'oheight': number;
|
|
245
252
|
}
|
|
246
253
|
/** --- 全局事件类型 --- */
|
|
247
|
-
export type TGlobalEvent = 'trayCreated' | 'trayChanged' | 'trayRemoved' | 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'formShowInSystemTaskChange' | 'formHashChange' | 'taskStarted' | 'taskEnded' | 'launcherShowChanged' | 'launcherFolderNameChanged' | 'hashChanged' | 'keydown' | 'keyup';
|
|
254
|
+
export type TGlobalEvent = 'trayCreated' | 'trayChanged' | 'trayRemoved' | 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'formShowInSystemTaskChange' | 'formHashChange' | 'taskStarted' | 'taskEnded' | 'webMcpStatusChanged' | 'launcherShowChanged' | 'launcherFolderNameChanged' | 'hashChanged' | 'keydown' | 'keyup';
|
|
248
255
|
/** --- 现场下载 app 的参数 --- */
|
|
249
256
|
export interface ICoreFetchAppOptions {
|
|
250
257
|
'notify'?: number | {
|
package/dist/lib/form.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as lCore from './core';
|
|
2
|
+
import * as lCommand from './command';
|
|
2
3
|
import * as lDom from './dom';
|
|
3
4
|
import * as lControl from './control';
|
|
4
5
|
/**
|
|
@@ -324,6 +325,12 @@ export declare abstract class AbstractForm extends AbstractCommon {
|
|
|
324
325
|
onTaskStarted(taskId: string): void | Promise<void>;
|
|
325
326
|
/** --- 任务结束事件 --- */
|
|
326
327
|
onTaskEnded(taskId: string): void | Promise<void>;
|
|
328
|
+
/**
|
|
329
|
+
* --- 页面级 WebMCP 接入状态变化,所有 Form 共用同一状态 ---
|
|
330
|
+
* @param status 浏览器接入状态,与 command.getAgentInfo 的 webMcp.status 一致
|
|
331
|
+
* @returns 无返回值
|
|
332
|
+
*/
|
|
333
|
+
onWebMcpStatusChanged(status: lCommand.TWebMcpStatus): void | Promise<void>;
|
|
327
334
|
/**
|
|
328
335
|
* --- Launcher 显示状态改变事件 ---
|
|
329
336
|
* @param state 是否显示
|
package/dist/lib/native.d.ts
CHANGED
|
@@ -4,6 +4,35 @@ import * as lCore from './core';
|
|
|
4
4
|
* @param id 系统级 ID
|
|
5
5
|
*/
|
|
6
6
|
export declare function initSysId(id: string): void;
|
|
7
|
+
/** --- 本地 MCP 客户端连接设置;仅向已授权 root 的 App 提供 --- */
|
|
8
|
+
export interface IMcpInfo {
|
|
9
|
+
'transport': 'streamable-http';
|
|
10
|
+
'url': string;
|
|
11
|
+
'token': string;
|
|
12
|
+
}
|
|
13
|
+
/** --- 当前 Native 的公开进程入口,不包含 HTTP 连接凭据 --- */
|
|
14
|
+
export interface ICommandEntry {
|
|
15
|
+
'name': string;
|
|
16
|
+
'platform': string;
|
|
17
|
+
'command': string;
|
|
18
|
+
'args': string[];
|
|
19
|
+
'startup': 'existing' | 'auto';
|
|
20
|
+
'mcp': {
|
|
21
|
+
'enabled': boolean;
|
|
22
|
+
'discovery': boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* --- 取得软件自身的 CLI/stdio 入口和启动要求,无需读取连接凭据 ---
|
|
27
|
+
* @returns 公开入口信息;普通网页或尚未支持此接口的宿主为 null
|
|
28
|
+
*/
|
|
29
|
+
export declare function getCommandEntry(): Promise<ICommandEntry | null>;
|
|
30
|
+
/**
|
|
31
|
+
* --- 读取 Native 主进程启用的 MCP 连接设置 ---
|
|
32
|
+
* @param current 当前 App
|
|
33
|
+
* @returns 连接设置;未启用为 null,无权限为 false
|
|
34
|
+
*/
|
|
35
|
+
export declare function getMcpInfo(current: lCore.TCurrent): Promise<IMcpInfo | null | false>;
|
|
7
36
|
/**
|
|
8
37
|
* --- 监听 native 传输过来的事件 ---
|
|
9
38
|
* @param current 当前任务 ID
|
package/dist/lib/task.d.ts
CHANGED