@glodon-aiot/agent-cli-ui 3.3.6-alpha.1 → 3.3.7-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.
Files changed (40) hide show
  1. package/dist/es/Dialog/AgentChat/index.mjs +347 -362
  2. package/dist/es/Dialog/SessionList/index.mjs +172 -252
  3. package/dist/es/Dialog/index.mjs +76 -83
  4. package/dist/es/QuillEditor/index.mjs +70 -59
  5. package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
  6. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  7. package/dist/es/src/style10.css +1 -1
  8. package/dist/es/src/style12.css +1 -1
  9. package/dist/es/src/style14.css +1 -1
  10. package/dist/es/src/style15.css +1 -1
  11. package/dist/es/src/style16.css +1 -1
  12. package/dist/es/src/style18.css +1 -1
  13. package/dist/es/src/style19.css +1 -1
  14. package/dist/es/src/style20.css +1 -1
  15. package/dist/es/src/style21.css +1 -1
  16. package/dist/es/src/style22.css +1 -1
  17. package/dist/es/src/style23.css +1 -1
  18. package/dist/es/src/style24.css +1 -1
  19. package/dist/es/src/style26.css +1 -1
  20. package/dist/es/src/style27.css +1 -1
  21. package/dist/es/src/style28.css +1 -1
  22. package/dist/es/src/style29.css +1 -1
  23. package/dist/es/src/style30.css +1 -1
  24. package/dist/es/src/style31.css +1 -1
  25. package/dist/es/src/style6.css +1 -1
  26. package/dist/es/src/style7.css +1 -1
  27. package/dist/es/src/style8.css +1 -1
  28. package/dist/es/src/style9.css +1 -1
  29. package/dist/lib/index.css +1 -1
  30. package/dist/lib/index.js +56 -56
  31. package/dist/src/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.d.ts +5 -4
  32. package/dist/src/Dialog/AgentChat/index.d.ts +0 -2
  33. package/dist/src/Dialog/SessionList/index.d.ts +3 -6
  34. package/dist/src/context/SessionContext.d.ts +15 -0
  35. package/dist/src/hooks/useSessionState.d.ts +7 -0
  36. package/package.json +3 -3
  37. package/dist/es/Dialog/AgentChat/Tools/SessionHistoryDrawer/index.mjs +0 -74
  38. package/dist/es/components/Sider/index.mjs +0 -24
  39. package/dist/es/src/style32.css +0 -1
  40. package/dist/es/src/style33.css +0 -1
@@ -3,12 +3,13 @@ import { Session } from '@glodon-aiot/bot-client-sdk';
3
3
  import { IApplication } from '@glodon-aiot/apis';
4
4
  interface SessionHistoryDrawerProps {
5
5
  disabled?: boolean;
6
- currentSession?: Session;
6
+ currentSession?: Session | null;
7
7
  application: IApplication;
8
8
  networkStatus: boolean;
9
- setCurrentSession?: Dispatch<SetStateAction<Session | undefined>>;
10
- sessions: Session[];
11
- setSessions: Dispatch<SetStateAction<Session[]>>;
9
+ setCurrentSession?: Dispatch<SetStateAction<Session | null | undefined>>;
10
+ isSessionHistoryVisible: boolean;
11
+ setIsSessionHistoryVisible: Dispatch<SetStateAction<boolean>>;
12
+ onSessionChange?: (session: Session) => void;
12
13
  }
13
14
  declare const SessionHistoryDrawer: FC<SessionHistoryDrawerProps>;
14
15
  export default SessionHistoryDrawer;
@@ -14,8 +14,6 @@ interface AgentChatProps {
14
14
  setCurrentSession?: Dispatch<SetStateAction<Session | undefined>>;
15
15
  networkStatus: boolean;
16
16
  setNetworkStatus: Dispatch<SetStateAction<boolean>>;
17
- sessions: Session[];
18
- setSessions: Dispatch<SetStateAction<Session[]>>;
19
17
  }
