zidane 3.3.0 → 3.3.2

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.
@@ -532,6 +532,35 @@ type SessionContentBlock = {
532
532
  type: 'thinking';
533
533
  text: string;
534
534
  signature?: string;
535
+ /**
536
+ * Provider that minted `signature`. Signatures are provider-bound (Anthropic
537
+ * HMAC vs. OpenAI `encrypted_content`) and are dropped on cross-provider
538
+ * hops to avoid 400s. Unset means legacy/unknown — forwarded as-is.
539
+ */
540
+ signatureProducer?: 'anthropic' | 'openai';
541
+ } | {
542
+ type: 'redacted_thinking';
543
+ data: string;
544
+ } | {
545
+ /**
546
+ * Opaque round-trip envelope for reasoning state minted by an OpenAI-compat
547
+ * gateway (currently OpenRouter). The gateway expects its own
548
+ * `reasoning_details` array echoed back verbatim on the next turn so the
549
+ * upstream model can resume an extended-reasoning chain across tool calls.
550
+ *
551
+ * Stored opaquely because the items are provider-bound (Anthropic HMAC
552
+ * signatures, OpenAI `encrypted_content`, model-specific summary formats
553
+ * — all flowing through the gateway's normalized envelope).
554
+ */
555
+ type: 'provider_reasoning';
556
+ producer: 'openrouter';
557
+ details: unknown[];
558
+ /**
559
+ * Model id that produced the details. Reasoning is bound to a specific
560
+ * upstream route — a model switch on the next turn invalidates the
561
+ * embedded signatures, so the sender drops the block on mismatch.
562
+ */
563
+ model?: string;
535
564
  };
