@oh-my-pi/pi-agent-core 9.1.0 → 9.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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/agent.ts +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-agent-core",
3
- "version": "9.1.0",
3
+ "version": "9.2.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",
@@ -24,9 +24,9 @@
24
24
  "test": "bun test"
25
25
  },
26
26
  "dependencies": {
27
- "@oh-my-pi/pi-ai": "9.1.0",
28
- "@oh-my-pi/pi-tui": "9.1.0",
29
- "@oh-my-pi/pi-utils": "9.1.0"
27
+ "@oh-my-pi/pi-ai": "9.2.0",
28
+ "@oh-my-pi/pi-tui": "9.2.0",
29
+ "@oh-my-pi/pi-utils": "9.2.0"
30
30
  },
31
31
  "keywords": [
32
32
  "ai",
package/src/agent.ts CHANGED
@@ -69,6 +69,11 @@ export interface AgentOptions {
69
69
  */
70
70
  interruptMode?: "immediate" | "wait";
71
71
 
72
+ /**
73
+ * API format for Kimi Code provider: "openai" or "anthropic" (default: "anthropic")
74
+ */
75
+ kimiApiFormat?: "openai" | "anthropic";
76
+
72
77
  /**
73
78
  * Custom stream function (for proxy backends, etc.). Default uses streamSimple.
74
79
  */
@@ -149,6 +154,7 @@ export class Agent {
149
154
  private cursorOnToolResult?: CursorToolResultHandler;
150
155
  private runningPrompt?: Promise<void>;
151
156
  private resolveRunningPrompt?: () => void;
157
+ private kimiApiFormat?: "openai" | "anthropic";
152
158
 
153
159
  /** Buffered Cursor tool results with text length at time of call (for correct ordering) */
154
160
  private _cursorToolResultBuffer: CursorToolResultEntry[] = [];
@@ -167,6 +173,7 @@ export class Agent {
167
173
  this.getToolContext = opts.getToolContext;
168
174
  this.cursorExecHandlers = opts.cursorExecHandlers;
169
175
  this.cursorOnToolResult = opts.cursorOnToolResult;
176
+ this.kimiApiFormat = opts.kimiApiFormat;
170
177
  }
171
178
 
172
179
  /**
@@ -486,6 +493,7 @@ export class Agent {
486
493
  interruptMode: this.interruptMode,
487
494
  sessionId: this._sessionId,
488
495
  thinkingBudgets: this._thinkingBudgets,
496
+ kimiApiFormat: this.kimiApiFormat,
489
497
  toolChoice: options?.toolChoice,
490
498
  convertToLlm: this.convertToLlm,
491
499
  transformContext: this.transformContext,