clickgo 7.3.1 → 7.4.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.
@@ -0,0 +1,87 @@
1
+ /** --- 文件读取命令由框架保留,网页、WebMCP 和 Native 使用相同入口 --- */
2
+ export declare const READ_COMMAND = "clickgo.file.read";
3
+ /** --- 默认及最大分段大小,单位为原始字节 --- */
4
+ export declare const DEFAULT_CHUNK_BYTES = 49152;
5
+ export declare const MAX_CHUNK_BYTES = 393216;
6
+ /** --- 命令执行范围;文件随所属 Panel、Form 或 App 销毁 --- */
7
+ export interface IOwner {
8
+ 'taskId': string;
9
+ 'formId': string;
10
+ 'panelId': string;
11
+ }
12
+ /** --- 发布的是已生成 Blob,不读取路径、不上传或重新生成文件 --- */
13
+ export interface IFileOptions {
14
+ 'fileName': string;
15
+ /** --- 默认使用 Blob.type;为空时使用 application/octet-stream --- */
16
+ 'mimeType'?: string;
17
+ }
18
+ /** --- 文件快照元数据;时间为 Unix 毫秒,URI 仅在所属页面生命周期内有效 --- */
19
+ export interface IFileInfo {
20
+ 'fileId': string;
21
+ 'fileName': string;
22
+ 'mimeType': string;
23
+ 'byteLength': number;
24
+ 'createdAt': number;
25
+ 'expiresAt': number;
26
+ 'uri': string;
27
+ 'readCommand': string;
28
+ 'readChunkSize': number;
29
+ }
30
+ /** --- offset/length 使用原始字节;逐段解码 Base64,nextOffset 为 null 时结束 --- */
31
+ export interface IFileReadOptions {
32
+ 'offset'?: number;
33
+ 'length'?: number;
34
+ 'signal'?: AbortSignal;
35
+ }
36
+ /** --- 每段携带同一份快照信息,便于客户端校验文件及交付状态 --- */
37
+ export interface IFileChunk {
38
+ 'file': IFileInfo;
39
+ 'offset': number;
40
+ 'nextOffset': number | null;
41
+ 'encoding': 'base64';
42
+ 'data': string;
43
+ }
44
+ /**
45
+ * --- 建立尚未对代理公开的文件快照,由命令成功结果决定是否交付 ---
46
+ * @param owner 已通过命令生命周期检查的所属范围
47
+ * @param blob 应用已生成的文件内容,最多 64 MiB;同一 App 最多保留 8 份、合计 128 MiB
48
+ * @param options 文件名及 MIME
49
+ * @returns 十分钟有效的独立元数据;参数、容量或计时器不可用时返回 false
50
+ */
51
+ export declare function create(owner: IOwner, blob: Blob, options: IFileOptions): IFileInfo | false;
52
+ /**
53
+ * --- 按内部快照校验所有文件,再一次性标记命令交付,拒绝伪造或跨 App 句柄 ---
54
+ * @param taskId 当前命令所属 App
55
+ * @param requested 业务结果声明的文件
56
+ * @param exposed 当前命令是否允许代理调用
57
+ * @returns 可信的独立元数据;任一文件已失效或不属于本 App 时返回 false
58
+ */
59
+ export declare function commit(taskId: string, requested: IFileInfo[], exposed: boolean): IFileInfo[] | false;
60
+ /**
61
+ * --- 只读取已由公开命令交付的文件;异步读取后再次核对取消、到期及销毁 ---
62
+ * @param taskId 所属 App
63
+ * @param fileId 文件标识
64
+ * @param options 分段范围及取消信号
65
+ * @returns 不可变文件的 Base64 字节段;不可用或范围错误返回 false
66
+ */
67
+ export declare function read(taskId: string, fileId: string, options?: IFileReadOptions): Promise<IFileChunk | false>;
68
+ /**
69
+ * --- 释放一个文件及其到期计时器 ---
70
+ * @param taskId 所属 App
71
+ * @param fileId 文件标识
72
+ * @returns 无返回值
73
+ */
74
+ export declare function remove(taskId: string, fileId: string): void;
75
+ /**
76
+ * --- 应用主动释放自己所属范围的旧文件,不影响其他 Form 或 Panel ---
77
+ * @param owner 调用者所属范围,App 级对象可管理整个 App
78
+ * @param fileId 要释放的缓存句柄,不是文件路径
79
+ * @returns 是否找到并释放文件,已释放或范围不符为 false
80
+ */
81
+ export declare function release(owner: IOwner, fileId: string): boolean;
82
+ /**
83
+ * --- 随命令所属范围销毁文件,Panel 不影响同 Form 的其他文件 ---
84
+ * @param owner 要清理的任务、Form 或 Panel
85
+ * @returns 无返回值
86
+ */
87
+ export declare function clear(owner: IOwner): void;
@@ -0,0 +1,37 @@
1
+ import type * as lCore from '../core';
2
+ import type * as lTask from '../task';
3
+ import type * as lNative from '../native';
4
+ import type * as lFile from './file';
5
+ import type * as lData from './data';
6
+ import type * as lWebMcp from './webmcp';
7
+ import type * as lGuide from './guide';
8
+ import type * as lTool from '../tool';
9
+ /** --- 命令运行时所需的框架机制;不自行创建任务、授权窗口或 Native 服务 --- */
10
+ export interface IRuntimeOptions {
11
+ /** --- 页面接入状态变化通知,沿用框架全局事件 --- */
12
+ 'core': Pick<typeof lCore, 'trigger'>;
13
+ /** --- 实时任务状态、任务发现及已有权限检查 --- */
14
+ 'task': Pick<typeof lTask, 'getOrigin' | 'getList' | 'checkPermission'>;
15
+ /** --- Native 接入发现及显式、受权限保护的凭据导出 --- */
16
+ 'native': Pick<typeof lNative, 'getCommandEntry' | 'getMcpInfo'>;
17
+ /** --- 文件句柄与容量、分段、有效期及所属范围契约 --- */
18
+ 'files': typeof lFile;
19
+ /** --- 输入、元数据和结果的校验与独立快照 --- */
20
+ 'data': typeof lData;
21
+ /** --- 公开命令的浏览器发布及撤销机制 --- */
22
+ 'webMcp': Pick<typeof lWebMcp, 'create'>;
23
+ /** --- 从接入信息生成说明,不主动读取凭据 --- */
24
+ 'guide': Pick<typeof lGuide, 'format'>;
25
+ }
26
+ /** --- 文件缓存的外部机制与公开读取协议;每次创建得到独立缓存 --- */
27
+ export interface IFileStoreOptions {
28
+ /** --- 文件随所属 App/Form 生命周期清理的框架计时器 --- */
29
+ 'task': Pick<typeof lTask, 'createTimer' | 'removeTimer'>;
30
+ /** --- 把有界 Blob 分段编码为 Data URL,结果只取 Base64 数据部分 --- */
31
+ 'tool': Pick<typeof lTool, 'blob2DataUrl'>;
32
+ /** --- 交付元数据中的框架读取命令名 --- */
33
+ 'readCommand': string;
34
+ /** --- 默认读取长度与单段上限,单位为原始字节 --- */
35
+ 'defaultChunkBytes': number;
36
+ 'maxChunkBytes': number;
37
+ }
@@ -0,0 +1,161 @@
1
+ import type * as lTool from '../tool';
2
+ import type * as lFile from './file';
3
+ import type * as lNative from '../native';
4
+ /** --- 命令输入与输出可跨浏览器、Native 和协议传输的 JSON 值 --- */
5
+ export type TJson = lTool.TJson;
6
+ /** --- JSON Schema 2020-12 的命令校验子集;不支持的关键字在注册时拒绝 --- */
7
+ export interface ISchema {
8
+ '$schema'?: string;
9
+ '$ref'?: string;
10
+ '$defs'?: Record<string, ISchema | boolean>;
11
+ 'title'?: string;
12
+ 'description'?: string;
13
+ 'default'?: TJson;
14
+ 'examples'?: TJson[];
15
+ 'type'?: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
16
+ 'properties'?: Record<string, ISchema | boolean>;
17
+ 'required'?: string[];
18
+ 'additionalProperties'?: ISchema | boolean;
19
+ 'items'?: ISchema | boolean;
20
+ 'minItems'?: number;
21
+ 'maxItems'?: number;
22
+ 'uniqueItems'?: boolean;
23
+ 'minLength'?: number;
24
+ 'maxLength'?: number;
25
+ 'pattern'?: string;
26
+ 'minimum'?: number;
27
+ 'maximum'?: number;
28
+ 'exclusiveMinimum'?: number;
29
+ 'exclusiveMaximum'?: number;
30
+ 'enum'?: TJson[];
31
+ 'const'?: TJson;
32
+ 'allOf'?: Array<ISchema | boolean>;
33
+ 'anyOf'?: Array<ISchema | boolean>;
34
+ 'oneOf'?: Array<ISchema | boolean>;
35
+ 'not'?: ISchema | boolean;
36
+ }
37
+ /** --- 所有入口共用的结果;错误码用于程序判断,message 用于说明 --- */
38
+ export type TResult<T extends TJson = TJson> = {
39
+ 'ok': true;
40
+ 'data': T;
41
+ 'files'?: lFile.IFileInfo[];
42
+ } | {
43
+ 'ok': false;
44
+ 'error': {
45
+ 'code': string;
46
+ 'message': string;
47
+ };
48
+ };
49
+ /** --- 执行来源仅用于展示与记录,不是授权凭证 --- */
50
+ export interface IContext {
51
+ 'taskId': string;
52
+ 'formId': string;
53
+ 'panelId': string;
54
+ 'source': 'user' | 'agent';
55
+ 'signal': AbortSignal;
56
+ /**
57
+ * --- 保留已生成文件;用 success(data, [file]) 明确交付,不读取路径或重新生成 ---
58
+ * @param blob 原文件,单份最多 64 MiB;每个 App 最多 8 份、合计 128 MiB
59
+ * @param options 文件名及可选 MIME,默认使用 Blob.type 或 application/octet-stream
60
+ * @returns 十分钟有效的独立句柄,随所属范围销毁;参数/容量无效返回 false
61
+ * 仅在本次执行中有效;失败、取消、无效输出及未交付的文件自动释放,私有命令不公开文件
62
+ */
63
+ 'createFile': (blob: Blob, options: lFile.IFileOptions) => lFile.IFileInfo | false;
64
+ }
65
+ /** --- 与 MCP 工具描述对齐的公开命令元数据 --- */
66
+ export interface IMetadata {
67
+ 'name': string;
68
+ 'title'?: string;
69
+ 'description': string;
70
+ 'inputSchema': ISchema & {
71
+ 'type': 'object';
72
+ };
73
+ 'outputSchema'?: ISchema;
74
+ /** --- 行为说明,不代替校验或授权 --- */
75
+ 'annotations'?: {
76
+ 'readOnlyHint'?: boolean;
77
+ 'destructiveHint'?: boolean;
78
+ 'idempotentHint'?: boolean;
79
+ 'openWorldHint'?: boolean;
80
+ /** --- WebMCP 的重要或不可逆现实效果说明 --- */
81
+ 'consequentialHint'?: boolean;
82
+ 'untrustedContentHint'?: boolean;
83
+ };
84
+ }
85
+ /** --- 应用声明一次,界面、浏览器代理和 Native 适配器共享执行函数 --- */
86
+ export interface IDefinition<T extends Record<string, TJson> = Record<string, TJson>> extends IMetadata {
87
+ /** --- 明确允许代理发现并调用;默认只允许应用内部调用 --- */
88
+ 'exposed'?: boolean;
89
+ /** --- 默认拒绝同一命令并发;业务确认可并行时才开启 --- */
90
+ 'concurrent'?: boolean;
91
+ /** --- 必须已经取得的框架权限;执行入口不弹授权窗 --- */
92
+ 'permissions'?: string[];
93
+ /** --- true 为可用,false 或原因文本为不可用;每次执行重新检查 --- */
94
+ 'enabled'?: () => boolean | string;
95
+ 'execute': (args: T, context: IContext) => TResult | Promise<TResult>;
96
+ }
97
+ /** --- 不包含函数或内部对象的独立快照 --- */
98
+ export interface IInfo extends IMetadata {
99
+ 'taskId': string;
100
+ 'formId': string;
101
+ 'panelId': string;
102
+ 'exposed': boolean;
103
+ 'enabled': boolean;
104
+ 'disabledReason': string;
105
+ 'running': number;
106
+ }
107
+ /** --- 绑定一个应用实例,只能调用该实例明确公开的命令 --- */
108
+ export interface IBridge {
109
+ 'taskId': string;
110
+ 'list': () => IInfo[];
111
+ 'execute': (name: string, args?: Record<string, TJson>, options?: {
112
+ 'signal'?: AbortSignal;
113
+ }) => Promise<TResult>;
114
+ }
115
+ /** --- 框架向网页发布的统一入口;按任务选择应用,只访问明确公开的命令 --- */
116
+ export interface IPageBridge {
117
+ 'getAgentInfo': (taskId?: string) => Promise<IAgentInfo | null | false>;
118
+ 'getAgentGuide': (taskId?: string) => Promise<string | null | false>;
119
+ 'listTasks': () => Array<{
120
+ 'id': string;
121
+ 'name': string;
122
+ }>;
123
+ 'list': (taskId: string) => IInfo[];
124
+ 'execute': (taskId: string, name: string, args?: Record<string, TJson>, options?: {
125
+ 'signal'?: AbortSignal;
126
+ }) => Promise<TResult>;
127
+ }
128
+ /** --- 统一接入说明的生成选项;默认不读取或包含 HTTP 凭据 --- */
129
+ export interface IAgentOptions {
130
+ /** --- 仅供应用主动导出 HTTP 连接设置,仍要求当前 App 已有 root 权限 --- */
131
+ 'includeMcpCredentials'?: boolean;
132
+ }
133
+ /** --- 页面级 WebMCP 接入状态;ready 表示浏览器接口可用,不表示某个 App 的工具已发布 --- */
134
+ export type TWebMcpStatus = 'unsupported' | 'ready';
135
+ /** --- 工具发布诊断状态,不参与页面级接入事件 --- */
136
+ export type TWebMcpRegistrationStatus = 'idle' | 'registering' | 'ready' | 'failed';
137
+ /** --- 可展示或导出的接入信息;命令列表始终从对应入口实时查询 --- */
138
+ export interface IAgentInfo {
139
+ 'schemaVersion': 1;
140
+ 'apps': Array<{
141
+ 'id': string;
142
+ 'name': string;
143
+ }>;
144
+ 'targetTaskId': string | null;
145
+ 'browser': {
146
+ 'url': string | null;
147
+ 'api': string;
148
+ };
149
+ 'webMcp': {
150
+ 'supported': boolean;
151
+ /** --- 全页面共用的浏览器接入状态,不受目标 App 或工具数量影响 --- */
152
+ 'status': TWebMcpStatus;
153
+ /** --- 所选 App 的发布诊断;多个 App 时优先报告失败及进行中的注册,不支持时为 null --- */
154
+ 'registrationStatus': TWebMcpRegistrationStatus | null;
155
+ /** --- 已完成工具发布的 App,不表示这些 App 分别建立了浏览器连接 --- */
156
+ 'publishedTaskIds': string[];
157
+ };
158
+ 'native': lNative.ICommandEntry | null;
159
+ /** --- 只有显式导出且通过 root 检查时才包含 HTTP 凭据 --- */
160
+ 'http': lNative.IMcpInfo | null;
161
+ }
@@ -1,153 +1,9 @@
1
1
  import * as lCore from './core';
