@oh-my-pi/pi-agent-core 3.13.1337 → 3.15.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/package.json +3 -3
- package/src/agent-loop.ts +7 -8
- package/src/types.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-pi/pi-agent-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"test": "vitest --run"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@oh-my-pi/pi-ai": "3.
|
|
17
|
-
"@oh-my-pi/pi-tui": "3.
|
|
16
|
+
"@oh-my-pi/pi-ai": "3.15.0",
|
|
17
|
+
"@oh-my-pi/pi-tui": "3.15.0"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"ai",
|
package/src/agent-loop.ts
CHANGED
|
@@ -322,8 +322,11 @@ async function executeToolCalls(
|
|
|
322
322
|
});
|
|
323
323
|
|
|
324
324
|
let result: AgentToolResult<any>;
|
|
325
|
-
let isError = false;
|
|
326
325
|
|
|
326
|
+
const details: { toolCallId: string; toolName: string; isError?: boolean } = {
|
|
327
|
+
toolCallId: toolCall.id,
|
|
328
|
+
toolName: toolCall.name,
|
|
329
|
+
};
|
|
327
330
|
try {
|
|
328
331
|
if (!tool) throw new Error(`Tool ${toolCall.name} not found`);
|
|
329
332
|
|
|
@@ -350,25 +353,21 @@ async function executeToolCalls(
|
|
|
350
353
|
content: [{ type: "text", text: e instanceof Error ? e.message : String(e) }],
|
|
351
354
|
details: {},
|
|
352
355
|
};
|
|
353
|
-
isError = true;
|
|
356
|
+
details.isError = true;
|
|
354
357
|
}
|
|
355
358
|
|
|
356
359
|
stream.push({
|
|
357
360
|
type: "tool_execution_end",
|
|
358
|
-
toolCallId: toolCall.id,
|
|
359
|
-
toolName: toolCall.name,
|
|
360
361
|
result,
|
|
361
|
-
|
|
362
|
+
...details,
|
|
362
363
|
});
|
|
363
364
|
|
|
364
365
|
const toolResultMessage: ToolResultMessage = {
|
|
365
366
|
role: "toolResult",
|
|
366
|
-
toolCallId: toolCall.id,
|
|
367
|
-
toolName: toolCall.name,
|
|
368
367
|
content: result.content,
|
|
369
368
|
details: result.details,
|
|
370
|
-
isError,
|
|
371
369
|
timestamp: Date.now(),
|
|
370
|
+
...details,
|
|
372
371
|
};
|
|
373
372
|
|
|
374
373
|
results.push(toolResultMessage);
|
package/src/types.ts
CHANGED
|
@@ -217,4 +217,4 @@ export type AgentEvent =
|
|
|
217
217
|
// Tool execution lifecycle
|
|
218
218
|
| { type: "tool_execution_start"; toolCallId: string; toolName: string; args: any }
|
|
219
219
|
| { type: "tool_execution_update"; toolCallId: string; toolName: string; args: any; partialResult: any }
|
|
220
|
-
| { type: "tool_execution_end"; toolCallId: string; toolName: string; result: any; isError
|
|
220
|
+
| { type: "tool_execution_end"; toolCallId: string; toolName: string; result: any; isError?: boolean };
|