@oscloudlab/vgen-agent-assistant 0.0.20 → 0.0.22

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.
Binary file
Binary file
@@ -0,0 +1,4 @@
1
+ import { LeftChatPanelProps } from '../VgenAgent/type';
2
+
3
+ declare const LeftChatPanel: React.FC<LeftChatPanelProps>;
4
+ export default LeftChatPanel;
@@ -25,6 +25,8 @@ export interface VgenAgentProps {
25
25
  * - inline:左侧固定面板,参与宿主布局流、在宿主布局左侧占据固定宽度的一列并与卡片同高(内容区相应缩窄)
26
26
  */
27
27
  dockLayout?: 'float' | 'inline';
28
+ /** dock 形态切换回调(由 AI 学伴内右上角切换按钮触发,宿主据此更新 dockLayout) */
29
+ onDockLayoutChange?: (layout: 'float' | 'inline') => void;
28
30
  /** inline 固定面板展开态列宽(number 时按 px),缺省 320 */
29
31
  dockPanelWidth?: number | string;
30
32
  /** 外部 ref 转调(setQuotedText/sendMsg)的默认目标形态,弹窗保持旧行为不受影响 */
@@ -32,6 +34,9 @@ export interface VgenAgentProps {
32
34
  /** diffViewer 组件透传注入:结果卡差异区渲染(未注入时隐藏差异区);
33
35
  * 资源编辑差异锚点(rel_resource_edit)以 modal 形态调用,opts 携带确认/取消回调 */
34
36
  customDiffViewer?: (payload: DiffCardPayload, opts?: CustomDiffViewerOpts) => ReactNode;
37
+ /** dock 无引用态快捷 chips 自定义注入(boarding 宿主自定意图提示词);
38
+ * 不传回落 dockVM.GENERAL_CHIPS 默认组;QuickChip.icon 可选,缺省渲染默认消息图标 */
39
+ generalChips?: QuickChip[];
35
40
  /** dock 快捷 chips(send 模式)点击回调,未提供时默认按 label 直接发送 */
36
41
  onDockQuickAction?: (label: string) => void;
37
42
  /** dock 意图 CTA 点击回调(未提供时 dock 不渲染 CTA 按钮) */
@@ -299,7 +304,8 @@ export interface CustomDiffViewerOpts {
299
304
  }
300
305
  /** dock 快捷 chip */
301
306
  export interface QuickChip {
302
- icon: ComponentType<{
307
+ /** 缺省可不传,渲染处回落默认消息图标 */
308
+ icon?: ComponentType<{
303
309
  className?: string;
304
310
  }>;
305
311
  label: string;
@@ -340,6 +346,8 @@ export interface DockMessage {
340
346
  export interface BottomChatDockProps {
341
347
  /** 卡片状态 → 收起态把手提示词(dockHint 三态文案),缺省 'fresh' */
342
348
  state?: 'fresh' | 'adjusted' | 'expanded';
349
+ /** 形态切换回调(面板/浮窗内 Segmented 触发,参数为目标形态,VgenAgent 直绑 onDockLayoutChange) */
350
+ onSwitchLayout?: (layout: 'float' | 'inline') => void;
343
351
  /**
344
352
  * dock 消息列表(MessageProps[] 头插序,宿主用 toDockChatMessages 从 controller.messages
345
353
  * 纯过滤派生);渲染与主聊天统一,全部由 MessageContent 组件承载
@@ -373,6 +381,12 @@ export interface BottomChatDockProps {
373
381
  /** diffViewer 组件透传注入(结果卡差异区渲染,未注入时结果卡隐藏差异区);
374
382
  * 资源编辑差异锚点以 modal 形态调用,opts 含确认/取消变更回调 */
375
383
  customDiffViewer?: (payload: DiffCardPayload, opts?: CustomDiffViewerOpts) => ReactNode;
384
+ /** 无引用态快捷 chips 自定义注入(VgenAgent 从 props.generalChips 透传),不传回落 dockVM.GENERAL_CHIPS */
385
+ generalChips?: QuickChip[];
386
+ /** 头部「开启新对话」按钮回调(VgenAgent 透传 controller.addNewSession),不传不渲染该按钮 */
387
+ onNewSession?: () => void;
388
+ /** 头部「会话历史」Popover 内容(VgenAgent 透传 historyListRender 视图),不传不渲染该按钮 */
389
+ historyPanel?: ReactNode;
376
390
  }
377
391
  /**
378
392
  * 左侧固定形态面板(追加形态,不影响 BottomChatDock 浮窗):
@@ -381,7 +395,7 @@ export interface BottomChatDockProps {
381
395
  * 在宿主布局左侧占据固定宽度的一列并与卡片同高
382
396
  * (宿主提供挂载槽位,见 KnowledgeCard bottomDockLayout='inline' 布局)
383
397
  */
384
- export interface BottomChatPanelProps extends BottomChatDockProps {
398
+ export interface LeftChatPanelProps extends BottomChatDockProps {
385
399
  /** 展开态面板初始列宽兼拖拽下限(number 按 px 处理),缺省 320;resizable=true 时展开态可拖拽在
386
400
  * [width, 50vw] 区间内自由拉伸;收起态固定为左侧窄竖条,仍在布局内占位 */
387
401
  width?: number | string;
@@ -1,11 +1,11 @@
1
1
  import { default as VgenAgent } from './components/VgenAgent';
2
2
  import { default as BottomChatDock } from './components/BottomChatDock';
3
- import { default as BottomChatPanel } from './components/BottomChatPanel';
3
+ import { default as LeftChatPanel } from './components/LeftChatPanel';
4
4
  import { useVgenChat } from './hooks/useVgenChat';
5
5
  import { COOKIE_AVATAR, detectIntent, GENERAL_CHIPS, INTENT_REPLY, QUOTE_CHIPS, dockHint } from './components/BottomChatDock/dockVM';
6
6
 
7
7
  export default VgenAgent;
8
- export { BottomChatDock, BottomChatPanel, useVgenChat, COOKIE_AVATAR, detectIntent, GENERAL_CHIPS, INTENT_REPLY, QUOTE_CHIPS, dockHint, };
8
+ export { BottomChatDock, LeftChatPanel, LeftChatPanel as BottomChatPanel, useVgenChat, COOKIE_AVATAR, detectIntent, GENERAL_CHIPS, INTENT_REPLY, QUOTE_CHIPS, dockHint, };
9
9
  export { msgType, agentScene } from './components/VgenAgent/type';
10
- export type { VgenAgentProps, VgenAgentRefProps, viewModeType, videoInfoProps, knowledgeInfoProps, courseInfoProps, MessageProps, resourceType, recommendVideosProps, chatMsgResProps, saveMsgProps, sessionProps, AdjustmentKind, DiffCardPayload, QuickChip, DockResultData, DockMessage, BottomChatDockProps, BottomChatPanelProps, } from './components/VgenAgent/type';
10
+ export type { VgenAgentProps, VgenAgentRefProps, viewModeType, videoInfoProps, knowledgeInfoProps, courseInfoProps, MessageProps, resourceType, recommendVideosProps, chatMsgResProps, saveMsgProps, sessionProps, AdjustmentKind, DiffCardPayload, QuickChip, DockResultData, DockMessage, BottomChatDockProps, LeftChatPanelProps, LeftChatPanelProps as BottomChatPanelProps, } from './components/VgenAgent/type';
11
11
  export type { VgenChatController, UseVgenChatProps } from './hooks/useVgenChat';