@glodon-aiot/agent-cli-ui 3.26.0-alpha.23 → 3.26.0-alpha.26
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/es/index.mjs +5655 -4988
- package/dist/lib/index.js +20 -19
- package/dist/src/Dialog/AgentChat/HistoryItem/ToolCalls.d.ts +24 -0
- package/dist/src/Dialog/AgentChat/HistoryItem/index.d.ts +2 -1
- package/dist/src/Dialog/AgentChat/HistoryItem/toolCallVisibility.d.ts +11 -0
- package/dist/src/components/LocalWorkspace/WorkspaceTree.d.ts +2 -0
- package/dist/src/components/LocalWorkspace/builtinToolSummary.d.ts +22 -0
- package/dist/src/components/LocalWorkspace/importDroppedFiles.d.ts +47 -0
- package/dist/src/components/LocalWorkspace/toolLabels.d.ts +4 -2
- package/dist/src/components/Sider/SiderTabs.d.ts +6 -0
- package/dist/src/constant.d.ts +2 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/types.d.ts +2 -3
- package/package.json +4 -4
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const isResultExec: (result?: unknown) => boolean;
|
|
3
|
+
type ToolStep = {
|
|
4
|
+
type?: string;
|
|
5
|
+
data?: {
|
|
6
|
+
pluginName?: string;
|
|
7
|
+
pluginCode?: string;
|
|
8
|
+
funcName?: string;
|
|
9
|
+
funcCode?: string;
|
|
10
|
+
thought?: string;
|
|
11
|
+
parameters?: {
|
|
12
|
+
query?: unknown;
|
|
13
|
+
};
|
|
14
|
+
requestBody?: unknown;
|
|
15
|
+
result?: unknown;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
interface ToolCallsProps {
|
|
19
|
+
actions?: ToolStep[][];
|
|
20
|
+
calling: boolean;
|
|
21
|
+
debug?: boolean;
|
|
22
|
+
}
|
|
23
|
+
declare const ToolCalls: React.FC<ToolCallsProps>;
|
|
24
|
+
export default ToolCalls;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IHistory, IApplication } from '@glodon-aiot/apis';
|
|
3
3
|
import { Session } from '@glodon-aiot/bot-client-sdk';
|
|
4
|
+
import { isResultExec } from './ToolCalls';
|
|
4
5
|
import { MarkdownProps } from '@glodon-aiot/react-components/dist/src/components/Markdown';
|
|
5
6
|
interface HistoryItemProps {
|
|
6
7
|
application: IApplication;
|
|
@@ -15,6 +16,6 @@ interface HistoryItemProps {
|
|
|
15
16
|
actions?: boolean;
|
|
16
17
|
markdown?: Partial<MarkdownProps>;
|
|
17
18
|
}
|
|
18
|
-
export
|
|
19
|
+
export { isResultExec };
|
|
19
20
|
declare const HistoryItem: React.FC<HistoryItemProps>;
|
|
20
21
|
export default HistoryItem;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function isSkillToolCall(steps: {
|
|
2
|
+
data?: {
|
|
3
|
+
funcCode?: string;
|
|
4
|
+
};
|
|
5
|
+
}[]): boolean;
|
|
6
|
+
/** debug 不为真时去掉三个技能工具。历史记录与当前对话共用这一判断。 */
|
|
7
|
+
export declare function visibleToolCalls<T extends {
|
|
8
|
+
data?: {
|
|
9
|
+
funcCode?: string;
|
|
10
|
+
};
|
|
11
|
+
}>(actions: T[][] | undefined, debug?: boolean): T[][];
|
|
@@ -8,6 +8,8 @@ interface WorkspaceTreeProps {
|
|
|
8
8
|
getContainer: () => HTMLElement;
|
|
9
9
|
highlight?: boolean;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/** 浮窗模式:默认收成左上角入口,点击后展开目录面板。 */
|
|
12
|
+
collapsible?: boolean;
|
|
11
13
|
}
|
|
12
14
|
declare const WorkspaceTree: React.FC<WorkspaceTreeProps>;
|
|
13
15
|
export default WorkspaceTree;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type BuiltinToolStatus = 'loading' | 'success' | 'error' | 'abort';
|
|
2
|
+
interface ToolStepLike {
|
|
3
|
+
data?: {
|
|
4
|
+
parameters?: {
|
|
5
|
+
query?: unknown;
|
|
6
|
+
};
|
|
7
|
+
requestBody?: unknown;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** query 有内容时用 query,否则用 requestBody。两者都可以是对象或 JSON 字符串。 */
|
|
11
|
+
export declare function builtinToolInput(steps: ToolStepLike[]): Record<string, unknown>;
|
|
12
|
+
/** 折叠行中间的辨识文字。正文、stdout 和 old_text 不放在这里。 */
|
|
13
|
+
export declare function summarizeBuiltinCall(funcCode: string, input: Record<string, unknown>): string | undefined;
|
|
14
|
+
export interface ToolResultBody {
|
|
15
|
+
code?: number;
|
|
16
|
+
message?: string;
|
|
17
|
+
data?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export declare function readToolResult(result: unknown): ToolResultBody | undefined;
|
|
20
|
+
/** 折叠行右侧。没有更具体的结果时返回 undefined,调用方继续用执行成功 / 执行失败。 */
|
|
21
|
+
export declare function builtinToolResultLabel(funcCode: string, status: BuiltinToolStatus, result: unknown): string | undefined;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { WorkspaceFiles } from '@glodon-aiot/bot-client-sdk';
|
|
2
|
+
/** 从系统拖进来的一项。没有 file 时表示空文件夹。 */
|
|
3
|
+
export interface DroppedEntry {
|
|
4
|
+
/** 相对本次拖放根的路径,使用 /。空文件夹可带结尾斜杠。 */
|
|
5
|
+
relativePath: string;
|
|
6
|
+
file?: File;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ImportFailure {
|
|
10
|
+
path: string;
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ImportResult {
|
|
14
|
+
files: number;
|
|
15
|
+
directories: number;
|
|
16
|
+
failed: ImportFailure[];
|
|
17
|
+
}
|
|
18
|
+
export interface ImportProgress {
|
|
19
|
+
done: number;
|
|
20
|
+
total: number;
|
|
21
|
+
}
|
|
22
|
+
interface WebkitEntry {
|
|
23
|
+
isFile: boolean;
|
|
24
|
+
isDirectory: boolean;
|
|
25
|
+
name: string;
|
|
26
|
+
fullPath: string;
|
|
27
|
+
file?: (success: (file: File) => void, error?: (err: DOMException) => void) => void;
|
|
28
|
+
createReader?: () => {
|
|
29
|
+
readEntries: (success: (entries: WebkitEntry[]) => void, error?: (err: DOMException) => void) => void;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** 把拖放目标目录和条目相对路径拼成工作区路径。 */
|
|
33
|
+
export declare function joinWorkspacePath(directory: string, relativePath: string): string;
|
|
34
|
+
export declare function filesToEntries(files: Iterable<File>): DroppedEntry[];
|
|
35
|
+
export declare function collectEntries(roots: WebkitEntry[]): Promise<DroppedEntry[]>;
|
|
36
|
+
/**
|
|
37
|
+
* 读取拖放内容。webkitGetAsEntry 必须在 drop 事件里同步调用,
|
|
38
|
+
* 否则浏览器会清空 dataTransfer.items。
|
|
39
|
+
*/
|
|
40
|
+
export declare function readDataTransfer(dataTransfer: DataTransfer): Promise<DroppedEntry[]>;
|
|
41
|
+
/** 把拖入的文件写入已授权工作区。单次失败不影响其余文件。 */
|
|
42
|
+
export declare function importDroppedEntries(files: Pick<WorkspaceFiles, 'write' | 'mkdir'>, directory: string, entries: DroppedEntry[], onProgress?: (progress: ImportProgress) => void): Promise<ImportResult>;
|
|
43
|
+
export declare function describeImportResult(result: ImportResult): {
|
|
44
|
+
type: 'success' | 'warning' | 'error';
|
|
45
|
+
content: string;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
|
@@ -5,11 +5,13 @@ interface ActionLike {
|
|
|
5
5
|
parameters?: {
|
|
6
6
|
query?: unknown;
|
|
7
7
|
};
|
|
8
|
+
requestBody?: unknown;
|
|
8
9
|
};
|
|
9
10
|
}
|
|
10
|
-
/**
|
|
11
|
+
/** 内置工具插件的步骤返回中文名和这一次调用的辨识信息;其他插件返回 undefined。 */
|
|
11
12
|
export declare function describeLocalFileAction(actions: ActionLike[]): {
|
|
12
13
|
name: string;
|
|
13
|
-
|
|
14
|
+
funcCode: string;
|
|
15
|
+
summary: string | undefined;
|
|
14
16
|
} | undefined;
|
|
15
17
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SiderRef } from './index';
|
|
3
|
+
import { SessionListProps } from '../../Dialog/SessionList';
|
|
4
|
+
export type { SiderRef };
|
|
5
|
+
declare const SiderTabs: React.ForwardRefExoticComponent<SessionListProps & React.RefAttributes<SiderRef>>;
|
|
6
|
+
export default SiderTabs;
|
package/dist/src/constant.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { default as icon } from './assets/icon.svg';
|
|
2
2
|
import { default as brand } from './assets/brand.svg';
|
|
3
3
|
import { default as IconThink } from './assets/think.svg';
|
|
4
|
+
import { default as IconTool } from './assets/tool.svg';
|
|
4
5
|
import { AgentClientUIConfig } from './types';
|
|
5
6
|
export declare const defaultUIConfig: AgentClientUIConfig;
|
|
6
7
|
export declare const defaultApiUrl = "https://copilot.glodon.com/api/cvforce";
|
|
7
8
|
export declare const defaultDovViewerUrl = "https://copilot.glodon.com/portal/_/cvforce/doc-viewer/";
|
|
8
|
-
export { icon, brand, IconThink };
|
|
9
|
+
export { icon, brand, IconThink, IconTool };
|
|
9
10
|
export declare const UNNAMED_SESSION_NAME = "\u672A\u547D\u540D\u4F1A\u8BDD";
|
|
10
11
|
export declare const KB = 1024;
|
|
11
12
|
export declare const MB: number;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export default class AgentClientUI {
|
|
|
39
39
|
/** SDK 的工作文件夹控制器,供宿主自定义选目录入口;未启用内置文件插件时为 undefined。 */
|
|
40
40
|
get localWorkspace(): import('@glodon-aiot/bot-client-sdk').LocalWorkspace | undefined;
|
|
41
41
|
private get localFilesEnabled();
|
|
42
|
-
/** 去掉 UI 专属的 ui 字段;集成方未提供文件确认钩子时注入 UI
|
|
42
|
+
/** 去掉 UI 专属的 ui 字段;集成方未提供文件确认钩子时注入 UI 弹窗。 */
|
|
43
43
|
private getSdkBuiltinPlugins;
|
|
44
44
|
setService(): BotClientApi;
|
|
45
45
|
reload(): void;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BotClient, AgentPluginMap, Session, MCPConfig, LocalFilesConfig
|
|
1
|
+
import { BotClient, AgentPluginMap, Session, MCPConfig, LocalFilesConfig } from '@glodon-aiot/bot-client-sdk';
|
|
2
2
|
import { ApprovalBridge } from './components/LocalWorkspace/approvalBridge';
|
|
3
3
|
import { BotClientApi, ICommentParam, ISession, IChatMessage, IHistory, IKnowledge, ISessionPrompt, ISearchReference, IApplication } from '@glodon-aiot/apis';
|
|
4
4
|
import { Theme } from 'antd/es/config-provider/context';
|
|
@@ -231,7 +231,7 @@ export interface AgentClientDefaultProps {
|
|
|
231
231
|
localFilesApprovalBridge?: ApprovalBridge;
|
|
232
232
|
}
|
|
233
233
|
export interface LocalFilesUIConfig {
|
|
234
|
-
/**
|
|
234
|
+
/** 是否显示工作区面板,默认 true。内嵌模式在左侧 tab,浮窗模式收在左上角,点击后展开。 */
|
|
235
235
|
picker?: boolean;
|
|
236
236
|
/** 首次选择前是否弹出数据外发提示,默认 true。 */
|
|
237
237
|
disclosure?: boolean;
|
|
@@ -268,7 +268,6 @@ export interface InitalData extends AgentClientUIConfig {
|
|
|
268
268
|
/** SDK 内置插件;localFiles 额外支持 UI 专属字段 ui,不会传给 SDK。 */
|
|
269
269
|
builtinPlugins?: {
|
|
270
270
|
localFiles?: UILocalFilesConfig;
|
|
271
|
-
localPython?: LocalPythonConfig;
|
|
272
271
|
};
|
|
273
272
|
mcp?: MCPConfig;
|
|
274
273
|
env?: Env;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/agent-cli-ui",
|
|
3
|
-
"version": "3.26.0-alpha.
|
|
3
|
+
"version": "3.26.0-alpha.26",
|
|
4
4
|
"module": "./dist/es/index.mjs",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"typings": "./dist/src/index.d.ts",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ant-design/icons": "^5.3.4",
|
|
34
|
-
"@glodon-aiot/apis": "^3.26.0-alpha.
|
|
35
|
-
"@glodon-aiot/bot-client-sdk": "^3.26.0-alpha.
|
|
36
|
-
"@glodon-aiot/react-components": "^3.26.0-alpha.
|
|
34
|
+
"@glodon-aiot/apis": "^3.26.0-alpha.26",
|
|
35
|
+
"@glodon-aiot/bot-client-sdk": "^3.26.0-alpha.26",
|
|
36
|
+
"@glodon-aiot/react-components": "^3.26.0-alpha.26",
|
|
37
37
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
38
38
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
39
39
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|