@aix-chat/core 0.1.0 → 0.1.2

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.
@@ -69,7 +69,7 @@ export declare class ChatBridge {
69
69
  getInputRef(): BridgeInputRef | null;
70
70
  /**
71
71
  * 打开(或激活)副屏中的指定 tab。
72
- * tab 不存在时新建,已存在时更新 payload 并切换到该 tab。
72
+ * tab 不存在时新建,已存在时更新 params 并切换到该 tab。
73
73
  * 自动为每个 tab 创建一个 EventEmitter,供事件通信使用。
74
74
  */
75
75
  openPanelTab(tab: import('../types/panel').PanelTab): void;
@@ -101,7 +101,7 @@ export declare class ChatBridge {
101
101
  */
102
102
  emitPanelEvent(id: string, event: import('../types/panel').PanelEvent): void;
103
103
  /**
104
- * 获取指定 tab 的 EventEmitter(供 SidePanelContent 注入到 payload
104
+ * 获取指定 tab 的 EventEmitter(供 SidePanelContent 注入到组件 props
105
105
  */
106
106
  getPanelEventEmitter(id: string): EventEmitter | undefined;
107
107
  /**
@@ -143,7 +143,7 @@ export var ChatBridge = /*#__PURE__*/function () {
143
143
 
144
144
  /**
145
145
  * 打开(或激活)副屏中的指定 tab。
146
- * tab 不存在时新建,已存在时更新 payload 并切换到该 tab。
146
+ * tab 不存在时新建,已存在时更新 params 并切换到该 tab。
147
147
  * 自动为每个 tab 创建一个 EventEmitter,供事件通信使用。
148
148
  */
149
149
  }, {
@@ -231,16 +231,17 @@ export var ChatBridge = /*#__PURE__*/function () {
231
231
  }, {
232
232
  key: "emitPanelEvent",
233
233
  value: function emitPanelEvent(id, event) {
234
+ var _event$params;
234
235
  var emitter = this.panelEmitters.get(id);
235
236
  if (!emitter) {
236
237
  console.warn("[ChatBridge] No EventEmitter found for tab \"".concat(id, "\". Ensure openPanelTab was called."));
237
238
  return;
238
239
  }
239
- emitter.emit(event.type, event.payload);
240
+ emitter.emit(event.type, (_event$params = event.params) !== null && _event$params !== void 0 ? _event$params : event.payload);
240
241
  }
241
242
 
242
243
  /**
243
- * 获取指定 tab 的 EventEmitter(供 SidePanelContent 注入到 payload
244
+ * 获取指定 tab 的 EventEmitter(供 SidePanelContent 注入到组件 props
244
245
  */
245
246
  }, {
246
247
  key: "getPanelEventEmitter",
@@ -4,7 +4,11 @@ export interface PanelTab {
4
4
  title: string;
5
5
  /** 对应注册的渲染器 key,如 "dag" */
6
6
  type: string;
7
- /** OC event 透传的数据,SDK 不解析 */
7
+ /** 透传的业务数据(推荐使用) */
8
+ params?: Record<string, any>;
9
+ /**
10
+ * @deprecated 请使用 params。payload 保留为向后兼容别名,SDK 内部双写保证两者值相同。
11
+ */
8
12
  payload?: Record<string, any>;
9
13
  /** 是否显示关闭按钮,默认 false */
10
14
  closable?: boolean;
@@ -37,7 +41,7 @@ export type PanelAction = {
37
41
  };
38
42
  export interface PanelActionEvent {
39
43
  event: 'panel_action';
40
- /** 语义 ID:首次出现新建 tab,已存在则更新 payload */
44
+ /** 语义 ID:首次出现新建 tab,已存在则更新数据 */
41
45
  tabId: string;
42
46
  /** 仅首次建 tab 时必须提供 */
43
47
  type?: string;
@@ -45,7 +49,11 @@ export interface PanelActionEvent {
45
49
  title?: string;
46
50
  /** SDK 级别容器指令 */
47
51
  panelCommand?: 'expand' | 'collapse';
48
- /** 透传给组件,SDK 不解析 */
52
+ /** 透传给组件的业务数据(推荐使用) */
53
+ params?: Record<string, any>;
54
+ /**
55
+ * @deprecated 请使用 params。payload 保留为向后兼容别名。
56
+ */
49
57
  payload?: Record<string, any>;
50
58
  }
51
59
  export interface PanelHandle {
@@ -66,6 +74,10 @@ export interface PanelHandle {
66
74
  export interface PanelEvent {
67
75
  /** 事件类型,如 'highlight-node', 'reset-view' */
68
76
  type: string;
69
- /** 事件数据,任意结构 */
77
+ /** 事件数据(推荐使用) */
78
+ params?: Record<string, any>;
79
+ /**
80
+ * @deprecated 请使用 params。payload 保留为向后兼容别名。
81
+ */
70
82
  payload?: Record<string, any>;
71
83
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aix-chat/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Aix-Chat 核心业务逻辑包,提供聊天会话管理、消息处理、插件扩展等核心能力",
5
5
  "keywords": [
6
6
  "chat",