@glodon-aiot/agent-cli-ui 3.3.2 → 3.3.4-beta.1
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/AgentClientUI.mjs +121 -109
- package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +156 -142
- package/dist/es/Dialog/AgentChat/PromptSetting/index.mjs +83 -98
- package/dist/es/Dialog/AgentChat/index.mjs +330 -313
- package/dist/es/Dialog/SessionList/index.mjs +35 -34
- package/dist/es/Dialog/index.mjs +101 -94
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +394 -0
- package/dist/es/ReactTextGenerationUI/components/fetchEventSource/fetch.mjs +112 -0
- package/dist/es/ReactTextGenerationUI/components/fetchEventSource/parse.mjs +97 -0
- package/dist/es/ReactTextGenerationUI/index.mjs +81 -0
- package/dist/es/components/FilePreview/index.mjs +26 -25
- package/dist/es/index.mjs +402 -217
- package/dist/es/node_modules/moment/dist/moment.mjs +2301 -0
- package/dist/es/packages/agent-cli-ui/package.json.mjs +162 -0
- package/dist/es/packages/react-components/dist/es/components/Markdown/ATag/index.mjs +27 -25
- package/dist/es/packages/react-components/dist/es/components/Markdown/Image/index.mjs +29 -27
- package/dist/es/packages/react-components/dist/es/components/Markdown/index.mjs +58 -48
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style.css +1 -1
- package/dist/es/src/style10.css +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style2.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style21.css +1 -1
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style26.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style3.css +1 -1
- package/dist/es/src/style30.css +1 -0
- package/dist/es/src/style31.css +1 -0
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +69 -58
- package/dist/src/AgentClientUI.d.ts +10 -2
- package/dist/src/Dialog/AgentChat/HistoryItem/index.d.ts +2 -0
- package/dist/src/Dialog/SessionList/index.d.ts +1 -0
- package/dist/src/Dialog/index.d.ts +9 -1
- package/dist/src/index.d.ts +11 -2
- package/dist/src/types.d.ts +8 -3
- package/package.json +3 -3
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
import { AgentClientProps } from './types';
|
|
3
|
-
|
|
3
|
+
import { Session } from '@glodon-aiot/bot-client-sdk';
|
|
4
|
+
import { IKnowledge, ISessionParams } from '@glodon-aiot/apis';
|
|
5
|
+
export interface AgentClientRefProps {
|
|
6
|
+
sessionCreate: (params: ISessionParams & {
|
|
7
|
+
knowledges?: IKnowledge[];
|
|
8
|
+
}) => Promise<Session> | undefined;
|
|
9
|
+
getSessionList: () => Promise<Session[]> | undefined;
|
|
10
|
+
}
|
|
11
|
+
declare const AgentClientUI: React.ForwardRefExoticComponent<AgentClientProps & React.RefAttributes<AgentClientRefProps>>;
|
|
4
12
|
export default AgentClientUI;
|
|
@@ -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 { MarkdownProps } from '@glodon-aiot/react-components/dist/src/components/Markdown';
|
|
4
5
|
interface HistoryItemProps {
|
|
5
6
|
application: IApplication;
|
|
6
7
|
currentSession?: Session;
|
|
@@ -12,6 +13,7 @@ interface HistoryItemProps {
|
|
|
12
13
|
isLoading?: boolean;
|
|
13
14
|
docViewerUrl?: string;
|
|
14
15
|
actions?: boolean;
|
|
16
|
+
markdown?: Partial<MarkdownProps>;
|
|
15
17
|
}
|
|
16
18
|
export declare const isResultExec: (result?: string) => boolean;
|
|
17
19
|
declare const HistoryItem: React.FC<HistoryItemProps>;
|
|
@@ -16,6 +16,7 @@ export interface SessionListRef {
|
|
|
16
16
|
create: (param: ISessionParams & {
|
|
17
17
|
knowledges?: IKnowledge[];
|
|
18
18
|
}) => Promise<Session> | any;
|
|
19
|
+
list: () => Promise<Session[]>;
|
|
19
20
|
}
|
|
20
21
|
declare const SessionList: React.ForwardRefExoticComponent<SessionListProps & React.RefAttributes<SessionListRef>>;
|
|
21
22
|
export default SessionList;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Session } from '@glodon-aiot/bot-client-sdk';
|
|
2
|
+
import { ISessionParams, IKnowledge } from '@glodon-aiot/apis';
|
|
1
3
|
import { default as React, CSSProperties } from 'react';
|
|
2
4
|
interface DialogProps {
|
|
3
5
|
appId: string;
|
|
@@ -5,5 +7,11 @@ interface DialogProps {
|
|
|
5
7
|
bodyStyle?: CSSProperties;
|
|
6
8
|
sessionId?: string;
|
|
7
9
|
}
|
|
8
|
-
|
|
10
|
+
export interface DialogRefProps {
|
|
11
|
+
sessionCreate: (params: ISessionParams & {
|
|
12
|
+
knowledges?: IKnowledge[];
|
|
13
|
+
}) => Promise<Session> | undefined;
|
|
14
|
+
getSessionList: () => Promise<Session[]> | undefined;
|
|
15
|
+
}
|
|
16
|
+
declare const Dialog: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<DialogRefProps>>;
|
|
9
17
|
export default Dialog;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AgentClientUIConfig, AgentClientMode, InitalData, Env } from './types';
|
|
2
|
-
import { BotClientApi, ISession } from '@glodon-aiot/apis';
|
|
2
|
+
import { BotClientApi, IKnowledge, ISession, ISessionParams } from '@glodon-aiot/apis';
|
|
3
|
+
import { Session, BotClient } from '@glodon-aiot/bot-client-sdk';
|
|
3
4
|
export default class AgentClientUI {
|
|
4
5
|
private _token;
|
|
5
6
|
private _activeSession;
|
|
@@ -7,9 +8,11 @@ export default class AgentClientUI {
|
|
|
7
8
|
private _defaultInputText;
|
|
8
9
|
private _inputDisabled;
|
|
9
10
|
private _defatulSessionId;
|
|
11
|
+
private _agentClientRef;
|
|
10
12
|
readonly apiUrl: string;
|
|
11
13
|
readonly docViewerUrl: string;
|
|
12
14
|
readonly env: Env;
|
|
15
|
+
readonly stream: boolean | undefined;
|
|
13
16
|
service: BotClientApi;
|
|
14
17
|
private rId;
|
|
15
18
|
_mode: AgentClientMode;
|
|
@@ -18,6 +21,7 @@ export default class AgentClientUI {
|
|
|
18
21
|
token?: (error: Error) => void;
|
|
19
22
|
};
|
|
20
23
|
wrapper: HTMLElement;
|
|
24
|
+
botClient: BotClient | null;
|
|
21
25
|
constructor(config: InitalData);
|
|
22
26
|
get token(): string;
|
|
23
27
|
set token(v: string);
|
|
@@ -31,6 +35,11 @@ export default class AgentClientUI {
|
|
|
31
35
|
input(message: string): void;
|
|
32
36
|
disable(): void;
|
|
33
37
|
enable(): void;
|
|
34
|
-
|
|
38
|
+
getSessionList(): Promise<Session[]>;
|
|
39
|
+
sessionCreate(params?: ISessionParams & {
|
|
40
|
+
knowledges?: IKnowledge[];
|
|
41
|
+
}): Promise<Session>;
|
|
42
|
+
createBotClientSDK(): Promise<BotClient>;
|
|
43
|
+
render(): Promise<void>;
|
|
35
44
|
destroy(callback?: VoidFunction): void;
|
|
36
45
|
}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BotClient, AgentPluginMap, Session, MCPConfig } from '@glodon-aiot/bot-client-sdk';
|
|
2
|
-
import { BotClientApi, ICommentParam, ISession, IChatMessage, IHistory, IKnowledge, ISessionPrompt, ISearchReference } from '@glodon-aiot/apis';
|
|
2
|
+
import { BotClientApi, ICommentParam, ISession, IChatMessage, IHistory, IKnowledge, ISessionPrompt, ISearchReference, IApplication } from '@glodon-aiot/apis';
|
|
3
3
|
import { Theme } from 'antd/es/config-provider/context';
|
|
4
4
|
import { CSSProperties } from 'react';
|
|
5
|
+
import { MarkdownProps } from '@glodon-aiot/react-components/dist/src/components/Markdown';
|
|
5
6
|
export type Env = 'dev' | 'test' | 'prod' | 'local';
|
|
6
7
|
export type AgentClientMode = 'float' | 'inlay';
|
|
7
8
|
export declare enum ApiUrl {
|
|
@@ -87,6 +88,7 @@ export interface AgentFeaturesConfig {
|
|
|
87
88
|
visible?: boolean;
|
|
88
89
|
default?: ISessionPrompt[];
|
|
89
90
|
};
|
|
91
|
+
markdown?: Partial<MarkdownProps>;
|
|
90
92
|
}
|
|
91
93
|
type CommentListener = (payload: {
|
|
92
94
|
applicationId: string;
|
|
@@ -147,7 +149,6 @@ export interface AgentClientDefaultProps {
|
|
|
147
149
|
service?: BotClientApi;
|
|
148
150
|
popupContainer?: React.RefObject<HTMLDivElement>;
|
|
149
151
|
token?: string;
|
|
150
|
-
agentClient?: BotClient;
|
|
151
152
|
debug?: boolean;
|
|
152
153
|
plugins?: AgentPluginMap;
|
|
153
154
|
mcp?: MCPConfig;
|
|
@@ -175,11 +176,12 @@ export interface AgentClientDefaultProps {
|
|
|
175
176
|
customItems?: {
|
|
176
177
|
icon: string;
|
|
177
178
|
name: string;
|
|
178
|
-
onClick: () => void;
|
|
179
179
|
position: 'left' | 'right';
|
|
180
180
|
visible?: boolean;
|
|
181
181
|
}[];
|
|
182
182
|
};
|
|
183
|
+
stream?: boolean;
|
|
184
|
+
agentClient?: BotClient;
|
|
183
185
|
}
|
|
184
186
|
interface DataEventListeners {
|
|
185
187
|
comment: CommentListener;
|
|
@@ -213,6 +215,8 @@ export interface InitalData extends AgentClientUIConfig {
|
|
|
213
215
|
refreshToken?: () => Promise<string>;
|
|
214
216
|
};
|
|
215
217
|
bodyStyle?: CSSProperties;
|
|
218
|
+
getSessionList?: any;
|
|
219
|
+
sessionCreate?: any;
|
|
216
220
|
}
|
|
217
221
|
export interface AgentClientProps extends AgentClientDefaultProps {
|
|
218
222
|
service: BotClientApi;
|
|
@@ -224,5 +228,6 @@ export interface AgentClientProps extends AgentClientDefaultProps {
|
|
|
224
228
|
apiUrl?: string;
|
|
225
229
|
sessionId?: string;
|
|
226
230
|
disabled?: boolean;
|
|
231
|
+
application: IApplication;
|
|
227
232
|
}
|
|
228
233
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/agent-cli-ui",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.4-beta.1",
|
|
4
4
|
"module": "./dist/es/index.mjs",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"typings": "./dist/src/index.d.ts",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ant-design/icons": "^5.3.4",
|
|
37
|
-
"@glodon-aiot/apis": "^3.3.
|
|
38
|
-
"@glodon-aiot/bot-client-sdk": "^3.3.
|
|
37
|
+
"@glodon-aiot/apis": "^3.3.4-beta.1",
|
|
38
|
+
"@glodon-aiot/bot-client-sdk": "^3.3.4-beta.1",
|
|
39
39
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
40
40
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
41
41
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|