zcode-app-cli 3.16.2-38 → 3.16.3-39

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.
Files changed (33) hide show
  1. package/LICENSES/README.md +1 -1
  2. package/README.md +8 -2
  3. package/bin/zcode.js +8 -1
  4. package/docs/CONFIGURATION.md +1 -1
  5. package/docs/CONFIGURATION.zh-CN.md +1 -1
  6. package/docs/THIRD_PARTY_CONTENT.md +2 -2
  7. package/package.json +2 -2
  8. package/vendor/cli-config.cjs +21 -0
  9. package/vendor/extraction.json +9 -4
  10. package/vendor/node_modules/@zcode/tui/dist/index.js +19 -3
  11. package/vendor/packages/documents-plugin/.zcode-plugin/plugin.json +3 -2
  12. package/vendor/packages/documents-plugin/dist/server.mjs +201 -152
  13. package/vendor/packages/documents-plugin/dist/ui/bundle-0.txt +1 -1
  14. package/vendor/packages/documents-plugin/dist/ui/panel.html +1 -1
  15. package/vendor/packages/documents-plugin/package.json +1 -1
  16. package/vendor/packages/node-repl-host/dist/mcp/server.js +1 -1
  17. package/vendor/packages/pdf-plugin/.zcode-plugin/plugin.json +3 -2
  18. package/vendor/packages/pdf-plugin/dist/server.mjs +201 -152
  19. package/vendor/packages/pdf-plugin/dist/ui/bundle-0.txt +1 -1
  20. package/vendor/packages/pdf-plugin/dist/ui/panel.html +1 -1
  21. package/vendor/packages/pdf-plugin/package.json +1 -1
  22. package/vendor/packages/presentations-plugin/.zcode-plugin/plugin.json +3 -2
  23. package/vendor/packages/presentations-plugin/dist/server.mjs +201 -152
  24. package/vendor/packages/presentations-plugin/dist/ui/bundle-0.txt +1 -1
  25. package/vendor/packages/presentations-plugin/dist/ui/panel.html +1 -1
  26. package/vendor/packages/presentations-plugin/package.json +1 -1
  27. package/vendor/packages/spreadsheets-plugin/.zcode-plugin/plugin.json +3 -2
  28. package/vendor/packages/spreadsheets-plugin/dist/server.mjs +201 -152
  29. package/vendor/packages/spreadsheets-plugin/dist/ui/bundle-0.txt +1 -1
  30. package/vendor/packages/spreadsheets-plugin/dist/ui/panel.html +1 -1
  31. package/vendor/packages/spreadsheets-plugin/package.json +1 -1
  32. package/vendor/zcode.cjs +1033 -1031
  33. package/zcode-runtime.lock.json +3 -3
@@ -23,7 +23,7 @@ their upstream originals byte for byte.
23
23
  revision. It is copied in its original language.
24
24
 
25
25
  The public source revision declares version 3.14.0. It is distinct from the
26
- Desktop 3.16.2 artifact pinned by this project's runtime lock. These notices
26
+ Desktop 3.16.3 artifact pinned by this project's runtime lock. These notices
27
27
  preserve upstream attribution; they are not a claim that this CLI was built
28
28
  from that exact commit. The third-party inventory covers multiple upstream
29
29
  distributions and may list components absent from our npm package.
package/README.md CHANGED
@@ -140,8 +140,8 @@ multi-line editor; slash-command, unified `@` workspace/Plugin references and
140
140
  session events; `/mode`, `/model`, `/resume`, `/plugins` and other upstream
141
141
  slash commands; searchable model and reasoning-effort selectors, plus MCP and
142
142
  workflow panels; status-bar-only Shift+Tab mode cycling
143
- (`build` → `edit` → `guarded` → `yolo`), independent `/plan` toggling with an input-border indicator, Ctrl+N model and empty-prompt Tab effort
144
- cycling; structured session-goal status in the right side of the turn footer;
143
+ (`build` → `edit` → `guarded` → `yolo`), independent `/plan` toggling with an input-border indicator, Ctrl+N model and Ctrl+T effort
144
+ cycling (Tab also cycles effort on an empty prompt); structured session-goal status in the right side of the turn footer;
145
145
  animated active-turn timer with a static `ZCODE_TUI_REDUCED_MOTION=1`
146
146
  fallback; responsive context-remaining and session-token metrics.
147
147
 
@@ -322,6 +322,12 @@ picker to return to input selection, then `Esc` again to close rewind.
322
322
  /cls clear the visible transcript only