2
- import * as lTool from './tool';
3
- import * as lNative from './native';
2
+ import * as lFile from './command/file';
3
+ import type { TJson, TResult, IDefinition, IInfo, IAgentOptions, IAgentInfo, IBridge, IPageBridge } from './command/types';
4
4
  export { showPalette } from './command/palette';
5
- /** --- 命令输入与输出可跨浏览器、Native 和协议传输的 JSON 值 --- */
6
- export type TJson = lTool.TJson;
7
- /** --- JSON Schema 2020-12 的命令校验子集;不支持的关键字在注册时拒绝 --- */
8
- export interface ISchema {
9
- '$schema'?: string;
10
- '$ref'?: string;
11
- '$defs'?: Record<string, ISchema | boolean>;
12
- 'title'?: string;
13
- 'description'?: string;
14
- 'default'?: TJson;
15
- 'examples'?: TJson[];
16
- 'type'?: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
17
- 'properties'?: Record<string, ISchema | boolean>;
18
- 'required'?: string[];
19
- 'additionalProperties'?: ISchema | boolean;
20
- 'items'?: ISchema | boolean;
21
- 'minItems'?: number;
22
- 'maxItems'?: number;
23
- 'uniqueItems'?: boolean;
24
- 'minLength'?: number;
25
- 'maxLength'?: number;
26
- 'pattern'?: string;
27
- 'minimum'?: number;
28
- 'maximum'?: number;
29
- 'exclusiveMinimum'?: number;
30
- 'exclusiveMaximum'?: number;
31
- 'enum'?: TJson[];
32
- 'const'?: TJson;
33
- 'allOf'?: Array<ISchema | boolean>;
34
- 'anyOf'?: Array<ISchema | boolean>;
35
- 'oneOf'?: Array<ISchema | boolean>;
36
- 'not'?: ISchema | boolean;
37
- }
38
- /** --- 所有入口共用的结果;错误码用于程序判断,message 用于说明 --- */
39
- export type TResult<T extends TJson = TJson> = {
40
- 'ok': true;
41
- 'data': T;
42
- } | {
43
- 'ok': false;
44
- 'error': {
45
- 'code': string;
46
- 'message': string;
47
- };
48
- };
49
- /** --- 执行来源仅用于展示与记录,不是授权凭证 --- */
50
- export interface IContext {
51
- 'taskId': string;
52
- 'formId': string;
53
- 'panelId': string;
54
- 'source': 'user' | 'agent';
55
- 'signal': AbortSignal;
56
- }
57
- /** --- 与 MCP 工具描述对齐的公开命令元数据 --- */
58
- export interface IMetadata {
59
- 'name': string;
60
- 'title'?: string;
61
- 'description': string;
62
- 'inputSchema': ISchema & {
63
- 'type': 'object';
64
- };
65
- 'outputSchema'?: ISchema;
66
- /** --- 行为说明,不代替校验或授权 --- */
67
- 'annotations'?: {
68
- 'readOnlyHint'?: boolean;
69
- 'destructiveHint'?: boolean;
70
- 'idempotentHint'?: boolean;
71
- 'openWorldHint'?: boolean;
72
- /** --- WebMCP 的重要或不可逆现实效果说明 --- */
73
- 'consequentialHint'?: boolean;
74
- 'untrustedContentHint'?: boolean;
75
- };
76
- }
77
- /** --- 应用声明一次,界面、浏览器代理和 Native 适配器共享执行函数 --- */
78
- export interface IDefinition<T extends Record<string, TJson> = Record<string, TJson>> extends IMetadata {
79
- /** --- 明确允许代理发现并调用;默认只允许应用内部调用 --- */
80
- 'exposed'?: boolean;
81
- /** --- 默认拒绝同一命令并发;业务确认可并行时才开启 --- */
82
- 'concurrent'?: boolean;
83
- /** --- 必须已经取得的框架权限;执行入口不弹授权窗 --- */
84
- 'permissions'?: string[];
85
- /** --- true 为可用,false 或原因文本为不可用;每次执行重新检查 --- */
86
- 'enabled'?: () => boolean | string;
87
- 'execute': (args: T, context: IContext) => TResult | Promise<TResult>;
88
- }
89
- /** --- 不包含函数或内部对象的独立快照 --- */
90
- export interface IInfo extends IMetadata {
91
- 'taskId': string;
92
- 'formId': string;
93
- 'panelId': string;
94
- 'exposed': boolean;
95
- 'enabled': boolean;
96
- 'disabledReason': string;
97
- 'running': number;
98
- }
99
- /** --- 绑定一个应用实例,只能调用该实例明确公开的命令 --- */
100
- export interface IBridge {
101
- 'taskId': string;
102
- 'list': () => IInfo[];
103
- 'execute': (name: string, args?: Record<string, TJson>, options?: {
104
- 'signal'?: AbortSignal;
105
- }) => Promise<TResult>;
106
- }
107
- /** --- 框架向网页发布的统一入口;按任务选择应用,只访问明确公开的命令 --- */
108
- export interface IPageBridge {
109
- 'getAgentInfo': (taskId?: string) => Promise<IAgentInfo | null | false>;
110
- 'getAgentGuide': (taskId?: string) => Promise<string | null | false>;
111
- 'listTasks': () => Array<{
112
- 'id': string;
113
- 'name': string;
114
- }>;
115
- 'list': (taskId: string) => IInfo[];
116
- 'execute': (taskId: string, name: string, args?: Record<string, TJson>, options?: {
117
- 'signal'?: AbortSignal;
118
- }) => Promise<TResult>;
119
- }
120
- /** --- 统一接入说明的生成选项;默认不读取或包含 HTTP 凭据 --- */
121
- export interface IAgentOptions {
122
- /** --- 仅供应用主动导出 HTTP 连接设置,仍要求当前 App 已有 root 权限 --- */
123
- 'includeMcpCredentials'?: boolean;
124
- }
125
- /** --- 页面级 WebMCP 接入状态;ready 表示浏览器接口可用,不表示某个 App 的工具已发布 --- */
126
- export type TWebMcpStatus = 'unsupported' | 'ready';
127
- /** --- 工具发布诊断状态,不参与页面级接入事件 --- */
128
- export type TWebMcpRegistrationStatus = 'idle' | 'registering' | 'ready' | 'failed';
129
- /** --- 可展示或导出的接入信息;命令列表始终从对应入口实时查询 --- */
130
- export interface IAgentInfo {
131
- 'schemaVersion': 1;
132
- 'apps': ReturnType<typeof listTasks>;
133
- 'targetTaskId': string | null;
134
- 'browser': {
135
- 'url': string | null;
136
- 'api': string;
137
- };
138
- 'webMcp': {
139
- 'supported': boolean;
140
- /** --- 全页面共用的浏览器接入状态,不受目标 App 或工具数量影响 --- */
141
- 'status': TWebMcpStatus;
142
- /** --- 所选 App 的发布诊断;多个 App 时优先报告失败及进行中的注册,不支持时为 null --- */
143
- 'registrationStatus': TWebMcpRegistrationStatus | null;
144
- /** --- 已完成工具发布的 App,不表示这些 App 分别建立了浏览器连接 --- */
145
- 'publishedTaskIds': string[];
146
- };
147
- 'native': lNative.ICommandEntry | null;
148
- /** --- 只有显式导出且通过 root 检查时才包含 HTTP 凭据 --- */
149
- 'http': lNative.IMcpInfo | null;
150
- }
5
+ export type { IFileInfo, IFileOptions, IFileChunk } from './command/file';
6
+ export type { TJson, ISchema, TResult, IContext, IMetadata, IDefinition, IInfo, IBridge, IPageBridge, IAgentOptions, TWebMcpStatus, TWebMcpRegistrationStatus, IAgentInfo, } from './command/types';
151
7
  /**
152
8
  * --- 初始化页面级 WebMCP 接入状态,由框架在执行 Boot.main 前自动调用 ---
153
9
  * @returns 无返回值
@@ -156,9 +12,10 @@ export declare function init(): void;
156
12
  /**
157
13
  * --- 构造成功结果 ---
158
14
  * @param data 可跨入口传输的 JSON 数据
15
+ * @param files 本次命令明确交付的框架文件,可省略;不能传入其他 App 的文件
159
16
  * @returns 成功结果
160
17
  */
