@kernl-sdk/protocol 0.4.2 → 0.5.0
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +38 -0
- package/dist/language-model/item.d.ts +2 -2
- package/dist/language-model/stream.d.ts +12 -12
- package/dist/language-model/stream.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/language-model/item.ts +2 -2
- package/src/language-model/stream.ts +12 -12
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @kernl/protocol
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8815744: **BREAKING:** Refactor event kind naming from kebab-case to dot notation
|
|
8
|
+
|
|
9
|
+
This aligns the language model stream/item kinds with the existing realtime events naming convention.
|
|
10
|
+
|
|
11
|
+
### Kind value changes
|
|
12
|
+
|
|
13
|
+
| Old | New |
|
|
14
|
+
| ------------------ | ------------------ |
|
|
15
|
+
| `tool-call` | `tool.call` |
|
|
16
|
+
| `tool-result` | `tool.result` |
|
|
17
|
+
| `text-start` | `text.start` |
|
|
18
|
+
| `text-delta` | `text.delta` |
|
|
19
|
+
| `text-end` | `text.end` |
|
|
20
|
+
| `reasoning-start` | `reasoning.start` |
|
|
21
|
+
| `reasoning-delta` | `reasoning.delta` |
|
|
22
|
+
| `reasoning-end` | `reasoning.end` |
|
|
23
|
+
| `tool-input-start` | `tool.input.start` |
|
|
24
|
+
| `tool-input-delta` | `tool.input.delta` |
|
|
25
|
+
| `tool-input-end` | `tool.input.end` |
|
|
26
|
+
| `stream-start` | `stream.start` |
|
|
27
|
+
|
|
28
|
+
### ToolInputStartEvent: `toolName` → `toolId`
|
|
29
|
+
|
|
30
|
+
The `ToolInputStartEvent` now uses `toolId` to match `ToolCall` and `ToolResult`.
|
|
31
|
+
|
|
32
|
+
### Migration
|
|
33
|
+
|
|
34
|
+
If you have persisted thread events, run:
|
|
35
|
+
|
|
36
|
+
```sql
|
|
37
|
+
UPDATE thread_events SET kind = 'tool.call' WHERE kind = 'tool-call';
|
|
38
|
+
UPDATE thread_events SET kind = 'tool.result' WHERE kind = 'tool-result';
|
|
39
|
+
```
|
|
40
|
+
|
|
3
41
|
## 0.4.2
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -144,7 +144,7 @@ export type Message = SystemMessage | AssistantMessage | UserMessage;
|
|
|
144
144
|
* Tool calls that the model has generated.
|
|
145
145
|
*/
|
|
146
146
|
export interface ToolCall extends LanguageModelItemBase {
|
|
147
|
-
readonly kind: "tool
|
|
147
|
+
readonly kind: "tool.call";
|
|
148
148
|
/**
|
|
149
149
|
* The identifier of the tool call. It must be unique across all tool calls.
|
|
150
150
|
*/
|
|
@@ -166,7 +166,7 @@ export interface ToolCall extends LanguageModelItemBase {
|
|
|
166
166
|
* Result of a tool call that has been executed by the provider.
|
|
167
167
|
*/
|
|
168
168
|
export interface ToolResult extends LanguageModelItemBase {
|
|
169
|
-
readonly kind: "tool
|
|
169
|
+
readonly kind: "tool.result";
|
|
170
170
|
/**
|
|
171
171
|
* The ID of the tool call that this result is associated with.
|
|
172
172
|
*/
|
|
@@ -22,21 +22,21 @@ export interface StreamEventBase {
|
|
|
22
22
|
* Stream event indicating the start of a text output.
|
|
23
23
|
*/
|
|
24
24
|
export interface TextStartEvent extends StreamEventBase {
|
|
25
|
-
readonly kind: "text
|
|
25
|
+
readonly kind: "text.start";
|
|
26
26
|
id: string;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Stream event indicating the end of a text output.
|
|
30
30
|
*/
|
|
31
31
|
export interface TextEndEvent extends StreamEventBase {
|
|
32
|
-
readonly kind: "text
|
|
32
|
+
readonly kind: "text.end";
|
|
33
33
|
id: string;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Stream event containing a delta (chunk) of text output.
|
|
37
37
|
*/
|
|
38
38
|
export interface TextDeltaEvent extends StreamEventBase {
|
|
39
|
-
readonly kind: "text
|
|
39
|
+
readonly kind: "text.delta";
|
|
40
40
|
id: string;
|
|
41
41
|
/**
|
|
42
42
|
* The incremental text chunk.
|
|
@@ -47,21 +47,21 @@ export interface TextDeltaEvent extends StreamEventBase {
|
|
|
47
47
|
* Stream event indicating the start of reasoning output.
|
|
48
48
|
*/
|
|
49
49
|
export interface ReasoningStartEvent extends StreamEventBase {
|
|
50
|
-
readonly kind: "reasoning
|
|
50
|
+
readonly kind: "reasoning.start";
|
|
51
51
|
id: string;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Stream event indicating the end of reasoning output.
|
|
55
55
|
*/
|
|
56
56
|
export interface ReasoningEndEvent extends StreamEventBase {
|
|
57
|
-
readonly kind: "reasoning
|
|
57
|
+
readonly kind: "reasoning.end";
|
|
58
58
|
id: string;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Stream event containing a delta (chunk) of reasoning output.
|
|
62
62
|
*/
|
|
63
63
|
export interface ReasoningDeltaEvent extends StreamEventBase {
|
|
64
|
-
readonly kind: "reasoning
|
|
64
|
+
readonly kind: "reasoning.delta";
|
|
65
65
|
id: string;
|
|
66
66
|
/**
|
|
67
67
|
* The incremental reasoning text chunk.
|
|
@@ -72,12 +72,12 @@ export interface ReasoningDeltaEvent extends StreamEventBase {
|
|
|
72
72
|
* Stream event indicating the start of tool input generation.
|
|
73
73
|
*/
|
|
74
74
|
export interface ToolInputStartEvent extends StreamEventBase {
|
|
75
|
-
readonly kind: "tool
|
|
75
|
+
readonly kind: "tool.input.start";
|
|
76
76
|
id: string;
|
|
77
77
|
/**
|
|
78
|
-
* The
|
|
78
|
+
* The identifier of the tool being called.
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
toolId: string;
|
|
81
81
|
/**
|
|
82
82
|
* Optional title for the tool call.
|
|
83
83
|
*/
|
|
@@ -87,14 +87,14 @@ export interface ToolInputStartEvent extends StreamEventBase {
|
|
|
87
87
|
* Stream event indicating the end of tool input generation.
|
|
88
88
|
*/
|
|
89
89
|
export interface ToolInputEndEvent extends StreamEventBase {
|
|
90
|
-
readonly kind: "tool
|
|
90
|
+
readonly kind: "tool.input.end";
|
|
91
91
|
id: string;
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
94
|
* Stream event containing a delta (chunk) of tool input.
|
|
95
95
|
*/
|
|
96
96
|
export interface ToolInputDeltaEvent extends StreamEventBase {
|
|
97
|
-
readonly kind: "tool
|
|
97
|
+
readonly kind: "tool.input.delta";
|
|
98
98
|
id: string;
|
|
99
99
|
/**
|
|
100
100
|
* The incremental tool input chunk.
|
|
@@ -105,7 +105,7 @@ export interface ToolInputDeltaEvent extends StreamEventBase {
|
|
|
105
105
|
* Stream event indicating the start of agent execution.
|
|
106
106
|
*/
|
|
107
107
|
export interface StartEvent extends StreamEventBase {
|
|
108
|
-
readonly kind: "stream
|
|
108
|
+
readonly kind: "stream.start";
|
|
109
109
|
/**
|
|
110
110
|
* Warnings for the call (e.g., unsupported settings).
|
|
111
111
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/language-model/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EACV,yBAAyB,EACzB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAChC,cAAc,GACd,cAAc,GACd,YAAY,GACZ,OAAO,GACP,mBAAmB,GACnB,mBAAmB,GACnB,iBAAiB,GACjB,SAAS,GACT,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,GACnB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C;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,eAAe;IACjD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,eAAe;IACjD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,eAAe;IAC/C,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;CACnB"}
|
package/package.json
CHANGED
|
@@ -195,7 +195,7 @@ export type Message = SystemMessage | AssistantMessage | UserMessage;
|
|
|
195
195
|
* Tool calls that the model has generated.
|
|
196
196
|
*/
|
|
197
197
|
export interface ToolCall extends LanguageModelItemBase {
|
|
198
|
-
readonly kind: "tool
|
|
198
|
+
readonly kind: "tool.call";
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* The identifier of the tool call. It must be unique across all tool calls.
|
|
@@ -222,7 +222,7 @@ export interface ToolCall extends LanguageModelItemBase {
|
|
|
222
222
|
* Result of a tool call that has been executed by the provider.
|
|
223
223
|
*/
|
|
224
224
|
export interface ToolResult extends LanguageModelItemBase {
|
|
225
|
-
readonly kind: "tool
|
|
225
|
+
readonly kind: "tool.result";
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
228
|
* The ID of the tool call that this result is associated with.
|
|
@@ -49,7 +49,7 @@ export interface StreamEventBase {
|
|
|
49
49
|
* Stream event indicating the start of a text output.
|
|
50
50
|
*/
|
|
51
51
|
export interface TextStartEvent extends StreamEventBase {
|
|
52
|
-
readonly kind: "text
|
|
52
|
+
readonly kind: "text.start";
|
|
53
53
|
id: string;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -57,7 +57,7 @@ export interface TextStartEvent extends StreamEventBase {
|
|
|
57
57
|
* Stream event indicating the end of a text output.
|
|
58
58
|
*/
|
|
59
59
|
export interface TextEndEvent extends StreamEventBase {
|
|
60
|
-
readonly kind: "text
|
|
60
|
+
readonly kind: "text.end";
|
|
61
61
|
id: string;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@ export interface TextEndEvent extends StreamEventBase {
|
|
|
65
65
|
* Stream event containing a delta (chunk) of text output.
|
|
66
66
|
*/
|
|
67
67
|
export interface TextDeltaEvent extends StreamEventBase {
|
|
68
|
-
readonly kind: "text
|
|
68
|
+
readonly kind: "text.delta";
|
|
69
69
|
id: string;
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -78,7 +78,7 @@ export interface TextDeltaEvent extends StreamEventBase {
|
|
|
78
78
|
* Stream event indicating the start of reasoning output.
|
|
79
79
|
*/
|
|
80
80
|
export interface ReasoningStartEvent extends StreamEventBase {
|
|
81
|
-
readonly kind: "reasoning
|
|
81
|
+
readonly kind: "reasoning.start";
|
|
82
82
|
id: string;
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -86,7 +86,7 @@ export interface ReasoningStartEvent extends StreamEventBase {
|
|
|
86
86
|
* Stream event indicating the end of reasoning output.
|
|
87
87
|
*/
|
|
88
88
|
export interface ReasoningEndEvent extends StreamEventBase {
|
|
89
|
-
readonly kind: "reasoning
|
|
89
|
+
readonly kind: "reasoning.end";
|
|
90
90
|
id: string;
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -94,7 +94,7 @@ export interface ReasoningEndEvent extends StreamEventBase {
|
|
|
94
94
|
* Stream event containing a delta (chunk) of reasoning output.
|
|
95
95
|
*/
|
|
96
96
|
export interface ReasoningDeltaEvent extends StreamEventBase {
|
|
97
|
-
readonly kind: "reasoning
|
|
97
|
+
readonly kind: "reasoning.delta";
|
|
98
98
|
id: string;
|
|
99
99
|
|
|
100
100
|
/**
|
|
@@ -107,13 +107,13 @@ export interface ReasoningDeltaEvent extends StreamEventBase {
|
|
|
107
107
|
* Stream event indicating the start of tool input generation.
|
|
108
108
|
*/
|
|
109
109
|
export interface ToolInputStartEvent extends StreamEventBase {
|
|
110
|
-
readonly kind: "tool
|
|
110
|
+
readonly kind: "tool.input.start";
|
|
111
111
|
id: string;
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
* The
|
|
114
|
+
* The identifier of the tool being called.
|
|
115
115
|
*/
|
|
116
|
-
|
|
116
|
+
toolId: string;
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* Optional title for the tool call.
|
|
@@ -125,7 +125,7 @@ export interface ToolInputStartEvent extends StreamEventBase {
|
|
|
125
125
|
* Stream event indicating the end of tool input generation.
|
|
126
126
|
*/
|
|
127
127
|
export interface ToolInputEndEvent extends StreamEventBase {
|
|
128
|
-
readonly kind: "tool
|
|
128
|
+
readonly kind: "tool.input.end";
|
|
129
129
|
id: string;
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -133,7 +133,7 @@ export interface ToolInputEndEvent extends StreamEventBase {
|
|
|
133
133
|
* Stream event containing a delta (chunk) of tool input.
|
|
134
134
|
*/
|
|
135
135
|
export interface ToolInputDeltaEvent extends StreamEventBase {
|
|
136
|
-
readonly kind: "tool
|
|
136
|
+
readonly kind: "tool.input.delta";
|
|
137
137
|
id: string;
|
|
138
138
|
|
|
139
139
|
/**
|
|
@@ -146,7 +146,7 @@ export interface ToolInputDeltaEvent extends StreamEventBase {
|
|
|
146
146
|
* Stream event indicating the start of agent execution.
|
|
147
147
|
*/
|
|
148
148
|
export interface StartEvent extends StreamEventBase {
|
|
149
|
-
readonly kind: "stream
|
|
149
|
+
readonly kind: "stream.start";
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
152
|
* Warnings for the call (e.g., unsupported settings).
|