@our-llm/shared 1.1.1 → 2.0.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/package.json +1 -1
- package/workflow-events.ts +10 -1
package/package.json
CHANGED
package/workflow-events.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* 字段映射:
|
|
8
8
|
* - t: threadId (线程ID)
|
|
9
|
+
* - ti: title (会话标题)
|
|
9
10
|
* - n: nodeId (节点ID)
|
|
10
11
|
* - c: content (内容)
|
|
11
12
|
* - r: reasoning (思维过程标记,1=true)
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
// 工作流开始事件的 data
|
|
17
18
|
export interface WorkflowStartData {
|
|
18
19
|
t: string // threadId
|
|
20
|
+
ti: string // title (会话标题,默认为工作流名称)
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
// 节点开始事件的 data
|
|
@@ -66,8 +68,13 @@ export interface ErrorData {
|
|
|
66
68
|
m: string // message
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
// 标题更新事件的 data
|
|
72
|
+
export interface TitleData {
|
|
73
|
+
ti: string // title (LLM 生成的会话标题)
|
|
74
|
+
}
|
|
75
|
+
|
|
69
76
|
// SSE 事件类型
|
|
70
|
-
export type SSEEventType = 'ws' | 'ns' | 'ne' | 'tk' | 'ok' | 'err' | 'l'
|
|
77
|
+
export type SSEEventType = 'ws' | 'ns' | 'ne' | 'tk' | 'ok' | 'err' | 'l' | 'tt'
|
|
71
78
|
|
|
72
79
|
// 事件类型映射(后端使用)
|
|
73
80
|
export const EventTypeMap = {
|
|
@@ -78,6 +85,7 @@ export const EventTypeMap = {
|
|
|
78
85
|
complete: 'ok',
|
|
79
86
|
error: 'err',
|
|
80
87
|
loading: 'l',
|
|
88
|
+
title: 'tt',
|
|
81
89
|
} as const
|
|
82
90
|
|
|
83
91
|
// 反向映射(前端使用)
|
|
@@ -89,4 +97,5 @@ export const EventTypeReverse = {
|
|
|
89
97
|
ok: 'complete',
|
|
90
98
|
err: 'error',
|
|
91
99
|
l: 'loading',
|
|
100
|
+
tt: 'title',
|
|
92
101
|
} as const
|