161
- export declare function success<T extends TJson>(data: T): TResult<T>;
18
+ export declare function success<T extends TJson>(data: T, files?: lFile.IFileInfo[]): TResult<T>;
162
19
  /**
163
20
  * --- 构造业务失败结果,不抛异常 ---
164
21
  * @param code 稳定的业务错误码
@@ -166,6 +23,13 @@ export declare function success<T extends TJson>(data: T): TResult<T>;
166
23
  * @returns 失败结果
167
24
  */
168
25
  export declare function failure(code: string, message: string): TResult<never>;
26
+ /**
27
+ * --- 主动释放旧导出的缓存,释放后代理不能继续读取;不删除磁盘文件 ---
28
+ * @param current 文件所属的 App/Form/Panel,Form/Panel 只能释放自身范围
29
+ * @param fileId 先前交付的文件标识
30
+ * @returns 是否找到并释放,已释放或不属于当前范围为 false
31
+ */
32
+ export declare function releaseFile(current: lCore.TCurrent, fileId: string): boolean;
169
33
  /**
170
34
  * --- 注册命令;重复名称、不支持的 schema 或已销毁的实例返回 false ---
171
35
  * @param current 所属任务/Form/Panel;销毁时自动移除其命令
@@ -257,9 +121,12 @@ export declare function createBridge(current: lCore.TCurrent): IBridge;
257
121
  */
