clickgo 6.10.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 +8 -3
- package/dist/app/demo.cga +0 -0
- package/dist/app/task.cga +0 -0
- package/dist/clickgo.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/lib/command/guide.d.ts +7 -0
- package/dist/lib/command.d.ts +57 -4
- package/dist/lib/core.d.ts +8 -1
- package/dist/lib/form.d.ts +7 -0
- package/dist/lib/native.d.ts +17 -0
- package/doc/clickgo-rag.md +2375 -1840
- package/package.json +2 -3
package/dist/lib/command.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as lCore from './core';
|
|
2
|
+
import * as lNative from './native';
|
|
2
3
|
export { showPalette } from './command/palette';
|
|
3
4
|
/** --- 命令输入与输出可跨浏览器、Native 和协议传输的 JSON 值 --- */
|
|
4
5
|
export type TJson = null | boolean | number | string | TJson[] | {
|
|
@@ -106,6 +107,8 @@ export interface IBridge {
|
|
|
106
107
|
}
|
|
107
108
|
/** --- 框架向网页发布的统一入口;按任务选择应用,只访问明确公开的命令 --- */
|
|
108
109
|
export interface IPageBridge {
|
|
110
|
+
'getAgentInfo': (taskId?: string) => Promise<IAgentInfo | null | false>;
|
|
111
|
+
'getAgentGuide': (taskId?: string) => Promise<string | null | false>;
|
|
109
112
|
'listTasks': () => Array<{
|
|
110
113
|
'id': string;
|
|
111
114
|
'name': string;
|
|
@@ -115,6 +118,42 @@ export interface IPageBridge {
|
|
|
115
118
|
'signal'?: AbortSignal;
|
|
116
119
|
}) => Promise<TResult>;
|
|
117
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;
|
|
118
157
|
/**
|
|
119
158
|
* --- 构造成功结果 ---
|
|
120
159
|
* @param data 可跨入口传输的 JSON 数据
|
|
@@ -171,6 +210,20 @@ export declare function listTasks(): Array<{
|
|
|
171
210
|
'id': string;
|
|
172
211
|
'name': string;
|
|
173
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>;
|
|
174
227
|
/**
|
|
175
228
|
* --- 应用界面直接执行已注册的业务命令 ---
|
|
176
229
|
* @param current 所属任务/Form
|
|
@@ -205,13 +258,13 @@ export declare function createBridge(current: lCore.TCurrent): IBridge;
|
|
|
205
258
|
*/
|
|
206
259
|
export declare function createPageBridge(): IPageBridge;
|
|
207
260
|
/**
|
|
208
|
-
* ---
|
|
261
|
+
* --- 显式重同步或重试当前 App 的工具发布;页面接入由框架自动管理 ---
|
|
209
262
|
* @param current 所属应用
|
|
210
|
-
* @returns
|
|
263
|
+
* @returns 是否同步成功;浏览器不支持、App 已退出或注册失败时返回 false
|
|
211
264
|
*/
|
|
212
265
|
export declare function connectWebMcp(current: lCore.TCurrent): Promise<boolean>;
|
|
213
266
|
/**
|
|
214
|
-
* ---
|
|
267
|
+
* --- 撤销当前 App 的 WebMCP 工具;不改变页面级接入状态,下次公开命令注册时自动发布 ---
|
|
215
268
|
* @param current 所属应用
|
|
216
269
|
* @returns 无返回值
|
|
217
270
|
*/
|
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
|
@@ -10,6 +10,23 @@ export interface IMcpInfo {
|
|
|
10
10
|
'url': string;
|
|
11
11
|
'token': string;
|
|
12
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>;
|
|
13
30
|
/**
|
|
14
31
|
* --- 读取 Native 主进程启用的 MCP 连接设置 ---
|
|
15
32
|
* @param current 当前 App
|