@matatbread/matbot-core 0.3.1 → 0.3.3
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 +2 -2
- package/src/runner.ts +6 -4
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"node",
|
|
5
5
|
"browser"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.3.
|
|
7
|
+
"version": "0.3.3",
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=24.0.0"
|
|
10
10
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@matatbread/matbot-plugin-api": "^0.3.
|
|
38
|
+
"@matatbread/matbot-plugin-api": "^0.3.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"typescript": "^6.0.3"
|
package/src/runner.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
Session, MessageContent, Usage,
|
|
2
|
+
Session, MessageContent, Usage, ProviderMeta,
|
|
3
3
|
PipelineEvent, RunConfig, ProviderAdapter, ProviderConfig,
|
|
4
4
|
Tool, ToolRegistry, ToolContext, Store, FileStore, SystemContextRegistry, Vault, PromptFn, FormField,
|
|
5
5
|
} from './types.js';
|
|
@@ -138,7 +138,7 @@ export async function* runSession(opts: RunSessionOpts): AsyncIterable<PipelineE
|
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
const pendingCalls: Array<{ id: string; name: string; input: unknown }> = [];
|
|
141
|
+
const pendingCalls: Array<{ id: string; name: string; input: unknown; meta?: ProviderMeta }> = [];
|
|
142
142
|
const assistantParts: MessageContent[] = [];
|
|
143
143
|
let textAcc = '';
|
|
144
144
|
let turnUsage: Usage | undefined;
|
|
@@ -187,7 +187,8 @@ export async function* runSession(opts: RunSessionOpts): AsyncIterable<PipelineE
|
|
|
187
187
|
assistantParts.push({ type: 'reasoning', reasoning: ev.reasoning });
|
|
188
188
|
break;
|
|
189
189
|
case 'tool-call':
|
|
190
|
-
pendingCalls.push({ id: ev.id, name: ev.name, input: ev.input
|
|
190
|
+
pendingCalls.push({ id: ev.id, name: ev.name, input: ev.input,
|
|
191
|
+
...(ev.meta !== undefined ? { meta: ev.meta } : {}) });
|
|
191
192
|
break;
|
|
192
193
|
case 'usage':
|
|
193
194
|
turnUsage = addUsage(turnUsage, ev);
|
|
@@ -221,7 +222,8 @@ export async function* runSession(opts: RunSessionOpts): AsyncIterable<PipelineE
|
|
|
221
222
|
// Build and store assistant message
|
|
222
223
|
if (textAcc) assistantParts.push({ type: 'text', text: textAcc });
|
|
223
224
|
for (const tc of pendingCalls) {
|
|
224
|
-
assistantParts.push({ type: 'tool-call', id: tc.id, name: tc.name, input: tc.input
|
|
225
|
+
assistantParts.push({ type: 'tool-call', id: tc.id, name: tc.name, input: tc.input,
|
|
226
|
+
...(tc.meta !== undefined ? { meta: tc.meta } : {}) });
|
|
225
227
|
}
|
|
226
228
|
|
|
227
229
|
if (assistantParts.length > 0) {
|