@glodon-aiot/agent-cli-ui 3.25.1-alpha.7 → 3.26.0-alpha.11
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 +5946 -4687
- package/dist/lib/index.js +21 -18
- package/dist/src/Dialog/AgentChat/HistoryItem/ArtifactList/index.d.ts +9 -0
- package/dist/src/Dialog/AgentChat/HistoryItem/ArtifactPreview/index.d.ts +23 -0
- package/dist/src/Dialog/AgentChat/HistoryItem/ArtifactPreview/memory.d.ts +6 -0
- 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/Tools/UploadKnowledgeFiles/index.d.ts +1 -0
- package/dist/src/components/LocalWorkspace/ApprovalModal.d.ts +10 -0
- package/dist/src/components/LocalWorkspace/DisclosureModal.d.ts +12 -0
- package/dist/src/components/LocalWorkspace/TransferProgress.d.ts +6 -0
- package/dist/src/components/LocalWorkspace/WorkspaceFolderEntry.d.ts +13 -0
- package/dist/src/components/LocalWorkspace/WorkspaceTree.d.ts +13 -0
- package/dist/src/components/LocalWorkspace/approvalBridge.d.ts +11 -0
- package/dist/src/components/LocalWorkspace/index.d.ts +9 -0
- package/dist/src/components/LocalWorkspace/lineDiff.d.ts +26 -0
- package/dist/src/components/LocalWorkspace/toolLabels.d.ts +15 -0
- package/dist/src/components/LocalWorkspace/useLocalWorkspace.d.ts +11 -0
- package/dist/src/constant.d.ts +5 -1
- package/dist/src/index.d.ts +7 -0
- package/dist/src/types.d.ts +43 -1
- package/dist/src/utils/index.d.ts +10 -0
- package/package.json +4 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ISessionArtifact } from '@glodon-aiot/apis';
|
|
3
|
+
interface ArtifactListProps {
|
|
4
|
+
artifacts: ISessionArtifact[];
|
|
5
|
+
activeArtifact?: ISessionArtifact | null;
|
|
6
|
+
onPreview: (artifact: ISessionArtifact) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const ArtifactList: FC<ArtifactListProps>;
|
|
9
|
+
export default ArtifactList;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ISessionArtifact } from '@glodon-aiot/apis';
|
|
3
|
+
import { ArtifactPreviewConfig, ArtifactPreviewPlacement, ArtifactPreviewStyle } from '../../../../types';
|
|
4
|
+
export declare function resolveArtifactPreview(artifacts?: boolean | ArtifactPreviewConfig): {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
preview: ArtifactPreviewPlacement;
|
|
7
|
+
style?: ArtifactPreviewStyle;
|
|
8
|
+
};
|
|
9
|
+
interface ArtifactPreviewOverlayProps {
|
|
10
|
+
placement: ArtifactPreviewPlacement;
|
|
11
|
+
artifact: ISessionArtifact | null;
|
|
12
|
+
style?: ArtifactPreviewStyle;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
getContainer: () => HTMLElement;
|
|
15
|
+
}
|
|
16
|
+
export declare const ArtifactPreviewOverlay: FC<ArtifactPreviewOverlayProps>;
|
|
17
|
+
interface ArtifactPreviewColumnProps {
|
|
18
|
+
artifact: ISessionArtifact;
|
|
19
|
+
style?: ArtifactPreviewStyle;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const ArtifactPreviewColumn: FC<ArtifactPreviewColumnProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ArtifactPreviewStyle } from '../../../../types';
|
|
2
|
+
export declare const ARTIFACT_COLUMN_MIN_WIDTH = 320;
|
|
3
|
+
export declare const ARTIFACT_COLUMN_DEFAULT_WIDTH = 480;
|
|
4
|
+
export declare function readArtifactPreviewMemory(): ArtifactPreviewStyle;
|
|
5
|
+
export declare function writeArtifactPreviewMemory(patch: ArtifactPreviewStyle): void;
|
|
6
|
+
export declare function clampColumnWidth(width: number, parentWidth: number): number;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const isResultExec: (result?: string) => 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?: string;
|
|
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;
|
|
@@ -21,6 +21,7 @@ interface UploadFilesProps {
|
|
|
21
21
|
afterFilesClear?: () => void;
|
|
22
22
|
docViewerUrl: string;
|
|
23
23
|
isFirstSession?: boolean;
|
|
24
|
+
/** Agent 应用开启后,Excel / SVG / DWG / JSON 作为本地附件上传,不进知识库。 */
|
|
24
25
|
allowExcelAttachment?: boolean;
|
|
25
26
|
}
|
|
26
27
|
declare const UploadFiles: React.ForwardRefExoticComponent<UploadFilesProps & React.RefAttributes<UploadRefProps>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ApprovalBridge } from './approvalBridge';
|
|
3
|
+
export declare function formatSize(bytes?: number): string;
|
|
4
|
+
interface ApprovalHostProps {
|
|
5
|
+
bridge: ApprovalBridge;
|
|
6
|
+
getContainer: () => HTMLElement;
|
|
7
|
+
}
|
|
8
|
+
/** 订阅 UI 确认桥,逐个显示确认请求;请求被撤销(停止回答等)时自动关闭。 */
|
|
9
|
+
declare const ApprovalHost: React.FC<ApprovalHostProps>;
|
|
10
|
+
export default ApprovalHost;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const DEFAULT_DISCLOSURE_TEXT = "\u9009\u62E9\u6587\u4EF6\u5939\u540E\uFF0C\u52A9\u624B\u53EF\u4EE5\u8BFB\u53D6\u8BE5\u6587\u4EF6\u5939\u4E2D\u7684\u6587\u4EF6\uFF0C\u8BFB\u53D6\u5230\u7684\u5185\u5BB9\u53EF\u80FD\u4F1A\u53D1\u9001\u7ED9 AI \u6A21\u578B\u5904\u7406\u3002\u4FEE\u6539\u3001\u4E0A\u4F20\u6216\u4E0B\u8F7D\u6587\u4EF6\u524D\u4F1A\u5148\u5F81\u5F97\u4F60\u7684\u786E\u8BA4\u3002\u8BF7\u52FF\u9009\u62E9\u5305\u542B\u654F\u611F\u4FE1\u606F\u7684\u6587\u4EF6\u5939\u3002";
|
|
3
|
+
interface DisclosureModalProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
text?: string;
|
|
6
|
+
getContainer: () => HTMLElement;
|
|
7
|
+
/** 必须在按钮点击中同步调用 pick(),否则会丢失用户手势。 */
|
|
8
|
+
onContinue: () => void;
|
|
9
|
+
onCancel: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const DisclosureModal: React.FC<DisclosureModalProps>;
|
|
12
|
+
export default DisclosureModal;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LocalWorkspace } from '@glodon-aiot/bot-client-sdk';
|
|
3
|
+
export declare const AUTHORIZATION_HINT = "\u52A9\u624B\u9700\u8981\u8BBF\u95EE\u5DE5\u4F5C\u6587\u4EF6\u5939\uFF0C\u8BF7\u5148\u9009\u62E9\u6216\u6062\u590D\u8BBF\u95EE";
|
|
4
|
+
interface WorkspaceFolderEntryProps {
|
|
5
|
+
workspace: LocalWorkspace;
|
|
6
|
+
disclosureText?: string;
|
|
7
|
+
getContainer: () => HTMLElement;
|
|
8
|
+
/** 工具因未授权失败时高亮并显示提示。 */
|
|
9
|
+
highlight?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const WorkspaceFolderEntry: React.FC<WorkspaceFolderEntryProps>;
|
|
13
|
+
export default WorkspaceFolderEntry;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LocalWorkspace } from '@glodon-aiot/bot-client-sdk';
|
|
3
|
+
interface WorkspaceTreeProps {
|
|
4
|
+
workspace: LocalWorkspace;
|
|
5
|
+
disclosureText?: string;
|
|
6
|
+
/** 为 false 时选择文件夹不再弹出外发提示。 */
|
|
7
|
+
disclosure?: boolean;
|
|
8
|
+
getContainer: () => HTMLElement;
|
|
9
|
+
highlight?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const WorkspaceTree: React.FC<WorkspaceTreeProps>;
|
|
13
|
+
export default WorkspaceTree;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApprovalHandler, ApprovalRequest } from '@glodon-aiot/bot-client-sdk';
|
|
2
|
+
export type ApprovalListener = (request: ApprovalRequest, resolve: (approved: boolean) => void) => void;
|
|
3
|
+
/**
|
|
4
|
+
* 连接 SDK 确认钩子与 React 弹窗:BotClient 创建时就需要钩子,而弹窗要等渲染后才存在。
|
|
5
|
+
* 没有弹窗挂载时一律拒绝,避免静默写盘。
|
|
6
|
+
*/
|
|
7
|
+
export interface ApprovalBridge {
|
|
8
|
+
handler: ApprovalHandler;
|
|
9
|
+
subscribe(listener: ApprovalListener): () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function createApprovalBridge(): ApprovalBridge;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as WorkspaceFolderEntry, AUTHORIZATION_HINT } from './WorkspaceFolderEntry';
|
|
2
|
+
export { default as WorkspaceTree } from './WorkspaceTree';
|
|
3
|
+
export { default as ApprovalHost } from './ApprovalModal';
|
|
4
|
+
export { default as TransferProgress } from './TransferProgress';
|
|
5
|
+
export { default as DisclosureModal, DEFAULT_DISCLOSURE_TEXT } from './DisclosureModal';
|
|
6
|
+
export { createApprovalBridge } from './approvalBridge';
|
|
7
|
+
export type { ApprovalBridge } from './approvalBridge';
|
|
8
|
+
export { useLocalWorkspace, useNeedsAuthorization, useTransferProgress } from './useLocalWorkspace';
|
|
9
|
+
export { lineDiff } from './lineDiff';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type DiffLineType = 'same' | 'added' | 'removed';
|
|
2
|
+
export interface DiffLine {
|
|
3
|
+
type: DiffLineType;
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export type LineDiffResult = {
|
|
7
|
+
kind: 'lines';
|
|
8
|
+
lines: DiffLine[];
|
|
9
|
+
added: number;
|
|
10
|
+
removed: number;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'summary';
|
|
13
|
+
beforeLines: number;
|
|
14
|
+
afterLines: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const LINE_DIFF_MAX_LINES = 2000;
|
|
17
|
+
/**
|
|
18
|
+
* 行级 LCS diff。超过 2000 行或计算超出时间预算时降级为只返回行数摘要。
|
|
19
|
+
* 先剥离公共前后缀,常见的小改动只需对中间很短的一段做 LCS。
|
|
20
|
+
*/
|
|
21
|
+
export declare function lineDiff(before: string, after: string): LineDiffResult;
|
|
22
|
+
/** 只保留改动行及其前后若干行上下文,其余折叠为一行省略标记。 */
|
|
23
|
+
export declare function collapseUnchanged(lines: DiffLine[], context?: number): (DiffLine | {
|
|
24
|
+
type: "skipped";
|
|
25
|
+
count: number;
|
|
26
|
+
})[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface ActionLike {
|
|
2
|
+
data?: {
|
|
3
|
+
pluginCode?: string;
|
|
4
|
+
funcCode?: string;
|
|
5
|
+
parameters?: {
|
|
6
|
+
query?: unknown;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** 内置工具插件的步骤返回中文名与相对路径;其他插件返回 undefined,按原样展示。 */
|
|
11
|
+
export declare function describeLocalFileAction(actions: ActionLike[]): {
|
|
12
|
+
name: string;
|
|
13
|
+
path: string | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LocalWorkspace, LocalWorkspaceStatus, ToolProgressEvent } from '@glodon-aiot/bot-client-sdk';
|
|
2
|
+
export interface LocalWorkspaceState {
|
|
3
|
+
status: LocalWorkspaceStatus;
|
|
4
|
+
displayName?: string;
|
|
5
|
+
}
|
|
6
|
+
/** 订阅工作区状态。 */
|
|
7
|
+
export declare function useLocalWorkspace(workspace?: LocalWorkspace): LocalWorkspaceState;
|
|
8
|
+
/** 进行中的上传/下载,按 requestId 记录最新进度;结束、失败或取消后移除。 */
|
|
9
|
+
export declare function useTransferProgress(workspace?: LocalWorkspace): ToolProgressEvent[];
|
|
10
|
+
/** 内置工具因未授权失败时置为 true,授权后自动复位。 */
|
|
11
|
+
export declare function useNeedsAuthorization(workspace?: LocalWorkspace): readonly [boolean, import('react').Dispatch<import('react').SetStateAction<boolean>>];
|
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;
|
|
@@ -16,6 +17,9 @@ export declare const FILE_ICONS: {
|
|
|
16
17
|
pdf: string;
|
|
17
18
|
xls: string;
|
|
18
19
|
xlsx: string;
|
|
20
|
+
svg: string;
|
|
21
|
+
dwg: string;
|
|
22
|
+
json: string;
|
|
19
23
|
};
|
|
20
24
|
export declare const NET_OPEN_STATUS: {
|
|
21
25
|
OPEN: number;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export default class AgentClientUI {
|
|
|
24
24
|
};
|
|
25
25
|
wrapper: HTMLElement;
|
|
26
26
|
botClient: BotClient | null;
|
|
27
|
+
private _approvalBridge?;
|
|
27
28
|
private _silencedSeconds;
|
|
28
29
|
private fetchSilenceDuration;
|
|
29
30
|
constructor(config: InitalData);
|
|
@@ -35,8 +36,14 @@ export default class AgentClientUI {
|
|
|
35
36
|
set mode(v: AgentClientMode);
|
|
36
37
|
get activeSession(): ISession | null;
|
|
37
38
|
get applicationId(): string;
|
|
39
|
+
/** SDK 的工作文件夹控制器,供宿主自定义选目录入口;未启用内置文件插件时为 undefined。 */
|
|
40
|
+
get localWorkspace(): import('@glodon-aiot/bot-client-sdk').LocalWorkspace | undefined;
|
|
41
|
+
private get localFilesEnabled();
|
|
42
|
+
/** 去掉 UI 专属的 ui 字段;集成方未提供文件确认钩子时注入 UI 弹窗。脚本确认不走这个弹窗。 */
|
|
43
|
+
private getSdkBuiltinPlugins;
|
|
38
44
|
setService(): BotClientApi;
|
|
39
45
|
reload(): void;
|
|
46
|
+
getArtifacts(sessionId?: string): Promise<import('@glodon-aiot/apis').ISessionArtifact[]>;
|
|
40
47
|
getMessageList(sessionId?: string): Promise<import('@glodon-aiot/apis').IHistory[]>;
|
|
41
48
|
input(message: string): void;
|
|
42
49
|
disable(): void;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BotClient, AgentPluginMap, Session, MCPConfig } from '@glodon-aiot/bot-client-sdk';
|
|
1
|
+
import { BotClient, AgentPluginMap, Session, MCPConfig, LocalFilesConfig, LocalPythonConfig } from '@glodon-aiot/bot-client-sdk';
|
|
2
|
+
import { ApprovalBridge } from './components/LocalWorkspace/approvalBridge';
|
|
2
3
|
import { BotClientApi, ICommentParam, ISession, IChatMessage, IHistory, IKnowledge, ISessionPrompt, ISearchReference, IApplication } from '@glodon-aiot/apis';
|
|
3
4
|
import { Theme } from 'antd/es/config-provider/context';
|
|
4
5
|
import { CSSProperties } from 'react';
|
|
@@ -52,6 +53,22 @@ export interface AgentClientUITransform {
|
|
|
52
53
|
knowledges?: boolean;
|
|
53
54
|
promptVariables?: boolean;
|
|
54
55
|
}
|
|
56
|
+
/** 产出物预览的展示位置。 */
|
|
57
|
+
export type ArtifactPreviewPlacement = 'modal' | 'drawer' | 'column';
|
|
58
|
+
export interface ArtifactPreviewStyle {
|
|
59
|
+
/** modal 初始是否全屏。用户切换后以本地记忆为准。 */
|
|
60
|
+
modalFullscreen?: boolean;
|
|
61
|
+
/** column 初始宽度,单位 px。用户拖拽后以本地记忆为准。 */
|
|
62
|
+
columnWidth?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface ArtifactPreviewConfig {
|
|
65
|
+
/** 是否展示产出物入口。默认展示。 */
|
|
66
|
+
visible?: boolean;
|
|
67
|
+
/** modal 弹窗,drawer 抽屉,column 右侧分栏。默认 modal。 */
|
|
68
|
+
preview?: ArtifactPreviewPlacement;
|
|
69
|
+
/** 预览样式。全屏和分栏宽度会在用户调整后写入本地。 */
|
|
70
|
+
style?: ArtifactPreviewStyle;
|
|
71
|
+
}
|
|
55
72
|
export interface MessageBoxFooterItem {
|
|
56
73
|
componentName: 'AnswerAgain' | 'Copy' | 'Comments';
|
|
57
74
|
position: 'left' | 'right';
|
|
@@ -92,6 +109,11 @@ export interface AgentFeaturesConfig {
|
|
|
92
109
|
openTarget?: string;
|
|
93
110
|
onOpen?: (list: ISearchReference[], messageId?: string) => void;
|
|
94
111
|
};
|
|
112
|
+
/**
|
|
113
|
+
* 产出物入口。true 或不传为展示,false 为不展示。
|
|
114
|
+
* 传对象时可同时指定预览位置和样式。
|
|
115
|
+
*/
|
|
116
|
+
artifacts?: boolean | ArtifactPreviewConfig;
|
|
95
117
|
};
|
|
96
118
|
prompts?: boolean;
|
|
97
119
|
connectNetwork?: boolean | {
|
|
@@ -203,6 +225,21 @@ export interface AgentClientDefaultProps {
|
|
|
203
225
|
stream?: boolean;
|
|
204
226
|
agentClient?: BotClient;
|
|
205
227
|
silencedSeconds?: number;
|
|
228
|
+
/** 内置本地文件插件的 UI 配置;未启用时为 undefined。 */
|
|
229
|
+
localFilesUI?: LocalFilesUIConfig;
|
|
230
|
+
/** UI 自带的写入/传输确认;集成方自行传入 onApprovalRequired 时为 undefined。 */
|
|
231
|
+
localFilesApprovalBridge?: ApprovalBridge;
|
|
232
|
+
}
|
|
233
|
+
export interface LocalFilesUIConfig {
|
|
234
|
+
/** 是否在输入区显示工作文件夹入口,默认 true。 */
|
|
235
|
+
picker?: boolean;
|
|
236
|
+
/** 首次选择前是否弹出数据外发提示,默认 true。 */
|
|
237
|
+
disclosure?: boolean;
|
|
238
|
+
/** 覆盖首次选择前的数据外发提示文案。 */
|
|
239
|
+
disclosureText?: string;
|
|
240
|
+
}
|
|
241
|
+
export interface UILocalFilesConfig extends LocalFilesConfig {
|
|
242
|
+
ui?: LocalFilesUIConfig;
|
|
206
243
|
}
|
|
207
244
|
interface DataEventListeners {
|
|
208
245
|
comment: CommentListener;
|
|
@@ -228,6 +265,11 @@ export interface InitalData extends AgentClientUIConfig {
|
|
|
228
265
|
apiUrl?: string;
|
|
229
266
|
docViewerUrl?: string;
|
|
230
267
|
plugins?: AgentPluginMap;
|
|
268
|
+
/** SDK 内置插件;localFiles 额外支持 UI 专属字段 ui,不会传给 SDK。 */
|
|
269
|
+
builtinPlugins?: {
|
|
270
|
+
localFiles?: UILocalFilesConfig;
|
|
271
|
+
localPython?: LocalPythonConfig;
|
|
272
|
+
};
|
|
231
273
|
mcp?: MCPConfig;
|
|
232
274
|
env?: Env;
|
|
233
275
|
debug?: boolean;
|
|
@@ -16,10 +16,20 @@ export declare enum shortCutEnum {
|
|
|
16
16
|
export declare const FILE_NAME_MAX_LENGTH = 100;
|
|
17
17
|
export declare const isValidImageUrlWithAnyExtension: (url: string) => boolean;
|
|
18
18
|
export declare const fileTypes: string[];
|
|
19
|
+
/** 不进知识库、只把对象地址写进问题的附件。xls/xlsx 保持原有行为。 */
|
|
20
|
+
export declare const LOCAL_ATTACHMENT_EXTENSIONS: string[];
|
|
21
|
+
/** 从问题里的 `[文件名](url)` 还原附件卡片时,用来识别对象地址。 */
|
|
22
|
+
export declare const LOCAL_ATTACHMENT_URL_EXT: RegExp;
|
|
19
23
|
export declare function isExcelFile(file: {
|
|
20
24
|
name?: string;
|
|
21
25
|
type?: string;
|
|
22
26
|
}): boolean;
|
|
27
|
+
export declare function isLocalAttachmentFile(file: {
|
|
28
|
+
name?: string;
|
|
29
|
+
type?: string;
|
|
30
|
+
}): boolean;
|
|
31
|
+
/** 对象存储的文件名后缀。扩展名不可信时按 Excel 处理,与原先只支持表格时一致。 */
|
|
32
|
+
export declare function localAttachmentStorageExt(filename?: string): string;
|
|
23
33
|
/**
|
|
24
34
|
* 对输入字符串中的反斜杠进行转义处理。
|
|
25
35
|
* 在 Markdown 解析等场景中,反斜杠有特殊含义,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/agent-cli-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.26.0-alpha.11",
|
|
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.
|
|
35
|
-
"@glodon-aiot/bot-client-sdk": "^3.
|
|
36
|
-
"@glodon-aiot/react-components": "^3.
|
|
34
|
+
"@glodon-aiot/apis": "^3.26.0-alpha.11",
|
|
35
|
+
"@glodon-aiot/bot-client-sdk": "^3.26.0-alpha.11",
|
|
36
|
+
"@glodon-aiot/react-components": "^3.26.0-alpha.11",
|
|
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",
|