536
565
  interface SessionMessage {
537
566
  role: 'user' | 'assistant';
@@ -949,6 +978,23 @@ interface OpenAICompatParams {
949
978
  * Default: `false`. The `openrouter` wrapper sets this to `true`.
950
979
  */
951
980
  cacheBreakpoints?: boolean;
981
+ /**
982
+ * Whether this endpoint speaks OpenRouter's normalized reasoning envelope —
983
+ * `reasoning: { effort | max_tokens | exclude }` on requests and structured
984
+ * `reasoning_details[]` on assistant messages, round-tripped to preserve
985
+ * extended-reasoning state across turns.
986
+ *
987
+ * - `true` — map zidane's `behavior.thinking` / `behavior.thinkingBudget` to
988
+ * the request's `reasoning` field, capture `reasoning_details`
989
+ * from streaming responses into `provider_reasoning` blocks, and
990
+ * echo them back on subsequent assistant messages.
991
+ * - `false` — never set the field; drop any stored `provider_reasoning`
992
+ * blocks before sending. Safe default for hosts that strict-
993
+ * validate the request schema.
994
+ *
995
+ * Default: `false`. The `openrouter` wrapper sets this to `true`.
996
+ */
997
+ supportsReasoning?: boolean;
952
998
  /**
953
999
  * Generic pass-through for fields on the Chat Completions request body that
954
1000
  * zidane does not yet type. Spread into the request before the typed core
@@ -21,6 +21,8 @@ async function consumeSSE(response, callbacks, signal) {
21
21
  let finishReason = "stop";
22
22
  let usage = { input: 0, output: 0 };
23
23
  const tcMap = /* @__PURE__ */ new Map();
24
+ const reasoningMap = /* @__PURE__ */ new Map();
25
+ let sawReasoningDetails = false;
24
26
  try {
25
27
  while (true) {
26
28
  if (signal?.aborted)
@@ -56,10 +58,36 @@ async function consumeSSE(response, callbacks, signal) {
56
58
  if (fr)
57
59
  finishReason = fr;
58
60
  const delta = choice.delta;
59
- const thinkingDelta = delta?.reasoning_content ?? delta?.reasoning;
60
- if (thinkingDelta) {
61
- thinking += thinkingDelta;
62
- callbacks.onThinking?.(thinkingDelta);
61
+ const reasoningDeltaArr = delta?.reasoning_details;
62
+ if (reasoningDeltaArr && reasoningDeltaArr.length > 0) {
63
+ sawReasoningDetails = true;
64
+ for (const item of reasoningDeltaArr) {
65
+ const idx = typeof item.index === "number" ? item.index : 0;
66
+ const existing = reasoningMap.get(idx) ?? {};
67
+ if (typeof item.text === "string") {
68
+ existing.text = (existing.text ?? "") + item.text;
69
+ thinking += item.text;
70
+ callbacks.onThinking?.(item.text);
71
+ }
72
+ if (typeof item.summary === "string") {
73
+ existing.summary = (existing.summary ?? "") + item.summary;
74
+ thinking += item.summary;
75
+ callbacks.onThinking?.(item.summary);
76
+ }
77
+ for (const key of ["type", "signature", "data", "format", "id"]) {
78
+ const v = item[key];
79
+ if (typeof v === "string")
80
+ existing[key] = v;
81
+ }
82
+ reasoningMap.set(idx, existing);
83
+ }
84
+ }
85
+ if (!sawReasoningDetails) {
86
+ const thinkingDelta = delta?.reasoning_content ?? delta?.reasoning;
87
+ if (thinkingDelta) {
88
+ thinking += thinkingDelta;
89
+ callbacks.onThinking?.(thinkingDelta);
90
+ }
63
91
  }
64
92
  const contentDelta = delta?.content;
65
93
  if (contentDelta) {
@@ -113,7 +141,8 @@ async function consumeSSE(response, callbacks, signal) {
113
141
  );
114
142
  }
115
143
  }
116
- return { text, thinking, toolCalls, finishReason, usage };
144
+ const reasoningDetails = Array.from(reasoningMap.entries()).sort(([a], [b]) => a - b).map(([, item]) => item);
145
+ return { text, thinking, toolCalls, finishReason, usage, reasoningDetails };
117
146
  }
118
147
  function toImageUrlPart(img) {
119
148
  return {
@@ -137,11 +166,23 @@ function summarizeToolResultOutput(output) {
137
166
  function toOAIMessages(system, messages, options = {}) {
138
167
  const out = [{ role: "system", content: system }];
139
168
  const nativeImageInTool = options.imageInToolResult === true;
169
+ const reasoningEnabled = options.supportsReasoning === true;
170
+ const activeModel = options.model;
140
171
  for (const msg of messages) {
141
172
  const toolResults = msg.content.filter((b) => b.type === "tool_result");
142
173
  const toolCalls = msg.content.filter((b) => b.type === "tool_call");
143
174
  const textBlocks = msg.content.filter((b) => b.type === "text");
144
175
  const imageBlocks = msg.content.filter((b) => b.type === "image");
176
+ const reasoningBlocks = reasoningEnabled ? msg.content.filter((b) => {
177
+ if (b.type !== "provider_reasoning")
178
+ return false;
179
+ if (b.producer !== "openrouter")
180
+ return false;
181
+ if (b.model && activeModel && b.model !== activeModel)
182
+ return false;
183
+ return true;
184
+ }) : [];
185
+ const reasoningDetails = reasoningBlocks.flatMap((b) => b.details);
145
186
  if (toolResults.length > 0) {
146
187
  for (const tr of toolResults) {
147
188
  if (typeof tr.output === "string") {
@@ -176,7 +217,7 @@ ${attachedMarker}` : attachedMarker;
176
217
  }
177
218
  if (toolCalls.length > 0) {
178
219
  const textContent = textBlocks.length > 0 ? textBlocks[0].text : null;
179
- out.push({
220
+ const m = {
180
221
  role: "assistant",
181
222
  content: textContent,
182
223
  tool_calls: toolCalls.map((tc) => ({
@@ -184,7 +225,10 @@ ${attachedMarker}` : attachedMarker;
184
225
  type: "function",
185
226
  function: { name: tc.name, arguments: JSON.stringify(tc.input) }
186
227
  }))
187
- });
228
+ };
229
+ if (reasoningDetails.length > 0)
230
+ m.reasoning_details = reasoningDetails;
231
+ out.push(m);
188
232
  continue;
189
233
  }
190
234
  if (imageBlocks.length > 0) {
@@ -195,16 +239,23 @@ ${attachedMarker}` : attachedMarker;
195
239
  for (const b of textBlocks) {
196
240
  parts.push({ type: "text", text: b.text });
197
241
  }
198
- out.push({ role: msg.role, content: parts });
242
+ const m = { role: msg.role, content: parts };
243
+ if (msg.role === "assistant" && reasoningDetails.length > 0)
244
+ m.reasoning_details = reasoningDetails;
245
+ out.push(m);
199
246
  continue;
200
247
  }
248
+ let pushed;
201
249
  if (textBlocks.length === 1) {
202
- out.push({ role: msg.role, content: textBlocks[0].text });
250
+ pushed = { role: msg.role, content: textBlocks[0].text };
203
251
  } else if (textBlocks.length > 1) {
204
- out.push({ role: msg.role, content: textBlocks.map((b) => ({ type: "text", text: b.text })) });
252
+ pushed = { role: msg.role, content: textBlocks.map((b) => ({ type: "text", text: b.text })) };
205
253
  } else {
206
- out.push({ role: msg.role, content: null });
254
+ pushed = { role: msg.role, content: null };
207
255
  }
256
+ if (msg.role === "assistant" && reasoningDetails.length > 0)
257
+ pushed.reasoning_details = reasoningDetails;
258
+ out.push(pushed);
208
259
  }
209
260
  return out;
210
261
  }
@@ -262,8 +313,18 @@ function toolResultsMessage(results) {
262
313
  }))
263
314
  };
264
315
  }
265
- function buildAssistantContent(text, toolCalls, thinking) {
316
+ function buildAssistantContent(text, toolCalls, thinking, reasoning) {
266
317
  const content = [];
318
+ if (reasoning && reasoning.details.length > 0) {
319
+ const block = {
320
+ type: "provider_reasoning",
321
+ producer: reasoning.producer,
322
+ details: reasoning.details
323
+ };
324
+ if (reasoning.model)
325
+ block.model = reasoning.model;
326
+ content.push(block);
327
+ }
267
328
  if (thinking)
268
329
  content.push({ type: "thinking", text: thinking });
269
330
  if (text)
@@ -349,6 +410,18 @@ function mapOAIFinishReason(reason) {
349
410
  return "other";
350
411
  }
351
412
  }
413
+ function planOpenRouterReasoning(thinking, thinkingBudget) {
414
+ if ((!thinking || thinking === "off") && typeof thinkingBudget !== "number")
415
+ return void 0;
416
+ const out = {};
417
+ if (thinking && thinking !== "off" && thinking !== "adaptive") {
418
+ out.effort = thinking === "minimal" ? "low" : thinking;
419
+ }
420
+ if (typeof thinkingBudget === "number" && thinkingBudget > 0) {
421
+ out.max_tokens = thinkingBudget;
422
+ }
423
+ return out;
424
+ }
352
425
  function openaiCompat(params) {
353
426
  const name = params.name ?? "openai-compat";
354
427
  const defaultModel = params.defaultModel ?? "gpt-4o-mini";
@@ -361,6 +434,7 @@ function openaiCompat(params) {
361
434
  imageInToolResult: params.capabilities?.imageInToolResult ?? false
362
435
  };
363
436
  const cacheBreakpointsEnabled = params.cacheBreakpoints === true;
437
+ const reasoningEnabled = params.supportsReasoning === true;
364
438
  return {
365
439
  name,
366
440
  meta: { defaultModel, capabilities },
@@ -372,7 +446,9 @@ function openaiCompat(params) {
372
446
  async stream(options, callbacks) {
373
447
  const modelId = options.model || defaultModel;
374
448
  const messages = toOAIMessages(options.system, options.messages, {
375
- imageInToolResult: capabilities.imageInToolResult === true
449
+ imageInToolResult: capabilities.imageInToolResult === true,
450
+ supportsReasoning: reasoningEnabled,
451
+ model: modelId
376
452
  });
377
453
  const shouldCache = cacheBreakpointsEnabled && options.cache !== false;
378
454
  if (shouldCache) {
@@ -388,6 +464,11 @@ function openaiCompat(params) {
388
464
  max_tokens: maxTokens,
389
465
  stream: true
390
466
  };
467
+ if (reasoningEnabled) {
468
+ const reasoning = planOpenRouterReasoning(options.thinking, options.thinkingBudget);
469
+ if (reasoning)
470
+ body.reasoning = reasoning;
471
+ }
391
472
  if (options.tools && options.tools.length > 0) {
392
473
  body.tools = shouldCache ? applyOAIToolCacheBreakpoint(options.tools) : options.tools;
393
474
  }
@@ -416,7 +497,12 @@ function openaiCompat(params) {
416
497
  const result = await consumeSSE(response, callbacks, options.signal);
417
498
  const finishReason = mapOAIFinishReason(result.finishReason);
418
499
  return {
419
- assistantMessage: buildAssistantContent(result.text, result.toolCalls, result.thinking),
500
+ assistantMessage: buildAssistantContent(
501
+ result.text,
502
+ result.toolCalls,
503
+ result.thinking,
504
+ reasoningEnabled && result.reasoningDetails.length > 0 ? { details: result.reasoningDetails, producer: "openrouter", model: modelId } : void 0
505
+ ),
420
506
  text: result.text,
421
507
  toolCalls: result.toolCalls,
422
508
  done: result.finishReason === "stop" || result.toolCalls.length === 0,
@@ -500,9 +586,26 @@ function fromAnthropic(msg) {
500
586
  content.push({ type: "tool_call", id: b.id, name: b.name, input: b.input });
501
587
  } else if (b.type === "tool_result") {
502
588
  const output = decodeAnthropicToolResultContent(b.content);
503
- content.push({ type: "tool_result", callId: b.tool_use_id, output });
589
+ const block2 = {
590
+ type: "tool_result",
591
+ callId: b.tool_use_id,
592
+ output
593
+ };
594
+ if (b.is_error === true)
595
+ block2.isError = true;
596
+ content.push(block2);
504
597
  } else if (b.type === "thinking") {
505
- content.push({ type: "thinking", text: b.thinking, signature: b.signature });
598
+ const block2 = {
599
+ type: "thinking",
600
+ text: b.thinking ?? ""
601
+ };
602
+ if (typeof b.signature === "string") {
603
+ block2.signature = b.signature;
604
+ block2.signatureProducer = "anthropic";
605
+ }
606
+ content.push(block2);
607
+ } else if (b.type === "redacted_thinking") {
608
+ content.push({ type: "redacted_thinking", data: b.data ?? "" });
506
609
  }
507
610
  }
508
611
  }
@@ -569,7 +672,7 @@ function fromOpenAI(msg) {
569
672
  return { role, content };
570
673
  }
571
674
  function toAnthropic(msg) {
572
- const blocks = msg.content.map((block) => {
675
+ const blocks = msg.content.filter((b) => !(b.type === "thinking" && b.signatureProducer === "openai")).filter((b) => b.type !== "provider_reasoning").map((block) => {
573
676
  switch (block.type) {
574
677
  case "text":
575
678
  return { type: "text", text: block.text };
@@ -577,10 +680,24 @@ function toAnthropic(msg) {
577
680
  return { type: "image", source: { type: "base64", media_type: block.mediaType, data: block.data } };
578
681
  case "tool_call":
579
682
  return { type: "tool_use", id: block.id, name: block.name, input: block.input };
580
- case "tool_result":
581
- return { type: "tool_result", tool_use_id: block.callId, content: encodeAnthropicToolResultContent(block.output) };
582
- case "thinking":
583
- return { type: "thinking", thinking: block.text, signature: block.signature };
683
+ case "tool_result": {
684
+ const out = {
685
+ type: "tool_result",
686
+ tool_use_id: block.callId,
687
+ content: encodeAnthropicToolResultContent(block.output)
688
+ };
689
+ if (block.isError)
690
+ out.is_error = true;
691
+ return out;
692
+ }
693
+ case "thinking": {
694
+ const out = { type: "thinking", thinking: block.text };
695
+ if (block.signature)
696
+ out.signature = block.signature;
697
+ return out;
698
+ }
699
+ case "redacted_thinking":
700
+ return { type: "redacted_thinking", data: block.data };
584
701
  default:
585
702
  return { type: "text", text: "" };
586
703
  }
@@ -5,7 +5,7 @@ import {
5
5
  toAnthropic,
6
6
  toolResultsMessage,
7
7
  userMessage
8
- } from "./chunk-X244RS5H.js";
8
+ } from "./chunk-4ILGBQ23.js";
9
9
  import {
10
10
  matchesContextExceeded
11
11
  } from "./chunk-LNN5UTS2.js";
@@ -13,7 +13,7 @@ import {
13
13
  // src/providers/oauth.ts
14
14
  import { existsSync, readFileSync, renameSync, writeFileSync } from "fs";
15
15
  import { resolve } from "path";
16
- import { getOAuthApiKey } from "@yaelg/pi-ai/oauth";
16
+ import { getOAuthApiKey } from "@mariozechner/pi-ai/oauth";
17
17
  function credentialsFilePath() {
18
18
  return resolve(process.cwd(), ".credentials.json");
19
19
  }
@@ -520,8 +520,8 @@ function cerebras(params) {
520
520
  }
521
521
 
522
522
  // src/providers/openai.ts
523
- import { getModel } from "@yaelg/pi-ai";
524
- import { streamOpenAICodexResponses } from "@yaelg/pi-ai/openai-codex-responses";
523
+ import { getModel } from "@mariozechner/pi-ai";
524
+ import { streamOpenAICodexResponses } from "@mariozechner/pi-ai/openai-codex-responses";
525
525
  var PROVIDER_ID = "openai-codex";
526
526
  var DEFAULT_MODEL = "gpt-5.4";
527
527
  function resolveModel(modelId) {
@@ -590,6 +590,8 @@ function toPiMessages(messages, modelId) {
590
590
  if (block.type === "text") {
591
591
  content.push({ type: "text", text: block.text });
592
592
  } else if (block.type === "thinking") {
593
+ if (block.signatureProducer === "anthropic")
594
+ continue;
593
595
  content.push({ type: "thinking", thinking: block.text, thinkingSignature: block.signature });
594
596
  } else if (block.type === "tool_call") {
595
597
  content.push({ type: "toolCall", id: block.id, name: block.name, arguments: block.input });
@@ -614,7 +616,15 @@ function fromPiAssistantMessage(message) {
614
616
  if (block.type === "text") {
615
617
  content.push({ type: "text", text: block.text });
616
618
  } else if (block.type === "thinking") {
617
- content.push({ type: "thinking", text: block.thinking, signature: block.thinkingSignature });
619
+ const out = {
620
+ type: "thinking",
621
+ text: block.thinking
622
+ };
623
+ if (typeof block.thinkingSignature === "string") {
624
+ out.signature = block.thinkingSignature;
625
+ out.signatureProducer = "openai";
626
+ }
627
+ content.push(out);
618
628
  } else if (block.type === "toolCall") {
619
629
  content.push({ type: "tool_call", id: block.id, name: block.name, input: block.arguments });
620
630
  }
@@ -807,7 +817,12 @@ function openrouter(params) {
807
817
  // silently ignores them for routes that cache automatically. Safe to turn on
808
818
  // by default — the caller can still flip `behavior.cache = false` to opt out
809
819
  // without needing to re-instantiate the provider.
810
- cacheBreakpoints: true
820
+ cacheBreakpoints: true,
821
+ // OpenRouter speaks the normalized `reasoning` request field and round-trips
822
+ // structured `reasoning_details` on assistant messages. Captured into
823
+ // `provider_reasoning` blocks and echoed back to preserve extended-reasoning
824
+ // state across turns on the same upstream route.
825
+ supportsReasoning: true
811
826
  });
812
827
  }
813
828
 
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { d as AgentHooks } from './agent-BBzkPRAu.js';
2
- export { ab as ActivationVia, ac as ActiveSkill, A as Agent, a as AgentAbortedError, b as AgentBehavior, c as AgentContextExceededError, e as AgentOptions, f as AgentProviderError, g as AgentRunOptions, h as AgentStats, i as AgentToolNotAllowedError, j as AnthropicParams, C as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, k as CerebrasParams, m as ClassifiedError, n as ClassifiedErrorKind, o as CreateSessionOptions, ad as DeactivationReason, ae as FileMapAdapter, af as FileMapStoreOptions, M as McpConnection, p as McpServerConfig, q as McpToolHookContext, O as OAuthRefreshHookContext, ag as OpenAICompatAuthHeader, ah as OpenAICompatHttpError, ai as OpenAICompatParams, r as OpenAIParams, s as OpenRouterParams, P as PromptDocumentPart, t as PromptImagePart, u as PromptPart, v as PromptTextPart, w as Provider, x as ProviderCapabilities, R as RemoteStoreOptions, y as RunHookMap, S as Session, z as SessionContentBlock, B as SessionData, D as SessionEndStatus, E as SessionHookContext, F as SessionMessage, G as SessionRun, H as SessionStore, I as SessionTurn, aj as SkillActivationState, ak as SkillActivationStateOptions, J as SkillConfig, al as SkillDiagnostic, K as SkillResource, am as SkillSource, L as SkillsConfig, N as SpawnHookContext, Q as StreamCallbacks, T as StreamHookContext, U as StreamOptions, V as ThinkingLevel, W as ToolCall, X as ToolContext, Y as ToolDef, Z as ToolExecutionMode, _ as ToolHookContext, $ as ToolMap, a0 as ToolResult, a1 as ToolResultContent, a2 as ToolResultImageContent, a3 as ToolResultTextContent, a4 as ToolSpec, a5 as TurnFinishReason, a6 as TurnResult, a7 as TurnUsage, an as anthropic, ao as autoDetectAndConvert, ap as cerebras, aq as classifyOpenAICompatError, ar as connectMcpServers, as as createAgent, at as createFileMapStore, au as createMemoryStore, av as createRemoteStore, aw as createSession, ax as createSkillActivationState, ay as fromAnthropic, az as fromOpenAI, aA as loadSession, aB as mapOAIFinishReason, a8 as matchesContextExceeded, aC as normalizeMcpBlocks, aD as normalizeMcpServers, aE as openai, aF as openaiCompat, aG as openrouter, aH as resultToString, aI as toAnthropic, aJ as toOpenAI, aK as toTypedError, a9 as toolOutputByteLength, aa as toolResultToText } from './agent-BBzkPRAu.js';
1
+ import { d as AgentHooks } from './agent-DqEkutk4.js';
2
+ export { ab as ActivationVia, ac as ActiveSkill, A as Agent, a as AgentAbortedError, b as AgentBehavior, c as AgentContextExceededError, e as AgentOptions, f as AgentProviderError, g as AgentRunOptions, h as AgentStats, i as AgentToolNotAllowedError, j as AnthropicParams, C as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, k as CerebrasParams, m as ClassifiedError, n as ClassifiedErrorKind, o as CreateSessionOptions, ad as DeactivationReason, ae as FileMapAdapter, af as FileMapStoreOptions, M as McpConnection, p as McpServerConfig, q as McpToolHookContext, O as OAuthRefreshHookContext, ag as OpenAICompatAuthHeader, ah as OpenAICompatHttpError, ai as OpenAICompatParams, r as OpenAIParams, s as OpenRouterParams, P as PromptDocumentPart, t as PromptImagePart, u as PromptPart, v as PromptTextPart, w as Provider, x as ProviderCapabilities, R as RemoteStoreOptions, y as RunHookMap, S as Session, z as SessionContentBlock, B as SessionData, D as SessionEndStatus, E as SessionHookContext, F as SessionMessage, G as SessionRun, H as SessionStore, I as SessionTurn, aj as SkillActivationState, ak as SkillActivationStateOptions, J as SkillConfig, al as SkillDiagnostic, K as SkillResource, am as SkillSource, L as SkillsConfig, N as SpawnHookContext, Q as StreamCallbacks, T as StreamHookContext, U as StreamOptions, V as ThinkingLevel, W as ToolCall, X as ToolContext, Y as ToolDef, Z as ToolExecutionMode, _ as ToolHookContext, $ as ToolMap, a0 as ToolResult, a1 as ToolResultContent, a2 as ToolResultImageContent, a3 as ToolResultTextContent, a4 as ToolSpec, a5 as TurnFinishReason, a6 as TurnResult, a7 as TurnUsage, an as anthropic, ao as autoDetectAndConvert, ap as cerebras, aq as classifyOpenAICompatError, ar as connectMcpServers, as as createAgent, at as createFileMapStore, au as createMemoryStore, av as createRemoteStore, aw as createSession, ax as createSkillActivationState, ay as fromAnthropic, az as fromOpenAI, aA as loadSession, aB as mapOAIFinishReason, a8 as matchesContextExceeded, aC as normalizeMcpBlocks, aD as normalizeMcpServers, aE as openai, aF as openaiCompat, aG as openrouter, aH as resultToString, aI as toAnthropic, aJ as toOpenAI, aK as toTypedError, a9 as toolOutputByteLength, aa as toolResultToText } from './agent-DqEkutk4.js';
3
3
  export { createDockerContext, createProcessContext } from './contexts.js';
4
4
  export { S as SandboxProvider, c as createSandboxContext } from './sandbox-CLghrTLi.js';
5
5
  export { C as ContextCapabilities, a as ContextType, E as ExecResult, b as ExecutionContext, c as ExecutionHandle, S as SpawnConfig } from './types-vA1a_ZX7.js';
6
6
  export { Preset, basic, basicTools, definePreset } from './presets.js';
7
7
  export { IMPLICITLY_ALLOWED_SKILL_TOOLS, SkillValidationIssue, SkillValidationResult, SourcedScanPath, buildCatalog, defineSkill, discoverSkills, installAllowedToolsGate, interpolateShellCommands, isToolAllowedByUnion, matchesAllowedTool, parseAllowedToolPattern, parseSkillFile, resolveSkills, validateResourcePath, validateSkillForWrite, validateSkillName, writeSkillToDisk, writeSkillsToDisk } from './skills.js';
8
- export { S as SkillsReadToolOptions, a as SkillsRunScriptToolOptions, b as SkillsUseToolOptions, c as createSkillsReadTool, d as createSkillsRunScriptTool, e as createSkillsUseTool, f as edit, g as glob, h as grep, m as multiEdit } from './skills-use-JMcA5NrF.js';
9
- export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult, c as createInteractionTool, b as createSpawnTool, v as validateToolArgs } from './validation-c3MQlCza.js';
8
+ export { S as SkillsReadToolOptions, a as SkillsRunScriptToolOptions, b as SkillsUseToolOptions, c as createSkillsReadTool, d as createSkillsRunScriptTool, e as createSkillsUseTool, f as edit, g as glob, h as grep, m as multiEdit } from './skills-use-WbOh6TuS.js';
9
+ export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult, c as createInteractionTool, b as createSpawnTool, v as validateToolArgs } from './validation-DTbkLXbd.js';
10
10
  import { Hookable } from 'hookable';
11
11
  import '@modelcontextprotocol/sdk/client/index.js';
12
12
 
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  cerebras,
7
7
  openai,
8
8
  openrouter
9
- } from "./chunk-VGFQEOHF.js";
9
+ } from "./chunk-W57VY6DJ.js";
10
10
  import {
11
11
  basicTools,
12
12
  basic_default,
@@ -75,7 +75,7 @@ import {
75
75
  openaiCompat,
76
76
  toAnthropic,
77
77
  toOpenAI
78
- } from "./chunk-X244RS5H.js";
78
+ } from "./chunk-4ILGBQ23.js";
79
79
  import {
80
80
  AgentAbortedError,
81
81
  AgentContextExceededError,
package/dist/mcp.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import 'hookable';
2
- export { M as McpConnection, p as McpServerConfig, ar as connectMcpServers, aC as normalizeMcpBlocks, aD as normalizeMcpServers, aH as resultToString } from './agent-BBzkPRAu.js';
2
+ export { M as McpConnection, p as McpServerConfig, ar as connectMcpServers, aC as normalizeMcpBlocks, aD as normalizeMcpServers, aH as resultToString } from './agent-DqEkutk4.js';
3
3
  import '@modelcontextprotocol/sdk/client/index.js';
4
4
  import './types-vA1a_ZX7.js';
package/dist/presets.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Y as ToolDef, e as AgentOptions } from './agent-BBzkPRAu.js';
1
+ import { Y as ToolDef, e as AgentOptions } from './agent-DqEkutk4.js';
2
2
  import 'hookable';
3
3
  import './types-vA1a_ZX7.js';
4
4
  import '@modelcontextprotocol/sdk/client/index.js';
@@ -1,4 +1,4 @@
1
- export { j as AnthropicParams, k as CerebrasParams, ag as OpenAICompatAuthHeader, ah as OpenAICompatHttpError, ai as OpenAICompatParams, r as OpenAIParams, s as OpenRouterParams, w as Provider, x as ProviderCapabilities, Q as StreamCallbacks, U as StreamOptions, W as ToolCall, a0 as ToolResult, a4 as ToolSpec, a6 as TurnResult, an as anthropic, ap as cerebras, aq as classifyOpenAICompatError, aB as mapOAIFinishReason, aE as openai, aF as openaiCompat, aG as openrouter } from './agent-BBzkPRAu.js';
1
+ export { j as AnthropicParams, k as CerebrasParams, ag as OpenAICompatAuthHeader, ah as OpenAICompatHttpError, ai as OpenAICompatParams, r as OpenAIParams, s as OpenRouterParams, w as Provider, x as ProviderCapabilities, Q as StreamCallbacks, U as StreamOptions, W as ToolCall, a0 as ToolResult, a4 as ToolSpec, a6 as TurnResult, an as anthropic, ap as cerebras, aq as classifyOpenAICompatError, aB as mapOAIFinishReason, aE as openai, aF as openaiCompat, aG as openrouter } from './agent-DqEkutk4.js';
2
2
  import 'hookable';
3
3
  import './types-vA1a_ZX7.js';
4
4
  import '@modelcontextprotocol/sdk/client/index.js';
package/dist/providers.js CHANGED
@@ -3,13 +3,13 @@ import {
3
3
  cerebras,
4
4
  openai,
5
5
  openrouter
6
- } from "./chunk-VGFQEOHF.js";
6
+ } from "./chunk-W57VY6DJ.js";
7
7
  import {
8
8
  OpenAICompatHttpError,
9
9
  classifyOpenAICompatError,
10
10
  mapOAIFinishReason,
11
11
  openaiCompat
12
- } from "./chunk-X244RS5H.js";
12
+ } from "./chunk-4ILGBQ23.js";
13
13
  import "./chunk-LNN5UTS2.js";
14
14
  export {
15
15
  OpenAICompatHttpError,
@@ -1,4 +1,4 @@
1
- import { H as SessionStore } from '../agent-BBzkPRAu.js';
1
+ import { H as SessionStore } from '../agent-DqEkutk4.js';
2
2
  import 'hookable';
3
3
  import '../types-vA1a_ZX7.js';
4
4
  import '@modelcontextprotocol/sdk/client/index.js';
package/dist/session.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { o as CreateSessionOptions, ae as FileMapAdapter, af as FileMapStoreOptions, R as RemoteStoreOptions, S as Session, z as SessionContentBlock, B as SessionData, F as SessionMessage, G as SessionRun, H as SessionStore, I as SessionTurn, ao as autoDetectAndConvert, at as createFileMapStore, au as createMemoryStore, av as createRemoteStore, aw as createSession, ay as fromAnthropic, az as fromOpenAI, aA as loadSession, aI as toAnthropic, aJ as toOpenAI } from './agent-BBzkPRAu.js';
1
+ export { o as CreateSessionOptions, ae as FileMapAdapter, af as FileMapStoreOptions, R as RemoteStoreOptions, S as Session, z as SessionContentBlock, B as SessionData, F as SessionMessage, G as SessionRun, H as SessionStore, I as SessionTurn, ao as autoDetectAndConvert, at as createFileMapStore, au as createMemoryStore, av as createRemoteStore, aw as createSession, ay as fromAnthropic, az as fromOpenAI, aA as loadSession, aI as toAnthropic, aJ as toOpenAI } from './agent-DqEkutk4.js';
2
2
  import 'hookable';
3
3
  import './types-vA1a_ZX7.js';
4
4
  import '@modelcontextprotocol/sdk/client/index.js';
package/dist/session.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  fromOpenAI,
12
12
  toAnthropic,
13
13
  toOpenAI
14
- } from "./chunk-X244RS5H.js";
14
+ } from "./chunk-4ILGBQ23.js";
15
15
  import "./chunk-LNN5UTS2.js";
16
16
  export {
17
17
  autoDetectAndConvert,
@@ -1,4 +1,4 @@
1
- import { Y as ToolDef, J as SkillConfig, aj as SkillActivationState, d as AgentHooks } from './agent-BBzkPRAu.js';
1
+ import { Y as ToolDef, J as SkillConfig, aj as SkillActivationState, d as AgentHooks } from './agent-DqEkutk4.js';
2
2
  import { Hookable } from 'hookable';
3
3
 
4
4
  /**
package/dist/skills.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { d as AgentHooks, aj as SkillActivationState, J as SkillConfig, am as SkillSource, al as SkillDiagnostic, L as SkillsConfig } from './agent-BBzkPRAu.js';
2
- export { ab as ActivationVia, ac as ActiveSkill, ad as DeactivationReason, ak as SkillActivationStateOptions, K as SkillResource, ax as createSkillActivationState } from './agent-BBzkPRAu.js';
1
+ import { d as AgentHooks, aj as SkillActivationState, J as SkillConfig, am as SkillSource, al as SkillDiagnostic, L as SkillsConfig } from './agent-DqEkutk4.js';
2
+ export { ab as ActivationVia, ac as ActiveSkill, ad as DeactivationReason, ak as SkillActivationStateOptions, K as SkillResource, ax as createSkillActivationState } from './agent-DqEkutk4.js';
3
3
  import { Hookable } from 'hookable';
4
4
  import { b as ExecutionContext, c as ExecutionHandle } from './types-vA1a_ZX7.js';
5
5
  import '@modelcontextprotocol/sdk/client/index.js';
package/dist/tools.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { S as SkillsReadToolOptions, a as SkillsRunScriptToolOptions, b as SkillsUseToolOptions, c as createSkillsReadTool, d as createSkillsRunScriptTool, e as createSkillsUseTool, f as edit, g as glob, h as grep, m as multiEdit } from './skills-use-JMcA5NrF.js';
2
- export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult, c as createInteractionTool, b as createSpawnTool, v as validateToolArgs } from './validation-c3MQlCza.js';
3
- import { Y as ToolDef } from './agent-BBzkPRAu.js';
4
- export { X as ToolContext, $ as ToolMap } from './agent-BBzkPRAu.js';
1
+ export { S as SkillsReadToolOptions, a as SkillsRunScriptToolOptions, b as SkillsUseToolOptions, c as createSkillsReadTool, d as createSkillsRunScriptTool, e as createSkillsUseTool, f as edit, g as glob, h as grep, m as multiEdit } from './skills-use-WbOh6TuS.js';
2
+ export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult, c as createInteractionTool, b as createSpawnTool, v as validateToolArgs } from './validation-DTbkLXbd.js';
3
+ import { Y as ToolDef } from './agent-DqEkutk4.js';
4
+ export { X as ToolContext, $ as ToolMap } from './agent-DqEkutk4.js';
5
5
  import 'hookable';
6
6
  import './presets.js';
7
7
  import './types-vA1a_ZX7.js';
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { A as Agent, a as AgentAbortedError, b as AgentBehavior, c as AgentContextExceededError, d as AgentHooks, e as AgentOptions, f as AgentProviderError, g as AgentRunOptions, h as AgentStats, i as AgentToolNotAllowedError, j as AnthropicParams, C as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, k as CerebrasParams, l as ChildRunStats, m as ClassifiedError, n as ClassifiedErrorKind, o as CreateSessionOptions, M as McpConnection, p as McpServerConfig, q as McpToolHookContext, O as OAuthRefreshHookContext, r as OpenAIParams, s as OpenRouterParams, P as PromptDocumentPart, t as PromptImagePart, u as PromptPart, v as PromptTextPart, w as Provider, x as ProviderCapabilities, R as RemoteStoreOptions, y as RunHookMap, S as Session, z as SessionContentBlock, B as SessionData, D as SessionEndStatus, E as SessionHookContext, F as SessionMessage, G as SessionRun, H as SessionStore, I as SessionTurn, J as SkillConfig, K as SkillResource, L as SkillsConfig, N as SpawnHookContext, Q as StreamCallbacks, T as StreamHookContext, U as StreamOptions, V as ThinkingLevel, W as ToolCall, X as ToolContext, Y as ToolDef, Z as ToolExecutionMode, _ as ToolHookContext, $ as ToolMap, a0 as ToolResult, a1 as ToolResultContent, a2 as ToolResultImageContent, a3 as ToolResultTextContent, a4 as ToolSpec, a5 as TurnFinishReason, a6 as TurnResult, a7 as TurnUsage, a8 as matchesContextExceeded, a9 as toolOutputByteLength, aa as toolResultToText } from './agent-BBzkPRAu.js';
1
+ export { A as Agent, a as AgentAbortedError, b as AgentBehavior, c as AgentContextExceededError, d as AgentHooks, e as AgentOptions, f as AgentProviderError, g as AgentRunOptions, h as AgentStats, i as AgentToolNotAllowedError, j as AnthropicParams, C as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, k as CerebrasParams, l as ChildRunStats, m as ClassifiedError, n as ClassifiedErrorKind, o as CreateSessionOptions, M as McpConnection, p as McpServerConfig, q as McpToolHookContext, O as OAuthRefreshHookContext, r as OpenAIParams, s as OpenRouterParams, P as PromptDocumentPart, t as PromptImagePart, u as PromptPart, v as PromptTextPart, w as Provider, x as ProviderCapabilities, R as RemoteStoreOptions, y as RunHookMap, S as Session, z as SessionContentBlock, B as SessionData, D as SessionEndStatus, E as SessionHookContext, F as SessionMessage, G as SessionRun, H as SessionStore, I as SessionTurn, J as SkillConfig, K as SkillResource, L as SkillsConfig, N as SpawnHookContext, Q as StreamCallbacks, T as StreamHookContext, U as StreamOptions, V as ThinkingLevel, W as ToolCall, X as ToolContext, Y as ToolDef, Z as ToolExecutionMode, _ as ToolHookContext, $ as ToolMap, a0 as ToolResult, a1 as ToolResultContent, a2 as ToolResultImageContent, a3 as ToolResultTextContent, a4 as ToolSpec, a5 as TurnFinishReason, a6 as TurnResult, a7 as TurnUsage, a8 as matchesContextExceeded, a9 as toolOutputByteLength, aa as toolResultToText } from './agent-DqEkutk4.js';
2
2
  export { C as ContextCapabilities, a as ContextType, E as ExecResult, b as ExecutionContext, c as ExecutionHandle, S as SpawnConfig } from './types-vA1a_ZX7.js';
3
3
  export { S as SandboxProvider } from './sandbox-CLghrTLi.js';
4
4
  export { Preset } from './presets.js';
5
- export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult } from './validation-c3MQlCza.js';
5
+ export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult } from './validation-DTbkLXbd.js';
6
6
  import 'hookable';
7
7
  import '@modelcontextprotocol/sdk/client/index.js';
@@ -1,4 +1,4 @@
1
- import { X as ToolContext, Y as ToolDef, h as AgentStats, l as ChildRunStats } from './agent-BBzkPRAu.js';
1
+ import { X as ToolContext, Y as ToolDef, h as AgentStats, l as ChildRunStats } from './agent-DqEkutk4.js';
2
2
  import { Preset } from './presets.js';
3
3
 
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zidane",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "description": "an agent that goes straight to the goal",
5
5
  "type": "module",
6
6
  "private": false,
@@ -71,7 +71,7 @@
71
71
  "typecheck": "tsc --noEmit"
72
72
  },
73
73
  "dependencies": {
74
- "@yaelg/pi-ai": "^0.66.1",
74
+ "@mariozechner/pi-ai": "0.70.5",
75
75
  "chalk": "^5.6.2",
76
76
  "hookable": "^6.1.1",
77
77
  "md4x": "^0.0.25"