@duheso/zerocli 0.9.5 → 0.9.7
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/cli.mjs +292 -86
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -119192,7 +119192,7 @@ function buildProviderInfoLines() {
|
|
|
119192
119192
|
const sLen = ` ● ${sL} ${sReady}`.length;
|
|
119193
119193
|
out.push(boxRow(sRow, W2, sLen));
|
|
119194
119194
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
119195
|
-
out.push(` ${DIM}${rgb(...DIMCOL)}zero ${RESET}${rgb(...ACCENT)}v${"0.9.
|
|
119195
|
+
out.push(` ${DIM}${rgb(...DIMCOL)}zero ${RESET}${rgb(...ACCENT)}v${"0.9.7"}${RESET}`);
|
|
119196
119196
|
return out;
|
|
119197
119197
|
}
|
|
119198
119198
|
function printStartupScreen() {}
|
|
@@ -147383,7 +147383,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
147383
147383
|
if (!isAttributionHeaderEnabled()) {
|
|
147384
147384
|
return "";
|
|
147385
147385
|
}
|
|
147386
|
-
const version2 = `${"0.9.
|
|
147386
|
+
const version2 = `${"0.9.7"}.${fingerprint}`;
|
|
147387
147387
|
const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "unknown";
|
|
147388
147388
|
const cch = "";
|
|
147389
147389
|
const workload = getWorkload();
|
|
@@ -190393,7 +190393,7 @@ var init_imageValidation = __esm(() => {
|
|
|
190393
190393
|
|
|
190394
190394
|
// src/utils/userAgent.ts
|
|
190395
190395
|
function getZeroCodeUserAgent() {
|
|
190396
|
-
return `claude-code/${"0.9.
|
|
190396
|
+
return `claude-code/${"0.9.7"}`;
|
|
190397
190397
|
}
|
|
190398
190398
|
|
|
190399
190399
|
// src/utils/http.ts
|
|
@@ -190402,7 +190402,7 @@ function getUserAgent() {
|
|
|
190402
190402
|
const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
|
|
190403
190403
|
const workload = getWorkload();
|
|
190404
190404
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
190405
|
-
return `claude-cli/${"0.9.
|
|
190405
|
+
return `claude-cli/${"0.9.7"} (${process.env.USER_TYPE}, ${process.env.CLAUDE_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
190406
190406
|
}
|
|
190407
190407
|
function getMCPUserAgent() {
|
|
190408
190408
|
const parts = [];
|
|
@@ -190416,7 +190416,7 @@ function getMCPUserAgent() {
|
|
|
190416
190416
|
parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
|
|
190417
190417
|
}
|
|
190418
190418
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
190419
|
-
return `claude-code/${"0.9.
|
|
190419
|
+
return `claude-code/${"0.9.7"}${suffix}`;
|
|
190420
190420
|
}
|
|
190421
190421
|
function getWebFetchUserAgent() {
|
|
190422
190422
|
const supportUrl = getAPIProvider() === "firstParty" ? "https://support.anthropic.com/" : "https://github.com/Duheso/ZeroCLI";
|
|
@@ -192892,23 +192892,46 @@ async function* openaiStreamToAnthropic(response, model, signal) {
|
|
|
192892
192892
|
return;
|
|
192893
192893
|
const decoder = new TextDecoder;
|
|
192894
192894
|
let buffer = "";
|
|
192895
|
-
const STREAM_IDLE_TIMEOUT_MS =
|
|
192895
|
+
const STREAM_IDLE_TIMEOUT_MS = parseInt(process.env.OPENAI_STREAM_IDLE_TIMEOUT_MS ?? "300000", 10) || 300000;
|
|
192896
192896
|
let lastDataTime = Date.now();
|
|
192897
|
+
let lastStallWarningTime = 0;
|
|
192897
192898
|
async function readWithTimeout() {
|
|
192898
192899
|
return new Promise((resolve19, reject) => {
|
|
192899
192900
|
const timeoutId = setTimeout(() => {
|
|
192900
192901
|
const elapsed = Math.round((Date.now() - lastDataTime) / 1000);
|
|
192901
|
-
|
|
192902
|
+
const msg = `OpenAI/Gemini SSE stream idle for ${elapsed}s (limit: ${STREAM_IDLE_TIMEOUT_MS / 1000}s). Connection likely dropped.`;
|
|
192903
|
+
logForDebugging(`
|
|
192904
|
+
` + `========================================================================
|
|
192905
|
+
` + `[ZERO-DEBUG] ENCERRAMENTO DETECTADO: STREAM IDLE TIMEOUT
|
|
192906
|
+
` + `========================================================================
|
|
192907
|
+
` + `CAUSA: O stream SSE ficou ${elapsed}s sem receber dados do modelo (vLLM/OpenAI).
|
|
192908
|
+
` + `LIMITE ATUAL: ${STREAM_IDLE_TIMEOUT_MS / 1000}s (configuravel via OPENAI_STREAM_IDLE_TIMEOUT_MS).
|
|
192909
|
+
` + `EFEITO: Zero encerrou o processamento porque assumiu que a conexao caiu.
|
|
192910
|
+
` + `CORRECAO: Aumentar o timeout via env var OPENAI_STREAM_IDLE_TIMEOUT_MS (em ms).
|
|
192911
|
+
` + ` Modelos locais (vLLM) podem demorar mais que 120s entre chunks.
|
|
192912
|
+
` + `========================================================================`, { level: "error" });
|
|
192913
|
+
reject(new Error(msg));
|
|
192902
192914
|
}, STREAM_IDLE_TIMEOUT_MS);
|
|
192915
|
+
const STALL_WARNING_INTERVAL_MS = 30000;
|
|
192916
|
+
const stallWarningId = setInterval(() => {
|
|
192917
|
+
const idleSeconds = Math.round((Date.now() - lastDataTime) / 1000);
|
|
192918
|
+
const now2 = Date.now();
|
|
192919
|
+
if (idleSeconds >= 30 && now2 - lastStallWarningTime >= STALL_WARNING_INTERVAL_MS) {
|
|
192920
|
+
lastStallWarningTime = now2;
|
|
192921
|
+
logForDebugging(`[ZERO-DEBUG] STALL WARNING: Stream sem dados há ${idleSeconds}s. ` + `Timeout em ${Math.round((STREAM_IDLE_TIMEOUT_MS - (now2 - lastDataTime)) / 1000)}s. ` + `Modelo ainda pode estar processando (vLLM/local models são lentos).`, { level: "warn" });
|
|
192922
|
+
}
|
|
192923
|
+
}, STALL_WARNING_INTERVAL_MS);
|
|
192903
192924
|
let abortCleanup;
|
|
192904
192925
|
if (signal) {
|
|
192905
192926
|
abortCleanup = () => {
|
|
192906
192927
|
clearTimeout(timeoutId);
|
|
192928
|
+
clearInterval(stallWarningId);
|
|
192907
192929
|
};
|
|
192908
192930
|
signal.addEventListener("abort", abortCleanup, { once: true });
|
|
192909
192931
|
}
|
|
192910
192932
|
reader.read().then((result) => {
|
|
192911
192933
|
clearTimeout(timeoutId);
|
|
192934
|
+
clearInterval(stallWarningId);
|
|
192912
192935
|
if (signal && abortCleanup)
|
|
192913
192936
|
signal.removeEventListener("abort", abortCleanup);
|
|
192914
192937
|
if (result.value)
|
|
@@ -192916,6 +192939,7 @@ async function* openaiStreamToAnthropic(response, model, signal) {
|
|
|
192916
192939
|
resolve19(result);
|
|
192917
192940
|
}, (err2) => {
|
|
192918
192941
|
clearTimeout(timeoutId);
|
|
192942
|
+
clearInterval(stallWarningId);
|
|
192919
192943
|
if (signal && abortCleanup)
|
|
192920
192944
|
signal.removeEventListener("abort", abortCleanup);
|
|
192921
192945
|
reject(err2);
|
|
@@ -192958,7 +192982,19 @@ async function* openaiStreamToAnthropic(response, model, signal) {
|
|
|
192958
192982
|
let chunk;
|
|
192959
192983
|
try {
|
|
192960
192984
|
chunk = JSON.parse(trimmed.slice(6));
|
|
192961
|
-
} catch {
|
|
192985
|
+
} catch (parseError) {
|
|
192986
|
+
logForDebugging(`
|
|
192987
|
+
` + `========================================================================
|
|
192988
|
+
` + `[ZERO-DEBUG] ALERTA: ERRO DE PARSE JSON NO STREAM SSE
|
|
192989
|
+
` + `========================================================================
|
|
192990
|
+
` + `CAUSA: Chunk recebido do modelo nao e JSON valido.
|
|
192991
|
+
` + `DADOS RECEBIDOS: ${trimmed.slice(0, 500)}
|
|
192992
|
+
` + `ERRO: ${parseError instanceof Error ? parseError.message : String(parseError)}
|
|
192993
|
+
` + `EFEITO: Este chunk foi IGNORADO silenciosamente. Se muitos chunks falharem,
|
|
192994
|
+
` + ` o modelo pode parecer encerrar sem completar a resposta.
|
|
192995
|
+
` + `CORRECAO: Verificar se o vLLM esta retornando respostas validas.
|
|
192996
|
+
` + ` Pode indicar incompatibilidade de formato entre vLLM e ZeroCLI.
|
|
192997
|
+
` + `========================================================================`, { level: "warn" });
|
|
192962
192998
|
continue;
|
|
192963
192999
|
}
|
|
192964
193000
|
const chunkUsage = convertChunkUsage(chunk.usage);
|
|
@@ -193133,6 +193169,20 @@ async function* openaiStreamToAnthropic(response, model, signal) {
|
|
|
193133
193169
|
yield { type: "content_block_stop", index: tc.index };
|
|
193134
193170
|
}
|
|
193135
193171
|
const stopReason = choice.finish_reason === "tool_calls" ? "tool_use" : choice.finish_reason === "length" ? "max_tokens" : "end_turn";
|
|
193172
|
+
if (choice.finish_reason === "length") {
|
|
193173
|
+
logForDebugging(`
|
|
193174
|
+
` + `========================================================================
|
|
193175
|
+
` + `[ZERO-DEBUG] ENCERRAMENTO DETECTADO: MAX_TOKENS ATINGIDO (finish_reason=length)
|
|
193176
|
+
` + `========================================================================
|
|
193177
|
+
` + `CAUSA: O modelo atingiu o limite de tokens de saida e parou de gerar.
|
|
193178
|
+
` + `FINISH_REASON: "length" (convertido para "max_tokens" internamente).
|
|
193179
|
+
` + `EFEITO: Zero encerrou o processamento porque o modelo foi cortado no meio.
|
|
193180
|
+
` + ` A resposta pode estar incompleta ou cortada abruptamente.
|
|
193181
|
+
` + `CORRECAO: Aumentar max_tokens via env var CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000
|
|
193182
|
+
` + ` ou CLAUDE_CODE_OPENAI_MAX_OUTPUT_TOKENS='{"seu-modelo": 64000}'
|
|
193183
|
+
` + ` Default atual: CAPPED_DEFAULT_MAX_TOKENS = 8000 tokens.
|
|
193184
|
+
` + `========================================================================`, { level: "error" });
|
|
193185
|
+
}
|
|
193136
193186
|
if (choice.finish_reason === "content_filter" || choice.finish_reason === "safety") {
|
|
193137
193187
|
if (!hasEmittedContentStart) {
|
|
193138
193188
|
yield {
|
|
@@ -244852,7 +244902,7 @@ function getTelemetryAttributes() {
|
|
|
244852
244902
|
attributes["session.id"] = sessionId;
|
|
244853
244903
|
}
|
|
244854
244904
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
244855
|
-
attributes["app.version"] = "0.9.
|
|
244905
|
+
attributes["app.version"] = "0.9.7";
|
|
244856
244906
|
}
|
|
244857
244907
|
const oauthAccount = getOauthAccountInfo();
|
|
244858
244908
|
if (oauthAccount) {
|
|
@@ -257091,7 +257141,7 @@ function computeFingerprint(messageText, version2) {
|
|
|
257091
257141
|
}
|
|
257092
257142
|
function computeFingerprintFromMessages(messages) {
|
|
257093
257143
|
const firstMessageText = extractFirstMessageText(messages);
|
|
257094
|
-
return computeFingerprint(firstMessageText, "0.9.
|
|
257144
|
+
return computeFingerprint(firstMessageText, "0.9.7");
|
|
257095
257145
|
}
|
|
257096
257146
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
257097
257147
|
var init_fingerprint = () => {};
|
|
@@ -257133,7 +257183,7 @@ async function sideQuery(opts) {
|
|
|
257133
257183
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
257134
257184
|
}
|
|
257135
257185
|
const messageText = extractFirstUserMessageText(messages);
|
|
257136
|
-
const fingerprint = computeFingerprint(messageText, "0.9.
|
|
257186
|
+
const fingerprint = computeFingerprint(messageText, "0.9.7");
|
|
257137
257187
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
257138
257188
|
const systemBlocks = [
|
|
257139
257189
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -266035,7 +266085,7 @@ var init_user = __esm(() => {
|
|
|
266035
266085
|
deviceId,
|
|
266036
266086
|
sessionId: getSessionId(),
|
|
266037
266087
|
email: getEmail(),
|
|
266038
|
-
appVersion: "0.9.
|
|
266088
|
+
appVersion: "0.9.7",
|
|
266039
266089
|
platform: getHostPlatformForAnalytics(),
|
|
266040
266090
|
organizationUuid,
|
|
266041
266091
|
accountUuid,
|
|
@@ -266429,7 +266479,7 @@ async function initializeBetaTracing(resource) {
|
|
|
266429
266479
|
});
|
|
266430
266480
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
266431
266481
|
setLoggerProvider(loggerProvider);
|
|
266432
|
-
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "0.9.
|
|
266482
|
+
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "0.9.7");
|
|
266433
266483
|
setEventLogger(eventLogger);
|
|
266434
266484
|
process.on("beforeExit", async () => {
|
|
266435
266485
|
await loggerProvider?.forceFlush();
|
|
@@ -266469,7 +266519,7 @@ async function initializeTelemetry() {
|
|
|
266469
266519
|
const platform3 = getPlatform();
|
|
266470
266520
|
const baseAttributes = {
|
|
266471
266521
|
[ATTR_SERVICE_NAME3]: "claude-code",
|
|
266472
|
-
[ATTR_SERVICE_VERSION3]: "0.9.
|
|
266522
|
+
[ATTR_SERVICE_VERSION3]: "0.9.7"
|
|
266473
266523
|
};
|
|
266474
266524
|
if (platform3 === "wsl") {
|
|
266475
266525
|
const wslVersion = getWslVersion();
|
|
@@ -266514,7 +266564,7 @@ async function initializeTelemetry() {
|
|
|
266514
266564
|
} catch {}
|
|
266515
266565
|
};
|
|
266516
266566
|
registerCleanup(shutdownTelemetry2);
|
|
266517
|
-
return meterProvider2.getMeter("com.anthropic.claude_code", "0.9.
|
|
266567
|
+
return meterProvider2.getMeter("com.anthropic.claude_code", "0.9.7");
|
|
266518
266568
|
}
|
|
266519
266569
|
const meterProvider = new MeterProvider3({
|
|
266520
266570
|
resource,
|
|
@@ -266534,7 +266584,7 @@ async function initializeTelemetry() {
|
|
|
266534
266584
|
});
|
|
266535
266585
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
266536
266586
|
setLoggerProvider(loggerProvider);
|
|
266537
|
-
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "0.9.
|
|
266587
|
+
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "0.9.7");
|
|
266538
266588
|
setEventLogger(eventLogger);
|
|
266539
266589
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
266540
266590
|
process.on("beforeExit", async () => {
|
|
@@ -266596,7 +266646,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
266596
266646
|
}
|
|
266597
266647
|
};
|
|
266598
266648
|
registerCleanup(shutdownTelemetry);
|
|
266599
|
-
return meterProvider.getMeter("com.anthropic.claude_code", "0.9.
|
|
266649
|
+
return meterProvider.getMeter("com.anthropic.claude_code", "0.9.7");
|
|
266600
266650
|
}
|
|
266601
266651
|
async function flushTelemetry() {
|
|
266602
266652
|
const meterProvider = getMeterProvider();
|
|
@@ -267408,9 +267458,9 @@ async function assertMinVersion() {
|
|
|
267408
267458
|
}
|
|
267409
267459
|
try {
|
|
267410
267460
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
267411
|
-
if (versionConfig.minVersion && lt("0.9.
|
|
267461
|
+
if (versionConfig.minVersion && lt("0.9.7", versionConfig.minVersion)) {
|
|
267412
267462
|
console.error(`
|
|
267413
|
-
It looks like your version of ZeroCLI (${"0.9.
|
|
267463
|
+
It looks like your version of ZeroCLI (${"0.9.7"}) needs an update.
|
|
267414
267464
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
267415
267465
|
|
|
267416
267466
|
To update, please run:
|
|
@@ -267626,7 +267676,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
267626
267676
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
267627
267677
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
267628
267678
|
pid: process.pid,
|
|
267629
|
-
currentVersion: "0.9.
|
|
267679
|
+
currentVersion: "0.9.7"
|
|
267630
267680
|
});
|
|
267631
267681
|
return "in_progress";
|
|
267632
267682
|
}
|
|
@@ -267635,7 +267685,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
267635
267685
|
if (!env2.isRunningWithBun() && env2.isNpmFromWindowsPath()) {
|
|
267636
267686
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
267637
267687
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
267638
|
-
currentVersion: "0.9.
|
|
267688
|
+
currentVersion: "0.9.7"
|
|
267639
267689
|
});
|
|
267640
267690
|
console.error(`
|
|
267641
267691
|
Error: Windows NPM detected in WSL
|
|
@@ -268189,7 +268239,7 @@ async function getDoctorDiagnostic() {
|
|
|
268189
268239
|
const installationType = await getCurrentInstallationType();
|
|
268190
268240
|
let version2;
|
|
268191
268241
|
try {
|
|
268192
|
-
version2 = "0.9.
|
|
268242
|
+
version2 = "0.9.7";
|
|
268193
268243
|
} catch {
|
|
268194
268244
|
version2 = "unknown";
|
|
268195
268245
|
}
|
|
@@ -269683,7 +269733,7 @@ function getInstallationEnv() {
|
|
|
269683
269733
|
return;
|
|
269684
269734
|
}
|
|
269685
269735
|
function getZeroCodeVersion() {
|
|
269686
|
-
return "0.9.
|
|
269736
|
+
return "0.9.7";
|
|
269687
269737
|
}
|
|
269688
269738
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
269689
269739
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -271050,8 +271100,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
271050
271100
|
const maxVersion = await getMaxVersion();
|
|
271051
271101
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
271052
271102
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
271053
|
-
if (gte("0.9.
|
|
271054
|
-
logForDebugging(`Native installer: current version ${"0.9.
|
|
271103
|
+
if (gte("0.9.7", maxVersion)) {
|
|
271104
|
+
logForDebugging(`Native installer: current version ${"0.9.7"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
271055
271105
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
271056
271106
|
latency_ms: Date.now() - startTime2,
|
|
271057
271107
|
max_version: maxVersion,
|
|
@@ -271062,7 +271112,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
271062
271112
|
version2 = maxVersion;
|
|
271063
271113
|
}
|
|
271064
271114
|
}
|
|
271065
|
-
if (!forceReinstall && version2 === "0.9.
|
|
271115
|
+
if (!forceReinstall && version2 === "0.9.7" && await versionIsAvailable(version2) && await isPossibleZeroBinary(executablePath)) {
|
|
271066
271116
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
271067
271117
|
logEvent("tengu_native_update_complete", {
|
|
271068
271118
|
latency_ms: Date.now() - startTime2,
|
|
@@ -372656,8 +372706,77 @@ function getSchemaValidationToolUseResult(tool, input, fallbackMessage) {
|
|
|
372656
372706
|
const override = getSchemaValidationErrorOverride(tool, input);
|
|
372657
372707
|
return `InputValidationError: ${override ?? fallbackMessage ?? ""}`;
|
|
372658
372708
|
}
|
|
372709
|
+
function tryRepairToolInput(tool, input) {
|
|
372710
|
+
const shape = tool.inputSchema.shape;
|
|
372711
|
+
if (!shape)
|
|
372712
|
+
return input;
|
|
372713
|
+
const expectedKeys = new Set(Object.keys(shape));
|
|
372714
|
+
const inputKeys = Object.keys(input);
|
|
372715
|
+
const unrecognizedKeys = inputKeys.filter((k) => !expectedKeys.has(k));
|
|
372716
|
+
if (unrecognizedKeys.length === 0)
|
|
372717
|
+
return input;
|
|
372718
|
+
const missingKeys = [...expectedKeys].filter((k) => !(k in input) || input[k] === undefined);
|
|
372719
|
+
if (missingKeys.length === 0)
|
|
372720
|
+
return input;
|
|
372721
|
+
const repaired = { ...input };
|
|
372722
|
+
let anyRepaired = false;
|
|
372723
|
+
for (const badKey of unrecognizedKeys) {
|
|
372724
|
+
let bestMatch = null;
|
|
372725
|
+
let bestScore = Infinity;
|
|
372726
|
+
for (const expectedKey of missingKeys) {
|
|
372727
|
+
if (badKey === `${expectedKey}_${expectedKey}` || badKey === `${expectedKey}_${expectedKey.split("_").pop()}` || badKey.startsWith(expectedKey + "_") && badKey.replace(expectedKey + "_", "") === expectedKey.split("_").pop()) {
|
|
372728
|
+
bestMatch = expectedKey;
|
|
372729
|
+
bestScore = 0;
|
|
372730
|
+
break;
|
|
372731
|
+
}
|
|
372732
|
+
if (badKey.startsWith(expectedKey) && badKey.length > expectedKey.length) {
|
|
372733
|
+
const suffix = badKey.slice(expectedKey.length + 1);
|
|
372734
|
+
if (expectedKey.endsWith(suffix) || expectedKey.includes(suffix)) {
|
|
372735
|
+
bestMatch = expectedKey;
|
|
372736
|
+
bestScore = 0;
|
|
372737
|
+
break;
|
|
372738
|
+
}
|
|
372739
|
+
}
|
|
372740
|
+
const dist = levenshteinDistance(badKey, expectedKey);
|
|
372741
|
+
if (dist <= 3 && dist < bestScore) {
|
|
372742
|
+
bestMatch = expectedKey;
|
|
372743
|
+
bestScore = dist;
|
|
372744
|
+
}
|
|
372745
|
+
if ((badKey.includes(expectedKey) || expectedKey.includes(badKey)) && bestScore > 1) {
|
|
372746
|
+
bestMatch = expectedKey;
|
|
372747
|
+
bestScore = 1;
|
|
372748
|
+
}
|
|
372749
|
+
}
|
|
372750
|
+
if (bestMatch) {
|
|
372751
|
+
repaired[bestMatch] = repaired[badKey];
|
|
372752
|
+
delete repaired[badKey];
|
|
372753
|
+
anyRepaired = true;
|
|
372754
|
+
const idx = missingKeys.indexOf(bestMatch);
|
|
372755
|
+
if (idx >= 0)
|
|
372756
|
+
missingKeys.splice(idx, 1);
|
|
372757
|
+
logForDebugging(`[ZERO-DEBUG] Tool param auto-repair: "${badKey}" → "${bestMatch}" (tool: ${tool.name})`);
|
|
372758
|
+
}
|
|
372759
|
+
}
|
|
372760
|
+
return anyRepaired ? repaired : input;
|
|
372761
|
+
}
|
|
372762
|
+
function levenshteinDistance(a2, b) {
|
|
372763
|
+
const m = a2.length;
|
|
372764
|
+
const n2 = b.length;
|
|
372765
|
+
const dp = Array.from({ length: m + 1 }, () => Array(n2 + 1).fill(0));
|
|
372766
|
+
for (let i3 = 0;i3 <= m; i3++)
|
|
372767
|
+
dp[i3][0] = i3;
|
|
372768
|
+
for (let j = 0;j <= n2; j++)
|
|
372769
|
+
dp[0][j] = j;
|
|
372770
|
+
for (let i3 = 1;i3 <= m; i3++) {
|
|
372771
|
+
for (let j = 1;j <= n2; j++) {
|
|
372772
|
+
dp[i3][j] = a2[i3 - 1] === b[j - 1] ? dp[i3 - 1][j - 1] : 1 + Math.min(dp[i3 - 1][j], dp[i3][j - 1], dp[i3 - 1][j - 1]);
|
|
372773
|
+
}
|
|
372774
|
+
}
|
|
372775
|
+
return dp[m][n2];
|
|
372776
|
+
}
|
|
372659
372777
|
async function checkPermissionsAndCallTool(tool, toolUseID, input, toolUseContext, canUseTool, assistantMessage, messageId, requestId, mcpServerType, mcpServerBaseUrl, onToolProgress) {
|
|
372660
|
-
const
|
|
372778
|
+
const repairedInput = tryRepairToolInput(tool, input);
|
|
372779
|
+
const parsedInput = tool.inputSchema.safeParse(repairedInput);
|
|
372661
372780
|
if (!parsedInput.success) {
|
|
372662
372781
|
const fallbackErrorContent = formatZodValidationError(tool.name, parsedInput.error);
|
|
372663
372782
|
let errorContent = getSchemaValidationErrorOverride(tool, input) ?? fallbackErrorContent;
|
|
@@ -375725,6 +375844,25 @@ async function* queryLoop(params, consumedCommandUuids) {
|
|
|
375725
375844
|
} catch (error42) {
|
|
375726
375845
|
logError2(error42);
|
|
375727
375846
|
const errorMessage2 = error42 instanceof Error ? error42.message : String(error42);
|
|
375847
|
+
const isIdleTimeout = errorMessage2.includes("idle") && errorMessage2.includes("timeout");
|
|
375848
|
+
const isMaxTokens = errorMessage2.includes("max_tokens") || errorMessage2.includes("max_output_tokens");
|
|
375849
|
+
const isStreamDrop = errorMessage2.includes("stream") || errorMessage2.includes("SSE") || errorMessage2.includes("Connection");
|
|
375850
|
+
logForDebugging(`
|
|
375851
|
+
` + `========================================================================
|
|
375852
|
+
` + `[ZERO-DEBUG] QUERY ENCERROU COM ERRO
|
|
375853
|
+
` + `========================================================================
|
|
375854
|
+
` + `ERRO: ${errorMessage2}
|
|
375855
|
+
` + `TIPO: ${error42 instanceof Error ? error42.constructor.name : typeof error42}
|
|
375856
|
+
` + `MENSAGENS DO ASSISTENTE: ${assistantMessages.length}
|
|
375857
|
+
` + `TOOL USES: ${assistantMessages.flatMap((_) => _.message.content.filter((content) => content.type === "tool_use")).length}
|
|
375858
|
+
` + (isIdleTimeout ? `DIAGNOSTICO: >>> STREAM IDLE TIMEOUT - modelo demorou demais para responder <<<
|
|
375859
|
+
` + `CORRECAO: Aumentar STREAM_IDLE_TIMEOUT_MS ou CLAUDE_STREAM_IDLE_TIMEOUT_MS
|
|
375860
|
+
` : isMaxTokens ? `DIAGNOSTICO: >>> MAX TOKENS ATINGIDO - resposta cortada pelo limite <<<
|
|
375861
|
+
` + `CORRECAO: export CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000
|
|
375862
|
+
` : isStreamDrop ? `DIAGNOSTICO: >>> CONEXAO COM MODELO CAIU - stream interrompido <<<
|
|
375863
|
+
` + `CORRECAO: Verificar estabilidade do vLLM e conexao de rede
|
|
375864
|
+
` : `DIAGNOSTICO: Erro nao mapeado nas causas conhecidas de encerramento silencioso.
|
|
375865
|
+
`) + `========================================================================`, { level: "error" });
|
|
375728
375866
|
logEvent("tengu_query_error", {
|
|
375729
375867
|
assistantMessages: assistantMessages.length,
|
|
375730
375868
|
toolUses: assistantMessages.flatMap((_) => _.message.content.filter((content) => content.type === "tool_use")).length,
|
|
@@ -375844,8 +375982,9 @@ async function* queryLoop(params, consumedCommandUuids) {
|
|
|
375844
375982
|
continue;
|
|
375845
375983
|
}
|
|
375846
375984
|
if (maxOutputTokensRecoveryCount < MAX_OUTPUT_TOKENS_RECOVERY_LIMIT) {
|
|
375985
|
+
logForDebugging(`[ZERO-DEBUG] MAX_TOKENS recovery attempt ${maxOutputTokensRecoveryCount + 1}/${MAX_OUTPUT_TOKENS_RECOVERY_LIMIT}. Enviando nudge para o modelo continuar de onde parou.`);
|
|
375847
375986
|
const recoveryMessage = createUserMessage({
|
|
375848
|
-
content: `Output token limit hit. Resume directly — no apology, no recap of what you were doing. ` + `Pick up mid-thought if that is where the cut happened. Break remaining work into smaller pieces.`,
|
|
375987
|
+
content: `Output token limit hit. Resume directly — no apology, no recap of what you were doing. ` + `Pick up mid-thought if that is where the cut happened. Break remaining work into smaller pieces. Use tool calls (one at a time) rather than generating large blocks of text or code inline.`,
|
|
375849
375988
|
isMeta: true
|
|
375850
375989
|
});
|
|
375851
375990
|
const next2 = {
|
|
@@ -376286,7 +376425,7 @@ function getAnthropicEnvMetadata() {
|
|
|
376286
376425
|
function getBuildAgeMinutes() {
|
|
376287
376426
|
if (false)
|
|
376288
376427
|
;
|
|
376289
|
-
const buildTime = new Date("2026-05-
|
|
376428
|
+
const buildTime = new Date("2026-05-14T00:59:01.796Z").getTime();
|
|
376290
376429
|
if (isNaN(buildTime))
|
|
376291
376430
|
return;
|
|
376292
376431
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -380238,6 +380377,29 @@ async function countMessagesTokensWithAPI(messages, tools) {
|
|
|
380238
380377
|
containsThinking
|
|
380239
380378
|
});
|
|
380240
380379
|
}
|
|
380380
|
+
const provider = getAPIProvider();
|
|
380381
|
+
const openAICompatProviders = new Set([
|
|
380382
|
+
"openai",
|
|
380383
|
+
"github",
|
|
380384
|
+
"codex",
|
|
380385
|
+
"nvidia-nim",
|
|
380386
|
+
"minimax",
|
|
380387
|
+
"mistral",
|
|
380388
|
+
"gemini"
|
|
380389
|
+
]);
|
|
380390
|
+
if (openAICompatProviders.has(provider)) {
|
|
380391
|
+
logForDebugging(`[ZERO-DEBUG] countTokens: provider="${provider}" não suporta countTokens API. Usando estimativa local.`);
|
|
380392
|
+
let total = 0;
|
|
380393
|
+
const bytesPerToken = getBytesPerTokenForModel(model);
|
|
380394
|
+
for (const msg of messages) {
|
|
380395
|
+
const content = typeof msg.content === "string" ? msg.content : Array.isArray(msg.content) ? msg.content.map((b) => typeof b === "string" ? b : JSON.stringify(b)).join("") : "";
|
|
380396
|
+
total += roughTokenCountEstimation(content, bytesPerToken);
|
|
380397
|
+
}
|
|
380398
|
+
if (tools.length > 0) {
|
|
380399
|
+
total += roughTokenCountEstimation(JSON.stringify(tools), bytesPerToken);
|
|
380400
|
+
}
|
|
380401
|
+
return total;
|
|
380402
|
+
}
|
|
380241
380403
|
const anthropic = await getAnthropicClient({
|
|
380242
380404
|
maxRetries: 1,
|
|
380243
380405
|
model,
|
|
@@ -380279,6 +380441,18 @@ function bytesPerTokenForFileType(fileExtension2) {
|
|
|
380279
380441
|
return 4;
|
|
380280
380442
|
}
|
|
380281
380443
|
}
|
|
380444
|
+
function getTokenizerConfig(model) {
|
|
380445
|
+
const lower = model.toLowerCase();
|
|
380446
|
+
for (const config2 of MODEL_TOKENIZER_CONFIGS) {
|
|
380447
|
+
if (lower.includes(config2.modelFamily)) {
|
|
380448
|
+
return config2;
|
|
380449
|
+
}
|
|
380450
|
+
}
|
|
380451
|
+
return { modelFamily: "unknown", bytesPerToken: 4, supportsJson: true, supportsCode: true };
|
|
380452
|
+
}
|
|
380453
|
+
function getBytesPerTokenForModel(model) {
|
|
380454
|
+
return getTokenizerConfig(model).bytesPerToken;
|
|
380455
|
+
}
|
|
380282
380456
|
function roughTokenCountEstimationForFileType(content, fileExtension2) {
|
|
380283
380457
|
return roughTokenCountEstimation(content, bytesPerTokenForFileType(fileExtension2));
|
|
380284
380458
|
}
|
|
@@ -380419,11 +380593,12 @@ async function countTokensWithBedrock({
|
|
|
380419
380593
|
return null;
|
|
380420
380594
|
}
|
|
380421
380595
|
}
|
|
380422
|
-
var TOKEN_COUNT_THINKING_BUDGET = 1024, TOKEN_COUNT_MAX_TOKENS = 2048;
|
|
380596
|
+
var TOKEN_COUNT_THINKING_BUDGET = 1024, TOKEN_COUNT_MAX_TOKENS = 2048, MODEL_TOKENIZER_CONFIGS;
|
|
380423
380597
|
var init_tokenEstimation = __esm(() => {
|
|
380424
380598
|
init_providers();
|
|
380425
380599
|
init_betas();
|
|
380426
380600
|
init_betas2();
|
|
380601
|
+
init_debug();
|
|
380427
380602
|
init_envUtils();
|
|
380428
380603
|
init_log3();
|
|
380429
380604
|
init_messages3();
|
|
@@ -380434,6 +380609,17 @@ var init_tokenEstimation = __esm(() => {
|
|
|
380434
380609
|
init_claude();
|
|
380435
380610
|
init_client6();
|
|
380436
380611
|
init_vcr();
|
|
380612
|
+
MODEL_TOKENIZER_CONFIGS = [
|
|
380613
|
+
{ modelFamily: "claude", bytesPerToken: 3.5, supportsJson: true, supportsCode: true },
|
|
380614
|
+
{ modelFamily: "gpt-4", bytesPerToken: 4, supportsJson: true, supportsCode: true },
|
|
380615
|
+
{ modelFamily: "gpt-3.5", bytesPerToken: 4, supportsJson: true, supportsCode: true },
|
|
380616
|
+
{ modelFamily: "gemini", bytesPerToken: 3.5, supportsJson: true, supportsCode: true },
|
|
380617
|
+
{ modelFamily: "llama", bytesPerToken: 3.8, supportsJson: true, supportsCode: true },
|
|
380618
|
+
{ modelFamily: "deepseek", bytesPerToken: 3.5, supportsJson: true, supportsCode: true },
|
|
380619
|
+
{ modelFamily: "minimax", bytesPerToken: 3.2, supportsJson: true, supportsCode: true },
|
|
380620
|
+
{ modelFamily: "qwen", bytesPerToken: 3.5, supportsJson: true, supportsCode: true },
|
|
380621
|
+
{ modelFamily: "mistral", bytesPerToken: 3.5, supportsJson: true, supportsCode: true }
|
|
380622
|
+
];
|
|
380437
380623
|
});
|
|
380438
380624
|
|
|
380439
380625
|
// src/utils/pdf.ts
|
|
@@ -403722,7 +403908,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
403722
403908
|
const client2 = new Client({
|
|
403723
403909
|
name: "claude-code",
|
|
403724
403910
|
title: "ZeroCLI",
|
|
403725
|
-
version: "0.9.
|
|
403911
|
+
version: "0.9.7",
|
|
403726
403912
|
description: "Anthropic's agentic coding tool",
|
|
403727
403913
|
websiteUrl: PRODUCT_URL
|
|
403728
403914
|
}, {
|
|
@@ -404074,7 +404260,7 @@ var init_client7 = __esm(() => {
|
|
|
404074
404260
|
const client2 = new Client({
|
|
404075
404261
|
name: "claude-code",
|
|
404076
404262
|
title: "ZeroCLI",
|
|
404077
|
-
version: "0.9.
|
|
404263
|
+
version: "0.9.7",
|
|
404078
404264
|
description: "Anthropic's agentic coding tool",
|
|
404079
404265
|
websiteUrl: PRODUCT_URL
|
|
404080
404266
|
}, {
|
|
@@ -406111,7 +406297,18 @@ ${deferredToolList}
|
|
|
406111
406297
|
streamIdleTimer = setTimeout(() => {
|
|
406112
406298
|
streamIdleAborted = true;
|
|
406113
406299
|
streamWatchdogFiredAt = performance.now();
|
|
406114
|
-
logForDebugging(`
|
|
406300
|
+
logForDebugging(`
|
|
406301
|
+
========================================================================
|
|
406302
|
+
[ZERO-DEBUG] ENCERRAMENTO DETECTADO: STREAM WATCHDOG TIMEOUT
|
|
406303
|
+
========================================================================
|
|
406304
|
+
CAUSA: O stream ficou ${STREAM_IDLE_TIMEOUT_MS / 1000}s sem receber chunks do modelo.
|
|
406305
|
+
LIMITE ATUAL: ${STREAM_IDLE_TIMEOUT_MS / 1000}s (configuravel via CLAUDE_STREAM_IDLE_TIMEOUT_MS).
|
|
406306
|
+
MODELO: ${options2.model}
|
|
406307
|
+
EFEITO: Zero abortou o stream e vai tentar fallback para modo nao-streaming.
|
|
406308
|
+
Se o fallback tambem falhar, o processamento encerra silenciosamente.
|
|
406309
|
+
CORRECAO: export CLAUDE_STREAM_IDLE_TIMEOUT_MS=600000 (10 min)
|
|
406310
|
+
export CLAUDE_ENABLE_STREAM_WATCHDOG=1
|
|
406311
|
+
========================================================================`, { level: "error" });
|
|
406115
406312
|
logForDiagnosticsNoPII("error", "cli_streaming_idle_timeout");
|
|
406116
406313
|
logEvent("tengu_streaming_idle_timeout", {
|
|
406117
406314
|
model: options2.model,
|
|
@@ -406404,6 +406601,15 @@ ${deferredToolList}
|
|
|
406404
406601
|
logEvent("tengu_max_tokens_reached", {
|
|
406405
406602
|
max_tokens: maxOutputTokens
|
|
406406
406603
|
});
|
|
406604
|
+
logForDebugging(`
|
|
406605
|
+
========================================================================
|
|
406606
|
+
[ZERO-DEBUG] ENCERRAMENTO DETECTADO: MAX_TOKENS ATINGIDO (Anthropic API)
|
|
406607
|
+
========================================================================
|
|
406608
|
+
CAUSA: O modelo atingiu o limite de ${maxOutputTokens} tokens de saida.
|
|
406609
|
+
EFEITO: A resposta foi cortada. Recovery sera tentado ate 3x.
|
|
406610
|
+
Se recovery falhar, o processamento encerra abruptamente.
|
|
406611
|
+
CORRECAO: export CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000
|
|
406612
|
+
========================================================================`, { level: "error" });
|
|
406407
406613
|
yield createAssistantAPIErrorMessage({
|
|
406408
406614
|
content: `${API_ERROR_MESSAGE_PREFIX}: Zero's response exceeded the ${maxOutputTokens} output token maximum. To configure this behavior, set the CLAUDE_CODE_MAX_OUTPUT_TOKENS environment variable.`,
|
|
406409
406615
|
apiError: "max_output_tokens",
|
|
@@ -414789,7 +414995,7 @@ function Feedback({
|
|
|
414789
414995
|
platform: env2.platform,
|
|
414790
414996
|
gitRepo: envInfo.isGit,
|
|
414791
414997
|
terminal: env2.terminal,
|
|
414792
|
-
version: "0.9.
|
|
414998
|
+
version: "0.9.7",
|
|
414793
414999
|
transcript: normalizeMessagesForAPI(messages),
|
|
414794
415000
|
errors: sanitizedErrors,
|
|
414795
415001
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -414982,7 +415188,7 @@ function Feedback({
|
|
|
414982
415188
|
", ",
|
|
414983
415189
|
env2.terminal,
|
|
414984
415190
|
", v",
|
|
414985
|
-
"0.9.
|
|
415191
|
+
"0.9.7"
|
|
414986
415192
|
]
|
|
414987
415193
|
})
|
|
414988
415194
|
]
|
|
@@ -415090,7 +415296,7 @@ ${sanitizedDescription}
|
|
|
415090
415296
|
` + `**Environment Info**
|
|
415091
415297
|
` + `- Platform: ${env2.platform}
|
|
415092
415298
|
` + `- Terminal: ${env2.terminal}
|
|
415093
|
-
` + `- Version: ${"0.9.
|
|
415299
|
+
` + `- Version: ${"0.9.7"}
|
|
415094
415300
|
` + feedbackIdLine + `
|
|
415095
415301
|
**Errors**
|
|
415096
415302
|
\`\`\`json
|
|
@@ -418243,7 +418449,7 @@ function buildPrimarySection() {
|
|
|
418243
418449
|
});
|
|
418244
418450
|
return [{
|
|
418245
418451
|
label: "Version",
|
|
418246
|
-
value: "0.9.
|
|
418452
|
+
value: "0.9.7"
|
|
418247
418453
|
}, {
|
|
418248
418454
|
label: "Session name",
|
|
418249
418455
|
value: nameValue
|
|
@@ -423013,7 +423219,7 @@ function Config({
|
|
|
423013
423219
|
}
|
|
423014
423220
|
})
|
|
423015
423221
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime181.jsx(ChannelDowngradeDialog, {
|
|
423016
|
-
currentVersion: "0.9.
|
|
423222
|
+
currentVersion: "0.9.7",
|
|
423017
423223
|
onChoice: (choice) => {
|
|
423018
423224
|
setShowSubmenu(null);
|
|
423019
423225
|
setTabsHidden(false);
|
|
@@ -423025,7 +423231,7 @@ function Config({
|
|
|
423025
423231
|
autoUpdatesChannel: "stable"
|
|
423026
423232
|
};
|
|
423027
423233
|
if (choice === "stay") {
|
|
423028
|
-
newSettings.minimumVersion = "0.9.
|
|
423234
|
+
newSettings.minimumVersion = "0.9.7";
|
|
423029
423235
|
}
|
|
423030
423236
|
updateSettingsForSource("userSettings", newSettings);
|
|
423031
423237
|
setSettingsData((prev_27) => ({
|
|
@@ -429966,7 +430172,7 @@ function UpdateScreen({ onDone }) {
|
|
|
429966
430172
|
setState({ type: "dev-build" });
|
|
429967
430173
|
return;
|
|
429968
430174
|
}
|
|
429969
|
-
const currentVersion = "0.9.
|
|
430175
|
+
const currentVersion = "0.9.7";
|
|
429970
430176
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
429971
430177
|
const latestVersion = await getLatestVersion(channel2);
|
|
429972
430178
|
if (!latestVersion) {
|
|
@@ -432077,7 +432283,7 @@ function HelpV2(t0) {
|
|
|
432077
432283
|
let t6;
|
|
432078
432284
|
if ($2[31] !== tabs) {
|
|
432079
432285
|
t6 = /* @__PURE__ */ jsx_runtime211.jsx(Tabs, {
|
|
432080
|
-
title: `ZeroCLI v${"0.9.
|
|
432286
|
+
title: `ZeroCLI v${"0.9.7"}`,
|
|
432081
432287
|
color: "professionalBlue",
|
|
432082
432288
|
defaultTab: "general",
|
|
432083
432289
|
children: tabs
|
|
@@ -456921,7 +457127,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
456921
457127
|
return [];
|
|
456922
457128
|
}
|
|
456923
457129
|
}
|
|
456924
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "0.9.
|
|
457130
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "0.9.7") {
|
|
456925
457131
|
if (process.env.USER_TYPE === "ant") {
|
|
456926
457132
|
const changelog = MACRO.VERSION_CHANGELOG;
|
|
456927
457133
|
if (changelog) {
|
|
@@ -485959,7 +486165,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
485959
486165
|
smapsRollup,
|
|
485960
486166
|
platform: process.platform,
|
|
485961
486167
|
nodeVersion: process.version,
|
|
485962
|
-
ccVersion: "0.9.
|
|
486168
|
+
ccVersion: "0.9.7"
|
|
485963
486169
|
};
|
|
485964
486170
|
}
|
|
485965
486171
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -486546,7 +486752,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
486546
486752
|
var call60 = async () => {
|
|
486547
486753
|
return {
|
|
486548
486754
|
type: "text",
|
|
486549
|
-
value: `${"0.9.
|
|
486755
|
+
value: `${"0.9.7"} (built ${"2026-05-14T00:59:01.796Z"})`
|
|
486550
486756
|
};
|
|
486551
486757
|
}, version2, version_default;
|
|
486552
486758
|
var init_version = __esm(() => {
|
|
@@ -496703,7 +496909,7 @@ function generateHtmlReport(data, insights) {
|
|
|
496703
496909
|
function buildExportData(data, insights, facets) {
|
|
496704
496910
|
let version3;
|
|
496705
496911
|
try {
|
|
496706
|
-
version3 = "0.9.
|
|
496912
|
+
version3 = "0.9.7";
|
|
496707
496913
|
} catch {
|
|
496708
496914
|
version3 = "unknown";
|
|
496709
496915
|
}
|
|
@@ -500899,7 +501105,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
500899
501105
|
init_slowOperations();
|
|
500900
501106
|
init_uuid();
|
|
500901
501107
|
try {
|
|
500902
|
-
VERSION7 = "0.9.
|
|
501108
|
+
VERSION7 = "0.9.7";
|
|
500903
501109
|
} catch {
|
|
500904
501110
|
VERSION7 = "unknown";
|
|
500905
501111
|
}
|
|
@@ -502220,7 +502426,7 @@ var init_filesystem = __esm(() => {
|
|
|
502220
502426
|
});
|
|
502221
502427
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
502222
502428
|
const nonce = randomBytes17(16).toString("hex");
|
|
502223
|
-
return join137(getZeroTempDir(), "bundled-skills", "0.9.
|
|
502429
|
+
return join137(getZeroTempDir(), "bundled-skills", "0.9.7", nonce);
|
|
502224
502430
|
});
|
|
502225
502431
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
502226
502432
|
});
|
|
@@ -513240,7 +513446,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
513240
513446
|
slash_commands: inputs.commands.filter((c6) => c6.userInvocable !== false).map((c6) => c6.name),
|
|
513241
513447
|
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
513242
513448
|
betas: getSdkBetas(),
|
|
513243
|
-
claude_code_version: "0.9.
|
|
513449
|
+
claude_code_version: "0.9.7",
|
|
513244
513450
|
output_style: outputStyle2,
|
|
513245
513451
|
agents: inputs.agents.map((agent2) => agent2.agentType),
|
|
513246
513452
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -528555,7 +528761,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
528555
528761
|
function getSemverPart(version3) {
|
|
528556
528762
|
return `${import_semver12.major(version3, { loose: true })}.${import_semver12.minor(version3, { loose: true })}.${import_semver12.patch(version3, { loose: true })}`;
|
|
528557
528763
|
}
|
|
528558
|
-
function useUpdateNotification(updatedVersion, initialVersion = "0.9.
|
|
528764
|
+
function useUpdateNotification(updatedVersion, initialVersion = "0.9.7") {
|
|
528559
528765
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react226.useState(() => getSemverPart(initialVersion));
|
|
528560
528766
|
if (!updatedVersion) {
|
|
528561
528767
|
return null;
|
|
@@ -528598,7 +528804,7 @@ function AutoUpdater({
|
|
|
528598
528804
|
return;
|
|
528599
528805
|
}
|
|
528600
528806
|
if (false) {}
|
|
528601
|
-
const currentVersion = "0.9.
|
|
528807
|
+
const currentVersion = "0.9.7";
|
|
528602
528808
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
528603
528809
|
let latestVersion = await getLatestVersion(channel2);
|
|
528604
528810
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -528819,12 +529025,12 @@ function NativeAutoUpdater({
|
|
|
528819
529025
|
logEvent("tengu_native_auto_updater_start", {});
|
|
528820
529026
|
try {
|
|
528821
529027
|
const maxVersion = await getMaxVersion();
|
|
528822
|
-
if (maxVersion && gt("0.9.
|
|
529028
|
+
if (maxVersion && gt("0.9.7", maxVersion)) {
|
|
528823
529029
|
const msg = await getMaxVersionMessage();
|
|
528824
529030
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
528825
529031
|
}
|
|
528826
529032
|
const result = await installLatest(channel2);
|
|
528827
|
-
const currentVersion = "0.9.
|
|
529033
|
+
const currentVersion = "0.9.7";
|
|
528828
529034
|
const latencyMs = Date.now() - startTime2;
|
|
528829
529035
|
if (result.lockFailed) {
|
|
528830
529036
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -528966,17 +529172,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
528966
529172
|
const maxVersion = await getMaxVersion();
|
|
528967
529173
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
528968
529174
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
528969
|
-
if (gte("0.9.
|
|
528970
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.9.
|
|
529175
|
+
if (gte("0.9.7", maxVersion)) {
|
|
529176
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.9.7"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
528971
529177
|
setUpdateAvailable(false);
|
|
528972
529178
|
return;
|
|
528973
529179
|
}
|
|
528974
529180
|
latest = maxVersion;
|
|
528975
529181
|
}
|
|
528976
|
-
const hasUpdate = latest && !gte("0.9.
|
|
529182
|
+
const hasUpdate = latest && !gte("0.9.7", latest) && !shouldSkipVersion(latest);
|
|
528977
529183
|
setUpdateAvailable(!!hasUpdate);
|
|
528978
529184
|
if (hasUpdate) {
|
|
528979
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.9.
|
|
529185
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.9.7"} -> ${latest}`);
|
|
528980
529186
|
}
|
|
528981
529187
|
};
|
|
528982
529188
|
$2[0] = t1;
|
|
@@ -529010,7 +529216,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
529010
529216
|
wrap: "truncate",
|
|
529011
529217
|
children: [
|
|
529012
529218
|
"currentVersion: ",
|
|
529013
|
-
"0.9.
|
|
529219
|
+
"0.9.7"
|
|
529014
529220
|
]
|
|
529015
529221
|
});
|
|
529016
529222
|
$2[3] = verbose;
|
|
@@ -538039,7 +538245,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
538039
538245
|
project_dir: getOriginalCwd(),
|
|
538040
538246
|
added_dirs: addedDirs
|
|
538041
538247
|
},
|
|
538042
|
-
version: "0.9.
|
|
538248
|
+
version: "0.9.7",
|
|
538043
538249
|
output_style: {
|
|
538044
538250
|
name: outputStyleName
|
|
538045
538251
|
},
|
|
@@ -562542,7 +562748,7 @@ function WelcomeV2() {
|
|
|
562542
562748
|
dimColor: true,
|
|
562543
562749
|
children: [
|
|
562544
562750
|
"v",
|
|
562545
|
-
"0.9.
|
|
562751
|
+
"0.9.7",
|
|
562546
562752
|
" "
|
|
562547
562753
|
]
|
|
562548
562754
|
})
|
|
@@ -562776,7 +562982,7 @@ function WelcomeV2() {
|
|
|
562776
562982
|
dimColor: true,
|
|
562777
562983
|
children: [
|
|
562778
562984
|
"v",
|
|
562779
|
-
"0.9.
|
|
562985
|
+
"0.9.7",
|
|
562780
562986
|
" "
|
|
562781
562987
|
]
|
|
562782
562988
|
})
|
|
@@ -563023,7 +563229,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
563023
563229
|
dimColor: true,
|
|
563024
563230
|
children: [
|
|
563025
563231
|
"v",
|
|
563026
|
-
"0.9.
|
|
563232
|
+
"0.9.7",
|
|
563027
563233
|
" "
|
|
563028
563234
|
]
|
|
563029
563235
|
});
|
|
@@ -563296,7 +563502,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
563296
563502
|
dimColor: true,
|
|
563297
563503
|
children: [
|
|
563298
563504
|
"v",
|
|
563299
|
-
"0.9.
|
|
563505
|
+
"0.9.7",
|
|
563300
563506
|
" "
|
|
563301
563507
|
]
|
|
563302
563508
|
});
|
|
@@ -564808,7 +565014,7 @@ function completeOnboarding() {
|
|
|
564808
565014
|
saveGlobalConfig((current) => ({
|
|
564809
565015
|
...current,
|
|
564810
565016
|
hasCompletedOnboarding: true,
|
|
564811
|
-
lastOnboardingVersion: "0.9.
|
|
565017
|
+
lastOnboardingVersion: "0.9.7"
|
|
564812
565018
|
}));
|
|
564813
565019
|
}
|
|
564814
565020
|
function showDialog(root2, renderer) {
|
|
@@ -569059,7 +569265,7 @@ function appendToLog(path24, message) {
|
|
|
569059
569265
|
cwd: getFsImplementation().cwd(),
|
|
569060
569266
|
userType: process.env.USER_TYPE,
|
|
569061
569267
|
sessionId: getSessionId(),
|
|
569062
|
-
version: "0.9.
|
|
569268
|
+
version: "0.9.7"
|
|
569063
569269
|
};
|
|
569064
569270
|
getLogWriter(path24).write(messageWithTimestamp);
|
|
569065
569271
|
}
|
|
@@ -569665,7 +569871,7 @@ async function startMCPServer(cwd2, debug, verbose) {
|
|
|
569665
569871
|
setCwd(cwd2);
|
|
569666
569872
|
const server = new Server({
|
|
569667
569873
|
name: "claude/tengu",
|
|
569668
|
-
version: "0.9.
|
|
569874
|
+
version: "0.9.7"
|
|
569669
569875
|
}, {
|
|
569670
569876
|
capabilities: {
|
|
569671
569877
|
tools: {}
|
|
@@ -574304,8 +574510,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
574304
574510
|
}
|
|
574305
574511
|
async function checkEnvLessBridgeMinVersion() {
|
|
574306
574512
|
const cfg = await getEnvLessBridgeConfig();
|
|
574307
|
-
if (cfg.min_version && lt("0.9.
|
|
574308
|
-
return `Your version of ZeroCLI (${"0.9.
|
|
574513
|
+
if (cfg.min_version && lt("0.9.7", cfg.min_version)) {
|
|
574514
|
+
return `Your version of ZeroCLI (${"0.9.7"}) is too old for Remote Control.
|
|
574309
574515
|
Version ${cfg.min_version} or higher is required. Run \`zero update\` to update.`;
|
|
574310
574516
|
}
|
|
574311
574517
|
return null;
|
|
@@ -574780,7 +574986,7 @@ async function initBridgeCore(params) {
|
|
|
574780
574986
|
const rawApi = createBridgeApiClient({
|
|
574781
574987
|
baseUrl,
|
|
574782
574988
|
getAccessToken,
|
|
574783
|
-
runnerVersion: "0.9.
|
|
574989
|
+
runnerVersion: "0.9.7",
|
|
574784
574990
|
onDebug: logForDebugging,
|
|
574785
574991
|
onAuth401,
|
|
574786
574992
|
getTrustedDeviceToken
|
|
@@ -581068,7 +581274,7 @@ __export(exports_update2, {
|
|
|
581068
581274
|
});
|
|
581069
581275
|
async function update2() {
|
|
581070
581276
|
logEvent("tengu_update_check", {});
|
|
581071
|
-
writeToStdout(`Current version: ${"0.9.
|
|
581277
|
+
writeToStdout(`Current version: ${"0.9.7"}
|
|
581072
581278
|
`);
|
|
581073
581279
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
581074
581280
|
writeToStdout(`Checking for updates to ${channel2} version...
|
|
@@ -581143,8 +581349,8 @@ async function update2() {
|
|
|
581143
581349
|
writeToStdout(`Zero is managed by Homebrew.
|
|
581144
581350
|
`);
|
|
581145
581351
|
const latest = await getLatestVersion(channel2);
|
|
581146
|
-
if (latest && !gte("0.9.
|
|
581147
|
-
writeToStdout(`Update available: ${"0.9.
|
|
581352
|
+
if (latest && !gte("0.9.7", latest)) {
|
|
581353
|
+
writeToStdout(`Update available: ${"0.9.7"} → ${latest}
|
|
581148
581354
|
`);
|
|
581149
581355
|
writeToStdout(`
|
|
581150
581356
|
`);
|
|
@@ -581160,8 +581366,8 @@ async function update2() {
|
|
|
581160
581366
|
writeToStdout(`Zero is managed by winget.
|
|
581161
581367
|
`);
|
|
581162
581368
|
const latest = await getLatestVersion(channel2);
|
|
581163
|
-
if (latest && !gte("0.9.
|
|
581164
|
-
writeToStdout(`Update available: ${"0.9.
|
|
581369
|
+
if (latest && !gte("0.9.7", latest)) {
|
|
581370
|
+
writeToStdout(`Update available: ${"0.9.7"} → ${latest}
|
|
581165
581371
|
`);
|
|
581166
581372
|
writeToStdout(`
|
|
581167
581373
|
`);
|
|
@@ -581177,8 +581383,8 @@ async function update2() {
|
|
|
581177
581383
|
writeToStdout(`Zero is managed by apk.
|
|
581178
581384
|
`);
|
|
581179
581385
|
const latest = await getLatestVersion(channel2);
|
|
581180
|
-
if (latest && !gte("0.9.
|
|
581181
|
-
writeToStdout(`Update available: ${"0.9.
|
|
581386
|
+
if (latest && !gte("0.9.7", latest)) {
|
|
581387
|
+
writeToStdout(`Update available: ${"0.9.7"} → ${latest}
|
|
581182
581388
|
`);
|
|
581183
581389
|
writeToStdout(`
|
|
581184
581390
|
`);
|
|
@@ -581243,11 +581449,11 @@ async function update2() {
|
|
|
581243
581449
|
`);
|
|
581244
581450
|
await gracefulShutdown(1);
|
|
581245
581451
|
}
|
|
581246
|
-
if (result.latestVersion === "0.9.
|
|
581247
|
-
writeToStdout(source_default.green(`Zero CLI is up to date (${"0.9.
|
|
581452
|
+
if (result.latestVersion === "0.9.7") {
|
|
581453
|
+
writeToStdout(source_default.green(`Zero CLI is up to date (${"0.9.7"})`) + `
|
|
581248
581454
|
`);
|
|
581249
581455
|
} else {
|
|
581250
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.9.
|
|
581456
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.9.7"} to version ${result.latestVersion}`) + `
|
|
581251
581457
|
`);
|
|
581252
581458
|
await regenerateCompletionCache();
|
|
581253
581459
|
}
|
|
@@ -581307,12 +581513,12 @@ async function update2() {
|
|
|
581307
581513
|
`);
|
|
581308
581514
|
await gracefulShutdown(1);
|
|
581309
581515
|
}
|
|
581310
|
-
if (latestVersion === "0.9.
|
|
581311
|
-
writeToStdout(source_default.green(`Zero CLI is up to date (${"0.9.
|
|
581516
|
+
if (latestVersion === "0.9.7") {
|
|
581517
|
+
writeToStdout(source_default.green(`Zero CLI is up to date (${"0.9.7"})`) + `
|
|
581312
581518
|
`);
|
|
581313
581519
|
await gracefulShutdown(0);
|
|
581314
581520
|
}
|
|
581315
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"0.9.
|
|
581521
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"0.9.7"})
|
|
581316
581522
|
`);
|
|
581317
581523
|
writeToStdout(`Installing update...
|
|
581318
581524
|
`);
|
|
@@ -581357,7 +581563,7 @@ async function update2() {
|
|
|
581357
581563
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
581358
581564
|
switch (status2) {
|
|
581359
581565
|
case "success":
|
|
581360
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.9.
|
|
581566
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.9.7"} to version ${latestVersion}`) + `
|
|
581361
581567
|
`);
|
|
581362
581568
|
await regenerateCompletionCache();
|
|
581363
581569
|
break;
|
|
@@ -582658,7 +582864,7 @@ ${customInstructions}` : customInstructions;
|
|
|
582658
582864
|
}
|
|
582659
582865
|
}
|
|
582660
582866
|
logForDiagnosticsNoPII("info", "started", {
|
|
582661
|
-
version: "0.9.
|
|
582867
|
+
version: "0.9.7",
|
|
582662
582868
|
is_native_binary: isInBundledMode()
|
|
582663
582869
|
});
|
|
582664
582870
|
registerCleanup(async () => {
|
|
@@ -583541,7 +583747,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
583541
583747
|
pendingHookMessages
|
|
583542
583748
|
}, renderAndRun);
|
|
583543
583749
|
}
|
|
583544
|
-
}).version("0.9.
|
|
583750
|
+
}).version("0.9.7", "-v, --version", "Output the version number");
|
|
583545
583751
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
583546
583752
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
583547
583753
|
if (canUserConfigureAdvisor()) {
|
|
@@ -584207,7 +584413,7 @@ if (false) {}
|
|
|
584207
584413
|
async function main2() {
|
|
584208
584414
|
const args = process.argv.slice(2);
|
|
584209
584415
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
584210
|
-
console.log(`${"0.9.
|
|
584416
|
+
console.log(`${"0.9.7"} (ZeroCLI)`);
|
|
584211
584417
|
return;
|
|
584212
584418
|
}
|
|
584213
584419
|
if (args.includes("--provider")) {
|
|
@@ -584349,4 +584555,4 @@ async function main2() {
|
|
|
584349
584555
|
}
|
|
584350
584556
|
main2();
|
|
584351
584557
|
|
|
584352
|
-
//# debugId=
|
|
584558
|
+
//# debugId=B6F3EC808063D21764756E2164756E21
|