zcode-app-cli 3.15.3-35 → 3.15.3-36
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/bin/zcode.js
CHANGED
|
@@ -1936,6 +1936,7 @@ async function main(args) {
|
|
|
1936
1936
|
process.once("SIGINT", onPluginSigint);
|
|
1937
1937
|
process.once("SIGTERM", onPluginSigterm);
|
|
1938
1938
|
if (process.platform !== "win32") process.once("SIGHUP", onPluginSighup);
|
|
1939
|
+
const builtinProviderWarnings = /* @__PURE__ */ new Set();
|
|
1939
1940
|
let pluginCommand;
|
|
1940
1941
|
try {
|
|
1941
1942
|
pluginCommand = await runPluginCommand(args, {
|
|
@@ -1943,7 +1944,11 @@ async function main(args) {
|
|
|
1943
1944
|
method,
|
|
1944
1945
|
params,
|
|
1945
1946
|
onStderr: (stderr) => {
|
|
1946
|
-
for (const line of stderr.split(/\r?\n/u))
|
|
1947
|
+
for (const line of stderr.split(/\r?\n/u)) {
|
|
1948
|
+
if (!line.startsWith("ZCode Built-in: ignoring unavailable ZCODE_BUILTIN_PROVIDER_CONFIG_FILE ") || builtinProviderWarnings.has(line)) continue;
|
|
1949
|
+
builtinProviderWarnings.add(line);
|
|
1950
|
+
process.stderr.write(`${line}\n`);
|
|
1951
|
+
}
|
|
1947
1952
|
},
|
|
1948
1953
|
signal: signal ?? pluginAbortController.signal,
|
|
1949
1954
|
transport: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcode-app-cli",
|
|
3
|
-
"version": "3.15.3-
|
|
3
|
+
"version": "3.15.3-36",
|
|
4
4
|
"description": "Unofficial terminal client for the ZCode agent runtime",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"test:node": "node --test test/node/*.test.cjs",
|
|
73
73
|
"test:tui": "bun run test:tui:component && bun run test:tui:e2e",
|
|
74
74
|
"test:tui:component": "bun test test/tui/scenario-http.test.ts test/tui/scenario-runtime.test.ts test/tui/scenario-shell.test.ts test/tui/scenario-workspace.test.ts test/tui/terminal-screen.test.ts",
|
|
75
|
-
"test:tui:e2e": "bun test test/tui/allowlisted-shell.test.ts test/tui/dynamic-workflows.test.ts test/tui/http-mock.test.ts test/tui/input-actions.test.ts test/tui/model-resume.test.ts test/tui/permission-request-queue.test.ts test/tui/run-scenario.test.ts test/tui/runtime-refresh.test.ts test/tui/session-rename.test.ts test/tui/terminal-session.test.ts test/tui/write-and-diff.test.ts",
|
|
75
|
+
"test:tui:e2e": "bun test test/tui/allowlisted-shell.test.ts test/tui/dynamic-workflows.test.ts test/tui/http-mock.test.ts test/tui/input-actions.test.ts test/tui/model-resume.test.ts test/tui/permission-request-queue.test.ts test/tui/run-scenario.test.ts test/tui/runtime-refresh.test.ts test/tui/session-rename.test.ts test/tui/startup.test.ts test/tui/terminal-session.test.ts test/tui/write-and-diff.test.ts",
|
|
76
76
|
"test:tui:host": "bun test test/tui/scenario-mountx.test.ts",
|
|
77
77
|
"test:tui:manual": "bun scripts/tui-scenario.ts --manual",
|
|
78
78
|
"test:tui-scenario": "bun scripts/tui-scenario.ts",
|
package/vendor/extraction.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"appVersion": "3.15.3",
|
|
3
3
|
"cliVersion": "0.16.9",
|
|
4
|
-
"extractedAt": "2026-10-
|
|
4
|
+
"extractedAt": "2026-10-16T01:44:21.858Z",
|
|
5
5
|
"sha512": "9RigUj20tjuaskzBt2sgWLtIuUaIET67x5joShRIgwLlbFcO/oWt1eemrlLn5ZskXUMzcUHtUTCKU8+mHF7kQQ==",
|
|
6
6
|
"source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.15.3/linux-x64/ZCode-3.15.3-linux-x64.deb",
|
|
7
7
|
"runtimeCapabilities": {
|
|
@@ -394,6 +394,80 @@ async function missingCodingPlanKey(options = {}) {
|
|
|
394
394
|
return message(providerId);
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
|
+
//#region packages/zcode-tui/src/stream-error-guard.ts
|
|
398
|
+
function watchStreamErrors(sources, onError) {
|
|
399
|
+
const uniqueSources = [...new Set(sources)];
|
|
400
|
+
for (const source of uniqueSources) source.on("error", onError);
|
|
401
|
+
let active = true;
|
|
402
|
+
return () => {
|
|
403
|
+
if (!active) return;
|
|
404
|
+
active = false;
|
|
405
|
+
for (const source of uniqueSources) source.off("error", onError);
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region packages/zcode-tui/src/startup.ts
|
|
410
|
+
async function loadTuiStartupOptions(options) {
|
|
411
|
+
const loadStartupOptions = options.loadStartupOptions;
|
|
412
|
+
if (!loadStartupOptions) return options;
|
|
413
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) throw new Error("ZCode TUI requires an interactive terminal.");
|
|
414
|
+
const ui = new TuiMainScreen(new ProcessTerminal(), true);
|
|
415
|
+
const chinese = options.locale?.startsWith("zh");
|
|
416
|
+
ui.addChild(new Text(chinese ? "正在启动 ZCode…" : "Starting ZCode…", 1, 0));
|
|
417
|
+
ui.addChild(new Text(chinese ? "按 Ctrl+C 取消" : "Press Ctrl+C to cancel", 1, 0));
|
|
418
|
+
let cancelled = false;
|
|
419
|
+
let resolveCancelled;
|
|
420
|
+
const cancellation = new Promise((resolve) => {
|
|
421
|
+
resolveCancelled = () => resolve(void 0);
|
|
422
|
+
});
|
|
423
|
+
const cancel = (exitCode) => {
|
|
424
|
+
if (cancelled) return;
|
|
425
|
+
cancelled = true;
|
|
426
|
+
process.exitCode = exitCode;
|
|
427
|
+
resolveCancelled();
|
|
428
|
+
};
|
|
429
|
+
const onSigint = () => cancel(128 + constants$1.signals.SIGINT);
|
|
430
|
+
const onSigterm = () => cancel(128 + constants$1.signals.SIGTERM);
|
|
431
|
+
const onSighup = () => cancel(128 + constants$1.signals.SIGHUP);
|
|
432
|
+
ui.addInputListener((data) => {
|
|
433
|
+
if (!isKeyRelease(data) && matchesKey(data, "ctrl+c")) onSigint();
|
|
434
|
+
return { consume: true };
|
|
435
|
+
});
|
|
436
|
+
const removeStreamErrorGuards = watchStreamErrors([process.stdout, process.stderr], () => cancel(1));
|
|
437
|
+
process.once("SIGINT", onSigint);
|
|
438
|
+
process.once("SIGTERM", onSigterm);
|
|
439
|
+
if (process.platform !== "win32") process.once("SIGHUP", onSighup);
|
|
440
|
+
try {
|
|
441
|
+
ui.start();
|
|
442
|
+
ui.renderNow();
|
|
443
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
444
|
+
if (cancelled) return void 0;
|
|
445
|
+
return await Promise.race([Promise.resolve().then(async () => {
|
|
446
|
+
if (cancelled) return void 0;
|
|
447
|
+
const startup = await loadStartupOptions();
|
|
448
|
+
return cancelled ? void 0 : {
|
|
449
|
+
...options,
|
|
450
|
+
...startup
|
|
451
|
+
};
|
|
452
|
+
}), cancellation]);
|
|
453
|
+
} finally {
|
|
454
|
+
process.off("SIGINT", onSigint);
|
|
455
|
+
process.off("SIGTERM", onSigterm);
|
|
456
|
+
if (process.platform !== "win32") process.off("SIGHUP", onSighup);
|
|
457
|
+
try {
|
|
458
|
+
ui.clear();
|
|
459
|
+
ui.renderNow();
|
|
460
|
+
} finally {
|
|
461
|
+
try {
|
|
462
|
+
ui.stop();
|
|
463
|
+
} finally {
|
|
464
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
465
|
+
removeStreamErrorGuards();
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
//#endregion
|
|
397
471
|
//#region packages/zcode-tui/src/prompt-preflight.ts
|
|
398
472
|
/** Preserve rejected input without replacing a draft typed during validation. */
|
|
399
473
|
async function preflightSubmission(options) {
|
|
@@ -162361,18 +162435,6 @@ var TurnNotifier = class {
|
|
|
162361
162435
|
}
|
|
162362
162436
|
};
|
|
162363
162437
|
//#endregion
|
|
162364
|
-
//#region packages/zcode-tui/src/stream-error-guard.ts
|
|
162365
|
-
function watchStreamErrors(sources, onError) {
|
|
162366
|
-
const uniqueSources = [...new Set(sources)];
|
|
162367
|
-
for (const source of uniqueSources) source.on("error", onError);
|
|
162368
|
-
let active = true;
|
|
162369
|
-
return () => {
|
|
162370
|
-
if (!active) return;
|
|
162371
|
-
active = false;
|
|
162372
|
-
for (const source of uniqueSources) source.off("error", onError);
|
|
162373
|
-
};
|
|
162374
|
-
}
|
|
162375
|
-
//#endregion
|
|
162376
162438
|
//#region packages/zcode-tui/src/tui-mode.ts
|
|
162377
162439
|
function record$1(value) {
|
|
162378
162440
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
@@ -171393,7 +171455,8 @@ var ZCodeTui = class {
|
|
|
171393
171455
|
};
|
|
171394
171456
|
async function runTui(options) {
|
|
171395
171457
|
suppressTuiAiSdkWarnings();
|
|
171396
|
-
await
|
|
171458
|
+
const readyOptions = await loadTuiStartupOptions(options);
|
|
171459
|
+
if (readyOptions) await new ZCodeTui(readyOptions).run();
|
|
171397
171460
|
}
|
|
171398
171461
|
//#endregion
|
|
171399
171462
|
export { loginFailureDiagnostic, runTui, shouldSuspendForLoginCommand, shouldUseNoBrowserForLogin, suppressTuiAiSdkWarnings, suspendedZaiLoginCommand };
|