@oh-my-pi/pi-agent-core 13.1.2 → 13.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-agent-core",
4
- "version": "13.1.2",
4
+ "version": "13.2.0",
5
5
  "description": "General-purpose agent with transport abstraction, state management, and attachment support",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -31,9 +31,9 @@
31
31
  "test": "bun test"
32
32
  },
33
33
  "dependencies": {
34
- "@oh-my-pi/pi-ai": "13.1.2",
35
- "@oh-my-pi/pi-tui": "13.1.2",
36
- "@oh-my-pi/pi-utils": "13.1.2"
34
+ "@oh-my-pi/pi-ai": "13.2.0",
35
+ "@oh-my-pi/pi-tui": "13.2.0",
36
+ "@oh-my-pi/pi-utils": "13.2.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@sinclair/typebox": "^0.34",
package/src/agent-loop.ts CHANGED
@@ -160,10 +160,11 @@ function injectIntentIntoSchema(schema: unknown): unknown {
160
160
  };
161
161
  }
162
162
 
163
- function injectIntentIntoTools(tools: Context["tools"]): Context["tools"] {
163
+ function normalizeTools(tools: Context["tools"], injectIntent: boolean): Context["tools"] {
164
164
  return tools?.map(tool => ({
165
165
  ...tool,
166
- parameters: injectIntentIntoSchema(tool.parameters) as typeof tool.parameters,
166
+ description: tool.description || "",
167
+ ...(injectIntent && { parameters: injectIntentIntoSchema(tool.parameters) as typeof tool.parameters }),
167
168
  }));
168
169
  }
169
170
 
@@ -316,7 +317,7 @@ async function streamAssistantResponse(
316
317
  const llmContext: Context = {
317
318
  systemPrompt: context.systemPrompt,
318
319
  messages: normalizedMessages,
319
- tools: config.intentTracing ? injectIntentIntoTools(context.tools) : context.tools,
320
+ tools: normalizeTools(context.tools, !!config.intentTracing),
320
321
  };
321
322
 
322
323
  const streamFunction = streamFn || streamSimple;