258
122
  export declare function createPageBridge(): IPageBridge;
259
123
  /**
260
- * --- 显式重同步或重试当前 App 的工具发布;页面接入由框架自动管理 ---
124
+ * --- 手动将当前 App 已公开的命令发布到浏览器 WebMCP ---
125
+ * 公开命令注册或移除时框架自动同步,通常无需调用。
126
+ * 仅在发布失败需重试、主动撤销后需恢复,或浏览器稍后才提供 WebMCP 接口时调用。
127
+ * 同一浏览器接口下保留已发布工具,只补齐缺失项;不重置 App 的命令或业务状态。
261
128
  * @param current 所属应用
262
- * @returns 是否同步成功;浏览器不支持、App 已退出或注册失败时返回 false
129
+ * @returns 是否发布成功;浏览器不支持、App 已退出、发布中途撤销或注册失败时返回 false
263
130
  */
264
131
  export declare function connectWebMcp(current: lCore.TCurrent): Promise<boolean>;
265
132
  /**
@@ -819,18 +819,28 @@ export interface IFabricObjectchangeEvent {
819
819
  'height': number;
820
820
  };
821
821
  }
822
- export interface IObjviewerLine {
823
- /** -- 可自定义线段的名称 --- */
824
- 'name'?: string;
825
- 'start': clickgo.control.IObjviewerLineObj;
826
- 'end': clickgo.control.IObjviewerLineObj;
827
- /** --- 默认 255 --- */
828
- 'hue'?: string;
829
- 'path'?: string;
830
- /** --- 默认 solid --- */
831
- 'stroke'?: 'solid' | 'dashed' | 'up' | 'down';
832
- }
833
- export interface IObjviewerLineObj {
834
- 'obj': HTMLElement | AbstractControl;
835
- 'pos': 'lt' | 't' | 'tr' | 'r' | 'rb' | 'b' | 'bl' | 'l';
822
+ /** --- 节点和连接的语义状态,不依赖主题的具体颜色 --- */
823
+ export type TObjviewerStatus = 'default' | 'online' | 'warning' | 'offline';
824
+ /** --- 按稳定节点 ID 声明的连接,节点暂不存在时不绘制,不保存 DOM 引用 --- */
825
+ export interface IObjviewerEdge {
826
+ 'source': string;
827
+ 'target': string;
828
+ 'label'?: string;
829
+ /** --- 默认 default,连接状态由应用明确提供 --- */
830
+ 'status'?: TObjviewerStatus;
831
+ /** --- 默认 none,dash 为流动虚线,dots 为静止底线上的移动圆点 --- */
832
+ 'animation'?: 'none' | 'dash' | 'dots';
833
+ /** --- 默认 forward,沿 source 到 target;reverse 反向,both 双向 --- */
834
+ 'direction'?: 'forward' | 'reverse' | 'both';
835
+ /** --- 动画周期,单位秒,默认 3,限制为 0.25–60;dots 为走完整条路径的时间 --- */
836
+ 'duration'?: number;
837
+ /** --- dots 模式每个方向的圆点数,默认 3,取整并限制为 1–8 --- */
838
+ 'dotCount'?: number;
839
+ }
840
+ /** --- 节点选择事件,仅通知选择,不在控件内执行业务跳转 --- */
841
+ export interface IObjviewerSelectEvent {
842
+ 'detail': {
843
+ 'nodeId': string;
844
+ 'label': string;
845
+ };
836
846
  }
Binary file
Binary file