323
323
  ```
324
324
 
325
+ New sessions are saved when you submit their first input or explicitly rename them.
326
+ Exiting an untouched session does not save it or print a resume command. Renaming
327
+ an empty session saves it immediately, including its custom title, so it can be
328
+ resumed before its first turn. Resume commands are shown only for saved sessions;
329
+ an invalid resume target is rejected without replacing the current session.
330
+
325
331
  `/cls` clears what the TUI displays without touching the session. The
326
332
  runtime's own `/clear` is an alias of `/new` and starts a fresh session, so it
327
333
  is forwarded to the runtime unchanged.
package/bin/zcode.js CHANGED
@@ -1776,6 +1776,12 @@ async function waitForChild(child, onError = (error) => console.error("Error: "
1776
1776
  });
1777
1777
  }
1778
1778
  function appendTuiRuntimeDiagnostic(chunk, state) {
1779
+ const lines = `${state.pendingLine ?? ""}${chunk.toString()}`.split(/\r?\n/u);
1780
+ state.pendingLine = lines.pop()?.slice(-1024);
1781
+ for (const line of lines) {
1782
+ const missing = /^Error: Session not found: ([A-Za-z0-9_-]{1,512})$/u.exec(line);
1783
+ if (missing) state.sessionError = `Session not found: ${missing[1]}`;
1784
+ }
1779
1785
  if (state.bytes >= tuiRuntimeLogLimitBytes) return;
1780
1786
  const text = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
1781
1787
  try {
@@ -1805,7 +1811,8 @@ function appendTuiRuntimeDiagnostic(chunk, state) {
1805
1811
  }
1806
1812
  }
1807
1813
  function tuiRuntimeFailureMessage(code, state) {
1808
- return `Error: ZCode runtime exited with status ${code}.${state.path && !state.writeFailed ? ` Diagnostics: ${state.path}` : " Runtime diagnostics could not be written."}\n`;
1814
+ const diagnostic = state.path && !state.writeFailed ? ` Diagnostics: ${state.path}` : " Runtime diagnostics could not be written.";
1815
+ return `Error: ${state.sessionError ?? `ZCode runtime exited with status ${code}`}.${diagnostic}\n`;
1809
1816
  }
1810
1817
  async function runRuntime(node, args, extraEnv = {}) {
1811
1818
  const tuiInvocation = isTuiRuntimeInvocation(args);
@@ -200,7 +200,7 @@ Plugin controls remain under `plugins`, hook declarations under
200
200
  These paths distinguish the packaged CLI from the upstream application. The
201
201
  source references below are pinned to upstream
202
202
  [`29628c9` / `v3.14.3`](https://github.com/zai-org/ZCode/tree/29628c9acdb81b703bbd4080c207a0e7ce5e276e).
203
- This package's runtime lock selects the separate Desktop 3.16.2 artifact; the
203
+ This package's runtime lock selects the separate Desktop 3.16.3 artifact; the
204
204
  public source snapshot is not an assertion of that artifact's build commit.
205
205
  The configuration boundaries were rechecked on 2026-10-20 against
206
206
  [`0a1fc56` / `0.17.0`](https://github.com/zai-org/ZCode/tree/0a1fc56d279fd1001f78387bd81aec1c26767411).
@@ -173,7 +173,7 @@ MCP 服务器按名称合并。当前 runtime 中,**同名服务器的用户
173
173
 
174
174
  下面区分本发行包与上游应用。源码引用固定在上游
175
175
  [`29628c9` / `v3.14.3`](https://github.com/zai-org/ZCode/tree/29628c9acdb81b703bbd4080c207a0e7ce5e276e)。
176
- 本项目 runtime lock 选择的是独立发布的 Desktop 3.16.2 产物,不能据此认定该产物
176
+ 本项目 runtime lock 选择的是独立发布的 Desktop 3.16.3 产物,不能据此认定该产物
177
177
  由这个公开源码提交构建。
178
178
  2026-10-20 已针对
179
179
  [`0a1fc56` / `0.17.0`](https://github.com/zai-org/ZCode/tree/0a1fc56d279fd1001f78387bd81aec1c26767411)
@@ -18,7 +18,7 @@ compatibility patches applied.
18
18
 
19
19
  The [upstream notices shipped here](../LICENSES/README.md) come from a separately
20
20
  pinned public source revision. That revision declares version 3.14.0; the current
21
- runtime lock selects Desktop 3.16.2. The notices are a conservative upstream
21
+ runtime lock selects Desktop 3.16.3. The notices are a conservative upstream
22
22
  inventory, not proof that the extracted binary was built from that exact commit
23
23
  or that every listed component is included in this npm package. Review artifact
24
24
  contents and applicable terms when updating the runtime.
@@ -41,7 +41,7 @@ patches; the patch report is in `vendor/extraction.json`.
41
41
 
42
42
  ## Plugin declarations
43
43
 
44
- These are the declarations observed in the Desktop 3.16.2 packages, not a
44
+ These are the declarations observed in the Desktop 3.16.3 packages, not a
45
45
  replacement for nested dependency or asset licenses:
46
46
 
47
47
  | Package directory | Manifest declaration |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcode-app-cli",
3
- "version": "3.16.2-38",
3
+ "version": "3.16.3-39",
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/model-status.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",
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/model-status.test.ts test/tui/permission-request-queue.test.ts test/tui/run-scenario.test.ts test/tui/runtime-refresh.test.ts test/tui/session-lifecycle.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",
@@ -98,6 +98,24 @@ function assertSessionModelReady(options) {
98
98
  if (state.issue) throw new Error(`${state.issue.message} Resume interactively with zcode --resume ${options.sessionId} and use /model to choose a replacement. No model request was sent.`);
99
99
  }
100
100
  //#endregion
101
+ //#region src/runtime-session-lifecycle.ts
102
+ async function assertResumableSession(store, sessionId) {
103
+ const session = await store.getSession(sessionId);
104
+ if (!session || session.time?.deleted !== void 0) throw new Error(`Session not found: ${sessionId}`);
105
+ }
106
+ async function ensureSessionForTitle(runtime, options) {
107
+ if (!runtime.sessionId || !runtime.sessionStore || !runtime.ensureSessionPersistedForExternalActivity) throw new Error("Session persistence is unavailable in this runtime.");
108
+ await runtime.ensureSessionPersistedForExternalActivity(options.title, { traceContext: options.traceContext ?? runtime.rootTraceContext });
109
+ await assertResumableSession(runtime.sessionStore, runtime.sessionId);
110
+ }
111
+ async function readSessionResumeTarget(app) {
112
+ const sessionId = app.sessionId ?? app.runtime?.sessionId;
113
+ const store = app.sessionStore ?? app.runtime?.sessionStore;
114
+ if (!sessionId || !store) return void 0;
115
+ const session = await store.getSession(sessionId);
116
+ return session && session.time?.deleted === void 0 ? sessionId : void 0;
117
+ }
118
+ //#endregion
101
119
  //#region src/runtime-tui-bridge.ts
102
120
  const maximumTaskMessageLength = 2e4;
103
121
  const maximumTaskSummaryLength = 200;
@@ -1077,9 +1095,11 @@ async function migrateLegacyProviders(options) {
1077
1095
  }
1078
1096
  //#endregion
1079
1097
  exports.appServerRegistryOptions = appServerRegistryOptions;
1098
+ exports.assertResumableSession = assertResumableSession;
1080
1099
  exports.assertSessionModelReady = assertSessionModelReady;
1081
1100
  exports.browserOpenCommand = browserOpenCommand;
1082
1101
  exports.createTuiWorkflowManagement = createTuiWorkflowManagement;
1102
+ exports.ensureSessionForTitle = ensureSessionForTitle;
1083
1103
  exports.exchangeBigmodelOAuthCode = exchangeBigmodelOAuthCode;
1084
1104
  exports.inspectRuntimeConfiguration = inspectRuntimeConfiguration;
1085
1105
  exports.installSqliteWriteRecovery = installSqliteWriteRecovery;
@@ -1088,6 +1108,7 @@ exports.migrateLegacyProviders = migrateLegacyProviders;
1088
1108
  exports.providerMigrationNeeded = providerMigrationNeeded;
1089
1109
  exports.pruneSqliteUsage = pruneSqliteUsage;
1090
1110
  exports.readSessionModelState = readSessionModelState;
1111
+ exports.readSessionResumeTarget = readSessionResumeTarget;
1091
1112
  exports.readTuiRuntimeProjection = readTuiRuntimeProjection;
1092
1113
  exports.restoreTuiBackgroundTasks = restoreTuiBackgroundTasks;
1093
1114
  exports.sendTuiBackgroundTaskMessage = sendTuiBackgroundTaskMessage;
@@ -1,9 +1,9 @@
1
1
  {
2
- "appVersion": "3.16.2",
2
+ "appVersion": "3.16.3",
3
3
  "cliVersion": "0.17.0",
4
- "extractedAt": "2026-10-20T10:56:09.287Z",
5
- "sha512": "gWA8sQKm/3R885GyUjacpo6hkIfoJ5WwetJMKzac+nXfFmMhHSmeVI2OzR2lOOc/h+O8EhylqecWpm4yWcpBSA==",
6
- "source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.16.2/linux-x64/ZCode-3.16.2-linux-x64.deb",
4
+ "extractedAt": "2026-10-24T00:12:33.970Z",
5
+ "sha512": "WvOb2B4NnRdNFIAKuMJ+S0vCT+uQfVfpiFPLsraG8KQCHTXQRsvC58OkTz79snfbmmCkAetXUi/RJ39bKG+T8g==",
6
+ "source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.16.3/linux-x64/ZCode-3.16.3-linux-x64.deb",
7
7
  "runtimeCapabilities": {
8
8
  "schemaVersion": 1,
9
9
  "cli": {
@@ -147,6 +147,11 @@
147
147
  "requirement": "required",
148
148
  "status": "applied"
149
149
  },
150
+ {
151
+ "id": "session-lifecycle",
152
+ "requirement": "required",
153
+ "status": "applied"
154
+ },
150
155
  {
151
156
  "id": "official-mcp-availability",
152
157
  "requirement": "optional",
@@ -167548,6 +167548,10 @@ var ZCodeTui = class {
167548
167548
  this.switchModel();
167549
167549
  return { consume: true };
167550
167550
  }
167551
+ if (matchesKey(data, "ctrl+t")) {
167552
+ this.switchEffort();
167553
+ return { consume: true };
167554
+ }
167551
167555
  if (matchesKey(data, "tab") && (this.turnAbortController || this.inputQueue.paused) && Boolean(this.editor.getText().trim()) && !this.editor.isShowingAutocomplete()) {
167552
167556
  this.queueCurrentEditorInput();
167553
167557
  return { consume: true };
@@ -171441,6 +171445,18 @@ var ZCodeTui = class {
171441
171445
  if (timeout) clearTimeout(timeout);
171442
171446
  if (usage !== void 0) this.applySessionUsage(usage);
171443
171447
  }
171448
+ async readExitResumeTarget() {
171449
+ const readSessionResumeTarget = this.options.readSessionResumeTarget;
171450
+ if (!readSessionResumeTarget) return void 0;
171451
+ let timeout;
171452
+ try {
171453
+ return await Promise.race([Promise.resolve().then(() => readSessionResumeTarget()).catch(() => void 0), new Promise((resolve) => {
171454
+ timeout = setTimeout(() => resolve(void 0), exitUsageQueryTimeoutMs);
171455
+ })]);
171456
+ } finally {
171457
+ if (timeout) clearTimeout(timeout);
171458
+ }
171459
+ }
171444
171460
  finishTurn(unfinishedToolState = "interrupted") {
171445
171461
  const notification = this.pendingTurnNotification;
171446
171462
  const notificationDetail = notification === "completed" ? this.turnAssistantText : this.pendingTurnNotificationDetail;
@@ -171454,7 +171470,7 @@ var ZCodeTui = class {
171454
171470
  if (unfinishedToolState === "cancelled") {
171455
171471
  this.turnWork.cancel();
171456
171472
  this.settleTurnTiming();
171457
- } else if (!this.turnWork.finishForeground(Boolean(this.options.readRuntimeProjection))) this.settleTurnTiming();
171473
+ } else if (!this.turnWork.finishForeground(Boolean(this.options.readRuntimeProjection) && unfinishedToolState !== "failed")) this.settleTurnTiming();
171458
171474
  this.activity = void 0;
171459
171475
  this.refreshSessionTerminalTitle();
171460
171476
  this.updateTurnStatus();
@@ -171517,11 +171533,11 @@ var ZCodeTui = class {
171517
171533
  }
171518
171534
  async finishStop(elapsedMilliseconds) {
171519
171535
  try {
171520
- await this.refreshExitUsage();
171536
+ const [, resumeTarget] = await Promise.all([this.refreshExitUsage(), this.readExitResumeTarget()]);
171521
171537
  const summary = buildExitSummary({
171522
171538
  elapsedMilliseconds,
171523
171539
  metrics: this.sessionMetrics,
171524
- sessionId: this.sessionId ?? this.runtimeProjection?.sessionId,
171540
+ sessionId: resumeTarget,
171525
171541
  width: this.ui.terminal.columns
171526
171542
  });
171527
171543
  const lines = [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "documents",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "DOCX document production skills and a Word viewer panel, published as an official ZCode plugin.",
5
5
  "description_i18n": {
6
6
  "en": "Word document production skills for DOCX: create, edit, format, review, and comment. View Word files in a side panel: reference passages in chat, and the agent can read, search, point at and capture them.",
@@ -20,7 +20,8 @@
20
20
  "cwd": "${ZCODE_PROJECT_DIR}",
21
21
  "env": {
22
22
  "ZCODE_WORKSPACE_ROOT": "${ZCODE_PROJECT_DIR}"
23
- }
23
+ },
24
+ "isolation": "workspace"
24
25
  }
25
26
  },
26
27
  "ui": {