zidane 5.13.6 → 5.13.8
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/dist/acp-cli.js +2 -2
- package/dist/agent-D7ZL8B2X.d.ts.map +1 -1
- package/dist/{auth-QA4WuQK5.js → auth-_g8igXc4.js} +2 -2
- package/dist/{auth-QA4WuQK5.js.map → auth-_g8igXc4.js.map} +1 -1
- package/dist/chat.js +2 -2
- package/dist/index.js +1 -1
- package/dist/{providers-Cz-RNYZO.js → providers-Bjm6ww_Y.js} +72 -48
- package/dist/providers-Bjm6ww_Y.js.map +1 -0
- package/dist/providers.js +1 -1
- package/dist/{transcript-anchors-C_ecFvJ2.js → transcript-anchors-RAcS90Px.js} +2 -2
- package/dist/{transcript-anchors-C_ecFvJ2.js.map → transcript-anchors-RAcS90Px.js.map} +1 -1
- package/dist/tui.js +2 -2
- package/package.json +1 -1
- package/dist/providers-Cz-RNYZO.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { a as createMemoryStore, i as createRemoteStore, o as createFileMapStore
|
|
|
14
14
|
import { EFFICIENCY_METRICS, EvalMetricError, artifactPath, buildEvalRunSummary, buildRegisteredEvals, buildTrajectory, clearRegisteredEvals, computeEvalTagScores, createEvalAgent, createEvalRunReporter, createReusableExecutionContext, defineEval, defineMetrics, efficiencyMetricValues, emitEfficiencyMetrics, fileContains, fileContentQuality, fileExists, fileExistsOneOf, finalizeEvalMetrics, formatEvalCaseSummary, formatEvalRunSummary, formatTrajectoryLine, functionalityMetric, llmJudge, normalizeMetric, registerEvalTests, relativeArtifactPath, runEvalCase, statusCompleted } from "./eval.js";
|
|
15
15
|
import { i as jsonSink, n as createLogger, r as createLoggingHooks, t as consoleSink } from "./logger-Ktm-lj1s.js";
|
|
16
16
|
import { n as startOAuthCallback, t as loginMcpServer } from "./login-D5rb4IG8.js";
|
|
17
|
-
import { a as local, f as arcee, i as openai, l as cerebras, m as applyAnthropicCacheBreakpoints, p as anthropic, r as openrouter, t as xai, u as baseten } from "./providers-
|
|
17
|
+
import { a as local, f as arcee, i as openai, l as cerebras, m as applyAnthropicCacheBreakpoints, p as anthropic, r as openrouter, t as xai, u as baseten } from "./providers-Bjm6ww_Y.js";
|
|
18
18
|
import { defineSkill } from "./skills.js";
|
|
19
19
|
//#region src/cache-telemetry.ts
|
|
20
20
|
const FNV_OFFSET = 2166136261;
|
|
@@ -756,6 +756,12 @@ function classifyAnthropicError(err) {
|
|
|
756
756
|
...retryable !== void 0 ? { retryable } : {}
|
|
757
757
|
};
|
|
758
758
|
}
|
|
759
|
+
function shouldFallbackFromFastMode(err) {
|
|
760
|
+
const classified = classifyAnthropicError(err);
|
|
761
|
+
if (classified?.kind === "provider_error" && classified.retryable === true) return true;
|
|
762
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
763
|
+
return /\b(?:fast|speed)\b/i.test(message) && /capacity|overload|rate|unavailable|unsupported|not supported|not permitted|extra inputs|invalid/i.test(message);
|
|
764
|
+
}
|
|
759
765
|
/**
|
|
760
766
|
* Build a user `SessionMessage` from multimodal prompt parts.
|
|
761
767
|
*
|
|
@@ -818,7 +824,7 @@ function anthropic(anthropicParams) {
|
|
|
818
824
|
documents: true,
|
|
819
825
|
audio: false,
|
|
820
826
|
video: false,
|
|
821
|
-
nativeWebSearch: { maxUses: 5 }
|
|
827
|
+
...!isOAuth ? { nativeWebSearch: { maxUses: 5 } } : {}
|
|
822
828
|
}
|
|
823
829
|
},
|
|
824
830
|
formatTools(tools) {
|
|
@@ -1000,55 +1006,73 @@ function anthropic(anthropicParams) {
|
|
|
1000
1006
|
};
|
|
1001
1007
|
else if (options.toolChoice.type === "required") params.tool_choice = { type: "any" };
|
|
1002
1008
|
else params.tool_choice = { type: "auto" };
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
});
|
|
1012
|
-
if (callbacks.onToolCallDelta) s.on("inputJson", () => {
|
|
1013
|
-
callbacks.onToolCallDelta();
|
|
1014
|
-
});
|
|
1015
|
-
if (callbacks.onServerToolUse || callbacks.onServerToolResult) s.on("contentBlock", (block) => {
|
|
1016
|
-
if (block.type === "server_tool_use") callbacks.onServerToolUse?.({
|
|
1017
|
-
id: block.id,
|
|
1018
|
-
name: block.name,
|
|
1019
|
-
input: block.input ?? {}
|
|
1009
|
+
const runStream = async (requestParams, fastRequested) => {
|
|
1010
|
+
const s = client.messages.stream(requestParams, { signal: options.signal });
|
|
1011
|
+
let text = "";
|
|
1012
|
+
let observedOutput = false;
|
|
1013
|
+
s.on("text", (delta) => {
|
|
1014
|
+
observedOutput = true;
|
|
1015
|
+
text += delta;
|
|
1016
|
+
callbacks.onText(delta);
|
|
1020
1017
|
});
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
content: block.content
|
|
1018
|
+
if (callbacks.onThinking) s.on("thinking", (delta) => {
|
|
1019
|
+
observedOutput = true;
|
|
1020
|
+
callbacks.onThinking(delta);
|
|
1025
1021
|
});
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1022
|
+
if (callbacks.onToolCallDelta) s.on("inputJson", () => {
|
|
1023
|
+
observedOutput = true;
|
|
1024
|
+
callbacks.onToolCallDelta();
|
|
1025
|
+
});
|
|
1026
|
+
if (callbacks.onServerToolUse || callbacks.onServerToolResult) s.on("contentBlock", (block) => {
|
|
1027
|
+
observedOutput = true;
|
|
1028
|
+
if (block.type === "server_tool_use") callbacks.onServerToolUse?.({
|
|
1029
|
+
id: block.id,
|
|
1030
|
+
name: block.name,
|
|
1031
|
+
input: block.input ?? {}
|
|
1032
|
+
});
|
|
1033
|
+
else if (block.type === "web_search_tool_result") callbacks.onServerToolResult?.({
|
|
1034
|
+
toolUseId: block.tool_use_id,
|
|
1035
|
+
toolName: "web_search",
|
|
1036
|
+
content: block.content
|
|
1037
|
+
});
|
|
1038
|
+
});
|
|
1039
|
+
let response;
|
|
1040
|
+
try {
|
|
1041
|
+
response = await s.finalMessage();
|
|
1042
|
+
} catch (err) {
|
|
1043
|
+
if (fastRequested && !observedOutput && shouldFallbackFromFastMode(err)) {
|
|
1044
|
+
const standardParams = { ...requestParams };
|
|
1045
|
+
delete standardParams.speed;
|
|
1046
|
+
return await runStream(standardParams, false);
|
|
1047
|
+
}
|
|
1048
|
+
throw err;
|
|
1049
|
+
}
|
|
1050
|
+
const toolCalls = response.content.filter((b) => b.type === "tool_use").map((b) => ({
|
|
1051
|
+
id: b.id,
|
|
1052
|
+
name: b.name,
|
|
1053
|
+
input: b.input
|
|
1054
|
+
}));
|
|
1055
|
+
const finishReason = mapStopReason(response.stop_reason);
|
|
1056
|
+
const isPause = response.stop_reason === "pause_turn";
|
|
1057
|
+
return {
|
|
1058
|
+
assistantMessage: fromAnthropic({
|
|
1059
|
+
role: "assistant",
|
|
1060
|
+
content: response.content
|
|
1061
|
+
}),
|
|
1062
|
+
text,
|
|
1063
|
+
toolCalls,
|
|
1064
|
+
done: !isPause && (response.stop_reason === "end_turn" || toolCalls.length === 0),
|
|
1065
|
+
usage: fillEstimatedCost({
|
|
1066
|
+
input: response.usage.input_tokens,
|
|
1067
|
+
output: response.usage.output_tokens,
|
|
1068
|
+
cacheCreation: response.usage.cache_creation_input_tokens ?? void 0,
|
|
1069
|
+
cacheRead: response.usage.cache_read_input_tokens ?? void 0,
|
|
1070
|
+
...finishReason ? { finishReason } : {},
|
|
1071
|
+
modelId: response.model ?? options.model
|
|
1072
|
+
}, "anthropic", fastRequested ? fastModeCostMultiplier(response.model ?? options.model) : void 0)
|
|
1073
|
+
};
|
|
1051
1074
|
};
|
|
1075
|
+
return await runStream(params, options.modelOptions?.fast === true);
|
|
1052
1076
|
}
|
|
1053
1077
|
};
|
|
1054
1078
|
}
|
|
@@ -2282,4 +2306,4 @@ function xai(params) {
|
|
|
2282
2306
|
//#endregion
|
|
2283
2307
|
export { local as a, generatePkce as c, planBasetenReasoning as d, arcee as f, FAST_MODE_OPTIONS as g, ANTHROPIC_EXTRA_MODELS as h, openai as i, cerebras as l, applyAnthropicCacheBreakpoints as m, createXaiOAuthProvider as n, cursor as o, anthropic as p, openrouter as r, createCursorOAuthProvider as s, xai as t, baseten as u };
|
|
2284
2308
|
|
|
2285
|
-
//# sourceMappingURL=providers-
|
|
2309
|
+
//# sourceMappingURL=providers-Bjm6ww_Y.js.map
|