zidane 3.3.0 → 3.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.
@@ -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
  }
@@ -812,7 +812,7 @@ function decodedBase64ByteLength(b64) {
812
812
 
813
813
  // src/tools/read-file.ts
814
814
  var DEFAULT_LINE_LIMIT = 2e3;
815
- var DEFAULT_BYTE_CAP = 65536;
815
+ var DEFAULT_BYTE_CAP = 262144;
816
816
  var DEFAULT_IMAGE_BYTE_CAP = 5 * 1024 * 1024;
817
817
  var readFile = {
818
818
  spec: {
@@ -824,7 +824,7 @@ var readFile = {
824
824
  path: { type: "string", description: "Relative file path." },
825
825
  offset: { type: "integer", description: "1-indexed line number to start from. Default: 1." },
826
826
  limit: { type: "integer", description: "Max lines to return. Default: 2000. Set 0 for unlimited." },
827
- maxBytes: { type: "integer", description: "Hard byte cap on file content read, regardless of line count. Default: 65536. Set 0 for unlimited. The rendered output may be slightly larger than this cap when `lineNumbers` is on (each line carries a `<N>\\t` prefix)." },
827
+ maxBytes: { type: "integer", description: "Hard byte cap on file content read, regardless of line count. Default: 262144. Set 0 for unlimited. The rendered output may be slightly larger than this cap when `lineNumbers` is on (each line carries a `<N>\\t` prefix)." },
828
828
  lineNumbers: { type: "boolean", description: "Prefix each line with its 1-indexed line number. Default: true. Override the agent-wide `behavior.readLineNumbers` for this call." }
829
829
  },
830
830
  required: ["path"]
@@ -943,7 +943,7 @@ var readFile = {
943
943
  if (midLineCut) {
944
944
  return `${body}
945
945
 
946
- \u2026truncated mid-line at line ${lastLineRead} (byte cap ${maxBytesN} reached). File has ${totalLines} lines, ${totalBytes} bytes total. Raise maxBytes, or use shell with sed/awk to read the remainder of this line.`;
946
+ \u2026truncated mid-line at line ${lastLineRead} (byte cap ${maxBytesN} reached). File has ${totalLines} lines, ${totalBytes} bytes total. Raise maxBytes to read the full line.`;
947
947
  }
948
948
  const reason = bytesCut ? `byte cap (${maxBytesN}) reached` : `line limit (${limitN}) reached`;
949
949
  return `${body}
@@ -992,17 +992,17 @@ function extractTrailingCommand(command) {
992
992
  }
993
993
 
994
994
  // src/tools/shell.ts
995
- var DEFAULT_MAX_OUTPUT_BYTES = 8192;
995
+ var DEFAULT_MAX_OUTPUT_BYTES = 32768;
996
996
  var shell = {
997
997
  spec: {
998
998
  name: "shell",
999
- description: "Execute a shell command in the project root and return its combined stdout/stderr. Output is tail-priority truncated at 8 KB by default; errors and exit-code summaries live in the tail. By default each call appends a `(exit N, Nms)` footer and surfaces non-empty stderr in a separate section even on success \u2014 set `metadata: false` to return only stdout. Set maxOutputBytes=0 to disable truncation.",
999
+ description: "Execute a shell command in the project root and return its combined stdout/stderr. Output is tail-priority truncated at 32 KiB by default; errors and exit-code summaries live in the tail. By default each call appends a `(exit N, Nms)` footer and surfaces non-empty stderr in a separate section even on success \u2014 set `metadata: false` to return only stdout. Set maxOutputBytes=0 to disable truncation.",
1000
1000
  inputSchema: {
1001
1001
  type: "object",
1002
1002
  properties: {
1003
1003
  command: { type: "string", description: "Shell command to run." },
1004
1004
  timeout: { type: "integer", description: "Per-call timeout in milliseconds." },
1005
- maxOutputBytes: { type: "integer", description: "Truncate combined stdout+stderr beyond this many bytes. Default: 8192. Set 0 for unlimited." },
1005
+ maxOutputBytes: { type: "integer", description: "Truncate combined stdout+stderr beyond this many bytes. Default: 32768. Set 0 for unlimited." },
1006
1006
  metadata: { type: "boolean", description: "Append `(exit N, Nms)` footer and surface non-empty stderr on success. Default: true." }
1007
1007
  },
1008
1008
  required: ["command"]
@@ -6,7 +6,7 @@ import {
6
6
  readFile,
7
7
  shell,
8
8
  writeFile
9
- } from "./chunk-Z2E5QN5X.js";
9
+ } from "./chunk-5GRZ5XVU.js";
10
10
 
11
11
  // src/presets/basic.ts
12
12
  var basicTools = { shell, readFile, writeFile, listFiles, edit, multiEdit };
@@ -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,12 +6,12 @@ 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,
13
13
  definePreset
14
- } from "./chunk-3D5Q527Y.js";
14
+ } from "./chunk-KITHPMLV.js";
15
15
  import {
16
16
  createAgent,
17
17
  createInteractionTool,
@@ -24,7 +24,7 @@ import {
24
24
  grep,
25
25
  multiEdit,
26
26
  validateToolArgs
27
- } from "./chunk-Z2E5QN5X.js";
27
+ } from "./chunk-5GRZ5XVU.js";
28
28
  import {
29
29
  IMPLICITLY_ALLOWED_SKILL_TOOLS,
30
30
  buildCatalog,
@@ -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';
package/dist/presets.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  basicTools,
3
3
  basic_default,
4
4
  definePreset
5
- } from "./chunk-3D5Q527Y.js";
6
- import "./chunk-Z2E5QN5X.js";
5
+ } from "./chunk-KITHPMLV.js";
6
+ import "./chunk-5GRZ5XVU.js";
7
7
  import "./chunk-X3VOTPVM.js";
8
8
  import "./chunk-UD25QF3H.js";
9
9
  import "./chunk-7H34OFDA.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/tools.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  shell,
14
14
  validateToolArgs,
15
15
  writeFile
16
- } from "./chunk-Z2E5QN5X.js";
16
+ } from "./chunk-5GRZ5XVU.js";
17
17
  import "./chunk-X3VOTPVM.js";
18
18
  import "./chunk-UD25QF3H.js";
19
19
  import "./chunk-7H34OFDA.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.3",
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"