20
18
  declare const AgentChat: React.FC<AgentChatProps>;
21
19
  export default AgentChat;
@@ -1,19 +1,16 @@
1
1
  import { default as React, Dispatch, SetStateAction } from 'react';
2
2
  import { Session } from '@glodon-aiot/bot-client-sdk';
3
3
  import { IKnowledge, IApplication, ISessionParams } from '@glodon-aiot/apis';
4
- export interface SessionListProps {
5
- appId?: string;
4
+ interface SessionListProps {
5
+ appId: string;
6
6
  application?: IApplication;
7
+ sider?: boolean;
7
8
  networkStatus: boolean;
8
9
  currentSession?: Session;
9
10
  setCurrentSession?: Dispatch<SetStateAction<Session | undefined>>;
10
11
  reload?: VoidFunction;
11
12
  checkKnowledges?: IKnowledge[];
12
13
  setCheckKnowledges?: Dispatch<SetStateAction<IKnowledge[] | undefined>>;
13
- isShowHeader?: boolean;
14
- sessions: Session[];
15
- setSessions: Dispatch<SetStateAction<Session[]>>;
16
- afterSessionClick?: (session: Session) => void;
17
14
  }
18
15
  export interface SessionListRef {
19
16
  create: (param: ISessionParams & {
@@ -0,0 +1,15 @@
1
+ import { default as React, ReactNode, Dispatch, SetStateAction } from 'react';
2
+ import { Session } from '@glodon-aiot/bot-client-sdk';
3
+ export interface SessionContextValue {
4
+ sessions: Session[];
5
+ setSessions: Dispatch<SetStateAction<Session[]>>;
6
+ isSwitchingToExistingSession: boolean;
7
+ setIsSwitchingToExistingSession: Dispatch<SetStateAction<boolean>>;
8
+ }
9
+ declare const SessionContext: React.Context<SessionContextValue | undefined>;
10
+ export interface SessionProviderProps {
11
+ children: ReactNode;
12
+ }
13
+ export declare const SessionProvider: React.FC<SessionProviderProps>;
14
+ export declare const useSessionContext: () => SessionContextValue;
15
+ export default SessionContext;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 统一的会话状态管理hook
3
+ * 用于管理会话列表和会话切换状态
4
+ * 现在使用Context来确保全局状态同步
5
+ */
6
+ export declare const useSessionState: () => import('../context/SessionContext').SessionContextValue;
7
+ export default useSessionState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glodon-aiot/agent-cli-ui",
3
- "version": "3.3.6-alpha.1",
3
+ "version": "3.3.7-beta.1",
4
4
  "module": "./dist/es/index.mjs",
5
5
  "main": "./dist/lib/index.js",
6
6
  "typings": "./dist/src/index.d.ts",
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@ant-design/icons": "^5.3.4",
40
- "@glodon-aiot/apis": "^3.3.6-alpha.1",
41
- "@glodon-aiot/bot-client-sdk": "^3.3.6-alpha.1",
40
+ "@glodon-aiot/apis": "^3.3.7-beta.1",
41
+ "@glodon-aiot/bot-client-sdk": "^3.3.7-beta.1",
42
42
  "@matejmazur/react-mathjax": "^0.1.10",
43
43
  "@react-pdf-viewer/core": "^3.12.0",
44
44
  "@react-pdf-viewer/default-layout": "^3.12.0",
@@ -1,74 +0,0 @@
1
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
- import { Popover as S, Button as h, Drawer as C } from "antd";
3
- import { useState as w, useContext as x } from "react";
4
- /* empty css */import b from "../../../../components/Iconfont/index.mjs";
5
- import g from "../../../../context.mjs";
6
- import v from "../../../../components/Sider/index.mjs";
7
- const V = (a) => {
8
- const {
9
- currentSession: s,
10
- disabled: l = !1,
11
- application: c,
12
- networkStatus: m,
13
- setCurrentSession: d,
14
- sessions: p,
15
- // 👈 新增
16
- setSessions: f
17
- // 👈 新增
18
- } = a, [y, t] = w(!1), {
19
- popupContainer: o
20
- } = x(g);
21
- return /* @__PURE__ */ u("div", {
22
- className: "session-history-drawer-component",
23
- children: [/* @__PURE__ */ e(S, {
24
- placement: "topRight",
25
- showArrow: !1,
26
- overlayClassName: "session-history-overlay",
27
- overlayStyle: {
28
- padding: "4px"
29
- },
30
- getPopupContainer: (i) => i.parentNode,
31
- content: "会话历史记录",
32
- children: /* @__PURE__ */ e(h, {
33
- className: "history-overlay-action",
34
- disabled: l,
35
- type: "text",
36
- icon: /* @__PURE__ */ e(b, {
37
- type: "icon-lishijilu",
38
- style: {
39
- fontSize: 24
40
- }
41
- }),
42
- onClick: () => t(!0)
43
- })
44
- }), y && /* @__PURE__ */ e(C, {
45
- title: "分组会话列表",
46
- open: !0,
47
- placement: "bottom",
48
- onClose: () => t(!1),
49
- className: "session-history-drawer",
50
- size: "large",
51
- getContainer: () => (o == null ? void 0 : o.current) || document.body,
52
- destroyOnClose: !0,
53
- style: {
54
- position: "absolute"
55
- },
56
- children: /* @__PURE__ */ e(v, {
57
- isShowHeader: !1,
58
- application: c,
59
- networkStatus: m,
60
- currentSession: s,
61
- setCurrentSession: d,
62
- sessions: p,
63
- setSessions: f,
64
- afterSessionClick: (i) => {
65
- var r, n;
66
- ((r = i.data) == null ? void 0 : r.id) !== ((n = s == null ? void 0 : s.data) == null ? void 0 : n.id) && t(!1);
67
- }
68
- })
69
- })]
70
- });
71
- };
72
- export {
73
- V as default
74
- };
@@ -1,24 +0,0 @@
1
- var a = Object.defineProperty;
2
- var o = Object.getOwnPropertySymbols;
3
- var d = Object.prototype.hasOwnProperty, f = Object.prototype.propertyIsEnumerable;
4
- var s = (e, r, i) => r in e ? a(e, r, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[r] = i, t = (e, r) => {
5
- for (var i in r || (r = {}))
6
- d.call(r, i) && s(e, i, r[i]);
7
- if (o)
8
- for (var i of o(r))
9
- f.call(r, i) && s(e, i, r[i]);
10
- return e;
11
- };
12
- import { jsx as m } from "react/jsx-runtime";
13
- import { forwardRef as n } from "react";
14
- import p from "../../Dialog/SessionList/index.mjs";
15
- /* empty css */const c = n((e, r) => /* @__PURE__ */ m("div", {
16
- className: "sider-container",
17
- children: /* @__PURE__ */ m(p, t({
18
- ref: r
19
- }, e))
20
- }));
21
- c.displayName = "Sider";
22
- export {
23
- c as default
24
- };
@@ -1 +0,0 @@
1
- .gbot-dialog-modal .ant-drawer-content-wrapper{height:calc(100% - 54px)!important;border-radius:12px 12px 0 0}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-header{padding:12px 16px;border-bottom:none}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-header .ant-drawer-header-title{justify-content:space-between;flex-direction:row-reverse;font-size:16px;color:#393939}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-header .ant-drawer-header-title .ant-drawer-close{margin:0;padding:0}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body{padding:0 16px 26px}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel{max-height:124px;width:100%;padding:2px 0;border-bottom:1px solid #e8e9eb}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .session-item-space{padding:10px 0;overflow:hidden}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel:hover{cursor:pointer}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .ant-space{width:100%}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question{font-size:14px;font-weight:700;line-height:21px;color:#070c14;width:100%;display:flex;align-items:center;justify-content:space-between}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .ant-tag{width:58px;height:24px;padding:1px 8px;border-radius:4px;font-size:14px;font-weight:400;background-color:#9c24f2;color:#fff}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .session-item-name{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .icons-bar{display:flex}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .icons-bar .ant-btn{margin:0 3px}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .ant-btn{width:20px;height:20px;padding:0;font-size:12px;color:#000}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .name-edit-panel{width:100%;position:relative}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .name-edit-panel .name-edit-input{width:100%}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .name-edit-panel .name-edit-input .ant-input-show-count-suffix{font-size:12px;font-weight:400;color:#e0e0e0;margin-right:60px}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .name-edit-panel .ant-btn{position:absolute;right:12px;top:7px;z-index:999}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-question .name-edit-panel .ant-btn .anticon{font-size:14px}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-answer{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#84868c}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-file{font-size:12px;color:#84868c}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-file .file-icon{width:16px;height:16px}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-file .file-name{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-file .ant-tag{font-size:10px;border:1px solid #84868c;background-color:transparent;color:#84868c}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-file .file-status-icon{position:absolute;left:6px;top:-2px;border-radius:10px;border:1px solid #fff}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-file .success-file-icon{color:#45cc27}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-file .failed-file-icon{color:#dc4446}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .session-item-panel .item-file .loading-file-icon{height:12px;width:12px;font-size:10px;background-color:#fff}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .current-item{margin:2px 0}.gbot-dialog-modal .ant-drawer-content-wrapper .ant-drawer-body .current-item .session-item-space{border-radius:8px;background-color:#f9f2ff;padding:8px}.gbot-dialog-modal .loading-panel .ant-drawer-body{display:flex;justify-content:center;align-items:center}
@@ -1 +0,0 @@
1
- .gbot-dialog-modal .prompt-list-wrap{width:100%;height:250px}.gbot-dialog-modal .prompt-list-wrap .prompt-list{height:204px;overflow:auto;width:100%}.gbot-dialog-modal .prompt-list-wrap .prompt-list-footer{height:46px;display:flex;align-items:center;border-top:1px solid #f0f0f0;padding:0 16px;margin:0 -16px}.gbot-dialog-modal .prompt-list-wrap .prompt-list-item{height:51px;padding:4px;display:flex;justify-content:space-between;overflow:hidden}.gbot-dialog-modal .prompt-list-wrap .prompt-list-item-body{flex-grow:1;overflow:hidden}.gbot-dialog-modal .prompt-list-wrap .prompt-list-item-title{font-size:14px}.gbot-dialog-modal .prompt-list-wrap .prompt-list-item-title .hightlight{color:#9c24f2}.gbot-dialog-modal .prompt-list-wrap .prompt-list-item-context{line-height:21px;font-size:12px;width:100%}.gbot-dialog-modal .prompt-list-wrap .prompt-list-item-actions{display:none;align-items:center}.gbot-dialog-modal .prompt-list-wrap .prompt-list-item-actions .ant-btn{color:#9c24f2}.gbot-dialog-modal .prompt-list-wrap .prompt-list-item:hover{background-color:#f9f2ff;cursor:pointer}.gbot-dialog-modal .prompt-list-wrap .prompt-list-item:hover .prompt-list-item-actions{display:flex}.gbot-dialog-modal .prompt-list-wrap .prompt-list-empty{max-width:500px;margin:0 auto;overflow:hidden}.gbot-dialog-modal .prompt-list-wrap .prompt-list-empty-tips{height:124px;overflow:hidden;width:100%;display:flex;flex-direction:row;justify-content:space-around;align-items:flex-end}.gbot-dialog-modal .prompt-list-wrap .prompt-list-empty-tips-item{width:200px;font-size:12px;display:flex;flex-direction:column}.gbot-dialog-modal .prompt-list-wrap .prompt-list-empty-tips-item img{max-width:100%;margin-bottom:16px}.gbot-dialog-modal .prompt-list-wrap .add-prompt-btn{padding-left:0}