zidane 7.0.32 → 7.1.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.
- package/README.md +19 -0
- package/dist/{acp-bBDF-dhy.js → acp-B5UfEhMd.js} +4 -4
- package/dist/{acp-bBDF-dhy.js.map → acp-B5UfEhMd.js.map} +1 -1
- package/dist/acp-cli.js +6 -6
- package/dist/acp.d.ts +2 -2
- package/dist/acp.js +1 -1
- package/dist/{agent-BCG9JcZl.js → agent-_xxElOgH.js} +162 -18
- package/dist/agent-_xxElOgH.js.map +1 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{anthropic-B4UmPm4H.js → anthropic-DPPs3wjJ.js} +111 -7
- package/dist/anthropic-DPPs3wjJ.js.map +1 -0
- package/dist/{approvals-DkwGBMZ9.js → approvals-u2T19Dc-.js} +275 -88
- package/dist/approvals-u2T19Dc-.js.map +1 -0
- package/dist/{auth-D0BHBb02.js → auth-HRKkOErn.js} +3 -3
- package/dist/{auth-D0BHBb02.js.map → auth-HRKkOErn.js.map} +1 -1
- package/dist/chat/pure.d.ts +3 -3
- package/dist/chat/pure.js +1 -1
- package/dist/chat.d.ts +6 -6
- package/dist/chat.js +8 -8
- package/dist/contexts/daytona.d.ts +3 -3
- package/dist/contexts/docker.d.ts +1 -1
- package/dist/contexts/e2b.d.ts +2 -2
- package/dist/contexts/sandbox.d.ts +1 -1
- package/dist/{contexts-BSFQVclW.js → contexts-CRE9pw07.js} +544 -17
- package/dist/contexts-CRE9pw07.js.map +1 -0
- package/dist/contexts.d.ts +4 -4
- package/dist/contexts.js +2 -2
- package/dist/daemon-cli.js +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/eval.js +3 -3
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +3 -3
- package/dist/{index-B6FkK6ZN.d.ts → index-C37_ppWv.d.ts} +2 -2
- package/dist/index-C37_ppWv.d.ts.map +1 -0
- package/dist/{index-Ogi2CeHf.d.ts → index-D3TTaaQ5.d.ts} +20 -7
- package/dist/index-D3TTaaQ5.d.ts.map +1 -0
- package/dist/{index-CCB05-JZ.d.ts → index-DZhrTn-v.d.ts} +259 -12
- package/dist/index-DZhrTn-v.d.ts.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +8 -8
- package/dist/{ipc-C10lnS-a.js → ipc-ChQeueur.js} +3 -3
- package/dist/{ipc-C10lnS-a.js.map → ipc-ChQeueur.js.map} +1 -1
- package/dist/ipc.d.ts +5 -5
- package/dist/ipc.js +3 -3
- package/dist/{types-U-rIVUDw.d.ts → isolation-Kfoof0MM.d.ts} +93 -2
- package/dist/isolation-Kfoof0MM.d.ts.map +1 -0
- package/dist/mcp.d.ts +1 -1
- package/dist/output/stream-json.d.ts +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/{plugins-B531Tz5b.js → plugins-gbI7SBA6.js} +3 -3
- package/dist/{plugins-B531Tz5b.js.map → plugins-gbI7SBA6.js.map} +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/dist/providers/anthropic.d.ts +2 -2
- package/dist/providers/anthropic.js +2 -2
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +1 -1
- package/dist/restate.d.ts +2 -2
- package/dist/restate.js +1 -1
- package/dist/{sandbox-CDl9tfTo.d.ts → sandbox-BH0WQkXn.d.ts} +2 -2
- package/dist/{sandbox-CDl9tfTo.d.ts.map → sandbox-BH0WQkXn.d.ts.map} +1 -1
- package/dist/{server--mwNA7oC.js → server-CTUpOdh3.js} +8 -8
- package/dist/{server--mwNA7oC.js.map → server-CTUpOdh3.js.map} +1 -1
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session/sqlite.d.ts.map +1 -1
- package/dist/session/sqlite.js +7 -0
- package/dist/session/sqlite.js.map +1 -1
- package/dist/{session-CVy-2mAy.js → session-BqRP1hS7.js} +33 -3
- package/dist/session-BqRP1hS7.js.map +1 -0
- package/dist/session.d.ts +1 -1
- package/dist/session.js +1 -1
- package/dist/{skills-PJyiSRCp.js → skills-BC3dodWp.js} +2 -2
- package/dist/{skills-PJyiSRCp.js.map → skills-BC3dodWp.js.map} +1 -1
- package/dist/skills.d.ts +1 -1
- package/dist/skills.js +1 -1
- package/dist/{src-CjkY6fBj.js → src-CkNQKFKr.js} +3 -3
- package/dist/{src-CjkY6fBj.js.map → src-CkNQKFKr.js.map} +1 -1
- package/dist/{tool-formatters-Bu4repDJ.d.ts → tool-formatters-C5s88MUd.d.ts} +2 -2
- package/dist/{tool-formatters-Bu4repDJ.d.ts.map → tool-formatters-C5s88MUd.d.ts.map} +1 -1
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +1 -1
- package/dist/{transcript-anchors-CJCxyVE-.d.ts → transcript-anchors-DxofXw_y.d.ts} +3 -3
- package/dist/transcript-anchors-DxofXw_y.d.ts.map +1 -0
- package/dist/tui.d.ts +21 -28
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +163 -69
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-HX3g3XIc.js → turn-operations-6JDu2ewy.js} +14 -2
- package/dist/{turn-operations-HX3g3XIc.js.map → turn-operations-6JDu2ewy.js.map} +1 -1
- package/dist/{turn-operations-qcv9UFcL.d.ts → turn-operations-BaQnxzhr.d.ts} +14 -4
- package/dist/{turn-operations-qcv9UFcL.d.ts.map → turn-operations-BaQnxzhr.d.ts.map} +1 -1
- package/dist/types-CWgENVLY.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/docs/ARCHITECTURE.md +2 -1
- package/docs/CHAT.md +9 -1
- package/docs/EXECUTION_CONTEXT.md +64 -3
- package/docs/SKILL.md +28 -0
- package/docs/TUI.md +6 -5
- package/package.json +1 -1
- package/dist/agent-BCG9JcZl.js.map +0 -1
- package/dist/anthropic-B4UmPm4H.js.map +0 -1
- package/dist/approvals-DkwGBMZ9.js.map +0 -1
- package/dist/contexts-BSFQVclW.js.map +0 -1
- package/dist/index-B6FkK6ZN.d.ts.map +0 -1
- package/dist/index-CCB05-JZ.d.ts.map +0 -1
- package/dist/index-Ogi2CeHf.d.ts.map +0 -1
- package/dist/session-CVy-2mAy.js.map +0 -1
- package/dist/transcript-anchors-CJCxyVE-.d.ts.map +0 -1
- package/dist/types-U-rIVUDw.d.ts.map +0 -1
package/dist/agent.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $i as McpToolMeta, $r as RunSummaryTokens,
|
|
1
|
+
import { $i as McpToolMeta, $r as RunSummaryTokens, A_ as HydrateReadStateOptions, F_ as hydrateReadStateFromSession, Gr as RunSummary, I_ as hydrateReadStateFromSessionAsync, Ji as AgentHookMap, Jr as RunSummaryByModel, Kr as RunSummaryBlock, L_ as readStateKey, M_ as ReadStateMap, N_ as getReadState, Qi as McpConnector, Qr as RunSummaryRepeatGuard, R_ as resolveReadStateMap, Xi as AgentOptions, Xr as RunSummaryCollectorOptions, Yi as AgentHooks, Yr as RunSummaryCollector, Zr as RunSummaryError, cm as CacheDimensionDiff, dm as CacheDriftInfo, ea as McpToolWrap, ei as RunSummaryValidation, fm as diffCacheDimensions, gm as snapshotCacheDimensions, hm as installCacheBreakLogger, j_ as ReadStateEntry, lm as CacheDimensionName, mm as hashMessages, om as CacheBreakInfo, pm as fnv1a32, qi as Agent, qr as RunSummaryBudget, sm as CacheBreakLoggerOptions, ta as createAgent, ti as createRunSummaryCollector, um as CacheDimensionSnapshot } from "./index-DZhrTn-v.js";
|
|
2
2
|
export { type Agent, type AgentHookMap, type AgentHooks, type AgentOptions, type CacheBreakInfo, type CacheBreakLoggerOptions, type CacheDimensionDiff, type CacheDimensionName, type CacheDimensionSnapshot, type CacheDriftInfo, type HydrateReadStateOptions, type McpConnector, type McpToolMeta, type McpToolWrap, type ReadStateEntry, type ReadStateMap, type RunSummary, type RunSummaryBlock, type RunSummaryBudget, type RunSummaryByModel, type RunSummaryCollector, type RunSummaryCollectorOptions, type RunSummaryError, type RunSummaryRepeatGuard, type RunSummaryTokens, type RunSummaryValidation, createAgent, createRunSummaryCollector, diffCacheDimensions, fnv1a32, getReadState, hashMessages, hydrateReadStateFromSession, hydrateReadStateFromSessionAsync, installCacheBreakLogger, readStateKey, resolveReadStateMap, snapshotCacheDimensions };
|
package/dist/agent.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ar as getReadState, cr as hydrateReadStateFromSessionAsync, lr as readStateKey, sr as hydrateReadStateFromSession, t as createAgent, ur as resolveReadStateMap } from "./agent-
|
|
1
|
+
import { ar as getReadState, cr as hydrateReadStateFromSessionAsync, lr as readStateKey, sr as hydrateReadStateFromSession, t as createAgent, ur as resolveReadStateMap } from "./agent-_xxElOgH.js";
|
|
2
2
|
import { a as snapshotCacheDimensions, i as installCacheBreakLogger, n as fnv1a32, r as hashMessages, t as diffCacheDimensions } from "./cache-telemetry-ehVdWsg2.js";
|
|
3
3
|
import { t as createRunSummaryCollector } from "./run-summary-BU_NgwUT.js";
|
|
4
4
|
export { createAgent, createRunSummaryCollector, diffCacheDimensions, fnv1a32, getReadState, hashMessages, hydrateReadStateFromSession, hydrateReadStateFromSessionAsync, installCacheBreakLogger, readStateKey, resolveReadStateMap, snapshotCacheDimensions };
|
|
@@ -735,6 +735,49 @@ const OAUTH_DEFAULT_BETAS = CLAUDE_CODE_BETAS;
|
|
|
735
735
|
* See: https://platform.claude.com/docs/en/build-with-claude/fast-mode
|
|
736
736
|
*/
|
|
737
737
|
const FAST_MODE_BETA = "fast-mode-2026-02-01";
|
|
738
|
+
/** Gates `thinking.block_binding` and the `input_transformations` response field. */
|
|
739
|
+
const THINKING_BINDING_BETA = "thinking-binding-controls-2026-08-01";
|
|
740
|
+
const THINKING_BINDING_BEHAVIORS = /* @__PURE__ */ new Set([
|
|
741
|
+
"drop_block",
|
|
742
|
+
"error",
|
|
743
|
+
"off"
|
|
744
|
+
]);
|
|
745
|
+
/**
|
|
746
|
+
* Env channel the chat host writes the user's `thinkingBinding` SETTING to.
|
|
747
|
+
* Distinct from `ZIDANE_THINKING_BINDING` (the shell override) so the two
|
|
748
|
+
* never read each other back: a host recreated in-process must not mistake
|
|
749
|
+
* an earlier host's setting write for a shell value.
|
|
750
|
+
*/
|
|
751
|
+
const THINKING_BINDING_SETTING_ENV = "ZIDANE_THINKING_BINDING_SETTING";
|
|
752
|
+
/**
|
|
753
|
+
* Effective {@link AnthropicParams.thinkingBinding}: the explicit param wins,
|
|
754
|
+
* then the shell's `ZIDANE_THINKING_BINDING`, then the chat host's setting
|
|
755
|
+
* channel ({@link THINKING_BINDING_SETTING_ENV}), then `'drop_block'`. Read
|
|
756
|
+
* per request so a flip lands on the next call without rebuilding the
|
|
757
|
+
* provider (the factory is no-arg in the chat host). Unrecognized values are
|
|
758
|
+
* ignored at each level.
|
|
759
|
+
*/
|
|
760
|
+
function resolveThinkingBinding(param, env = process.env) {
|
|
761
|
+
if (param !== void 0) return param;
|
|
762
|
+
for (const key of ["ZIDANE_THINKING_BINDING", THINKING_BINDING_SETTING_ENV]) {
|
|
763
|
+
const value = env[key]?.trim();
|
|
764
|
+
if (value && THINKING_BINDING_BEHAVIORS.has(value)) return value;
|
|
765
|
+
}
|
|
766
|
+
return "drop_block";
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* The 400 the API returns under `prefix_mismatch_behavior: "error"` for a
|
|
770
|
+
* replayed block whose prefix changed. Distinct from a corrupt/tampered
|
|
771
|
+
* signature: this one names the binding and the remedy.
|
|
772
|
+
*/
|
|
773
|
+
function isPrefixMismatchError(err) {
|
|
774
|
+
return /bound to a different conversation|prefix_mismatch_behavior/i.test(errorText(err));
|
|
775
|
+
}
|
|
776
|
+
function isInputTransformation(value) {
|
|
777
|
+
if (typeof value !== "object" || value === null) return false;
|
|
778
|
+
const v = value;
|
|
779
|
+
return typeof v.type === "string" && typeof v.path === "string" && typeof v.reason === "string";
|
|
780
|
+
}
|
|
738
781
|
const API_KEY_RESERVED_EXTRA_HEADER_NAMES = /* @__PURE__ */ new Set(["anthropic-beta"]);
|
|
739
782
|
const OAUTH_RESERVED_EXTRA_HEADER_NAMES = /* @__PURE__ */ new Set([
|
|
740
783
|
"accept",
|
|
@@ -1497,6 +1540,39 @@ const MODELS_REJECTING_FORCED_TOOL_CHOICE = /* @__PURE__ */ new Set();
|
|
|
1497
1540
|
function isForcedToolChoiceUnsupportedError(err) {
|
|
1498
1541
|
return isRequestValidationError(err) && /\btool_choice\b[^.]+not supported for this model\b/i.test(errorText(err));
|
|
1499
1542
|
}
|
|
1543
|
+
/**
|
|
1544
|
+
* True for the 400 an endpoint returns when it does not know the
|
|
1545
|
+
* preserved-thinking binding surface: either the `anthropic-beta` value
|
|
1546
|
+
* (`Unexpected value(s) \`thinking-binding-controls-2026-08-01\` for the
|
|
1547
|
+
* \`anthropic-beta\` header`) or the body field (`thinking.block_binding:
|
|
1548
|
+
* Extra inputs are not permitted`). Anchored on the validation-400 gate plus
|
|
1549
|
+
* one of the two names so an unrelated `thinking` validation error (bad
|
|
1550
|
+
* budget, wrong type) does not match. Gateways and the subscription backend
|
|
1551
|
+
* are the expected sources — the same places fast mode had to be dropped.
|
|
1552
|
+
*
|
|
1553
|
+
* NOT the prefix-mismatch 400 itself. Under `'error'` mode that error reads
|
|
1554
|
+
* `Invalid \`signature\` in \`thinking\` block. The block is bound to a
|
|
1555
|
+
* different conversation. Remove the block, or set
|
|
1556
|
+
* \`thinking.block_binding.prefix_mismatch_behavior\` to "drop_block".` — it
|
|
1557
|
+
* names the field while proving the endpoint understood it. Matching it here
|
|
1558
|
+
* would mis-diagnose a user-requested failure as an unsupported endpoint and
|
|
1559
|
+
* disable the binding for the instance's lifetime, so the signature shape is
|
|
1560
|
+
* excluded explicitly.
|
|
1561
|
+
*/
|
|
1562
|
+
function isThinkingBindingRejectedError(err) {
|
|
1563
|
+
if (!isRequestValidationError(err)) return false;
|
|
1564
|
+
const text = errorText(err);
|
|
1565
|
+
return /block_binding|prefix_mismatch_behavior|thinking-binding-controls/i.test(text) && !/invalid\s+`?signature`?|bound to a different conversation/i.test(text);
|
|
1566
|
+
}
|
|
1567
|
+
/** The same request with `thinking.block_binding` removed. */
|
|
1568
|
+
function withoutThinkingBinding(params) {
|
|
1569
|
+
if (!params.thinking) return params;
|
|
1570
|
+
const { block_binding: _dropped, ...thinking } = params.thinking;
|
|
1571
|
+
return {
|
|
1572
|
+
...params,
|
|
1573
|
+
thinking
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1500
1576
|
function isForcedToolChoice(choice) {
|
|
1501
1577
|
return choice?.type === "tool" || choice?.type === "any";
|
|
1502
1578
|
}
|
|
@@ -1659,6 +1735,14 @@ function anthropic(anthropicParams) {
|
|
|
1659
1735
|
const isOAuth = resolveAnthropicAuthShape(bedrockConfig ? "" : getConfiguredApiKey(anthropicParams), anthropicParams?.authMode).bearer;
|
|
1660
1736
|
const defaultModel = anthropicParams?.defaultModel || "claude-fable-5-1";
|
|
1661
1737
|
let runtimeCredentials = extractRuntimeCredentials(anthropicParams);
|
|
1738
|
+
/**
|
|
1739
|
+
* Set once this provider instance sees the endpoint reject the
|
|
1740
|
+
* preserved-thinking binding beta or field; every later request on the
|
|
1741
|
+
* instance skips both up front instead of paying the failing round-trip.
|
|
1742
|
+
* Per instance, not process-wide: acceptance is a property of the
|
|
1743
|
+
* endpoint + credential, and one process may hold several.
|
|
1744
|
+
*/
|
|
1745
|
+
let thinkingBindingRejected = false;
|
|
1662
1746
|
return {
|
|
1663
1747
|
name: "anthropic",
|
|
1664
1748
|
meta: {
|
|
@@ -1843,8 +1927,13 @@ function anthropic(anthropicParams) {
|
|
|
1843
1927
|
const callCanRotateAuth = callAuth.bearer;
|
|
1844
1928
|
const effectiveCacheTtl = options.cacheTtl ?? (callIsOAuth ? "1h" : void 0);
|
|
1845
1929
|
const extendedTtl = options.cache !== false && effectiveCacheTtl === "1h" && !bedrockConfig;
|
|
1846
|
-
const
|
|
1847
|
-
const
|
|
1930
|
+
const plan = planAnthropicThinking(options.thinking ?? "off", options.thinkingBudget, options.taskBudget, options.effortHint !== false);
|
|
1931
|
+
const thinkingBinding = resolveThinkingBinding(anthropicParams?.thinkingBinding);
|
|
1932
|
+
const bindingActive = plan !== null && !bedrockConfig && thinkingBinding !== "off" && !thinkingBindingRejected;
|
|
1933
|
+
const baseConditionalBetas = [...options.modelOptions?.fast && !callIsOAuth ? [FAST_MODE_BETA] : [], ...extendedTtl ? [EXTENDED_CACHE_TTL_BETA] : []];
|
|
1934
|
+
const conditionalBetas = [...baseConditionalBetas, ...bindingActive ? [THINKING_BINDING_BETA] : []];
|
|
1935
|
+
const betasFor = (conditional) => conditional.length > 0 ? [...anthropicParams?.extraBetas ?? [], ...conditional] : anthropicParams?.extraBetas;
|
|
1936
|
+
const requestBetas = betasFor(conditionalBetas);
|
|
1848
1937
|
const resolvedExtraHeaders = await resolveExtraHeaders(anthropicParams?.extraHeaders);
|
|
1849
1938
|
let client = bedrockConfig ? await createBedrockClient(bedrockConfig, anthropicParams, resolvedExtraHeaders) : createClient(await loadAnthropicSdk(), apiKey, callAuth, anthropicParams?.baseURL, requestBetas, resolvedExtraHeaders, callIsOAuth ? diagnostic.wrapFetch : void 0);
|
|
1850
1939
|
const wireSystem = renderSystemForWire(options.system);
|
|
@@ -1866,7 +1955,6 @@ function anthropic(anthropicParams) {
|
|
|
1866
1955
|
},
|
|
1867
1956
|
...options.messages
|
|
1868
1957
|
] : [...options.messages];
|
|
1869
|
-
const thinking = options.thinking ?? "off";
|
|
1870
1958
|
const inputTools = options.tools ?? [];
|
|
1871
1959
|
const nameBoundary = createToolNameBoundary(messages, inputTools.map((t) => t.name), callIsOAuth ? claudeCodeToolAliases : void 0);
|
|
1872
1960
|
const wireTools = nameBoundary.changed ? inputTools.map((t) => t.name === nameBoundary.toWire(t.name) ? t : {
|
|
@@ -1886,7 +1974,6 @@ function anthropic(anthropicParams) {
|
|
|
1886
1974
|
};
|
|
1887
1975
|
if (anthropicParams?.contextManagement && !bedrockConfig) params.context_management = anthropicParams.contextManagement;
|
|
1888
1976
|
if (options.cache !== false) applyAnthropicCacheBreakpoints(params, callIsOAuth ? void 0 : options.system, extendedTtl ? effectiveCacheTtl : void 0);
|
|
1889
|
-
const plan = planAnthropicThinking(thinking, options.thinkingBudget, options.taskBudget, options.effortHint !== false);
|
|
1890
1977
|
if (plan && bedrockConfig) {
|
|
1891
1978
|
const budget = plan.kind === "enabled" ? plan.budgetTokens : BEDROCK_THINKING_BUDGETS[plan.effort ?? "medium"];
|
|
1892
1979
|
params.thinking = {
|
|
@@ -1925,6 +2012,7 @@ function anthropic(anthropicParams) {
|
|
|
1925
2012
|
if (typeof plan.maxTokensCap === "number" && plan.maxTokensCap > 0) params.max_tokens = Math.min(params.max_tokens, plan.maxTokensCap);
|
|
1926
2013
|
}
|
|
1927
2014
|
params.temperature = 1;
|
|
2015
|
+
if (bindingActive) params.thinking.block_binding = { prefix_mismatch_behavior: thinkingBinding };
|
|
1928
2016
|
}
|
|
1929
2017
|
params.max_tokens = Math.min(params.max_tokens, modelMaxOutput);
|
|
1930
2018
|
if (callIsOAuth) {
|
|
@@ -2016,6 +2104,11 @@ function anthropic(anthropicParams) {
|
|
|
2016
2104
|
callbacks.onUsage(live);
|
|
2017
2105
|
});
|
|
2018
2106
|
}
|
|
2107
|
+
let inputTransformations;
|
|
2108
|
+
if (callbacks.onInputTransformations) s.on("streamEvent", (event) => {
|
|
2109
|
+
const list = (event.type === "message_start" ? event.message : event.type === "message_delta" ? event : void 0)?.input_transformations;
|
|
2110
|
+
if (Array.isArray(list) && list.length > 0) inputTransformations = list.filter(isInputTransformation);
|
|
2111
|
+
});
|
|
2019
2112
|
if (callbacks.onToolCallDelta) s.on("inputJson", () => {
|
|
2020
2113
|
observedOutput = true;
|
|
2021
2114
|
callbacks.onToolCallDelta();
|
|
@@ -2037,7 +2130,7 @@ function anthropic(anthropicParams) {
|
|
|
2037
2130
|
try {
|
|
2038
2131
|
response = await s.finalMessage();
|
|
2039
2132
|
} catch (err) {
|
|
2040
|
-
if (!observedOutput && scrubPass < MAX_THINKING_SCRUB_PASSES && isRecoverableThinkingBlockError(err, requestParams.messages)) {
|
|
2133
|
+
if (!(bindingActive && thinkingBinding === "error" && isPrefixMismatchError(err)) && !observedOutput && scrubPass < MAX_THINKING_SCRUB_PASSES && isRecoverableThinkingBlockError(err, requestParams.messages)) {
|
|
2041
2134
|
const failingIndex = parseFailingMessageIndex(err);
|
|
2042
2135
|
const plan = planThinkingScrub(scrubPass, failingIndex, requestParams.messages);
|
|
2043
2136
|
const scrubbed = withoutHistoricalThinking(requestParams.messages, plan.upToIndex, plan.alsoMessageIndex);
|
|
@@ -2078,12 +2171,23 @@ function anthropic(anthropicParams) {
|
|
|
2078
2171
|
delete standardParams.speed;
|
|
2079
2172
|
return await runStream(standardParams, false, scrubPass, authPass);
|
|
2080
2173
|
}
|
|
2174
|
+
if (bindingActive && !thinkingBindingRejected && !observedOutput && isThinkingBindingRejectedError(err)) {
|
|
2175
|
+
thinkingBindingRejected = true;
|
|
2176
|
+
if (process.env.ZIDANE_DEBUG) process.stderr.write(`[zidane/anthropic] endpoint rejected thinking.block_binding; retrying without it: ${errorMessage(err)}\n`);
|
|
2177
|
+
client = createClient(await loadAnthropicSdk(), apiKey, callAuth, anthropicParams?.baseURL, betasFor(baseConditionalBetas), resolvedExtraHeaders, callIsOAuth ? diagnostic.wrapFetch : void 0);
|
|
2178
|
+
return await runStream(withoutThinkingBinding(requestParams), fastRequested, scrubPass, authPass);
|
|
2179
|
+
}
|
|
2081
2180
|
if (!observedOutput && isForcedToolChoice(requestParams.tool_choice) && isForcedToolChoiceUnsupportedError(err)) {
|
|
2082
2181
|
MODELS_REJECTING_FORCED_TOOL_CHOICE.add(modelId);
|
|
2083
2182
|
return await runStream(withoutForcedToolChoice(requestParams), fastRequested, scrubPass, authPass);
|
|
2084
2183
|
}
|
|
2085
2184
|
throw err;
|
|
2086
2185
|
}
|
|
2186
|
+
if (inputTransformations && inputTransformations.length > 0) try {
|
|
2187
|
+
callbacks.onInputTransformations?.(inputTransformations);
|
|
2188
|
+
} catch (hookErr) {
|
|
2189
|
+
if (process.env.ZIDANE_DEBUG) process.stderr.write(`[zidane/anthropic] onInputTransformations threw: ${errorMessage(hookErr)}\n`);
|
|
2190
|
+
}
|
|
2087
2191
|
const toolCalls = response.content.filter((b) => b.type === "tool_use").map((b) => ({
|
|
2088
2192
|
id: b.id,
|
|
2089
2193
|
name: nameBoundary.fromWire(b.name),
|
|
@@ -2129,6 +2233,6 @@ function anthropic(anthropicParams) {
|
|
|
2129
2233
|
};
|
|
2130
2234
|
}
|
|
2131
2235
|
//#endregion
|
|
2132
|
-
export {
|
|
2236
|
+
export { FAST_MODE_OPTIONS as _, buildAnthropicClientOptions as a, credentialIdentity as c, resolveAnthropicAuthShape as d, resolveAnthropicBetas as f, ANTHROPIC_EXTRA_MODELS as g, sanitizeProviderDiagnosticMetadata as h, applyAnthropicCacheBreakpoints as i, defaultAnthropicMaxTokens as l, resolveThinkingBinding as m, THINKING_BINDING_SETTING_ENV as n, cacheWriteTtlMultiplier as o, resolveAnthropicMaxOutput as p, anthropic as r, classifyAnthropicError as s, EXTENDED_CACHE_TTL_BETA as t, planAnthropicThinking as u };
|
|
2133
2237
|
|
|
2134
|
-
//# sourceMappingURL=anthropic-
|
|
2238
|
+
//# sourceMappingURL=anthropic-DPPs3wjJ.js.map
|